@visactor/vrender-components 0.17.19 → 0.18.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/cjs/axis/base.js +15 -19
  2. package/cjs/axis/base.js.map +1 -1
  3. package/cjs/axis/line.js +52 -59
  4. package/cjs/axis/line.js.map +1 -1
  5. package/cjs/axis/overlap/auto-hide.d.ts +0 -1
  6. package/cjs/axis/overlap/auto-hide.js +2 -10
  7. package/cjs/axis/overlap/auto-hide.js.map +1 -1
  8. package/cjs/axis/overlap/auto-limit.d.ts +0 -1
  9. package/cjs/axis/overlap/auto-limit.js +3 -5
  10. package/cjs/axis/overlap/auto-limit.js.map +1 -1
  11. package/cjs/axis/type.d.ts +0 -1
  12. package/cjs/axis/type.js.map +1 -1
  13. package/cjs/brush/brush.js +4 -4
  14. package/cjs/brush/brush.js.map +1 -1
  15. package/cjs/data-zoom/data-zoom.d.ts +1 -5
  16. package/cjs/data-zoom/data-zoom.js +78 -136
  17. package/cjs/data-zoom/data-zoom.js.map +1 -1
  18. package/cjs/index.d.ts +1 -2
  19. package/cjs/index.js +2 -3
  20. package/cjs/index.js.map +1 -1
  21. package/cjs/indicator/indicator.d.ts +1 -3
  22. package/cjs/indicator/indicator.js +15 -54
  23. package/cjs/indicator/indicator.js.map +1 -1
  24. package/cjs/indicator/type.d.ts +0 -1
  25. package/cjs/indicator/type.js.map +1 -1
  26. package/cjs/label/arc.d.ts +2 -2
  27. package/cjs/label/arc.js +35 -38
  28. package/cjs/label/arc.js.map +1 -1
  29. package/cjs/label/base.d.ts +8 -6
  30. package/cjs/label/base.js +52 -88
  31. package/cjs/label/base.js.map +1 -1
  32. package/cjs/label/line.js +4 -3
  33. package/cjs/label/line.js.map +1 -1
  34. package/cjs/label/type.d.ts +7 -14
  35. package/cjs/label/type.js.map +1 -1
  36. package/cjs/label/util.d.ts +0 -4
  37. package/cjs/label/util.js +3 -24
  38. package/cjs/label/util.js.map +1 -1
  39. package/cjs/legend/discrete/discrete.d.ts +14 -1
  40. package/cjs/legend/discrete/discrete.js +51 -25
  41. package/cjs/legend/discrete/discrete.js.map +1 -1
  42. package/cjs/legend/discrete/type.d.ts +1 -0
  43. package/cjs/legend/discrete/type.js.map +1 -1
  44. package/cjs/marker/area.js +1 -5
  45. package/cjs/marker/area.js.map +1 -1
  46. package/cjs/marker/base.d.ts +0 -1
  47. package/cjs/marker/base.js +3 -6
  48. package/cjs/marker/base.js.map +1 -1
  49. package/cjs/marker/line.js +1 -7
  50. package/cjs/marker/line.js.map +1 -1
  51. package/cjs/marker/point.d.ts +0 -1
  52. package/cjs/marker/point.js +11 -24
  53. package/cjs/marker/point.js.map +1 -1
  54. package/cjs/marker/type.d.ts +0 -1
  55. package/cjs/marker/type.js.map +1 -1
  56. package/cjs/pager/pager.d.ts +2 -0
  57. package/cjs/pager/pager.js +15 -6
  58. package/cjs/pager/pager.js.map +1 -1
  59. package/cjs/pager/type.d.ts +1 -0
  60. package/cjs/pager/type.js.map +1 -1
  61. package/cjs/scrollbar/scrollbar.js +3 -9
  62. package/cjs/scrollbar/scrollbar.js.map +1 -1
  63. package/cjs/tag/tag.js +3 -3
  64. package/cjs/tag/tag.js.map +1 -1
  65. package/cjs/title/title.js +2 -2
  66. package/cjs/title/title.js.map +1 -1
  67. package/cjs/util/limit-shape.d.ts +0 -4
  68. package/cjs/util/limit-shape.js +4 -13
  69. package/cjs/util/limit-shape.js.map +1 -1
  70. package/cjs/util/text.d.ts +1 -1
  71. package/cjs/util/text.js +4 -4
  72. package/cjs/util/text.js.map +1 -1
  73. package/dist/index.js +29932 -0
  74. package/dist/index.min.js +1 -0
  75. package/es/axis/base.js +15 -18
  76. package/es/axis/base.js.map +1 -1
  77. package/es/axis/line.js +50 -59
  78. package/es/axis/line.js.map +1 -1
  79. package/es/axis/overlap/auto-hide.d.ts +0 -1
  80. package/es/axis/overlap/auto-hide.js +2 -10
  81. package/es/axis/overlap/auto-hide.js.map +1 -1
  82. package/es/axis/overlap/auto-limit.d.ts +0 -1
  83. package/es/axis/overlap/auto-limit.js +3 -5
  84. package/es/axis/overlap/auto-limit.js.map +1 -1
  85. package/es/axis/type.d.ts +0 -1
  86. package/es/axis/type.js.map +1 -1
  87. package/es/brush/brush.js +4 -4
  88. package/es/brush/brush.js.map +1 -1
  89. package/es/data-zoom/data-zoom.d.ts +1 -5
  90. package/es/data-zoom/data-zoom.js +74 -135
  91. package/es/data-zoom/data-zoom.js.map +1 -1
  92. package/es/index.d.ts +1 -2
  93. package/es/index.js +1 -3
  94. package/es/index.js.map +1 -1
  95. package/es/indicator/indicator.d.ts +1 -3
  96. package/es/indicator/indicator.js +14 -53
  97. package/es/indicator/indicator.js.map +1 -1
  98. package/es/indicator/type.d.ts +0 -1
  99. package/es/indicator/type.js.map +1 -1
  100. package/es/label/arc.d.ts +2 -2
  101. package/es/label/arc.js +35 -38
  102. package/es/label/arc.js.map +1 -1
  103. package/es/label/base.d.ts +8 -6
  104. package/es/label/base.js +50 -89
  105. package/es/label/base.js.map +1 -1
  106. package/es/label/line.js +4 -3
  107. package/es/label/line.js.map +1 -1
  108. package/es/label/type.d.ts +7 -14
  109. package/es/label/type.js.map +1 -1
  110. package/es/label/util.d.ts +0 -4
  111. package/es/label/util.js +2 -22
  112. package/es/label/util.js.map +1 -1
  113. package/es/legend/discrete/discrete.d.ts +14 -1
  114. package/es/legend/discrete/discrete.js +50 -27
  115. package/es/legend/discrete/discrete.js.map +1 -1
  116. package/es/legend/discrete/type.d.ts +1 -0
  117. package/es/legend/discrete/type.js.map +1 -1
  118. package/es/marker/area.js +2 -6
  119. package/es/marker/area.js.map +1 -1
  120. package/es/marker/base.d.ts +0 -1
  121. package/es/marker/base.js +3 -6
  122. package/es/marker/base.js.map +1 -1
  123. package/es/marker/line.js +2 -8
  124. package/es/marker/line.js.map +1 -1
  125. package/es/marker/point.d.ts +0 -1
  126. package/es/marker/point.js +11 -25
  127. package/es/marker/point.js.map +1 -1
  128. package/es/marker/type.d.ts +0 -1
  129. package/es/marker/type.js.map +1 -1
  130. package/es/pager/pager.d.ts +2 -0
  131. package/es/pager/pager.js +16 -6
  132. package/es/pager/pager.js.map +1 -1
  133. package/es/pager/type.d.ts +1 -0
  134. package/es/pager/type.js.map +1 -1
  135. package/es/scrollbar/scrollbar.js +3 -9
  136. package/es/scrollbar/scrollbar.js.map +1 -1
  137. package/es/tag/tag.js +3 -3
  138. package/es/tag/tag.js.map +1 -1
  139. package/es/title/title.js +3 -3
  140. package/es/title/title.js.map +1 -1
  141. package/es/util/limit-shape.d.ts +0 -4
  142. package/es/util/limit-shape.js +3 -11
  143. package/es/util/limit-shape.js.map +1 -1
  144. package/es/util/text.d.ts +1 -1
  145. package/es/util/text.js +4 -4
  146. package/es/util/text.js.map +1 -1
  147. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vutils"),require("@visactor/vscale")):"function"==typeof define&&define.amd?define(["exports","@visactor/vutils","@visactor/vscale"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VRender=t.VRender||{},t.VRender.Components={}),t.VUtils,t.VScale)}(this,(function(t,e,i){"use strict";function n(){n=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,a=Object.defineProperty||function(t,e,i){t[e]=i.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var r=e&&e.prototype instanceof b?e:b,s=Object.create(r.prototype),o=new O(n||[]);return a(s,"_invoke",{value:T(t,i,o)}),s}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",v="suspendedYield",p="executing",g="completed",y={};function b(){}function m(){}function x(){}var _={};h(_,o,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(E([])));k&&k!==i&&r.call(k,o)&&(_=k);var B=x.prototype=b.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(n,a,s,o){var l=c(t[n],t,a);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,o)}),(function(t){i("throw",t,s,o)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,o)}))}o(l.arg)}var n;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,n){i(t,r,e,n)}))}return n=n?n.then(a,a):a()}})}function T(e,i,n){var r=f;return function(a,s){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var l=P(o,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,i,n);if("normal"===u.type){if(r=n.done?g:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}function P(e,i){var n=i.method,r=e.iterator[n];if(r===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,P(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=c(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,y;var s=a.arg;return s?s.done?(i[e.resultName]=s.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function E(e){if(e||""===e){var i=e[o];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=x,a(B,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:m,configurable:!0}),m.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(B),t},e.awrap=function(t){return{__await:t}},S(w.prototype),h(w.prototype,l,(function(){return this})),e.AsyncIterator=w,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var s=new w(d(t,i,n,r),a);return e.isGeneratorFunction(i)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(B),h(B,u,"Generator"),h(B,o,(function(){return this})),h(B,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=E,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(n,r){return o.type="throw",o.arg=e,i.next=n,r&&(i.method="next",i.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(l&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),M(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;M(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:E(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function r(t){return r="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},r(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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,A(n.key),n)}}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,i){return(e=A(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(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&&d(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,e,i){return f=c()?Reflect.construct.bind():function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&d(r,i.prototype),r},f.apply(null,arguments)}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(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 v(t)}function g(t){var e=c();return function(){var i,n=h(t);if(e){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return p(this,i)}}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},y.apply(this,arguments)}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,s,o=[],l=!0,u=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(u)throw r}}return o}}(t,e)||x(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||x(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){if(t){if("string"==typeof t)return _(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function A(t){var e=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)}(t,"string");return"symbol"==typeof e?e:String(e)}var k=function(){function t(){a(this,t)}return o(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}]),t}();k.auto_increment_id=0;var B=o((function t(e){a(this,t),this.id=k.GenAutoIncrementId(),this.registry=e})),S="named",w="inject",T="multi_inject",P="inversify:tagged",C="inversify:paramtypes",M=function(){function t(e,i){a(this,t),this.key=e,this.value=i}return o(t,[{key:"toString",value:function(){return this.key===S?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")}}]),t}(),O=function(t){var e;return function(t){var e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,l=!s&&!o,u={create:s?function(){return S(Object.create(null))}:o?function(){return S({__proto__:null})}:function(){return S({})},has:l?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:l?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),d="object"==("undefined"==typeof process?"undefined":r(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=d||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var 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[a]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var 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){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){var i=this._find(e,!1);if(i>=0){for(var n=this._keys.length,r=i+1;r<n;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,r)},e.prototype.entries=function(){return new i(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[a]=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 r(t,e){return e}function s(t,e){return[t,e]}}():Map,f=(d||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new c}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[a]=function(){return this.keys()}}():Set,new(d||"function"!=typeof WeakMap?function(){var t=16,i=u.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=a(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=a(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return a(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=a(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var t;do{t="@@WeakMap@@"+o()}while(u.has(i,t));return i[t]=!0,t}function a(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:u.create()})}return t[n]}function s(t,e){for(var i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function o(){var e,i=(e=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):s(new Uint8Array(e),e):s(new Array(e),e));i[6]=79&i[6]|64,i[8]=191&i[8]|128;for(var n="",r=0;r<t;++r){var a=i[r];4!==r&&6!==r&&8!==r||(n+="-"),a<16&&(n+="0"),n+=a.toString(16).toLowerCase()}return n}}():WeakMap));function v(t,e,i){var n=f.get(t);if(b(n)){if(!i)return;n=new c,f.set(t,n)}var r=n.get(e);if(b(r)){if(!i)return;r=new c,n.set(e,r)}return r}function p(t,e,i){if(g(t,e,i))return!0;var n=B(e);return!m(n)&&p(t,n,i)}function g(t,e,i){var n=v(e,i,!1);return!b(n)&&!!n.has(t)}function y(t,e,i){if(g(t,e,i))return function(t,e,i){var n=v(e,i,!1);if(!b(n))return n.get(t)}(t,e,i);var n=B(e);return m(n)?void 0:y(t,n,i)}function b(t){return void 0===t}function m(t){return null===t}function x(t){return"object"==r(t)?null!==t:"function"==typeof t}function _(t,e){switch(function(t){if(null===t)return 1;switch(r(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var i=3===e?"string":5===e?"number":"default",a=function(t,e){var i=t[e];if(null!=i){if(!k(i))throw new TypeError;return i}}(t,n);if(void 0!==a){var s=a.call(t,i);if(x(s))throw new TypeError;return s}return function(t,e){if("string"===e){var i=t.toString;if(k(i)){var n=i.call(t);if(!x(n))return n}var r=t.valueOf;if(k(r)){var a=r.call(t);if(!x(a))return a}}else{var s=t.valueOf;if(k(s)){var o=s.call(t);if(!x(o))return o}var l=t.toString;if(k(l)){var u=l.call(t);if(!x(u))return u}}throw new TypeError}(t,"default"===i?"number":i)}function A(t){var e=_(t,3);return"symbol"==r(e)?e:function(t){return""+t}(e)}function k(t){return"function"==typeof t}function B(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;var i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;var r=n.constructor;return"function"!=typeof r||r===t?e:r}function S(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,n){if(!x(i))throw new TypeError;return r=t,a=e,void v(i,n,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),p(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),g(t,e,i)})),t("getMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),y(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function E(t,e,i,n){!function(t,e,i,n){var r,a=[n],s={};O.hasOwnMetadata(t,e)&&(s=O.getMetadata(t,e));var o=s[i];void 0===o&&(o=[]),(r=o).push.apply(r,a),s[i]=o,O.defineMetadata(t,s,e)}(P,t,i.toString(),n)}function L(t){return function(e,i,n){E(e,0,n,t)}}function R(t){return function(e){return function(i,n,r){return L(new M(t,e))(i,n,r)}}}var I=R(w),j=R(T);function D(){return function(t){return O.defineMetadata(C,null,t),t}}function N(t){return L(new M(S,t))}var U,z="Singleton",H="Transient",W="ConstantValue",V="DynamicValue",F="Factory",G="Function",Y="Instance",X="Invalid",$=function(){function t(e,i){a(this,t),this.id=k.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=e,this.scope=i,this.type=X,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}return o(t,[{key:"clone",value:function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===z&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.provider=this.provider,e.constraint=this.constraint,e.cache=this.cache,e}}]),t}(),q=function(){function t(){a(this,t)}return o(t,[{key:"getConstructorMetadata",value:function(t){return{compilerGeneratedMetadata:O.getMetadata(C,t),userGeneratedMetadata:O.getMetadata(P,t)||{}}}},{key:"getPropertiesMetadata",value:function(t){throw new Error("暂未实现")}}]),t}(),K=(U=S,function(t){var e=function(e){if(null==e)return!1;if(e.key===U&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;for(var i=e.constructorArgsMetadata,n=0;n<i.length;n++)if(i[n].key===U&&i[n].value===t)return!0;return!1};return e.metaData=new M(U,t),e}),Z=function(){function t(e){a(this,t),this._binding=e}return o(t,[{key:"inRequestScope",value:function(){throw new Error("暂未实现")}},{key:"inSingletonScope",value:function(){return this._binding.scope=z,this}},{key:"inTransientScope",value:function(){return this._binding.scope=H,this}},{key:"whenTargetNamed",value:function(t){return this._binding.constraint=K(t),this}}]),t}(),J=function(){function t(e){a(this,t),this._binding=e}return o(t,[{key:"to",value:function(t){return this._binding.type=Y,this._binding.implementationType=t,new Z(this._binding)}},{key:"toSelf",value:function(){var t=this._binding.serviceIdentifier;return this.to(t)}},{key:"toDynamicValue",value:function(t){return this._binding.type=V,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Z(this._binding)}},{key:"toConstantValue",value:function(t){return this._binding.type=W,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=z,new Z(this._binding)}},{key:"toFactory",value:function(t){return this._binding.type=F,this._binding.factory=t,this._binding.scope=z,new Z(this._binding)}},{key:"toService",value:function(t){this.toDynamicValue((function(e){return e.container.get(t)}))}}]),t}(),Q=function(){function t(e){a(this,t);var i=e||{};i.defaultScope=i.defaultScope||H,this.options=i,this.id=k.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new q}return o(t,[{key:"load",value:function(t){var e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}},{key:"get",value:function(t){var e=this._getNotAllArgs(t,!1);return this._get(e)}},{key:"getAll",value:function(t){var e=this._getAllArgs(t);return this._get(e)}},{key:"getTagged",value:function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}},{key:"getNamed",value:function(t,e){return this.getTagged(t,S,e)}},{key:"isBound",value:function(t){return this._bindingDictionary.has(t)}},{key:"bind",value:function(t){var e=this.options.defaultScope,i=new $(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new J(i)}},{key:"unbind",value:function(t){this._bindingDictionary.delete(t)}},{key:"rebind",value:function(t){return this.unbind(t),this.bind(t)}},{key:"_getContainerModuleHelpersFactory",value:function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}};return function(n){return{bindFunction:(r=n,function(i){var n=t.bind(i);return e(n,r),n}),isboundFunction:function(e){return t.isBound(e)},rebindFunction:i(n),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(t){return null}};var r}}},{key:"_getNotAllArgs",value:function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}},{key:"_getAllArgs",value:function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}},{key:"_get",value:function(t){var e=this,i=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((function(e){return e.constraint(t)})).forEach((function(t){i.push(e._resolveFromBinding(t))})),t.isMultiInject||1!==i.length?i:i[0]}},{key:"_getChildRequest",value:function(t){for(var e=this,i=t.implementationType,n=this._metadataReader.getConstructorMetadata(i).userGeneratedMetadata,r=Object.keys(n),a=[],s=function(){var t=n[o],i={};t.forEach((function(t){i[t.key]=t.value}));var r={inject:i[w],multiInject:i[T]},s=r.inject||r.multiInject,l={serviceIdentifier:s,constructorArgsMetadata:t},u={injectIdentifier:s,metadata:t,bindings:e._bindingDictionary.get(s).filter((function(t){return t.constraint(l)}))};a.push(u)},o=0;o<r.length;o++)s();return a}},{key:"_resolveFromBinding",value:function(t){var e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}},{key:"_getResolvedFromBinding",value:function(t){var e;switch(t.type){case W:case G:e=t.cache;break;case Y:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}},{key:"_resolveInstance",value:function(t,e){if(t.activated)return t.cache;var i=this._getChildRequest(t);return this._createInstance(e,i)}},{key:"_createInstance",value:function(t,e){return e.length?f(t,m(this._resolveRequests(e))):new t}},{key:"_resolveRequests",value:function(t){var e=this;return t.map((function(t){return t.bindings.length>1?t.bindings.map((function(t){return e._resolveFromBinding(t)})):e._resolveFromBinding(t.bindings[0])}))}},{key:"_saveToScope",value:function(t,e){t.scope===z&&(t.cache=e,t.activated=!0)}}]),t}(),et=Symbol("ContributionProvider"),it=function(){function t(e,i){a(this,t),this.serviceIdentifier=e,this.container=i}return o(t,[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&(t=this.caches).push.apply(t,m(this.container.getAll(this.serviceIdentifier)))),this.caches}}]),t}();function nt(t,e){t(et).toDynamicValue((function(t){var i=t.container;return new it(e,i)})).inSingletonScope().whenTargetNamed(e)}var rt=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}]),i}(function(){function t(e,i){a(this,t),this._args=e,this.name=i,this.taps=[]}return o(t,[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((function(t){return t.name!==i&&(!e||t.fn===e)})))}},{key:"_parseOptions",value:function(t,e,i){var n;if("string"==typeof e)n={name:e.trim()};else if("object"!=r(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)}},{key:"_tap",value:function(t,e,i){this._insert(this._parseOptions(t,e,i))}},{key:"_insert",value:function(t){var e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var i=0;"number"==typeof t.stage&&(i=t.stage);for(var n=this.taps.length;n>0;){n--;var r=this.taps[n];this.taps[n+1]=r;var a=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(a>i)){n++;break}}this.taps[n]=t}}]),t}()),at=Symbol.for("EnvContribution"),st=Symbol.for("VGlobal"),ot=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},lt=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ut=function(t,e){return function(i,n){e(i,n,t)}},ht=function(){function t(e){a(this,t),this.contributions=e,this.id=k.GenAutoIncrementId(),this.hooks={onSetEnv:new rt(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}return o(t,[{key:"env",get:function(){return this._env}},{key:"devicePixelRatio",get:function(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}},{key:"supportEvent",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}},{key:"supportsTouchEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}},{key:"supportsPointerEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}},{key:"supportsMouseEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}},{key:"applyStyles",get:function(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles},set:function(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}},{key:"bindContribution",value:function(t){var e=this,i=[];if(this.contributions.getContributions().forEach((function(n){var r=n.configure(e,t);r&&r.then&&i.push(r)})),i.length)return Promise.all(i)}},{key:"getDynamicCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}},{key:"getStaticCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}},{key:"setEnv",value:function(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}},{key:"deactiveCurrentEnv",value:function(){this.envContribution&&this.envContribution.release()}},{key:"activeEnv",value:function(t,e){var i=this,n=this._env;this._env=t;var r=this.bindContribution(e);if(r&&r.then)return r.then((function(){i.envParams=e,i.hooks.onSetEnv.call(n,t,i)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}},{key:"setActiveEnvContribution",value:function(t){this.envContribution=t}},{key:"createCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}},{key:"createOffscreenCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}},{key:"releaseCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}},{key:"addEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}},{key:"getRequestAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}},{key:"getCancelAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}},{key:"getElementById",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}},{key:"getRootElement",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}},{key:"getDocument",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}},{key:"mapToCanvasPoint",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}},{key:"loadImage",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}},{key:"loadSvg",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}},{key:"loadJson",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}},{key:"loadArrayBuffer",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}},{key:"loadBlob",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}},{key:"isChrome",value:function(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}},{key:"isSafari",value:function(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}},{key:"getNativeAABBBounds",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}},{key:"removeDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}},{key:"createDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}},{key:"getElementTop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}},{key:"getElementLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}},{key:"getElementTopLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}}]),t}();ht=ot([D(),ut(0,I(et)),ut(0,N(at)),lt("design:paramtypes",[Object])],ht);var dt,ct,ft,vt,pt,gt,yt,bt,mt,xt,_t,At,kt,Bt,St,wt=e.tau-1e-8,Tt=function(){function t(e){a(this,t),this.init(e)}return o(t,[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,i,n,r,a,s){if(Math.abs(a-r)>wt)return this.bounds.add(t-n,i-n),void this.bounds.add(t+n,i+n);var o,l,u,h,d=1/0,c=-1/0,f=1/0,v=-1/0;function p(t){u=n*Math.cos(t),h=n*Math.sin(t),u<d&&(d=u),u>c&&(c=u),h<f&&(f=h),h>v&&(v=h)}if(p(r),p(a),a!==r)if((r%=e.tau)<0&&(r+=e.tau),(a%=e.tau)<0&&(a+=e.tau),a<r&&(s=!s,o=r,r=a,a=o),s)for(a-=e.tau,o=r-r%e.halfPi,l=0;l<4&&o>a;++l,o-=e.halfPi)p(o);else for(o=r-r%e.halfPi+e.halfPi,l=0;l<4&&o<a;++l,o+=e.halfPi)p(o);this.bounds.add(t+d,i+f),this.bounds.add(t+c,i+v)}},{key:"arcTo",value:function(t,e,i,n,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,a)}},{key:"closePath",value:function(){}},{key:"ellipse",value:function(){throw new Error("不支持ellipse")}},{key:"lineTo",value:function(t,e){this.bounds.add(t,e)}},{key:"moveTo",value:function(t,e){this.bounds.add(t,e)}},{key:"quadraticCurveTo",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}},{key:"rect",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}]),t}(),Pt=function(){function t(){a(this,t),this.curves=[],this.bounds=new e.AABBBounds}return o(t,[{key:"getCurveLengths",value:function(){return this.curves.map((function(t){return t.getLength()}))}},{key:"getPointAt",value:function(t){return{x:0,y:0}}},{key:"getLength",value:function(){return 0}},{key:"getBounds",value:function(){return this.bounds}}]),t}(),Ct=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Mt={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},Ot=0,Et=1,Lt=2,Rt=3,It=4,jt=5,Dt=6,Nt=7,Ut=8;function zt(t,i,n,r){for(var a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_,A,k,B,S,w,T,P,C,M,O=function(t,i,n,r,a,s,o,l,u){var h=e.degreeToRadian(o),d=Math.sin(h),c=Math.cos(h),f=c*(l-t)*.5+d*(u-i)*.5,v=c*(u-i)*.5-d*(l-t)*.5,p=f*f/((n=Math.abs(n))*n)+v*v/((r=Math.abs(r))*r);p>1&&(n*=p=Math.sqrt(p),r*=p);var g=c/n,y=d/n,b=-d/r,m=c/r,x=g*l+y*u,_=b*l+m*u,A=g*t+y*i,k=b*t+m*i,B=1/((A-x)*(A-x)+(k-_)*(k-_))-.25;B<0&&(B=0);var S=Math.sqrt(B);s===a&&(S=-S);var w=.5*(x+A)-S*(k-_),T=.5*(_+k)+S*(A-x),P=Math.atan2(_-T,x-w),C=Math.atan2(k-T,A-w)-P;C<0&&1===s?C+=e.tau:C>0&&0===s&&(C-=e.tau);for(var M=Math.ceil(Math.abs(C/(e.halfPi+.001))),O=[],E=0;E<M;++E){var L=P+E*C/M,R=P+(E+1)*C/M;O[E]=[w,T,L,R,n,r,d,c]}return O}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],i,n),E=0;E<O.length;++E){var L=(a=O[E],s=void 0,o=void 0,l=void 0,u=void 0,h=void 0,d=void 0,c=void 0,f=void 0,v=void 0,p=void 0,g=void 0,y=void 0,b=void 0,m=void 0,x=void 0,_=void 0,A=void 0,k=void 0,B=void 0,S=void 0,w=void 0,T=void 0,P=void 0,C=void 0,M=void 0,s=a[0],o=a[1],l=a[2],u=a[3],h=a[4],d=a[5],c=a[6],f=a[7],v=f*h,p=-c*d,g=c*h,y=f*d,b=Math.cos(l),m=Math.sin(l),x=Math.cos(u),_=Math.sin(u),A=.5*(u-l),k=Math.sin(.5*A),B=8/3*k*k/Math.sin(A),[v*(S=s+b-B*m)+p*(w=o+m+B*b),g*S+y*w,v*(C=(T=s+x)+B*_)+p*(M=(P=o+_)-B*x),g*C+y*M,v*T+p*P,g*T+y*P]);t.bezierCurveTo(L[0],L[1],L[2],L[3],L[4],L[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(yt||(yt={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(bt||(bt={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(mt||(mt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(xt||(xt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(_t||(_t={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(At||(At={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(kt||(kt={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Bt||(Bt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(St||(St={}));var Ht=[function(t,e,i,n,r,a,s){return e.arc(t[1]*r+i,t[2]*a+n,t[3]*(r+a)/2,t[4],t[5],t[6],s)},function(t,e,i,n,r,a,s){return e.arcTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*(r+a)/2,s)},function(t,e,i,n,r,a,s){return e.bezierCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*r+i,t[6]*a+n,s)},function(t,e,i,n){return e.closePath()},function(t,e,i,n,r,a){return e.ellipse(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8])},function(t,e,i,n,r,a,s){return e.lineTo(t[1]*r+i,t[2]*a+n,s)},function(t,e,i,n,r,a,s){return e.moveTo(t[1]*r+i,t[2]*a+n,s)},function(t,e,i,n,r,a,s){return e.quadraticCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,s)},function(t,e,i,n,r,a,s){return e.rect(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,s)}];function Wt(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=0;o<t.length;o++){var l=t[o];Ht[l[0]](l,e,i,n,r,a,s)}}var Vt=function(){function t(){a(this,t)}return o(t,[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}]),t}();function Ft(t,i,n,r,a){return function(t,i){for(var n=0,r=t.length,a=0;a<r;a++){var s=t[a],o=i[a],l=t[(a+1)%r],u=i[(a+1)%r];n+=e.PointService.distanceNN(s,o,l,u)}return n/2}([t.x,i.x,n.x,r.x],[t.y,i.y,n.y,r.y])}function Gt(t,e,i,n,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*i*r*r*a+n*r*r*r}function Yt(t,i,n,r,a){var s=Gt(t.x,i.x,n.x,r.x,a),o=Gt(t.y,i.y,n.y,r.y,a);return new e.Point(s,o)}function Xt(t,i){var n=t.p0,r=t.p1,a=t.p2,s=t.p3,o=Yt(n,r,a,s,i),l=e.PointService.pointAtPP(n,r,i),u=e.PointService.pointAtPP(r,a,i),h=e.PointService.pointAtPP(a,s,i),d=e.PointService.pointAtPP(l,u,i),c=e.PointService.pointAtPP(u,h,i);return[new $t(n,l,d,o),new $t(o,c,h,s)]}var $t=function(t){u(n,t);var i=g(n);function n(t,e,r,s){var o;return a(this,n),(o=i.call(this)).type=Bt.CubicBezierCurve,o.p0=t,o.p1=e,o.p2=r,o.p3=s,o}return o(n,[{key:"_validPoint",value:function(){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)}},{key:"getPointAt",value:function(t){if(!1!==this.defined)return Yt(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?Ft(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(t){return t===kt.ROW?e.abs(this.p0.x-this.p3.x):t===kt.COLUMN?e.abs(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var i=e.max(t-.01,0),n=e.min(t+.01,1),r=this.getPointAt(i),a=this.getPointAt(n);return e.atan2(a.y-r.y,a.x-r.x)}}]),n}(Vt);function qt(t,i){var n=t.p0,r=t.p1,a=e.PointService.pointAtPP(n,r,i);return[new Kt(n,a),new Kt(a,r)]}var Kt=function(t){u(n,t);var i=g(n);function n(t,e){var r;return a(this,n),(r=i.call(this)).type=Bt.LineCurve,r.p0=t,r.p1=e,r}return o(n,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return e.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=e.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}},{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}},{key:"calcLength",value:function(){return this._validPoint()?e.PointService.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(t){return t===kt.ROW?e.abs(this.p0.x-this.p1.x):t===kt.COLUMN?e.abs(this.p0.y-this.p1.y):0}}]),n}(Vt),Zt=function(){function t(e,i){a(this,t),this.init(e,i)}return o(t,[{key:"endX",get:function(){return this._lastX}},{key:"endY",get:function(){return this._lastY}},{key:"init",value:function(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}},{key:"bezierCurveTo",value:function(t,i,n,r,a,s,o,l){var u=new $t(new e.Point(this._lastX,this._lastY),new e.Point(t,i),new e.Point(n,r),new e.Point(a,s));u.originP1=this._lastOriginP,u.originP2=l,u.defined=o,this.curves.push(u),this._lastX=a,this._lastY=s,this._lastOriginP=l}},{key:"closePath",value:function(){if(!(this.curves.length<2)){var t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}}},{key:"ellipse",value:function(){throw new Error("SegContext不支持调用ellipse")}},{key:"lineTo",value:function(t,e,i,n){var r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}},{key:"moveTo",value:function(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}},{key:"quadraticCurveTo",value:function(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}},{key:"clear",value:function(){this.curves=[],this.length=NaN}},{key:"tryUpdateLength",value:function(t){return this.getLength(t)}},{key:"addLinearCurve",value:function(t,i,n,r,a){var s=new Kt(new e.Point(this._lastX,this._lastY),new e.Point(t,i));return s.originP1=r,s.originP2=a,s.defined=n,s}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(t){var i,n;if(t===kt.COLUMN){if(!this.curves.length)return 0;var r=this.curves[0],a=this.curves[this.curves.length-1],s=null!==(i=a.p3)&&void 0!==i?i:a.p1;return e.abs(r.p0.y-s.y)}if(t===kt.ROW){if(!this.curves.length)return 0;var o=this.curves[0],l=this.curves[this.curves.length-1],u=null!==(n=l.p3)&&void 0!==n?n:l.p1;return e.abs(o.p0.x-u.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}]),t}(),Jt=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"bezierCurveTo",value:function(t,e,n,r,a,s,o,l){return y(h(i.prototype),"bezierCurveTo",this).call(this,e,t,r,n,s,a,o,l)}},{key:"lineTo",value:function(t,e,n,r){return y(h(i.prototype),"lineTo",this).call(this,e,t,n,r)}},{key:"moveTo",value:function(t,e,n){return y(h(i.prototype),"moveTo",this).call(this,e,t,n)}},{key:"clear",value:function(){return y(h(i.prototype),"clear",this).call(this)}}]),i}(Zt);function Qt(t,e){for(var i=!1,n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}var te=function(){function t(e,i){a(this,t),this.context=e,i&&(this.startPoint=i)}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var 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}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ee(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new Zt("linear",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new te(a,r),t),a}function ie(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)}var ne=function(){function t(e,i){a(this,t),this.context=e,this.startPoint=i}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){2===this._point&&ie(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}},{key:"point",value:function(t){var 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:ie(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}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function re(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return ee(t,i);var a=new Zt("basis",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new ne(a,r),t),a}function ae(t){return t<0?-1:1}function se(t,e,i){var n=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(n||Number(r<0&&-0)),s=(i-t._y1)/(r||Number(n<0&&-0)),o=(a*r+s*n)/(n+r);return(ae(a)+ae(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function oe(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function le(t,e,i,n,r){var a=t._x0,s=t._y0,o=t._x1,l=t._y1,u=(o-a)/3;t.context.bezierCurveTo(a+u,s+u*e,o-u,l-u*i,o,l,n,t.lastPoint1)}var ue=function(){function t(e,i){a(this,t),this.context=e,this.startPoint=i}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:le(this,this._t0,oe(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,le(this,oe(this,e=se(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:le(this,this._t0,e=se(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}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}(),he=function(t){u(i,t);var e=g(i);function i(t,n){return a(this,i),e.call(this,t,n)}return o(i,[{key:"point",value:function(t){return y(h(i.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}]),i}(ue);function de(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return ee(t,i);var a=new Zt("monotoneX",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new ue(a,r),t),a}function ce(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return ee(t,i);var a=new Jt("monotoneY",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new he(a,r),t),a}var fe=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;a(this,t),this.context=e,this._t=i,this.startPoint=n}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){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)}},{key:"point",value:function(t){var 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{var 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}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ve(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.direction,a=n.startPoint;if(t.length<2-Number(!!a))return null;var s=new Zt("step",null!=r?r:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new fe(s,i,a),t),s}var pe=function(){function t(e,i){a(this,t),this.context=e,i&&(this.startPoint=i)}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){this.context.closePath()}},{key:"point",value:function(t){var 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}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ge(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new Zt("linear",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new pe(a,r),t),a}function ye(t,e,i){switch(e){case"linear":default:return ee(t,i);case"basis":return re(t,i);case"monotoneX":return de(t,i);case"monotoneY":return ce(t,i);case"step":return ve(t,.5,i);case"stepBefore":return ve(t,0,i);case"stepAfter":return ve(t,1,i);case"linearClosed":return ge(t,i)}}var be=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).commandList=[],t&&(e._ctx=t),e._boundsContext=new Tt(e.bounds),e}return o(n,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([Dt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([jt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){return this.commandList.push([Nt,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){return this.commandList.push([Lt,t,e,i,n,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,a),this}},{key:"arcTo",value:function(t,e,i,n,r){return this.commandList.push([Et,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}},{key:"ellipse",value:function(t,e,i,n,r,a,s,o){return this.commandList.push([It,t,e,i,n,r,a,s,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,a,s,o),this}},{key:"rect",value:function(t,e,i,n){return this.commandList.push([Ut,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}},{key:"arc",value:function(t,e,i,n,r,a){return this.commandList.push([Ot,t,e,i,n,r,a]),this._ctx&&this._ctx.arc(t,e,i,n,r,a),this}},{key:"closePath",value:function(){return this.commandList.push([Rt]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[Dt]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[jt]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[Nt]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[Lt]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[Ot]=function(t){var e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_=[];e=_,i=t[4],n=t[5],r=t[1],a=t[2],s=t[3],o=t[3],l=Math.abs(n-i),u=4*Math.tan(l/4)/3,h=n<i?-1:1,d=Math.cos(i),c=Math.sin(i),f=Math.cos(n),v=Math.sin(n),p=d*s+r,g=c*o+a,y=f*s+r,b=v*o+a,m=s*u*h,x=o*u*h,e.push(p-m*c,g+x*d,y+m*v,b-x*f,y,b);for(var A="",k=0;k<_.length;k+=6)A+="C".concat(_[k]," ").concat(_[k+1]," ").concat(_[k+2]," ").concat(_[k+3]," ").concat(_[k+4]," ").concat(_[k+5]);return A},t[Rt]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,i="";return this.commandList.forEach((function(t){i+=e[t[0]](t)})),i}},{key:"fromString",value:function(t,e,i,n,r){this.clear();var a=function(t){if(!t)return[];var e,i,n=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===n)return[];for(var r=[],a=0,s=n.length;a<s;a++)if(dt=n[a],ct=dt.slice(1),e=[ft=dt[0]],null!==(i=ct.match(Ct))){for(var o=0,l=i.length;o<l;o++)vt=i[o],pt=parseFloat(vt),Number.isNaN(pt)||e.push(pt);if(gt=Mt[ft],e.length-1>gt)for(var u=void 0,h=1,d=e.length;h<d;h+=gt){u=[ft];for(var c=h,f=h+gt;c<f;c++)u.push(e[c]);r.push(u)}else r.push(e)}else r.push(e);return r}(t);return this._runCommandStrList(a,e,i,n,r),this._updateBounds(),this}},{key:"fromLine",value:function(t){var e=t.attribute,i=e.points,n=e.curveType,r=e.clipRangeByDimension;if(i){var a=ye(i,n);"x"===r?this.direction=kt.ROW:"y"===r?this.direction=kt.COLUMN:"auto"===r&&(this.direction=a.direction),this.curves=a.curves}}},{key:"fromCustomPath2D",value:function(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,i,n){var r=this,a=this.commandList;if(!this.transformCbList){var s=[];s[Dt]=this.moveToTransform,s[jt]=this.lineToTransform,s[Nt]=this.quadraticCurveToTransform,s[Lt]=this.bezierCurveToTransform,s[Et]=this.arcToTransform,s[It]=this.ellipseTransform,s[Ut]=this.rectTransform,s[Ot]=this.arcTransform,s[Rt]=this.closePathTransform,this.transformCbList=s}a.forEach((function(a){r.transformCbList[a[0]](a,t,e,i,n)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"lineToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"quadraticCurveToTransform",value:function(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}},{key:"bezierCurveToTransform",value:function(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}},{key:"arcToTransform",value:function(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}},{key:"ellipseTransform",value:function(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}},{key:"rectTransform",value:function(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}},{key:"arcTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,i,n,r,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=null,d=0,c=0,f=0,v=0,p=0,g=t.length;p<g;++p){switch(e=t[p],1===l&&1===u||(e=xe(e,l,u)),e[0]){case"l":d+=e[1],c+=e[2],this.lineTo(d+s,c+o);break;case"L":d=e[1],c=e[2],this.lineTo(d+s,c+o);break;case"h":d+=e[1],this.lineTo(d+s,c+o);break;case"H":d=e[1],this.lineTo(d+s,c+o);break;case"v":c+=e[1],this.lineTo(d+s,c+o);break;case"V":c=e[1],this.lineTo(d+s,c+o);break;case"m":d+=e[1],c+=e[2],this.moveTo(d+s,c+o);break;case"M":d=e[1],c=e[2],this.moveTo(d+s,c+o);break;case"c":i=d+e[5],n=c+e[6],f=d+e[3],v=c+e[4],this.bezierCurveTo(d+e[1]+s,c+e[2]+o,f+s,v+o,i+s,n+o),d=i,c=n;break;case"C":d=e[5],c=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+s,e[2]+o,f+s,v+o,d+s,c+o);break;case"s":i=d+e[3],n=c+e[4],f=2*d-f,v=2*c-v,this.bezierCurveTo(f+s,v+o,d+e[1]+s,c+e[2]+o,i+s,n+o),f=d+e[1],v=c+e[2],d=i,c=n;break;case"S":i=e[3],n=e[4],f=2*d-f,v=2*c-v,this.bezierCurveTo(f+s,v+o,e[1]+s,e[2]+o,i+s,n+o),d=i,c=n,f=e[1],v=e[2];break;case"q":i=d+e[3],n=c+e[4],f=d+e[1],v=c+e[2],this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=i,c=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+s,e[2]+o,i+s,n+o),d=i,c=n,f=e[1],v=e[2];break;case"t":i=d+e[1],n=c+e[2],null===h[0].match(/[QqTt]/)?(f=d,v=c):"t"===h[0]?(f=2*d-r,v=2*c-a):"q"===h[0]&&(f=2*d-f,v=2*c-v),r=f,a=v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),c=n,f=(d=i)+e[1],v=c+e[2];break;case"T":i=e[1],n=e[2],f=2*d-f,v=2*c-v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=i,c=n;break;case"a":zt(this,d+s,c+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+s,e[7]+c+o]),d+=e[6],c+=e[7];break;case"A":zt(this,d+s,c+o,[e[1],e[2],e[3],e[4],e[5],e[6]+s,e[7]+o]),d=e[6],c=e[7];break;case"z":case"Z":this.closePath()}h=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(var a=0,s=t.length;a<s;++a){var o=t[a].slice();switch(o[0]){case jt:this.lineToTransform(o,e,i,n,r);break;case Dt:this.moveToTransform(o,e,i,n,r);break;case Lt:this.bezierCurveToTransform(o,e,i,n,r);break;case Nt:this.quadraticCurveToTransform(o,e,i,n,r);break;case Ot:this.arcToTransform(o,e,i,n,r);break;case It:this.ellipseTransform(o,e,i,n,r);break;case Ut:this.rectTransform(o,e,i,n,r);break;case Et:this.arcToTransform(o,e,i,n,r);break;case Rt:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),Wt(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===kt.COLUMN){if(!this.curves.length)return 0;var t=this.curves[0],i=this.curves[this.curves.length-1];return e.abs(t.p0.y-i.p1.y)}if(this.direction===kt.ROW){if(!this.curves.length)return 0;var n=this.curves[0],r=this.curves[this.curves.length-1];return e.abs(n.p0.x-r.p1.x)}return this.curves.reduce((function(t,e){return t+e.getLength()}),0)}},{key:"getAttrAt",value:function(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};for(var e,i=0,n=0;n<this.curves.length;n++){var r=(e=this.curves[n]).getLength(this.direction);if(i+r>=t)break;i+=r}var a=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(a),angle:e.getAngleAt(a)}}}]),n}(Pt),me=["l",0,0,0,0,0,0,0];function xe(t,e,i){var n=me[0]=t[0];if("a"===n||"A"===n)me[1]=e*t[1],me[2]=i*t[2],me[3]=t[3],me[4]=t[4],me[5]=t[5],me[6]=e*t[6],me[7]=i*t[7];else if("h"===n||"H"===n)me[1]=e*t[1];else if("v"===n||"V"===n)me[1]=i*t[1];else for(var r=1,a=t.length;r<a;++r)me[r]=(r%2==1?e:i)*t[r];return me}var _e={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 e.Matrix},Ae={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ke=Object.assign({outerBorder:Object.assign(Object.assign({},Ae),{distance:0}),innerBorder:Object.assign(Object.assign({},Ae),{distance:0})},Ae),Be={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",disableAutoClipedPoptip:void 0},Se=Object.assign(Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",blur:0,cursor:null,html:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),ke),{alignSelf:"auto"}),{pickStrokeBuffer:0}),we={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Te=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,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},{_debug_bounds:!1}),Se),_e),Pe=Object.assign(Object.assign({},Te),{startAngle:0,endAngle:e.pi2,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Ce=Object.assign(Object.assign(Object.assign({},Te),we),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Me=Object.assign(Object.assign({},Te),{radius:1,startAngle:0,endAngle:e.pi2}),Oe=Object.assign(Object.assign({},Te),{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"}),Ee=Object.assign(Object.assign({},Te),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Le=Object.assign(Object.assign(Object.assign({},Te),we),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),Re=Object.assign(Object.assign({},Te),{path:new be,customPath:function(){e.Logger.getInstance().warn("空函数")}}),Ie=Object.assign(Object.assign({},Te),{points:[],cornerRadius:0,closePath:!0}),je=Object.assign(Object.assign({},Te),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),De=Object.assign(Object.assign({},Te),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Ne=Object.assign(Object.assign({},Te),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ue=Object.assign(Object.assign(Object.assign({},Te),Be),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ze=Object.assign(Object.assign({},Te),{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}),He=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Te),{fill:!0,cornerRadius:0}),We=Object.assign(Object.assign({},He),{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}),Ve=new(o((function t(){a(this,t)}))),Fe={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"}},Ge=!0,Ye=!1,Xe=/\w|\(|\)|-/,$e=/[.?!,;:/,。?!、;:]/,qe=/\S/;function Ke(t,e,i,n,r){if(!e||e<=0)return 0;for(var a=Ve.graphicUtil.textMeasure,s=n,o=t.slice(0,s),l=Math.floor(a.measureText(o,i).width),u=t.slice(0,s+1),h=Math.floor(a.measureText(u,i).width);l>e||h<=e;){if(l>e?s--:s++,s>t.length){s=t.length;break}if(s<0){s=0;break}o=t.slice(0,s),l=Math.floor(a.measureText(o,i).width),u=t.slice(0,s+1),h=Math.floor(a.measureText(u,i).width)}return r&&(s=Ze(t,s)),s}function Ze(t,e){for(var i=e;Xe.test(t[i-1])&&Xe.test(t[i])||$e.test(t[i]);)if(--i<=0)return e;return i}function Je(t,e){var i=Ve.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var Qe=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ti=function(){function t(){a(this,t)}return o(t,[{key:"configure",value:function(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}},{key:"measureTextWidth",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}},{key:"estimate",value:function(t,e){for(var i=e.fontSize,n=void 0===i?Ue.fontSize:i,r=0,a=0,s=0;s<t.length;s++)t.charCodeAt(s)<128?r++:a++;return{width:~~(.8*r*n+a*n),height:n}}},{key:"measureTextPixelHeight",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Be.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Be.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}},{key:"measureText",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}},{key:"clipTextVertical",value:function(t,e,i,n){var r=this;if(0===t.length)return{verticalList:t,width:0};var a=e.fontSize,s=void 0===a?12:a;t.forEach((function(t){t.width=0===t.direction?s:r.measureTextWidth(t.text,e)}));for(var o=[],l=0,u=0;u<t.length&&l+t[u].width<i;u++)l+=t[u].width,o.push(t[u]);if(t[u]&&t[u].text.length>1){var h=this._clipText(t[u].text,e,i-l,0,t[u].text.length-1,"end",!1);if(n&&h.str!==t[u].text){for(var d="",c=0,f=0;f<u;f++){var v=t[f];d+=v.text,c+=v.text.length}var p=Ze(d+=t[u].text,c+h.str.length);(p-=c)!==h.str.length-1&&(h.str=h.str.substring(0,p),h.width=this.measureTextWidth(h.str,e))}o.push(Object.assign(Object.assign({},t[u]),{text:h.str,width:h.width})),l+=h.width}return{verticalList:o,width:l}}},{key:"clipText",value:function(t,e,i,n){if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if((r=this.measureTextWidth(t[0],e))>i)return{str:"",width:0};var a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&a.str!==t){var s=Ze(t,a.str.length);s!==a.str.length&&(a.str=t.substring(0,s),a.width=this.measureTextWidth(a.str,e))}return a}},{key:"_clipText",value:function(t,e,i,n,r,a,s){var o;if("start"===a)o=this._clipTextStart(t,e,i,n,r),s&&(o.result=s+o.str);else if("middle"===a){var l=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:l.width,result:l.left+s+l.right}}else o=this._clipTextEnd(t,e,i,n,r),s&&(o.result=o.str+s);return o}},{key:"_clipTextEnd",value:function(t,e,i,n,r){var a,s=Math.floor((n+r)/2),o=t.substring(0,s+1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};var u=t.substring(0,s);return(a=this.measureTextWidth(u,e))<=i?{str:u,width:a}:this._clipTextEnd(t,e,i,n,s)}if(l<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(0,s+2);return(a=this.measureTextWidth(h,e))>=i?{str:o,width:l}:this._clipTextEnd(t,e,i,s,r)}return{str:o,width:l}}},{key:"_clipTextStart",value:function(t,e,i,n,r){var a,s=Math.ceil((n+r)/2),o=t.substring(s-1,t.length-1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};var u=t.substring(s,t.length-1);return(a=this.measureTextWidth(u,e))<=i?{str:u,width:a}:this._clipTextStart(t,e,i,s,t.length-1)}if(l<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(s-2,t.length-1);return(a=this.measureTextWidth(h,e))>=i?{str:o,width:l}:this._clipTextStart(t,e,i,n,s)}return{str:o,width:l}}},{key:"_clipTextMiddle",value:function(t,e,i,n,r,a,s,o){var l=t.substring(0,o),u=this.measureTextWidth(l,e);if(u+s>i)return{left:n,right:r,width:a+s};var h=t.substring(t.length-o,t.length),d=this.measureTextWidth(h,e);return u+d>i?{left:l,right:r,width:u+s}:this._clipTextMiddle(t,e,i,l,h,u,d,o+1)}},{key:"clipTextWithSuffixVertical",value:function(t,e,i,n,r,a){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};var 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;var o,l=this.measureTextWidth(n,e);if(l>i)return s;if(i-=l,"start"===a){var u=this.revertVerticalList(t);o=this.clipTextVertical(u,e,i,r);var h=this.revertVerticalList(o.verticalList);h.unshift({text:n,direction:1,width:l}),o.verticalList=h}else if("middle"===a){var d=this.clipTextVertical(t,e,i/2,r),c=this.revertVerticalList(t),f=this.clipTextVertical(c,e,i/2,r);d.verticalList.push({text:n,direction:1,width:l}),this.revertVerticalList(f.verticalList).forEach((function(t){return d.verticalList.push(t)})),o={verticalList:d.verticalList,width:d.width+f.width}}else(o=this.clipTextVertical(t,e,i,r)).verticalList.push({text:n,direction:1,width:l});return o.width+=l,o}},{key:"revertVerticalList",value:function(t){return t.reverse().map((function(t){var e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}},{key:"clipTextWithSuffix",value:function(t,e,i,n,r,a){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};var s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};var o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;var l=this._clipText(t,e,i,0,t.length-1,a,n);if(r&&l.str!==t){var u=Ze(t,l.str.length);u!==l.str.length&&(l.str=t.substring(0,u),l.width=this.measureTextWidth(l.str,e))}return l.str=l.result,l.width+=o,l}}]),t}();ti=Qe([D()],ti);var ei=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ii=Symbol.for("TextMeasureContribution"),ni=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i)}(ti);ni=ei([D()],ni);var ri=new Q,ai=Symbol.for("CanvasFactory");function si(t){return ri.getNamed(ai,Ve.global.env)(t)}var oi=function(){function t(){a(this,t),this.pools=[],this.allocatedCanvas=[]}return o(t,[{key:"shareCanvas",value:function(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}},{key:"getCommonCanvas",value:function(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}},{key:"allocate",value:function(t){if(!this.pools.length){var e=si(Object.assign({nativeCanvas:Ve.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}var i=this.pools.pop();return i.resize(t.width,t.height),i.dpr=t.dpr,i}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=si(Object.assign({nativeCanvas:Ve.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}var n=this.pools.pop();return n.width=t.width,n.height=t.height,n}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),li=new oi,ui=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hi=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},di=Symbol.for("VWindow"),ci=Symbol.for("WindowHandlerContribution"),fi=function(){function t(){a(this,t),this.hooks={onChange:new rt(["x","y","width","height"])},this._uid=k.GenAutoIncrementId(),this.global=Ve.global,this.postInit()}return o(t,[{key:"width",get:function(){if(this._handler){var t=this._handler.getWH();return this._width=t.width}return this._width}},{key:"height",get:function(){if(this._handler){var t=this._handler.getWH();return this._height=t.height}return this._height}},{key:"dpr",get:function(){return this._handler.getDpr()}},{key:"postInit",value:function(){var t=this;this.global.hooks.onSetEnv.tap("window",(function(){t.active()})),this.active()}},{key:"active",value:function(){var t=this.global;t.env&&!this.actived&&(ri.getNamed(ci,t.env).configure(this,t),this.actived=!0)}},{key:"style",get:function(){return this._handler.getStyle()},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){this._handler.createWindow(t);var e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}},{key:"setWindowHandler",value:function(t){this._handler=t}},{key:"setDpr",value:function(t){return this._handler.setDpr(t)}},{key:"resize",value:function(t,e){return this._handler.resizeWindow(t,e)}},{key:"configure",value:function(){throw new Error("暂不支持")}},{key:"release",value:function(){return this._handler.releaseWindow()}},{key:"getContext",value:function(){return this._handler.getContext()}},{key:"getNativeHandler",value:function(){return this._handler.getNativeHandler()}},{key:"getImageBuffer",value:function(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}},{key:"addEventListener",value:function(t,e,i){return this._handler.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._handler.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._handler.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this._handler.getBoundingClientRect()}},{key:"getContainer",value:function(){return this._handler.container}},{key:"clearViewBox",value:function(t,e){this._handler.clearViewBox(t,e)}},{key:"isVisible",value:function(t){return this._handler.isVisible(t)}},{key:"onVisibleChange",value:function(t){return this._handler.onVisibleChange(t)}},{key:"getTopLeft",value:function(t){return this._handler.getTopLeft(t)}}]),t}();fi=ui([D(),hi("design:paramtypes",[])],fi);var vi,pi=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gi=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yi=function(t,e){return function(i,n){e(i,n,t)}},bi=function(){function t(e){var i=this;a(this,t),this.contributions=e,this.configured=!1,this.global=Ve.global,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,n){i.configured=!1,i.configure(n,e)}))}return o(t,[{key:"canvas",get:function(){return this.tryInitCanvas(),this._canvas}},{key:"context",get:function(){return this.tryInitCanvas(),this._context}},{key:"textMeasure",get:function(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}},{key:"configure",value:function(t,e){var i=this;this.configured||(this.contributions.getContributions().forEach((function(t){t.configure(i,e)})),this.configured=!0)}},{key:"tryInitCanvas",value:function(){if(!this._canvas){var t=li.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);var r=this.global.measureTextMethod;this.global.measureTextMethod=n;var a={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:Be.fontSize};return this.global.measureTextMethod=r,a}},{key:"createTextMeasureInstance",value:function(t,i,n){var r=this;return this.configure(this.global,this.global.env),new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:Be.fontFamily,fontSize:Be.fontSize},getCanvasForMeasure:n||function(){return r.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t)}},{key:"drawGraphicToCanvas",value:function(t,e,i){if(!e.defaultLayer)return null;var n=ri.get(di),r=t.AABBBounds,a=r.width(),s=r.height();n.create({width:a,height:s,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});var o=-r.x1,l=-r.y1,u=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{x:o,y:l,width:a,height:s,stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=u;var h=n.getNativeHandler();return h.nativeCanvas?h.nativeCanvas:null}}]),t}();bi=pi([D(),yi(0,I(et)),yi(0,N(ii)),gi("design:paramtypes",[Object])],bi),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(vi||(vi={}));var mi=new e.Matrix,xi=function(){function t(){a(this,t),this.matrix=new e.Matrix}return o(t,[{key:"init",value:function(t){return this.mode=vi.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=vi.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,i){var n=this.outSourceMatrix;if(mi.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){var r=i.x,a=i.y;this.outTargetMatrix.translate(r,a),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-a)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(mi.a,mi.b,mi.c,mi.d,mi.e,mi.f),this}},{key:"rotateMatrix",value:function(t,e){var i=this.outSourceMatrix;if(mi.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){var n=e.x,r=e.y;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(mi.a,mi.b,mi.c,mi.d,mi.e,mi.f),this}},{key:"scale",value:function(t,e,i){return this.mode===vi.matrix?this.scaleMatrix(t,e,i):this}},{key:"rotate",value:function(t,e){return this.mode===vi.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var i=this.outSourceMatrix;return mi.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(mi.a,mi.b,mi.c,mi.d,mi.e,mi.f),this}},{key:"translate",value:function(t,e){return this.mode===vi.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===vi.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}]),t}();xi=pi([D(),gi("design:paramtypes",[])],xi);var _i={arc:Pe,area:Ce,circle:Me,line:Le,path:Re,symbol:Ne,text:Ue,rect:je,rect3d:De,polygon:Ie,richtext:ze,richtextIcon:We,image:He,group:Oe,glyph:Ee},Ai=Object.keys(_i);function ki(t,e){Object.keys(e).forEach((function(i){t[i]=e[i]}))}var Bi={arc:Object.assign({},_i.arc),area:Object.assign({},_i.area),circle:Object.assign({},_i.circle),line:Object.assign({},_i.line),path:Object.assign({},_i.path),symbol:Object.assign({},_i.symbol),text:Object.assign({},_i.text),rect:Object.assign({},_i.rect),rect3d:Object.assign({},_i.rect3d),polygon:Object.assign({},_i.polygon),richtext:Object.assign({},_i.richtext),richtextIcon:Object.assign({},_i.richtextIcon),image:Object.assign({},_i.image),group:Object.assign({},_i.group),glyph:Object.assign({},_i.glyph)},Si=function(){function t(){a(this,t),this.initTheme(),this.dirty=!1}return o(t,[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},Ai.forEach((function(e){t._defaultTheme[e]=Object.create(Bi[e])})),this.combinedTheme=this._defaultTheme}},{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}},{key:"getParentWithTheme",value:function(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}},{key:"applyTheme",value:function(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var r=this.getParentWithTheme(t);if(r){var a=r.theme;(a.dirty||n)&&a.applyTheme(r,i,!0)}this.userTheme?this.doCombine(r&&r.theme.combinedTheme):(r?this.combinedTheme=r.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,e.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this,i=this.userTheme,n=this.combinedTheme;Ai.forEach((function(r){var a=Object.create(Bi[r]);t&&t[r]&&ki(a,t[r]),n[r]&&ki(a,n[r]),i[r]&&ki(a,i[r]),e.combinedTheme[r]=a})),i.common&&Ai.forEach((function(t){ki(e.combinedTheme[t],i.common)})),this.dirty=!1}},{key:"setTheme",value:function(t,e){var i=this.userTheme;i?Object.keys(t).forEach((function(e){i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}},{key:"resetTheme",value:function(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}},{key:"dirtyChildren",value:function(t){var e=this;t.forEachChildren((function(t){t.isContainer&&(t.theme&&(t.theme.dirty=!0),e.dirtyChildren(t))}))}}]),t}(),wi=new Si;function Ti(t,e){return t.glyphHost?Ti(t.glyphHost):e?(t.isContainer,e):function(t){var 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)):wi.getTheme()}return null}(t)||wi.getTheme()}var Pi=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))},Ci=function(t){u(r,t);var i=g(r);function r(){var t;return a(this,r),(t=i.call(this))._uid=k.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return o(r,[{key:"previousSibling",get:function(){return this._prev}},{key:"nextSibling",get:function(){return this._next}},{key:"children",get:function(){return this.getChildren()}},{key:"firstChild",get:function(){return this._firstChild}},{key:"lastChild",get:function(){return this._lastChild}},{key:"count",get:function(){return this._count}},{key:"childrenCount",get:function(){return this._idMap?this._idMap.size:0}},{key:"forEachChildren",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])for(var e=this._lastChild,i=0;e;){if(t(e,i++))return;e=e._prev}else for(var n=this._firstChild,r=0;n;){if(t(n,r++))return;n=n._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Pi(this,void 0,void 0,n().mark((function i(){var r,a,s,o,l,u;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!e){i.next=16;break}r=this._lastChild,a=0;case 2:if(!r){i.next=14;break}if(s=t(r,a++),i.t0=s.then,!i.t0){i.next=9;break}return i.next=8,s;case 8:s=i.sent;case 9:if(!s){i.next=11;break}return i.abrupt("return");case 11:r=r._prev;case 12:i.next=2;break;case 14:i.next=29;break;case 16:o=this._firstChild,l=0;case 17:if(!o){i.next=29;break}if(u=t(o,l++),i.t1=u.then,!i.t1){i.next=24;break}return i.next=23,u;case 23:u=i.sent;case 24:if(!u){i.next=26;break}return i.abrupt("return");case 26:o=o._next;case 27:i.next=17;break;case 29:case"end":return i.stop()}}),i,this)})))}},{key:"forEach",value:function(t){return this.forEachChildren(t)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}},{key:"appendChildArrHighPerformance",value:function(t){return console.error("暂不支持该函数"),t}},{key:"insertBefore",value:function(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)}},{key:"insertAfter",value:function(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)}},{key:"insertInto",value:function(t,i){if(!this._ignoreWarn&&this._nodeList&&e.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),i>=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===i)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,r=0;r<i;r++){if(!n)return null;r>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._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}},{key:"insertIntoKeepIdx",value:function(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){var i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}var n;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(n=this._nodeList[r]);r--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;var a=this.insertInto(t,0);return this._ignoreWarn=!1,a}},{key:"removeChild",value:function(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){var e=this._nodeList.findIndex((function(e){return 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}},{key:"delete",value:function(){this.parent&&this.parent.removeChild(this)}},{key:"removeAllChild",value:function(){if(this._idMap){for(var t=this._firstChild;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)}}},{key:"replaceChild",value:function(t,e){throw new Error("暂不支持")}},{key:"find",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren((function(i,r){return!(i===e||!t(i,r)||(n=i,0))})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}},{key:"findAll",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren((function(i,r){i!==e&&t(i,r)&&n.push(i)})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}},{key:"getElementById",value:function(t){return this.find((function(e){return e.id===t}),!0)}},{key:"findChildById",value:function(t){return this.getElementById(t)}},{key:"findChildByUid",value:function(t){return this._idMap&&this._idMap.get(t)||null}},{key:"getElementsByName",value:function(t){return this.findAll((function(e){return e.name===t}),!0)}},{key:"findChildrenByName",value:function(t){return this.getElementsByName(t)}},{key:"getElementsByType",value:function(t){return this.findAll((function(e){return e.type===t}),!0)}},{key:"getChildByName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((function(e){return e.name===t}),e)}},{key:"getChildAt",value:function(t){var e=this._firstChild;if(!e)return null;for(var i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}},{key:"at",value:function(t){return this.getChildAt(t)}},{key:"containNode",value:function(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;for(var e=this._firstChild;e;){if(e.containNode(t))return!0;e=e._next}return!1}},{key:"getRootNode",value:function(){for(var t=this.parent;null==t?void 0:t.parent;)t=t.parent;return t||this}},{key:"hasChildNodes",value:function(){return null!==this._firstChild}},{key:"addChild",value:function(t){return this.appendChild(t)}},{key:"add",value:function(t){return this.appendChild(t)}},{key:"getChildren",value:function(){for(var t=[],e=this._firstChild;e;)t.push(e),e=e._next;return t}},{key:"isChildOf",value:function(t){return!!this.parent&&this.parent._uid===t._uid}},{key:"isParentOf",value:function(t){return t.isChildOf(this)}},{key:"isDescendantsOf",value:function(t){var e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}},{key:"isAncestorsOf",value:function(t){return t.isDescendantsOf(this)}},{key:"getAncestor",value:function(t){throw new Error("暂不支持")}},{key:"setAllDescendantsProps",value:function(t,e){for(var i=this._firstChild;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}},{key:"setCount",value:function(t){this._count+=t;var e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}},{key:"clone",value:function(){throw new Error("暂不支持")}},{key:"cloneTo",value:function(t){throw new Error("暂不支持")}},{key:"getParent",value:function(){return this.parent}},{key:"del",value:function(t){return this.removeChild(t)}},{key:"addEventListener",value:function(t,i,n){var a=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isObject(n)&&n.once,o=e.isFunction(i)?void 0:i;return t=a?"".concat(t,"capture"):t,i=e.isFunction(i)?i:i.handleEvent,s?y(h(r.prototype),"once",this).call(this,t,i,o):y(h(r.prototype),"on",this).call(this,t,i,o),this}},{key:"on",value:function(t,e,i){return this.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,i,n){var a=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isFunction(i)?void 0:i;t=a?"".concat(t,"capture"):t,i=e.isFunction(i)?i:i.handleEvent;var o=e.isObject(n)&&n.once;return y(h(r.prototype),"off",this).call(this,t,i,s,o),this}},{key:"off",value:function(t,e,i){return this.removeEventListener(t,e,i)}},{key:"once",value:function(t,i,n){return e.isObject(n)?(n.once=!0,this.addEventListener(t,i,n)):this.addEventListener(t,i,{once:!0})}},{key:"removeAllEventListeners",value:function(){return y(h(r.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];return(e=y(h(r.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(n)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}]),r}(e.EventEmitter),Mi=function(){function t(e){a(this,t),this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return o(t,[{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewX",get:function(){return this.viewport.x}},{key:"viewY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}]),t}(),Oi=function(t){u(i,t);var e=g(i);function i(t,n){var r;return a(this,i),(r=e.call(this)).type=t,r.detail=n,r}return o(i)}(Mi),Ei={pickable:!0,visible:!0,dispatchEvent:function(t){var e;if(!(t instanceof Mi))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:function(t,e){return this.dispatchEvent(new Oi(t,e))}},Li=function(){function t(){a(this,t)}return o(t,null,[{key:"linear",value:function(t){return t}},{key:"none",value:function(){return this.linear}},{key:"get",value:function(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))}}},{key:"getPowIn",value:function(t){return function(e){return Math.pow(e,t)}}},{key:"getPowOut",value:function(t){return function(e){return 1-Math.pow(1-e,t)}}},{key:"getPowInOut",value:function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}},{key:"getBackIn",value:function(t){return function(e){return e*e*((t+1)*e-t)}}},{key:"getBackOut",value:function(t){return function(e){return--e*e*((t+1)*e+t)+1}}},{key:"getBackInOut",value:function(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)}}},{key:"sineIn",value:function(t){return 1-Math.cos(t*Math.PI/2)}},{key:"sineOut",value:function(t){return Math.sin(t*Math.PI/2)}},{key:"sineInOut",value:function(t){return-(Math.cos(Math.PI*t)-1)/2}},{key:"expoIn",value:function(t){return 0===t?0:Math.pow(2,10*t-10)}},{key:"expoOut",value:function(t){return 1===t?1:1-Math.pow(2,-10*t)}},{key:"expoInOut",value:function(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}},{key:"circIn",value:function(t){return-(Math.sqrt(1-t*t)-1)}},{key:"circOut",value:function(t){return Math.sqrt(1- --t*t)}},{key:"circInOut",value:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{key:"bounceOut",value:function(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}},{key:"bounceIn",value:function(e){return 1-t.bounceOut(1-e)}},{key:"bounceInOut",value:function(e){return e<.5?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5}},{key:"getElasticIn",value:function(t,i){return function(n){if(0===n||1===n)return n;var r=i/e.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)}}},{key:"getElasticOut",value:function(t,i){return function(n){if(0===n||1===n)return n;var r=i/e.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-r)*e.pi2/i)+1}}},{key:"getElasticInOut",value:function(t,i){return function(n){var r=i/e.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-r)*e.pi2/i)*.5+1}}}]),t}();Li.quadIn=Li.getPowIn(2),Li.quadOut=Li.getPowOut(2),Li.quadInOut=Li.getPowInOut(2),Li.cubicIn=Li.getPowIn(3),Li.cubicOut=Li.getPowOut(3),Li.cubicInOut=Li.getPowInOut(3),Li.quartIn=Li.getPowIn(4),Li.quartOut=Li.getPowOut(4),Li.quartInOut=Li.getPowInOut(4),Li.quintIn=Li.getPowIn(5),Li.quintOut=Li.getPowOut(5),Li.quintInOut=Li.getPowInOut(5),Li.backIn=Li.getBackIn(1.7),Li.backOut=Li.getBackOut(1.7),Li.backInOut=Li.getBackInOut(1.7),Li.elasticIn=Li.getElasticIn(1,.3),Li.elasticOut=Li.getElasticOut(1,.3),Li.elasticInOut=Li.getElasticInOut(1,.3*1.5);var Ri=function(){function t(){a(this,t),this.id=k.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}return o(t,[{key:"addAnimate",value:function(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++}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}},{key:"tick",value:function(t){if(!this.paused){var e=this.animateHead;for(this.animateCount=0;e;)e.status===xt.END?this.removeAnimate(e):e.status===xt.RUNNING||e.status===xt.INITIAL?(this.animateCount++,e.advance(t)):e.status===xt.PAUSED&&this.animateCount++,e=e.nextAnimate}}},{key:"clear",value:function(){for(var t=this.animateHead;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}},{key:"removeAnimate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((function(t){return 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()}}]),t}(),Ii=new Ri,ji=function(){function t(e,i,n,r,s){a(this,t),this.from=e,this.to=i,this.duration=n,this.easing=r,this.params=s,this.updateCount=0}return o(t,[{key:"bind",value:function(t,e){this.target=t,this.subAnimate=e,this.onBind()}},{key:"onBind",value:function(){}},{key:"onFirstRun",value:function(){}},{key:"onStart",value:function(){}},{key:"onEnd",value:function(){}},{key:"getEndProps",value:function(){}},{key:"getFromProps",value:function(){return this.from}},{key:"getMergedEndProps",value:function(){var t,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}},{key:"update",value:function(t,e,i){var n=this;if(0===this.updateCount){this.onFirstRun();var r=this.step.getLastProps();Object.keys(r).forEach((function(t){n.subAnimate.animate.validAttr(t)&&(i[t]=r[t])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}]),t}(),Di=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,null,null,0,"linear")).cb=t,n}return o(i,[{key:"onUpdate",value:function(t,e,i){}},{key:"onStart",value:function(){this.cb()}}]),i}(ji),Ni=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ii;a(this,t),this.id=e,this.timeline=i,this.status=xt.INITIAL,this.tailAnimate=new zi(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return o(t,[{key:"setTimeline",value:function(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}},{key:"getStartTime",value:function(){return this._startTime}},{key:"getDuration",value:function(){return this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0)}},{key:"after",value:function(t){var e=t.getDuration();return this._startTime=e,this}},{key:"afterAll",value:function(t){var i=-1/0;return t.forEach((function(t){i=e.max(t.getDuration(),i)})),this._startTime=i,this}},{key:"parallel",value:function(t){return this._startTime=t.getStartTime(),this}},{key:"play",value:function(t){if(this.tailAnimate.play(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mode;e&&i&_t.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:mt.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,i=new Di((function(){t(e,i.step.prev)}));return this.tailAnimate.play(i),this}},{key:"customInterpolate",value:function(e,i,n,r,a,s){var o=t.interpolateMap.get(e)||t.interpolateMap.get("");return!!o&&o(e,i,n,r,a,s)}},{key:"pause",value:function(){this.status===xt.RUNNING&&(this.status=xt.PAUSED)}},{key:"resume",value:function(){this.status===xt.PAUSED&&(this.status=xt.RUNNING)}},{key:"to",value:function(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"wait",value:function(t){if(this.tailAnimate.wait(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"startAt",value:function(t){if(this.tailAnimate.startAt(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"loop",value:function(t){if(this.tailAnimate.loop=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"reversed",value:function(t){if(this.tailAnimate.reversed=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"bounce",value:function(t){if(this.tailAnimate.bounce=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"subAnimate",value:function(){var t=new zi(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}},{key:"getStartProps",value:function(){return this.subAnimates[0].getStartProps()}},{key:"getEndProps",value:function(){return this.tailAnimate.getEndProps()}},{key:"depreventAttr",value:function(t){this._preventAttrs&&this._preventAttrs.delete(t)}},{key:"preventAttr",value:function(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}},{key:"preventAttrs",value:function(t){var e=this;t.forEach((function(t){return e.preventAttr(t)}))}},{key:"validAttr",value:function(t){return!this._preventAttrs||!this._preventAttrs.has(t)}},{key:"bind",value:function(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((function(e){e.bind(t)})),this}},{key:"advance",value:function(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===xt.INITIAL&&(this.status=xt.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===xt.RUNNING&&(this.status=xt.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,i=0,n=this.rawPosition,r=this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0);t<0&&(t=0);var a=t>=r;if(a&&(t=r),t===n)return a;for(var s=0;s<this.subAnimates.length&&!(i+(e=this.subAnimates[s]).totalDuration>=t);s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),a}},{key:"onStart",value:function(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}},{key:"onEnd",value:function(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}},{key:"onRemove",value:function(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}},{key:"onFrame",value:function(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}},{key:"release",value:function(){this.status=xt.END}},{key:"stop",value:function(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()}}],[{key:"AddInterpolate",value:function(e,i){t.interpolateMap.set(e,i)}}]),t}();Ni.mode=_t.NORMAL,Ni.interpolateMap=new Map;var Ui,zi=function(){function t(e,i){a(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new Hi(0,0,i?Object.assign({},i.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}return o(t,[{key:"totalDuration",get:function(){return this.calcAttr(),this._totalDuration+this._startAt}},{key:"calcAttr",value:function(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}},{key:"bind",value:function(t){return this.target=t,this}},{key:"play",value:function(t){var e=t.duration;(null==e||e<0)&&(e=0);var i=t.easing,n="string"==typeof i?Li[i]:i,r=this._addStep(e,null,n);return r.type=At.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}},{key:"to",value:function(t,e,i,n){var r=this;(null==e||e<0)&&(e=0);var a="string"==typeof i?Li[i]:i,s=this._addStep(e,null,a);return s.type=At.to,this._appendProps(t,s,!!n&&n.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),n&&n.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==r.animate.id&&t.preventAttrs(s.propKeys)})),this}},{key:"from",value:function(t,e,i,n){var r=this;this.to(t,0,i,n);var a={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){a[t]=r.getLastPropByName(t,r.stepTail)})),this.to(a,e,i,n),this.stepTail.type=At.from}},{key:"startAt",value:function(t){return t<0&&(t=0),this._startAt=t,this}},{key:"getStartProps",value:function(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}},{key:"getEndProps",value:function(){return this.stepTail.props}},{key:"getLastStep",value:function(){return this._lastStep}},{key:"wait",value:function(t){if(t>0){var e=this._addStep(+t,null);e.type=At.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}},{key:"_addStep",value:function(t,e,i){var n=new Hi(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}},{key:"_appendProps",value:function(t,e,i){var n=this;e.props=i?t:Object.assign({},t);var r=e.prev,a=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((function(t){void 0===e.props[t]&&(e.props[t]=n.target.getDefaultAttribute(t))}));r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach((function(t){void 0===a[t]&&(a[t]=r.props[t])}))),e.propKeys=Object.keys(e.props),r=r.prev;var s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(a)),e.propKeys.forEach((function(t){if(void 0===s[t]){var e=n.animate.getStartProps();s[t]=e[t]=n.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}},{key:"_appendCustomAnimate",value:function(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}},{key:"setPosition",value:function(t){var e,i,n,r=this.duration,a=this.loop,s=this.rawPosition,o=!1,l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(r<=0)return o=!0;if(n=(t-=l)-(i=Math.floor(t/r))*r,(o=t>=a*r+r)&&(t=(n=r)*(i=a)+r),t===s)return o;var u=!this.reversed!=!(this.bounce&&i%2);return u&&(n=r-n),this._deltaPosition=n-this.position,this.position=n,this.rawPosition=t+l,this.updatePosition(o,u),o}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var i=this.stepHead.next,n=this.position,r=this.duration;if(this.target&&i){for(var a=i.next;a&&a.position<=n;)a=(i=a).next;var s=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(s=i.easing(s)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,s,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(i,s)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,i){if(t!==e)if(i){for(var n=e.prev;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{for(var r=e.next;r&&r!==t;)r.customAnimate&&(r.customAnimate.onStart&&r.customAnimate.onStart(),r.customAnimate.onEnd&&r.customAnimate.onEnd()),r=r.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}},{key:"getLastPropByName",value:function(t,i){for(var n=i.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var r=n.customAnimate.getEndProps()[t];if(void 0!==r)return r}n=n.prev}return e.Logger.getInstance().warn("未知错误,step中找不到属性"),i.props[t]}},{key:"updateTarget",value:function(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}]),t}(),Hi=function(){function t(e,i,n,r){a(this,t),this.duration=i,this.position=e,this.props=n,this.easing=r}return o(t,[{key:"append",value:function(t){t.prev=this,t.next=this.next,this.next=t}},{key:"getLastProps",value:function(){for(var t=this.prev;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}]),t}(),Wi=200,Vi="cubicOut";!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Ui||(Ui={}));var Fi=[!1,!1,!1,!1],Gi=[0,0,0,0],Yi=function(t){return t?e.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Gi[0]=t[0],Gi[2]=t[0],Gi[1]=t[1],Gi[3]=t[1],Gi):t:t:0},Xi=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],$i=[1,2,3,0,1,2,3,0];function qi(t,i,n,r){for(;t>=e.pi2;)t-=e.pi2;for(;t<0;)t+=e.pi2;for(;t>i;)i+=e.pi2;Xi[0].x=n,Xi[1].y=n,Xi[2].x=-n,Xi[3].y=-n;var a=Math.ceil(t/e.halfPi)%4,s=Math.ceil(i/e.halfPi)%4;if(r.add(e.cos(t)*n,e.sin(t)*n),r.add(e.cos(i)*n,e.sin(i)*n),a!==s||i-t>e.pi)for(var o=!1,l=0;l<$i.length;l++)if(o||a!==$i[l]){if(o&&s===$i[l])break;if(o){var u=Xi[$i[l]];r.add(u.x,u.y)}}else{o=!0;var h=Xi[a];r.add(h.x,h.y)}}function Ki(t,i,n){var r=e.pointAt(t.x,t.y,i.x,i.y,n),a=r.x,s=r.y,o=e.pointAt(t.x1,t.y1,i.x1,i.y1,n),l=o.x,u=o.y,h=new e.Point(a,s,l,u);return h.defined=i.defined,h}function Zi(t,i,n){if(!t||!i)return[];Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);var r=[];if(t.length>i.length){r=i.map((function(t){var i=new e.Point(t.x,t.y,t.x1,t.y1);return i.defined=t.defined,i}));for(var a=0;a<i.length;a++)r[a]=Ki(t[a],i[a],n)}else{r=i.map((function(t){var i=new e.Point(t.x,t.y,t.x1,t.y1);return i.defined=t.defined,i}));for(var s=0;s<t.length;s++)r[s]=Ki(t[s],i[s],n)}return r}function Ji(t,i){if(e.isArray(t)){for(var n,r=0;r<t.length&&void 0===n;r++)n=t[r][i];return n}return t[i]}var Qi=function(){function t(){a(this,t),this.durations=[],this.timeout=t.TimeOut,this.lastDate=0,this.durationsListThreshold=30}return o(t,[{key:"call",value:function(t){var e=this;return this.lastDate=Date.now(),setTimeout((function(){e.appendDuration(Date.now()-e.lastDate),t(0)}),this.timeout,!0)}},{key:"clear",value:function(t){clearTimeout(t)}},{key:"appendDuration",value:function(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((function(t,e){return t+e}),0)/this.durations.length,1e3/60),1e3/30)}}]),t}();Qi.TimeOut=1e3/60,new Qi;var tn,en,nn=function(t,i){return e.isString(t)&&"%"===t[t.length-1]?i*(Number.parseFloat(t.substring(0,t.length-1))/100):t},rn=function(t){u(n,t);var i=g(n);function n(t,e,r,s,o){return a(this,n),i.call(this,t,e,r,s,o)}return o(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,i,n,r,a,s,o,l;this.fromNumber=e.isNumber(null===(t=this.from)||void 0===t?void 0:t.text)?null===(i=this.from)||void 0===i?void 0:i.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=e.isNumber(null===(r=this.to)||void 0===r?void 0:r.text)?null===(a=this.to)||void 0===a?void 0:a.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(l=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==l?l:Math.max(e.getDecimalPlaces(this.fromNumber),e.getDecimalPlaces(this.toNumber)))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}]),n}(ji);!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"}(tn||(tn={})),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(en||(en={}));var an=function(){function t(){a(this,t)}return o(t,null,[{key:"Get",value:function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en.Color1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(n===en.Color1){var a=t.store1[i];if(a)return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r;var s=e.Color.parseColorString(i);if(s){var o=[s.r/255,s.g/255,s.b/255,s.opacity];t.store1[i]=o,t.store255[i]=[s.r,s.g,s.b,s.opacity],r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3]}return r}var l=t.store255[i];if(l)return r[0]=l[0],r[1]=l[1],r[2]=l[2],r[3]=l[3],r;var u=e.Color.parseColorString(i);return u&&(t.store1[i]=[u.r/255,u.g/255,u.b/255,u.opacity],t.store255[i]=[u.r,u.g,u.b,u.opacity],r[0]=u.r,r[1]=u.g,r[2]=u.b,r[3]=u.opacity),r}},{key:"Set",value:function(e,i,n){if(i===en.Color1){if(t.store1[e])return;t.store1[e]=n,t.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(t.store255[e])return;t.store255[e]=n,t.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}]),t}();function sn(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),",").concat(t[3].toFixed(2),")"):"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),")"):t}function on(t,e,i,n,r){if(!t||!e)return t&&sn(t)||e&&sn(e)||!1;var a,s,o=!1,l=!1;if(Array.isArray(t)?a=t:"string"==typeof t?a=an.Get(t,en.Color255):o=!0,Array.isArray(e)?s=e:"string"==typeof e?s=an.Get(e,en.Color255):l=!0,o!==l){var u=o?t:e,h=o?e:t,d=Object.assign(Object.assign({},u),{stops:u.stops.map((function(t){return Object.assign(Object.assign({},t),{color:sn(h)})}))});return o?on(u,d,i,n,r):on(d,u,i,n,r)}if(o){if(t.gradient===e.gradient){var c=t,f=e,v=c.stops,p=f.stops;if(v.length!==p.length)return!1;if("linear"===c.gradient)return function(t,e,i){var 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((function(t,e){return{color:hn(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i);if("radial"===c.gradient)return function(t,e,i){var 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((function(t,e){return{color:hn(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i);if("conical"===c.gradient)return function(t,e,i){var 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((function(t,e){return{color:hn(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i)}return!1}return r&&r(a,s),sn(function(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]}(a,s,i),n)}an.store255={},an.store1={};var ln=[0,0,0,0],un=[0,0,0,0];function hn(t,e,i){return an.Get(t,en.Color255,ln),an.Get(e,en.Color255,un),"rgba(".concat(Math.round(ln[0]+(un[0]-ln[0])*i),",").concat(Math.round(ln[1]+(un[1]-ln[1])*i),",").concat(Math.round(ln[2]+(un[2]-ln[2])*i),",").concat(ln[3]+(un[3]-ln[3])*i,")")}var dn=function(){function t(){a(this,t)}return o(t,null,[{key:"GetImage",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?Ve.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&i.imageLoadSuccess(e,r.data):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Ve.global.loadImage(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetSvg",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?Ve.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&Ve.global.getRequestAnimationFrame()((function(){i.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Ve.global.loadSvg(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetFile",value:function(e,i){var n=t.cache.get(e);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((function(t){return t.data})):Promise.resolve(n.data):(n={type:i,loadState:"init"},t.cache.set(e,n),"arrayBuffer"===i?n.dataPromise=Ve.global.loadArrayBuffer(e):"blob"===i?n.dataPromise=Ve.global.loadBlob(e):"json"===i&&(n.dataPromise=Ve.global.loadJson(e)),n.dataPromise.then((function(t){return t.data})))}}]),t}();dn.cache=new Map;var cn=new e.Matrix,fn=new e.AABBBounds,vn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],pn=["x","y"],gn=["scaleX","scaleY"],yn=["angle"],bn=new e.Point,mn={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},xn=function(t){u(n,t);var i=g(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,n),(t=i.call(this))._AABBBounds=new e.AABBBounds,t._updateTag=yt.INIT,t.attribute=r,t.valid=t.isValid(),r.background&&t.loadImage(r.background,!0),t}return o(n,[{key:"AABBBounds",get:function(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}},{key:"OBBBounds",get:function(){return this.tryUpdateOBBBounds()}},{key:"globalAABBBounds",get:function(){return this.tryUpdateGlobalAABBBounds()}},{key:"transMatrix",get:function(){return this.tryUpdateLocalTransMatrix(!0)}},{key:"globalTransMatrix",get:function(){return this.tryUpdateGlobalTransMatrix(!0)}},{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"getOffsetXY",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attribute,a=r.dx,s=void 0===a?t.dx:a,o=r.dy,l=void 0===o?t.dy:o;if(n&&this.parent){var u=this.parent.attribute;bn.x=s+(null!==(e=u.scrollX)&&void 0!==e?e:0),bn.y=l+(null!==(i=u.scrollY)&&void 0!==i?i:0)}else bn.x=s,bn.y=l;return bn}},{key:"onAnimateBind",value:function(t){this._emitCustomEvent("animate-bind",t)}},{key:"tryUpdateAABBBounds",value:function(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Ve.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Ve.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}},{key:"combindShadowAABBBounds",value:function(t){if(this.shadowRoot){var e=this.shadowRoot.AABBBounds.clone();t.union(e)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){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}},{key:"tryUpdateGlobalTransMatrix",value:function(){if(this._globalTransMatrix){if(this.parent){var 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}},{key:"shouldUpdateGlobalMatrix",value:function(){return!0}},{key:"tryUpdateLocalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new e.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&yt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&yt.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&yt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&yt.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&yt.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&yt.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=yt.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,i,n,r){if(!r)return!1;if(n===bt.GLOBAL){var a=new e.Point(t,i);this.parent&&this.parent.globalTransMatrix.transformPoint(a,a),t=a.x,i=a.y}return r.containsPoint(this,{x:t,y:i})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,n=Object.keys(t),r=0;r<n.length;r++){var a=n[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}},{key:"setAttribute",value:function(t,i,n,r){var a,s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(l({},t,i),this.attribute,t,r);s?this._setAttributes(s,n,r):e.isNil(null===(a=this.normalAttrs)||void 0===a?void 0:a[t])?(this.attribute[t]=i,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)):this.normalAttrs[t]=i,"background"===t&&this.loadImage(i,!0)}},{key:"needUpdateTags",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vn,i=0;i<e.length;i++){var n=e[i];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vn,i=0;i<e.length;i++)if(t===e[i])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:mt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=yt.INIT,this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var i,n;if(0===t&&0===e)return this;var r={type:mt.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,pn,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y,this._setAttributes(a));var s=this.attribute,o=s.postMatrix;return o?Ve.transformUtil.fromMatrix(o,o).translate(t,e):(s.x=(null!==(i=s.x)&&void 0!==i?i:_e.x)+t,s.y=(null!==(n=s.y)&&void 0!==n?n:_e.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"translateTo",value:function(t,e){var i=this.attribute;if(i.x===t&&i.y===e)return this;var n={type:mt.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,pn,n);return r?(this._setAttributes(r,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"scale",value:function(t,i,n){var r,a;if(1===t&&1===i)return this;var s={type:mt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:i,scaleCenter:n},this.attribute,gn,s);o&&(t=o.scaleX,i=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));var l=this.attribute;if(n){var u=this.attribute.postMatrix;u||(u=new e.Matrix,l.postMatrix=u),Ve.transformUtil.fromMatrix(u,u).scale(t,i,n)}else l.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:_e.scaleX)*t,l.scaleY=(null!==(a=l.scaleY)&&void 0!==a?a:_e.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}},{key:"scaleTo",value:function(t,e){var i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;var n={type:mt.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,gn,n);return r?(this._setAttributes(r,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"rotate",value:function(t,i){var n;if(0===t)return this;var r={type:mt.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:i},this.attribute,yn,r);a&&(delete a.angle,this._setAttributes(a,!1,r));var s=this.attribute;if(i){var o=this.attribute.postMatrix;o||(o=new e.Matrix,s.postMatrix=o),Ve.transformUtil.fromMatrix(o,o).rotate(t,i)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:_e.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"rotateTo",value:function(t){var e=this.attribute;if(e.angle===t)return this;var i={type:mt.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,yn,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}},{key:"skewTo",value:function(t,e){return this}},{key:"animate",value:function(t){var e=this;this.animates||(this.animates=new Map);var i=new Ni(null==t?void 0:t.id).bind(this);if(t){var n=t.onStart,r=t.onFrame,a=t.onEnd,s=t.onRemove;null!=n&&i.onStart(n),null!=r&&i.onFrame(r),null!=a&&i.onEnd(a),null!=s&&i.onRemove(s),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((function(){e.animates.delete(i.id)})),i}},{key:"onAttributeUpdate",value:function(t){t&&t.skipUpdateCallback||(Ve.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}},{key:"update",value:function(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}},{key:"hasState",value:function(t){return!(!this.currentStates||!this.currentStates.length)&&(!!e.isNil(t)||this.currentStates.includes(t))}},{key:"getState",value:function(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}},{key:"applyStateAttrs",value:function(t,e,i,n){var r,a,s,o,l=this;if(i){var u,h=Object.keys(t),d=this.getNoWorkAnimateAttr(),c={};n?h.forEach((function(e){d[e]?(u||(u={}),u[e]=t[e]):c[e]=void 0===t[e]?l.getDefaultAttribute(e):t[e]})):h.forEach((function(e){d[e]?(u||(u={}),u[e]=t[e]):c[e]=t[e]}));var f=this.animate();f.stateNames=e,f.to(c,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==a?a:Wi,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==o?o:Vi),u&&this.setAttributes(u,!1,{type:mt.STATE})}else this.setAttributes(t,!1,{type:mt.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,i={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(i[t]=e.normalAttrs[t],delete e.normalAttrs[t]):i[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(i){t[i]=e.normalAttrs[i]}))):Object.keys(t).forEach((function(t){i[t]=e.getNormalAttribute(t)})),this.normalAttrs=i}},{key:"getNormalAttribute",value:function(t){var i=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var r=n.getEndProps();e.has(r,t)&&(i=r[t])}})),i}},{key:"clearStates",value:function(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}},{key:"removeState",value:function(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){var i=this.currentStates.filter((function(e){return e!==t}));this.useStates(i,e)}}},{key:"toggleState",value:function(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){var i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}},{key:"addState",value:function(t,e,i){var n;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}}},{key:"useStates",value:function(t,e){var i,n=this;if(t.length){if((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((function(t,e){return n.currentStates[e]!==t}))){var r={};t.forEach((function(e){var i,a=n.stateProxy?n.stateProxy(e,t):null===(i=n.states)||void 0===i?void 0:i[e];a&&Object.assign(r,a)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=yt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=yt.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=yt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&yt.UPDATE_SHAPE_AND_BOUNDS)===yt.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=yt.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=yt.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=yt.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=yt.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=yt.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=yt.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=yt.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag&yt.UPDATE_LAYOUT)}},{key:"getAnchor",value:function(t,e){var i=this,n=[0,0],r=function(){if(e.b)return e.b;var t=i.attribute,n=t.scaleX,r=t.scaleY,a=t.angle;return fn.copy(i._AABBBounds),i.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=i.AABBBounds.clone(),i._AABBBounds.copy(fn),i.setAttributes({scaleX:n,scaleY:r,angle:a}),e.b};if("string"==typeof t[0]){var a=parseFloat(t[0])/100,s=r();n[0]=s.x1+(s.x2-s.x1)*a}else n[0]=t[0];if("string"==typeof t[1]){var o=parseFloat(t[1])/100,l=r();n[1]=l.y1+(l.y2-l.y1)*o}else n[1]=t[1];return n}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,i=t.x,n=void 0===i?_e.x:i,r=t.y,a=void 0===r?_e.y:r,s=t.scaleX,o=void 0===s?_e.scaleX:s,l=t.scaleY,u=void 0===l?_e.scaleY:l,h=t.angle,d=void 0===h?_e.angle:h,c=t.scaleCenter,f=t.anchor,v=t.postMatrix,p=[0,0],g={};if(f&&(p=this.getAnchor(f,g)),!c||1===o&&1===u)e.normalTransform(this._transMatrix,this._transMatrix.reset(),n,a,o,u,d,f&&p);else{var y=this._transMatrix;y.reset(),y.translate(p[0],p[1]),y.rotate(d),y.translate(-p[0],-p[1]),y.translate(n,a),p=this.getAnchor(c,g),Ve.transformUtil.fromMatrix(y,y).scale(o,u,{x:p[0],y:p[1]})}var b=this.getOffsetXY(_e);if(this._transMatrix.e+=b.x,this._transMatrix.f+=b.y,v){var m=cn.setValue(v.a,v.b,v.c,v.d,v.e,v.f),x=this._transMatrix;m.multiply(x.a,x.b,x.c,x.d,x.e,x.f),x.setValue(m.a,m.b,m.c,m.d,m.e,m.f)}}},{key:"doUpdateGlobalMatrix",value:function(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);var t=this.parent.attribute,e=t.scrollX,i=void 0===e?0:e,n=t.scrollY,r=void 0===n?0:n;this._globalTransMatrix.translate(i,r)}}},{key:"setStage",value:function(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){var i=t.getTimeline();this.animates.forEach((function(t){t.setTimeline(i)}))}this._onSetStage&&this._onSetStage(this,t,e),Ve.graphicService.onSetStage(this,t)}}},{key:"setStageToShadowRoot",value:function(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}},{key:"onAddStep",value:function(t){}},{key:"onStop",value:function(t){t&&this.setAttributes(t,!1,{type:mt.ANIMATE_END})}},{key:"onStep",value:function(t,e,i,n,r){var a={};if(i.customAnimate)i.customAnimate.update(r,n,a);else{var s=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,a,i,n,r,s,void 0,o,l)}this.setAttributes(a,!1,{type:mt.ANIMATE_UPDATE,animationState:{ratio:n,end:r,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,i,n,r,a,s,o,l,u){var h=this;u||(u=Object.keys(s),n.propKeys=u),a?n.propKeys.forEach((function(t){e.validAttr(t)&&(i[t]=s[t])})):u.forEach((function(a){var u;if(e.validAttr(a)){var d=s[a],c=null!==(u=o&&o[a])&&void 0!==u?u:t.getLastPropByName(a,n);if(null!=d&&null!=c)e.interpolateFunc&&e.interpolateFunc(a,r,c,d,i)||(e.customInterpolate(a,r,c,d,h,i)||h.defaultInterpolate(d,c,a,i,l,r)||h._interpolate(a,r,c,d,i));else i[a]=d}})),n.parsedProps=l}},{key:"defaultInterpolate",value:function(t,e,i,n,r,a){if(Number.isFinite(t))return n[i]=e+(t-e)*a,!0;if("fill"===i){r||(r={});var s=r.fillColorArray,o=on(e,null!=s?s:t,a,!1,(function(t,e){r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});var l=r.strokeColorArray,u=on(e,null!=l?l:t,a,!1,(function(t,e){r.strokeColorArray=e}));return u&&(n[i]=u),!0}if("shadowColor"===i){r||(r={});var h=r.shadowColorArray,d=on(e,null!=h?h:t,a,!0,(function(t,e){r.shadowColorArray=e}));return d&&(n[i]=d),!0}return!1}},{key:"_interpolate",value:function(t,e,i,n,r){}},{key:"getDefaultAttribute",value:function(t){return Ti(this)[this.type][t]}},{key:"getComputedAttribute",value:function(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}},{key:"onSetStage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}},{key:"attachShadow",value:function(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Ve.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}},{key:"detachShadow",value:function(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}},{key:"toJson",value:function(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((function(t){return t.toJson()}))}}},{key:"createPathProxy",value:function(t){return e.isString(t,!0)?this.pathProxy=(new be).fromString(t):this.pathProxy=new be,this.pathProxy}},{key:"loadImage",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!t||i&&function(t){return!(!t.fill&&!t.stroke)}(t))){var n=t;this.resources||(this.resources=new Map);var r={data:"init",state:null};this.resources.set(n,r),"string"==typeof t?(r.state="loading",t.startsWith("<svg")?(dn.GetSvg(t,this),this.backgroundImg=this.backgroundImg||i):(e.isValidUrl(t)||t.includes("/")||e.isBase64(t))&&(dn.GetImage(t,this),this.backgroundImg=this.backgroundImg||i)):(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||i)}}},{key:"imageLoadSuccess",value:function(t,e,i){if(this.resources){var n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var i=this.resources.get(t);i&&(i.state="fail",e&&e())}}},{key:"_stopAnimates",value:function(t){t&&t.forEach((function(t){t.stop()}))}},{key:"stopAnimates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((function(e){e.stopAnimates(t)}))}},{key:"release",value:function(){this.releaseStatus="released",Ve.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var i,n;if(this._events&&t in this._events){var r=new Oi(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)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),i=0;i<e.length;++i){var r=e[i];Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}]),n}(Ci);xn.mixin(Ei);var _n=function(){function t(e){a(this,t),this.tagname=e,this.child=[],this[":@"]={}}return o(t,[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(l({},t,e))}},{key:"addChild",value:function(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(l(l({},t.tagname,t.child),":@",t[":@"])):this.child.push(l({},t.tagname,t.child))}}]),t}();function An(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function kn(t,e,i){var n=function(t,e){for(var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",a=e;a<t.length;a++){var s=t[a];if(i)s===i&&(i="");else if('"'===s||"'"===s)i=s;else if(s===n[0]){if(!n[1])return{data:r,index:a};if(t[a+1]===n[1])return{data:r,index:a}}else"\t"===s&&(s=" ");r+=s}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var r=n.data,a=n.index,s=r.search(/\s/),o=r,l=!0;-1!==s&&(o=r.substr(0,s).replace(/\s\s*$/,""),r=r.substr(s+1));var u=o;if(i){var h=o.indexOf(":");-1!==h&&(l=(o=o.substr(h+1))!==n.data.substr(h+1))}return{tagName:o,tagExp:r,closeIndex:a,attrExpPresent:l,rawTagName:u}}}var Bn=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),Sn=function(){function t(e){a(this,t),this.currentNode=null,this.options=e,this.tagsNodeStack=[],this.docTypeEntities={}}return o(t,[{key:"addChild",value:function(t,e,i){var n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}},{key:"buildAttributesMap",value:function(t,e,i){var n={};if(t){for(var r=function(t,e){for(var i=[],n=e.exec(t);n;){var r=[];r.startIndex=e.lastIndex-n[0].length;for(var a=n.length,s=0;s<a;s++)r.push(n[s]);i.push(r),n=e.exec(t)}return i}(t,Bn),a=r.length,s=0;s<a;s++){var o=r[s][1],l=r[s][4];o&&(n[o]=void 0===l||(isNaN(l)?l:Number(l)))}return n}}},{key:"parseXml",value:function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new _n("!xml"),i=e,n="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var s=An(t,">",a,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),(i=this.tagsNodeStack.pop())&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",a=s}else if("?"===t[a+1])a=kn(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=An(t,"--\x3e",a+4,"Comment is not closed.");else{var l=kn(t,a,!1),u=l.tagName,h=l.tagExp,d=l.attrExpPresent,c=l.closeIndex;if(u!==e.tagname&&(r+=r?"."+u:u),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===u[u.length-1]?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),h=u):h=h.substr(0,h.length-1);var f=new _n(u);u!==h&&d&&(f[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new _n(u);this.tagsNodeStack.push(i),u!==h&&d&&(v[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,v,r),i=v}n="",a=c}else n+=t[a];return e.child}}]),t}();function wn(t,e){return Tn(t)}function Tn(t,e){for(var i,n={},r=0;r<t.length;r++){var a=t[r],s=Pn(a);if(void 0!==s&&a[s]){var o=Tn(a[s]);i=o,Object.keys(i).length,a[":@"]&&Cn(o,a[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(o)):n[s]=o}}return n}function Pn(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Cn(t,e,i){if(e)for(var n=Object.keys(e),r=n.length,a=0;a<r;a++){var s=n[a];t[s]=e[s]}}var Mn=function(){function t(e){a(this,t),this.options=Object.assign({},t.defaultOptions,e)}return o(t,[{key:"valid",value:function(t){return t.startsWith("<")}},{key:"parse",value:function(t){return!!this.valid&&wn(new Sn(this.options).parseXml(t),this.options)}}]),t}();function On(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Mn.defaultOptions={};var En,Ln=0;function Rn(){return Ln++}function In(t){for(var e=[],i=0,n="",r=0;r<t.length;r++)Nn(t[r])?i?n+=t[r]:(i=1,n=t[r]):(i&&(e.push({text:n,direction:En.VERTICAL}),n="",i=0),e.push({text:t[r],direction:En.HORIZONTAL}));return n&&e.push({text:n,direction:En.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(En||(En={}));var jn=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return jn.set(t,!0)}));var Dn=new Map;function Nn(t){if(jn.has(t))return!0;if(Dn.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((function(t){return Dn.set(t,!0)}));var Un=Rn(),zn=Rn(),Hn=Rn(),Wn=Rn();Rn();var Vn=Rn(),Fn=Rn(),Gn=Rn(),Yn=Rn(),Xn=Rn();Rn();var $n=Rn();Rn();var qn,Kn=Rn(),Zn=Rn(),Jn=Rn(),Qn=Symbol.for("GraphicService"),tr=Symbol.for("GraphicCreator"),er={"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"},ir=Object.keys(er);!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(qn||(qn={}));var nr=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="group",e.parent=null,e.isContainer=!0,e.numberType=Vn,e._childUpdateTag=yt.UPDATE_BOUNDS,e}return o(n,[{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"setTheme",value:function(t){return this.theme||(this.theme=new Si),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new Si)}},{key:"hideAll",value:function(){this.setAttribute("visible",!1),this.forEachChildren((function(t){t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}},{key:"showAll",value:function(){this.setAttribute("visible",!0),this.forEachChildren((function(t){t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}},{key:"containsPoint",value:function(t,i,n){if(n===bt.GLOBAL){var r=new e.Point(t,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),this.AABBBounds.contains(r.x,r.y)}return this.AABBBounds.contains(t,i)}},{key:"shouldUpdateAABBBounds",value:function(){return!!y(h(n.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&yt.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Ve.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Ve.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,i=void 0===e?_e.x:e,r=t.y,a=void 0===r?_e.y:r,s=t.dx,o=void 0===s?_e.dx:s,l=t.dy,u=void 0===l?_e.dy:l,d=t.scaleX,c=void 0===d?_e.scaleX:d,f=t.scaleY,v=void 0===f?_e.scaleY:f,p=t.angle,g=void 0===p?_e.angle:p,b=t.postMatrix;if(0!==i||0!==a||0!==o||0!==u||1!==c||1!==v||0!==g||b)return y(h(n.prototype),"doUpdateLocalMatrix",this).call(this);this._transMatrix.reset()}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=Ti(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=Ve.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),n=t.boundsPadding,r=void 0===n?e.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=yt.CLEAR_BOUNDS,this._childUpdateTag&=yt.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=yt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&yt.UPDATE_BOUNDS||(this._childUpdateTag|=yt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=y(h(n.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),Ve.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){y(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),Ve.graphicService.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=y(h(n.prototype),"appendChild",this).call(this,t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertBefore",value:function(t,e){var i=y(h(n.prototype),"insertBefore",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertAfter",value:function(t,e){var i=y(h(n.prototype),"insertAfter",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertInto",value:function(t,e){var i=y(h(n.prototype),"insertInto",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"removeChild",value:function(t){var e=y(h(n.prototype),"removeChild",this).call(this,t);return t.stage=null,Ve.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){this.forEachChildren((function(t){Ve.graphicService.onRemove(t)})),y(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var i=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Ve.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,i.layer)})))}},{key:"addUpdatePositionTag",value:function(){y(h(n.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){y(h(n.prototype),"addUpdateGlobalPositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){var e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!!(this._updateTag&yt.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,i){var n=this._getChildByName(t);return n?n.setAttributes(e):((n=Ve.graphicService.creator[i](e)).name=t,this.add(n)),n}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(xn);function rr(t){return new nr(t)}nr.NOWORK_ANIMATE_ATTR=mn;var ar,sr=function(t){u(i,t);var e=g(i);function i(t,n,r,s){var o,l;return a(this,i),(o=e.call(this,{})).stage=t,o.global=n,o.window=r,o.main=s.main,o.layerHandler=s.layerHandler,o.layerHandler.init(v(o),r,{main:s.main,canvasId:s.canvasId,width:o.viewWidth,height:o.viewHeight,zIndex:null!==(l=s.zIndex)&&void 0!==l?l:0}),o.layer=v(o),o.subLayers=new Map,o.theme=new Si,o.background="rgba(0, 0, 0, 0)",o.afterDrawCbs=[],o}return o(i,[{key:"offscreen",get:function(){return this.layerHandler.offscreen}},{key:"layerMode",get:function(){return this.layerHandler.type}},{key:"width",get:function(){return this.stage?this.stage.width:0}},{key:"height",get:function(){return this.stage?this.stage.height:0}},{key:"viewWidth",get:function(){return this.stage?this.stage.viewWidth:0}},{key:"viewHeight",get:function(){return this.stage?this.stage.viewHeight:0}},{key:"dirtyBound",get:function(){throw new Error("暂不支持")}},{key:"dpr",get:function(){return this._dpr}},{key:"combineSubLayer",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(i.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&i.forEach((function(t){t.group&&(t.group.incremental=0)})),i.forEach((function(e){Ve.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){y(h(i.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"tryRenderSecondaryLayer",value:function(t,e){var i=this;this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((function(n){n.layer.renderCount=i.renderCount,n.layer.render(t,e)}))}},{key:"render",value:function(t,e){var i,n=this,r=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:r.x,y:r.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((function(t){return t(n)})),this.tryRenderSecondaryLayer(t,e)}},{key:"resize",value:function(t,e){this.layerHandler.resize(t,e)}},{key:"resizeView",value:function(t,e){this.layerHandler.resizeView(t,e)}},{key:"setDpr",value:function(t){this.layerHandler.setDpr(t)}},{key:"afterDraw",value:function(t){this.afterDrawCbs.push(t)}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"prepare",value:function(t,e){}},{key:"combineTo",value:function(t,e){var i,n,r,a=this;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((function(t){return t(a)})))}},{key:"release",value:function(){var t=this;y(h(i.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){Ve.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var i,n,r,a=this;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((function(t){return t(a)}))}}]),i}(nr),or=Symbol.for("TransformUtil"),lr=Symbol.for("GraphicUtil"),ur=Symbol.for("LayerService"),hr=Symbol.for("StaticLayerHandlerContribution"),dr=Symbol.for("DynamicLayerHandlerContribution"),cr=Symbol.for("VirtualLayerHandlerContribution"),fr=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pr=ar=function(){function t(){a(this,t),this.layerMap=new Map,this.global=Ve.global}return o(t,[{key:"tryInit",value:function(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}},{key:"getStageLayer",value:function(t){return this.layerMap.get(t)}},{key:"getRecommendedLayerType",value:function(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}},{key:"getLayerHandler",value:function(t){return"static"===t?ri.get(hr):"dynamic"===t?ri.get(dr):ri.get(cr)}},{key:"createLayer",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();var n=this.getRecommendedLayerType(i.layerMode);n=i.main||i.canvasId?"static":n;var r=this.getLayerHandler(n),a=new sr(t,this.global,t.window,Object.assign(Object.assign({main:!1},i),{layerMode:n,canvasId:null!==(e=i.canvasId)&&void 0!==e?e:ar.GenerateLayerId(),layerHandler:r})),s=this.layerMap.get(t)||[];return s.push(a),this.layerMap.set(t,s),this.staticLayerCountInEnv--,a}},{key:"prepareStageLayer",value:function(t){var e;t.forEachChildren((function(t){var i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i).secondaryHandlers=[]}))}},{key:"releaseLayer",value:function(t,e){e.release();var i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((function(t){return t!==e})))}},{key:"layerCount",value:function(t){return(this.layerMap.get(t)||[]).length}},{key:"restLayerCount",value:function(t){return"browser"===this.global.env?10:0}}],[{key:"GenerateLayerId",value:function(){return"".concat(ar.idprefix,"_").concat(ar.prefix_count++)}}]),t}();pr.idprefix="visactor_layer",pr.prefix_count=0,pr=ar=fr([D(),vr("design:paramtypes",[])],pr);var gr=new B((function(t){t(st).to(ht).inSingletonScope(),t(di).to(fi),t(lr).to(bi).inSingletonScope(),t(or).to(xi).inSingletonScope(),t(ur).to(pr).inSingletonScope()}));function yr(t,e){return!(!t&&!e)}function br(t,i){return(e.isArray(t)?t.some((function(t){return t||void 0===t})):!!t)&&i>0}function mr(t,e,i){return i&&t*e>0}function xr(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function _r(t,e){return t*e>0}function Ar(t,e,i,n){return t*e>0&&0!==i&&0!==n}function kr(t,i,n,r,a,s,o,l){var u=n-t,h=r-i,d=o-a,c=l-s,f=c*u-d*h;return f*f<e.epsilon?[]:[t+(f=(d*(i-s)-c*(t-a))/f)*u,i+f*h]}function Br(t,e,i,n,r,a,s){var o=t-i,l=e-n,u=(s?a:-a)/Math.sqrt(o*o+l*l),h=u*l,d=-u*o,c=t+h,f=e+d,v=i+h,p=n+d,g=(c+v)/2,y=(f+p)/2,b=v-c,m=p-f,x=b*b+m*m,_=r-a,A=c*p-v*f,k=(m<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A)),B=(A*m-b*k)/x,S=(-A*b-m*k)/x,w=(A*m+b*k)/x,T=(-A*b+m*k)/x,P=B-g,C=S-y,M=w-g,O=T-y;return P*P+C*C>M*M+O*O&&(B=w,S=T),{cx:B,cy:S,x01:-h,y01:-d,x11:B*(r/_-1),y11:S*(r/_-1)}}function Sr(t,i,n,r,a,s,o){var l=t.getParsedAngle(),u=l.startAngle,h=l.endAngle,d=e.abs(h-u),c=h>u,f=!1;if(a<s){var v=a;a=s,s=v}if(a<=e.epsilon)i.moveTo(n,r);else if(d>=e.pi2-e.epsilon)i.moveTo(n+a*e.cos(u),r+a*e.sin(u)),i.arc(n,r,a,u,h,!c),s>e.epsilon&&(i.moveTo(n+s*e.cos(h),r+s*e.sin(h)),i.arc(n,r,s,h,u,c));else{var p,g,y,b,m=t.getParsedCornerRadius(),x=t.getParsePadAngle(u,h),_=x.outerDeltaAngle,A=x.innerDeltaAngle,k=x.outerStartAngle,B=x.outerEndAngle,S=x.innerEndAngle,w=x.innerStartAngle,T=m,P=m,C=m,M=m,O=Math.max(P,T),E=Math.max(C,M),L=O,R=E,I=a*e.cos(k),j=a*e.sin(k),D=s*e.cos(S),N=s*e.sin(S);if((E>e.epsilon||O>e.epsilon)&&(p=a*e.cos(B),g=a*e.sin(B),y=s*e.cos(w),b=s*e.sin(w),d<e.pi)){var U=kr(I,j,y,b,p,g,D,N);if(U){var z=I-U[0],H=j-U[1],W=p-U[0],V=g-U[1],F=1/e.sin(e.acos((z*W+H*V)/(e.sqrt(z*z+H*H)*e.sqrt(W*W+V*V)))/2),G=e.sqrt(U[0]*U[0]+U[1]*U[1]);R=e.min(E,(s-G)/(F-1)),L=e.min(O,(a-G)/(F+1))}}if(_<.001)o&&(o[3]||o[1])&&i.moveTo(n+I,r+j),f=!0;else if(L>e.epsilon){var Y=e.min(T,L),X=e.min(P,L),$=Br(y,b,I,j,a,Y,Number(c)),q=Br(p,g,D,N,a,X,Number(c));L<O&&Y===X?!o||o[0]?(i.moveTo(n+$.cx+$.x01,r+$.cy+$.y01),i.arc(n+$.cx,r+$.cy,L,e.atan2($.y01,$.x01),e.atan2(q.y01,q.x01),!c)):i.moveTo(n+$.cx+L*e.cos(e.atan2(q.y01,q.x01)),r+$.cy+L*e.sin(e.atan2(q.y01,q.x01))):!o||o[0]?(i.moveTo(n+$.cx+$.x01,r+$.cy+$.y01),Y>0&&i.arc(n+$.cx,r+$.cy,Y,e.atan2($.y01,$.x01),e.atan2($.y11,$.x11),!c),i.arc(n,r,a,e.atan2($.cy+$.y11,$.cx+$.x11),e.atan2(q.cy+q.y11,q.cx+q.x11),!c),X>0&&i.arc(n+q.cx,r+q.cy,X,e.atan2(q.y11,q.x11),e.atan2(q.y01,q.x01),!c)):X>0?i.moveTo(n+q.cx+X*e.cos(e.atan2(q.y01,q.x01)),r+q.cy+X*e.sin(e.atan2(q.y01,q.x01))):i.moveTo(n+p,r+a*e.sin(B))}else!o||o[0]?(i.moveTo(n+I,r+j),i.arc(n,r,a,k,B,!c)):i.moveTo(n+a*e.cos(B),r+a*e.sin(B));if(!(s>e.epsilon)||A<.001)!o||o[1]?i.lineTo(n+D,r+N):i.moveTo(n+D,r+N),f=!0;else if(R>e.epsilon){var K=e.min(M,R),Z=e.min(C,R),J=Br(D,N,p,g,s,-Z,Number(c)),Q=Br(I,j,y,b,s,-K,Number(c));if(!o||o[1]?i.lineTo(n+J.cx+J.x01,r+J.cy+J.y01):i.moveTo(n+J.cx+J.x01,r+J.cy+J.y01),R<E&&K===Z){var tt=e.atan2(Q.y01,Q.x01);!o||o[2]?i.arc(n+J.cx,r+J.cy,R,e.atan2(J.y01,J.x01),tt,!c):i.moveTo(n+J.cx+e.cos(tt),r+J.cy+e.sin(tt))}else!o||o[2]?(Z>0&&i.arc(n+J.cx,r+J.cy,Z,e.atan2(J.y01,J.x01),e.atan2(J.y11,J.x11),!c),i.arc(n,r,s,e.atan2(J.cy+J.y11,J.cx+J.x11),e.atan2(Q.cy+Q.y11,Q.cx+Q.x11),c),K>0&&i.arc(n+Q.cx,r+Q.cy,K,e.atan2(Q.y11,Q.x11),e.atan2(Q.y01,Q.x01),!c)):K>0?i.moveTo(n+Q.cx+K*e.cos(e.atan2(Q.y01,Q.x01)),r+Q.cy+K*e.sin(e.atan2(Q.y01,Q.x01))):i.moveTo(n+y,r+b)}else!o||o[1]?i.lineTo(n+D,r+N):i.moveTo(n+D,r+N),!o||o[2]?i.arc(n,r,s,S,w,c):i.moveTo(n+s*e.cos(w),r+s*e.sin(w))}return o?o[3]&&i.lineTo(n+a*e.cos(u),r+a*e.sin(u)):i.closePath(),f}var wr=Symbol.for("ArcRenderContribution"),Tr=Symbol.for("AreaRenderContribution"),Pr=Symbol.for("CircleRenderContribution"),Cr=Symbol.for("GroupRenderContribution"),Mr=Symbol.for("ImageRenderContribution"),Or=Symbol.for("PathRenderContribution"),Er=Symbol.for("PolygonRenderContribution"),Lr=Symbol.for("RectRenderContribution"),Rr=Symbol.for("SymbolRenderContribution"),Ir=Symbol.for("TextRenderContribution"),jr=Symbol.for("InteractiveSubRenderContribution"),Dr=["radius","startAngle","endAngle"].concat(m(vn)),Nr=function(t){u(i,t);var e=g(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return a(this,i),(t=e.call(this,n)).type="circle",t.numberType=Wn,t}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,i=t.endAngle,n=t.radius;return this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}},{key:"doUpdateAABBBounds",value:function(t){var e=Ti(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Ve.graphicService.updateCircleAABBBounds(i,Ti(this).circle,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=Yi(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ti(this).circle[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Dr)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Dr)}},{key:"toCustomPath",value:function(){var t,e,i,n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),a=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),s=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new be;return o.arc(0,0,r,a,s),o}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(xn);function Ur(t){return new Nr(t)}function zr(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Hr(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}Nr.NOWORK_ANIMATE_ATTR=mn;var Wr=function(){function t(e,i,n){a(this,t),this.fontFamily=e,this.textOptions=i,this.textMeasure=n}return o(t,[{key:"LayoutBBox",value:function(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}},{key:"GetLayout",value:function(t,e,i,n,r,a,s,o,l){for(var u=[],h=[e,i],d=[0,0];t.length>0;){var c=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,s,o,l).str;u.push({str:c,width:this.textMeasure.measureTextWidth(c,this.textOptions)}),t=t.substring(c.length)}"left"===n||"start"===n||("center"===n?d[0]=h[0]/-2:"right"!==n&&"end"!==n||(d[0]=-h[0])),"top"===r||("middle"===r?d[1]=h[1]/-2:"bottom"===r&&(d[1]=-h[1]));var f={xOffset:d[0],yOffset:d[1],width:h[0],height:h[1]};return this.layoutWithBBox(f,u,n,r,a)}},{key:"GetLayoutByLines",value:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((function(t){return t.toString()}));var l=[],u=[0,0];if("number"==typeof s&&s!==1/0){for(var h,d=0,c=t.length;d<c;d++)h=Math.min(this.textMeasure.measureTextWidth(t[d],this.textOptions),s),l.push({str:this.textMeasure.clipTextWithSuffix(t[d],this.textOptions,h,r,a,o).str,width:h});u[0]=s}else{var f,v;s=0;for(var p=0,g=t.length;p<g;p++)v=t[p],f=this.textMeasure.measureTextWidth(v,this.textOptions),s=Math.max(s,f),l.push({str:v,width:f});u[0]=s}u[1]=l.length*n,u[0]=l.reduce((function(t,e){return Math.max(t,e.width)}),0);var y={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(y,e,i),this.layoutWithBBox(y,l,e,i,n)}},{key:"layoutWithBBox",value:function(t,e,i,n,r){var a=[0,0],s=e.length*r;"top"===n||("middle"===n?a[1]=(t.height-s)/2:"bottom"===n&&(a[1]=t.height-s));for(var o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}},{key:"lineOffset",value:function(t,e,i,n,r,a){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+a[1],a[1]+=r,e}}]),t}(),Vr=["text","maxLineWidth","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp"].concat(m(vn)),Fr=function(t){u(n,t);var i=g(n);function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return a(this,n),(t=i.call(this,e)).type="text",t.numberType=Jn,t.cache={},t}return o(n,[{key:"font",get:function(){var t=Ti(this).text;return this._font||(this._font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);var n=t.fontStyle,r=void 0===n?e.fontStyle:n,a=t.fontVariant,s=void 0===a?e.fontVariant:a,o=t.fontWeight,l=void 0===o?e.fontWeight:o,u=t.fontSize,h=void 0===u?e.fontSize:u,d=t.fontFamily;return(r?r+" ":"")+(s?s+" ":"")+(l?l+" ":"")+h*i+"px "+((void 0===d?e.fontFamily:d)||"sans-serif")}(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,i=Ti(this).text;if(this.isSimplify()){var n=e.maxLineWidth,r=void 0===n?i.maxLineWidth:n;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}}},{key:"clipedWidth",get:function(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=Ti(this).text,e=this.attribute;if(this.isSimplify()){var i=e.maxLineWidth,n=void 0===i?t.maxLineWidth:i;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),null!=this.clipedText&&this.clipedText!==e.text.toString())}}},{key:"multilineLayout",get:function(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isSimplify",value:function(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}},{key:"isMultiLine",get:function(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}},{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return e.isArray(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),n=this.attribute.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"updateWrapAABBBounds",value:function(t){var i,n,r,a,s=Ti(this).text,o=this.attribute,l=o.fontFamily,u=void 0===l?s.fontFamily:l,h=o.textAlign,d=void 0===h?s.textAlign:h,c=o.textBaseline,f=void 0===c?s.textBaseline:c,v=o.fontSize,p=void 0===v?s.fontSize:v,g=o.ellipsis,y=void 0===g?s.ellipsis:g,b=o.maxLineWidth,m=o.stroke,x=void 0===m?s.stroke:m,_=o.lineWidth,A=void 0===_?s.lineWidth:_,k=o.wordBreak,B=void 0===k?s.wordBreak:k,S=o.fontWeight,w=void 0===S?s.fontWeight:S,T=o.ignoreBuf,P=void 0===T?s.ignoreBuf:T,C=o.suffixPosition,M=void 0===C?s.suffixPosition:C,O=o.heightLimit,E=void 0===O?0:O,L=o.lineClamp,R=null!==(i=nn(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==i?i:this.attribute.fontSize||s.fontSize,I=P?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var j=this.cache.layoutData.bbox;return this._AABBBounds.set(j.xOffset,j.yOffset,j.xOffset+j.width,j.yOffset+j.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}var D=Ve.graphicUtil.textMeasure,N=new Wr(u,{fontSize:p,fontWeight:w,fontFamily:u},D),U=e.isArray(t)?t.map((function(t){return t.toString()})):[t.toString()],z=[],H=[0,0],W=1/0;if(E>0&&(W=Math.max(Math.floor(E/R),1)),L&&(W=Math.min(W,L)),"number"==typeof b&&b!==1/0){if(b>0)for(var V=0;V<U.length;V++){var F=U[V],G=!0;if(V===W-1){var Y=N.textMeasure.clipTextWithSuffix(F,N.textOptions,b,y,!1,M);z.push({str:Y.str,width:Y.width});break}var X=N.textMeasure.clipText(F,N.textOptions,b,"break-word"===B);if(""!==F&&""===X.str){if(y){var $=N.textMeasure.clipTextWithSuffix(F,N.textOptions,b,y,!1,M);X.str=null!==(r=$.str)&&void 0!==r?r:"",X.width=null!==(a=$.width)&&void 0!==a?a:0}else X.str="",X.width=0;G=!1}if(z.push({str:X.str,width:X.width}),X.str.length===F.length);else if(G){var q=F.substring(X.str.length);U.splice(V+1,0,q)}}var K=0;z.forEach((function(t){K=Math.max(K,t.width)})),H[0]=K}else{for(var Z,J,Q=0,tt=0,et=U.length;tt<et;tt++){if(tt===W-1){var it=N.textMeasure.clipTextWithSuffix(U[tt],N.textOptions,b,y,!1,M);z.push({str:it.str,width:it.width}),Q=Math.max(Q,it.width);break}J=U[tt],Z=N.textMeasure.measureTextWidth(J,N.textOptions,"break-word"===B),Q=Math.max(Q,Z),z.push({str:J,width:Z})}H[0]=Q}H[1]=z.length*(R+I);var nt={xOffset:0,yOffset:0,width:H[0],height:H[1]};N.LayoutBBox(nt,d,f);var rt=N.layoutWithBBox(nt,z,d,f,R);return this.cache.layoutData=rt,this.clearUpdateShapeTag(),this._AABBBounds.set(nt.xOffset,nt.yOffset,nt.xOffset+nt.width,nt.yOffset+nt.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=Ti(this).text,i=this.attribute.direction;return"horizontal"===(void 0===i?e.direction:i)?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}},{key:"updateMultilineAABBBounds",value:function(t){var e=Ti(this).text,i=this.attribute.direction;return"horizontal"===(void 0===i?e.direction:i)?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}},{key:"updateHorizontalSinglelineAABBBounds",value:function(t){var e,i,n=Ti(this).text,r=this.attribute.wrap;if(void 0===r?n.wrap:r)return this.updateWrapAABBBounds([t]);var a,s,o=Ve.graphicUtil.textMeasure,l=this.attribute,u=l.maxLineWidth,h=void 0===u?n.maxLineWidth:u,d=l.ellipsis,c=void 0===d?n.ellipsis:d,f=l.textAlign,v=void 0===f?n.textAlign:f,p=l.textBaseline,g=void 0===p?n.textBaseline:p,y=l.fontFamily,b=void 0===y?n.fontFamily:y,m=l.fontSize,x=void 0===m?n.fontSize:m,_=l.fontWeight,A=void 0===_?n.fontWeight:_,k=l.stroke,B=void 0===k?n.stroke:k,S=l.lineWidth,w=void 0===S?n.lineWidth:S,T=l.ignoreBuf,P=void 0===T?n.ignoreBuf:T,C=l.whiteSpace,M=void 0===C?n.whiteSpace:C,O=l.suffixPosition,E=void 0===O?n.suffixPosition:O;if("normal"===M)return this.updateWrapAABBBounds(t);var L=P?0:Math.max(2,.075*x),R=l.fontSize||n.fontSize,I=null!==(e=nn(l.lineHeight,R))&&void 0!==e?e:R+L;if(!this.shouldUpdateShape()&&this.cache){var j=zr(v,a=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0),D=Hr(g,I,x);return this._AABBBounds.set(j,D,j+a,D+I),B&&this._AABBBounds.expand(w/2),this._AABBBounds}if(Number.isFinite(h)){if(c){var N=!0===c?n.ellipsis:c,U=o.clipTextWithSuffix(t.toString(),{fontSize:x,fontWeight:A,fontFamily:b},h,N,!1,E);s=U.str,a=U.width}else{var z=o.clipText(t.toString(),{fontSize:x,fontWeight:A,fontFamily:b},h,!1);s=z.str,a=z.width}this.cache.clipedText=s,this.cache.clipedWidth=a}else a=o.measureTextWidth(t.toString(),{fontSize:x,fontWeight:A,fontFamily:b}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();var H=zr(v,a),W=I;Ve.global&&Ve.global.isSafari()&&(W+=.2*x);var V=Hr(g,W,x,L);return this._AABBBounds.set(H,V,H+a,V+W),B&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"getBaselineMapAlign",value:function(){return n.baselineMapAlign}},{key:"getAlignMapBaseline",value:function(){return n.alignMapBaseline}},{key:"updateVerticalSinglelineAABBBounds",value:function(t){var e,i,r,a,s=Ti(this).text,o=Ve.graphicUtil.textMeasure,l=this.attribute,u=l.ignoreBuf,h=(void 0===u?s.ignoreBuf:u)?0:2,d=l.maxLineWidth,c=void 0===d?s.maxLineWidth:d,f=l.ellipsis,v=void 0===f?s.ellipsis:f,p=l.fontSize,g=void 0===p?s.fontSize:p,y=l.fontWeight,b=void 0===y?s.fontWeight:y,m=l.fontFamily,x=void 0===m?s.fontFamily:m,_=l.stroke,A=void 0===_?s.stroke:_,k=l.lineWidth,B=void 0===k?s.lineWidth:k,S=l.verticalMode,w=void 0===S?s.verticalMode:S,T=l.suffixPosition,P=void 0===T?s.suffixPosition:T,C=null!==(e=nn(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==e?e:(l.fontSize||s.fontSize)+h,M=l.textAlign,O=void 0===M?s.textAlign:M,E=l.textBaseline,L=void 0===E?s.textBaseline:E;if(!w){var R=O;O=null!==(i=n.baselineMapAlign[L])&&void 0!==i?i:"left",L=null!==(r=n.alignMapBaseline[R])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){var I=zr(O,a=this.cache.clipedWidth),j=Hr(L,C,g);return this._AABBBounds.set(j,I,j+C,I+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}var D=[In(t.toString())];if(Number.isFinite(c)){if(v){var N=!0===v?s.ellipsis:v,U=o.clipTextWithSuffixVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},c,N,!1,P);D=[U.verticalList],a=U.width}else{var z=o.clipTextVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},c,!1);D=[z.verticalList],a=z.width}this.cache.verticalList=D,this.cache.clipedWidth=a}else a=0,D[0].forEach((function(t){var e=t.direction===En.HORIZONTAL?g:o.measureTextWidth(t.text,{fontSize:g,fontWeight:b,fontFamily:x});a+=e,t.width=e})),this.cache.verticalList=D,this.cache.clipedWidth=a;this.clearUpdateShapeTag();var H=zr(O,a),W=Hr(L,C,g);return this._AABBBounds.set(W,H,W+C,H+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,i,n=Ti(this).text,r=this.attribute.wrap;if(void 0===r?n.wrap:r)return this.updateWrapAABBBounds(t);var a=this.attribute,s=a.fontFamily,o=void 0===s?n.fontFamily:s,l=a.textAlign,u=void 0===l?n.textAlign:l,h=a.textBaseline,d=void 0===h?n.textBaseline:h,c=a.fontSize,f=void 0===c?n.fontSize:c,v=a.fontWeight,p=void 0===v?n.fontWeight:v,g=a.ellipsis,y=void 0===g?n.ellipsis:g,b=a.maxLineWidth,m=a.stroke,x=void 0===m?n.stroke:m,_=a.lineWidth,A=void 0===_?n.lineWidth:_,k=a.whiteSpace,B=void 0===k?n.whiteSpace:k,S=a.suffixPosition,w=void 0===S?n.suffixPosition:S,T=null!==(e=nn(a.lineHeight,a.fontSize||n.fontSize))&&void 0!==e?e:a.fontSize||n.fontSize;if("normal"===B)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var P=this.cache.layoutData.bbox;return this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}var C=Ve.graphicUtil.textMeasure,M=new Wr(o,{fontSize:f,fontWeight:p,fontFamily:o},C).GetLayoutByLines(t,u,d,T,!0===y?n.ellipsis:y||void 0,!1,b,w),O=M.bbox;return this.cache.layoutData=M,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(t){var i,r,a,s,o=Ti(this).text,l=Ve.graphicUtil.textMeasure,u=this.attribute,h=u.ignoreBuf,d=(void 0===h?o.ignoreBuf:h)?0:2,c=u.maxLineWidth,f=void 0===c?o.maxLineWidth:c,v=u.ellipsis,p=void 0===v?o.ellipsis:v,g=u.fontFamily,y=void 0===g?o.fontFamily:g,b=u.fontSize,m=void 0===b?o.fontSize:b,x=u.fontWeight,_=void 0===x?o.fontWeight:x,A=u.stroke,k=void 0===A?o.stroke:A,B=u.lineWidth,S=void 0===B?o.lineWidth:B,w=u.verticalMode,T=void 0===w?o.verticalMode:w,P=u.suffixPosition,C=void 0===P?o.suffixPosition:P,M=null!==(i=nn(u.lineHeight,u.fontSize||o.fontSize))&&void 0!==i?i:(u.fontSize||o.fontSize)+d,O=u.textAlign,E=void 0===O?o.textAlign:O,L=u.textBaseline,R=void 0===L?o.textBaseline:L;if(!T){var I=E;E=null!==(r=n.baselineMapAlign[R])&&void 0!==r?r:"left",R=null!==(a=n.alignMapBaseline[I])&&void 0!==a?a:"top"}if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((function(t){var i=t.reduce((function(t,e){return t+e.width}),0);s=e.max(i,s)}));var j=zr(E,s),D=this.cache.verticalList.length*M,N=Hr(R,D,m);return this._AABBBounds.set(N,j,N+D,j+s),k&&this._AABBBounds.expand(S/2),this._AABBBounds}var U=t.map((function(t){return In(t.toString())}));U.forEach((function(t,e){if(Number.isFinite(f))if(p){var i=!0===p?o.ellipsis:p,n=l.clipTextWithSuffixVertical(t,{fontSize:m,fontWeight:_,fontFamily:y},f,i,!1,C);U[e]=n.verticalList,s=n.width}else{var r=l.clipTextVertical(t,{fontSize:m,fontWeight:_,fontFamily:y},f,!1);U[e]=r.verticalList,s=r.width}else s=0,t.forEach((function(t){var e=t.direction===En.HORIZONTAL?m:l.measureTextWidth(t.text,{fontSize:m,fontWeight:_,fontFamily:y});s+=e,t.width=e}))})),this.cache.verticalList=U,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((function(t){var i=t.reduce((function(t,e){return t+e.width}),0);s=e.max(i,s)}));var z=zr(E,s),H=this.cache.verticalList.length*M,W=Hr(R,H,m);return this._AABBBounds.set(W,z,W+H,z+s),k&&this._AABBBounds.expand(S/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ti(this).text[t]}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vr;return y(h(n.prototype),"needUpdateTags",this).call(this,t,e)}},{key:"needUpdateTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vr;return y(h(n.prototype),"needUpdateTag",this).call(this,t,e)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(xn);function Gr(t){return new Fr(t)}Fr.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},mn),Fr.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Fr.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var Yr=["heightLimit","lineClamp"],Xr=function(t){u(n,t);var i=g(n);function n(t){return a(this,n),i.call(this,Object.assign(Object.assign({},t),{wrap:!0}))}return o(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return e.isArray(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,i,n,r,a=Ti(this).text,s=this.attribute,o=s.fontFamily,l=void 0===o?a.fontFamily:o,u=s.textAlign,h=void 0===u?a.textAlign:u,d=s.textBaseline,c=void 0===d?a.textBaseline:d,f=s.fontSize,v=void 0===f?a.fontSize:f,p=s.ellipsis,g=void 0===p?a.ellipsis:p,y=s.maxLineWidth,b=s.stroke,m=void 0===b?a.stroke:b,x=s.lineWidth,_=void 0===x?a.lineWidth:x,A=s.wordBreak,k=void 0===A?a.wordBreak:A,B=s.fontWeight,S=void 0===B?a.fontWeight:B,w=s.ignoreBuf,T=void 0===w?a.ignoreBuf:w,P=s.heightLimit,C=void 0===P?0:P,M=s.suffixPosition,O=void 0===M?a.suffixPosition:M,E=s.lineClamp,L=null!==(e=nn(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,R=T?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var I=this.cache.layoutData.bbox;return this._AABBBounds.set(I.xOffset,I.yOffset,I.xOffset+I.width,I.yOffset+I.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}var j=Ve.graphicUtil.textMeasure,D=new Wr(l,{fontSize:v,fontWeight:S,fontFamily:l},j),N=t.map((function(t){return t.toString()})),U=[],z=[0,0],H=1/0;if(C>0&&(H=Math.max(Math.floor(C/L),1)),E&&(H=Math.min(H,E)),"number"==typeof y&&y!==1/0){if(y>0)for(var W=0;W<N.length;W++){var V=N[W],F=!0;if(W===H-1){var G=D.textMeasure.clipTextWithSuffix(V,D.textOptions,y,g,!1,O);U.push({str:G.str,width:G.width});break}var Y=D.textMeasure.clipText(V,D.textOptions,y,"break-word"===k);if(""!==V&&""===Y.str){if(g){var X=D.textMeasure.clipTextWithSuffix(V,D.textOptions,y,g,!1,O);Y.str=null!==(n=X.str)&&void 0!==n?n:"",Y.width=null!==(r=X.width)&&void 0!==r?r:0}else Y.str="",Y.width=0;F=!1}if(U.push({str:Y.str,width:Y.width}),Y.str.length===V.length);else if(F){var $=V.substring(Y.str.length);N.splice(W+1,0,$)}}var q=0;U.forEach((function(t){q=Math.max(q,t.width)})),z[0]=q}else{for(var K,Z,J=0,Q=0,tt=N.length;Q<tt;Q++){if(Q===H-1){var et=D.textMeasure.clipTextWithSuffix(N[Q],D.textOptions,y,g,!1,O);U.push({str:et.str,width:et.width}),J=Math.max(J,et.width);break}Z=N[Q],K=D.textMeasure.measureTextWidth(Z,D.textOptions,"break-word"===k),J=Math.max(J,K),U.push({str:Z,width:K})}z[0]=J}z[1]=U.length*(L+R);var it={xOffset:0,yOffset:0,width:z[0],height:z[1]};D.LayoutBBox(it,h,c);var nt=D.layoutWithBBox(it,U,h,c,L);return this.cache.layoutData=nt,this.clearUpdateShapeTag(),this._AABBBounds.set(it.xOffset,it.yOffset,it.xOffset+it.width,it.yOffset+it.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Yr.length;e++){var i=Yr[e];if(-1!==t.indexOf(i))return!0}return y(h(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Yr.length;e++)if(t===Yr[e])return!0;return y(h(n.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Fr);function $r(t){return new Xr(t)}var qr=function(){function t(){a(this,t)}return o(t,[{key:"bounds",value:function(t,i){if(e.isNumber(t)){var n=t/2;i.x1=-n,i.x2=n,i.y1=-n,i.y2=n}else i.x1=-t[0]/2,i.x2=t[0]/2,i.y1=-t[1]/2,i.y2=t[1]/2}}]),t}();function Kr(t,i,n,r,a){return a?t.arc(n,r,i,0,e.tau,!1,a):t.arc(n,r,i,0,e.tau),!1}var Zr=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="circle",t.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return Kr(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Kr(t,e/2+r,i,n,a)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," a ").concat(r,",").concat(r," 0 1,0 ").concat(2*r,",0 a ").concat(r,",").concat(r," 0 1,0 -").concat(2*r,",0")}}]),i}(qr),Jr=new Zr;var Qr=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="cross",t.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",t}return o(i,[{key:"draw",value:function(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)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return function(t,e,i,n,r,a){return t.moveTo(-3*e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-3*e+n-r,a),t.lineTo(e+i+r,-3*e+n-r,a),t.lineTo(e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,e+n+r,a),t.lineTo(e+i+r,e+n+r,a),t.lineTo(e+i+r,3*e+n+r,a),t.lineTo(-e+i-r,3*e+n+r,a),t.lineTo(-e+i-r,e+n+r,a),t.lineTo(-3*e+i-r,e+n+r,a),t.closePath(),!0}(t,e/6,i,n,r,a)}}]),i}(qr),ta=new Qr;function ea(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 ia=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="diamond",t.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return ea(t,e/2,i,n,r)}},{key:"drawFitDir",value:function(t,e,i,n,r){return ea(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return ea(t,e/2+r,i,n,a)}}]),i}(qr),na=new ia;function ra(t,e,i,n){var r=2*e;return t.rect(i-e,n-e,r,r),!1}var aa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="square",t.pathStr="M-0.5,-0.5h1v1h-1Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ra(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ra(t,e/2+r,i,n)}}]),i}(qr),sa=new aa;var oa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleUp",t.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z",t}return o(i,[{key:"draw",value:function(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)}},{key:"drawOffset",value:function(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)}}]),i}(qr),la=new oa,ua=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangle",t}return o(i)}(oa),ha=new ua,da=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ca=Math.sin(e.tau/10)*da,fa=-Math.cos(e.tau/10)*da;function va(t,i,n,r){var a=ca*i,s=fa*i;t.moveTo(n,-i+r),t.lineTo(a+n,s+r);for(var o=1;o<5;++o){var l=e.tau*o/5,u=Math.cos(l),h=Math.sin(l);t.lineTo(h*i+n,-u*i+r),t.lineTo(u*a-h*s+n,h*a+u*s+r)}return t.closePath(),!0}var pa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="star",t.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0",t}return o(i,[{key:"draw",value:function(t,e,i,n){return va(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return va(t,e/2+r,i,n)}}]),i}(qr),ga=new pa,ya=e.sqrt(3);function ba(t,e,i,n){var r=e,a=r/ya,s=a/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(a/2+i,n),t.lineTo(s/2+i,n),t.lineTo(s/2+i,o+n),t.lineTo(-s/2+i,o+n),t.lineTo(-s/2+i,n),t.lineTo(-a/2+i,n),t.closePath(),!0}var ma=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow",t.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",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ba(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ba(t,e/2+r,i,n)}}]),i}(qr),xa=new ma;function _a(t,e,i,n){var 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 Aa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="wedge",t.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return _a(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return _a(t,e/2+r,i,n)}}]),i}(qr),ka=new Aa;function Ba(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Sa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="stroke",t.pathStr="",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ba(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ba(t,e/2+r,i,n)}}]),i}(qr),wa=new Sa,Ta=-.5,Pa=e.sqrt(3)/2,Ca=1/e.sqrt(12);function Ma(t,e,i,n){var r=e/2,a=e*Ca,s=r,o=e*Ca+e,l=-s,u=o;return t.moveTo(r+i,a+n),t.lineTo(s+i,o+n),t.lineTo(l+i,u+n),t.lineTo(Ta*r-Pa*a+i,Pa*r+Ta*a+n),t.lineTo(Ta*s-Pa*o+i,Pa*s+Ta*o+n),t.lineTo(Ta*l-Pa*u+i,Pa*l+Ta*u+n),t.lineTo(Ta*r+Pa*a+i,Ta*a-Pa*r+n),t.lineTo(Ta*s+Pa*o+i,Ta*o-Pa*s+n),t.lineTo(Ta*l+Pa*u+i,Ta*u-Pa*l+n),t.closePath(),!1}var Oa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="wye",t.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ma(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ma(t,e/2+r,i,n)}}]),i}(qr),Ea=new Oa;var La=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleLeft",t.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z",t}return o(i,[{key:"draw",value:function(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)}},{key:"drawOffset",value:function(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)}}]),i}(qr),Ra=new La;var Ia=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleRight",t.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z",t}return o(i,[{key:"draw",value:function(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)}},{key:"drawOffset",value:function(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)}}]),i}(qr),ja=new Ia;var Da=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleDown",t.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z",t}return o(i,[{key:"draw",value:function(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)}},{key:"drawOffset",value:function(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)}}]),i}(qr),Na=new Da,Ua=e.sqrt(3);function za(t,e,i,n){var r=e*Ua;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Ha=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return za(t,e/2/Ua,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return za(t,e/2/Ua+r,i,n)}}]),i}(oa),Wa=new Ha;function Va(t,e,i,n){var r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var Fa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Left",t.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Va(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Va(t,e/4+r,i,n)}}]),i}(qr),Ga=new Fa;function Ya(t,e,i,n){var r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var Xa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Right",t.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ya(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ya(t,e/4+r,i,n)}}]),i}(qr),$a=new Xa;function qa(t,e,i,n){var r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var Ka=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Up",t.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25",t}return o(i,[{key:"draw",value:function(t,e,i,n){return qa(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return qa(t,e/4+r,i,n)}}]),i}(qr),Za=new Ka;function Ja(t,e,i,n){var r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var Qa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Down",t.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ja(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ja(t,e/4+r,i,n)}}]),i}(qr),ts=new Qa;function es(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var is=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="lineV",t.pathStr="M0,-0.5L0,0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return es(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return es(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e,", ").concat(i-r," L ").concat(e,",").concat(i+r)}}]),i}(qr),ns=new is;function rs(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var as=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="lineH",t.pathStr="M-0.5,0L0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return rs(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return rs(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," L ").concat(e+r,",").concat(i)}}]),i}(qr),ss=new as;function os(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 ls=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="close",t.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return os(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return os(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i-r," L ").concat(e+r,",").concat(i+r," M ").concat(e+r,", ").concat(i-r," L ").concat(e-r,",").concat(i+r)}}]),i}(qr),us=new ls;function hs(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function ds(t,e,i,n){var r=e,a=e/2;return t.rect(i-r/2,n-a/2,r,a),!1}var cs=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).type="rect",t.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",t}return o(n,[{key:"draw",value:function(t,i,n,r){return e.isNumber(i)?ds(t,i,n,r):hs(t,i,n,r)}},{key:"drawOffset",value:function(t,i,n,r,a){return e.isNumber(i)?ds(t,i+2*a,n,r):hs(t,[i[0]+2*a,i[1]+2*a],n,r)}}]),n}(qr),fs=new cs,vs=new e.AABBBounds,ps=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,t),this.pathStr="",this.type=i,e.isArray(n)?this.svgCache=n:this.path=n,this.isSvg=r}return o(t,[{key:"drawOffset",value:function(t,e,i,n,r,a,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),Wt(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(Wt(this.path.commandList,t,i,n,e+r,e+r),!1)}},{key:"draw",value:function(t,e,i,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),Wt(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(Wt(this.path.commandList,t,i,n,e,e),!1)}},{key:"bounds",value:function(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((function(i){var n=i.path;vs.x1=n.bounds.x1*t,vs.y1=n.bounds.y1*t,vs.x2=n.bounds.x2*t,vs.y2=n.bounds.y2*t,e.union(vs)}))}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)}}]),t}(),gs={};[Jr,ta,na,sa,Wa,ha,ga,xa,ka,wa,Ea,Ra,ja,la,Na,Ga,$a,Za,ts,fs,ns,ss,us].forEach((function(t){gs[t.type]=t}));var ys={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},bs=new e.AABBBounds,ms=["symbolType","size"].concat(m(vn)),xs=function(t){u(n,t);var i=g(n);function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return a(this,n),(t=i.call(this,e)).type="symbol",t.numberType=Zn,t}return o(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return e.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t,i=Ti(this).symbol,r=this.attribute.symbolType,a=void 0===r?i.symbolType:r,s=gs[a];if(s)return this._parsedPath=s,s;if(s=n.userSymbolMap[a])return this._parsedPath=s,s;if(!0===((t=a=ys[a]||a).startsWith("<svg")||t.startsWith("<?xml"))){var o=(new Mn).parse(a).svg;if(!o)return null;var l=e.isArray(o.path)?o.path:[o.path];bs.clear();var u=[];l.forEach((function(t){var e=(new be).fromString(t.d),i={};ir.forEach((function(e){t[e]&&(i[er[e]]=t[e])})),u.push({path:e,attribute:i}),bs.union(e.bounds)}));var h=bs.width(),d=bs.height(),c=1/e.max(h,d);return u.forEach((function(t){return t.path.transform(0,0,c,c)})),this._parsedPath=new ps(a,u,!0),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}var f=(new be).fromString(a),v=f.bounds.width(),p=f.bounds.height(),g=1/e.max(v,p);return f.transform(0,0,g,g),this._parsedPath=new ps(a,f),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=Ti(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Ve.graphicService.updateSymbolAABBBounds(i,Ti(this).symbol,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=Yi(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ti(this).symbol[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,ms)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,ms)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),i=this.attribute.size,n=e.isArray(i)?i:[i,i];return t.path?(new be).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new be).fromString(t.pathStr,0,0,n[0],n[1])}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(xn);function _s(t){return new xs(t)}xs.userSymbolMap={},xs.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},mn);var As=["segments","points","curveType"].concat(m(vn)),ks=function(t){u(i,t);var e=g(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,i),(t=e.call(this,n)).type="line",t.numberType=Gn,t}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,i=t.segments;return i?0!==i.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=Zi(i,n,e))}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updateLineAABBBounds(e,Ti(this).line,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ti(this).line[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,As)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,As)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new be,i=t.segments,n=function(t){if(t&&t.length){var i=!0;t.forEach((function(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((function(t){n(t.points)})):t.points&&n(t.points),e}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(xn);function Bs(t){return new ks(t)}ks.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},mn);var Ss=["width","x1","y1","height","cornerRadius"].concat(m(vn)),ws=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="rect",e.numberType=$n,e}return o(n,[{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updateRectAABBBounds(e,Ti(this).rect,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ti(this).rect[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,Ss)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,Ss)}},{key:"toCustomPath",value:function(){var t=this.attribute,i=e.isNil(t.width)?t.x1-t.x:t.width,n=e.isNil(t.height)?t.y1-t.y:t.height,r=0,a=0;i<0&&(r=i,i=-i),n<0&&(a=n,n=-n);var s=new be;return s.moveTo(r,a),s.rect(r,a,i,n),s}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(xn);function Ts(t){return new ws(t)}ws.NOWORK_ANIMATE_ATTR=mn;var Ps=function(){function t(e,i,n,r,s,o,l,u,h,d,c,f,v,p){a(this,t),this.left=e,this.top=i,this.width=n,this.height=r,this.actualHeight=0,this.bottom=i+r,this.right=e+n,this.ellipsis=s,this.wordBreak=o,this.verticalDirection=l,this.lines=[],this.globalAlign=u,this.globalBaseline=h,this.layoutDirection=d,this.directionKey=Fe[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=f,this.singleLine=v,p?(p.clear(),this.icons=p):this.icons=new Map}return o(t,[{key:"draw",value:function(t,e){var i=this.getActualSize(),n=i.width,r=i.height,a=this.isWidthMax?Math.min(this.width,n):this.width||n||0,s=this.isHeightMax?Math.min(this.height,r):this.height||r||0;s=Math.min(s,r);var o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}var l=0;switch(this.globalAlign){case"left":l=0;break;case"center":l=-a/2;break;case"right":l=-a}var u=this[this.directionKey.height];this.singleLine&&(u=this.lines[0].height+1);var h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=u&&0!==u)for(var d=0;d<this.lines.length;d++){var c=this.lines[d],f=c.top,v=c.height;if(f+v<this[this.directionKey.top]||f+v>this[this.directionKey.top]+u)return h;var p=!1;this.ellipsis&&this.lines[d+1]&&this.lines[d+1].top+this.lines[d+1].height>this[this.directionKey.top]+u&&(p=!0,h=!0),this.lines[d].draw(t,p,this.lines[d][this.directionKey.left]+l,this.lines[d][this.directionKey.top]+o,e)}else{var g=Math.floor((u-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=g:o+=g;for(var y=0;y<this.lines.length;y++)this.lines[y].draw(t,!1,this.lines[y][this.directionKey.left]+l,this.lines[y][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var b=0;b<this.lines.length;b++){var m=this.lines[b];m.top;var x=m.height,_=u-this.lines[b].top-this.lines[b].height;if(0===u)this.lines[b].draw(t,!1,l,_+o,e);else{if(_+x>this[this.directionKey.top]+u||_<this[this.directionKey.top])return h;var A=!1;this.ellipsis&&this.lines[b+1]&&_-this.lines[b+1].height<this[this.directionKey.top]&&(A=!0,h=!0),this.lines[b].draw(t,A,l,_+o,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(var k=0;k<this.lines.length;k++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[k].height+this.lines[k].top);var B=this.lines[k],S=B.top,w=B.height;if(0===u)this.lines[k].draw(t,!1,this.lines[k][this.directionKey.left]+l,this.lines[k][this.directionKey.top]+o,e);else{if(S+w<this[this.directionKey.top]||S+w>this[this.directionKey.top]+u)return h;var T=!1;this.ellipsis&&this.lines[k+1]&&this.lines[k+1].top+this.lines[k+1].height>this[this.directionKey.top]+u&&(T=!0,h=!0),this.lines[k].draw(t,T,this.lines[k][this.directionKey.left]+l,this.lines[k][this.directionKey.top]+o,e)}}}return h}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,i=0;i<this.lines.length;i++){var 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}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,i=this.getRawActualSize();i.width;i.height;this.width,this.height;var n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(var r=0;r<this.lines.length;r++){var a=this.lines[r],s=a.top,o=a.height;if(s+o<this[this.directionKey.top]||s+o>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[r+1]&&this.lines[r+1].top+this.lines[r+1].height>this[this.directionKey.top]+n){var l=this.lines[r].getWidthWithEllips();l>t&&(t=l),e+=this.lines[r].height}else this.lines[r].actualWidth>t&&(t=this.lines[r].actualWidth),e+=this.lines[r].height}else{Math.floor((n-this.actualHeight)/2);for(var u=0;u<this.lines.length;u++)this.lines[u].actualWidth>t&&(t=this.lines[u].actualWidth),e+=this.lines[u].height}else if("bottom"===this.verticalDirection)for(var h=0;h<this.lines.length;h++){var d=this.lines[h];d.top;var c=d.height,f=n-this.lines[h].top-this.lines[h].height;if(0===n)this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height;else if(f+c>this[this.directionKey.top]+n||f<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[h+1]&&f-this.lines[h+1].height<this[this.directionKey.top]){var v=this.lines[h].getWidthWithEllips();v>t&&(t=v),e+=this.lines[h].height}else this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height}else for(var p=0;p<this.lines.length;p++){var g=this.lines[p],y=g.top,b=g.height;if(0===n)this.lines[p].actualWidth>t&&(t=this.lines[p].actualWidth),e+=this.lines[p].height;else if(y+b<this[this.directionKey.top]||y+b>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[p+1]&&this.lines[p+1].top+this.lines[p+1].height>this[this.directionKey.top]+n){var m=this.lines[p].getWidthWithEllips();m>t&&(t=m),e+=this.lines[p].height}else this.lines[p].actualWidth>t&&(t=this.lines[p].actualWidth),e+=this.lines[p].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}]),t}(),Cs=function(){function t(e,i,n){a(this,t),this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";var r=nn(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof r?r>this.fontSize?r:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;var s=Je(e,n),o=s.ascent,l=s.height,u=s.descent,h=s.width,d=0,c=0,f=0;this.height>l&&(d=(this.height-l)/2,c=Math.ceil(d),f=Math.floor(d)),"top"===this.textBaseline?(this.ascent=d,this.descent=l-d):"bottom"===this.textBaseline?(this.ascent=l-d,this.descent=d):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+c,this.descent=u+f),this.length=e.length,this.width=h||0,this.text=e||"",this.newLine=i||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}return o(t,[{key:"updateWidth",value:function(){var t=Je(this.text,this.character).width;this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}},{key:"draw",value:function(t,e,i,n,r){var a=this.text,s=this.left+i;e+=this.top;var o=this.direction;if(this.verticalEllipsis)a="...",o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)a+="...","right"===r&&(s-=this.ellipsisWidth);else if("replace"===this.ellipsis){var l=Ke(a,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,a.length-1);if(a=a.slice(0,l),a+="...","right"===r){var u=Je(this.text.slice(l),this.character).width;"vertical"===o||(s-=this.ellipsisWidth-u)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,s,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(s,e),s=0,e=0),this.character.stroke&&(function(t,e){var i=e&&e.stroke||Ye;if(i){t.globalAlpha=1,t.lineWidth=e&&"number"==typeof e.lineHeight?e.lineHeight:1,t.strokeStyle=i;var 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"})}else t.globalAlpha=0}(t,this.character),t.strokeText(a,s,e)),function(t,e){var i=e&&e.fill||Ge;if(i){t.globalAlpha=1,t.fillStyle=i;var 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"})}else t.globalAlpha=0}(t,this.character),this.character.fill&&t.fillText(a,s,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(s,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(s,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(s,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(s,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,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){var n=Ke(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,n),e+="...";var r=Je(this.text.slice(n),this.character).width;return i+this.ellipsisWidth-r}return i}}]),t}();var Ms=["width","height","image"].concat(m(vn)),Os=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="image",n.numberType=Fn,n.loadImage(n.attribute.image),n}return o(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0},set:function(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0},set:function(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"repeatX",get:function(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}},{key:"repeatY",get:function(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}},{key:"image",get:function(){return this.attribute.image},set:function(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}},{key:"imageLoadSuccess",value:function(t,e,n){var r=this;y(h(i.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var n=this;y(h(i.prototype),"imageLoadFail",this).call(this,t,(function(){n.failCallback&&n.failCallback()}))}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updateImageAABBBounds(e,Ti(this).image,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return He[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Ms)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Ms)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(xn);function Es(t){return new Os(t)}Os.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},mn);var Ls=function(t){u(n,t);var i=g(n);function n(t){var r;if(a(this,n),(r=i.call(this,t))._x=0,r._y=0,r._hovered=!1,r._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(r._hovered=!0),t.margin){var s=Yi(t.margin);r._marginArray="number"==typeof s?[s,s,s,s]:s}return r.onBeforeAttributeUpdate=function(t,i,n){if(e.isArray(n)&&-1!==n.indexOf("margin")||"margin"===n)if(i.margin){var a=Yi(i.margin);r._marginArray="number"==typeof a?[a,a,a,a]:a}else r._marginArray=[0,0,0,0]},p(r)}return o(n,[{key:"width",get:function(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}},{key:"height",get:function(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();var t=this.attribute,e=t.width,i=void 0===e?He.width:e,n=t.height,r=void 0===n?He.height:n,a=this.attribute,s=a.backgroundWidth,o=void 0===s?i:s,l=a.backgroundHeight,u=(o-i)/2,h=((void 0===l?r:l)-r)/2;return this._AABBBounds.expand([0,2*u,2*h,0]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}]),n}(Os),Rs=function(){function t(e,i,n,r,s,o,l,u){var h=this;a(this,t),this.left=e,this.width=i,this.baseline=n,this.ascent=r,this.descent=s,this.top=n-r,this.paragraphs=o.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof Ls?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=l,this.directionKey=Fe[this.direction],this.actualWidth=0;var d=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof Cs){var i=qe.exec(t.text);0!==(null==i?void 0:i.index)&&(t.text=t.text.slice(null==i?void 0:i.index),t.updateWidth())}h.actualWidth+=t[h.directionKey.width],d=Math.max(t[h.directionKey.height],d)})),this.height=d,this.blankWidth=u?0:this.width-this.actualWidth,this.calcOffset(i,u)}return o(t,[{key:"calcOffset",value:function(t,e){var i=this.directionKey,n=this.height,r=this.left,a=0;if(this.actualWidth<t&&!e)switch(this.textAlign){case"right":r=t-this.actualWidth;break;case"center":r=(t-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof Ls?(t["_"+i.x]=r,r+=t[i.width]+a,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+a)}))}},{key:"draw",value:function(t,e,i,n,r){var a=this;if(e)for(var s=0,o=this.paragraphs.length-1;o>=0;o--){var l=this.paragraphs[o];if(l instanceof Ls)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var u=Je("...",l.character).width||0;if(u<=this.blankWidth+s){l.ellipsis="add";break}if(u<=this.blankWidth+s+l.width){l.ellipsis="replace",l.ellipsisWidth=u,l.ellipsisOtherParagraphWidth=this.blankWidth+s;break}l.ellipsis="hide",s+=l.width}this.paragraphs.map((function(e,s){if(e instanceof Ls)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,a.ascent);e.draw(t,n+a.ascent,i,0===s,a.textAlign)}))}},{key:"getWidthWithEllips",value:function(){for(var t=this,e=0,i=this.paragraphs.length-1;i>=0;i--){var n=this.paragraphs[i];if(n instanceof Ls)break;var r=Je("...",n.character).width||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}var a=0;return this.paragraphs.map((function(e,i){a+=e instanceof Ls?e.width:e.getWidthWithEllips(t.direction)})),a}}]),t}(),Is=function(){function t(e){a(this,t),this.frame=e,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=e.layoutDirection,this.directionKey=Fe[this.direction]}return o(t,[{key:"store",value:function(t){if(t instanceof Ls){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var 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))}},{key:"send",value:function(){if(0!==this.lineBuffer.length){var t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Rs(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}}},{key:"deal",value:function(t){t instanceof Ls?"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)))}},{key:"cut",value:function(t){var e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=Ke(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){var r=function(t,e){var i=t.text.slice(0,e),n=t.text.slice(e);return[new Cs(i,t.newLine,t.character),new Cs(n,!0,t.character)]}(t,n),a=b(r,2),s=a[0],o=a[1];this.store(s),this.deal(o)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}]),t}(),js=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(m(vn)),Ds=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="richtext",n._currentHoverIcon=null,n.numberType=Kn,n}return o(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ze.width},set:function(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:ze.height},set:function(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxWidth",get:function(){return this.attribute.maxWidth},set:function(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxHeight",get:function(){return this.attribute.maxHeight},set:function(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}},{key:"ellipsis",get:function(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:ze.ellipsis},set:function(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}},{key:"wordBreak",get:function(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:ze.wordBreak},set:function(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}},{key:"verticalDirection",get:function(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:ze.verticalDirection},set:function(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}},{key:"textAlign",get:function(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:ze.textAlign},set:function(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}},{key:"textBaseline",get:function(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:ze.textBaseline},set:function(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}},{key:"textConfig",get:function(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:ze.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updateRichTextAABBBounds(e,Ti(this).richtext,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return ze[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,js)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,js)}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"doUpdateFrameCache",value:function(){for(var t,e=this,i=this.attribute,n=i.textConfig,r=void 0===n?[]:n,a=i.maxWidth,s=i.maxHeight,o=i.width,l=i.height,u=i.ellipsis,h=i.wordBreak,d=i.verticalDirection,c=i.textAlign,f=i.textBaseline,v=i.layoutDirection,p=i.singleLine,g=[],y=0;y<r.length;y++)if("image"in r[y]){var b=r[y],m=b.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(b.id);if(m)g.push(m);else{var x=new Ls(b);x.successCallback=function(){var t;e.addUpdateBoundTag(),null===(t=e.stage)||void 0===t||t.renderNextFrame()},x.richtextId=b.id,g.push(x)}}else if(r[y].text.includes("\n"))for(var _=r[y].text.split("\n"),A=0;A<_.length;A++)g.push(new Cs(_[A],0!==A,r[y]));else g.push(new Cs(r[y].text,!1,r[y]));for(var k="number"==typeof a&&Number.isFinite(a)&&a>0,B="number"==typeof s&&Number.isFinite(s)&&s>0,S="number"==typeof o&&Number.isFinite(o)&&o>0&&(!k||o<=a),w="number"==typeof l&&Number.isFinite(l)&&l>0&&(!B||l<=s),T=new Ps(0,0,(S?o:k?a:0)||0,(w?l:B?s:0)||0,u,h,d,c,f,v||"horizontal",!S&&k,!w&&B,p||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),P=new Is(T),C=0;C<g.length;C++)P.deal(g[C]);if(P.send(),!("horizontal"===T.layoutDirection?S:w)){var M=T.getActualSizeWidthEllipsis(),O="horizontal"===T.layoutDirection?M.width:M.height;("horizontal"===T.layoutDirection?k:B)&&(O=Math.min(O,"horizontal"===T.layoutDirection?a:s)),T.lines.forEach((function(t){t.calcOffset(O,!1)}))}this._frameCache=T}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){y(h(i.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(i){i.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var i,n,r,a,s,o=t.pickIcon(e.global);o&&o===t._currentHoverIcon||(o?(null===(i=t._currentHoverIcon)||void 0===i||i.setHoverState(!1),t._currentHoverIcon=o,t._currentHoverIcon.setHoverState(!0),null===(n=t.stage)||void 0===n||n.setCursor(o.attribute.cursor),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!o&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(a=t.stage)||void 0===a||a.setCursor(),null===(s=t.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var i,n;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(i=t.stage)||void 0===i||i.setCursor(),null===(n=t.stage)||void 0===n||n.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,i=this.getFrameCache(),n=this.globalTransMatrix,r=n.e,a=n.f;return i.icons.forEach((function(i){var n,s;i.AABBBounds.containsPoint({x:t.x-r,y:t.y-a})&&(e=i,e.globalX=(null!==(n=e.attribute.x)&&void 0!==n?n:0)+r,e.globalY=(null!==(s=e.attribute.y)&&void 0!==s?s:0)+a)})),e}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(xn);function Ns(t){return new Ds(t)}Ds.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},mn);var Us=["path","customPath"].concat(m(vn)),zs=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="path",e.numberType=Yn,e}return o(n,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.path;return null!=t&&""!==t}},{key:"getParsedPathShape",value:function(){var t=Ti(this).path;if(!this.valid)return t.path;var i=this.attribute;return i.path instanceof be?i.path:(e.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof be?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updatePathAABBBounds(e,Ti(this).path,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;e.isString(t.path,!0)?this.cache=(new be).fromString(t.path):t.customPath&&(this.cache=new be,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ti(this).path[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,Us)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,Us)}},{key:"toCustomPath",value:function(){return(new be).fromCustomPath2D(this.getParsedPathShape(),0,0)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(xn);function Hs(t){return new zs(t)}zs.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},mn);var Ws=["segments","points","curveType"].concat(m(vn)),Vs=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="area",n.numberType=Hn,n}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,i=t.segments;return i?0!==i.length:!!e&&0!==e.length}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updateAreaAABBBounds(e,Ti(this).area,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=Zi(i,n,e))}},{key:"getDefaultAttribute",value:function(t){return Ti(this).area[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Ws)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Ws)}},{key:"toCustomPath",value:function(){var t=new be,e=this.attribute,i=e.segments,n=function(e){if(e&&e.length){var i=!0,n=[];if(e.forEach((function(e){var r,a;!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!==(a=e.y1)&&void 0!==a?a:e.y}),i=!1)})),n.length){for(var r=n.length-1;r>=0;r--)t.lineTo(n[r].x,n[r].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((function(t){n(t.points)})),t}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(xn);function Fs(t){return new Vs(t)}Vs.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},mn);var Gs=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(m(vn)),Ys=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="arc",e.numberType=Un,e}return o(n,[{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,i=t.endAngle,n=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=Ti(this).arc,i=this.attribute,n=i.cornerRadius,r=void 0===n?t.cornerRadius:n,a=i.outerRadius,s=void 0===a?t.outerRadius:a,o=i.innerRadius,l=void 0===o?t.innerRadius:o;if(0===r||"0%"===r)return 0;var u=Math.abs(s-l);return Math.min(e.isNumber(r,!0)?r:u*parseFloat(r)/100,u/2)}},{key:"getParsedAngle",value:function(){var t=Ti(this).arc,i=this.attribute,n=i.startAngle,r=void 0===n?t.startAngle:n,a=i.endAngle,s=void 0===a?t.endAngle:a,o=this.attribute.cap,l=void 0===o?t.cap:o,u=s-r>=0?1:-1,h=s-r;if(s=(r=e.clampAngleByRadian(r))+h,l&&e.abs(h)<e.pi2-e.epsilon){var d=1,c=1;l.length&&(d=Number(l[0]),c=Number(l[1]));var f=this.attribute,v=f.outerRadius,p=void 0===v?t.outerRadius:v,g=f.innerRadius,y=void 0===g?t.innerRadius:g,b=Math.abs(p-y)/2,m=b/p;if(b>e.epsilon&&p>e.epsilon)return{startAngle:r-u*m*d,endAngle:s+u*m*c,sc:u*m*d,ec:u*m*c}}return{startAngle:r,endAngle:s}}},{key:"getParsePadAngle",value:function(t,i){var n=Ti(this).arc,r=this.attribute,a=r.outerRadius,s=void 0===a?n.outerRadius:a,o=r.innerRadius,l=void 0===o?n.innerRadius:o,u=r.padAngle,h=void 0===u?n.padAngle:u,d=this.attribute.padRadius,c=void 0===d?e.sqrt(s*s+l*l):d,f=e.abs(i-t),v=t,p=i,g=t,y=i,b=h/2,m=f,x=f;if(b>e.epsilon&&c>e.epsilon){var _=i>t?1:-1,A=e.asin(Number(c)/l*e.sin(b)),k=e.asin(Number(c)/s*e.sin(b));return(m-=2*A)>e.epsilon?(g+=A*=_,y-=A):(m=0,g=y=(t+i)/2),(x-=2*k)>e.epsilon?(v+=k*=_,p-=k):(x=0,v=p=(t+i)/2),{outerStartAngle:v,outerEndAngle:p,innerStartAngle:g,innerEndAngle:y,innerDeltaAngle:m,outerDeltaAngle:x}}return{outerStartAngle:v,outerEndAngle:p,innerStartAngle:g,innerEndAngle:y,innerDeltaAngle:m,outerDeltaAngle:x}}},{key:"doUpdateAABBBounds",value:function(t){var e=Ti(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Ve.graphicService.updateArcAABBBounds(i,Ti(this).arc,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=Yi(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,Gs)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,Gs)}},{key:"getDefaultAttribute",value:function(t){return Ti(this).arc[t]}},{key:"toCustomPath",value:function(){var t=this.attribute,i=this.getParsedAngle(),n=i.startAngle,r=i.endAngle,a=t.innerRadius,s=t.outerRadius,o=e.abs(r-n),l=r>n;if(s<a){var u=s;s=a,a=u}var h=new be;if(s<=e.epsilon)h.moveTo(0,0);else if(o>=e.pi2-e.epsilon)h.moveTo(0+s*e.cos(n),0+s*e.sin(n)),h.arc(0,0,s,n,r,!l),a>e.epsilon&&(h.moveTo(0+a*e.cos(r),0+a*e.sin(r)),h.arc(0,0,a,r,n,l));else{var d=s*e.cos(n),c=s*e.sin(n),f=a*e.cos(r),v=a*e.sin(r);h.moveTo(0+d,0+c),h.arc(0,0,s,n,r,!l),h.lineTo(0+f,0+v),h.arc(0,0,a,r,n,l),h.closePath()}return h}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(xn);function Xs(t){return new Ys(t)}Ys.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},mn);var $s=["points","cornerRadius"].concat(m(vn)),qs=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="polygon",n.numberType=Xn,n}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.points;return t&&t.length>=2}},{key:"doUpdateAABBBounds",value:function(){var t=Ti(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ve.graphicService.updatePolygonAABBBounds(e,Ti(this).polygon,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Yi(r);return a&&i.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=Zi(i,n,e))}},{key:"getDefaultAttribute",value:function(t){return Ti(this).polygon[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,$s)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,$s)}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new be;return t.forEach((function(t,i){0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(xn);function Ks(t){return new qs(t)}qs.NOWORK_ANIMATE_ATTR=mn;var Zs=function(){function t(){a(this,t)}return o(t,[{key:"updateBounds",value:function(t,e,i,n){var r=t.outerBorder,a=t.shadowBlur,s=void 0===a?e.shadowBlur:a;if(r){var o=e.outerBorder,l=r.distance,u=void 0===l?o.distance:l,h=r.lineWidth,d=void 0===h?o.lineWidth:h;i.expand(u+(s+d)/2)}return i}}]),t}(),Js=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"updateBounds",value:function(t,e,i,n){var r=t.outerBorder,a=t.shadowBlur,s=void 0===a?e.shadowBlur:a,o=t.strokeBoundsBuffer,l=void 0===o?e.strokeBoundsBuffer:o;if(r){var u=e.outerBorder,h=r.distance,d=void 0===h?u.distance:h,c=r.lineWidth;On(i,d+(s+(void 0===c?u.lineWidth:c))/2,!0,l)}return i}}]),i}(Zs);var Qs=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"allocate",value:function(t,i,n,r,a,s){if(!this.pools.length)return new e.Matrix(t,i,n,r,a,s);var o=this.pools.pop();return o.a=t,o.b=i,o.c=n,o.d=r,o.e=a,o.f=s,o}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new e.Matrix(t.a,t.b,t.c,t.d,t.e,t.f);var i=this.pools.pop();return i.a=t.a,i.b=t.b,i.c=t.c,i.d=t.d,i.e=t.e,i.f=t.f,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),to=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"allocate",value:function(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var e=this.pools.pop();return t.identity(e),e}},{key:"allocateByObj",value:function(t){var 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(var i=0;i<e.length;i++)e[i]=t[i];return e}},{key:"free",value:function(t){t&&this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}],[{key:"identity",value:function(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}}]),t}(),eo=new Qs,io=new to,no=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ro=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ao=function(t,e){return function(i,n){e(i,n,t)}};function so(t,e,i){var n,r,a,s,o,l,u,h,d,c,f,v,p=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*p+e[4]*g+e[8]*y+e[12],t[13]=e[1]*p+e[5]*g+e[9]*y+e[13],t[14]=e[2]*p+e[6]*g+e[10]*y+e[14],t[15]=e[3]*p+e[7]*g+e[11]*y+e[15]):(n=e[0],r=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],c=e[9],f=e[10],v=e[11],t[0]=n,t[1]=r,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=u,t[7]=h,t[8]=d,t[9]=c,t[10]=f,t[11]=v,t[12]=n*p+o*g+d*y+e[12],t[13]=r*p+l*g+c*y+e[13],t[14]=a*p+u*g+f*y+e[14],t[15]=s*p+h*g+v*y+e[15]),t}function oo(t,e,i){var n=e[0],r=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],c=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],b=e[15],m=i[0],x=i[1],_=i[2],A=i[3];return t[0]=m*n+x*o+_*d+A*p,t[1]=m*r+x*l+_*c+A*g,t[2]=m*a+x*u+_*f+A*y,t[3]=m*s+x*h+_*v+A*b,m=i[4],x=i[5],_=i[6],A=i[7],t[4]=m*n+x*o+_*d+A*p,t[5]=m*r+x*l+_*c+A*g,t[6]=m*a+x*u+_*f+A*y,t[7]=m*s+x*h+_*v+A*b,m=i[8],x=i[9],_=i[10],A=i[11],t[8]=m*n+x*o+_*d+A*p,t[9]=m*r+x*l+_*c+A*g,t[10]=m*a+x*u+_*f+A*y,t[11]=m*s+x*h+_*v+A*b,m=i[12],x=i[13],_=i[14],A=i[15],t[12]=m*n+x*o+_*d+A*p,t[13]=m*r+x*l+_*c+A*g,t[14]=m*a+x*u+_*f+A*y,t[15]=m*s+x*h+_*v+A*b,t}function lo(t,e,i){var n,r=e.attribute,a=r.x,s=void 0===a?i.x:a,o=r.y,l=void 0===o?i.y:o,u=r.z,h=void 0===u?i.z:u,d=r.dx,c=void 0===d?i.dx:d,f=r.dy,v=void 0===f?i.dy:f,p=r.dz,g=void 0===p?i.dz:p,y=r.scaleX,b=void 0===y?i.scaleX:y,m=r.scaleY,x=void 0===m?i.scaleY:m,_=r.scaleZ,A=void 0===_?i.scaleZ:_,k=r.alpha,B=void 0===k?i.alpha:k,S=r.beta,w=void 0===S?i.beta:S,T=r.angle,P=void 0===T?i.angle:T,C=r.anchor3d,M=void 0===C?e.attribute.anchor:C,O=r.anchor,E=[0,0,0];if(M){if("string"==typeof M[0]){var L=parseFloat(M[0])/100,R=e.AABBBounds;E[0]=R.x1+(R.x2-R.x1)*L}else E[0]=M[0];if("string"==typeof M[1]){var I=parseFloat(M[1])/100,j=e.AABBBounds;E[1]=j.x1+(j.x2-j.x1)*I}else E[1]=M[1];E[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),so(t,t,[s+c,l+v,h+g]),so(t,t,[E[0],E[1],E[2]]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],h=e[9],d=e[10],c=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+u*n,t[5]=s*r+h*n,t[6]=o*r+d*n,t[7]=l*r+c*n,t[8]=u*r-a*n,t[9]=h*r-s*n,t[10]=d*r-o*n,t[11]=c*r-l*n}(t,t,w),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],s=e[1],o=e[2],l=e[3],u=e[8],h=e[9],d=e[10],c=e[11];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]=a*r-u*n,t[1]=s*r-h*n,t[2]=o*r-d*n,t[3]=l*r-c*n,t[8]=a*n+u*r,t[9]=s*n+h*r,t[10]=o*n+d*r,t[11]=l*n+c*r}(t,t,B),so(t,t,[-E[0],-E[1],E[2]]),function(t,e,i){var n=i[0],r=i[1],a=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]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[b,x,A]),P){var D=io.allocate(),N=[0,0];if(O){if("string"==typeof M[0]){var U=parseFloat(M[0])/100,z=e.AABBBounds;N[0]=z.x1+(z.x2-z.x1)*U}else N[0]=M[0];if("string"==typeof M[1]){var H=parseFloat(M[1])/100,W=e.AABBBounds;N[1]=W.x1+(W.x2-W.x1)*H}else N[1]=M[1]}so(D,D,[N[0],N[1],0]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],s=e[1],o=e[2],l=e[3],u=e[4],h=e[5],d=e[6],c=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]=a*r+u*n,t[1]=s*r+h*n,t[2]=o*r+d*n,t[3]=l*r+c*n,t[4]=u*r-a*n,t[5]=h*r-s*n,t[6]=d*r-o*n,t[7]=c*r-l*n}(D,D,P),so(D,D,[-N[0],-N[1],0]),oo(t,t,D)}}var uo=function(){function t(i){a(this,t),this.creator=i,this.hooks={onAttributeUpdate:new rt(["graphic"]),onSetStage:new rt(["graphic","stage"]),onRemove:new rt(["graphic"]),onRelease:new rt(["graphic"]),onAddIncremental:new rt(["graphic","group","stage"]),onClearIncremental:new rt(["graphic","group","stage"]),beforeUpdateAABBBounds:new rt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new rt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new e.AABBBounds,this.tempAABBBounds2=new e.AABBBounds,this._rectBoundsContribitions=[new Zs],this._symbolBoundsContribitions=[new Js],this._circleBoundsContribitions=[new Zs],this._arcBoundsContribitions=[new Zs],this._pathBoundsContribitions=[new Zs]}return o(t,[{key:"onAttributeUpdate",value:function(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}},{key:"onSetStage",value:function(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}},{key:"onRemove",value:function(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}},{key:"onRelease",value:function(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}},{key:"onAddIncremental",value:function(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}},{key:"afterUpdateAABBBounds",value:function(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;var n=new Tt(t);return Wt(i.commandList,n,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){var r=t.width,a=t.height,s=t.x1,o=t.y1,l=t.x,u=t.y;r=null!=r?r:s-l,a=null!=a?a:o-u,i.set(0,0,r||0,a||0)}var h=this.tempAABBBounds1,d=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),d.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,h,n),i.union(h),h.setValue(d.x1,d.y1,d.x2,d.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateGroupAABBBounds",value:function(t,e,i,n){var r=t.width,a=t.height,s=t.path,o=t.clip,l=void 0===o?e.clip:o;s&&s.length?s.forEach((function(t){i.union(t.AABBBounds)})):null!=r&&null!=a&&i.set(0,0,r,a),l||n.forEachChildren((function(t){i.union(t.AABBBounds)}));var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateGlyphAABBBounds",value:function(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((function(t){i.union(t.AABBBounds)})),i):i}},{key:"updateRichTextAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;var r=t.width,a=void 0===r?e.width:r,s=t.height,o=void 0===s?e.height:s,l=t.maxWidth,u=void 0===l?e.maxWidth:l,h=t.maxHeight,d=void 0===h?e.maxHeight:h,c=t.textAlign,f=void 0===c?e.textAlign:c,v=t.textBaseline,p=void 0===v?e.textBaseline:v;if(a>0&&o>0)i.set(0,0,a,o);else{var g=n.getFrameCache().getActualSize(),y=g.width,b=g.height,m=a||y||0,x=o||b||0;x="number"==typeof d&&x>d?d:x||0,m="number"==typeof u&&m>u?u:m||0,i.set(0,0,m,x)}var _=0;switch(p){case"top":_=0;break;case"middle":_=-i.height()/2;break;case"bottom":_=-i.height()}var A=0;switch(f){case"left":A=0;break;case"center":A=-i.width()/2;break;case"right":A=-i.width()}i.translate(A,_);var k=this.tempAABBBounds1,B=this.tempAABBBounds2;return k.setValue(i.x1,i.y1,i.x2,i.y2),B.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateTextAABBBounds",value:function(t,i,n,r){if(!this._validCheck(t,i,n,r))return n;if(!r)return n;var a=r.attribute.text,s=void 0===a?i.text:a;Array.isArray(s)?r.updateMultilineAABBBounds(s):r.updateSingallineAABBBounds(s);var o=this.tempAABBBounds1,l=this.tempAABBBounds2;o.setValue(n.x1,n.y1,n.x2,n.y2),l.setValue(n.x1,n.y1,n.x2,n.y2);var u=t.scaleX,h=void 0===u?i.scaleX:u,d=t.scaleY,c=void 0===d?i.scaleY:d,f=t.shadowBlur,v=void 0===f?i.shadowBlur:f,p=t.strokeBoundsBuffer,g=void 0===p?i.strokeBoundsBuffer:p;v&&(On(o,v/Math.abs(h+c),!0,g),n.union(o));return this.combindShadowAABBBounds(n,r),e.transformBoundsWithMatrix(n,n,r.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(s){s.updateBounds(t,e,r,n),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)}));var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,i,n){if(!n)return i;var r=n.getParsedPathShape();return i.union(r.getBounds()),i}},{key:"updatePyramid3dAABBBounds",value:function(t,e,i,n){if(!n)return i;var r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((function(t){var e=t[0],n=t[1];i.add(e,n)}));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.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}},{key:"updateArc3dAABBBounds",value:function(t,e,i,n){if(!n)return i;var r=n.stage;if(!r||!r.camera)return i;var a=t.outerRadius,s=void 0===a?e.outerRadius:a,o=t.height,l=s+(void 0===o?0:o);i.setValue(-l,-l,l,l);var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updatePolygonAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,i,n){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){i.add(t.x,t.y)})),i}},{key:"updateLineAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,s=i;return a.forEach((function(t){s.add(t.x,t.y)})),s}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,s=i;return a.forEach((function(t){t.points.forEach((function(t){s.add(t.x,t.y)}))})),s}},{key:"updateAreaAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,s=i;return a.forEach((function(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}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,s=i;return a.forEach((function(t){t.points.forEach((function(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}},{key:"updateCircleAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,i,n){var r=t.radius,a=void 0===r?e.radius:r;return i.set(-a,-a,a,a),i}},{key:"updateCircleAABBBoundsAccurate",value:function(t,i,n,r){var a=t.startAngle,s=void 0===a?i.startAngle:a,o=t.endAngle,l=void 0===o?i.endAngle:o,u=t.radius,h=void 0===u?i.radius:u;return l-s>e.pi2-e.epsilon?n.set(-h,-h,h,h):qi(s,l,h,n),n}},{key:"updateArcAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)}));var o=t.lineJoin,l=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,i,e,"miter"===l,r),i}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,i,n){var r=t.innerRadius,a=void 0===r?e.innerRadius:r,s=t.outerRadius,o=void 0===s?e.outerRadius:s;return o<a&&(o=a),i.set(-o,-o,o,o),i}},{key:"updateArcAABBBoundsAccurate",value:function(t,i,n,r){var a=t.outerRadius,s=void 0===a?i.outerRadius:a,o=t.innerRadius,l=void 0===o?i.innerRadius:o;if(s<l){var u=s;s=l,l=u}var h=t.endAngle,d=void 0===h?i.endAngle:h,c=t.startAngle,f=void 0===c?i.startAngle:c;if(f>d){var v=f;f=d,d=v}return s<=e.epsilon?n.set(0,0,0,0):Math.abs(d-f)>e.pi2-e.epsilon?n.set(-s,-s,s,s):(qi(f,d,s,n),qi(f,d,l,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)}));var o=t.lineJoin,l=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,i,e,"miter"===l,r),i}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,i,n,r){var a=t.size,s=void 0===a?i.size:a;if(e.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{var o=s/2;n.set(-o,-o,o,o)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,i,n){if(!n)return i;var r=t.size,a=void 0===r?e.size:r;return n.getParsedPath().bounds(a,i),i}},{key:"updateImageAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){var r=t.width,a=void 0===r?e.width:r,s=t.height,o=void 0===s?e.height:s;i.set(0,0,a,o)}var l=this.tempAABBBounds1,u=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),u.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var i=e.shadowRoot.AABBBounds;t.union(i)}}},{key:"transformAABBBounds",value:function(t,i,n,r,a){var s=t.scaleX,o=void 0===s?n.scaleX:s,l=t.scaleY,u=void 0===l?n.scaleY:l,h=t.stroke,d=void 0===h?n.stroke:h,c=t.shadowBlur,f=void 0===c?n.shadowBlur:c,v=t.lineWidth,p=void 0===v?n.lineWidth:v,g=t.pickStrokeBuffer,y=void 0===g?n.pickStrokeBuffer:g,b=t.strokeBoundsBuffer,m=void 0===b?n.strokeBoundsBuffer:b,x=this.tempAABBBounds1,_=this.tempAABBBounds2;d&&p&&(On(x,(p+y)/Math.abs(o+u),r,m),i.union(x),x.setValue(_.x1,_.y1,_.x2,_.y2));if(f){var A=t.shadowOffsetX,k=void 0===A?n.shadowOffsetX:A,B=t.shadowOffsetY,S=void 0===B?n.shadowOffsetY:B;On(x,f/Math.abs(o+u)*2,!1,m+1),x.translate(k,S),i.union(x)}this.combindShadowAABBBounds(i,a);var w=!0,T=a.transMatrix;a&&a.isContainer&&(w=!(1===T.a&&0===T.b&&0===T.c&&1===T.d&&0===T.e&&0===T.f)),w&&e.transformBoundsWithMatrix(i,i,T)}},{key:"_validCheck",value:function(t,e,i,n){if(!n)return!0;if(!n.valid)return i.clear(),!1;var r=t.visible;return!!(void 0===r?e.visible:r)||(i.clear(),!1)}}]),t}();uo=no([D(),ao(0,I(tr)),ro("design:paramtypes",[Object])],uo);var ho,co=new(function(){function t(){a(this,t),this.store=new Map}return o(t,[{key:"RegisterGraphicCreator",value:function(t,e){this.store.set(t,e),this[t]=e}},{key:"CreateGraphic",value:function(t,e){var i=this.store.get(t);return i?i(e):null}}]),t}());function fo(t){return ho||(ho=co.CreateGraphic("text",{})),ho.setAttributes(t),ho.AABBBounds}var vo={x:0,y:0,z:0,lastModelMatrix:null},po=function(){function t(){a(this,t)}return o(t,[{key:"init",value:function(t){var e=this;t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((function(t){return e._renderContribitions.push(t)})),this._renderContribitions.length&&(this._renderContribitions.sort((function(t,e){return e.order-t.order})),this._beforeRenderContribitions=this._renderContribitions.filter((function(t){return t.time===St.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(t){return t.time===St.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}},{key:"afterRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}},{key:"valid",value:function(t,e,i,n){var r=t.attribute,a=r.fill,s=void 0===a?e.fill:a,o=r.background,l=r.stroke,u=void 0===l?e.stroke:l,h=r.opacity,d=void 0===h?e.opacity:h,c=r.fillOpacity,f=void 0===c?e.fillOpacity:c,v=r.lineWidth,p=void 0===v?e.lineWidth:v,g=r.strokeOpacity,y=void 0===g?e.strokeOpacity:g,b=r.visible,m=void 0===b?e.visible:b,x=mr(d,f,s),_=_r(d,y),A=yr(s,o),k=br(u,p);return!(!t.valid||!m)&&!(!A&&!k)&&!!(x||_||i||n||o)&&{fVisible:x,sVisible:_,doFill:A,doStroke:k}}},{key:"transform",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.attribute,a=r.x,s=void 0===a?e.x:a,o=r.y,l=void 0===o?e.y:o,u=r.z,h=void 0===u?e.z:u,d=r.scaleX,c=void 0===d?e.scaleX:d,f=r.scaleY,v=void 0===f?e.scaleY:f,p=r.angle,g=void 0===p?e.angle:p,y=r.postMatrix,b=i.modelMatrix,m=i.camera;vo.x=s,vo.y=l,vo.z=h,vo.lastModelMatrix=b;var x=m&&(n||function(t){var e=t.attribute,i=e.alpha,n=e.beta;return i||n}(t)),_=x?t.transMatrix.onlyTranslate()&&!y:1===c&&1===v&&0===g&&!y;if(x){var A=io.allocate(),k=io.allocate();lo(k,t,e),oo(A,b||A,k),vo.x=0,vo.y=0,vo.z=0,i.modelMatrix=A,i.setTransform(1,0,0,1,0,0,!0),io.free(k)}if(_&&!b){var B=t.getOffsetXY(e);vo.x+=B.x,vo.y+=B.y,vo.z=h,i.setTransformForCurrent()}else if(x)vo.x=0,vo.y=0,vo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(m&&i.project){var S=t.getOffsetXY(e);vo.x+=S.x,vo.y+=S.y,this.transformWithoutTranslate(i,vo.x,vo.y,vo.z,c,v,g)}else i.transformFromMatrix(t.transMatrix,!0),vo.x=0,vo.y=0,vo.z=0;return vo}},{key:"transformUseContext2d",value:function(t,e,i,n){var r=n.camera;if(this.camera=r,r){var a=t.AABBBounds,s=a.x2-a.x1,o=a.y2-a.y1,l=n.project(0,0,i),u=n.project(s,0,i),h=n.project(s,o,i),d={x:0,y:0},c={x:s,y:0},f={x:s,y:o};n.camera=null;var v=1/(d.x*(f.y-c.y)-c.x*f.y+f.x*c.y+(c.x-f.x)*d.y),p=-(d.y*(h.x-u.x)-c.y*h.x+f.y*u.x+(c.y-f.y)*l.x)*v,g=(c.y*h.y+d.y*(u.y-h.y)-f.y*u.y+(f.y-c.y)*l.y)*v,y=(d.x*(h.x-u.x)-c.x*h.x+f.x*u.x+(c.x-f.x)*l.x)*v,b=-(c.x*h.y+d.x*(u.y-h.y)-f.x*u.y+(f.x-c.x)*l.y)*v,m=(d.x*(f.y*u.x-c.y*h.x)+d.y*(c.x*h.x-f.x*u.x)+(f.x*c.y-c.x*f.y)*l.x)*v,x=(d.x*(f.y*u.y-c.y*h.y)+d.y*(c.x*h.y-f.x*u.y)+(f.x*c.y-c.x*f.y)*l.y)*v;n.setTransform(p,g,y,b,m,x,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,i,n){this.camera&&(n.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,i,n,r,a,s){var o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,a,!1),t.rotate(s,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}},{key:"_draw",value:function(t,e,i,n,r){var a=n.context;if(a){a.highPerformanceSave();var s=this.transform(t,e,a,i),o=s.x,l=s.y,u=s.z,h=s.lastModelMatrix;this.z=u,function(t,e,i,n,r,a,s,o){if(!t.pathProxy)return!1;var l=Ti(t,null==a?void 0:a.theme)[t.type],u=t.attribute,h=u.fill,d=void 0===h?l.fill:h,c=u.stroke,f=void 0===c?l.stroke:c,v=u.opacity,p=void 0===v?l.opacity:v,g=u.fillOpacity,y=void 0===g?l.fillOpacity:g,b=u.lineWidth,m=void 0===b?l.lineWidth:b,x=u.strokeOpacity,_=void 0===x?l.strokeOpacity:x,A=u.visible,k=void 0===A?l.visible:A,B=mr(p,y,d),S=_r(p,_),w=yr(d),T=br(f,m);return!k||!w&&!T||!(B||S||s||o)||(e.beginPath(),Wt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),T&&(o?o(e,t.attribute,l):S&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),w&&(s?s(e,t.attribute,l):B&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fill())),!0)}(t,a,o,l,0,r)||(this.drawShape(t,a,o,l,n,r),this.z=0,a.modelMatrix!==h&&io.free(a.modelMatrix),a.modelMatrix=h),a.highPerformanceRestore()}}}]),t}();function go(t,e,i){var n=e,r=t.currentMatrix,a=r.a,s=r.b,o=r.c,l=r.d,u=Math.sign(a)*Math.sqrt(a*a+s*s),h=Math.sign(l)*Math.sqrt(o*o+l*l);return u+h===0?0:n=n/Math.abs(u+h)*2*i}function yo(t,i,n,r,a){if(!i||!0===i)return"black";var s,o;if(e.isArray(i))for(var l=0;l<i.length&&!(o=i[l]);l++);else o=i;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i){var n,r,a,s,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=i.AABBBounds;if(!u)return;var h=u.x2-u.x1,d=u.y2-u.y1,c=u.x1-o,f=u.y1-l;if(i.attribute){var v=i.attribute,p=v.scaleX,g=void 0===p?1:p,y=v.scaleY,b=void 0===y?1:y;if(g*b==0)return;h/=g,d/=b,c/=g,f/=b}var m=t.createLinearGradient(c+(null!==(n=e.x0)&&void 0!==n?n:0)*h,f+(null!==(r=e.y0)&&void 0!==r?r:0)*d,c+(null!==(a=e.x1)&&void 0!==a?a:1)*h,f+(null!==(s=e.y1)&&void 0!==s?s:0)*d);return e.stops.forEach((function(t){m.addColorStop(t.offset,t.color)})),m}(t,o,n,r,a):"conical"===o.gradient?s=function(t,e,i){var n,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=i.AABBBounds;if(!o)return;var l=o.x2-o.x1,u=o.y2-o.y1,h=o.x1-a,d=o.y1-s;if(i.attribute){var c=i.attribute,f=c.scaleX,v=void 0===f?1:f,p=c.scaleY,g=void 0===p?1:p;if(v*g==0)return;l/=v,u/=g,h/=v,d/=g}var y=t.createConicGradient(h+(null!==(n=e.x)&&void 0!==n?n:0)*l,d+(null!==(r=e.y)&&void 0!==r?r:0)*u,e.startAngle,e.endAngle);return e.stops.forEach((function(t){y.addColorStop(t.offset,t.color)})),y.GetPattern(l+h,u+d,void 0)}(t,o,n,r,a):"radial"===o.gradient&&(s=function(t,e,i){var n,r,a,s,o,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,d=i.AABBBounds;if(!d)return;var c=d.x2-d.x1,f=d.y2-d.y1,v=d.x1-u,p=d.y1-h;if(i.attribute){var g=i.attribute,y=g.scaleX,b=void 0===y?1:y,m=g.scaleY,x=void 0===m?1:m;if(b*x==0)return;v/=b,p/=x,c/=b,f/=x}var _=t.createRadialGradient(v+(null!==(n=e.x0)&&void 0!==n?n:.5)*c,p+(null!==(r=e.y0)&&void 0!==r?r:.5)*f,Math.max(c,f)*(null!==(a=e.r0)&&void 0!==a?a:0),v+(null!==(s=e.x1)&&void 0!==s?s:.5)*c,p+(null!==(o=e.y1)&&void 0!==o?o:.5)*f,Math.max(c,f)*(null!==(l=e.r1)&&void 0!==l?l:.5));return e.stops.forEach((function(t){_.addColorStop(t.offset,t.color)})),_}(t,o,n,r,a)),s||"orange")}var bo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},mo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xo=function(t,e){return function(i,n){e(i,n,t)}},_o=function(){function t(){a(this,t),this.time=St.beforeFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.background,p=f.backgroundMode,g=void 0===p?l.backgroundMode:p;if(v)if(t.backgroundImg&&t.resources){var y=t.resources.get(v);if("success"!==y.state||!y.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var b=Ti(t.parent).group,m=t.parent.attribute,x=m.scrollX,_=void 0===x?b.scrollX:x,A=m.scrollY,k=void 0===A?b.scrollY:A;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(_,k)}e.clip();var B=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,y.data,B,g),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=v,e.fill(),e.highPerformanceRestore()}},{key:"doDrawImage",value:function(t,e,i,n){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{var r=t.createPattern(e,n);t.fillStyle=r,t.translate(i.x1,i.y1),t.fillRect(0,0,i.width(),i.height()),t.translate(-i.x1,-i.y1)}}}]),t}(),Ao=new _o,ko=function(){function t(e){a(this,t),this.subRenderContribitions=e,this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((function(f){f.render(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}}]),t}();ko=bo([D(),xo(0,I(et)),xo(0,N(jr)),mo("design:paramtypes",[Object])],ko);var Bo=function(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=10}return o(t,[{key:"createCommonPattern",value:function(t,e,i,n,r){var a=(t-2*e)/2,s=n.dpr,o=li.allocate({width:t,height:t,dpr:s}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(a,l);var u=n.createPattern(o.nativeCanvas,"repeat");return u.setTransform&&u.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),li.free(o),u}},{key:"createCirclePattern",value:function(t,i,n,r){return this.createCommonPattern(t,i,n,r,(function(t,i){i.fillStyle=n,i.arc(t,t,t,0,e.pi2),i.fill()}))}},{key:"createDiamondPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){var r=t/2,a=r;n.fillStyle=i,n.moveTo(r,a-e),n.lineTo(e+r,a),n.lineTo(r,a+e),n.lineTo(r-e,a),n.closePath(),n.fill()}))}},{key:"createRectPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(a,0,2*n,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(0,a,t,2*n)}))}},{key:"createBiasLRLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);var r=t/2,a=-r;n.moveTo(r,a),n.lineTo(r+t,a+t),n.moveTo(-r,-a),n.lineTo(-r+t,-a+t),n.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);var r=t/2,a=r;n.moveTo(t+r,a),n.lineTo(r,a+t),n.moveTo(t-r,-a),n.lineTo(-r,-a+t),n.stroke()}))}},{key:"createGridPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,t,t),n.fillRect(r+t,a+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this.textureMap||this.initTextureMap(e,t.stage);var f=t.attribute,v=f.texture,p=void 0===v?l.texture:v,g=f.textureColor,y=void 0===g?l.textureColor:g,b=f.textureSize,m=void 0===b?l.textureSize:b,x=f.texturePadding,_=void 0===x?l.texturePadding:x;if(p){var A=this.textureMap.get(p);if(!A)switch(p){case"circle":A=this.createCirclePattern(m,_,y,e);break;case"diamond":A=this.createDiamondPattern(m,_,y,e);break;case"rect":A=this.createRectPattern(m,_,y,e);break;case"vertical-line":A=this.createVerticalLinePattern(m,_,y,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(m,_,y,e);break;case"bias-lr":A=this.createBiasLRLinePattern(m,_,y,e);break;case"bias-rl":A=this.createBiasRLLinePattern(m,_,y,e);break;case"grid":A=this.createGridPattern(m,_,y,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}}}]),t}(),So=new Bo,wo=new(function(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.outerBorder,v=c.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,b=y.innerRadius,m=void 0===b?l.innerRadius:b,x=y.outerRadius,_=void 0===x?l.outerRadius:x,A=y.startAngle,k=void 0===A?l.startAngle:A,B=y.endAngle,S=void 0===B?l.endAngle:B,w=y.opacity,T=void 0===w?l.opacity:w,P=y.x,C=void 0===P?l.x:P,M=y.y,O=void 0===M?l.y:M,E=y.scaleX,L=void 0===E?l.scaleX:E,R=y.scaleY,I=void 0===R?l.scaleY:R,j=!(!f||!f.stroke),D=!(!v||!v.stroke);if(p){var N=f.distance,U=void 0===N?l.outerBorder.distance:N,z=go(e,U,e.dpr),H=U/_;if(t.setAttributes({outerRadius:_+z,innerRadius:m-z,startAngle:k-H,endAngle:S+H}),e.beginPath(),Sr(t,e,i,n,_+z,m-z),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,f,l.outerBorder);else if(j){var W=l.outerBorder.opacity;l.outerBorder.opacity=T,e.setStrokeStyle(t,f,(C-i)/L,(O-n)/I,l.outerBorder),l.outerBorder.opacity=W,e.stroke()}}if(g){var V=v.distance,F=void 0===V?l.innerBorder.distance:V,G=go(e,F,e.dpr),Y=F/_;if(t.setAttributes({outerRadius:_-G,innerRadius:m+G,startAngle:k+Y,endAngle:S-Y}),e.beginPath(),Sr(t,e,i,n,_-G,m+G),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,v,l.innerBorder);else if(D){var X=l.innerBorder.opacity;l.innerBorder.opacity=T,e.setStrokeStyle(t,v,(C-i)/L,(O-n)/I,l.innerBorder),l.innerBorder.opacity=X,e.stroke()}}t.setAttributes({outerRadius:_,innerRadius:m,startAngle:k,endAngle:S})}}}]),t}()),To=So,Po=Ao,Co=function(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.outerBorder,v=c.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,b=y.radius,m=void 0===b?l.radius:b,x=y.startAngle,_=void 0===x?l.startAngle:x,A=y.endAngle,k=void 0===A?l.endAngle:A,B=y.opacity,S=void 0===B?l.opacity:B,w=y.x,T=void 0===w?l.x:w,P=y.y,C=void 0===P?l.y:P,M=y.scaleX,O=void 0===M?l.scaleX:M,E=y.scaleY,L=void 0===E?l.scaleY:E,R=!(!f||!f.stroke),I=!(!v||!v.stroke);if(p){var j=f.distance,D=go(e,void 0===j?l.outerBorder.distance:j,e.dpr);if(e.beginPath(),e.arc(i,n,m+D,_,k),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,f,l.outerBorder);else if(R){var N=l.outerBorder.opacity;l.outerBorder.opacity=S,e.setStrokeStyle(t,f,(T-i)/O,(C-n)/L,l.outerBorder),l.outerBorder.opacity=N,e.stroke()}}if(g){var U=v.distance,z=go(e,void 0===U?l.innerBorder.distance:U,e.dpr);if(e.beginPath(),e.arc(i,n,m-z,_,k),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,v,l.innerBorder);else if(I){var H=l.innerBorder.opacity;l.innerBorder.opacity=S,e.setStrokeStyle(t,v,(T-i)/O,(C-n)/L,l.innerBorder),l.innerBorder.opacity=H,e.stroke()}}}}}]),t}(),Mo=new Co,Oo=So,Eo=Ao,Lo=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=St.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.background,v=c.backgroundMode,p=void 0===v?l.backgroundMode:v;if(f)if(t.backgroundImg&&t.resources){var g=t.resources.get(f);if("success"!==g.state||!g.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var y=t.AABBBounds;this.doDrawImage(e,g.data,y,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}}]),i}(_o),Ro=new Lo,Io=e.pi/2;function jo(t,i,n,r,a,s){var o;if(r<0&&(i+=r,r=-r),a<0&&(n+=a,a=-a),e.isNumber(s,!0))o=[s=e.abs(s),s,s,s];else if(Array.isArray(s)){var l,u,h=s;switch(h.length){case 0:o=[0,0,0,0];break;case 1:o=[l=e.abs(h[0]),l,l,l];break;case 2:case 3:o=[l=e.abs(h[0]),u=e.abs(h[1]),l,u];break;default:(o=h)[0]=e.abs(o[0]),o[1]=e.abs(o[1]),o[2]=e.abs(o[2]),o[3]=e.abs(o[3])}}else o=[0,0,0,0];if(r<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(i,n,r,a);var d=[i,n],c=[i+r,n],f=[i+r,n+a],v=[i,n+a],p=Math.min(r/2,a/2),g=[Math.min(p,o[0]),Math.min(p,o[1]),Math.min(p,o[2]),Math.min(p,o[3])],y=[d[0]+g[0],d[1]],b=[d[0],d[1]+g[0]],m=[c[0]-g[1],c[1]],x=[c[0],c[1]+g[1]],_=[f[0]-g[2],f[1]],A=[f[0],f[1]-g[2]],k=[v[0]+g[3],v[1]],B=[v[0],v[1]-g[3]];if(t.moveTo(y[0],y[1]),t.lineTo(m[0],m[1]),!e.arrayEqual(m,x)){var S=m[0],w=m[1]+g[1];t.arc(S,w,g[1],-Io,0,!1)}if(t.lineTo(A[0],A[1]),!e.arrayEqual(_,A)){var T=A[0]-g[2],P=A[1];t.arc(T,P,g[2],0,Io,!1)}if(t.lineTo(k[0],k[1]),!e.arrayEqual(k,B)){var C=k[0],M=k[1]-g[3];t.arc(C,M,g[3],Io,e.pi,!1)}if(t.lineTo(b[0],b[1]),!e.arrayEqual(y,b)){var O=y[0],E=y[1]+g[0];t.arc(O,E,g[0],e.pi,e.pi+Io,!1)}return t.closePath(),t}var Do=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).time=St.beforeFillStroke,t}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.background,p=f.backgroundMode,g=void 0===p?u.backgroundMode:p;if(v)if(t.backgroundImg){var y=t.resources.get(v);if("success"!==y.state||!y.data)return;if(i.save(),t.parent&&!t.transMatrix.onlyTranslate()){var b=Ti(t.parent).group,m=t.parent.attribute,x=m.scrollX,_=void 0===x?b.scrollX:x,A=m.scrollY,k=void 0===A?b.scrollY:A;i.setTransformFromMatrix(t.parent.globalTransMatrix,!0),i.translate(_,k)}var B=t.AABBBounds;this.doDrawImage(i,y.data,B,g),i.restore(),t.transMatrix.onlyTranslate()||i.setTransformForCurrent()}else if(e.isObject(v)){var S=v.stroke,w=v.fill,T=v.lineWidth,P=void 0===T?1:T,C=v.cornerRadius,M=void 0===C?0:C,O=v.expandX,E=void 0===O?0:O,L=v.expandY,R=void 0===L?0:L;if(!S&&!w)return;i.beginPath();var I=function(t){var i=Yi(t.attribute.boundsPadding),n=t.AABBBounds,r=n.x1,a=n.y1,s=n.width(),o=n.height();return e.isNumber(i)?(r+=i,a+=i,s-=2*i,o-=2*i):(r+=i[3],a+=i[0],s-=i[1]+i[3],o-=i[0]+i[2]),{x:r,y:a,width:s,height:o}}(t),j=I.x,D=I.y,N=I.width,U=I.height;M?jo(i,j-E,D-R,N+2*E,U+2*R,M):i.rect(j-E,D-R,N+2*E,U+2*R),i.globalAlpha=1,w&&(i.fillStyle=w,i.fill()),S&&P>0&&(i.lineWidth=P,i.strokeStyle=S,i.stroke())}else{i.beginPath();var z=t.AABBBounds;i.rect(n,r,z.width(),z.height()),i.fillStyle=v,i.globalAlpha=1,i.fill()}}}]),n}(_o);var No=new Do,Uo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zo=function(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.outerBorder,p=f.innerBorder,g=v&&!1!==v.visible,y=p&&!1!==p.visible;if(g||y){var b=t.attribute,m=b.cornerRadius,x=void 0===m?u.cornerRadius:m,_=b.opacity,A=void 0===_?u.opacity:_,k=b.x,B=void 0===k?u.x:k,S=b.y,w=void 0===S?u.y:S,T=b.scaleX,P=void 0===T?u.scaleX:T,C=b.scaleY,M=void 0===C?u.scaleY:C,O=b.x1,E=b.y1,L=t.attribute,R=L.width,I=L.height;R=(null!=R?R:O-n)||0,I=(null!=I?I:E-r)||0;var j=!(!v||!v.stroke),D=!(!p||!p.stroke);if(g){var N=v.distance,U=go(i,void 0===N?u.outerBorder.distance:N,i.dpr),z=n-U,H=r-U,W=2*U;if(0===x||e.isArray(x)&&x.every((function(t){return 0===t}))?(i.beginPath(),i.rect(z,H,R+W,I+W)):(i.beginPath(),jo(i,z,H,R+W,I+W,x)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),c)c(i,v,u.outerBorder);else if(j){var V=u.outerBorder.opacity;u.outerBorder.opacity=A,i.setStrokeStyle(t,v,(B-n)/P,(w-r)/M,u.outerBorder),u.outerBorder.opacity=V,i.stroke()}}if(y){var F=p.distance,G=go(i,void 0===F?u.innerBorder.distance:F,i.dpr),Y=n+G,X=r+G,$=2*G;if(0===x||e.isArray(x)&&x.every((function(t){return 0===t}))?(i.beginPath(),i.rect(Y,X,R-$,I-$)):(i.beginPath(),jo(i,Y,X,R-$,I-$,x)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),c)c(i,p,u.innerBorder);else if(D){var q=u.innerBorder.opacity;u.innerBorder.opacity=A,i.setStrokeStyle(t,p,(B-n)/P,(w-r)/M,u.innerBorder),u.innerBorder.opacity=q,i.stroke()}}}}}]),t}(),Ho=function(){function t(){a(this,t),this.time=St.beforeFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute.stroke,v=void 0===f?l.stroke:f;Array.isArray(v)&&v.some((function(t){return!1===t}))&&(c.doStroke=!1)}}]),t}();Ho=Uo([D()],Ho);var Wo=function(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.width,v=void 0===f?l.width:f,p=c.height,g=void 0===p?l.height:p,y=c.stroke,b=void 0===y?l.stroke:y;if(Array.isArray(b)&&b.some((function(t){return!1===t}))){if(e.setStrokeStyle(t,t.attribute,i,n,l),e.beginPath(),e.moveTo(i,n),b[0]?e.lineTo(i+v,n):e.moveTo(i+v,n),b[1]?e.lineTo(i+v,n+g):e.moveTo(i+v,n+g),b[2]?e.lineTo(i,n+g):e.moveTo(i,n+g),b[3]){var m=b[0]?n-e.lineWidth/2:n;e.lineTo(i,m)}else e.moveTo(i,n);e.stroke()}}}]),t}();Wo=Uo([D()],Wo);var Vo=new zo,Fo=So,Go=Ao,Yo=new(function(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.getParsedPath();if(c){var f=t.attribute,v=f.outerBorder,p=f.innerBorder,g=v&&!1!==v.visible,y=p&&!1!==p.visible;if(g||y){var b=t.attribute,m=b.size,x=void 0===m?l.size:m,_=b.opacity,A=void 0===_?l.opacity:_,k=b.x,B=void 0===k?l.x:k,S=b.y,w=void 0===S?l.y:S,T=b.scaleX,P=void 0===T?l.scaleX:T,C=b.scaleY,M=void 0===C?l.scaleY:C,O=!(!v||!v.stroke),E=!(!p||!p.stroke);if(g){var L=v.distance,R=go(e,void 0===L?l.outerBorder.distance:L,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,x,i,n,R)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,v,l.outerBorder);else if(O){var I=l.outerBorder.opacity;l.outerBorder.opacity=A,e.setStrokeStyle(t,v,(B-i)/P,(w-n)/M,l.outerBorder),l.outerBorder.opacity=I,e.stroke()}}if(y){var j=p.distance,D=go(e,void 0===j?l.innerBorder.distance:j,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,x,i,n,-D)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,p,l.innerBorder);else if(E){var N=l.innerBorder.opacity;l.innerBorder.opacity=A,e.setStrokeStyle(t,p,(B-i)/P,(w-n)/M,l.innerBorder),l.innerBorder.opacity=N,e.stroke()}}}}}}]),t}()),Xo=So,$o=Ao,qo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ko=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zo=function(t,e){return function(i,n){e(i,n,t)}},Jo=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).arcRenderContribitions=t,e.numberType=Un,e.builtinContributions=[wo,Po,To],e.init(t),e}return o(n,[{key:"drawArcTailCapPath",value:function(t,i,n,r,a,s,o,l){var u=l-o,h=t.getParsedAngle(),d=h.startAngle,c=h.endAngle;c=l;var f=e.abs(c-d),v=c>d,p=!1;if(a<s){var g=a;a=s,s=g}var y=t.getParsedCornerRadius(),b=t.getParsePadAngle(d,c);b.outerDeltaAngle;var m,x,_,A,k=b.innerDeltaAngle,B=b.outerStartAngle,S=b.outerEndAngle,w=b.innerEndAngle,T=b.innerStartAngle,P=y,C=y,M=y,O=y,E=Math.max(C,P),L=Math.max(M,O),R=E,I=L,j=a*e.cos(B),D=a*e.sin(B),N=s*e.cos(w),U=s*e.sin(w);if((L>e.epsilon||E>e.epsilon)&&(m=a*e.cos(S),x=a*e.sin(S),_=s*e.cos(T),A=s*e.sin(T),f<e.pi)){var z=kr(j,D,_,A,m,x,N,U);if(z){var H=j-z[0],W=D-z[1],V=m-z[0],F=x-z[1],G=1/e.sin(e.acos((H*V+W*F)/(e.sqrt(H*H+W*W)*e.sqrt(V*V+F*F)))/2),Y=e.sqrt(z[0]*z[0]+z[1]*z[1]);I=e.min(L,(s-Y)/(G-1)),R=e.min(E,(a-Y)/(G+1))}}if(R>e.epsilon){var X=e.min(P,R),$=e.min(C,R),q=Br(_,A,j,D,a,X,Number(v)),K=Br(m,x,N,U,a,$,Number(v));if(R<E&&X===$)i.moveTo(n+q.cx+q.x01,r+q.cy+q.y01),i.arc(n+q.cx,r+q.cy,R,e.atan2(q.y01,q.x01),e.atan2(K.y01,K.x01),!v);else{var Z=c-u-.03,J=e.atan2(K.y11,K.x11);i.arc(n,r,a,Z,J,!v),$>0&&i.arc(n+K.cx,r+K.cy,$,e.atan2(K.y11,K.x11),e.atan2(K.y01,K.x01),!v)}}else i.moveTo(n+j,r+D);if(!(s>e.epsilon)||k<.001)i.lineTo(n+N,r+U),p=!0;else if(I>e.epsilon){var Q=e.min(O,I),tt=e.min(M,I),et=Br(N,U,m,x,s,-tt,Number(v)),it=Br(j,D,_,A,s,-Q,Number(v));if(i.lineTo(n+et.cx+et.x01,r+et.cy+et.y01),I<L&&Q===tt){var nt=e.atan2(it.y01,it.x01);i.arc(n+et.cx,r+et.cy,I,e.atan2(et.y01,et.x01),nt,!v)}else{tt>0&&i.arc(n+et.cx,r+et.cy,tt,e.atan2(et.y01,et.x01),e.atan2(et.y11,et.x11),!v);var rt=e.atan2(et.cy+et.y11,et.cx+et.x11),at=c-u-.03;i.arc(n,r,s,rt,at,v)}}else i.lineTo(n+s*e.cos(T),r+s*e.sin(T));return p}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Ti(t,null==s?void 0:s.theme).arc,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.stroke,v=void 0===f?u.stroke:f,p=h.x,g=void 0===p?u.x:p,y=h.y,b=void 0===y?u.y:y,m=this.valid(t,u,o,l);if(m){var x=m.fVisible,_=m.sVisible,A=m.doFill,k=m.doStroke,B=t.attribute,S=B.outerRadius,w=void 0===S?u.outerRadius:S,T=B.innerRadius,P=void 0===T?u.innerRadius:T,C=B.cap,M=void 0===C?u.cap:C,O=B.forceShowCap,E=void 0===O?u.forceShowCap:O,L=0,R=(e.isBoolean(M)&&M||M[0])&&"conical"===c.gradient;if(R){var I=t.getParsedAngle(),j=I.sc,D=I.startAngle,N=I.endAngle;e.abs(N-D)<e.pi2-e.epsilon&&(L=j||0,c.startAngle-=L,c.endAngle-=L)}var U=!1,z=function(t){var i,n=!0;if(e.isBoolean(t,!0)){for(var r=0;r<4;r++)Fi[r]=t,n&&(n=!(null!==(i=Fi[r])&&void 0!==i&&!i));n=t}else if(Array.isArray(t))for(var a=0;a<4;a++)Fi[a]=!!t[a],n&&(n=!!Fi[a]);else Fi[0]=!1,Fi[1]=!1,Fi[2]=!1,Fi[3]=!1;return{isFullStroke:n,stroke:Fi}}(v),H=z.isFullStroke,W=z.stroke;if((A||H)&&(i.beginPath(),Sr(t,i,n,r,w,P),U=!0,i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),A&&(o?o(i,t.attribute,u):x&&(i.setCommonStyle(t,t.attribute,g-n,b-r,u),i.fill())),k&&H&&(l?l(i,t.attribute,u):_&&(i.setStrokeStyle(t,t.attribute,g-n,b-r,u),i.stroke()))),!H&&k&&(i.beginPath(),Sr(t,i,n,r,w,P,W),U||this.beforeRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),l?l(i,t.attribute,u):_&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke())),(e.isBoolean(M)&&M||M[1])&&E){var V=t.getParsedAngle(),F=V.startAngle,G=V.endAngle;if(e.abs(G-F)>=e.pi2-e.epsilon){i.beginPath();var Y=Math.abs(w-P)/2/w,X=t.attribute,$=X.endAngle,q=void 0===$?u.endAngle:$,K=X.fill,Z=void 0===K?u.fill:K,J=q;if(this.drawArcTailCapPath(t,i,n,r,w,P,J,J+Y),U||this.beforeRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),A){var Q=Z;if("conical"===Q.gradient){var tt=function(t,i,n,r){for(var a=r.stops,s=r.startAngle,o=r.endAngle;n<0;)n+=e.pi2;for(;n>e.pi2;)n-=e.pi2;if(n<s)return a[0].color;if(n>o)return a[0].color;for(var l,u,h=(n-s)/(o-s),d=0;d<a.length;d++)if(a[d].offset>=h){l=a[d-1],u=a[d];break}return h=(h-l.offset)/(u.offset-l.offset),on(l.color,u.color,h,!1)}(0,0,q,Q);o||mr&&(i.setCommonStyle(t,t.attribute,n,r,u),i.fillStyle=tt,i.fill())}}k&&(l||_&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke()))}}this.afterRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),R&&(c.startAngle+=L,c.endAngle+=L)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}}]),n}(po);Jo=qo([D(),Zo(0,I(et)),Zo(0,N(wr)),Ko("design:paramtypes",[Object])],Jo);var Qo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},tl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},el=function(t,e){return function(i,n){e(i,n,t)}},il=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).circleRenderContribitions=t,n.numberType=Wn,n.builtinContributions=[Mo,Eo,Oo],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l=Ti(t,null==a?void 0:a.theme).circle,u=t.attribute,h=u.radius,d=void 0===h?l.radius:h,c=u.startAngle,f=void 0===c?l.startAngle:c,v=u.endAngle,p=void 0===v?l.endAngle:v,g=u.x,y=void 0===g?l.x:g,b=u.y,m=void 0===b?l.y:b,x=this.valid(t,l,s,o);if(x){var _=x.fVisible,A=x.sVisible,k=x.doFill,B=x.doStroke;e.beginPath(),e.arc(i,n,d,f,p),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,k,B,_,A,l,r,s,o),k&&(s?s(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,y-i,m-n,l),e.fill())),B&&(o?o(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,y-i,m-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,k,B,_,A,l,r,s,o)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}}]),i}(po);function nl(t,i,n,r,a){var s,o=a||{},l=o.offsetX,u=void 0===l?0:l,h=o.offsetY,d=void 0===h?0:h,c=o.offsetZ,f=void 0===c?0:c,v=o.mode,p=void 0===v?"none":v,g=o.drawConnect,y=void 0!==g&&g;if(o.zeroX,o.zeroY,(!y||"none"!==p)&&i){var b=!0,m=i.curves;if(n>=1)if(y){var x,_=!0;m.forEach((function(e,i){var n,r=e.p0;if(e.originP1!==e.originP2){if(x&&x.originP1===x.originP2&&(r=x.p0),e.defined)_||(t.lineTo(r.x+u,r.y+d,f),_=!_);else{var a,s=e.originP1,o=e.originP2;if(s&&!1!==s.defined?a=r:s&&!1!==o.defined&&(a=null!==(n=e.p3)&&void 0!==n?n:e.p1),_){_=!_;var l=a?a.x:e.p0.x,h=a?a.y:e.p0.y;t.moveTo(l+u,h+d,f)}else a&&(_=!_,t.lineTo(a.x+u,a.y+d,f))}x=e}else x=e}))}else m.forEach((function(e){e.defined?(b&&t.moveTo(e.p0.x+u,e.p0.y+d,f),rl(t,e,1,a),b=!1):b=!0}));else if(!(n<=0)){var A;"x"===r?A=kt.ROW:"y"===r?A=kt.COLUMN:"auto"===r&&(A=i.direction);for(var k=n*i.tryUpdateLength(A),B=0,S=!0,w=null,T=0,P=m.length;T<P;T++){var C=m[T],M=C.getLength(A),O=(k-B)/M;if(B+=M,O<0)break;if(y){var E=C.p0;if(C.originP1===C.originP2){w=C;continue}if(w&&w.originP1===w.originP2&&(E=w.p0),C.defined)S||(t.lineTo(E.x+u,E.y+d,f),S=!S);else{var L=C.originP1,R=C.originP2,I=void 0;if(L&&!1!==L.defined?I=E:L&&!1!==R.defined&&(I=null!==(s=C.p3)&&void 0!==s?s:C.p1),S){S=!S;var j=I?I.x:C.p0.x,D=I?I.y:C.p0.y;t.moveTo(j+u,D+d,f)}else I&&(S=!S,t.lineTo(I.x+u,I.y+d,f))}w=C}else{if(!C.defined){b=!0;continue}b&&t.moveTo(C.p0.x+u,C.p0.y+d,f),rl(t,C,e.min(O,1),a),b=!1}}}}}function rl(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,l+e.p1.y,s+e.p2.x,l+e.p2.y,s+e.p3.x,l+e.p3.y,h):t.lineTo(s+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var d=b(Xt(e,i),1)[0];t.bezierCurveTo(s+d.p1.x,l+d.p1.y,s+d.p2.x,l+d.p2.y,s+d.p3.x,l+d.p3.y,h)}else{var c=e.getPointAt(i);t.lineTo(s+c.x,l+c.y,h)}}}il=Qo([D(),el(0,I(et)),el(0,N(Pr)),tl("design:paramtypes",[Object])],il);var al=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},sl=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).numberType=Gn,t}return o(n,[{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f,v,p){var g,y,b,m,x;if(i){t.beginPath();var _=null!==(g=this.z)&&void 0!==g?g:0;nl(t.camera?t:t.nativeContext,i,u,h,{offsetX:d,offsetY:c,offsetZ:_}),f.cache&&!e.isArray(f.cache)&&f.cache.curves.every((function(t){return t.defined}))&&f.attribute.curveType&&f.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(f,o,l);var A=o.x,k=void 0===A?0:A,B=o.x,S=void 0===B?0:B;!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,o,k-d,S-c,l),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,o,k-d,S-c,l),t.stroke()));var w=o.connectedType,T=o.connectedX,P=o.connectedY,C=o.connectedStyle;if(e.isArray(l)?(w=null!==(y=null!=w?w:l[0].connectedType)&&void 0!==y?y:l[1].connectedType,T=null!==(b=null!=T?T:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,P=null!==(m=null!=P?P:l[0].connectedY)&&void 0!==m?m:l[1].connectedY,C=null!==(x=null!=C?C:l[0].connectedStyle)&&void 0!==x?x:l[1].connectedStyle):(w=null!=w?w:l.connectedType,T=null!=T?T:l.connectedX,P=null!=P?P:l.connectedY,C=null!=C?C:l.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),"none"!==w){t.beginPath(),nl(t.camera?t:t.nativeContext,i,u,h,{offsetX:d,offsetY:c,offsetZ:_,drawConnect:!0,mode:w,zeroX:T,zeroY:P});var M=[];e.isArray(l)?l.forEach((function(t){return M.push(t)})):M.push(l),M.push(o),!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,C,k-d,S-c,M),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,C,k-d,S-c,M),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f;e.beginPath();var v=null!==(f=this.z)&&void 0!==f?f:0,p=t.attribute.points,g=p[0];e.moveTo(g.x+s,g.y+o,v);for(var y=1;y<p.length;y++){var b=p[y];e.lineTo(b.x+s,b.y+o,v)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);var m=t.attribute,x=m.x,_=void 0===x?0:x,A=m.x,k=void 0===A?0:A;!1!==i&&(d?d(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,_-s,k-o,l),e.fill())),!1!==n&&(c?c(e,t.attribute,l):a&&(e.setStrokeStyle(t,t.attribute,_-s,k-o,l),e.stroke()))}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=this,h=Ti(t,null==s?void 0:s.theme).line,d=t.attribute,c=d.fill,f=void 0===c?h.fill:c,v=d.stroke,p=void 0===v?h.stroke:v,g=d.fillOpacity,y=void 0===g?h.fillOpacity:g,b=d.strokeOpacity,m=void 0===b?h.strokeOpacity:b,x=d.segments,_=d.points,A=d.closePath;if(this.valid(t,h,o,l)){var k=t.attribute.curveType,B=void 0===k?h.curveType:k;A&&"linear"===B&&(B="linearClosed");var S=t.attribute,w=S.clipRange,T=void 0===w?h.clipRange:w,P=S.clipRangeByDimension,C=void 0===P?h.clipRangeByDimension:P;if(1===T&&!x&&!_.some((function(t){return!1===t.defined}))&&"linear"===B)return this.drawLinearLineHighPerformance(t,i,!!f,!!p,y,m,n,r,h,a,s,o,l);if(t.shouldUpdateShape()){var M=t.attribute,O=M.points,E=M.segments,L=O;if(E&&E.length){var R,I;if(t.cache=E.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(I={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===e?R={x:I.endX,y:I.endY,defined:I.curves[I.curves.length-1].defined}:e>1&&(R.x=I.endX,R.y=I.endY,R.defined=I.curves[I.curves.length-1].defined);var i=ye(t.points,B,{startPoint:R});return I=i,i})).filter((function(t){return!!t})),"linearClosed"===B){for(var j,D=0;D<t.cache.length;D++){for(var N=t.cache[D],U=0;U<N.curves.length;U++)if(N.curves[U].defined){j=N.curves[U].p0;break}if(j)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(j.x,j.y,!0)}}else{if(!O||!O.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ye(L,B)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){var z=t.attribute.segments.filter((function(t){return t.points.length}));if(1===z[0].points.length&&z.shift(),1===T){var H=!1;t.cache.forEach((function(e,a){H||(H=u.drawSegmentItem(i,e,!!f,!!p,y,m,z[a],[h,t.attribute],T,C,n,r,t,o,l))}))}else{var W=t.cache.reduce((function(t,e){return t+e.getLength()}),0),V=T*W,F=0,G=!1;t.cache.forEach((function(a,s){if(!G){var d=a.getLength(),c=(V-F)/d;F+=d,c>0&&(G=u.drawSegmentItem(i,a,!!f,!!p,y,m,z[s],[h,t.attribute],e.min(c,1),C,n,r,t,o,l))}}))}}else this.drawSegmentItem(i,t.cache,!!f,!!p,y,m,t.attribute,h,T,C,n,r,t,o,l)}}}]),n}(po);function ol(t,e,i,n){if(!(e.length<2)){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;r.mode;var d=e[0];t.moveTo(d.p0.x+s,d.p0.y+l,h);var c=(d=e[e.length-1]).p3||d.p1;t.lineTo(c.x+s,c.y+l,h),d=i[i.length-1],t.lineTo(d.p0.x+s,d.p0.y+l,h),c=(d=i[0]).p3||d.p1,t.lineTo(c.x+s,c.y+l,h),t.closePath()}}function ll(t,e,i,n){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u,d=!0;e.forEach((function(e){e.defined?(d&&t.moveTo(e.p0.x+s,e.p0.y+l,h),ul(t,e,1,n),d=!1):d=!0})),d=!0;for(var c=i.length-1;c>=0;c--){var f=i[c];f.defined?(d&&t.lineTo(f.p0.x+s,f.p0.y+l,h),ul(t,f,1,n),d=!1):d=!0}t.closePath()}function ul(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,l+e.p1.y,s+e.p2.x,l+e.p2.y,s+e.p3.x,l+e.p3.y,h):t.lineTo(s+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var d=b(Xt(e,i),1)[0];t.bezierCurveTo(s+d.p1.x,l+d.p1.y,s+d.p2.x,l+d.p2.y,s+d.p3.x,l+d.p3.y,h)}else{var c=e.getPointAt(i);t.lineTo(s+c.x,l+c.y,h)}}}sl=al([D()],sl);var hl=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=St.afterFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f,v,p,g;this.textureMap||this.initTextureMap(e,t.stage);var y=(c||{}).attribute,b=void 0===y?t.attribute:y,m=b.texture,x=void 0===m?null!==(f=t.attribute.texture)&&void 0!==f?f:Ji(l,"texture"):m,_=b.textureColor,A=void 0===_?null!==(v=t.attribute.textureColor)&&void 0!==v?v:Ji(l,"textureColor"):_,k=b.textureSize,B=void 0===k?null!==(p=t.attribute.textureSize)&&void 0!==p?p:Ji(l,"textureSize"):k,S=b.texturePadding,w=void 0===S?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:Ji(l,"texturePadding"):S;if(x){var T=this.textureMap.get(x);if(!T)switch(x){case"circle":T=this.createCirclePattern(B,w,A,e);break;case"diamond":T=this.createDiamondPattern(B,w,A,e);break;case"rect":T=this.createRectPattern(B,w,A,e);break;case"vertical-line":T=this.createVerticalLinePattern(B,w,A,e);break;case"horizontal-line":T=this.createHorizontalLinePattern(B,w,A,e);break;case"bias-lr":T=this.createBiasLRLinePattern(B,w,A,e);break;case"bias-rl":T=this.createBiasRLLinePattern(B,w,A,e);break;case"grid":T=this.createGridPattern(B,w,A,e)}T&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=T,e.fill(),e.highPerformanceRestore())}}}]),i}(Bo),dl=new hl,cl=Ao,fl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pl=function(t,e){return function(i,n){e(i,n,t)}};function gl(t,e,i){switch(e){case"linear":default:return ee(t,i);case"basis":return re(t,i);case"monotoneX":return de(t,i);case"monotoneY":return ce(t,i);case"step":return ve(t,.5,i);case"stepBefore":return ve(t,0,i);case"stepAfter":return ve(t,1,i);case"linearClosed":return ge(t,i)}}var yl=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).areaRenderContribitions=t,e.numberType=Hn,e.builtinContributions=[dl,cl],e.init(t),e}return o(n,[{key:"drawLinearAreaHighPerformance",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f){var v,p,g,y,b;i.beginPath();var m=null!==(v=this.z)&&void 0!==v?v:0,x=t.attribute.points,_=x[0];i.moveTo(_.x+o,_.y+l,m);for(var A=1;A<x.length;A++){var k=x[A];i.lineTo(k.x+o,k.y+l,m)}for(var B=x.length-1;B>=0;B--){var S=x[B];i.lineTo((null!==(p=S.x1)&&void 0!==p?p:S.x)+o,(null!==(g=S.y1)&&void 0!==g?g:S.y)+l,m)}i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,i,o,l,!!a,!1,n,!1,u,h,c,null,{attribute:t.attribute});var w=t.attribute,T=w.x,P=void 0===T?0:T,C=w.x,M=void 0===C?0:C;if(!1!==n&&(c?c(i,t.attribute,u):a&&(i.setCommonStyle(t,t.attribute,P-o,M-l,u),i.fill())),r){var O=t.attribute.stroke,E=void 0===O?u&&u.stroke:O;if(e.isArray(E)&&(E[0]||E[2])&&!1===E[1])if(i.beginPath(),E[0]){i.moveTo(_.x+o,_.y+l,m);for(var L=1;L<x.length;L++){var R=x[L];i.lineTo(R.x+o,R.y+l,m)}}else if(E[2]){var I=x[x.length-1];i.moveTo(I.x+o,I.y+l,m);for(var j=x.length-2;j>=0;j--){var D=x[j];i.lineTo((null!==(y=D.x1)&&void 0!==y?y:D.x)+o,(null!==(b=D.y1)&&void 0!==b?b:D.y)+l,m)}}i.setStrokeStyle(t,t.attribute,P-o,M-l,u),i.stroke(),this.afterRenderStep(t,i,o,l,!!a,!1,n,!1,u,h,c,null,{attribute:t.attribute})}}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,d,c,f,v,p=this,g=Ti(t,null==s?void 0:s.theme).area,y=t.attribute,b=y.fill,m=void 0===b?g.fill:b,x=y.stroke;void 0===x&&g.stroke;var _=y.fillOpacity,A=void 0===_?g.fillOpacity:_,k=y.z,B=void 0===k?g.z:k,S=y.strokeOpacity,w=void 0===S?g.strokeOpacity:S,T=this.valid(t,g,o,l);if(T){var P=T.doFill,C=T.doStroke,M=t.attribute,O=M.clipRange,E=void 0===O?g.clipRange:O,L=M.closePath,R=M.points,I=M.segments,j=t.attribute.curveType,D=void 0===j?g.curveType:j;if(L&&"linear"===D&&(D="linearClosed"),1===E&&!I&&!R.some((function(t){return!1===t.defined}))&&"linear"===D)return this.drawLinearAreaHighPerformance(t,i,!!m,C,A,w,n,r,g,a,s,o,l);if(t.shouldUpdateShape()){if(I&&I.length){for(var N,U,z,H=I.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(U={endX:t.points[0].x,endY:t.points[0].y}),null;1===e?N={x:U.endX,y:U.endY}:e>1&&(N.x=U.endX,N.y=U.endY);var i=gl(t.points,D,{startPoint:N});return U=i,i})).filter((function(t){return!!t})),W=[],V=I.length-1;V>=0;V--){for(var F=I[V].points,G=[],Y=F.length-1;Y>=0;Y--)G.push({x:null!==(u=F[Y].x1)&&void 0!==u?u:F[Y].x,y:null!==(h=F[Y].y1)&&void 0!==h?h:F[Y].y});if(0!==V){var X=I[V-1].points,$=X[X.length-1];$&&G.push({x:null!==(d=$.x1)&&void 0!==d?d:$.x,y:null!==(c=$.y1)&&void 0!==c?c:$.y})}G.length>1&&(z=gl(G,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D),W.unshift(z))}t.cacheArea=W.map((function(t,e){return{top:H[e],bottom:t}}))}else{if(!R||!R.length)return t.cacheArea=null,void t.clearUpdateShapeTag();for(var q=R,K=[],Z=R.length-1;Z>=0;Z--)K.push({x:null!==(f=R[Z].x1)&&void 0!==f?f:R[Z].x,y:null!==(v=R[Z].y1)&&void 0!==v?v:R[Z].y});var J=gl(q,D),Q=gl(K,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D);t.cacheArea={top:J,bottom:Q}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){var tt=t.attribute.segments.filter((function(t){return t.points.length}));if(1===tt[0].points.length&&tt.shift(),1===E){var et=!1;t.cacheArea.forEach((function(e,s){et||(et=p.drawSegmentItem(i,e,P,A,C,w,tt[s],[g,t.attribute],E,n,r,B,t,a,o,l))}))}else{var it=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),nt=E*it,rt=0,at=!1;t.cacheArea.forEach((function(s,u){if(!at){var h=s.top.getLength(),d=(nt-rt)/h;rt+=h,d>0&&(at=p.drawSegmentItem(i,s,P,A,C,w,tt[u],[g,t.attribute],e.min(d,1),n,r,B,t,a,o,l))}}))}}else this.drawSegmentItem(i,t.cacheArea,P,A,C,w,t.attribute,g,E,n,r,B,t,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p){var g=!1;return g=(g=g||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,d,c,f,!1,v,p))||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,d,c,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y){var b,m,x,_,A=o.connectedType,k=o.connectedX,B=o.connectedY,S=o.connectedStyle,w=[];if(p&&(e.isArray(l)?(A=null!==(b=null!=A?A:l[0].connectedType)&&void 0!==b?b:l[1].connectedType,k=null!==(m=null!=k?k:l[0].connectedX)&&void 0!==m?m:l[1].connectedX,B=null!==(x=null!=B?B:l[0].connectedY)&&void 0!==x?x:l[1].connectedY,S=null!==(_=null!=S?S:l[0].connectedStyle)&&void 0!==_?_:l[1].connectedStyle):(A=null!=A?A:l.connectedType,k=null!=k?k:l.connectedX,B=null!=B?B:l.connectedY,S=null!=S?S:l.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),e.isArray(l)?l.forEach((function(t){return w.push(t)})):w.push(l),w.push(o)),p&&"none"===A)return!1;if(i){t.beginPath();var T,P,C=f.attribute,M=C.points,O=C.segments,E=kt.ROW;if(O){var L=O[O.length-1];P=O[0].points[0],T=L.points[L.points.length-1]}else P=M[0],T=M[M.length-1];E=e.abs(T.x-P.x)>e.abs(T.y-P.y)?kt.ROW:kt.COLUMN,function(t,i,n,r){var a,s=r||{},o=s.drawConnect,l=void 0!==o&&o,u=s.mode;if(!l||"none"!==(void 0===u?"none":u)){var h=i.top,d=i.bottom;if(h.curves.length===d.curves.length)if(n>=1){var c=[],f=[],v=!0;if(l){var p,g,y=!0,b=h.curves.length;h.curves.forEach((function(e,i){var n=d.curves[b-i-1],a=e,s=n;if(e.originP1===e.originP2)return p=e,void(g=n);if(p&&p.originP1===p.originP2&&(a=p,s=g),e.defined)y||(c.push(a),f.push(s),ol(t,c,f,r),c.length=0,f.length=0,y=!y);else{var o,l,u=e.originP1,h=e.originP2;u&&!1!==u.defined?(o=a,l=s):u&&!1!==h.defined&&(o=e,l=n),y?(y=!y,c.push(o||e),f.push(l||n)):o&&(y=!y,c.push(o||e),f.push(l||n),ol(t,c,f,r),c.length=0,f.length=0)}p=e})),ol(t,c,f,r)}else{for(var m=0,x=h.curves.length;m<x;m++){var _=h.curves[m];v!==_.defined?(v?(ll(t,c,f,r),c.length=0,f.length=0):(c.push(_),f.push(d.curves[x-m-1])),v=!v):v&&(c.push(_),f.push(d.curves[x-m-1]))}ll(t,c,f,r)}}else if(!(n<=0)){var A=(r||{}).direction,k=h.curves,B=null!==(a=k[k.length-1].p3)&&void 0!==a?a:k[k.length-1].p1,S=e.abs(B.x-k[0].p0.x),w=e.abs(B.y-k[0].p0.y);A=null!=A?A:S>w?kt.ROW:kt.COLUMN,Number.isFinite(S)||(A=kt.COLUMN),Number.isFinite(w)||(A=kt.ROW);for(var T,P,C=n*(A===kt.ROW?S:w),M=0,O=!0,E=[],L=[],R=!0,I=0,j=h.curves.length;I<j;I++){var D=h.curves[I],N=D.getLength(A),U=(C-M)/N;if(U<0)break;if(M+=N,l){var z=d.curves[j-I-1],H=D,W=z;if(D.originP1===D.originP2){T=D,P=z;continue}if(T&&T.originP1===T.originP2&&(H=T,W=P),D.defined)R||(E.push(H),L.push(W),ol(t,E,L,r),E.length=0,L.length=0,R=!R);else{var V=D.originP1,F=D.originP2,G=void 0,Y=void 0;V&&!1!==V.defined?(G=H,Y=W):V&&!1!==F.defined&&(G=D,Y=z),R?(R=!R,E.push(G||D),L.push(Y||z)):G&&(R=!R,E.push(G||D),L.push(Y||z),ol(t,E,L,r),E.length=0,L.length=0)}T=D}else{var X=null,$=null;O!==D.defined?(O?(ll(t,E,L,r),E.length=0,L.length=0):(X=D,$=d.curves[j-I-1]),O=!O):O&&(X=D,$=d.curves[j-I-1]),X&&$&&(U<1&&(X=X.p2&&X.p3?Xt(X,U)[0]:qt(X,U)[0],$=$.p2&&$.p3?Xt($,1-U)[1]:qt($,1-U)[1]),X.defined=O,$.defined=O,E.push(X),L.push($)),X=null,$=null}}l?ol(t,E,L,r):ll(t,E,L,r)}}}(t.camera?t:t.nativeContext,i,u,{offsetX:h,offsetY:d,offsetZ:c,direction:E,drawConnect:p,mode:A,zeroX:k,zeroY:B}),this.beforeRenderStep(f,t,h,d,!!r,!1,n,!1,l,v,g,null,{attribute:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(f,o,l);var R=o.x,I=void 0===R?0:R,j=o.x,D=void 0===j?0:j;if(!1!==n&&(g?g(t,o,l):r&&(t.setCommonStyle(f,p?S:o,I-h,D-d,p?w:l),t.fill())),this.afterRenderStep(f,t,h,d,!!r,!1,n,!1,l,v,g,null,{attribute:o}),!1!==a)if(y)y(t,o,l);else{var N=o.stroke,U=void 0===N?l&&l[1]&&l[1].stroke:N;e.isArray(U)&&(U[0]||U[2])&&!1===U[1]&&(t.beginPath(),nl(t.camera?t:t.nativeContext,U[0]?i.top:i.bottom,u,E===kt.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:c,drawConnect:p,mode:A,zeroX:k,zeroY:B})),t.setStrokeStyle(f,p?S:o,I-h,D-d,p?w:l),t.stroke()}return!1}}}]),n}(po);yl=fl([D(),pl(0,I(et)),pl(0,N(Tr)),vl("design:paramtypes",[Object])],yl);var bl=So,ml=Ao,xl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},_l=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Al=function(t,e){return function(i,n){e(i,n,t)}},kl=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).pathRenderContribitions=t,n.numberType=Yn,n.builtinContributions=[ml,bl],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l,u,h,d=null!==(l=this.tempTheme)&&void 0!==l?l:Ti(t,null==a?void 0:a.theme).path,c=t.attribute,f=c.x,v=void 0===f?d.x:f,p=c.y,g=void 0===p?d.y:p,y=null!==(u=this.z)&&void 0!==u?u:0,b=this.valid(t,d,s,o);if(b){var m=b.fVisible,x=b.sVisible,_=b.doFill,A=b.doStroke;if(e.beginPath(),t.pathShape)Wt(t.pathShape.commandList,e,i,n,1,1,y);else Wt((null!==(h=t.attribute.path)&&void 0!==h?h:d.path).commandList,e,i,n,1,1,y);e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,n,_,A,m,x,d,r,s,o),A&&(o?o(e,t.attribute,d):x&&(e.setStrokeStyle(t,t.attribute,v-i,g-n,d),e.stroke())),_&&(s?s(e,t.attribute,d):m&&(e.setCommonStyle(t,t.attribute,v-i,g-n,d),e.fill())),this.afterRenderStep(t,e,i,n,_,A,m,x,d,r,s,o)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}]),i}(po);kl=xl([D(),Al(0,I(et)),Al(0,N(Or)),_l("design:paramtypes",[Object])],kl);var Bl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Sl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wl=function(t,e){return function(i,n){e(i,n,t)}},Tl=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).rectRenderContribitions=t,e.type="rect",e.numberType=$n,e.builtinContributions=[Vo,Go,Fo],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h=null!==(u=this.tempTheme)&&void 0!==u?u:Ti(t,null==s?void 0:s.theme).rect,d=t.attribute,c=d.fill,f=void 0===c?h.fill:c,v=d.background,p=d.stroke,g=void 0===p?h.stroke:p,y=d.cornerRadius,b=void 0===y?h.cornerRadius:y,m=d.opacity,x=void 0===m?h.opacity:m,_=d.fillOpacity,A=void 0===_?h.fillOpacity:_,k=d.lineWidth,B=void 0===k?h.lineWidth:k,S=d.strokeOpacity,w=void 0===S?h.strokeOpacity:S,T=d.visible,P=void 0===T?h.visible:T,C=d.x1,M=d.y1,O=d.x,E=void 0===O?h.x:O,L=d.y,R=void 0===L?h.y:L,I=t.attribute,j=I.width,D=I.height,N=xr(x,A,j=(null!=j?j:C-E)||0,D=(null!=D?D:M-R)||0,f),U=Ar(x,w,j,D),z=yr(f,v),H=br(g,B);if(t.valid&&P&&(z||H)&&(N||U||o||l||v)){0===b||e.isArray(b)&&b.every((function(t){return 0===t}))?(i.beginPath(),i.rect(n,r,j,D)):(i.beginPath(),jo(i,n,r,j,D,b));var W={doFill:z,doStroke:H};i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,i,n,r,z,H,N,U,h,a,o,l,W),W.doFill&&(o?o(i,t.attribute,h):N&&(i.setCommonStyle(t,t.attribute,E-n,R-r,h),i.fill())),W.doStroke&&(l?l(i,t.attribute,h):U&&(i.setStrokeStyle(t,t.attribute,E-n,R-r,h),i.stroke())),this.afterRenderStep(t,i,n,r,z,H,N,U,h,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}]),n}(po);Tl=Bl([D(),wl(0,I(et)),wl(0,N(Lr)),Sl("design:paramtypes",[Object])],Tl);var Pl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ml=function(t,e){return function(i,n){e(i,n,t)}},Ol=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).symbolRenderContribitions=t,e.numberType=Zn,e.builtinContributions=[Yo,$o,Xo],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h=Ti(t,null==s?void 0:s.theme).symbol,d=t.attribute,c=d.size,f=void 0===c?h.size:c,v=d.x,p=void 0===v?h.x:v,g=d.y,y=void 0===g?h.y:g,b=d.scaleX,m=void 0===b?h.scaleX:b,x=d.scaleY,_=void 0===x?h.scaleY:x,A=this.valid(t,h,o,l);if(A){var k=A.fVisible,B=A.sVisible,S=A.doFill,w=A.doStroke,T=t.getParsedPath();if(T){var P=t.attribute.keepDirIn3d,C=void 0===P?h.keepDirIn3d:P,M=null!==(u=this.z)&&void 0!==u?u:0;if(i.beginPath(),C&&i.camera&&i.project){var O=i.project(n,r,M),E=i.camera;i.camera=null,!1===T.draw(i,e.isArray(f)?[f[0]*m,f[1]*_]:f*m,O.x,O.y,void 0,(function(e,a){var s,u,d;if(t._parsedPath.svgCache){var c=Object.assign({},a);c.fill=null!==(s=a.fill)&&void 0!==s?s:t.attribute.fill,c.opacity=null!==(u=a.fill)&&void 0!==u?u:t.attribute.opacity,c.fillOpacity=t.attribute.fillOpacity,c.stroke=null!==(d=a.stroke)&&void 0!==d?d:t.attribute.stroke,a=c}a.fill&&(o?o(i,t.attribute,h):(i.setCommonStyle(t,a,p-n,y-r,h),i.fill())),a.stroke&&(l?l(i,t.attribute,h):(i.setStrokeStyle(t,a,(p-n)/m,(y-r)/_,h),i.stroke()))}))&&i.closePath(),i.camera=E}else!1===T.draw(i,f,n,r,M,(function(e,a){var s,u,d;if(t._parsedPath.svgCache){var c=Object.assign({},a);c.fill=null!==(s=a.fill)&&void 0!==s?s:t.attribute.fill,c.opacity=null!==(u=a.opacity)&&void 0!==u?u:t.attribute.opacity,c.fillOpacity=t.attribute.fillOpacity,c.stroke=null!==(d=a.stroke)&&void 0!==d?d:t.attribute.stroke,a=c}a.fill&&(o?o(i,t.attribute,h):(i.setCommonStyle(t,a,p-n,y-r,h),i.fill())),a.stroke&&(l?l(i,t.attribute,h):(i.setStrokeStyle(t,a,(p-n)/m,(y-r)/_,h),i.stroke()))}))&&i.closePath();i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,i,n,r,S,w,k,B,h,a,o,l),S&&!T.isSvg&&(o?o(i,t.attribute,h):k&&(i.setCommonStyle(t,t.attribute,p-n,y-r,h),i.fill())),w&&!T.isSvg&&(l?l(i,t.attribute,h):B&&(i.setStrokeStyle(t,t.attribute,(p-n)/m,(y-r)/_,h),i.stroke())),this.afterRenderStep(t,i,n,r,S,w,k,B,h,a,o,l)}}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}}]),n}(po);Ol=Pl([D(),Ml(0,I(et)),Ml(0,N(Rr)),Cl("design:paramtypes",[Object])],Ol);var El=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=St.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.background,v=c.backgroundMode,p=void 0===v?l.backgroundMode:v;if(f){var g=t.AABBBounds;if(t.backgroundImg&&t.resources){var y=t.resources.get(f);if("success"!==y.state||!y.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),this.doDrawImage(e,y.data,g,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fillRect(g.x1,g.y1,g.width(),g.height()),e.highPerformanceRestore()}}}]),i}(_o),Ll=new El,Rl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Il=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jl=function(t,e){return function(i,n){e(i,n,t)}},Dl=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).textRenderContribitions=t,e.numberType=Jn,e.builtinContributions=[Ll],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,d,c=this,f=Ti(t,null==s?void 0:s.theme).text,v=t.attribute;v.text;var p=v.underline,g=void 0===p?f.underline:p,y=v.lineThrough,b=void 0===y?f.lineThrough:y,m=v.keepDirIn3d,x=void 0===m?f.keepDirIn3d:m,_=v.direction,A=void 0===_?f.direction:_,k=v.whiteSpace;void 0===k&&f.whiteSpace;var B=v.fontSize,S=void 0===B?f.fontSize:B,w=v.verticalMode,T=void 0===w?f.verticalMode:w,P=v.x,C=void 0===P?f.x:P,M=v.y,O=void 0===M?f.y:M,E=t.attribute,L=E.textAlign,R=void 0===L?f.textAlign:L,I=E.textBaseline,j=void 0===I?f.textBaseline:I;if(!T&&"vertical"===A){var D=R;R=null!==(u=t.getBaselineMapAlign()[j])&&void 0!==u?u:"left",j=null!==(h=t.getAlignMapBaseline()[D])&&void 0!==h?h:"top"}var N=null!==(d=nn(t.attribute.lineHeight,S))&&void 0!==d?d:S,U=this.valid(t,f,o,l);if(U){var z=U.fVisible,H=U.sVisible,W=U.doFill,V=U.doStroke,F=!x,G=this.z||0;i.beginPath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,f),this.beforeRenderStep(t,i,n,r,W,V,z,H,f,a,o,l),F&&this.transformUseContext2d(t,f,G,i);var Y=function(e,a,s,u){var h=n+a,d=r+s;if(u){i.highPerformanceSave(),h+=S;var v=eo.allocate(1,0,0,1,0,0);v.rotateByCenter(Math.PI/2,h,d),i.transformFromMatrix(v,!0),eo.free(v)}V&&(l?l(i,t.attribute,f):H&&(i.setStrokeStyle(t,t.attribute,C-n,O-r,f),i.strokeText(e,h,d,G))),W&&(o?o(i,t.attribute,f):z&&(i.setCommonStyle(t,t.attribute,C-n,O-r,f),i.fillText(e,h,d,G),c.drawUnderLine(g,b,t,h,d,G,f,i))),u&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(t.isMultiLine)if(i.setTextStyleWithoutAlignBaseline(t.attribute,f,G),"horizontal"===A){var X=t.multilineLayout;if(!X)return void i.highPerformanceRestore();var $=X.bbox,q=$.xOffset,K=$.yOffset;V&&(l?l(i,t.attribute,f):H&&(i.setStrokeStyle(t,t.attribute,C-n,O-r,f),X.lines.forEach((function(t){i.strokeText(t.str,(t.leftOffset||0)+q+n,(t.topOffset||0)+K+r,G)})))),W&&(o?o(i,t.attribute,f):z&&(i.setCommonStyle(t,t.attribute,C-n,O-r,f),X.lines.forEach((function(e){i.fillText(e.str,(e.leftOffset||0)+q+n,(e.topOffset||0)+K+r,G),c.drawMultiUnderLine(g,b,t,(e.leftOffset||0)+n,(e.topOffset||0)+K+r,G,e.width,f,i)}))))}else{t.tryUpdateAABBBounds();var Z=t.cache.verticalList;i.textAlign="left",i.textBaseline="top";var J=N*Z.length,Q=0;Z.forEach((function(t){var i=t.reduce((function(t,e){return t+(e.width||0)}),0);Q=e.max(i,Q)}));var tt=0,et=0;"bottom"===j?et=-J:"middle"===j&&(et=-J/2),"center"===R?tt-=Q/2:"right"===R&&(tt-=Q),Z.forEach((function(t,e){var i=t.reduce((function(t,e){return t+(e.width||0)}),0),n=Q-i,r=tt;"center"===R?r+=n/2:"right"===R&&(r+=n),t.forEach((function(t){var i=t.text,n=t.width,a=t.direction;Y(i,J-(e+1)*N+et,r,a),r+=n}))}))}else if("horizontal"===A){i.setTextStyle(t.attribute,f,G);var it=t.clipedText,nt=0;N!==S&&("top"===j?nt=(N-S)/2:"middle"===j||"bottom"===j&&(nt=-(N-S)/2)),Y(it,0,nt,0)}else{t.tryUpdateAABBBounds();var rt=t.cache;if(rt){i.setTextStyleWithoutAlignBaseline(t.attribute,f,G);var at=rt.verticalList,st=0,ot=at[0].reduce((function(t,e){return t+(e.width||0)}),0),lt=0;"bottom"===j?lt=-N:"middle"===j&&(lt=-N/2),"center"===R?st-=ot/2:"right"===R&&(st-=ot),i.textAlign="left",i.textBaseline="top",at[0].forEach((function(t){var e=t.text,i=t.width,n=t.direction;Y(e,lt,st,n),st+=i}))}}F&&this.restoreTransformUseContext2d(t,f,G,i),this.afterRenderStep(t,i,n,r,W,V,z,H,f,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).text,a=t.attribute.keepDirIn3d,s=!(void 0===a?r.keepDirIn3d:a);this._draw(t,r,s,i,n)}},{key:"drawUnderLine",value:function(t,e,i,n,r,a,s,o){if(!(e+t<=0)){var l=i.attribute,u=l.textAlign,h=void 0===u?s.textAlign:u,d=l.textBaseline,c=void 0===d?s.textBaseline:d,f=l.fontSize,v=void 0===f?s.fontSize:f,p=l.fill,g=void 0===p?s.fill:p,y=l.opacity,b=void 0===y?s.opacity:y,m=l.fillOpacity,x=void 0===m?s.fillOpacity:m,_=i.clipedWidth,A=zr(h,_),k=Hr(c,v,v),B={lineWidth:0,stroke:g,opacity:b,strokeOpacity:x};if(t){B.lineWidth=t,o.setStrokeStyle(i,B,n,r,s),o.beginPath();var S=r+k+v;o.moveTo(n+A,S,a),o.lineTo(n+A+_,S,a),o.stroke()}if(e){B.lineWidth=e,o.setStrokeStyle(i,B,n,r,s),o.beginPath();var w=r+k+v/2;o.moveTo(n+A,w,a),o.lineTo(n+A+_,w,a),o.stroke()}}}},{key:"drawMultiUnderLine",value:function(t,e,i,n,r,a,s,o,l){if(!(e+t<=0)){var u=i.attribute,h=u.textAlign,d=void 0===h?o.textAlign:h,c=u.fontSize,f=void 0===c?o.fontSize:c,v=u.fill,p=void 0===v?o.fill:v,g=u.opacity,y=void 0===g?o.opacity:g,b=u.fillOpacity,m=void 0===b?o.fillOpacity:b,x=zr(d,s),_=Hr("alphabetic",f,f),A={lineWidth:0,stroke:p,opacity:y,strokeOpacity:m},k=-3;if(t){A.lineWidth=t,l.setStrokeStyle(i,A,n,r,o),l.beginPath();var B=r+_+f+k;l.moveTo(n+x,B,a),l.lineTo(n+x+s,B,a),l.stroke()}if(k=-1,e){A.lineWidth=e,l.setStrokeStyle(i,A,n,r,o),l.beginPath();var S=r+_+f/2+k;l.moveTo(n+x,S,a),l.lineTo(n+x+s,S,a),l.stroke()}}}}]),n}(po);function Nl(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function Ul(t,e){return Math.sqrt(t*t+e*e)}function zl(t,e,i,n,r){var a=e/i;return{x:t.x-n*a,y:t.y-r*a}}Dl=Rl([D(),jl(0,I(et)),jl(0,N(Ir)),Il("design:paramtypes",[Object])],Dl);var Hl=So,Wl=Ao,Vl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gl=function(t,e){return function(i,n){e(i,n,t)}},Yl=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).polygonRenderContribitions=t,e.numberType=Xn,e.builtinContributions=[Wl,Hl],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Ti(t,null==s?void 0:s.theme).polygon,h=t.attribute,d=h.points,c=void 0===d?u.points:d,f=h.cornerRadius,v=void 0===f?u.cornerRadius:f,p=h.x,g=void 0===p?u.x:p,y=h.y,b=void 0===y?u.y:y,m=h.closePath,x=void 0===m?u.closePath:m,_=this.valid(t,u,o,l);if(_){var A=_.fVisible,k=_.sVisible,B=_.doFill,S=_.doStroke;i.beginPath(),v<=0||e.isArray(v)&&v.every((function(t){return 0===t}))?Nl(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r){var a,s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)Nl(t,e,i,n);else{var o=0,l=e.length-1;s||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(var u=o;u<=l;u++){var h=e[0===u?l:(u-1)%e.length],d=e[u%e.length],c=e[(u+1)%e.length],f=d.x-h.x,v=d.y-h.y,p=d.x-c.x,g=d.y-c.y,y=(Math.atan2(v,f)-Math.atan2(g,p))/2,b=Math.abs(Math.tan(y)),m=Array.isArray(r)?null!==(a=r[u%e.length])&&void 0!==a?a:0:r,x=m/b,_=Ul(f,v),A=Ul(p,g),k=Math.min(_,A);x>k&&(x=k,m=k*b);var B=zl(d,x,_,f,v),S=zl(d,x,A,p,g),w=2*d.x-B.x-S.x,T=2*d.y-B.y-S.y,P=Ul(w,T),C=zl(d,Ul(x,m),P,w,T),M=Math.atan2(B.y-C.y,B.x-C.x),O=Math.atan2(S.y-C.y,S.x-C.x),E=O-M;E<0&&(M=O,E=-E),E>Math.PI&&(E-=Math.PI),0===u?t.moveTo(B.x+i,B.y+n):t.lineTo(B.x+i,B.y+n),E&&t.arcTo(d.x+i,d.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}s||t.lineTo(e[l+1].x+i,e[l+1].y+n)}}(i.camera?i:i.nativeContext,c,n,r,v,x),x&&i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,i,n,r,B,S,A,k,u,a,o,l),B&&(o?o(i,t.attribute,u):A&&(i.setCommonStyle(t,t.attribute,g-n,b-r,u),i.fill())),S&&(l?l(i,t.attribute,u):k&&(i.setStrokeStyle(t,t.attribute,g-n,b-r,u),i.stroke())),this.afterRenderStep(t,i,n,r,B,S,A,k,u,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Ti(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}}]),n}(po);Yl=Vl([D(),Gl(0,I(et)),Gl(0,N(Er)),Fl("design:paramtypes",[Object])],Yl);var Xl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$l=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ql=function(t,e){return function(i,n){e(i,n,t)}},Kl=["","repeat-x","repeat-y","repeat"],Zl=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).imageRenderContribitions=t,e.numberType=Fn,e.builtinContributions=[No],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o){var l=Ti(t).image,u=t.attribute,h=u.width,d=void 0===h?l.width:h,c=u.height,f=void 0===c?l.height:c,v=u.repeatX,p=void 0===v?l.repeatX:v,g=u.repeatY,y=void 0===g?l.repeatY:g,b=u.cornerRadius,m=void 0===b?l.cornerRadius:b,x=u.image,_=this.valid(t,l,o);if(_){var A=_.fVisible;_.sVisible;var k=_.doFill;if(_.doStroke,i.setShadowBlendStyle&&i.setShadowBlendStyle(t,l),this.beforeRenderStep(t,i,n,r,k,!1,A,!1,l,a,o),k)if(o)o(i,t.attribute,l);else if(A){if(!x||!t.resources)return;var B=t.resources.get(x);if("success"!==B.state)return;var S=!1;0===m||e.isArray(m)&&m.every((function(t){return 0===t}))||(i.beginPath(),jo(i,n,r,d,f,m),i.save(),i.clip(),S=!0),i.setCommonStyle(t,t.attribute,n,r,l);var w=0;if("repeat"===p&&(w|=1),"repeat"===y&&(w|=2),w){var T=i.createPattern(B.data,Kl[w]);i.fillStyle=T,i.translate(n,r,!0),i.fillRect(0,0,d,f),i.translate(-n,-r,!0)}else i.drawImage(B.data,n,r,d,f);S&&i.restore()}this.afterRenderStep(t,i,n,r,k,!1,A,!1,l,a,o)}}},{key:"draw",value:function(t,e,i){var n=t.attribute.image;if(n&&t.resources&&("success"===t.resources.get(n).state&&e.drawParams.context)){var r=Ti(t).image;this._draw(t,r,!1,i)}}}]),n}(po);Zl=Xl([D(),ql(0,I(et)),ql(0,N(Mr)),$l("design:paramtypes",[Object])],Zl);var Jl=Symbol.for("IncrementalDrawContribution"),Ql=Symbol.for("ArcRender"),tu=Symbol.for("AreaRender"),eu=Symbol.for("CircleRender"),iu=Symbol.for("GraphicRender"),nu=Symbol.for("GroupRender"),ru=Symbol.for("LineRender"),au=Symbol.for("PathRender"),su=Symbol.for("PolygonRender"),ou=Symbol.for("RectRender"),lu=Symbol.for("SymbolRender"),uu=Symbol.for("TextRender"),hu=Symbol.for("RichTextRender"),du=Symbol.for("ImageRender"),cu=Symbol.for("DrawContribution"),fu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pu=function(t,e){return function(i,n){e(i,n,t)}},gu=Symbol.for("RenderService"),yu=function(){function t(e){a(this,t),this.drawContribution=e}return o(t,[{key:"prepare",value:function(t){var e=this;t&&this.renderTreeRoots.forEach((function(i){e._prepare(i,t)}))}},{key:"_prepare",value:function(t,e){var i=this;t.forEachChildren((function(t){i._prepare(t,e)})),t.update({bounds:e,trans:!0})}},{key:"prepareRenderList",value:function(){}},{key:"beforeDraw",value:function(t){}},{key:"draw",value:function(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}},{key:"afterDraw",value:function(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}},{key:"render",value:function(t,e){this.renderTreeRoots=t,this.drawParams=e;var i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}}]),t}();yu=fu([D(),pu(0,I(cu)),vu("design:paramtypes",[Object])],yu);var bu=new B((function(t){t(gu).to(yu).inSingletonScope()})),mu=Symbol.for("PickerService"),xu=Symbol.for("GlobalPickerService"),_u=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Au=Symbol.for("PickItemInterceptor"),ku=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterPickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}},{key:"beforePickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}},{key:"_pickItem",value:function(t,i,n,r,a){if(!t.shadowRoot)return null;var s=(a||{}).parentMatrix;if(!s)return null;var o=i.pickContext;o.highPerformanceSave();var l=t.shadowRoot,u=eo.allocateByObj(s),h=new e.Point(u.a*n.x+u.c*n.y+u.e,u.b*n.x+u.d*n.y+u.f),d=i.pickGroup(l,h,u,r);return o.highPerformanceRestore(),d}}]),t}();ku=_u([D()],ku);var Bu=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforePickItem",value:function(t,i,n,r,a){var s=t.baseGraphic;if(s&&s.parent){var o=new e.Point(n.x,n.y),l=i.pickContext;l.highPerformanceSave();var u=s.parent.globalTransMatrix;u.transformPoint(o,o);var h=s.isContainer?i.pickGroup(s,o.clone(),u,r):i.pickItem(s,o.clone(),u,r);return l.highPerformanceRestore(),h}return null}}]),t}();Bu=_u([D()],Bu);var Su=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforePickItem",value:function(t,i,n,r,a){if(!t.in3dMode||r.in3dInterceptor)return null;var s=i.pickContext,o=t.stage;if(!s||!o)return null;if(r.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){var l,u=!1,h=!1;if(t.forEachChildren((function(t){return!(u=t.numberType===zn)})),t.forEachChildren((function(t){return!(h=!!t.findFace)})),u){var d=t.getChildren(),c=m(d);c.sort((function(t,i){for(var n,r,a,s,o=(null!==(r=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==r?r:0)/2,l=(null!==(s=null!==(a=i.attribute.startAngle)&&void 0!==a?a:0+i.attribute.endAngle)&&void 0!==s?s:0)/2;o<0;)o+=e.pi2;for(;l<0;)l+=e.pi2;return l-o})),c.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),c.forEach((function(e){t.appendChild(e)})),r.hack_pieFace="outside",(l=i.pickGroup(t,n,a.parentMatrix,r)).graphic||(r.hack_pieFace="inside",l=i.pickGroup(t,n,a.parentMatrix,r)),l.graphic||(r.hack_pieFace="top",l=i.pickGroup(t,n,a.parentMatrix,r)),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),d.forEach((function(e){t.appendChild(e)}))}else if(h){var f=t.getChildren(),v=f.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));v.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),v.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),v.forEach((function(e){t.add(e.g)})),l=i.pickGroup(t,n,a.parentMatrix,r),t.removeAllChild(),f.forEach((function(t){t._next=null,t._prev=null})),t.update(),f.forEach((function(e){t.add(e)}))}else l=i.pickGroup(t,n,a.parentMatrix,r);return s.camera=null,r.in3dInterceptor=!1,s.restore(),l}return s.restore(),null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();Su=_u([D()],Su);var wu=new B((function(t,e,i){i(mu)||(t(xu).toSelf(),t(mu).toService(xu)),t(Su).toSelf().inSingletonScope(),t(Au).toService(Su),t(ku).toSelf().inSingletonScope(),t(Au).toService(ku),t(Bu).toSelf().inSingletonScope(),t(Au).toService(Bu),nt(t,Au)})),Tu=new B((function(t){t(Qn).to(uo).inSingletonScope(),t(tr).toConstantValue(co)})),Pu=Symbol.for("AutoEnablePlugins"),Cu=Symbol.for("PluginService"),Mu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ou=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eu=function(t,e){return function(i,n){e(i,n,t)}},Lu=function(){function t(e){a(this,t),this.autoEnablePlugins=e,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}return o(t,[{key:"active",value:function(t,e){var i=this;this.stage=t,this.actived=!0;var n=e.pluginList;n&&ri.isBound(Pu)&&this.autoEnablePlugins.getContributions().forEach((function(t){n.includes(t.name)&&i.register(t)}))}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(i){i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((function(i){i.name===t&&e.push(i)})),e}},{key:"register",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}},{key:"unRegister",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}},{key:"release",value:function(){var t=this;this.onStartupFinishedPlugin.forEach((function(e){e.deactivate(t)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((function(e){e.deactivate(t)})),this.onRegisterPlugin=[]}}]),t}();Lu=Mu([D(),Eu(0,I(et)),Eu(0,N(Pu)),Ou("design:paramtypes",[Object])],Lu);var Ru=new B((function(t){t(Cu).to(Lu),function(t,e){t(et).toDynamicValue((function(t){var i=t.container;return new it(e,i)})).whenTargetNamed(e)}(t,Pu)})),Iu=new B((function(t){nt(t,at)})),ju=new B((function(t){t(ii).to(ni).inSingletonScope(),nt(t,ii)})),Du=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Nu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uu=function(){function t(){a(this,t),this.type="static",this.offscreen=!1,this.global=Ve.global}return o(t,[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(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{var n;this.main=!1,i.canvasId&&(n=this.global.getElementById(i.canvasId)),n||(n=this.global.createCanvas({width:e.width,height:e.height})),n.style&&(n.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=si({nativeCanvas:n,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});a.applyPosition(),this.canvas=a,this.context=a.getContext()}}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){var n;if(!this.main){var r=this.window.getContext().getCanvas().nativeCanvas;!r||this.canvas.x===r.offsetLeft&&this.canvas.y===r.offsetTop||(this.canvas.x=r.offsetLeft,this.canvas.y=r.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))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var i=t.getContext().canvas.nativeCanvas;e.context.drawImage(i,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,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}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}]),t}();Uu=Du([D(),Nu("design:paramtypes",[])],Uu);var zu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Hu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wu=function(){function t(){a(this,t),this.offscreen=!1,this.type="virtual",this.global=Ve.global}return o(t,[{key:"setDpr",value:function(t){}},{key:"init",value:function(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}},{key:"resize",value:function(t,e){}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}},{key:"merge",value:function(t){}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,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}))}},{key:"getContext",value:function(){return null}},{key:"release",value:function(){}}]),t}();Wu=zu([D(),Hu("design:paramtypes",[])],Wu);var Vu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gu=function(){function t(){a(this,t),this.offscreen=!0,this.type="dynamic",this.global=Ve.global}return o(t,[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,i){this.layer=t;var n=si({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()}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){this.canvas.resize(t,e)}},{key:"render",value:function(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"}))}},{key:"prepare",value:function(t,e){}},{key:"release",value:function(){this.canvas.release()}},{key:"getContext",value:function(){return this.context}},{key:"drawTo",value:function(t,e,i){var n=t.getContext(),r=t.dpr,a=i.x,s=void 0===a?0:a,o=i.y,l=void 0===o?0:o,u=i.width,h=void 0===u?this.layer.viewWidth:u,d=i.height,c=void 0===d?this.layer.viewHeight:d;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,l,h,c),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,l,h,c),n.nativeContext.restore()}},{key:"merge",value:function(t){}}]),t}();Gu=Vu([D(),Fu("design:paramtypes",[])],Gu);var Yu=new B((function(t){t(Uu).toSelf(),t(Gu).toSelf(),t(Wu).toSelf(),t(hr).toService(Uu),t(dr).toService(Gu),t(cr).toService(Wu)}));var Xu=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))};function $u(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Xu(this,void 0,void 0,n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(i,r);case 2:case"end":return e.stop()}}),e)})))}function qu(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a=[],s=!1;t.forEachChildren((function(t,e){var n=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===n?i:n))return s=!0,!0;return!1}),n);var o=null,l=!1;if(s){t.forEachChildren((function(t){var e=t.attribute.zIndex,n=void 0===e?i:e;r[n]?r[n].push(t):(r[n]=[t],a.push(n))}),n),a.sort((function(t,e){return n?e-t:t-e}));for(var u=!1,h=0;h<a.length&&!u;h++)for(var d=a[h],c=r[d],f=0;f<c.length;f++){if(l){u=!0,o=c[f];break}c[f]._uid!==e||(l=!0)}}else t.forEachChildren((function(t){return l?(o=t,!0):(t._uid===e&&(l=!0),!1)}),n);return o}var Ku=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ju=Symbol.for("DrawItemInterceptor"),Qu=new e.AABBBounds,th=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.shadowRoot)return!1;var a=i.context;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Qu.copy(n.dirtyBounds);var s=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(s)}return n.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),a.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(Qu),!0}}]),t}(),eh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;var a=i.context;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);var s=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(s.x1,s.y1,s.width(),s.height()),a.highPerformanceRestore(),!0}}]),t}(),ih=function(){function t(){a(this,t),this.order=1,this.interceptors=[new th,new rh,new nh,new eh]}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,i,n,r))return!0;return!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].beforeDrawItem&&this.interceptors[a].beforeDrawItem(t,e,i,n,r))return!0;return!1}}]),t}();ih=Ku([D(),Zu("design:paramtypes",[])],ih);var nh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforeDrawItem",value:function(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}},{key:"beforeSetInteractive",value:function(t,e,i,n,r){var a=t.interactiveGraphic;if(t.attribute.globalZIndex){a||(a=t.clone(),t.interactiveGraphic=a,a.baseGraphic=t),a.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();var s=i.stage.getLayer("_builtin_interactive");return s&&this.getShadowRoot(s).add(a),!0}if(a){i.stage.tryInitInteractiveLayer();var o=i.stage.getLayer("_builtin_interactive");o&&this.getShadowRoot(o).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}},{key:"beforeDrawInteractive",value:function(t,e,i,n,r){var a=t.baseGraphic;if(a){this.processing=!0;var s=i.context;return s.highPerformanceSave(),s.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?n.renderGroup(a,i,a.parent.globalTransMatrix):n.renderItem(a,i),s.highPerformanceRestore(),this.processing=!1,!0}return!1}},{key:"getShadowRoot",value:function(t){var e,i=t.getElementById("_interactive_group");return i||((i=co.CreateGraphic("group",{})).id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}]),t}(),rh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforeDrawItem",value:function(t,i,n,r,a){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var s=i.drawParams,o=s.context,l=s.stage;o.canvas,o.save(),this.initCanvasCtx(o),o.camera=l.camera;var u=o.currentMatrix;u.a/=o.dpr,u.b/=o.dpr,u.c/=o.dpr,u.d/=o.dpr,u.e/=o.dpr,u.f/=o.dpr;var h,d,c=io.allocate();d=u,(h=c)[0]=d.a,h[1]=d.b,h[2]=0,h[3]=0,h[4]=d.c,h[5]=d.d,h[6]=0,h[7]=0,h[8]=0,h[9]=0,h[10]=1,h[11]=0,h[12]=d.e,h[13]=d.f,h[14]=0,h[15]=1;var f=o.modelMatrix;if(f){if(c){var v=io.allocate();o.modelMatrix=oo(v,f,c)}}else o.modelMatrix=c;if(o.setTransform(1,0,0,1,0,0,!0),t.isContainer){var p=!1,g=!1;if(t.forEachChildren((function(t){return!(p=t.numberType===zn)})),t.forEachChildren((function(t){return!(g=!!t.findFace)})),p){var y=t.getChildren(),b=m(y);b.sort((function(t,i){for(var n,r,a,s,o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(r=t.attribute.endAngle)&&void 0!==r?r:0))/2,l=((null!==(a=i.attribute.startAngle)&&void 0!==a?a:0)+(null!==(s=i.attribute.endAngle)&&void 0!==s?s:0))/2;o<0;)o+=e.pi2;for(;l<0;)l+=e.pi2;return l-o})),b.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),b.forEach((function(e){t.appendChild(e)}));var x=t.parent.globalTransMatrix;n.hack_pieFace="outside",r.renderGroup(t,n,x),n.hack_pieFace="inside",r.renderGroup(t,n,x),n.hack_pieFace="top",r.renderGroup(t,n,x),t.removeAllChild(),y.forEach((function(t){t._next=null,t._prev=null})),y.forEach((function(e){t.appendChild(e)}))}else if(g){var _=t.getChildren(),A=_.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var i;return o.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));A.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),A.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),A.forEach((function(e){t.add(e.g)})),r.renderGroup(t,n,t.parent.globalTransMatrix,!0),t.removeAllChild(),_.forEach((function(t){t._next=null,t._prev=null})),t.update(),_.forEach((function(e){t.add(e)}))}else r.renderGroup(t,n,t.parent.globalTransMatrix)}else r.renderItem(t,n);return o.camera=null,o.restore(),o.modelMatrix!==f&&io.free(o.modelMatrix),o.modelMatrix=f,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}(),ah=new(function(){function t(){a(this,t),this.pools=[];for(var i=0;i<10;i++)this.pools.push(new e.AABBBounds)}return o(t,[{key:"allocate",value:function(t,i,n,r){if(!this.pools.length)return(new e.AABBBounds).setValue(t,i,n,r);var a=this.pools.pop();return a.x1=t,a.y1=i,a.x2=n,a.y2=r,a}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new e.AABBBounds(t);var i=this.pools.pop();return i.x1=t.x1,i.y1=t.y1,i.x2=t.x2,i.y2=t.y2,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}()),sh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},oh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lh=function(t,e){return function(i,n){e(i,n,t)}},uh=function(){function t(i,n){a(this,t),this.contributions=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new e.Bounds,this.backupDirtyBounds=new e.Bounds,this.global=Ve.global,this.layerService=Ve.layerService,this.init()}return o(t,[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var i=t.styleRenderMap.get(e.style)||new Map;i.set(e.numberType,e),t.styleRenderMap.set(e.style,i)}else t.defaultRenderMap.set(e.numberType,e)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"prepareForDraw",value:function(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}},{key:"draw",value:function(t,i){var n=this;this.prepareForDraw(t,i),i.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(i.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var r=i.context,a=i.stage,s=i.x,o=void 0===s?0:s,l=i.y,u=void 0===l?0:l,h=i.width,d=i.height;if(r){var c=this.dirtyBounds.setValue(0,0,h,d);if(a.dirtyBounds&&!a.dirtyBounds.empty()){var f=e.getRectIntersect(c,a.dirtyBounds,!1);c.x1=Math.floor(f.x1),c.y1=Math.floor(f.y1),c.x2=Math.ceil(f.x2),c.y2=Math.ceil(f.y2)}var v=r.dpr%1;(v||.5!==v)&&(c.x1=Math.floor(c.x1*r.dpr)/r.dpr,c.y1=Math.floor(c.y1*r.dpr)/r.dpr,c.x2=Math.ceil(c.x2*r.dpr)/r.dpr,c.y2=Math.ceil(c.y2*r.dpr)/r.dpr),this.backupDirtyBounds.copy(c),r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0);var p=c.width()*r.dpr<r.canvas.width||c.height()*r.dpr<r.canvas.height;r.save(),r.translate(o,u,!0),p&&(r.beginPath(),r.rect(c.x1,c.y1,c.width(),c.height()),r.clip()),a.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,r,i),r.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Te.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Te.zIndex)})).forEach((function(t){t.isContainer?n.renderGroup(t,i,eo.allocate(1,0,0,1,0,0)):n.renderItem(t,i)})),r.restore(),r.restore(),r.draw(),r.inuse=!1}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,i=t._uid;e;){var n=qu(e,i,Te.zIndex);if(n)return n;i=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,i,n,r){var a=this;if(!i.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==i.startAtId||i.startAtId===t._uid))return i.break=!0,void this._increaseRender(t,i);if(!this.useDirtyBounds||e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1)){var s,o=n;if(this.useDirtyBounds){s=ah.allocateByObj(this.dirtyBounds);var l=t.transMatrix;o=eo.allocateByObj(n).multiply(l.a,l.b,l.c,l.d,l.e,l.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o.getInverse())}this.renderItem(t,i,{drawingCb:function(){var e;r?t.forEachChildren((function(t){i.break||(t.isContainer?a.renderGroup(t,i,o):a.renderItem(t,i))})):function(t,e,i){var n,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s={},o=[],l=!1;if(a?l=!0:t.forEachChildren((function(t,i){var r=t.attribute.zIndex,a=void 0===r?e:r;if(0===i)n=a;else if(n!==a)return l=!0,!0;return!1}),r),l){t.forEachChildren((function(t){var i=t.attribute.zIndex,n=void 0===i?e:i;s[n]?s[n].push(t):(s[n]=[t],o.push(n))}),r),o.sort((function(t,e){return r?e-t:t-e}));for(var u=!1,h=0;h<o.length&&!u;h++){var d=o[h],c=s[d];a&&c.sort((function(t,e){var i,n;return(r?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(var f=0;f<c.length;f++)if(i(c[f],f)){u=!0;break}}}else t.forEachChildren(i,r)}(t,Te.zIndex,(function(t){i.break||(t.isContainer?a.renderGroup(t,i,o):a.renderItem(t,i))}),!1,!!(null===(e=i.context)||void 0===e?void 0:e.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(s),ah.free(s),eo.free(o))}}}},{key:"_increaseRender",value:function(t,e){var i=e.layer,n=e.stage,r=i.subLayers,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,a));var s=a.layer.getNativeHandler().getContext(),o=a.drawContribution||ri.get(Jl);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:a.layer,context:s,startAtId:t._uid,break:!1})),a.drawContribution=o;var l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{var u=r.get(l._uid);u||(u={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(l._uid,u));var h=u.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:u.layer,context:h,startAtId:l._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e;return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,i,n){if(this.InterceptorContributions.length)for(var r=0;r<this.InterceptorContributions.length;r++){var a=this.InterceptorContributions[r];if(a.beforeDrawItem&&a.beforeDrawItem(t,this.currentRenderService,i,this,n))return}var s=this.getRenderContribution(t);if(s){var o,l=!1;if(t.parent){var u=t.parent.attribute,h=u.scrollX,d=void 0===h?0:h,c=u.scrollY,f=void 0===c?0:c;if(l=!(!d&&!f)){o=this.dirtyBounds.clone();var v=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(v),this.dirtyBounds.translate(-d,-f)}}if(!this.useDirtyBounds||t.isContainer||e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1)){var p=null!=i.startAtId&&t._uid!==i.startAtId;if(t._uid===i.startAtId&&(i.startAtId=null),n&&(n.skipDraw=p),p?t.isContainer&&s.draw(t,this.currentRenderService,i,n):s.draw(t,this.currentRenderService,i,n),l&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(var g=0;g<this.InterceptorContributions.length;g++){var y=this.InterceptorContributions[g];if(y.afterDrawItem&&y.afterDrawItem(t,this.currentRenderService,i,this))return}}else l&&this.dirtyBounds.copy(o)}}},{key:"selectRenderByType",value:function(t){return e.Logger.getInstance().warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,i){var n,r=i.clear;if(r){var a=e.getCanvas(),s=i.width,o=void 0===s?a.width:s,l=i.height,u=void 0===l?a.height:l;e.clearRect(0,0,o,u);var h=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(h&&h.backgroundImg&&h.resources){var d=h.resources.get(r);d&&"success"===d.state&&d.data&&e.drawImage(d.data,0,0,o,u)}else e.fillStyle=yo(e,r,{AABBBounds:{x1:0,y1:0,x2:0+o,y2:0+u}},0,0),e.fillRect(0,0,o,u)}}},{key:"afterDraw",value:function(t,e){}}]),t}();uh=sh([D(),lh(0,j(iu)),lh(1,I(et)),lh(1,N(Ju)),oh("design:paramtypes",[Array,Object])],uh);var hh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ch=function(t,e){return function(i,n){e(i,n,t)}},fh=function(){function t(e){a(this,t),this.groupRenderContribitions=e,this.numberType=Vn}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Ti(t,null==s?void 0:s.theme).group,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.background,v=h.stroke,p=void 0===v?u.stroke:v,g=h.opacity,y=void 0===g?u.opacity:g,b=h.width,m=void 0===b?u.width:b,x=h.height,_=void 0===x?u.height:x,A=h.clip,k=void 0===A?u.clip:A,B=h.fillOpacity,S=void 0===B?u.fillOpacity:B,w=h.strokeOpacity,T=void 0===w?u.strokeOpacity:w,P=h.cornerRadius,C=void 0===P?u.cornerRadius:P,M=h.path,O=void 0===M?u.path:M,E=h.lineWidth,L=void 0===E?u.lineWidth:E,R=h.visible,I=void 0===R?u.visible:R,j=xr(y,S,m,_,c),D=Ar(y,T,m,_),N=yr(c,f),U=br(p,L);if(t.valid&&I){if(!k){if(!N&&!U)return;if(!(j||D||o||l||f))return}if(O&&O.length&&a.drawContribution){var z=i.disableFill,H=i.disableStroke,W=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,O.forEach((function(t){a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,s)})),i.disableFill=z,i.disableStroke=H,i.disableBeginPath=W}else 0===C||e.isArray(C)&&C.every((function(t){return 0===t}))?(i.beginPath(),i.rect(n,r,m,_)):(i.beginPath(),jo(i,n,r,m,_,C));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Ro));var V={doFill:N,doStroke:U};this._groupRenderContribitions.forEach((function(e){e.time===St.beforeFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l,V)})),k&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),V.doFill&&(o?o(i,t.attribute,u):j&&(i.setCommonStyle(t,t.attribute,n,r,u),i.fill())),V.doStroke&&(l?l(i,t.attribute,u):D&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke())),this._groupRenderContribitions.forEach((function(e){e.time===St.afterFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l)}))}}},{key:"draw",value:function(t,e,i,n){var r=i.context;if(r){var a=t.attribute.clip;a?r.save():r.highPerformanceSave();var s=Ti(t,null==n?void 0:n.theme).group,o=r.modelMatrix;if(r.camera){var l=io.allocate(),u=io.allocate();lo(u,t,s),oo(l,o||l,u),r.modelMatrix=l,io.free(u),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,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,i);var h,d=t.attribute,c=d.scrollX,f=void 0===c?s.scrollX:c,v=d.scrollY,p=void 0===v?s.scrollY:v;(f||p)&&r.translate(f,p),n&&n.drawingCb&&(h=n.drawingCb()),r.modelMatrix!==o&&io.free(r.modelMatrix),r.modelMatrix=o,h&&h.then?h.then((function(){a?r.restore():r.highPerformanceRestore()})):a?r.restore():r.highPerformanceRestore()}}}]),t}();fh=hh([D(),ch(0,I(et)),ch(0,N(Cr)),dh("design:paramtypes",[Object])],fh);var vh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ph=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=Gn,t}return o(i,[{key:"drawShape",value:function(t,e,n,r,a,s,o,l){if(t.incremental&&a.multiGraphicOptions){var u=a.multiGraphicOptions,d=u.startAtIdx,c=u.length,f=t.attribute.segments,v=void 0===f?[]:f;if(d>v.length)return;var p=Ti(t).line,g=t.attribute,b=g.fill,m=void 0===b?p.fill:b,x=g.stroke,_=void 0===x?p.stroke:x,A=g.opacity,k=void 0===A?p.opacity:A,B=g.fillOpacity,S=void 0===B?p.fillOpacity:B,w=g.strokeOpacity,T=void 0===w?p.strokeOpacity:w,P=g.lineWidth,C=void 0===P?p.lineWidth:P,M=g.visible,O=void 0===M?p.visible:M,E=mr(k,S,m),L=_r(k,T),R=yr(m),I=br(_,C);if(!t.valid||!O)return;if(!R&&!I)return;if(!(E||L||o||l))return;for(var j=a.context,D=d;D<d+c;D++)this.drawIncreaseSegment(t,j,v[D-1],v[D],t.attribute.segments[D],[p,t.attribute],n,r)}else y(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,s,o,l)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,s,o){n&&(e.beginPath(),function(t,e,i,n){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=e?e.points[e.points.length-1]:i.points[0];t.moveTo(u.x+s,u.y+l),i.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+s,e.y+l):t.moveTo(e.x+s,e.y+l)}))}(e.nativeContext,i,n,{offsetX:s,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,s,o,a),e.stroke())}}]),i}(sl);ph=vh([D()],ph);var gh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},yh=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=Hn,t}return o(i,[{key:"drawShape",value:function(t,e,n,r,a,s,o){if(t.incremental&&a.multiGraphicOptions){var l=a.multiGraphicOptions,u=l.startAtIdx,d=l.length,c=t.attribute.segments,f=void 0===c?[]:c;if(u>f.length)return;var v=Ti(t).area,p=t.attribute,g=p.fill,b=void 0===g?v.fill:g,m=p.fillOpacity,x=void 0===m?v.fillOpacity:m,_=p.opacity,A=void 0===_?v.opacity:_,k=p.visible,B=void 0===k?v.visible:k,S=mr(A,x,b),w=yr(b);if(!t.valid||!B)return;if(!w)return;if(!S&&!o)return;for(var T=u;T<u+d;T++)this.drawIncreaseSegment(t,e,f[T-1],f[T],t.attribute.segments[T],[v,t.attribute],n,r)}else y(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,s,o)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,s,o){n&&(e.beginPath(),function(t,e,i,n){for(var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=i.points,h=[],d=0;d<u.length;d++)u[d].defined;h.push(u),h.forEach((function(i,n){var r,a,o,u,h=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(h.x+s,h.y+l),i.forEach((function(e){!1!==e.defined?t.lineTo(e.x+s,e.y+l):t.moveTo(e.x+s,e.y+l)}));for(var d=i.length-1;d>=0;d--){var c=i[d];t.lineTo(null!==(r=c.x1)&&void 0!==r?r:c.x,null!==(a=c.y1)&&void 0!==a?a:c.y)}t.lineTo(null!==(o=h.x1)&&void 0!==o?o:h.x,null!==(u=h.y1)&&void 0!==u?u:h.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,n,{offsetX:s,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,s,o,a),e.fill())}}]),i}(yl);yh=gh([D()],yh);var bh,mh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_h=function(t,e){return function(i,n){e(i,n,t)}},Ah=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(bh||(bh={}));var kh=function(t){u(i,t);var e=g(i);function i(t,n,r,s){var o;return a(this,i),(o=e.call(this,t,s)).contributions=t,o.lineRender=n,o.areaRender=r,o.drawItemInterceptorContributions=s,o.rendering=!1,o.currFrameStartAt=0,o.currentIdx=0,o.status=bh.NORMAL,o.checkingForDrawPromise=null,o.hooks={completeDraw:new rt([])},o}return o(i,[{key:"init",value:function(){y(h(i.prototype),"init",this).call(this),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}},{key:"draw",value:function(t,e){return Ah(this,void 0,void 0,n().mark((function i(){var r,a,s,o,l,u,h=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.checkingForDrawPromise){i.next=2;break}return i.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),i.next=5,this.checkingForDrawPromise;case 5:if(r=i.sent,this.checkingForDrawPromise=null,!r){i.next=8;break}return i.abrupt("return");case 8:this.currentRenderService=t,a=e.context,s=e.x,o=void 0===s?0:s,l=e.y,u=void 0===l?0:l,a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,a,e),a.translate(o,u,!0),a.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Te.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Te.zIndex)})).forEach((function(t){h.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){a.restore(),a.restore(),a.draw(),a.inuse=!1,h.rendering=!1})));case 11:case"end":return i.stop()}}),i,this)})))}},{key:"_increaseRender",value:function(t,e){return Ah(this,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.rendering=!0,i.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return i.stop()}}),i,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return Ah(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.count=t.count,i.next=3,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return Ah(r,void 0,void 0,n().mark((function r(){var a,s=this;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(2===t.count){n.next=6;break}return n.next=3,$u(t,Te.zIndex,(function(i,n){if(s.status===bh.STOP)return!0;if(i.isContainer)return!1;if(n<s.currentIdx)return!1;var r=s.currFrameStartAt+t.incremental;return n<r&&(s.currentIdx=n+1,s.renderItem(i,e)),n===r-1&&(s.currFrameStartAt=s.currentIdx,s.waitToNextFrame())}));case 3:i(!1),n.next=21;break;case 6:if(!(a=t.getChildAt(0)).incremental||!a.attribute.segments){n.next=19;break}a.incrementalAt||(a.incrementalAt=0);case 9:if(!(a.incrementalAt<a.attribute.segments.length)){n.next=17;break}return e.multiGraphicOptions={startAtIdx:a.incrementalAt,length:a.incremental},this.renderItem(a,e),a.incrementalAt+=a.incremental,n.next=15,this.waitToNextFrame();case 15:n.next=9;break;case 17:n.next=20;break;case 19:this.renderItem(a,e);case 20:i(!1);case 21:case"end":return n.stop()}}),r,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return i.stop()}}),i,this)})))}},{key:"waitToNextFrame",value:function(){return Ah(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.global.getRequestAnimationFrame()((function(){t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"checkForDraw",value:function(t){return Ah(this,void 0,void 0,n().mark((function e(){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return i=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return Ah(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.rendering,!t.t0){t.next=5;break}return this.status=bh.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=bh.NORMAL,e.hooks.completeDraw.taps=e.hooks.completeDraw.taps.filter((function(t){return"stopCb"!==t.name})),t(!1)}))}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"resetToInit",value:function(){this.currFrameStartAt=0,this.currentIdx=0}},{key:"renderGroup",value:function(t,e){return Ah(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.break||!1===t.attribute.visibleAll){i.next=11;break}if(!t.incremental||e.startAtId!==t._uid){i.next=7;break}return i.next=4,this._increaseRender(t,e);case 4:i.t0=void(e.break=!0),i.next=10;break;case 7:return i.next=9,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return Ah(r,void 0,void 0,n().mark((function r(){var a=this;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,$u(t,Te.zIndex,(function(t){return Ah(a,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.t0=e.break,i.t0){i.next=6;break}if(i.t1=t.isContainer,!i.t1){i.next=6;break}return i.next=6,this.renderGroup(t,e);case 6:case"end":return i.stop()}}),i,this)})))}));case 2:i(!1);case 3:case"end":return r.stop()}}),r)})))}})}));case 9:i.t0=void i.sent;case 10:return i.abrupt("return",i.t0);case 11:case"end":return i.stop()}}),i,this)})))}}]),i}(uh);kh=mh([D(),_h(0,j(iu)),_h(1,I(ph)),_h(2,I(yh)),_h(3,I(et)),_h(3,N(Ju)),xh("design:paramtypes",[Array,Object,Object,Object])],kh);var Bh=new B((function(t){t(_o).toSelf().inSingletonScope(),t(Bo).toSelf().inSingletonScope(),t(cu).to(uh),t(Jl).to(kh),t(nu).to(fh).inSingletonScope(),t(iu).toService(nu),nt(t,Cr),t(ko).toSelf().inSingletonScope(),nt(t,jr),nt(t,iu),t(ih).toSelf().inSingletonScope(),t(Ju).toService(ih),nt(t,Ju)}));var Sh=!1;Sh||(Sh=!0,ri.load(gr),ri.load(Tu),ri.load(bu),ri.load(wu),ri.load(Ru),function(t){t.load(Iu),t.load(ju),t.load(Yu)}(ri),function(t){t.load(Bh)}(ri));var wh=ri.get(st);Ve.global=wh;var Th=ri.get(lr);Ve.graphicUtil=Th;var Ph=ri.get(or);Ve.transformUtil=Ph;var Ch=ri.get(Qn);Ve.graphicService=Ch;var Mh,Oh=ri.get(ur);Ve.layerService=Oh;var Eh=!1,Lh=new B((function(t){Eh||(Eh=!0,t(Jo).toSelf().inSingletonScope(),t(Ql).to(Jo).inSingletonScope(),t(iu).toService(Ql),t(wr).toService(ko),nt(t,wr))})),Rh=!1,Ih=new B((function(t){Rh||(Rh=!0,t(Tl).toSelf().inSingletonScope(),t(ou).to(Tl).inSingletonScope(),t(iu).toService(ou),t(Wo).toSelf(),t(Ho).toSelf(),t(Lr).toService(Wo),t(Lr).toService(Ho),t(Lr).toService(ko),nt(t,Lr))})),jh=!1,Dh=new B((function(t){jh||(jh=!0,t(sl).toSelf().inSingletonScope(),t(ph).toSelf().inSingletonScope(),t(ru).to(sl).inSingletonScope(),t(iu).toService(ru))})),Nh=!1,Uh=new B((function(t){Nh||(Nh=!0,t(yl).toSelf().inSingletonScope(),t(tu).to(yl).inSingletonScope(),t(iu).toService(tu),t(Tr).toService(ko),nt(t,Tr),t(yh).toSelf().inSingletonScope())})),zh=!1,Hh=new B((function(t){zh||(zh=!0,t(Ol).toSelf().inSingletonScope(),t(lu).to(Ol).inSingletonScope(),t(iu).toService(lu),t(Rr).toService(ko),nt(t,Rr))})),Wh=!1,Vh=new B((function(t){Wh||(Wh=!0,t(il).toSelf().inSingletonScope(),t(eu).to(il).inSingletonScope(),t(iu).toService(eu),t(Pr).toService(ko),nt(t,Pr))})),Fh=!1,Gh=new B((function(t){Fh||(Fh=!0,t(uu).to(Dl).inSingletonScope(),t(iu).toService(uu),t(Ir).toService(ko),nt(t,Ir))})),Yh=!1,Xh=new B((function(t){Yh||(Yh=!0,t(kl).toSelf().inSingletonScope(),t(au).to(kl).inSingletonScope(),t(iu).toService(au),t(Or).toService(ko),nt(t,Or))})),$h=!1,qh=new B((function(t){$h||($h=!0,t(su).to(Yl).inSingletonScope(),t(iu).toService(su),t(Er).toService(ko),nt(t,Er))})),Kh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jh=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.call(this)).numberType=Kn,t.builtinContributions=[Ll],t.init(),t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r){var a=Ti(t).richtext,s=t.attribute,o=s.strokeOpacity,l=void 0===o?a.strokeOpacity:o,u=s.opacity,h=void 0===u?a.opacity:u,d=s.fillOpacity,c=void 0===d?a.fillOpacity:d,f=s.visible,v=void 0===f?a.visible:f;if(t.valid&&v){var p=mr(h,c,!0),g=mr(h,l,!0);p&&(e.translate(i,n),this.beforeRenderStep(t,e,i,n,p,g,p,g,a,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,p,g,p,g,a,r))}}},{key:"drawIcon",value:function(t,e,i,n,r){var a,s=Ti(t).richtextIcon,o=t.attribute,l=o.width,u=void 0===l?s.width:l,h=o.height,d=void 0===h?s.height:h,c=o.opacity,f=void 0===c?s.opacity:c,v=o.image,p=o.backgroundFill,g=void 0===p?s.backgroundFill:p,y=o.backgroundFillOpacity,b=void 0===y?s.backgroundFillOpacity:y,m=o.backgroundStroke,x=void 0===m?s.backgroundStroke:m,_=o.backgroundStrokeOpacity,A=void 0===_?s.backgroundStrokeOpacity:_,k=o.backgroundRadius,B=void 0===k?s.backgroundRadius:k,S=o.margin,w=t.attribute,T=w.backgroundWidth,P=void 0===T?u:T,C=w.backgroundHeight,M=void 0===C?d:C;if(S&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){var O=(P-u)/2,E=(M-d)/2;0===B?(e.beginPath(),e.rect(i-O,n-E,P,M)):(e.beginPath(),jo(e,i-O,n-E,P,M,B)),g&&(e.globalAlpha=b,e.fillStyle=g,e.fill()),x&&(e.globalAlpha=A,e.strokeStyle=x,e.stroke())}var L=v&&(null===(a=null==t?void 0:t.resources)||void 0===a?void 0:a.get(v));L&&"success"===L.state&&(e.globalAlpha=f,e.drawImage(L.data,i,n,u,d))}},{key:"draw",value:function(t,e,i){var n=Ti(t).richtext;this._draw(t,n,!1,i)}}]),i}(po);Jh=Kh([D(),Zh("design:paramtypes",[])],Jh);var Qh=!1,td=new B((function(t){Qh||(Qh=!0,t(hu).to(Jh).inSingletonScope(),t(iu).toService(hu))})),ed=!1,id=new B((function(t){ed||(ed=!0,t(du).to(Zl).inSingletonScope(),t(iu).toService(du),t(Mr).toService(ko),nt(t,Mr))}));const nd=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class rd extends nr{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,i,n){e.isPlainObject(this.attribute[t])&&e.isPlainObject(i)&&!e.isFunction(this.attribute[t])&&!e.isFunction(i)?e.merge(this.attribute[t],i):this.attribute[t]=i,nd.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>nd.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,i){e.isNil(i)&&(i=Object.keys(t));for(let n=0;n<i.length;n++){const r=i[n];!e.isPlainObject(this.attribute[r])||e.isFunction(this.attribute[r])||e.isFunction(t[r])?this.attribute[r]=t[r]:e.merge(this.attribute[r],t[r])}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new Oi(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}var ad=Symbol.for("MathPickerContribution"),sd=Symbol.for("MathArcPicker"),od=Symbol.for("MathAreaPicker"),ld=Symbol.for("MathCirclePicker"),ud=Symbol.for("MathImagePicker"),hd=Symbol.for("MathLinePicker"),dd=Symbol.for("MathPathPicker"),cd=Symbol.for("MathRectPicker"),fd=Symbol.for("MathSymbolPicker"),vd=Symbol.for("MathTextPicker"),pd=Symbol.for("MathPolygonPicker"),gd=Symbol.for("CanvasArcPicker"),yd=Symbol.for("CanvasAreaPicker"),bd=Symbol.for("CanvasCirclePicker"),md=Symbol.for("CanvasImagePicker"),xd=Symbol.for("CanvasLinePicker"),_d=Symbol.for("CanvasPathPicker"),Ad=Symbol.for("CanvasRectPicker"),kd=Symbol.for("CanvasSymbolPicker"),Bd=Symbol.for("CanvasTextPicker"),Sd=Symbol.for("CanvasPolygonPicker"),wd=Symbol.for("CanvasRichTextPicker"),Td=Symbol.for("CanvasPickerContribution"),Pd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Md=function(t,e){return function(i,n){e(i,n,t)}},Od=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=Un}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).arc;n.highPerformanceSave();var a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=go(n,a+s,n.dpr),d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Od=Pd([D(),Md(0,I(Ql)),Cd("design:paramtypes",[Object])],Od);var Ed=!1,Ld=new B((function(t,e,i,n){Ed||(Ed=!0,t(gd).to(Od).inSingletonScope(),t(Td).toService(gd))})),Rd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Id=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jd=function(t,e){return function(i,n){e(i,n,t)}},Dd=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=Un}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).arc;n.highPerformanceSave();var a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Dd=Rd([D(),jd(0,I(Ql)),Id("design:paramtypes",[Object])],Dd);var Nd=!1,Ud=new B((function(t,e,i,n){Nd||(Nd=!0,t(sd).to(Dd).inSingletonScope(),t(ad).toService(sd))})),zd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Hd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wd=function(t,e){return function(i,n){e(i,n,t)}},Vd=new e.AABBBounds,Fd=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=$n}return o(t,[{key:"contains",value:function(t,i,n){if(!t.AABBBounds.containsPoint(i))return!1;if("imprecise"===t.attribute.pickMode)return!0;var r=(null!=n?n:{}).pickContext;if(!r)return!1;var a=Ti(t).rect,s=t.attribute.cornerRadius,o=void 0===s?a.cornerRadius:s,l=t.attribute,u=l.x,h=void 0===u?a.x:u,d=l.y,c=void 0===d?a.y:d;r.highPerformanceSave();var f=!0;if(t.transMatrix.onlyTranslate()){var v=t.getOffsetXY(a);h+=v.x,c+=v.y,r.setTransformForCurrent()}else h=0,c=0,f=!1,r.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!f||t.shadowRoot||e.isNumber(o,!0)&&0!==o||e.isArray(o)&&o.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,r,h,c,{},null,(function(t,e,n){return!!p||(p=t.isPointInPath(i.x,i.y))}),(function(t,e,n){if(p)return!0;var a=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=go(r,a+s,r.dpr),p=t.isPointInStroke(i.x,i.y)}));else{var g=t.attribute,y=g.fill,b=void 0===y?a.fill:y,m=g.stroke,x=void 0===m?a.stroke:m,_=g.lineWidth,A=void 0===_?a.lineWidth:_;if(b)p=!0;else if(x){var k=t.AABBBounds;Vd.setValue(k.x1,k.y1,k.x2,k.y2),Vd.expand(-A/2),p=!Vd.containsPoint(i)}}return r.highPerformanceRestore(),p}}]),t}();Fd=zd([D(),Wd(0,I(ou)),Hd("design:paramtypes",[Object])],Fd);var Gd=!1,Yd=new B((function(t,e,i,n){Gd||(Gd=!0,t(Ad).to(Fd).inSingletonScope(),t(Td).toService(Ad))})),Xd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$d=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qd=function(t,e){return function(i,n){e(i,n,t)}},Kd=new e.AABBBounds,Zd=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=$n}return o(t,[{key:"contains",value:function(t,i,n){if(!t.AABBBounds.containsPoint(i))return!1;if("imprecise"===t.attribute.pickMode)return!0;var r=(null!=n?n:{}).pickContext;if(!r)return!1;var a=Ti(t).rect,s=t.attribute.cornerRadius,o=void 0===s?a.cornerRadius:s,l=t.attribute,u=l.x,h=void 0===u?a.x:u,d=l.y,c=void 0===d?a.y:d;r.highPerformanceSave();var f=!0;if(t.transMatrix.onlyTranslate()){var v=t.getOffsetXY(a);h+=v.x,c+=v.y,r.setTransformForCurrent()}else h=0,c=0,f=!1,r.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!f||e.isNumber(o,!0)&&0!==o||e.isArray(o)&&o.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,r,h,c,{},null,(function(t,e,n){return!!p||(p=t.isPointInPath(i.x,i.y))}),(function(t,e,n){if(p)return!0;var a=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=a+s,p=t.isPointInStroke(i.x,i.y)}));else if(p){var g=t.attribute,y=g.fill,b=void 0===y?a.fill:y,m=g.stroke,x=void 0===m?a.stroke:m,_=g.lineWidth,A=void 0===_?a.lineWidth:_;if(b)p=!0;else if(x){var k=t.AABBBounds;Kd.setValue(k.x1,k.y1,k.x2,k.y2),Kd.expand(-A/2),p=!Kd.containsPoint(i)}}return r.highPerformanceRestore(),p}}]),t}();Zd=Xd([D(),qd(0,I(ou)),$d("design:paramtypes",[Object])],Zd);var Jd=!1,Qd=new B((function(t,e,i,n){Jd||(Jd=!0,t(cd).to(Zd).inSingletonScope(),t(ad).toService(cd))})),tc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ec=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i)}(po),ic=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},nc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rc=function(t,e){return function(i,n){e(i,n,t)}},ac=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="line",n.numberType=Gn,n}return o(i,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;n.highPerformanceSave();var r=Ti(t).line,a=this.transform(t,r,n),s=a.x,o=a.y,l=a.z,u=a.lastModelMatrix,h=e;if(n.camera){h=e.clone();var d=t.parent.globalTransMatrix;h.x=d.a*e.x+d.c*e.y+d.e,h.y=d.b*e.x+d.d*e.y+d.f}this.canvasRenderer.z=l;var c=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(function(t){return!!c||(c=t.isPointInPath(h.x,h.y))}),(function(t,e,i){if(c)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=go(n,r+a,n.dpr),c=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,n.modelMatrix!==u&&io.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),c}}]),i}(ec=tc([D()],ec));ac=ic([D(),rc(0,I(ru)),nc("design:paramtypes",[Object])],ac);var sc=!1,oc=new B((function(t,e,i,n){sc||(sc=!0,t(xd).to(ac).inSingletonScope(),t(Td).toService(xd))})),lc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},uc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hc=function(t,e){return function(i,n){e(i,n,t)}},dc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="line",this.numberType=Gn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).line,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();dc=lc([D(),hc(0,I(ru)),uc("design:paramtypes",[Object])],dc);var cc=!1,fc=new B((function(t,e,i,n){cc||(cc=!0,t(hd).to(dc).inSingletonScope(),t(ad).toService(hd))})),vc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},pc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gc=function(t,e){return function(i,n){e(i,n,t)}},yc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Hn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).area,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t){return!!d||(d=t.isPointInPath(e.x,e.y))})),n.highPerformanceRestore(),d}}]),t}();yc=vc([D(),gc(0,I(tu)),pc("design:paramtypes",[Object])],yc);var bc=!1,mc=new B((function(t,e,i,n){bc||(bc=!0,t(yd).to(yc).inSingletonScope(),t(Td).toService(yd))})),xc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},_c=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ac=function(t,e){return function(i,n){e(i,n,t)}},kc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Hn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).area,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t){return!!d||(d=t.isPointInPath(e.x,e.y))})),n.highPerformanceRestore(),d}}]),t}();kc=xc([D(),Ac(0,I(tu)),_c("design:paramtypes",[Object])],kc);var Bc=!1,Sc=new B((function(t,e,i,n){Bc||(Bc=!0,t(od).to(kc).inSingletonScope(),t(ad).toService(od))})),wc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Tc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pc=function(t,e){return function(i,n){e(i,n,t)}},Cc=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="symbol",n.numberType=Zn,n}return o(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();var a=Ti(t).symbol,s=this.transform(t,a,n),o=s.x,l=s.y,u=s.z,h=s.lastModelMatrix,d=e;if(n.camera){d=e.clone();var c=t.parent.globalTransMatrix;d.x=c.a*e.x+c.c*e.y+c.e,d.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=u;var f=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,(function(t,e,i){return!!f||(f=t.isPointInPath(d.x,d.y))}),(function(t,e,i){if(f)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=go(n,r+a,n.dpr),f=t.isPointInStroke(d.x,d.y)})),this.canvasRenderer.z=0,n.modelMatrix!==h&&io.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),f}}]),i}(ec);Cc=wc([D(),Pc(0,I(lu)),Tc("design:paramtypes",[Object])],Cc);var Mc=!1,Oc=new B((function(t,e,i,n){Mc||(Mc=!0,t(kd).to(Cc).inSingletonScope(),t(Td).toService(kd))})),Ec=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Lc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rc=function(t,e){return function(i,n){e(i,n,t)}},Ic=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="symbol",this.numberType=Zn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).symbol,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Ic=Ec([D(),Rc(0,I(lu)),Lc("design:paramtypes",[Object])],Ic);var jc=!1,Dc=new B((function(t,e,i,n){jc||(jc=!0,t(fd).to(Ic).inSingletonScope(),t(ad).toService(fd))})),Nc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Uc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zc=function(t,e){return function(i,n){e(i,n,t)}},Hc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Wn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).circle,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=go(n,a+s,n.dpr),d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Hc=Nc([D(),zc(0,I(eu)),Uc("design:paramtypes",[Object])],Hc);var Wc=!1,Vc=new B((function(t,e,i,n){Wc||(Wc=!0,t(bd).to(Hc).inSingletonScope(),t(Td).toService(bd))})),Fc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Gc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yc=function(t,e){return function(i,n){e(i,n,t)}},Xc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Wn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).circle,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Xc=Fc([D(),Yc(0,I(eu)),Gc("design:paramtypes",[Object])],Xc);var $c=!1,qc=new B((function(t,e,i,n){$c||($c=!0,t(ld).to(Xc).inSingletonScope(),t(ad).toService(ld))})),Kc=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jc=function(t,e){return function(i,n){e(i,n,t)}},Qc=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="text",n.numberType=Jn,n}return o(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();var a=Ti(t).text,s=t.attribute.keepDirIn3d,o=!(void 0===s?a.keepDirIn3d:s),l=this.transform(t,a,n,o),u=l.x,h=l.y,d=l.z,c=l.lastModelMatrix;this.canvasRenderer.z=d;var f=e;if(n.camera){f=e.clone();var v=t.parent.globalTransMatrix;f.x=v.a*e.x+v.c*e.y+v.e,f.y=v.b*e.x+v.d*e.y+v.f}var p=!1;return this.canvasRenderer.drawShape(t,n,u,h,{},null,(function(e,i,n){if(p)return!0;var r=t.attribute,s=r.fontSize,o=void 0===s?a.fontSize:s,l=r.textBaseline,c=void 0===l?a.textBaseline:l,v=r.textAlign,g=void 0===v?a.textAlign:v,y=t.AABBBounds,b=y.height(),m=y.width(),x=Hr(c,b,o),_=zr(g,m);return e.rect(_+u,x+h,m,b,d),p=e.isPointInPath(f.x,f.y)}),(function(t,e,i){return p})),this.canvasRenderer.z=0,n.modelMatrix!==c&&io.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),p}}]),i}(ec);Qc=Kc([D(),Jc(0,I(uu)),Zc("design:paramtypes",[Object])],Qc);var tf=!1,ef=new B((function(t,e,i,n){tf||(tf=!0,t(Bd).to(Qc).inSingletonScope(),t(Td).toService(Bd))})),nf=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},rf=function(){function t(){a(this,t),this.type="text",this.numberType=Jn}return o(t,[{key:"contains",value:function(t,e,i){return!!t.AABBBounds.containsPoint(e)}}]),t}();rf=nf([D()],rf);var af=!1,sf=new B((function(t,e,i,n){af||(af=!0,t(vd).to(rf).inSingletonScope(),t(ad).toService(vd))})),of=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},lf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uf=function(t,e){return function(i,n){e(i,n,t)}},hf=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="path",n.numberType=Yn,n}return o(i,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).path;n.highPerformanceSave();var a=this.transform(t,r,n),s=a.x,o=a.y,l=a.z,u=a.lastModelMatrix,h=e;if(n.camera){h=e.clone();var d=t.parent.globalTransMatrix;h.x=d.a*e.x+d.c*e.y+d.e,h.y=d.b*e.x+d.d*e.y+d.f}this.canvasRenderer.z=l;var c=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(function(t,e,i){return!!c||(c=t.isPointInPath(h.x,h.y))}),(function(t,e,i){if(c)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=go(n,r+a,n.dpr),c=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,n.modelMatrix!==u&&io.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),c}}]),i}(ec);hf=of([D(),uf(0,I(au)),lf("design:paramtypes",[Object])],hf);var df=!1,cf=new B((function(t,e,i,n){df||(df=!0,t(_d).to(hf).inSingletonScope(),t(Td).toService(_d))})),ff=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pf=function(t,e){return function(i,n){e(i,n,t)}},gf=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="path",this.numberType=Yn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).path,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();gf=ff([D(),pf(0,I(au)),vf("design:paramtypes",[Object])],gf);var yf=!1,bf=new B((function(t,e,i,n){yf||(yf=!0,t(dd).to(gf).inSingletonScope(),t(ad).toService(dd))})),mf=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_f=function(t,e){return function(i,n){e(i,n,t)}},Af=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Xn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).polygon,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=go(n,a+s,n.dpr),d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Af=mf([D(),_f(0,I(su)),xf("design:paramtypes",[Object])],Af);var kf=!1,Bf=new B((function(t,e,i,n){kf||(kf=!0,t(Sd).to(Af).inSingletonScope(),t(Td).toService(Sd))})),Sf=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tf=function(t,e){return function(i,n){e(i,n,t)}},Pf=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Xn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Ti(t).polygon,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var d=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!d||(d=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(d)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,d=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),d}}]),t}();Pf=Sf([D(),Tf(0,I(su)),wf("design:paramtypes",[Object])],Pf);var Cf=!1,Mf=new B((function(t,e,i,n){Cf||(Cf=!0,t(pd).to(Pf).inSingletonScope(),t(ad).toService(pd))})),Of=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ef=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lf=function(t,e){return function(i,n){e(i,n,t)}},Rf=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=Kn}return o(t,[{key:"contains",value:function(t,e,i){return!!t.AABBBounds.containsPoint(e)}}]),t}();Rf=Of([D(),Lf(0,I(hu)),Ef("design:paramtypes",[Object])],Rf);var If=!1,jf=new B((function(t,e,i,n){If||(If=!0,t(wd).to(Rf).inSingletonScope(),t(Td).toService(wd))})),Df=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Nf=function(){function t(){a(this,t),this.type="image",this.numberType=Fn}return o(t,[{key:"contains",value:function(t,e,i){return!!(null!=i?i:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}]),t}();Nf=Df([D()],Nf);var Uf=!1,zf=new B((function(t,e,i,n){Uf||(Uf=!0,t(ud).to(Nf).inSingletonScope(),t(Nf).toService(ud))})),Hf=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Wf=function(){function t(){a(this,t),this.type="image",this.numberType=Fn}return o(t,[{key:"contains",value:function(t,e,i){return!!(null!=i?i:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}]),t}();Wf=Hf([D()],Wf);var Vf=!1,Ff=new B((function(t,e,i,n){Vf||(Vf=!0,t(md).to(Wf).inSingletonScope(),t(Td).toService(md))})),Gf=!1,Yf=new B((function(t,e,i,n){Gf||(Gf=!0,t(ud).to(Nf).inSingletonScope(),t(Nf).toService(ud))})),Xf=(function(){if(null==Mh){try{Mh=!!window}catch(t){Mh=!1}if(Mh)try{Mh=!tt}catch(t){Mh=!0}}}(),Mh),$f=!1;function qf(){$f||($f=!0,co.RegisterGraphicCreator("arc",Xs),ri.load(Lh),ri.load(Xf?Ld:Ud))}var Kf=!1;function Zf(){Kf||(Kf=!0,co.RegisterGraphicCreator("area",Fs),ri.load(Uh),ri.load(Xf?mc:Sc))}var Jf=!1;function Qf(){Jf||(Jf=!0,co.RegisterGraphicCreator("circle",Ur),ri.load(Vh),ri.load(Xf?Vc:qc))}var tv=!1;function ev(){tv||(tv=!0,co.RegisterGraphicCreator("group",rr))}var iv=!1;function nv(){iv||(iv=!0,co.RegisterGraphicCreator("image",Es),ri.load(id),ri.load(Xf?Ff:Yf))}var rv=!1;function av(){rv||(rv=!0,co.RegisterGraphicCreator("line",Bs),ri.load(Dh),ri.load(Xf?oc:fc))}var sv=!1;function ov(){sv||(sv=!0,co.RegisterGraphicCreator("path",Hs),ri.load(Xh),ri.load(Xf?cf:bf))}var lv=!1;function uv(){lv||(lv=!0,co.RegisterGraphicCreator("polygon",Ks),ri.load(qh),ri.load(Xf?Bf:Mf))}var hv=!1;function dv(){hv||(hv=!0,co.RegisterGraphicCreator("rect",Ts),ri.load(Ih),ri.load(Xf?Yd:Qd))}var cv=!1;function fv(){cv||(cv=!0,co.RegisterGraphicCreator("richtext",Ns),ri.load(td),ri.load(Xf?jf:zf))}var vv=!1;function pv(){vv||(vv=!0,co.RegisterGraphicCreator("symbol",_s),ri.load(Hh),ri.load(Xf?Oc:Dc))}var gv=!1;function yv(){gv||(gv=!0,co.RegisterGraphicCreator("text",Gr),ri.load(Gh),ri.load(Xf?ef:sf))}var bv=!1;function mv(){bv||(bv=!0,co.RegisterGraphicCreator("wrapText",$r))}const xv={debounce:e.debounce,throttle:e.throttle};ev(),dv();class _v extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},_v.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:i,viewY:n}=t,{direction:r,width:a,height:s,range:o}=this.attribute,l=this._sliderSize,[u,h]=this._getScrollRange();let d;if("vertical"===r){const t=n-this._viewPosition.y,i=e.clamp(t-l/2,u,h);d=t/s,this._slider.setAttribute("y",i,!0)}else{const t=i-this._viewPosition.x,n=e.clamp(t-l/2,u,h);d=t/a,this._slider.setAttribute("x",n,!0)}this.setScrollRange([d-(o[1]-o[0])/2,d+(o[1]-o[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();const{direction:e}=this.attribute;this._prePos="horizontal"===e?t.clientX:t.clientY,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===wh.env?(wh.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),wh.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute;let i,n,r=0;const{width:a,height:s}=this._getSliderRenderBounds();return"vertical"===e?(n=t.clientY,r=n-this._prePos,i=r/s):(n=t.clientX,r=n-this._prePos,i=r/a),[n,i]},this._onSliderPointerMove=xv[this.attribute.delayType]((t=>{t.stopPropagation();const e=this.getScrollRange(),[i,n]=this._computeScrollValue(t);this.setScrollRange([e[0]+n,e[1]+n],!0),this._prePos=i}),this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:i=!0,range:n,limitRange:r=[0,1]}=this.attribute,a=this.getScrollRange(),[s,o]=this._computeScrollValue(t),l=[a[0]+o,a[1]+o];this._dispatchEvent("scrollUp",{pre:n,value:e.clampRange(l,r[0],r[1])}),"browser"===wh.env?(wh.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),wh.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,i=!0){const{direction:n="horizontal",limitRange:r=[0,1],range:a,realTime:s=!0}=this.attribute,o=e.clampRange(t,r[0],r[1]);if(i){const t=this._getSliderPos(o);this._slider&&("horizontal"===n?this._slider.setAttribute("x",t[0],!0):this._slider.setAttribute("y",t[0],!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame())}this.attribute.range=o,s&&this._dispatchEvent("scrollDrag",{pre:a,value:o})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",xv[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:i,height:n,range:r,limitRange:a=[0,1],railStyle:s,sliderStyle:o,padding:l=2}=this.attribute,u=this.createOrUpdateChild("scrollbar-container",{},"group"),h=u.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:n},s),"rect");this._rail=h;const d=this._getSliderRenderBounds(),c=this._getSliderPos(e.clampRange(r,a[0],a[1])),f=c[1]-c[0];let v;this._sliderSize=f,v="horizontal"===t?{x:c[0],y:d.y1,width:f,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:f};const p=u.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},v),{cornerRadius:this._getDefaultSliderCornerRadius()}),o),{boundsPadding:e.normalizePadding(l),pickMode:"imprecise"}),"rect");this._slider=p,this._container=u;const g=this._container.AABBBounds;this._viewPosition={x:g.x1,y:g.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:i,padding:n=2}=this.attribute,[r,a,s,o]=e.normalizePadding(n),l={x1:o,y1:r,x2:t-a,y2:i-s,width:Math.max(0,t-(o+a)),height:Math.max(0,i-(r+s))};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:n,x1:r,y1:a}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+r,i*t[1]+r]:[n*t[0]+a,n*t[1]+a]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:i}=this.attribute,[n,r]=e.clampRange(t,0,1),{width:a,height:s,x1:o,y1:l}=this._getSliderRenderBounds(),u=this._sliderSize;return"horizontal"===i?e.clampRange([o+n*a,o+r*a],o,a-u):e.clampRange([l+n*s,l+r*s],l,s-u)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function Av(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}function kv(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function Bv(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))}function Sv(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&Sv(t,e)}))}_v.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0},"function"==typeof SuppressedError&&SuppressedError;const wv=t=>!e.isNil(t)&&!1!==t.visible;const Tv=["#ffffff","#000000"];function Pv(t,i,n,r,a,s){if("string"!=typeof t||"string"!=typeof i)return t;const o=new e.Color(t).toHex(),l=new e.Color(i).toHex();return Cv(o,l,n,r,s)?o:function(t,e,i,n,r,a){const s=[];r&&(r instanceof Array?s.push(...r):s.push(r));s.push(...Tv);for(const r of s)if(t!==r&&Cv(r,e,i,n,a))return r;return}(o,l,n,r,a,s)}function Cv(t,i,n,r,a){if("lightness"===a){const n=e.Color.getColorBrightness(new e.Color(i));return e.Color.getColorBrightness(new e.Color(t))<.5?n>=.5:n<.5}return r?Mv(t,i)>r:"largeText"===n?Mv(t,i)>3:Mv(t,i)>4.5}function Mv(t,e){const i=Ov(t),n=Ov(e);return((i>n?i:n)+.05)/((i>n?n:i)+.05)}function Ov(t){const i=e.hexToRgb(t),n=i[0]/255,r=i[1]/255,a=i[2]/255;let s,o,l;s=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),o=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4),l=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4);return.2126*s+.7152*o+.0722*l}function Ev(t,e,i,n){let r;switch(t){case"base":r=e;break;case"invertBase":r=i;break;case"similarBase":r=n}return r}function Lv(t,e){return[t[0]*e,t[1]*e]}function Rv(t,e,i){const n=function(t,e){const[i,n]=t,[r,a]=e,s=Math.sqrt((i*i+n*n)*(r*r+a*a)),o=s&&(i*r+n*a)/s;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),r=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return i?r?2*Math.PI-n:n:r?n:2*Math.PI-n}const Iv=-.5*Math.PI,jv=1.5*Math.PI,Dv="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";var Nv;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Nv||(Nv={}));const Uv={[Nv.selectedReverse]:{},[Nv.selected]:{},[Nv.hover]:{},[Nv.hoverReverse]:{}},zv={container:"",width:30,height:30,style:{}},Hv=(t,i,n)=>new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:Dv,fontSize:11},getTextBounds:n?void 0:fo,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t);function Wv(t,e){var i;if(!t)return{width:0,height:0};const n=fo({text:t,fontFamily:e.fontFamily,fontSize:e.fontSize||12,fontWeight:e.fontWeight,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||12});return{width:n.width(),height:n.height()}}function Vv(){ev(),dv(),pv(),fv(),yv()}Vv();class Fv extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Fv.defaultAttributes,t)),this.name="tag"}render(){var t,i,n;const{text:r="",textStyle:a={},shape:s={},panel:o={},space:l=4,minWidth:u,maxWidth:h,padding:d=4,visible:c,state:f,type:v,textAlwaysCenter:p}=this.attribute,g=e.normalizePadding(d),y=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let b,m=g[1]+g[3],x=g[0]+g[2],_=0,A=0;const{visible:k}=s,B=Av(s,["visible"]);if(e.isBoolean(k)){const t=(null==B?void 0:B.size)||10,i=e.isNumber(t)?t:Math.max(t[0],t[1]);b=y.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:k,x:i/2,y:i/2}),"symbol"),e.isEmpty(null==f?void 0:f.shape)||(b.states=f.shape),k&&(A=i+l)}let S;if(m+=A,_+=A,"rich"===v){const n=Object.assign(Object.assign({textConfig:r,visible:e.isValid(r)&&!1!==c},a),{x:_,y:0,width:null!==(t=a.width)&&void 0!==t?t:0,height:null!==(i=a.height)&&void 0!==i?i:0});S=y.createOrUpdateChild("tag-text",n,"richtext");const{visible:s}=o,l=Av(o,["visible"]);if(c&&e.isBoolean(s)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},l),{visible:s&&!!r,x:S.AABBBounds.x1,y:S.AABBBounds.y1,width:S.AABBBounds.width(),height:S.AABBBounds.height()}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}else if("html"===v){const t=Object.assign(Object.assign({textConfig:[],visible:e.isValid(r)&&!1!==c,html:Object.assign(Object.assign({dom:r},zv),a)},a),{x:_,y:0});S=y.createOrUpdateChild("tag-text",t,"richtext");const{visible:i}=o,n=Av(o,["visible"]);if(c&&e.isBoolean(i)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},n),{visible:i&&!!r,x:S.AABBBounds.x1,y:S.AABBBounds.y1,width:S.AABBBounds.width(),height:S.AABBBounds.height()}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}else{const t=Object.assign(Object.assign({text:r,visible:e.isValid(r)&&!1!==c,lineHeight:null==a?void 0:a.fontSize},a),{x:_,y:0});e.isNil(t.lineHeight)&&(t.lineHeight=a.fontSize),S=y.createOrUpdateChild("tag-text",t,"text"),e.isEmpty(null==f?void 0:f.text)||(S.states=f.text);const i=Wv(t.text,a),l=i.width,d=i.height;m+=l;const v=null!==(n=s.size)&&void 0!==n?n:10,k=e.isNumber(v)?v:Math.max(v[0],v[1]);x+=Math.max(d,s.visible?k:0);const{textAlign:B,textBaseline:w}=a;(e.isValid(u)||e.isValid(h))&&(e.isValid(u)&&m<u&&(m=u),e.isValid(h)&&m>h&&(m=h,S.setAttribute("maxLineWidth",h-g[1]-g[2])));let T=0,P=0;"center"===B?(T-=m/2,b&&b.setAttribute("x",(b.attribute.x||0)-l/2),y.setAttribute("x",-A/2)):"right"===B||"end"===B?(T-=m,b&&b.setAttribute("x",(b.attribute.x||0)-l),y.setAttribute("x",-g[1]-A)):"left"!==B&&"start"!==B||y.setAttribute("x",g[3]),!p||"left"!==B&&"start"!==B||S.setAttributes({x:_+m/2,textAlign:"center"}),"middle"===w?(P-=x/2,b&&b.setAttribute("y",0)):"bottom"===w?(P-=x,b&&b.setAttribute("y",-d/2),y.setAttribute("y",-g[2])):"top"===w&&(y.setAttribute("y",g[0]),b&&b.setAttribute("y",d/2));const{visible:C}=o,M=Av(o,["visible"]);if(c&&e.isBoolean(C)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},M),{visible:C&&!!r,x:T,y:P,width:m,height:x}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}}}Fv.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const Gv={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},Yv={poptip:e.merge({},Gv)};const Xv=new e.AABBBounds;ev(),mv(),pv(),dv();class $v extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},$v.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,i,n,r,a,s,o,l;const{titleStyle:u={},position:h,contentStyle:d={},panel:c={},space:f=4,minWidth:v=0,maxWidth:p=1/0,padding:g=4,maxWidthPercent:y,visible:b,state:m,dx:x=0,dy:_=0}=this.attribute;let{title:A="",content:k=""}=this.attribute;A=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(A):A,k=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(k):k;const B=e.normalizePadding(g),S=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),w=p-B[1]-B[3],T=e.isValid(A)&&!1!==b,P=Object.assign(Object.assign({text:e.isArray(A)?A:[A],visible:T},u),{x:B[3],y:B[0],maxLineWidth:w,textAlign:"left",textBaseline:"top"}),C=S.createOrUpdateChild("poptip-title",P,"wrapText");e.isEmpty(null==m?void 0:m.title)||(C.states=m.title);const M=C.AABBBounds,O=M.height(),E=M.width();let L=O+f;T||(L=0);const R=e.isValid(k)&&!1!==b,I=Object.assign(Object.assign({text:e.isArray(k)?k:[k],visible:R},d),{x:B[3],y:B[0]+L,maxLineWidth:w,textAlign:"left",textBaseline:"top"}),j=S.createOrUpdateChild("poptip-content",I,"wrapText");e.isEmpty(null==m?void 0:m.content)||(j.states=m.content);const D=j.AABBBounds,N=D.height(),U=D.width();R&&(L+=N);let z=e.max(E+B[1]+B[3],U+B[1]+B[3]);z>p?z=p:z<v&&(z=v);let H=B[0]+B[2]+L;const{visible:W}=c,V=Av(c,["visible"]),F=null!==(t=V.size)&&void 0!==t?t:12,G=e.isArray(F)?[F[0]+(null!==(i=V.space)&&void 0!==i?i:0),F[1]+(null!==(n=V.space)&&void 0!==n?n:0)]:F+(null!==(r=V.space)&&void 0!==r?r:0),Y=null!==(a=V.lineWidth)&&void 0!==a?a:1,X=this.stage?[null!==(s=this.stage.viewWidth)&&void 0!==s?s:this.stage.width,null!==(o=this.stage.viewHeight)&&void 0!==o?o:this.stage.height]:void 0;if(X){const t=this.AABBBounds,i=null!==(l=this.attribute.x)&&void 0!==l?l:t.x1,n=X[0]-t.x1;let r=Math.max(i,n);const a=(e.isArray(F)?F[0]:12)+3;if(r=Math.min(r-a,r*y),r<z){z=r;const t=B[1]+B[3];C.setAttribute("maxLineWidth",r-t),j.setAttribute("maxLineWidth",r-t),H=B[0]+B[2],T&&(H+=C.AABBBounds.height()+f),H+=j.AABBBounds.height()}}const $="auto"===h;let q,K=-1/0;for(let t=0;t<this.positionList.length+1;t++){const i=$?this.positionList[t===this.positionList.length?q:t]:h,{angle:n,offset:r,rectOffset:a}=this.getAngleAndOffset(i,z,H,e.isArray(G)?G:[G,G-Y]);if(e.isBoolean(W)){const t=(e.isArray(F)?F[0]:F)/4,i=S.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},V),{visible:W&&(R||T),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:n,dx:r[0],dy:r[1],size:F,zIndex:-9}),"symbol");e.isEmpty(null==m?void 0:m.panel)||(i.states=m.panel);const a=S.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},V),{visible:W&&(R||T),x:0,y:0,width:z,height:H,zIndex:-8}),"rect");e.isEmpty(null==m?void 0:m.panel)||(a.states=m.panel)}if(S.setAttributes({x:-r[0]+x,y:-r[1]+_}),!$||!X)break;{Xv.setValue(0,0,z,H).transformWithMatrix(S.globalTransMatrix);const i=Xv,n=(new e.Bounds).setValue(0,0,X[0],X[1]);if(e.rectInsideAnotherRect(i,n,!1))break;{const r=e.getRectIntersect(i,n,!1),a=(r.x2-r.x1)*(r.y2-r.y1);a>K&&(K=a,q=t)}}}}getAngleAndOffset(t,i,n,r){const a=r[1]/2;switch(t){case"tl":return{angle:e.pi/2*3,offset:[i/4,n+a],rectOffset:[-i/4,-n-r[1]]};case"top":return{angle:e.pi/2*3,offset:[i/2,n+a],rectOffset:[0,-n-r[1]]};case"tr":return{angle:e.pi/2*3,offset:[i/4*3,n+a],rectOffset:[i/4*3,-n-r[1]]};case"rt":return{angle:0,offset:[-a,n/5],rectOffset:[i/4*3,-n-r[1]]};case"right":return{angle:0,offset:[-a,n/2],rectOffset:[i/4*3,-n-r[1]]};case"rb":return{angle:0,offset:[-a,n/5*4],rectOffset:[i/4*3,-n-r[1]]};case"bl":return{angle:e.pi/2,offset:[i/4,-a],rectOffset:[-i/4,-n-r[1]]};case"bottom":return{angle:e.pi/2,offset:[i/2,-a],rectOffset:[0,-n-r[1]]};case"br":return{angle:e.pi/2,offset:[i/4*3,-a],rectOffset:[i/4*3,-n-r[1]]};case"lt":return{angle:e.pi,offset:[i+a,n/5],rectOffset:[-i/4,-n-r[1]]};case"left":return{angle:e.pi,offset:[i+a,n/2],rectOffset:[0,-n-r[1]]};case"lb":return{angle:e.pi,offset:[i+a,n/5*4],rectOffset:[i/4*3,-n-r[1]]}}}}$v.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};let qv=class{render(t,i,n,r,a,s,o,l,u,h,d,c,f){var v,p,g;if(1===t._showPoptip){const{visible:i,visibleCb:n}=t.attribute.poptip||{};if(!1===i||n&&!1===n(t))return;const r={};e.merge(r,$v.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(r):this.poptipComponent=new $v(r);let a=t.attribute.poptip||{};if("text"===t.type&&null==a.title&&null==a.content){const i={};p=i,g=a,e.merge(p,Yv.poptip,g),a=i,a.content=null!==(v=a.content)&&void 0!==v?v:t.attribute.text}const s=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},a),{x:s.e,y:s.f})),h.stage.tryInitInteractiveLayer();const o=h.stage.getLayer("_builtin_interactive");o&&o.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};qv=kv([D()],qv);let Kv=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=k.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if(e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};Kv=kv([D()],Kv);let Zv=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=k.GenAutoIncrementId(),this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)},this.poptip=t=>{const e=t.target;if("text"!==e.type||!e.cliped||e.isContainer||!e.attribute||e.attribute.disableAutoClipedPoptip)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i={}}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip),e.addEventListener("pointerleave",this.pointerlave)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip),e.removeEventListener("pointerleave",this.pointerlave)}};Zv=kv([D()],Zv);const Jv=new B(((t,e,i,n)=>{i(qv)||(t(qv).toSelf().inSingletonScope(),t(jr).toService(qv)),i(Kv)||(t(Kv).toSelf(),t(Pu).toService(Kv)),i(Zv)||(t(Zv).toSelf(),t(Pu).toService(Zv))}));class Qv extends rd{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}ev(),av();class tp extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},tp.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},n),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}tp.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},ev(),dv();class ep extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ep.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},n),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}ep.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},ev(),qf();class ip extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ip.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),n),"arc")}setLocation(t){const{center:i}=this.attribute,n=e.PointService.distancePP(t,i);this.setAttribute("radius",n)}}ip.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}},ev(),qf();class np extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},np.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:n=0,sectorStyle:r}=this.attribute,{startAngle:a,endAngle:s}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:n,startAngle:a,endAngle:s}),r),"arc")}setLocation(t){const{center:i,startAngle:n=Iv,endAngle:r=jv}=this.attribute,a=r-n,s=e.radianToDegree(e.getAngleByPoint(i,t));this.setAttributes({startAngle:s-a/2,endAngle:s+a/2})}}np.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},ev(),ov();class rp extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},rp.defaultAttributes,t))}renderCrosshair(t){const{center:i,radius:n,sides:r=6,lineStyle:a}=this.attribute,{startAngle:s,endAngle:o}=this.attribute,l=(o-s)%(2*Math.PI)==0,u=(o-s)/r;let h;for(let t=0;t<=r;t++){const a=s+u*t,o=e.polarToCartesian(i,n,a);0===t?h=`M${o.x},${o.y}`:h+=`L${o.x},${o.y}`,t===r&&l&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},a),"path")}setLocation(t){const{center:i}=this.attribute,n=e.PointService.distancePP(t,i);this.setAttribute("radius",n)}}rp.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const ap=5,sp=31,op=32,lp=new Uint32Array(op+1),up=new Uint32Array(op+1);up[0]=0,lp[0]=~up[0];for(let t=1;t<=op;++t)up[t]=up[t-1]<<1|1,lp[t]=~up[t];function hp(t,e,i=0){const n=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*i+n)/n),a=~~((e+2*i+n)/n),s=t=>~~((t+i)/n);return s.invert=t=>t*n-i,s.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+op)/op));function n(t,e){i[t]|=e}function r(t,e){i[t]&=e}return{array:i,get:(e,n)=>{const r=n*t+e;return i[r>>>ap]&1<<(r&sp)},set:(e,i)=>{const r=i*t+e;n(r>>>ap,1<<(r&sp))},clear:(e,i)=>{const n=i*t+e;r(n>>>ap,~(1<<(n&sp)))},getRange:({x1:n,y1:r,x2:a,y2:s})=>{if(a<0||s<0||n>t||r>e)return!0;let o,l,u,h,d=s;for(;d>=r;--d)if(o=d*t+n,l=d*t+a,u=o>>>ap,h=l>>>ap,u===h){if(i[u]&lp[o&sp]&up[1+(l&sp)])return!0}else{if(i[u]&lp[o&sp])return!0;if(i[h]&up[1+(l&sp)])return!0;for(let t=u+1;t<h;++t)if(i[t])return!0}return!1},setRange:({x1:i,y1:r,x2:a,y2:s})=>{if(a<0||s<0||i>t||r>e)return;let o,l,u,h,d;for(;r<=s;++r)if(o=r*t+i,l=r*t+a,u=o>>>ap,h=l>>>ap,u===h)n(u,lp[o&sp]&up[1+(l&sp)]);else for(n(u,lp[o&sp]),n(h,up[1+(l&sp)]),d=u+1;d<h;++d)n(d,4294967295)},clearRange:({x1:e,y1:i,x2:n,y2:a})=>{let s,o,l,u,h;for(;i<=a;++i)if(s=i*t+e,o=i*t+n,l=s>>>ap,u=o>>>ap,l===u)r(l,up[s&sp]|lp[1+(o&sp)]);else for(r(l,up[s&sp]),r(u,lp[1+(o&sp)]),h=l+1;h<u;++h)r(h,0)},outOfBounds:({x1:i,y1:n,x2:r,y2:a})=>i<0||n<0||a>=e||r>=t,toImageData:n=>{const r=n.createImageData(t,e),a=r.data;for(let n=0;n<e;++n)for(let e=0;e<t;++e){const r=n*t+e,s=4*r,o=i[r>>>ap]&1<<(r&sp);a[s+0]=255*o,a[s+1]=255*o,a[s+2]=255*o,a[s+3]=31}return r}}}(r,a),s.ratio=n,s.padding=i,s.width=t,s.height=e,s}function dp(t,i,n=!1){if(n){const{x1:n,x2:r,y1:a,y2:s}=i,o=e.clamp(n,0,t.width),l=e.clamp(r,0,t.width),u=e.clamp(a,0,t.height),h=e.clamp(s,0,t.height);return{x1:t(o),x2:t(l),y1:t(u),y2:t(h)}}return{x1:t(i.x1),x2:t(i.x2),y1:t(i.y1),y2:t(i.y2)}}function cp(t,e,i,n=!0,r=0){let a=i;r>0&&(a={x1:i.x1-r,x2:i.x2+r,y1:i.y1-r,y2:i.y2+r}),a=dp(t,a);return!(n&&e.outOfBounds(a))&&!e.getRange(a)}function fp(t,i,n,r=[],a=!0,s=0){const o=r.filter((t=>e.isValid(t)));for(let e=0;e<o.length;e++){const r=n.clone();if(r.setAttributes(o[e]),r.update(),cp(t,i,dp(t,r.AABBBounds),a,s))return i.setRange(dp(t,r.AABBBounds,!0)),o[e]}return!1}function vp(t,i,n,r,a,s,o){var l,u;const h=null===(l=r.overlap)||void 0===l?void 0:l.clampForce,d=null===(u=r.overlap)||void 0===u?void 0:u.overlapPadding;if("bound"===n.type||"position"===n.type){if(e.isFunction(o)){const l=((e.isFunction(n.position)?n.position(a.attribute):n.position)||function(t){if("rect"===t)return gp;return pp}(r.type)).map((t=>o(a.AABBBounds,s,t,r.offset)));return fp(t,i,a,l,h,d)}return!1}if("moveY"===n.type){const r=(n.offset?e.isFunction(n.offset)?n.offset(a.attribute):n.offset:[]).map((t=>({x:a.attribute.x,y:a.attribute.y+t})));return fp(t,i,a,r,h,d)}if("moveX"===n.type){const r=(n.offset?e.isFunction(n.offset)?n.offset(a.attribute):n.offset:[]).map((t=>({x:a.attribute.x+t,y:a.attribute.y})));return fp(t,i,a,r,h,d)}return!1}const pp=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],gp=["top","inside-top","inside"];function yp(t,e,i){const{x1:n,x2:r,y1:a,y2:s}=t.AABBBounds,o=Math.min(n,r),l=Math.max(n,r),u=Math.min(a,s),h=Math.max(a,s);let d=0,c=0;return o<0&&l-o<=e?d=-o:l>e&&o-(l-e)>=0&&(d=e-l),u<0&&h-u<=i?c=-u:h>i&&u-(h-i)>=0&&(c=i-h),{dx:d,dy:c}}const bp={fadeIn:(t={})=>{var e,i,n;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(n=t.strokeOpacity)&&void 0!==n?n:1}}},fadeOut:(t={})=>{var e,i,n;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(n=t.strokeOpacity)&&void 0!==n?n:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function mp(t,e){var i,n;return null!==(n=null===(i=bp[e])||void 0===i?void 0:i.call(bp,t))&&void 0!==n?n:{from:{},to:{}}}const xp=(t,i,n,r)=>{const a=Object.assign({},t.attribute),s=Object.assign({},i.attribute);return e.array(null==r?void 0:r.excludeChannels).forEach((t=>{delete s[t]})),Object.keys(s).forEach((t=>{n&&!n.includes(t)&&delete s[t]})),{from:a,to:s}};function _p(t,i,n,r){t.attribute.text!==i.attribute.text&&e.isValidNumber(Number(t.attribute.text)*Number(i.attribute.text))&&t.animate().play(new rn({text:t.attribute.text},{text:i.attribute.text},n,r))}const Ap={mode:"same-time",duration:300,easing:"linear"};function kp(t,e,i,n){const r=function(t){return t.radius?{x:Math.cos(t.angle)*t.radius,y:Math.sin(t.angle)*t.radius}:{x:0,y:0}}({radius:i,angle:n});return{x:t+r.x,y:e+r.y}}function Bp(t){return(t=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function Sp(t){return 3===t||4===t}function wp(t,e){const{x1:i,y1:n,x2:r,y2:a}=t,{x1:s,y1:o,x2:l,y2:u}=e;return!(i<=s&&r<=s||i>=l&&r>=l||n<=o&&a<=o||n>=u&&a>=u)}const Tp=(t,e,i="top",n=0)=>{if(!t)return;const{x1:r,y1:a,x2:s,y2:o}=t,l=Math.abs(s-r),u=Math.abs(o-a),h=(e.x1+e.x2)/2,d=(e.y1+e.y2)/2;let c=0,f=0,v=0,p=0;e&&(v=Math.abs(e.x1-e.x2)/2,p=Math.abs(e.y1-e.y2)/2);const g={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":f=-1;break;case"bottom":f=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(g[i]*(Math.PI/180)),f=Math.cos(g[i]*(Math.PI/180));break;case"center":c=0,f=0}return{x:h+c*(n+v)+Math.sign(c)*(l/2),y:d+f*(n+p)+Math.sign(f)*(u/2)}},Pp=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function Cp(t,e,i="end",n=0){if(!t||!e)return;const{x1:r,x2:a}=t,s=Math.abs(a-r),o=e.x1;let l=o;return"end"===i?l=o+s/2+n:"start"===i&&(l=o-s/2-n),{x:l,y:e.y1}}ev(),yv(),fv(),av();class Mp extends rd{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Mp.defaultAttributes,t)),this.name="label",this._onHover=t=>{const i=t.target;i===this._lastHover||e.isEmpty(i.states)||(i.addState(Nv.hover,!0),Sv(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Nv.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(Sv(this,(t=>{e.isEmpty(t.states)||(t.removeState(Nv.hoverReverse),t.removeState(Nv.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState("selected"))return this._lastSelect=null,void Sv(this,(t=>{e.isEmpty(t.states)||(t.removeState(Nv.selectedReverse),t.removeState(Nv.selected))}));e.isEmpty(i.states)||(i.addState(Nv.selected,!0),Sv(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Nv.selectedReverse,!0)})),this._lastSelect=i)},this._handleRelatedGraphicSetState=t=>{var e,i,n;if((null===(e=t.detail)||void 0===e?void 0:e.type)===mt.STATE){const e=null!==(n=null===(i=t.target)||void 0===i?void 0:i.currentStates)&&void 0!==n?n:[];(this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)]).forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}}}labeling(t,e,i,n){}_labelLine(t){}render(){if(this._prepare(),e.isNil(this._idToGraphic)||this._isCollectionBase&&e.isNil(this._idToPoint))return;const{overlap:t,smartInvert:i,dataFilter:n,customLayoutFunc:r,customOverlapFunc:a}=this.attribute;let s,o=this.attribute.data;e.isFunction(n)&&(o=n(o)),s=e.isFunction(r)?r(o,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(o),e.isFunction(a)?s=a(s,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(s=this._overlapping(s)),s&&s.length&&s.forEach((t=>{this._bindEvent(t),this._setStatesOfText(t)})),!1!==i&&this._smartInvert(s),this._renderLabels(s)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const i=this.attribute.state;i&&!e.isEmpty(i)&&(t.states=i)}_setStatesOfLabelLine(t){if(!t)return;const i=this.attribute.labelLineState;i&&!e.isEmpty(i)&&(t.states=i)}_createLabelText(t){var e,i;if("rich"===t.textType){t.textConfig=t.text,t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0;return co.richtext(t)}if("html"===t.textType){t.textConfig=[],t.html=Object.assign(Object.assign({dom:t.text},zv),t);return co.richtext(t)}return co.text(t)}_prepare(){var t,i,n,r,a;const s=[];let o;if(o=e.isFunction(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),o.forEach((t=>{"willRelease"!==t.releaseStatus&&s.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(i=this._idToPoint)||void 0===i||i.clear(),this._baseMarks=s,this._isCollectionBase="line-data"===this.attribute.type,!s||0===s.length)return;const{data:l}=this.attribute;if(l&&0!==l.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let i=0;i<s.length;i++){const n=s[i],r=Pp(n);if(null==r?void 0:r.length)for(let i=0;i<r.length;i++){const a=l[t];a&&r[i]&&(e.isValid(a.id)||(a.id=`vrender-component-${this.name}-${t}`),this._idToPoint.set(a.id,r[i]),this._idToGraphic.set(a.id,n)),t++}}}else for(let t=0;t<s.length;t++){const i=l[t],n=s[t];i&&n&&(e.isValid(i.id)||(i.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(i.id,n))}!1!==this.attribute.animation&&(this._animationConfig={enter:e.merge({},Ap,this.attribute.animation,null!==(n=this.attribute.animationEnter)&&void 0!==n?n:{}),exit:e.merge({},Ap,this.attribute.animation,null!==(r=this.attribute.animationExit)&&void 0!==r?r:{}),update:e.isArray(this.attribute.animationUpdate)?this.attribute.animationUpdate:e.merge({},Ap,this.attribute.animation,null!==(a=this.attribute.animationUpdate)&&void 0!==a?a:{})})}}getRelatedGraphic(t){return this._idToGraphic.get(t.id)}_layout(t=[]){const{textStyle:i={},position:n,offset:r}=this.attribute,a=[];for(let s=0;s<t.length;s++){const o=t[s],l=this.getRelatedGraphic(o),u=Object.assign(Object.assign({fill:this._isCollectionBase?e.isArray(l.attribute.stroke)?l.attribute.stroke.find((t=>!!t&&!0!==t)):l.attribute.stroke:l.attribute.fill},i),o),h=this._createLabelText(u),d=this.getGraphicBounds(h),c=e.isFunction(n)?n(o):n,f=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(o.id),c):this.getGraphicBounds(l,{x:o.x,y:o.y},c),v=this.labeling(d,f,c,r);v&&(u.x=v.x,u.y=v.y,h.setAttributes(v)),a.push(h)}return a}_overlapping(t){var i,n,r,a;if(0===t.length)return[];const s=this.attribute.overlap,o=[],l=this.getBaseMarkGroup(),u=null!==(i=s.size)&&void 0!==i?i:{width:null!==(n=null==l?void 0:l.AABBBounds.width())&&void 0!==n?n:0,height:null!==(r=null==l?void 0:l.AABBBounds.height())&&void 0!==r?r:0};if(0===u.width||0===u.height)return t;const{avoidBaseMark:h,strategy:d=[],hideOnHit:c=!0,clampForce:f=!0,avoidMarks:v=[],overlapPadding:p}=s,g=this._bmpTool||hp(u.width,u.height),y=this._bitmap||g.bitmap(),b=d.some((t=>"bound"===t.type));h&&(null===(a=this._baseMarks)||void 0===a||a.forEach((t=>{t.AABBBounds&&y.setRange(dp(g,t.AABBBounds,!0))}))),v.length>0&&v.forEach((t=>{e.isString(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&y.setRange(dp(g,t.AABBBounds,!0))})):t.AABBBounds&&y.setRange(dp(g,t.AABBBounds,!0))}));for(let i=0;i<t.length;i++){if(!1===t[i].visible)continue;const n=t[i],r=this.getRelatedGraphic(n.attribute);if(n.update(),!e.isRectIntersect(r.AABBBounds,{x1:0,x2:g.width,y1:0,y2:g.height},!0))continue;if(cp(g,y,n.AABBBounds,f,p)){if(!b){y.setRange(dp(g,n.AABBBounds,!0)),o.push(n);continue}if(b&&(null==r?void 0:r.AABBBounds)&&this._canPlaceInside(n.AABBBounds,null==r?void 0:r.AABBBounds)){y.setRange(dp(g,n.AABBBounds,!0)),o.push(n);continue}}let a=!1;for(let e=0;e<d.length;e++)if(a=vp(g,y,d[e],this.attribute,n,this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t[i].attribute.id)):this.getGraphicBounds(r,t[i].attribute),this.labeling),!1!==a){n.setAttributes({x:a.x,y:a.y}),o.push(n);break}if(!a&&f){const{dx:t=0,dy:e=0}=yp(n,g.width,g.height);if(0===t&&0===e){if(cp(g,y,n.AABBBounds)){y.setRange(dp(g,n.AABBBounds,!0)),o.push(n);continue}}else if(cp(g,y,{x1:n.AABBBounds.x1+t,x2:n.AABBBounds.x2+t,y1:n.AABBBounds.y1+e,y2:n.AABBBounds.y2+e})){n.setAttributes({x:n.attribute.x+t,y:n.attribute.y+e}),y.setRange(dp(g,n.AABBBounds,!0)),o.push(n);continue}}!a&&!c&&o.push(n)}return e.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(y),o}getBaseMarkGroup(){const{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find((e=>e.name===t),!0)}getGraphicBounds(t,e={}){return(null==t?void 0:t.AABBBounds)||{x1:e.x,x2:e.x,y1:e.y,y2:e.y}}_renderLabels(t){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){const i=new Map,n=this._graphicToText||new Map,r=[],a=[];t.forEach(((t,s)=>{var o,l,u,h,d,c,f;const v=this._labelLine(t),p=this.getRelatedGraphic(t.attribute),g=t.attribute.id,y=this._isCollectionBase?g:p,b=(null==n?void 0:n.get(y))?"update":"enter";if("enter"===b){if(r.push(t),i.set(y,v?{text:t,labelLine:v}:{text:t}),p){const{from:e,to:i}=mp(t.attribute,"fadeIn");this.add(t),v&&(this._setStatesOfLabelLine(v),a.push(v),this.add(v)),this._syncStateWithRelatedGraphic(p),this._animationConfig.enter.duration>0&&p.once("animate-bind",(n=>{t.setAttributes(e),v&&v.setAttributes(e);const o=this._afterRelatedGraphicAttributeUpdate(t,r,v,a,s,p,i,this._animationConfig.enter);p.on("afterAttributeUpdate",o)}))}}else if("update"===b){const r=n.get(y);n.delete(y),i.set(y,r);const a=r.text,{duration:s,easing:v}=this._animationConfig.update;!function(t,i,n){if(!e.isArray(n)){const{duration:e,easing:r,increaseEffect:a=!0}=n;return t.animate().to(i.attribute,e,r),void(a&&_p(t,i,e,r))}n.forEach(((n,r)=>{const{duration:a,easing:s,increaseEffect:o=!0,channel:l}=n,{from:u,to:h}=xp(t,i,l,n.options);e.isEmpty(h)||t.animate().to(h,a,s),"text"in u&&"text"in h&&o&&_p(t,i,a,s)}))}(a,t,this._animationConfig.update),r.labelLine&&r.labelLine.animate().to(e.merge({},r.labelLine.attribute,{visible:null===(c=null!==(h=(null===(l=null===(o=t.attribute)||void 0===o?void 0:o.line)||void 0===l?void 0:l.visible)&&(null===(u=t.attribute)||void 0===u?void 0:u.visible))&&void 0!==h?h:null===(d=t.attribute)||void 0===d?void 0:d.visible)||void 0===c||c,points:null===(f=t.attribute)||void 0===f?void 0:f.points}),s,v)}})),n.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(mp(t.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd((()=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)}))})),this._graphicToText=i}_renderWithOutAnimation(t){const e=new Map,i=this._graphicToText||new Map;t.forEach((t=>{var n;const r=this._labelLine(t),a=this.getRelatedGraphic(t.attribute),s=(null==i?void 0:i.get(a))?"update":"enter",o=this._isCollectionBase?t.attribute.id:a;if("enter"===s)e.set(o,r?{text:t,labelLine:r}:{text:t}),this.add(t),r&&this.add(r),this._syncStateWithRelatedGraphic(a);else if("update"===s){const r=i.get(o);i.delete(o),e.set(o,r),r.text.setAttributes(t.attribute),(null==r?void 0:r.labelLine)&&r.labelLine.setAttributes({points:null===(n=t.attribute)||void 0===n?void 0:n.points})}})),i.forEach((t=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)})),this._graphicToText=e}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,n,r,a,s,{mode:o,duration:l,easing:u,delay:h}){const d=c=>{var f,v,p;const{detail:g}=c;if(!g)return{};const y=null===(f=g.animationState)||void 0===f?void 0:f.step;if(!(g.type===mt.ANIMATE_UPDATE&&y&&!("wait"===y.type&&null==(null===(v=y.prev)||void 0===v?void 0:v.type))))return{};if(g.type===mt.ANIMATE_END)return t.setAttributes(s),void(i&&i.setAttributes(s));const b=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",d))};switch(o){case"after":g.animationState.end&&(t.animate({onStart:b}).wait(h).to(s,l,u),i&&i.animate().wait(h).to(s,l,u));break;case"after-all":r===e.length-1&&g.animationState.end&&(e.forEach((t=>{t.animate({onStart:b}).wait(h).to(s,l,u)})),n.forEach((t=>{t.animate().wait(h).to(s,l,u)})));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!a.containsPoint(e.x,e.y,bt.LOCAL,null===(p=this.stage)||void 0===p?void 0:p.pickerService)||(t.animate({onStart:b}).wait(h).to(s,l,u),i&&i.animate().wait(h).to(s,l,u))}else g.animationState.isFirstFrameOfStep&&(t.animate({onStart:b}).wait(h).to(s,l,u),i&&i.animate().wait(h).to(s,l,u))}};return d}_smartInvert(t){var e,i,n,r,a;const s=this.attribute.smartInvert||{},{textType:o,contrastRatiosThreshold:l,alternativeColors:u,mode:h}=s,d=null!==(e=s.fillStrategy)&&void 0!==e?e:"invertBase",c=null!==(i=s.strokeStrategy)&&void 0!==i?i:"base",f=null!==(n=s.brightColor)&&void 0!==n?n:"#ffffff",v=null!==(r=s.darkColor)&&void 0!==r?r:"#000000",p=null!==(a=s.outsideEnable)&&void 0!==a&&a;if("null"!==d||"null"!==c)for(let e=0;e<t.length;e++){const i=t[e];if(!i)continue;const n=this.getRelatedGraphic(i.attribute),r=n.attribute.fill,a=r,s=Pv(i.attribute.fill,r,o,l,u,h),g=Cv(s,f)?f:v;if(p){const t=Ev(d,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=Ev(c,a,s,g);e&&i.setAttributes({stroke:e})}else{if(this._canPlaceInside(i.AABBBounds,null==n?void 0:n.AABBBounds)){const t=Ev(d,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=Ev(c,a,s,g);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:Pv(i.attribute.fill,i.attribute.stroke,o,l,u,h)});continue}const t=Ev(d,a,s,g);t&&i.setAttributes({fill:t});const e=Ev(c,a,s,g);e&&i.setAttributes({stroke:e})}}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}Mp.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class Op extends Mp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Op.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",n=0){return Tp(t,e,i,n)}}Op.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class Ep extends Mp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ep.defaultAttributes,t))}labeling(t,e,i="top",n=0){if(!t||!e)return;const{x1:r,y1:a,x2:s,y2:o}=t,l=Math.abs(s-r),u=Math.abs(o-a),h=Math.abs(e.x2-e.x1),d=Math.abs(e.y2-e.y1);let c=(e.x1+e.x2)/2,f=(e.y1+e.y2)/2,v=0,p=0;switch(i){case"top":case"inside-top":p=-.5;break;case"bottom":case"inside-bottom":p=.5;break;case"left":case"inside-left":v=-.5;break;case"right":case"inside-right":v=.5;break;case"top-right":v=.5,p=-.5;break;case"top-left":v=-.5,p=-.5;break;case"bottom-right":v=.5,p=.5;break;case"bottom-left":v=-.5,p=.5}c+=v*h,f+=p*d;let g=0,y=0;const b=i.includes("inside");switch(i.includes("top")?y=b?1:-1:i.includes("bottom")?y=b?-1:1:i.includes("left")?g=b?1:-1:i.includes("right")&&(g=b?-1:1),i){case"top-right":case"bottom-right":g=-1;break;case"top-left":case"bottom-left":g=1}return{x:c+g*n+g*l/2,y:f+y*n+y*u/2}}}Ep.tag="rect-label",Ep.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class Lp extends Mp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Lp.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if(!t||"line"!==t.type)return super.getGraphicBounds(t,e);const r=(null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)||[e],a="start"===i?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return Cp(t,e,i,n)}}Lp.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Rp{constructor(t,e,i,n,r,a,s,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=n,this.radian=r,this.middleAngle=a,this.innerRadius=s,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class Ip extends Mp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ip.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",n=0){if(t&&e)return{x:0,y:0}}_layout(t=[]){const e=super._layout(t),i=e.map((t=>this.getGraphicBounds(t))),n=Object.assign(Object.assign({},this.attribute.textStyle),{text:"..."}),r=this._createLabelText(n),a=this.getGraphicBounds(r),s=a.x2-a.x1,o=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),t,i,s);for(let i=0;i<t.length;i++){const n=t[i],r=o.find((t=>{var e;return(null===(e=t.refDatum)||void 0===e?void 0:e.id)===n.id})),a={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,maxLineWidth:r.labelLimit,points:(null==r?void 0:r.pointA)&&(null==r?void 0:r.pointB)&&(null==r?void 0:r.pointC)?[r.pointA,r.pointB,r.pointC]:void 0,line:null==r?void 0:r.labelLine};e[i].setAttributes(a)}return e}layoutArcLabels(t,i,n,r,a,s){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=s;let o=0;n.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)})),r.forEach(((t,n)=>{var s,l;const u=this._idToGraphic.get(t.id).attribute,h={x:null!==(s=null==u?void 0:u.x)&&void 0!==s?s:0,y:null!==(l=null==u?void 0:u.y)&&void 0!==l?l:0};if(!e.isNil(r[n])&&!e.isNil(a[n])){const t=r[n]?r[n]:null,e=a[n]?a[n]:{x1:0,x2:0,y1:0,y2:0},s=(u.startAngle+u.endAngle)/2,l=u.endAngle-u.startAngle,c=Bp(u.endAngle-l/2),f=kp(h.x,h.y,u.outerRadius,s),v=kp(h.x,h.y,o+i.line.line1MinLength,s),p=new Rp(t,f,v,c,l,s,u.innerRadius,u.outerRadius,h);p.pointA=kp(h.x,h.y,this.computeDatumRadius(2*h.x,2*h.y,u.outerRadius),p.middleAngle),p.labelSize={width:e.x2-e.x1,height:e.y2-e.y1},1===(d=p.quadrant)||2===d?this._arcRight.set(p.refDatum,p):Sp(p.quadrant)&&this._arcLeft.set(p.refDatum,p)}var d}));const l=Array.from(this._arcLeft.values()),u=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":h.push(...this._layoutInsideLabels(u,i,n)),h.push(...this._layoutInsideLabels(l,i,n));break;default:h.push(...this._layoutOutsideLabels(u,i,n)),h.push(...this._layoutOutsideLabels(l,i,n))}return h}_layoutInsideLabels(t,i,n){var r,a;const s=i,o=s.spaceWidth,l=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:"inside",u=null!==(a=null==s?void 0:s.offsetRadius)&&void 0!==a?a:-o;return t.forEach((t=>{var n,r,a;const{labelSize:h,radian:d}=t,c=t.innerRadius,f=t.outerRadius,v=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(f,h.height);let p;if(d<v)p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=f-t-o}!0!==(null==s?void 0:s.rotate)&&(p=f-o);const g=this._getFormatLabelText(t.refDatum,p);t.labelText=g;const y=Math.min(p,t.labelSize.width),b=this._computeAlign(t,i);let m,x=0;"inside"===l&&(x="left"===b?y:"right"===b?0:y/2),m="inside-inner"===l?c-u+x:f+u-x,t.labelPosition=kp(t.circleCenter.x,t.circleCenter.y,m,t.middleAngle),t.labelLimit=y,e.isGreater(y,0)||(t.labelVisible=!1),t.angle=null!==(r=null===(n=null==i?void 0:i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:t.middleAngle;let _=null!==(a=null==s?void 0:s.offsetAngle)&&void 0!==a?a:0;["inside-inner","inside-outer"].includes(l)&&(_+=Math.PI/2),t.angle+=_})),t}_layoutOutsideLabels(t,i,n){var r,a,s,o,l;const u=null!==(a=null===(r=n[0].attribute)||void 0===r?void 0:r.x)&&void 0!==a?a:0,h=2*(null!==(o=null===(s=n[0].attribute)||void 0===s?void 0:s.y)&&void 0!==o?o:0),d=i.line.line2MinLength,c=i.layout,f=i.spaceWidth;if(t.forEach((t=>{const e=Sp(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+d+f),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==i.coverEnable||"none"===c.strategy){for(const e of t){const{labelPosition:t,labelSize:r}=e;e.labelLimit=r.width,e.pointB=Sp(e.quadrant)?{x:t.x+r.width/2+d+f,y:t.y}:{x:t.x-r.width/2-d-f,y:t.y},this._computeX(e,i,n)}!1===i.coverEnable&&"none"===c.strategy&&this._coverLabels(t)}else{const e=h/((null===(l=i.textStyle)||void 0===l?void 0:l.fontSize)||16);this._adjustY(t,e,i,n);const{minY:r,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:n}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(h,Math.max(n,t.maxY)),t}),{minY:1/0,maxY:-1/0}),s=Math.max(Math.abs(h/2-r),Math.abs(a-h/2)),o=this._computeLayoutRadius(s,i,n);for(const e of t)this._computePointB(e,o,i,n),this._computeX(e,i,n)}const v=2*u;return t.forEach((t=>{var n,r;t.labelVisible&&(e.isLess(t.pointB.x,d+f)||e.isGreater(t.pointB.x,v-d-f))&&(t.labelVisible=!1),t.angle=null!==(r=null===(n=null==i?void 0:i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:0,(null==i?void 0:i.offsetAngle)&&(t.angle+=i.offsetAngle),t.labelLine=Object.assign({},null==i?void 0:i.line)})),t}_computeX(t,i,n){var r;const a=t.circleCenter,s=2*a.x;a.y;let o=0;n.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)}));const l=this.computeLayoutOuterRadius(o,i.width,i.height),u=i.line.line1MinLength,h=i.line.line2MinLength,d=null===(r=i.layout)||void 0===r?void 0:r.align,c=i.spaceWidth,{labelPosition:f,quadrant:v,pointB:p}=t;e.isValidNumber(p.x*p.y)||(t.pointC={x:NaN,y:NaN},f.x=NaN,t.labelLimit=0);const g=this.computeRadius(l,i.width,i.height),y=Sp(v)?-1:1;let b=0;let m=(y>0?s-p.x:p.x)-h-c;"labelLine"===d&&(b=(g+u+h)*y+a.x,m=(y>0?s-b:b)-c);const x=this._getFormatLabelText(t.refDatum,m);t.labelText=x;let _=Math.min(m,t.labelSize.width);switch(d){case"labelLine":break;case"edge":b=y>0?s-_-c:_+c;break;default:b=p.x+y*h}_=Math.max(this._ellipsisWidth,_),t.labelLimit=_,t.pointC={x:b,y:f.y};const A=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);if("edge"===d){const t=0;f.x=(y>0?s+t:t)-y*A}else{const t=0;f.x=b+t+y*(c+A)}}_computeAlign(t,i){var n,r,a,s,o,l;const u=i,h=null!==(r=null===(n=u.textStyle)||void 0===n?void 0:n.textAlign)&&void 0!==r?r:null===(a=u.textStyle)||void 0===a?void 0:a.align,d=null!==(o=null===(s=u.layout)||void 0===s?void 0:s.textAlign)&&void 0!==o?o:null===(l=u.layout)||void 0===l?void 0:l.align;return"inside"!==u.position?e.isNil(h)||"auto"===h?"edge"===d?Sp(t.quadrant)?"left":"right":Sp(t.quadrant)?"right":"left":h:e.isNil(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,i,n,r){var a,s,o,l;s=null===(a=r[0].attribute)||void 0===a?void 0:a.x;const u=2*(null!==(l=null===(o=r[0].attribute)||void 0===o?void 0:o.y)&&void 0!==l?l:0),h=n.layout;if("vertical"===h.strategy){let i,n=0;const r=t.length;if(r<=0)return;for(let a=0;a<r;a++){const{y1:s}=t[a].getLabelBounds();if(i=s-n,e.isLess(i,0)){const e=this._shiftY(t,a,r-1,-i);this._shiftY(t,e,0,i/2)}const{y2:o}=t[a].getLabelBounds();n=o}const{y1:a}=t[0].getLabelBounds();i=a-0,e.isLess(i,0)&&this._shiftY(t,0,r-1,-i);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>u;e--)t[e].labelVisible=!1}else if("none"!==h.strategy){const a=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));a.sort(((t,e)=>e.arc.radian-t.arc.radian)),a.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let s=1/0,o=-1/0;for(let l=0;l<i&&l<t.length;l++){this._storeY(t);const i=a[l].arc;this._computeYRange(i,n,r),i.labelVisible=!0;const d=i.labelPosition.y,{lastIndex:c,nextIndex:f}=this._findNeighborIndex(t,a[l]),v=t[c],p=t[f];if(-1===c&&-1!==f){const e=p.labelPosition.y;d>e?i.labelPosition.y=e-p.labelSize.height/2-i.labelSize.height/2:this._twoWayShift(t,i,p,f)}else if(-1!==c&&-1===f){const e=v.labelPosition.y;d<e?i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2:this._twoWayShift(t,v,i,a[l].originIndex)}else if(-1!==c&&-1!==f){const e=v.labelPosition.y,n=p.labelPosition.y;d>n?(i.labelPosition.y=n-p.labelSize.height/2-i.labelSize.height/2,this._twoWayShift(t,v,i,a[l].originIndex)):d<e?(i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2,this._twoWayShift(t,i,p,f)):(this._twoWayShift(t,v,i,a[l].originIndex),this._twoWayShift(t,i,p,f))}const g=Math.min(s,a[l].originIndex),y=Math.max(o,a[l].originIndex);let b;if(b=t[y].getLabelBounds().y2-u,e.isGreater(b,0)&&this._shiftY(t,y,0,-b),b=t[g].getLabelBounds().y1-0,e.isLess(b,0)&&this._shiftY(t,g,t.length-1,-b),b=t[y].getLabelBounds().y2-u,e.isGreater(b,0)){i.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(i.labelVisible=!1,this._restoreY(t)):(s=g,o=y)}}}_shiftY(t,e,i,n){const r=e<i?1:-1;let a=e;for(;-1!==a;){t[a].labelPosition.y+=n;const e=this._findNextVisibleIndex(t,a,i,r);if(e>=0&&e<t.length){const{y1:i,y2:n}=t[a].getLabelBounds(),{y1:s,y2:o}=t[e].getLabelBounds();if(r>0&&n<s||r<0&&i>o)return a}a=e}return i}_findNextVisibleIndex(t,e,i,n){const r=(i-e)*n;for(let i=1;i<=r;i++){const r=e+i*n;if(t[r].labelVisible)return r}return-1}_computePointB(t,i,n,r){const a=n;let s=0;r.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,n.width,n.height),l=a.line.line1MinLength;if("none"===a.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const r=t.circleCenter,a=this.computeRadius(o,n.width,n.height),{labelPosition:s,quadrant:u}=t,h=i-Math.max(a+l,t.outerRadius),d=Math.sqrt(i**2-Math.abs(r.y-s.y)**2)-h;e.isValidNumber(d)?t.pointB={x:r.x+d*(Sp(u)?-1:1),y:s.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,i,n){const r=t.circleCenter,a={width:2*r.x,height:2*r.y};let s=0;n.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,i.width,i.height),l=i.line.line1MinLength,{width:u,height:h}=a,d=this.computeRadius(o,i.width,i.height),c=this._computeLayoutRadius(h/2,i,n),f=Math.abs(t.center.x-u/2),v=t.center.y-h/2;let p,g,y;if(e.isNumberClose(u/2,f))p=0,g=1,y=-v;else if(e.isNumberClose(h/2,v))p=1,g=0,y=-f;else{const t=-1/(v/f);p=t,g=-1,y=v-t*f}const b=function(t,e,i,n,r,a){if(0===t&&0===e||a<=0)return[];if(0===t){const t=-i/e,s=a**2-(t-r)**2;return s<0?[]:0===s?[{x:n,y:t}]:[{x:Math.sqrt(s)+n,y:t},{x:-Math.sqrt(s)+n,y:t}]}if(0===e){const e=-i/t,s=a**2-(e-n)**2;return s<0?[]:0===s?[{x:e,y:r}]:[{x:e,y:Math.sqrt(s)+r},{x:e,y:-Math.sqrt(s)+r}]}const s=(e/t)**2+1,o=2*((i/t+n)*(e/t)-r),l=o**2-4*s*((i/t+n)**2+r**2-a**2);if(l<0)return[];const u=(-o+Math.sqrt(l))/(2*s),h=(-o-Math.sqrt(l))/(2*s),d=-(e*u+i)/t;return 0===l?[{x:d,y:u}]:[{x:d,y:u},{x:-(e*h+i)/t,y:h}]}(p,g,y,l+d-c,0,c);if(b.length<2)return;let m,x;b[0].x>b[1].x&&b.reverse(),b[0].x<0?e.isNumberClose(b[0].y,b[1].y)?e.isGreater(t.middleAngle,-Math.PI)&&e.isLess(t.middleAngle,0)||e.isGreater(t.middleAngle,Math.PI)&&e.isLess(t.middleAngle,2*Math.PI)?(m=0,x=b[1].y+h/2):(m=b[1].y+h/2,x=h):b[0].y<b[1].y?(m=0,x=b[1].y+h/2):(m=b[1].y+h/2,x=a.height):(m=Math.min(b[0].y,b[1].y)+h/2,x=Math.max(b[0].y,b[1].y)+h/2),t.labelYRange=[m,x]}_computeLayoutRadius(t,e,i){const n=e,r=n.layoutArcGap,a=n.line.line1MinLength;let s=0;i.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+a,u=l-r;return Math.max((u**2+t**2)/(2*u),l)}_findNeighborIndex(t,e){const i=e.originIndex;let n=-1,r=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){n=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){r=e;break}return{lastIndex:n,nextIndex:r}}_twoWayShift(t,i,n,r){const a=n.getLabelBounds().y1-i.getLabelBounds().y2;if(e.isLess(a,0)){const e=this._shiftY(t,r,t.length-1,-a);this._shiftY(t,e,0,a/2)}}_restoreY(t){for(const e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(const i of t){const{labelYRange:t,labelPosition:n}=i;if(i.labelVisible&&t&&(e.isLess(n.y,t[0])||e.isGreater(n.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){const n=t[i].getLabelBounds();wp(e,n)?t[i].labelVisible=!1:e=n}}_labelLine(t){var e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m;return(null===(e=t.attribute)||void 0===e?void 0:e.points)?co.line({visible:null===(o=null!==(a=(null===(n=null===(i=t.attribute)||void 0===i?void 0:i.line)||void 0===n?void 0:n.visible)&&(null===(r=t.attribute)||void 0===r?void 0:r.visible))&&void 0!==a?a:null===(s=t.attribute)||void 0===s?void 0:s.visible)||void 0===o||o,stroke:null!==(d=null===(h=null===(u=null===(l=t.attribute)||void 0===l?void 0:l.line)||void 0===u?void 0:u.style)||void 0===h?void 0:h.stroke)&&void 0!==d?d:null===(c=t.attribute)||void 0===c?void 0:c.fill,lineWidth:null!==(g=null===(p=null===(v=null===(f=t.attribute)||void 0===f?void 0:f.line)||void 0===v?void 0:v.style)||void 0===p?void 0:p.lineWidth)&&void 0!==g?g:1,points:null===(y=t.attribute)||void 0===y?void 0:y.points,curveType:(null===(m=null===(b=t.attribute)||void 0===b?void 0:b.line)||void 0===m?void 0:m.smooth)?"basis":null}):void 0}computeRadius(t,i,n,r){return this.computeLayoutRadius(i||0,n||0)*t*(e.isNil(r)?1:r)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){const n=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*n}}Ip.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,textAlign:"center",textBaseline:"middle"},position:"outside",offset:0,line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0},pickable:!1};class jp extends Mp{constructor(t){super(e.merge({},jp.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if("area"!==t.type)return super.getGraphicBounds(t,e);const r=(null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)||[e],a="start"===i?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return Cp(t,e,i,n)}}jp.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Dp extends Mp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Dp.defaultAttributes,t)),this.name="line-data-label"}labeling(t,e,i="top",n=0){return Tp(t,e,i,n)}}Dp.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};const Np={rect:Ep,symbol:Op,arc:Ip,line:Lp,area:jp,"line-data":Dp};class Up extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Up.defaultAttributes,t)),this.name="data-label"}render(){var t;const{dataLabels:i,size:n}=this.attribute;if(!i||0===i.length)return;const{width:r=0,height:a=0}=n||{};if(!r||!a||!e.isValidNumber(a*r))return;this._componentMap||(this._componentMap=new Map);const s=hp(r,a),o=s.bitmap(),l=new Map,u=this._componentMap;for(let e=0;e<i.length;e++){const n=i[e],r=Np[n.type]||Mp;if(r){const{baseMarkGroupName:i,type:a}=n,u=null!==(t=n.id)&&void 0!==t?t:`${i}-${a}-${e}`;let h=this._componentMap.get(u);h?(h.setBitmapTool(s),h.setBitmap(o),h.setAttributes(n),l.set(u,h)):(h=new r(n),h.setBitmap(o),h.setBitmapTool(s),this.add(h),l.set(u,h))}}u.forEach(((t,e)=>{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}function zp(){ev(),av(),uv(),pv()}Up.defaultAttributes={pickable:!1},zp();class Hp extends rd{getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Hp.defaultAttributes,t)),this.name="segment"}render(){this.removeAllChild(),this._reset();const{startSymbol:t,endSymbol:i,lineStyle:n,state:r,visible:a=!0,multiSegment:s,mainSegmentIndex:o}=this.attribute;if(!a)return;this._computeLineAngle();const l=this._renderSymbol(t,"start"),u=this._renderSymbol(i,"end");if(this.startSymbol=l,this.endSymbol=u,s){const t=[...this.attribute.points];if(e.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const i=this._clipPoints(e.flattenArray(t));t[0][0]=i[0],t[t.length-1][t[t.length-1].length-1]=i[i.length-1]}t.forEach(((t,i)=>{var a,s;const o=co.line(Object.assign(Object.assign({points:t},e.isArray(n)?null!==(a=n[i])&&void 0!==a?a:n[n.length-1]:n),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+i),e.isEmpty(null==r?void 0:r.line)||(o.states=e.isArray(r.line)?null!==(s=r.line[i])&&void 0!==s?s:r.line[r.line.length-1]:r.line),this.add(o)}))}else{const t=co.polygon(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},e.array(n)[0]),{fill:!1,closePath:!1}));t.name=`${this.name}-line`,t.id=this._getNodeId("line"),e.isEmpty(null==r?void 0:r.line)||(t.states=[].concat(r.line)[0]),this.add(t)}}_renderSymbol(t,i){const n=this._getMainSegmentPoints();if(!n.length)return;const{autoRotate:r=!0}=t;let a;if(t&&t.visible){const s=this._startAngle,o=this._endAngle,{state:l}=this.attribute,u=n[0],h=n[n.length-1],{refX:d=0,refY:c=0,refAngle:f=0,style:v,symbolType:p,size:g=12}=t;let y,b;"start"===i?(y={x:u.x+(e.isValidNumber(s)?d*Math.cos(s)+c*Math.cos(s-Math.PI/2):0),y:u.y+(e.isValidNumber(s)?d*Math.sin(s)+c*Math.sin(s-Math.PI/2):0)},b=s+Math.PI/2):(y={x:h.x+(e.isValidNumber(o)?d*Math.cos(o)+c*Math.cos(o-Math.PI/2):0),y:h.y+(e.isValidNumber(o)?d*Math.sin(o)+c*Math.sin(o-Math.PI/2):0)},b=o+Math.PI/2),a=co.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:p,size:g,angle:r?b+f:0,strokeBoundsBuffer:0}),v)),a.name=`${this.name}-${i}-symbol`,a.id=this._getNodeId(`${i}-symbol`),e.isEmpty(null==l?void 0:l.symbol)||(a.states=l.symbol),this.add(a)}return a}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:i,mainSegmentIndex:n}=this.attribute;let r;return r=i?e.isValidNumber(n)?t[n]:e.flattenArray(t):t,this._mainSegmentPoints=r,r}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,r={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),r]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],r=t[t.length-1],a=[e.x-i.x,e.y-i.y],s=Math.atan2(a[1],a[0]),o=[r.x-n.x,r.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=s,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}var Wp,Vp;Hp.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},t.AXIS_ELEMENT_NAME=void 0,(Wp=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",Wp.axisContainer="axis-container",Wp.labelContainer="axis-label-container",Wp.tickContainer="axis-tick-container",Wp.tick="axis-tick",Wp.subTick="axis-sub-tick",Wp.label="axis-label",Wp.title="axis-title",Wp.gridContainer="axis-grid-container",Wp.grid="axis-grid",Wp.gridRegion="axis-grid-region",Wp.line="axis-line",Wp.background="axis-background",Wp.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(Vp=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",Vp.selectedReverse="selected_reverse",Vp.hover="hover",Vp.hoverReverse="hover_reverse";const Fp={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},Gp={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}};class Yp extends rd{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{const i=t.target;i!==this._lastHover&&i.name&&!e.isEmpty(i.states)&&(i.addState(Nv.hover,!0),Sv(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Nv.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(Sv(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Nv.hoverReverse),t.removeState(Nv.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState(Nv.selected))return this._lastSelect=null,void Sv(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Nv.selectedReverse),t.removeState(Nv.selected))}));i.name&&!e.isEmpty(i.states)&&(i.addState(Nv.selected,!0),Sv(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Nv.selectedReverse,!0)})),this._lastSelect=i)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const i=e.cloneDeep(this.attribute);e.merge(this.attribute,t);const n=co.group({x:this.attribute.x,y:this.attribute.y});return this.add(n),this._renderInner(n),this.removeChild(n),this.attribute=i,n.AABBBounds}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=co.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(e){const{title:i,label:n,tick:r,line:a,items:s}=this.attribute,o=co.group({x:0,y:0,zIndex:1});if(o.name=t.AXIS_ELEMENT_NAME.axisContainer,o.id=this._getNodeId("container"),o.setMode(this.mode),this.axisContainer=o,e.add(o),a&&a.visible&&this.renderLine(o),s&&s.length&&(this.data=this._transformItems(s[0]),r&&r.visible&&this.renderTicks(o),n&&n.visible)){const e=co.group({x:0,y:0,pickable:!1});e.name=t.AXIS_ELEMENT_NAME.labelContainer,e.id=this._getNodeId("label-container"),this.axisLabelsContainer=e,o.add(e),s.forEach(((t,i)=>{const n=this.renderLabels(e,t,i),r=n.getChildren();this.beforeLabelsOverlap(r,t,n,i,s.length),this.handleLabelsOverlap(r,t,n,i,s.length),this.afterLabelsOverlap(r,t,n,i,s.length)}))}i&&i.visible&&this.renderTitle(o)}renderTicks(i){const n=this.getTickLineItems(),r=co.group({x:0,y:0,pickable:!1});r.name=t.AXIS_ELEMENT_NAME.tickContainer,r.id=this._getNodeId("tick-container"),i.add(r),n.forEach(((i,a)=>{var s;const o=co.line(Object.assign({},this._getTickLineAttribute("tick",i,a,n)));if(o.name=t.AXIS_ELEMENT_NAME.tick,o.id=this._getNodeId(i.id),e.isEmpty(null===(s=this.attribute.tick)||void 0===s?void 0:s.state))o.states=Uv;else{const t=this.data[a],i=e.merge({},Uv,this.attribute.tick.state);Object.keys(i).forEach((n=>{e.isFunction(i[n])&&(i[n]=i[n](t.rawValue,a,t,this.data))})),o.states=i}r.add(o)})),this.tickLineItems=n;const{subTick:a}=this.attribute;if(a&&a.visible){const i=this.getSubTickLineItems();i.length&&i.forEach(((i,s)=>{const o=co.line(Object.assign({},this._getTickLineAttribute("subTick",i,s,n)));if(o.name=t.AXIS_ELEMENT_NAME.subTick,o.id=this._getNodeId(`${s}`),e.isEmpty(a.state))o.states=Uv;else{const t=e.merge({},Uv,a.state);Object.keys(t).forEach((r=>{e.isFunction(t[r])&&(t[r]=t[r](i.value,s,i,n))})),o.states=t}r.add(o)})),this.subTickLineItems=i}}renderLabels(i,n,r){const{dataFilter:a}=this.attribute.label;a&&e.isFunction(a)&&(n=a(n,r));const s=this._transformItems(n),o=co.group({x:0,y:0,pickable:!1});o.name=`${t.AXIS_ELEMENT_NAME.labelContainer}-layer-${r}`,o.id=this._getNodeId(`label-container-layer-${r}`),i.add(o);let l=0,u=0,h="center",d="middle";return s.forEach(((i,n)=>{var a,c,f,v;const p=this._getLabelAttribute(i,n,s,r);let g;if("rich"===p.type?(p.textConfig=p.text,p.width=null!==(a=p.width)&&void 0!==a?a:0,p.height=null!==(c=p.height)&&void 0!==c?c:0,g=co.richtext(p)):"html"===p.type?(p.textConfig=[],p.html=Object.assign(Object.assign({dom:p.text},zv),p),g=co.richtext(p)):g=co.text(p),g.name=t.AXIS_ELEMENT_NAME.label,g.id=this._getNodeId(`layer${r}-label-${i.id}`),e.isEmpty(null===(f=this.attribute.label)||void 0===f?void 0:f.state))g.states=Uv;else{const t=e.merge({},Uv,this.attribute.label.state);Object.keys(t).forEach((a=>{e.isFunction(t[a])&&(t[a]=t[a](i,n,s,r))})),g.states=t}o.add(g);const y=null!==(v=p.angle)&&void 0!==v?v:0;l=Math.max(l,g.AABBBounds.width()),u=Math.max(u,g.AABBBounds.height()),y&&(l=Math.abs(l*Math.cos(y)),u=Math.abs(u*Math.sin(y))),h=p.textAlign,d=p.textBaseline})),this.axisLabelLayerSize[r]={width:l,height:u,textAlign:h,textBaseline:d},o}renderTitle(e){const i=this.getTitleAttribute(),n=new Fv(Object.assign({},i));n.name=t.AXIS_ELEMENT_NAME.title,n.id=this._getNodeId("title"),e.add(n)}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}getTextAlign(t){let i="center";return e.isNumberClose(t[0],0)?e.isNumberClose(t[1],0)?Object.is(t[1],-0)?i="start":Object.is(t[0],-0)&&(i="end"):i="center":t[0]>0?i="start":t[0]<0&&(i="end"),i}getTickLineItems(){const{tick:t}=this.attribute,i=this.data,n=[],{alignWithLabel:r,inside:a=!1,length:s,dataFilter:o}=t;let l=1;return i.length>=2&&(l=i[1].value-i[0].value),(o&&e.isFunction(o)?o(i):i).forEach((t=>{let i=t.point,o=t.value;if(!r){const e=t.value-l/2;if(this.isInValidValue(e))return;i=this.getTickCoord(e),o=e}const u=this.getVerticalCoord(i,s,a);if("3d"===this.mode){const r=this.getVerticalVector(s,a,i);let l=0,h=0;e.abs(r[0])>e.abs(r[1])?l=e.pi/2*(u.x>i.x?1:-1):h=e.pi/2*(u.y>i.y?-1:1),n.push({start:i,end:u,value:o,id:`tick-${t.id}`,anchor:[i.x,i.y],alpha:l,beta:h})}else n.push({start:i,end:u,value:o,id:`tick-${t.id}`})})),n}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:n=!1,length:r=2}=t,a=this.tickLineItems,s=a.length;if(s>=2)for(let t=0;t<s-1;t++){const s=a[t],o=a[t+1];for(let t=0;t<i;t++){const a=(t+1)/(i+1),l=(1-a)*s.value+a*o.value,u=this.getTickCoord(l),h=this.getVerticalCoord(u,r,n);e.push({start:u,end:h,value:l,id:`sub-tick-${l}`})}}return e}_getTickLineAttribute(t,i,n,r){let a=e.get(this.attribute,`${t}.style`);const s=this.data[n];a=e.isFunction(a)?e.merge({},e.get(Gp,`${t}.style`),"tick"===t?a(s.rawValue,n,s,this.data):a(i.value,n,i,r)):a;const{start:o,end:l,anchor:u,alpha:h,beta:d}=i;return Object.assign({points:[o,l],anchor:u,alpha:h,beta:d},a)}_getLabelAttribute(t,i,n,r){var a,s;const{space:o=4,inside:l=!1,formatMethod:u,type:h="text",text:d}=this.attribute.label;let c=o,f=0;(null===(a=this.attribute.tick)||void 0===a?void 0:a.visible)&&this.attribute.tick.inside===l&&(f=this.attribute.tick.length||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&this.attribute.subTick.inside===l&&(f=Math.max(f,this.attribute.subTick.length||2)),c+=f;const v=this.getRelativeVector(t.point);r>0&&(0===v[1]?c+=(this.axisLabelLayerSize[r-1].height+e.get(this.attribute,"label.space",4))*r:c+=(this.axisLabelLayerSize[r-1].width+e.get(this.attribute,"label.space",4))*r);const p=this.getVerticalCoord(t.point,c,l),g=this.getVerticalVector(c||1,l,p),y=u?u(`${t.label}`,t,i,n,r):t.label;let{style:b}=this.attribute.label;b=e.isFunction(b)?e.merge({},Gp.label.style,b(t,i,n,r)):b;const m=this.getLabelAlign(g,l,b.angle);return b=e.merge(m,b),e.isFunction(b.text)&&(b.text=b.text({label:t.label,value:t.rawValue,index:t.index,layer:r})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(p,g,y,b)),{text:null!=d?d:y,lineHeight:null==b?void 0:b.fontSize,type:h}),b)}getLabelPosition(t,e,i,n){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}}function Xp(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(n=e.centerX,r=e.centerY,a=e.angle,s=t.attribute.x,o=t.attribute.y,{x:(n-s)*Math.cos(a)+(r-o)*Math.sin(a)+s,y:(n-s)*Math.sin(a)+(o-r)*Math.cos(a)+o});var n,r,a,s,o;const l=i.x-e.centerX,u=i.y-e.centerY;e.x1+=l,e.x2+=l,e.y1+=u,e.y2+=u,e.centerX+=l,e.centerY+=u,t.rotatedBounds=e}))}const $p={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,n)=>n&&qp(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function qp(t,e,i){const n=t.AABBBounds,r=e.AABBBounds;return i>Math.max(r.x1-n.x2,n.x1-r.x2,r.y1-n.y2,n.y1-r.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function Kp(t,e){for(let i,n=1,r=t.length,a=t[0];n<r;a=i,++n)if(qp(a,i=t[n],e))return!0}function Zp(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function Jp(t){for(let r=1;r<t.length;r++)if(i=t[r-1],n=t[r],e.isRectIntersect(i.AABBBounds,n.AABBBounds,!1)&&(!i.rotatedBounds||!n.rotatedBounds||e.isRotateAABBIntersect(i.rotatedBounds,n.rotatedBounds,!0)))return!0;var i,n;return!1}function Qp(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},eg(t,e.attribute.angle)),{angle:tg(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},ig(t,e.attribute.angle)),{angle:tg(e.attribute.angle)}))}))}(t,e),Xp(e)}function tg(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function eg(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],n=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],n=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const r=(e=tg(e))/(.5*Math.PI);let a;return a=r===Math.floor(r)?2*Math.floor(r):2*Math.floor(r)+1,{textAlign:i[a],textBaseline:n[a]}}function ig(t,e=0){let i=["right","right","center","left","center","left","center","right","right"],n=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","right","right","right","left","left","left","left","right"],n=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]);const r=(e=tg(e))/(.5*Math.PI);let a;return a=r===Math.floor(r)?2*Math.floor(r):2*Math.floor(r)+1,{textAlign:i[a],textBaseline:n[a]}}class ng{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:n=1}=this.attribute,r=function(t){const[e,i]=t;let n=e*e+i*i;return n>0&&(n=1/Math.sqrt(n)),[t[0]*n,t[1]*n]}(this.getRelativeVector());return Lv([r[1],-1*r[0]],t*(e?1:-1)*n)}}function rg(){ev(),av(),fv(),yv()}rg(),dv();class ag extends Yp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ag.defaultAttributes,t),i)}_renderInner(i){var n;super._renderInner(i);const{panel:r}=this.attribute;if(r&&r.visible){const i=this.axisContainer,a=i.AABBBounds,s=co.rect(Object.assign({x:a.x1,y:a.y1,width:a.width(),height:a.height()},r.style));s.name=t.AXIS_ELEMENT_NAME.background,s.id=this._getNodeId("background"),s.states=e.merge({},Fp,null!==(n=r.state)&&void 0!==n?n:{}),i.insertBefore(s,i.firstChild)}}renderLine(i){const{start:n,end:r,line:a}=this.attribute,s=a,{startSymbol:o,endSymbol:l,style:u,breakRange:h,breakShape:d,breakShapeStyle:c,state:f}=s,v=Av(s,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),p=Object.assign({points:[n,r],startSymbol:o,endSymbol:l,lineStyle:u},v);e.isEmpty(f)||(p.state={line:e.merge({},Fp,f),symbol:e.merge({},Fp,f)});const g=new Hp(p);g.name=t.AXIS_ELEMENT_NAME.line,g.id=this._getNodeId("line"),i.add(g)}getTitleAttribute(){var t,i,n;const r=this.attribute.title,{position:a="middle",space:s=4,textStyle:o={},autoRotate:l=!0,shape:u,background:h,state:d={}}=r,c=Av(r,["position","space","textStyle","autoRotate","shape","background","state"]);let f=.5;"start"===a?f=0:"end"===a&&(f=1);const{verticalFactor:v=1}=this.attribute,p=-1*v,g=this.getTickCoord(f),y=this.getRelativeVector();let b=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+e.get(this.attribute,"label.space",4);b+=t;const i=Object.keys(this.axisLabelLayerSize).length;if(0===y[1]){const e=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(e)?b+=e+(i-1)*t:b=0}else{if(0===y[0]){const e=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.width():0;isFinite(e)?b+=e+(i-1)*t:b=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{b+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const e=this.axisLabelLayerSize[0].textAlign,n="start"===e||"left"===e,r="center"===e,a=y[1]>0;b=1===p?a?n?b:r?b/2:t:n?t:r?b/2:b:a?n?t:r?b/2:b:n?b:r?b/2:t}}let m=0;(null===(i=this.attribute.tick)||void 0===i?void 0:i.visible)&&!1===this.attribute.tick.inside&&(m=this.attribute.tick.length||4),(null===(n=this.attribute.subTick)||void 0===n?void 0:n.visible)&&!1===this.attribute.subTick.inside&&(m=Math.max(m,this.attribute.subTick.length||2));const x=m+b+s,_=this.getVerticalCoord(g,x,!1),A=this.getVerticalVector(x,!1,{x:0,y:0});let k,B,{angle:S}=c;if(k="start"===a?"start":"end"===a?"end":"center",e.isNil(S)&&l){S=Rv(y,[1,0],!0);const{verticalFactor:t=1}=this.attribute;B=1===-1*t?"bottom":"top"}else k=this.getTextAlign(A),B=this.getTextBaseline(A,!1);const w=Object.assign(Object.assign(Object.assign({},_),c),{textStyle:Object.assign({textAlign:k,textBaseline:B},o),state:{text:e.merge({},Fp,d.text),shape:e.merge({},Fp,d.shape),panel:e.merge({},Fp,d.background)}});return w.angle=S,u&&u.visible&&(w.shape=Object.assign({visible:!0},u.style),u.space&&(w.space=u.space)),h&&h.visible&&(w.panel=Object.assign({visible:!0},h.style)),w}getTextBaseline(t,i){let n="middle";const{verticalFactor:r=1}=this.attribute,a=(i?1:-1)*r;return e.isNumberClose(t[1],0)?n=!e.isNumberClose(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===a?"bottom":"top":t[1]>0?n="top":t[1]<0&&(n="bottom"),n}getLabelAlign(t,i,n){const r=this.attribute.orient;if(e.isValidNumber(n)||0===t[0]&&0===t[1]){if("top"===r||"bottom"===r)return eg(r,n);if("left"===r||"right"===r)return ig(r,n)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,i)}}beforeLabelsOverlap(t,i,n,r,a){const{flush:s=!1}=this.attribute.label||{};if(s&&t.length){const{orient:i,start:n,end:r}=this.attribute,a="bottom"===i||"top"===i,s=t[0],o=e.last(t),l=a?s.attribute.x>o.attribute.x:s.attribute.y<o.attribute.y;if(a)if(l){const t=r.x,e=n.x,i=s.AABBBounds.x2,a=o.AABBBounds.x1;i>t&&s.setAttributes({x:t,textAlign:"right"}),a<e&&o.setAttributes({x:e,textAlign:"left"})}else{const t=n.x,e=r.x,i=s.AABBBounds.x1,a=o.AABBBounds.x2;i<t&&s.setAttributes({x:t,textAlign:"left"}),a>e&&o.setAttributes({x:e,textAlign:"right"})}else if(l){const t=s.AABBBounds.y1,e=o.AABBBounds.y2,i=n.y,a=r.y;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>a&&o.setAttributes({y:a,textBaseline:"bottom"})}else{const t=r.y,e=n.y,i=s.AABBBounds.y2,a=o.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),a<e&&o.setAttributes({y:e,textBaseline:"top"})}}}handleLabelsOverlap(t,i,n,r,a){if(e.isEmpty(t))return;const{verticalLimitSize:s,label:o,orient:l}=this.attribute,u=this._getAxisLabelLimitLength(s,a),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:f,limitEllipsis:v,autoHide:p,autoHideMethod:g,autoHideSeparation:y}=o;e.isFunction(h)?h(t,i,r,this):(d&&function(t,i){if(e.isEmpty(t))return;const{orient:n,labelRotateAngle:r=[0,45,90]}=i;if(0===r.length||t.some((t=>!!t.attribute.angle)))return;let a=0,s=0;for(r&&r.length>0&&(s=r.length);a<s;){const i=r[a++];if(t.forEach((t=>{t.attribute.angle=e.degreeToRadian(i)})),Qp(n,t),!Jp(t))break}}(t,{labelRotateAngle:c,orient:l}),f&&e.isValidNumber(u)&&u>0&&function(t,i){const{limitLength:n,ellipsis:r="...",orient:a}=i;!e.isEmpty(t)&&e.isValidNumber(n)&&t.forEach((t=>{if(("top"===a||"bottom"===a)&&Math.floor(t.AABBBounds.height())<=n)return;if(("left"===a||"right"===a)&&Math.floor(t.AABBBounds.width())<=n)return;let i=0===t.attribute.angle||e.isNil(t.attribute.angle)?"top"===a||"bottom"===a?null:n:Math.abs(n/Math.sin(t.attribute.angle));e.isValidNumber(t.attribute.maxLineWidth)&&(i=e.isValidNumber(i)?Math.min(t.attribute.maxLineWidth,i):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:i,ellipsis:t.attribute.ellipsis||r})}))}(t,{limitLength:u,ellipsis:v,orient:l}),p&&function(t,i){if(e.isEmpty(t))return;const n=t.filter(Zp);if(e.isEmpty(n))return;let r;r=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(n),Xp(r);const{method:a="parity",separation:s=0}=i,o=e.isFunction(a)?a:$p[a]||$p.parity;if(r.length>=3&&Kp(r,s)){do{r=o(r,s)}while(r.length>=3&&Kp(r,s));r.length<3&&!e.last(n).attribute.opacity&&r.length>1&&(e.last(r).setAttribute("opacity",0),e.last(n).setAttribute("opacity",1))}n.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:l,method:g,separation:y}))}afterLabelsOverlap(i,n,r,a,s){const{verticalLimitSize:o,orient:l}=this.attribute,u="bottom"===l||"top"===l,h=r.AABBBounds;let d=u?h.height():h.width();const{verticalMinSize:c}=this.attribute;if(e.isValidNumber(c)&&(!e.isValidNumber(o)||c<=o)){const e=this._getAxisLabelLimitLength(c,s);let i,n;d=Math.max(d,e),"left"===l?(i=h.x2-d,n=h.y1):"right"===l?(i=h.x1,n=h.y1):"top"===l?(i=h.x1,n=h.y2-d):"bottom"===l&&(i=h.x1,n=h.y1);const a=co.rect({x:i,y:n,width:u?h.width():d,height:u?d:h.height(),pickable:!1});a.name=t.AXIS_ELEMENT_NAME.axisLabelBackground,a.id=this._getNodeId("axis-label-background"),r.insertBefore(a,r.firstChild)}if(e.isValid(this.attribute.label.containerAlign)){let t;"left"===l?t=h.x2:"right"===l?t=h.x1:"top"===l?t=h.y2:"bottom"===l&&(t=h.y1),function(t,e,i,n,r){if("right"===n||"left"===n){if("left"===r){const r="right"===n?0:-1;t.forEach((t=>{t.setAttributes({x:e+i*r,textAlign:"left"})}))}else if("right"===r){const r="right"===n?1:0;t.forEach((t=>{t.setAttributes({x:e+i*r,textAlign:"right"})}))}else if("center"===r){const r="right"===n?1:-1;t.forEach((t=>{t.setAttributes({x:e+.5*i*r,textAlign:"center"})}))}}else if("bottom"===n||"top"===n)if("top"===r){const r="bottom"===n?0:-1;t.forEach((t=>{t.setAttributes({y:e+i*r,textBaseline:"top"})}))}else if("bottom"===r){const r="bottom"===n?1:0;t.forEach((t=>{t.setAttributes({y:e+i*r,textBaseline:"bottom"})}))}else if("middle"===r){const r="bottom"===n?1:-1;t.forEach((t=>{t.setAttributes({y:e+.5*i*r,textBaseline:"middle"})}))}}(i,t,d,l,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,i){var n,r,a;const{label:s,title:o,line:l,tick:u}=this.attribute,h=null!==(n=s.space)&&void 0!==n?n:4;let d=t,c=0,f=0;const v=l&&l.visible?null!==(r=l.style.lineWidth)&&void 0!==r?r:1:0,p=u&&u.visible?null!==(a=u.length)&&void 0!==a?a:4:0;if(o&&o.visible&&"string"==typeof o.text){c=Wv(o.text,o.textStyle).height;const t=e.normalizePadding(o.padding);f=o.space+t[0]+t[2]}return d&&(d=(d-h-f-c-v-p)/i),d}}ag.defaultAttributes=Gp,e.mixin(ag,ng);class sg{isInValidValue(t){const{startAngle:e=Iv,endAngle:i=jv}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:i=Iv,endAngle:n=jv,center:r,radius:a,inside:s=!1,innerRadius:o=0}=this.attribute,l=i+(n-i)*t;return e.polarToCartesian(r,s&&o>0?o:a,l)}getVerticalVector(t,e=!1,i){const{inside:n=!1}=this.attribute,{center:r}=this.attribute,a=[i.x-r.x,i.y-r.y];return Lv(a,(e?-1:1)*(n?-1:1)*t/function(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}(a))}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}const og=(t=0)=>{if(t<0)for(;t<0;)t+=e.tau;else if(t>0)for(;t>e.tau;)t-=e.tau;return t};function lg(t,i,n){return!e.isLess(t,i,0,1e-6)&&!e.isGreater(t,n,0,1e-6)}rg(),Qf();class ug extends Yp{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ug.defaultAttributes,t))}renderLine(i){const{startAngle:n=Iv,endAngle:r=jv,radius:a,center:s,innerRadius:o=0,line:l={},inside:u=!1}=this.attribute;let h=a,d=o;u&&o>0&&(h=o,d=0);const c=Object.assign(Object.assign(Object.assign({},s),{startAngle:n,endAngle:r,radius:h,innerRadius:d}),l.style),f=co.circle(c);f.name=t.AXIS_ELEMENT_NAME.line,f.id=this._getNodeId("line"),e.isEmpty(l.state)||(f.states=e.merge({},Fp,l.state)),i.add(f)}getTitleAttribute(){var t,i,n;const{center:r,radius:a,innerRadius:s=0}=this.attribute,o=this.attribute.title,{space:l=4,textStyle:u={},shape:h,background:d,state:c={}}=o,f=Av(o,["space","textStyle","shape","background","state"]);let v=r,p=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside&&(p=e.get(this.attribute.label,"style.fontSize",12)+e.get(this.attribute.label,"space",4));let g=0;(null===(i=this.attribute.tick)||void 0===i?void 0:i.visible)&&!1===this.attribute.tick.inside&&(g=this.attribute.tick.length||4),(null===(n=this.attribute.subTick)||void 0===n?void 0:n.visible)&&!1===this.attribute.subTick.inside&&(g=Math.max(g,this.attribute.subTick.length||2));const y=a+g+p+l;let b="middle",{position:m}=this.attribute.title;e.isNil(m)&&(m=0===s?"end":"middle"),"start"===m?(b="bottom",v={x:r.x,y:r.y-y}):"end"===m&&(b="top",v={x:r.x,y:r.y+y});const x=Object.assign(Object.assign(Object.assign({},v),f),{textStyle:Object.assign({textBaseline:b,textAlign:"center"},u),state:{text:e.merge({},Fp,c.text),shape:e.merge({},Fp,c.shape),panel:e.merge({},Fp,c.background)}}),{angle:_}=f;return x.angle=_,h&&h.visible&&(x.shape=Object.assign({visible:!0},h.style),h.space&&(x.space=h.space)),d&&d.visible&&(x.panel=Object.assign({visible:!0},d.style)),x}getSubTickLineItems(){var t,e;const{subTick:i}=this.attribute,n=[],{count:r=4,inside:a=!1,length:s=2}=i,o=this.tickLineItems,l=o.length;if(l>=2){const i=this.data[1].value-this.data[0].value,u=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t<l;t++){const e=o[t],l=o[t+1];for(let t=0;t<r;t++){const o=(t+1)/(r+1),h=(1-o)*e.value+o*(l?l.value:u?1:e.value+i),d=this.getTickCoord(h),c=this.getVerticalCoord(d,s,a);n.push({start:d,end:c,value:h})}}}return n}getTextBaseline(t){let i="middle";return e.isNumberClose(t[1],0)?i="middle":t[1]>0&&t[1]>Math.abs(t[0])?i="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(i="bottom"),i}beforeLabelsOverlap(t,e,i,n,r){}handleLabelsOverlap(t,e,i,n,r){}afterLabelsOverlap(t,e,i,n,r){}getLabelAlign(t,e,i){return{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,n){return function(t,e,i,n){const r=fo(Object.assign({text:i},n)),a=r.width(),s=r.height(),o=og(Math.atan2(e[1],e[0]))-Math.PI,l=3*Math.PI/4,u=Math.PI/4,h=Math.PI/2,d=t.x;let c=0;c=lg(o,-l,-u)?((o+l)/h-.5)*a:lg(o,u,l)?(.5-(o-u)/h)*a:Math.cos(o)>=0?.5*a:.5*-a;const f=d-c,v=t.y;let p=0;return p=lg(o,-l,-u)?.5*-s:lg(o,u,l)?.5*s:Math.cos(o)>=0?(.5-(u-o)/h)*s:(.5-og(o-l)/h)*s,{x:f,y:v-p}}(t,e,i,n)}}ug.defaultAttributes=Gp,e.mixin(ug,sg);function hg(t,e){let i="";return 0===t.length||(t.forEach(((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function dg(t,i,n,r){let a="";if(!t||0===i.length)return a;const s=i[0],o=e.PointService.distancePP(t,s),l=n?0:1;return r?a+=`M${t.x},${t.y-o}A${o},${o},0,0,${l},${t.x},${t.y+o}A${o},${o},0,0,${l},${t.x},${t.y-o}Z`:i.forEach(((t,e)=>{0===e?a=`M${t.x},${t.y}`:a+=`A${o},${o},0,0,${l},${t.x},${t.y}`})),a}function cg(t,i,n){const{type:r,closed:a}=n,s=i.slice(0).reverse();let o="",l="";if("line"===r&&n.smoothLink&&n.center){const i=t[0],r=s[0],u=n.center;o=hg(t,!!a),l=hg(s,!!a);const h=e.PointService.distancePP(r,u),d=e.PointService.distancePP(i,u);o+=`A${h},${h},0,0,1,${r.x},${r.y}L${r.x},${r.y}`,l+=`A${d},${d},0,0,0,${i.x},${i.y}`}else if("circle"===r){const{center:e}=n;o=dg(e,t,!1,!!a),l=dg(e,s,!0,!!a)}else"line"!==r&&"polygon"!==r||(o=hg(t,!!a),l=hg(s,!!a));return a?o+=l:(l="L"+l.substring(1),o+=l,o+="Z"),o}class fg extends rd{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=co.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(i,n){const r=e.merge({},this.attribute,this.getGridAttribute(i)),{type:a,items:s,style:o,closed:l,alternateColor:u,depth:h=0}=r,d=i?`${t.AXIS_ELEMENT_NAME.grid}-sub`:`${t.AXIS_ELEMENT_NAME.grid}`;if(s.forEach(((t,i)=>{const{id:r,points:s}=t;let u="";if("line"===a||"polygon"===a)u=hg(s,!!l);else if("circle"===a){const{center:t}=this.attribute;u=dg(t,s,!1,!!l)}const c=co.path(Object.assign({path:u,z:h},e.isFunction(o)?e.merge({},this.skipDefault?null:fg.defaultAttributes.style,o(t,i)):o));c.name=`${d}-line`,c.id=this._getNodeId(`${d}-path-${r}`),n.add(c)})),h&&"line"===a&&s.forEach(((t,i)=>{const{id:r,points:a}=t,s=[];s.push(a[0]);const u=a[1].x-a[0].x,c=a[1].y-a[0].y,f=Math.sqrt(u*u+c*c),v=h/f;s.push({x:a[0].x+u*v,y:a[0].y+c*v});const p=hg(s,!!l),g=e.abs(s[0].x-s[1].x),y=e.abs(s[0].y-s[1].y),b=co.path(Object.assign({path:p,z:0,alpha:g>y?(a[1].x-a[0].x>0?-1:1)*e.pi/2:0,beta:g<y?-e.pi/2:0,anchor3d:g>y?[s[0].x,0]:[0,s[0].y]},e.isFunction(o)?e.merge({},this.skipDefault?null:fg.defaultAttributes.style,o(t,i)):o));b.name=`${d}-line`,b.id=this._getNodeId(`${d}-path-${r}`),n.add(b)})),s.length>1&&u){const t=e.isArray(u)?u:[u,"transparent"],i=e=>t[e%t.length];for(let t=0;t<s.length-1;t++){const[e,a]=[s[t].points,s[t+1].points],o=cg(e,a,r),l=co.path({path:o,fill:i(t)});l.name=`${d}-region`,l.id=this._getNodeId(`${d}-region-${t}`),n.add(l)}}}_getNodeId(t){return`${this.id}-${t}`}}fg.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}},ev(),ov();class vg extends fg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},fg.defaultAttributes,t),i)}_getGridPoint(t,i){let n;if("line"===t){const{length:t}=this.attribute;n=[i,this.getVerticalCoord(i,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:r=6,startAngle:a=Iv,endAngle:s=jv}=this.attribute;n=function(t,i,n,r,a){const s=[],o=a-r;for(let a=0;a<i;a++){const l=r+a*o/i;s.push(e.polarToCartesian(t,n,l))}return s}(t,r,e.PointService.distancePP(t,i),a,s)}return n}getGridAttribute(t){const{type:i,alignWithLabel:n=!0}=this.attribute;let r=1;let a;this.data.length>=2&&(r=this.data[1].value-this.data[0].value);let s=[];if(t){a=e.merge({},this.attribute,this.attribute.subGrid);const t=[],{count:o=4}=this.attribute.subGrid||{};if(this.data.length>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!n){const e=t.value-r/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let n=0;n<e.length-1;n++){const r=e[n],a=e[n+1];t.push({id:`sub-${n}-0`,points:this._getGridPoint(i,this.getTickCoord(r.value)),datum:{}});for(let e=0;e<o;e++){const s=(e+1)/(o+1),l=(1-s)*r.value+s*a.value,u=this.getTickCoord(l);t.push({id:`sub-${n}-${e+1}`,points:this._getGridPoint(i,u),datum:{}})}n===e.length-2&&t.push({id:`sub-${n}-${o+1}`,points:this._getGridPoint(i,this.getTickCoord(a.value)),datum:{}})}s=t}}else{a=this.attribute;const t=[];this.data.forEach((e=>{let{point:a}=e;if(!n){const t=e.value-r/2;if(this.isInValidValue(t))return;a=this.getTickCoord(t)}t.push({id:e.label,datum:e,points:this._getGridPoint(i,a)})})),s=t}return Object.assign(Object.assign({},a),{items:s})}}e.mixin(vg,ng),ev(),ov();class pg extends fg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},fg.defaultAttributes,t),i)}getGridAttribute(t){let i,n=[];const r=this.attribute,{radius:a,innerRadius:s=0,startAngle:o=Iv,endAngle:l=jv,center:u,subGrid:h}=r,d=Av(r,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:c=!0}=d||{},f=a-s;let v=1;if(this.data.length>=2&&(v=this.data[1].value-this.data[0].value),t){i=e.merge({},d,h);const t=[],{count:r=4}=h||{},a=this.data.length;if(a>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!c){const e=t.value-v/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let i=0;i<a;i++){const n=e[i],a=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(n.value),this.getVerticalCoord(this.getTickCoord(n.value),f,!0)],datum:{}});for(let e=0;e<r;e++){const s=(e+1)/(r+1),o=(1-s)*n.value+s*(a?a.value:c?1:n.value+v),l=this.getTickCoord(o),u=this.getVerticalCoord(l,f,!0);t.push({id:`sub-${i}-${e+1}`,points:[l,u],datum:{}})}}Math.abs(l-o)%(2*Math.PI)==0&&t.push(t[0]),n=t}}else{i=d;const t=[];let e;e=Math.abs(l-o)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,e.forEach((e=>{let{point:i}=e;if(!c){const t=e.value-v/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const n=this.getVerticalCoord(i,f,!0);t.push({id:e.id,points:[i,n],datum:e})})),n=t}return Object.assign(Object.assign({},i),{items:n,center:u,type:"line"})}}e.mixin(pg,sg);const gg="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",yg={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:gg,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:gg,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},bg={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var mg;t.DataZoomActiveTag=void 0,(mg=t.DataZoomActiveTag||(t.DataZoomActiveTag={})).startHandler="startHandler",mg.endHandler="endHandler",mg.middleHandler="middleHandler",mg.background="background";const xg={debounce:e.debounce,throttle:e.throttle};Vv(),dv(),pv(),Zf(),av();class _g extends rd{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},_g.defaultAttributes,i)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=t=>t,this._onHandlerPointerDown=(e,i)=>{e.stopPropagation(),"start"===i?(this._activeTag=t.DataZoomActiveTag.startHandler,this._activeItem=this._startHandlerMask):"end"===i?(this._activeTag=t.DataZoomActiveTag.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===i?(this._activeTag=t.DataZoomActiveTag.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===i?(this._activeTag=t.DataZoomActiveTag.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===i&&(this._activeTag=t.DataZoomActiveTag.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(e),this._activeCache.lastPos=this.eventPosToStagePos(e),"browser"===wh.env&&(wh.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._onHandlerPointerMove=xg[this.attribute.delayType]((e=>{e.stopPropagation();const{start:i,end:n,brushSelect:r,realTime:a=!0}=this.attribute,s=this.eventPosToStagePos(e),{attPos:o,max:l}=this._layoutCache,u=(s[o]-this._activeCache.lastPos[o])/l;let{start:h,end:d}=this.state;this._activeState&&(this._activeTag===t.DataZoomActiveTag.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+u):this._activeTag===t.DataZoomActiveTag.startHandler?h+u>d?(h=d,d=h+u,this._activeTag=t.DataZoomActiveTag.endHandler):h+=u:this._activeTag===t.DataZoomActiveTag.endHandler&&(d+u<h?(d=h,h=d+u,this._activeTag=t.DataZoomActiveTag.startHandler):d+=u),this._activeCache.lastPos=s,r&&this.renderDragMask()),h=Math.min(Math.max(h,0),1),d=Math.min(Math.max(d,0),1),i===h&&n===d||(this.setStateAttr(h,d,!0),this._dispatchEvent("change",{start:h,end:d,tag:this._activeTag}))}),this.attribute.delayTime);const{start:r,end:a,size:s,orient:o,showDetail:l,position:u,previewData:h,previewPointsX:d,previewPointsY:c,previewPointsX1:f,previewPointsY1:v,updateStateCallback:p}=this.attribute,{width:g,height:y}=s;r&&(this.state.start=r),a&&(this.state.end=a),this._spanCache=this.state.end-this.state.start,this._isHorizontal="top"===o||"bottom"===o,this._layoutCache.max=this._isHorizontal?g:y,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",this._activeCache.startPos=u,this._activeCache.lastPos=u,this._showText="auto"!==l&&l,h&&(this._previewData=h),e.isFunction(d)&&(this._previewPointsX=d),e.isFunction(c)&&(this._previewPointsY=c),e.isFunction(f)&&(this._previewPointsX1=f),e.isFunction(v)&&(this._previewPointsY1=v)}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:n=!1,minSpan:r=0,maxSpan:a=1}=this.attribute,s=e-t;s!==this._spanCache&&(n||s<r||s>a)||(this._spanCache=s,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){var e,i;const{x:n,y:r}=wh.mapToCanvasPoint(t);return{x:n-((null===(e=this.stage)||void 0===e?void 0:e.x)||0),y:r-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}_onHandlerPointerUp(e){e.preventDefault();const{start:i,end:n,brushSelect:r,realTime:a=!0}=this.attribute;if(this._activeState&&this._activeTag===t.DataZoomActiveTag.background){const t=this.eventPosToStagePos(e);this.backgroundDragZoom(this._activeCache.startPos,t)}this._activeState=!1,r&&this.renderDragMask(),a&&i===this.state.start&&n===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),"browser"===wh.env&&(wh.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.removeEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:n}=this._layoutCache,{position:r}=this.attribute,a=t[i]-r[i],s=e[i]-r[i],o=Math.min(Math.max(Math.min(a,s)/n,0),1),l=Math.min(Math.max(Math.max(a,s)/n,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:i}=this.attribute,{position:n,width:r,height:a}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,n.x,n.x+r),y:n.y,width:this._activeState&&this._activeTag===t.DataZoomActiveTag.background&&Math.abs(this.dragMaskSize())||0,height:a},i),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:n.x,y:e.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,n.y,n.y+a),width:r,height:this._activeState&&this._activeTag===t.DataZoomActiveTag.background&&Math.abs(this.dragMaskSize())||0},i),"rect")}renderText(){const{startTextStyle:t,endTextStyle:i}=this.attribute,{formatMethod:n}=t,r=Av(t,["formatMethod"]),{formatMethod:a}=i,s=Av(i,["formatMethod"]),{start:o,end:l}=this.state;this._startValue=this._statePointToData(o),this._endValue=this._statePointToData(l);const{position:u,width:h,height:d}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:n?n(this._startValue):this._startValue,x:u.x+o*h,y:u.y+d/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:a?a(this._endValue):this._endValue,x:u.x+l*h,y:u.y+d/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${u}`)):(this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:n?n(this._startValue):this._startValue,x:u.x+h/2,y:u.y+o*d,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:a?a(this._endValue):this._endValue,x:u.x+h/2,y:u.y+l*d,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${u}`))}getLayoutAttrFromConfig(){var t,e,i,n;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:r,size:a,orient:s,middleHandlerStyle:o={},startHandlerStyle:l={},endHandlerStyle:u={}}=this.attribute,{width:h,height:d}=a,c=null!==(e=null===(t=o.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let f,v,p;o.visible?this._isHorizontal?(f=h,v=d-c,p={x:r.x,y:r.y+c}):(f=h-c,v=d,p={x:r.x+("left"===s?c:0),y:r.y}):(f=h,v=d,p=r);const g=null!==(i=l.size)&&void 0!==i?i:this._isHorizontal?v:f,y=null!==(n=u.size)&&void 0!==n?n:this._isHorizontal?v:f;return l.visible&&(this._isHorizontal?(f-=(g+y)/2,p={x:p.x+g/2,y:p.y}):(v-=(g+y)/2,p={x:p.x,y:p.y+g})),this._layoutAttrFromConfig={position:p,width:f,height:v},this._layoutAttrFromConfig}render(){var t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y;this._layoutAttrFromConfig=null;const{orient:b,backgroundStyle:m,backgroundChartStyle:x={},selectedBackgroundStyle:_={},selectedBackgroundChartStyle:A={},middleHandlerStyle:k={},startHandlerStyle:B={},endHandlerStyle:S={},brushSelect:w}=this.attribute,{start:T,end:P}=this.state,{position:C,width:M,height:O}=this.getLayoutAttrFromConfig(),E=null!==(t=B.triggerMinSize)&&void 0!==t?t:40,L=null!==(e=S.triggerMinSize)&&void 0!==e?e:40,R=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=R,this._background=R.createOrUpdateChild("background",Object.assign({x:C.x,y:C.y,width:M,height:O,cursor:w?"crosshair":"auto"},m),"rect"),(null===(i=x.line)||void 0===i?void 0:i.visible)&&this.setPreviewAttributes("line",R),(null===(n=x.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",R),w&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=R.createOrUpdateChild("selectedBackground",Object.assign({x:C.x+T*M,y:C.y,width:(P-T)*M,height:O,cursor:w?"crosshair":"move"},_),"rect"):this._selectedBackground=R.createOrUpdateChild("selectedBackground",Object.assign({x:C.x,y:C.y+T*O,width:M,height:(P-T)*O,cursor:w?"crosshair":"move"},_),"rect"),(null===(r=A.line)||void 0===r?void 0:r.visible)&&this.setSelectedPreviewAttributes("line",R),(null===(a=A.area)||void 0===a?void 0:a.visible)&&this.setSelectedPreviewAttributes("area",R),this._showText&&this.renderText(),this._isHorizontal){if(k.visible){const t=(null===(s=k.background)||void 0===s?void 0:s.size)||10;this._middleHandlerRect=R.createOrUpdateChild("middleHandlerRect",Object.assign({x:C.x+T*M,y:C.y-t,width:(P-T)*M,height:t},null===(o=k.background)||void 0===o?void 0:o.style),"rect"),this._middleHandlerSymbol=R.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:C.x+(T+P)/2*M,y:C.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(u=null===(l=k.icon)||void 0===l?void 0:l.symbolType)&&void 0!==u?u:"square"},k.icon),"symbol")}this._startHandler=R.createOrUpdateChild("startHandler",Object.assign(Object.assign({x:C.x+T*M,y:C.y+O/2,size:O,symbolType:null!==(h=B.symbolType)&&void 0!==h?h:"square"},bg.horizontal),B),"symbol"),this._endHandler=R.createOrUpdateChild("endHandler",Object.assign(Object.assign({x:C.x+P*M,y:C.y+O/2,size:O,symbolType:null!==(d=S.symbolType)&&void 0!==d?d:"square"},bg.horizontal),S),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),E),e=Math.max(this._startHandler.AABBBounds.height(),E),i=Math.max(this._endHandler.AABBBounds.width(),L),n=Math.max(this._endHandler.AABBBounds.height(),L);this._startHandlerMask=R.createOrUpdateChild("startHandlerMask",Object.assign({x:C.x+T*M-t/2,y:C.y+O/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},bg.horizontal),"rect"),this._endHandlerMask=R.createOrUpdateChild("endHandlerMask",Object.assign({x:C.x+P*M-i/2,y:C.y+O/2-n/2,width:i,height:n,fill:"white",fillOpacity:0,zIndex:999},bg.horizontal),"rect")}else{if(k.visible){const t=(null===(c=k.background)||void 0===c?void 0:c.size)||10;this._middleHandlerRect=R.createOrUpdateChild("middleHandlerRect",Object.assign({x:"left"===b?C.x-t:C.x+M,y:C.y+T*O,width:t,height:(P-T)*O},null===(f=k.background)||void 0===f?void 0:f.style),"rect"),this._middleHandlerSymbol=R.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:"left"===b?C.x-t/2:C.x+M+t/2,y:C.y+(T+P)/2*O,angle:Math.PI/180*90,symbolType:null!==(p=null===(v=k.icon)||void 0===v?void 0:v.symbolType)&&void 0!==p?p:"square",strokeBoundsBuffer:0},k.icon),"symbol")}this._startHandler=R.createOrUpdateChild("startHandler",Object.assign(Object.assign({x:C.x+M/2,y:C.y+T*O,size:M,symbolType:null!==(g=B.symbolType)&&void 0!==g?g:"square"},bg.vertical),B),"symbol"),this._endHandler=R.createOrUpdateChild("endHandler",Object.assign(Object.assign({x:C.x+M/2,y:C.y+P*O,size:M,symbolType:null!==(y=S.symbolType)&&void 0!==y?y:"square"},bg.vertical),S),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),E),e=Math.max(this._startHandler.AABBBounds.height(),E),i=Math.max(this._endHandler.AABBBounds.width(),L),n=Math.max(this._endHandler.AABBBounds.height(),L);this._startHandlerMask=R.createOrUpdateChild("startHandlerMask",Object.assign({x:C.x+M/2+t/2,y:C.y+T*O-e/2,width:n,height:i,fill:"white",fillOpacity:0,zIndex:999},bg.vertical),"rect"),this._endHandlerMask=R.createOrUpdateChild("endHandlerMask",Object.assign({x:C.x+M/2+i/2,y:C.y+P*O-n/2,width:n,height:i,fill:"white",fillOpacity:0,zIndex:999},bg.vertical),"rect")}}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:n}=this.getLayoutAttrFromConfig();let r,a;return this._isHorizontal?(r=[{x:e.x,y:e.y+n}],a=[{x:e.x+i,y:e.y+n}]):"left"===t?(r=[{x:e.x+i,y:e.y}],a=[{x:e.x+i,y:e.y+n}]):(r=[{x:e.x,y:e.y+n}],a=[{x:e.x,y:e.y}]),{basePointStart:r,basePointEnd:a}}getPreviewLinePoints(){const t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){const t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i={}}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i={}}=this.attribute,{start:n,end:r}=this.state,{position:a,width:s,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?a.x+n*s:a.x,y:this._isHorizontal?a.y:a.y+n*o,width:this._isHorizontal?(r-n)*s:s,height:this._isHorizontal?o:(r-n)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?a.x+n*s:a.x),y:-(this._isHorizontal?a.y:a.y+n*o),width:this._isHorizontal?(r-n)*s:s,height:this._isHorizontal?o:(r-n)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let n=this.find((t=>t.name===i),!0);return n?n.setAttributes(e):(n=new Fv(e),n.name=i),t.add(n),n}setStartAndEnd(t,i){const{start:n,end:r}=this.attribute;e.isValid(t)&&e.isValid(i)&&(t!==this.state.start||i!==this.state.end)&&(this.state.start=t,this.state.end=i,n===this.state.start&&r===this.state.end||(this.setStateAttr(t,i,!0),this._dispatchEvent("change",{start:t,end:i,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,i,n,r;const{middleHandlerStyle:a={}}=this.attribute,s=null!==(i=null===(t=a.background)||void 0===t?void 0:t.size)&&void 0!==i?i:10,o=null!==(r=null===(n=a.icon)||void 0===n?void 0:n.size)&&void 0!==r?r:10;return Math.max(s,...e.array(o))}setPreviewPointsX(t){e.isFunction(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){e.isFunction(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){e.isFunction(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){e.isFunction(t)&&(this._previewPointsY1=t)}setStatePointToData(t){e.isFunction(t)&&(this._statePointToData=t)}}var Ag,kg,Bg;_g.defaultAttributes=yg,t.IMarkLineLabelPosition=void 0,(Ag=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",Ag.middle="middle",Ag.end="end",Ag.insideStartTop="insideStartTop",Ag.insideStartBottom="insideStartBottom",Ag.insideMiddleTop="insideMiddleTop",Ag.insideMiddleBottom="insideMiddleBottom",Ag.insideEndTop="insideEndTop",Ag.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(kg=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",kg.right="right",kg.top="top",kg.bottom="bottom",kg.middle="middle",kg.insideLeft="insideLeft",kg.insideRight="insideRight",kg.insideTop="insideTop",kg.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(Bg=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",Bg.bottom="bottom",Bg.middle="middle",Bg.insideTop="insideTop",Bg.insideBottom="insideBottom",Bg.insideMiddle="insideMiddle";class Sg extends rd{constructor(){super(...arguments),this.name="marker"}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let r;if(n){const n=co.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));r=co.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(r),this._containerClip=n,this.add(n)}else r=co.group({x:0,y:0,pickable:!1}),this.add(r);r.name="marker-container",this._container=r}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&(!this._container&&this.isValidPoints()?(this._initContainer(),this.initMarker(this._container)):this.isValidPoints()?(this._updateContainer(),this.updateMarker()):(this._container=null,this.removeAllChild()))}}const wg={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:t.IMarkLineLabelPosition.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},Tg={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},Pg={label:{position:t.IMarkAreaLabelPosition.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},Cg={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},Mg={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};function Og(t,e){const{x1:i,y1:n,x2:r,y2:a}=e,{x1:s,y1:o,x2:l,y2:u}=t.AABBBounds,{dx:h=0,dy:d=0}=t.attribute;let c=0,f=0;s<i&&(c=i-s),o<n&&(f=n-o),l>r&&(c=r-l),u>a&&(f=a-u),c&&t.setAttribute("dx",c+h),f&&t.setAttribute("dy",f+d)}function Eg(){ev(),Vv()}Eg(),zp();class Lg extends Sg{getLine(){return this._line}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Lg.defaultAttributes,t)),this.name="markLine"}setLabelPos(){var t,e;const{label:i={},limitRect:n}=this.attribute,{position:r="end",refX:a=0,refY:s=0,confine:o}=i,l=this._line.getMainSegmentPoints(),u=null!==(t=this._line.getEndAngle())&&void 0!==t?t:0,h=a*Math.cos(u)+s*Math.cos(u-Math.PI/2),d=a*Math.sin(u)+s*Math.sin(u-Math.PI/2);let c;if(c=r.includes("start")||r.includes("Start")?{x:l[0].x+h,y:l[0].y+d}:r.includes("middle")||r.includes("Middle")?{x:(l[0].x+l[l.length-1].x)/2+h,y:(l[0].y+l[l.length-1].y)/2+d}:{x:l[l.length-1].x+h,y:l[l.length-1].y+d},this._label.setAttributes(Object.assign(Object.assign({},c),{angle:i.autoRotate?u+(null!==(e=i.refAngle)&&void 0!==e?e:0):0,textStyle:Object.assign(Object.assign({},Tg[r]),i.textStyle)})),n&&o){const{x:t,y:e,width:i,height:r}=n;Og(this._label,{x1:t,y1:e,x2:t+i,y2:e+r})}}initMarker(t){const{points:e,startSymbol:i,endSymbol:n,label:r,lineStyle:a,mainSegmentIndex:s,multiSegment:o}=this.attribute,l=new Hp({points:e,startSymbol:i,endSymbol:n,lineStyle:a,mainSegmentIndex:s,multiSegment:o,pickable:!1});l.name="mark-line-line",this._line=l,t.add(l);const u=new Fv(Object.assign({},r));u.name="mark-line-label",this._label=u,t.add(u),this.setLabelPos()}updateMarker(){const{points:t,startSymbol:e,endSymbol:i,label:n,lineStyle:r,mainSegmentIndex:a,multiSegment:s}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:r,mainSegmentIndex:a,multiSegment:s}),this._label&&this._label.setAttributes(Object.assign({dx:0,dy:0},n)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;return!(!t||t.length<2)}}Lg.defaultAttributes=wg,Eg(),uv();class Rg extends Sg{getArea(){return this._area}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Rg.defaultAttributes,t)),this.name="markArea"}_getPositionByDirection(t,e){const{x1:i,x2:n,y1:r,y2:a}=this._area.AABBBounds;return e.includes("left")||e.includes("Left")?{x:i,y:(r+a)/2}:e.includes("right")||e.includes("Right")?{x:n,y:(r+a)/2}:e.includes("top")||e.includes("Top")?{x:(i+n)/2,y:r}:e.includes("bottom")||e.includes("Bottom")?{x:(i+n)/2,y:a}:{x:(i+n)/2,y:(r+a)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,i=null!==(t=e.position)&&void 0!==t?t:"middle",n=this._getPositionByDirection(this._area,i);if(this._label.setAttributes(Object.assign(Object.assign({},n),{textStyle:Object.assign(Object.assign({},Cg[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:n}=this.attribute.limitRect;Og(this._label,{x1:t,y1:e,x2:t+i,y2:e+n})}}}initMarker(t){const{points:e,label:i,areaStyle:n}=this.attribute,r=co.polygon(Object.assign({points:e},n));r.name="mark-area-area",this._area=r,t.add(r);const a=new Fv(Object.assign({},i));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i}=this.attribute;this._area&&this._area.setAttributes(Object.assign({points:t},i)),this._area&&this._label.setAttributes(Object.assign({dx:0,dy:0},e)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;return!(!t||t.length<3)}}Rg.defaultAttributes=Pg,Eg(),zp(),pv(),nv(),av();class Ig extends Sg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ig.defaultAttributes,t)),this.name="markPoint"}setLabelPos(){}setItemAttributes(e,i,n,r){var a;if(!e)return;const{autoRotate:s=!0,refX:o=0,refY:l=0,refAngle:u=0,textStyle:h={},richTextStyle:d={},imageStyle:c={},position:f=t.IMarkPointItemPosition.middle}=i,v=(null===(a=this._line)||void 0===a?void 0:a.getEndAngle())||0,p=o*Math.cos(v)+l*Math.cos(v-Math.PI/2),g=o*Math.sin(v)+l*Math.sin(v-Math.PI/2);"text"===r?e.setAttributes(Object.assign(Object.assign({},h),{textStyle:Object.assign(Object.assign({},Mg[(null==i?void 0:i.position)||"end"]),h.textStyle)})):"richText"===r?e.setAttributes({dx:this.getItemDx(e,f,d)+(d.dx||0),dy:this.getItemDy(e,f,d)+(d.dy||0)}):"image"===r&&e.setAttributes({dx:this.getItemDx(e,f,c)+(c.dx||0),dy:this.getItemDy(e,f,c)+(c.dy||0)}),e.setAttributes({x:n.x+(p||0),y:n.y+(g||0),angle:s&&v+u})}getItemDx(t,e,i){var n,r;const a=null!==(r=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==r?r:(null==i?void 0:i.width)||0;return e.includes("inside")?-a:0}getItemDy(t,e,i){var n,r;const a=null!==(r=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==r?r:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-a:e.includes("middle")||e.includes("Middle")?-a/2:0}initItem(t,e){const{type:i="text",symbolStyle:n,richTextStyle:r,imageStyle:a,renderCustomCallback:s}=t;let o;return"symbol"===i?o=co.symbol(Object.assign(Object.assign({},e),n)):"text"===i?o=new Fv(Object.assign({},e)):"richText"===i?o=co.richtext(Object.assign(Object.assign({},e),r)):"image"===i?o=co.image(Object.assign(Object.assign({},e),a)):"custom"===i&&s&&(o=s()),this.setItemAttributes(o,t,e,i),o}getItemLineAttr(t,e,i){let n=[];const{type:r="type-s"}=t;return n="type-do"===r?[e,{x:(e.x+i.x)/2,y:i.y},i]:"type-po"===r?[e,{x:i.x,y:e.y},i]:"type-op"===r?[e,{x:e.x,y:i.y},i]:[e,i],n}setItemLineAttr(t,e,i,n){if(this._line){const{startSymbol:r,endSymbol:a,lineStyle:s}=t,o=this.getItemLineAttr(t,e,i);this._line.setAttributes({points:o,startSymbol:r,endSymbol:a,lineStyle:s,visible:n})}}getDecorativeLineAttr(t,e){var i;const n=(null===(i=null==t?void 0:t.decorativeLine)||void 0===i?void 0:i.length)||10,r=this._line.getEndAngle()||0;return{startPointOffsetX:n/2*Math.cos(r-Math.PI/2),startPointOffsetY:n/2*Math.sin(r-Math.PI/2),endPointOffsetX:-n/2*Math.cos(r-Math.PI/2),endPointOffsetY:-n/2*Math.sin(r-Math.PI/2)}}setDecorativeLineAttr(t,e,i){if(this._decorativeLine){const{lineStyle:n}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:s,endPointOffsetY:o}=this.getDecorativeLineAttr(t,e);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+s,y:e.y+o}]},n),{visible:i}))}}initMarker(t){var e;const{position:i,itemLine:n={},itemContent:r={}}=this.attribute,a={x:i.x+(r.offsetX||0),y:i.y+(r.offsetY||0)},s=new Hp({points:[],pickable:!1});s.name="mark-point-line",this._line=s,t.add(s);const o=co.line({points:[]});o.name="mark-point-decorativeLine",this._decorativeLine=o,t.add(o),this.setItemLineAttr(n,i,a,n.visible),this.setDecorativeLineAttr(n,a,null===(e=n.decorativeLine)||void 0===e?void 0:e.visible);const l=this.initItem(r,a);this._item=l,t.add(l)}updateMarker(){var t;const{position:e,itemLine:i={},itemContent:n={}}=this.attribute,{type:r="text"}=n,a={x:e.x+(n.offsetX||0),y:e.y+(n.offsetY||0)};this.setItemLineAttr(i,e,a,i.visible),this.setDecorativeLineAttr(i,a,null===(t=i.decorativeLine)||void 0===t?void 0:t.visible),this.setItemAttributes(this._item,n,a,r)}isValidPoints(){return!0}}function jg(){ev(),pv(),yv()}Ig.defaultAttributes={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}};const Dg={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};jg();class Ng extends rd{getCurrent(){return this._current}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ng.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",this._getPageText(this._current))}}render(){var t;this._reset();const{layout:i="horizontal",handler:n=Dg,total:r,defaultCurrent:a=1,textStyle:s,padding:o=0}=this.attribute;this._current=a;const l=e.normalizePadding(o),u="horizontal"===i,h=co.group({x:0,y:0}),d=n.style||{},c=d.size||15,f=null!==(t=n.space)&&void 0!==t?t:8,v=n.state||{};let{preShape:p,nextShape:g}=n;p||(p=u?"triangleLeft":"triangleUp"),g||(g=u?"triangleRight":"triangleDown");const y=co.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},d),{x:0,y:0,symbolType:p,size:c}));y.states=v,y.name="preHandler",this.preHandler=y,h.add(y);const{width:b,height:m}=Wv(this._getPageText(r),Object.assign({textAlign:"center",textBaseline:"middle"},s)),x=e.isNumber(c)?c:c[0],_=e.isNumber(c)?c:c[1],A=co.text(Object.assign({x:u?x/2+f+b/2:0,y:u?0:_/2+f+m/2,text:this._getPageText(a),textAlign:"center",textBaseline:"middle",lineHeight:null==s?void 0:s.fontSize},s));this.text=A,h.add(A);const k=co.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},d),{x:u?x+2*f+b:0,y:u?0:_+2*f+m,symbolType:g,size:c}));k.name="nextHandler",k.states=v,this.nextHandler=k,h.add(k),1===this._total?(y.addState("disable"),k.addState("disable")):1===this._current?y.addState("disable"):this._current===r&&k.addState("disable");const B=h.AABBBounds,S=B.width(),w=B.height();h.translateTo(0-B.x1+l[3],0-B.y1+l[0]),this.add(h),this.attribute.width=S+l[1]+l[3],this.attribute.height=w+l[0]+l[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}_getPageText(t){const{pageFormatter:i}=this.attribute;return i?e.isFunction(i)?i(t,this._total):`${i}`.replace("{current}",`${t}`).replace("{total}",`${this._total}`):`${t}/${this._total}`}setTotal(t){t!==this.attribute.total&&(this._total=t,1!==this._current&&this._current<=t?this.setAttributes({total:t,defaultCurrent:this._current}):this.setAttribute("total",t))}}Ng.defaultAttributes={handler:Dg,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const Ug=16,zg=8,Hg=12,Wg=12;var Vg,Fg,Gg;t.LegendStateValue=void 0,(Vg=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",Vg.unSelected="unSelected",Vg.selectedHover="selectedHover",Vg.unSelectedHover="unSelectedHover",Vg.focus="focus",t.LegendEvent=void 0,(Fg=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",Fg.legendItemUnHover="legendItemUnHover",Fg.legendItemClick="legendItemClick",Fg.legendItemAttributeUpdate="legendItemAttributeUpdate",t.LEGEND_ELEMENT_NAME=void 0,(Gg=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",Gg.title="legendTitle",Gg.item="legendItem",Gg.itemShape="legendItemShape",Gg.itemLabel="legendItemLabel",Gg.itemValue="legendItemValue",Gg.focus="legendItemFocus";class Yg extends rd{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild();const{interactive:i=!0,title:n,padding:r=0}=this.attribute,a=e.normalizePadding(r),s=co.group({x:a[3],y:a[0],pickable:i,childrenPickable:i});s.name=t.LEGEND_ELEMENT_NAME.innerView,this.add(s),this._innerView=s,(null==n?void 0:n.visible)&&this._renderTitle(n),this._renderContent(),this._adjustLayout(),i&&this._bindEvents();const o=this._innerView.AABBBounds;this.attribute.width=o.width()+a[1]+a[3],this.attribute.height=o.height()+a[0]+a[2]}_renderTitle(i){const{text:n="",textStyle:r,padding:a=0,background:s,minWidth:o,maxWidth:l,shape:u}=i,h={x:0,y:0,text:n,textStyle:r,padding:e.normalizePadding(a),minWidth:o,maxWidth:l};u&&u.visible&&(h.shape=Object.assign({visible:!0},u.style),e.isValid(u.space)&&(h.space=u.space)),s&&s.visible&&(h.panel=Object.assign({visible:!0},s.style));const d=new Fv(h);d.name=t.LEGEND_ELEMENT_NAME.title,this._title=d,this._innerView.add(d)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),n=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===n?this._title.setAttribute("x",(e-i)/2):"end"===n&&this._title.setAttribute("x",e-i)}}}function Xg(){ev(),yv(),dv(),pv()}function $g(){ev(),Vv()}const qg={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};$g(),jg();class Kg extends Yg{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},Kg.defaultAttributes,i)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=e=>{const i=e.target;if(i&&i.name&&i.name.startsWith(t.LEGEND_ELEMENT_NAME.item)){const t=i.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===t.id)return;this._unHover(this._lastActiveItem,e)}this._hover(t,e)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,e),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=e=>{var i,n,r,a;const s=e.target;if(s&&s.name&&s.name.startsWith(t.LEGEND_ELEMENT_NAME.item)){const o=s.delegate;if(s.name===t.LEGEND_ELEMENT_NAME.focus){const r=o.hasState(t.LegendStateValue.focus);o.toggleState(t.LegendStateValue.focus),r?null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((i=>{this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(i,t.LegendStateValue.selected,e)})):(this._setLegendItemState(o,t.LegendStateValue.selected,e),this._removeLegendItemState(o,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((i=>{o!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(i,t.LegendStateValue.unSelected,e))})))}else{null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach((e=>{e.removeState(t.LegendStateValue.focus)}));const{selectMode:i="multiple",allowAllCanceled:n=!0}=this.attribute,s=o.hasState(t.LegendStateValue.selected),l=this._getSelectedLegends();if("multiple"===i){if(!1===n&&s&&1===l.length)return void this._dispatchLegendEvent(t.LegendEvent.legendItemClick,o,e);s?(this._removeLegendItemState(o,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(o,t.LegendStateValue.unSelected,e)):(this._setLegendItemState(o,t.LegendStateValue.selected,e),this._removeLegendItemState(o,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e))}else this._setLegendItemState(o,t.LegendStateValue.selected,e),this._removeLegendItemState(o,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(a=this._itemsContainer)||void 0===a||a.getChildren().forEach((i=>{o!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(i,t.LegendStateValue.unSelected,e))}))}this._dispatchLegendEvent(t.LegendEvent.legendItemClick,o,e)}}}setSelected(e){var i;(null===(i=this._itemsContainer)||void 0===i?void 0:i.getChildren()).forEach((i=>{const n=i.data;e.includes(n.label)?(this._setLegendItemState(i,t.LegendStateValue.selected),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover])):(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}_renderItems(){const{item:t={},maxCol:i=1,maxRow:n=2,maxWidth:r,maxHeight:a,defaultSelected:s=[],lazyload:o}=this.attribute,{spaceCol:l=Ug,spaceRow:u=zg}=t,h=this._itemsContainer,{items:d,isHorizontal:c,startIndex:f}=this._itemContext,v=c?n:i;let p,{doWrap:g,maxWidthInCol:y,startX:b,startY:m,pages:x}=this._itemContext;for(let t=f,i=d.length;t<i;t++){if(o&&x>this._itemContext.currentPage*v){this._itemContext.startIndex=t;break}p=d[t],p.id||(p.id=p.label),p.index=t;const i=this._renderEachItem(p,!!e.isEmpty(s)||(null==s?void 0:s.includes(p.label)),t,d),n=i.attribute.width,f=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,f),y=Math.max(n,y),this._itemMaxWidth=Math.max(n,this._itemMaxWidth),c?(e.isValid(r)&&(n>=r?(g=!0,t>0&&(b=0,m+=f+u,x+=1)):r<b+n&&(g=!0,b=0,m+=f+u,x+=1)),t>0&&i.setAttributes({x:b,y:m}),b+=l+n):(e.isValid(a)&&a<m+f&&(g=!0,m=0,b+=y+l,y=0,x+=1),t>0&&i.setAttributes({x:b,y:m}),m+=u+f),h.add(i)}return this._itemContext.doWrap=g,this._itemContext.startX=b,this._itemContext.startY=m,this._itemContext.maxWidthInCol=y,this._itemContext.pages=x,this._itemContext.maxPages=v,o||(this._itemContext.startIndex=d.length),this._itemContext}_renderContent(){const{item:t={},items:i,reversed:n}=this.attribute;if(!1===t.visible||e.isEmpty(i))return;let r=i;n&&(r=null==i?void 0:i.reverse());const a=co.group({x:0,y:0});this._itemsContainer=a;const{layout:s,autoPage:o}=this.attribute,l="horizontal"===s,{maxWidth:u,width:h,height:d}=t;e.isValid(u)?e.isValid(h)?this._itemWidthByUser=Math.min(u,h):this._itemWidthByUser=u:e.isValid(h)&&(this._itemWidthByUser=h),e.isValid(d)&&(this._itemHeightByUser=d),this._itemContext={currentPage:this.attribute.pager&&this.attribute.pager.defaultCurrent||1,doWrap:!1,maxWidthInCol:0,maxPages:1,pages:1,startX:0,startY:0,startIndex:0,items:r,isHorizontal:l},this._itemContext=this._renderItems();let c=!1;this._itemContext.doWrap&&o&&this._itemContext.pages>this._itemContext.maxPages&&(c=this._renderPager(l)),c||(a.setAttribute("y",this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",8):0),this._innerView.add(a))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_renderEachItem(i,n,r,a){var s,o;const{id:l,label:u,value:h,shape:d}=i,{padding:c=0,focus:f,focusIconStyle:v}=this.attribute.item,{shape:p,label:g,value:y,background:b}=this.attribute.item,m=this._handleStyle(p,i,n,r,a),x=this._handleStyle(g,i,n,r,a),_=this._handleStyle(y,i,n,r,a),A=this._handleStyle(b,i,n,r,a),k=e.normalizePadding(c);let B;!1===b.visible?(B=co.group({x:0,y:0,cursor:null===(s=A.style)||void 0===s?void 0:s.cursor}),this._appendDataToShape(B,t.LEGEND_ELEMENT_NAME.item,i,B)):(B=co.group(Object.assign({x:0,y:0},A.style)),this._appendDataToShape(B,t.LEGEND_ELEMENT_NAME.item,i,B,A.state)),B.id=`${null!=l?l:u}-${r}`,B.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const S=co.group({x:0,y:0,pickable:!1});B.add(S);let w,T=0,P=0,C=0;if(p&&!1!==p.visible){P=e.get(m,"style.size",10),C=e.get(p,"space",8);const r=co.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},d),m.style));Object.keys(m.state||{}).forEach((t=>{const i=m.state[t].fill||m.state[t].stroke;d.fill&&e.isNil(m.state[t].fill)&&i&&(m.state[t].fill=i),d.stroke&&e.isNil(m.state[t].stroke)&&i&&(m.state[t].stroke=i)})),this._appendDataToShape(r,t.LEGEND_ELEMENT_NAME.itemShape,i,B,m.state),r.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),S.add(r)}let M=0;if(f){const n=e.get(v,"size",10);w=co.symbol(Object.assign(Object.assign({x:0,y:-n/2-1,strokeBoundsBuffer:0},v),{visible:!0,pickMode:"imprecise",boundsPadding:k})),this._appendDataToShape(w,t.LEGEND_ELEMENT_NAME.focus,i,B),M=n}const O=co.text(Object.assign(Object.assign({x:P/2+C,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(o=x.style)||void 0===o?void 0:o.fontSize},x.style),{text:g.formatMethod?g.formatMethod(u,i,r):u}));this._appendDataToShape(O,t.LEGEND_ELEMENT_NAME.itemLabel,i,B,x.state),O.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),S.add(O);const E=e.get(g,"space",8);if(e.isValid(h)){const a=e.get(y,"space",f?8:0),s=co.text(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:_.style.fontSize},_.style),{text:y.formatMethod?y.formatMethod(h,i,r):h}));if(this._appendDataToShape(s,t.LEGEND_ELEMENT_NAME.itemValue,i,B,_.state),s.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-k[1]-k[3]-P-C-E-M-a,e=s.AABBBounds,i=O.AABBBounds,n=e.width(),r=i.width();r>t?(t-n)/r>.4?O.setAttribute("maxLineWidth",t-n):(s.setAttribute("maxLineWidth",.5*t),O.setAttribute("maxLineWidth",.5*t)):s.setAttribute("maxLineWidth",t-r),y.alignRight?s.setAttributes({textAlign:"right",x:this._itemWidthByUser-P/2-k[1]-k[3]-M-a}):s.setAttribute("x",O.AABBBounds.x2+a)}else s.setAttribute("x",O.AABBBounds.x2+a);T=s.AABBBounds.x2+a,S.add(s)}else this._itemWidthByUser?(O.setAttribute("maxLineWidth",this._itemWidthByUser-k[1]-k[3]-P-C-M),T=O.AABBBounds.x2+E):T=O.AABBBounds.x2+E;w&&(w.setAttribute("x",T),S.add(w));const L=S.AABBBounds,R=L.width(),I=L.height(),j=e.isValid(this.attribute.item.width)?this.attribute.item.width:R+k[1]+k[3],D=this._itemHeightByUser||I+k[0]+k[2];return B.attribute.width=j,B.attribute.height=D,w&&w.setAttribute("visible",!1),S.translateTo(-L.x1+k[3],-L.y1+k[0]),B}_renderPager(t){const i=this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",8):0,{maxWidth:n,maxHeight:r,maxCol:a=1,maxRow:s=2,item:o={},pager:l={},disableTriggerEvent:u}=this.attribute,{spaceCol:h=Ug,spaceRow:d=zg}=o,c=this._itemsContainer,{animation:f=!0,animationDuration:v=450,animationEasing:p="quadIn",space:g=Wg,position:y="middle"}=l,b=Av(l,["animation","animationDuration","animationEasing","space","position"]);let m,x=0,_=0,A=0,k=0,B=1;if(t){if(m=new Ng(Object.assign(Object.assign({layout:1===s?"horizontal":"vertical",total:99},e.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},b)),{disableTriggerEvent:u})),this._pager=m,this._innerView.add(m),x=(s-1)*d+this._itemHeight*s,_=n-m.AABBBounds.width()-g,_<=0)return this._innerView.removeChild(m),!1;let t;c.getChildren().forEach(((t,e)=>{const{width:i,height:n}=t.attribute;_<A+i&&(A=0,k+=n+d,B+=1),e>0&&t.setAttributes({x:A,y:k}),A+=h+i})),this._itemContext.startX=A,this._itemContext.startY=k,this._itemContext.pages=B,m.setTotal(Math.ceil(B/s)),t="start"===y?i:"end"===y?i+x-m.AABBBounds.height()/2:i+x/2-m.AABBBounds.height()/2,m.setAttributes({x:_,y:t})}else{if(m=new Ng(Object.assign({layout:"horizontal",total:99,disableTriggerEvent:u},b)),this._pager=m,this._innerView.add(m),_=this._itemMaxWidth*a+(a-1)*h,x=r-m.AABBBounds.height()-g-i,x<=0)return this._innerView.removeChild(m),!1;let t;c.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;x<k+i&&(k=0,A+=this._itemMaxWidth+h,B+=1),e>0&&t.setAttributes({x:A,y:k}),k+=d+i})),m.setTotal(Math.ceil(B/a)),t="start"===y?0:"end"===y?_-m.AABBBounds.width():(_-m.AABBBounds.width())/2,m.setAttributes({x:t,y:r-m.AABBBounds.height()})}l.defaultCurrent>1&&(t?c.setAttribute("y",-(l.defaultCurrent-1)*(x+d)):c.setAttribute("x",-(l.defaultCurrent-1)*(_+h)));const S=co.group({x:0,y:i,width:_,height:x,clip:!0,pickable:!1});S.add(c),this._innerView.add(S);const w=e=>{const{current:i}=e.detail;this._itemContext.currentPage=i,this._itemContext&&this._itemContext.startIndex<this._itemContext.items.length&&(this._renderItems(),m.setTotal(Math.ceil(this._itemContext.pages/this._itemContext.maxPages))),f?c.animate().to(t?{y:-(i-1)*(x+d)}:{x:-(i-1)*(_+h)},v,p):t?c.setAttribute("y",-(i-1)*(x+d)):c.setAttribute("x",-(i-1)*(_+h))};return this._pager.addEventListener("toPrev",w),this._pager.addEventListener("toNext",w),!0}_hover(e,i){this._lastActiveItem=e;e.hasState(t.LegendStateValue.selected)?this._setLegendItemState(e,t.LegendStateValue.selectedHover,i):this._setLegendItemState(e,t.LegendStateValue.unSelectedHover,i);const n=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);n&&n.setAttribute("visible",!0),this._dispatchLegendEvent(t.LegendEvent.legendItemHover,e,i)}_unHover(e,i){let n=!1;(e.hasState(t.LegendStateValue.unSelectedHover)||e.hasState(t.LegendStateValue.selectedHover))&&(n=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{n||!e.hasState(t.LegendStateValue.unSelectedHover)&&!e.hasState(t.LegendStateValue.selectedHover)||(n=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const r=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);r&&r.setAttribute("visible",!1),n&&this._dispatchLegendEvent(t.LegendEvent.legendItemAttributeUpdate,e,i),this._dispatchLegendEvent(t.LegendEvent.legendItemUnHover,e,i)}_setLegendItemState(e,i,n){let r=!1;e.hasState(i)||(r=!0),e.addState(i,true),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&(r||e.hasState(i)||(r=!0),e.addState(i,true))})),r&&this._dispatchLegendEvent(t.LegendEvent.legendItemAttributeUpdate,e,n)}_removeLegendItemState(e,i,n){let r=!1;i.forEach((t=>{!r&&e.hasState(t)&&(r=!0),e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{!r&&e.hasState(t)&&(r=!0),e.removeState(t)}))})),r&&this._dispatchLegendEvent(t.LegendEvent.legendItemAttributeUpdate,e,n)}_getSelectedLegends(){var e;const i=[];return null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{e.hasState(t.LegendStateValue.selected)&&i.push(e.data)})),i}_appendDataToShape(t,i,n,r,a={}){t.name=i,t.data=n,t.delegate=r,t.states=e.merge({},qg,a)}_dispatchLegendEvent(e,i,n){const r=this._getSelectedLegends();r.sort(((t,e)=>t.index-e.index));const a=r.map((t=>t.label));this._dispatchEvent(e,{item:i,data:i.data,selected:i.hasState(t.LegendStateValue.selected),currentSelectedItems:r,currentSelected:a,event:n})}_handleStyle(t,i,n,r,a){const s={};return t.style&&(e.isFunction(t.style)?s.style=t.style(i,n,r,a):s.style=t.style),t.state&&(s.state={},Object.keys(t.state).forEach((o=>{t.state[o]&&(e.isFunction(t.state[o])?s.state[o]=t.state[o](i,n,r,a):s.state[o]=t.state[o])}))),s}}var Zg;function Jg(t){return e.isArray(t)?t:[t,t]}function Qg(t){return t?"ew-resize":"ns-resize"}Kg.defaultAttributes={layout:"horizontal",title:{align:"start",space:Hg,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:Ug,spaceRow:zg,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:Wg,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(Zg=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",Zg.railContainer="sliderRailContainer",Zg.rail="sliderRail",Zg.startText="sliderStartText",Zg.endText="sliderEndText",Zg.startHandler="sliderStartHandler",Zg.startHandlerText="startHandlerText",Zg.endHandler="sliderEndHandler",Zg.endHandlerText="sliderEndHandlerText",Zg.track="sliderTrack",Zg.trackContainer="sliderTrackContainer",Xg();class ty extends rd{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ty.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._currentHandler=t.target,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===wh.env?(wh.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var i,n;t.stopPropagation();const{railWidth:r,railHeight:a,min:s,max:o}=this.attribute;if(o===s)return;let l,u,h,d=0;this._isHorizontal?(l=t.clientX,d=l-this._prePos,u=null===(n=this._currentHandler)||void 0===n?void 0:n.attribute.x,h=r):(l=t.clientY,d=l-this._prePos,u=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.y,h=a);const c=e.clamp(u+d,0,h),f=c/h*(o-s)+s;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,f):this._updateHandler(this._currentHandler,c,f),this._updateTrack(),this._prePos=l,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._currentHandler=null,"browser"===wh.env?(wh.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===wh.env?(wh.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),wh.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation();const{railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{startHandler:s,endHandler:o}=this._getHandlers();let l,u,h;this._isHorizontal?(l=t.clientX,u=this._track.attribute.width,h=i):(l=t.clientY,u=this._track.attribute.height,h=n);const d=l-this._prePos;if(s){const t=this._isHorizontal?s.attribute.x:s.attribute.y,i=e.clamp(t+d,0,h-u),n=i/h*(a-r)+r;this._updateHandler(s,i,n)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,i=e.clamp(t+d,u,h),n=i/h*(a-r)+r,l=null==s?void 0:s.attribute;this._updateHandler(o,i,n),this._track.setAttributes(this._isHorizontal?{x:Math.min(l.x,o.attribute.x),width:Math.abs(l.x-o.attribute.x)}:{y:Math.min(l.y,o.attribute.y),height:Math.abs(l.y-o.attribute.y)})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),"browser"===wh.env?(wh.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),wh.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation();const{railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const s=this._startHandler,o=this._endHandler;let l,u,h,d;this._isHorizontal?(l=t.viewX-this._rail.globalAABBBounds.x1,u=null==s?void 0:s.attribute.x,h=null==o?void 0:o.attribute.x,d=i):(l=t.viewY-this._rail.globalAABBBounds.y1,u=null==s?void 0:s.attribute.y,h=null==o?void 0:o.attribute.y,d=n);const c=l/d*(a-r)+r;if(e.isValid(h)){const t=Math.abs(l-u)>Math.abs(l-h)?o:s;this._updateHandler(t,l,c)}else this._updateHandler(s,l,c);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){const{layout:i,railWidth:n,railHeight:r,min:a,max:s}=this.attribute;if(s===a)return;const[o,l]=e.array(t),{startHandler:u,endHandler:h}=this._getHandlers(),d="vertical"===i?r:n,c=(o-a)/(s-a)*d;if(u&&this._updateHandler(u,c,o),h){const t=(l-a)/(s-a)*d;this._updateHandler(h,t,l)}this._updateTrack()}render(){var i,n;this.removeAllChild();const{layout:r="horizontal",railWidth:a,railHeight:s,startText:o,endText:l,min:u,max:h,showHandler:d=!0}=this.attribute;let{value:c}=this.attribute;e.isNil(c)&&(c=[u,h]),this._currentValue={startValue:Jg(c)[0],endValue:Jg(c)[1]};const f="horizontal"===r;this._isHorizontal=f;const v=co.group({x:0,y:0});v.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(v),this._innerView=v;let p,g=0;if(o&&o.visible){p=co.text(Object.assign({x:f?0:a/2,y:f?s/2:0,textAlign:f?"start":"center",textBaseline:f?"middle":"top",text:o.text,lineHeight:null===(i=o.style)||void 0===i?void 0:i.fontSize},o.style)),p.name=t.SLIDER_ELEMENT_NAME.startText,v.add(p);const n=e.isValid(o.space)?o.space:0;g+=(f?p.AABBBounds.width():p.AABBBounds.height())+n}const y=co.group({x:f?g:0,y:f?0:g});v.add(y);const b=co.group({x:0,y:0});let m;if(b.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=b,y.add(b),this._renderRail(b),g+=f?a:s,l&&l.visible){const i=e.isValid(l.space)?l.space:0;m=co.text(Object.assign({x:f?g+i:a/2,y:f?s/2:g+i,textAlign:f?"start":"center",textBaseline:f?"middle":"top",text:l.text,lineHeight:null===(n=l.style)||void 0===n?void 0:n.fontSize},l.style)),m.name=t.SLIDER_ELEMENT_NAME.endText,v.add(m)}this._renderTrack(b),d&&(this._renderHandlers(y),this._bindEvents())}_renderRail(e){const{railWidth:i,railHeight:n,railStyle:r,slidable:a}=this.attribute;let s="default";!1!==a&&(s="pointer");const o=co.rect(Object.assign({x:0,y:0,width:i,height:n,cursor:s},r));return o.name=t.SLIDER_ELEMENT_NAME.rail,e.add(o),this._rail=o,o}_renderHandlers(i){const{range:n,min:r,max:a,handlerSize:s=14,handlerStyle:o,handlerText:l,railHeight:u,railWidth:h,slidable:d}=this.attribute;let{value:c}=this.attribute;e.isNil(c)&&(c=[r,a]);const f=l&&l.visible,v=this._isHorizontal,p=v?h:u,[g,y]=Jg(c),b=a===r?n?0:p:(g-r)/(a-r)*p,m=this._renderHandler(Object.assign({x:v?b:h/2,y:v?u/2:b,size:s,strokeBoundsBuffer:0,cursor:!1===d?"default":Qg(v)},o));if(m.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=m,i.add(m),this._currentValue.startPos=b,f){const e=this._renderHandlerText(g,n?"start":"end");e.name=t.SLIDER_ELEMENT_NAME.startHandlerText,i.add(e),this._startHandlerText=e}if(n){const e=a===r?p:(y-r)/(a-r)*p,n=this._renderHandler(Object.assign({x:v?e:h/2,y:v?u/2:e,size:s,strokeBoundsBuffer:0,cursor:!1===d?"default":Qg(v)},o));if(n.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=n,i.add(n),this._currentValue.endPos=e,f){const e=this._renderHandlerText(y,"end");e.name=t.SLIDER_ELEMENT_NAME.endHandlerText,i.add(e),this._endHandlerText=e}}}_renderTrack(i){const{range:n,min:r,max:a,railHeight:s,railWidth:o,trackStyle:l,railStyle:u,slidable:h,value:d}=this.attribute;let c,f;if(e.isNil(d))n?(c=r,f=a):c=f=r;else if(n){const t=e.clampRange(d,r,a);c=t[0],f=t[1]}else c=r,f=e.clamp(d,r,a);const v=this._isHorizontal,p=v?o:s;n||(c=r);const g=co.group({x:0,y:0,width:o,height:s,cornerRadius:null==u?void 0:u.cornerRadius,clip:!0,pickable:!1});g.name=t.SLIDER_ELEMENT_NAME.trackContainer;const y=e.isObject(n)&&!0===n.draggableTrack;let b;b=!1===h?"default":!1===n||!1===y?"pointer":Qg(v);const m=a===r?p:(f-c)/(a-r)*p,x=a===r?0:(c-r)/(a-r)*p,_=co.rect(Object.assign({x:v?x:0,y:v?0:x,width:v?m:o,height:v?s:m,cursor:b},l));_.name=t.SLIDER_ELEMENT_NAME.track,this._track=_,g.add(_),i.add(g)}_renderHandler(t){return co.symbol(t)}_renderHandlerText(t,e){var i,n,r;const{align:a,min:s,max:o,handlerSize:l=14,handlerText:u={},railHeight:h,railWidth:d,slidable:c}=this.attribute,f=this._isHorizontal,v=f?d:h,p=o===s?"start"===e?0:v:(t-s)/(o-s)*v,g=null!==(i=u.space)&&void 0!==i?i:4,y={text:u.formatter?u.formatter(t):t.toFixed(null!==(n=u.precision)&&void 0!==n?n:0),lineHeight:null===(r=u.style)||void 0===r?void 0:r.lineHeight,cursor:!1===c?"default":Qg(f)};f?"top"===a?(y.textBaseline="bottom",y.textAlign="center",y.x=p,y.y=(h-l)/2-g):(y.textBaseline="top",y.textAlign="center",y.x=p,y.y=(h+l)/2+g):"left"===a?(y.textBaseline="middle",y.textAlign="end",y.x=(d-l)/2-g,y.y=p):(y.textBaseline="middle",y.textAlign="start",y.x=(d+l)/2+g,y.y=p);return co.text(Object.assign(Object.assign({},y),u.style))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:i}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),e.isObject(i)&&i.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_updateTrack(){const t=this._startHandler,e=this._endHandler;if(this._isHorizontal){const i=null==t?void 0:t.attribute.x;if(e){const t=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else this._track.setAttributes({width:i})}else{const i=null==t?void 0:t.attribute.y;if(e){const t=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,t),height:Math.abs(i-t)})}else this._track.setAttributes({height:i})}}_updateHandler(e,i,n){var r;const a=this._isHorizontal;e.setAttribute(a?"x":"y",i);const s=e.name===t.SLIDER_ELEMENT_NAME.startHandler?this._startHandlerText:this._endHandlerText;if(s){const{handlerText:t={}}=this.attribute;s.setAttributes({text:t.formatter?t.formatter(n):n.toFixed(null!==(r=t.precision)&&void 0!==r?r:0),[a?"x":"y"]:i})}e.name===t.SLIDER_ELEMENT_NAME.startHandler?(this._currentValue.startValue=n,this._currentValue.startPos=i):(this._currentValue.endValue=n,this._currentValue.endPos=i)}_updateHandlerText(e,i,n){var r;const a=this._isHorizontal,{handlerText:s={}}=this.attribute;e.setAttributes({[a?"x":"y"]:i,text:s.formatter?s.formatter(n):n.toFixed(null!==(r=s.precision)&&void 0!==r?r:0)});const o=e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?this._startHandler:this._endHandler;o&&o.setAttributes({[a?"x":"y"]:i}),e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?(this._currentValue.startValue=n,this._currentValue.startPos=i):(this._currentValue.endValue=n,this._currentValue.endPos=i)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}ty.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},$g(),Xg();class ey extends Yg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ey.defaultAttributes,t)),this.name="colorLegend",this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:d=!0,handlerSize:c,handlerStyle:f,railStyle:v,trackStyle:p,startText:g,endText:y,handlerText:b,showTooltip:m,tooltip:x,disableTriggerEvent:_}=this.attribute,A=[],k=(o-s)/(t.length-1);for(let e=0;e<t.length;e++)A.push(s+k*e);this._colorScale=(new i.LinearScale).domain(A,!0).range(t),this._color=this._getTrackColor();const B=new ty({x:0,y:0,range:{draggableTrack:!0},slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:d,handlerSize:c,handlerStyle:f,railStyle:v,trackStyle:Object.assign({fill:this._color},p),startText:g,endText:y,handlerText:b,showTooltip:m,tooltip:x,disableTriggerEvent:_});this._innerView.add(B),this._slider=B,B.translateTo(0-B.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",Hg):0)-B.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}_getTrackColor(){const{colors:t,layout:i}=this.attribute;if(e.isEmpty(t))return;const n=t.length;if(1===n)return t[0];const r=[];for(let e=0;e<n;e++){const i=e/(n-1);r.push({offset:i,color:t[e]})}const a="horizontal"===i;return{gradient:"linear",stops:r,x0:0,y0:0,x1:a?1:0,y1:a?0:1}}_updateColor(){const{layout:t="horizontal",colors:e,railWidth:i,railHeight:n}=this.attribute,{startHandler:r,endHandler:a,track:s}=this._slider,{startValue:o,endValue:l,startPos:u,endPos:h}=this._slider.currentValue,d=this._colorScale.scale(o),c=this._colorScale.scale(l);null==r||r.setAttribute("fill",d),null==a||a.setAttribute("fill",c);const f="horizontal"===t?i:n;if(Math.abs(u-h)!==f&&e&&e.length>1){const t=this._color.stops,e=Math.min(u,h),i=Math.max(u,h),n=e/f,r=i/f,a=r-n,d=t.filter((t=>t.offset>n&&t.offset<r)),c=Math.min(o,l),v=Math.max(o,l),p=this._colorScale.scale(c),g=this._colorScale.scale(v),y=[{offset:0,color:p}];d.forEach((t=>{y.push({offset:(t.offset-n)/a,color:t.color})})),y.push({offset:1,color:g}),s.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:y}))}}}function iy(t="bottom"){let e=0;const i=3.5,n=2.5;return"top"===t?`\n M${e},-6L${e-i},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+n},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-n},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-i},2.5\n v-5\n h7\n v5\n Z\n`}ey.defaultAttributes={layout:"horizontal",title:{align:"start",space:Hg,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}}},$g(),Xg(),ov();class ny extends Yg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ny.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:i,align:n,min:r,max:a,value:s,railWidth:o,railHeight:l,showHandler:u=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,sizeBackground:m,disableTriggerEvent:x}=this.attribute,_=co.group({x:0,y:0});this._innerView.add(_);const A=new ty({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:i,align:n,min:r,max:a,value:s,railWidth:o,railHeight:l,showHandler:u,handlerSize:h,handlerStyle:Object.assign({symbolType:iy(n)},d),railStyle:c,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,disableTriggerEvent:x});_.add(A);let k,B=0;const S=12;"horizontal"===i?"top"===n?(k=`M0,0L${o},0L${o},12Z`,B=l):(k=`M0,12L${o},12L${o},0Z`,A.setAttribute("y",S)):"left"===n?k=`M${o},0L${o},0L${o+S},${l}L${o},${l}Z`:(k=`M0,${l}L12,${l}L12,0Z`,A.setAttribute("x",S));const w=co.path(Object.assign(Object.assign({x:0,y:B,path:k},m),{zIndex:0}));_.add(w);const T=this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",Hg):0;_.translate(0-_.AABBBounds.x1,T-_.AABBBounds.y1),this._slider=A}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}ny.defaultAttributes={layout:"horizontal",title:{align:"start",space:Hg,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}},ev(),mv(),fv();class ry extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ry.defaultAttributes,t)),this.name="title"}render(){var t,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_,A,k,B,S,w,T,P,C,M,O,E,L,R,I,j,D,N,U,z,H,W;const{textType:V,text:F,subtextType:G,textStyle:Y={},subtext:X,subtextStyle:$={},width:q,height:K,minWidth:Z,maxWidth:J,minHeight:Q,maxHeight:tt,align:et,verticalAlign:it,padding:nt=0}=this.attribute,rt=e.normalizePadding(nt),at=this.createOrUpdateChild("title-container",{x:rt[3],y:rt[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==Y.visible)if("rich"===V||e.isValid(Y.character)){const e=Object.assign({x:null!==(t=Y.x)&&void 0!==t?t:0,y:null!==(i=Y.y)&&void 0!==i?i:0,width:null!==(r=null!==(n=Y.width)&&void 0!==n?n:q)&&void 0!==r?r:0,height:null!==(s=null!==(a=Y.height)&&void 0!==a?a:K)&&void 0!==s?s:0,ellipsis:null===(o=Y.ellipsis)||void 0===o||o,wordBreak:null!==(l=Y.wordBreak)&&void 0!==l?l:"break-word",maxHeight:Y.maxHeight,maxWidth:Y.maxWidth,textConfig:null!==(u=Y.character)&&void 0!==u?u:F},Y);this._mainTitle=at.createOrUpdateChild("mainTitle",e,"richtext")}else if("html"===V){const t=Object.assign({html:Object.assign(Object.assign({dom:F},zv),Y),x:null!==(h=Y.x)&&void 0!==h?h:0,y:null!==(d=Y.y)&&void 0!==d?d:0,width:null!==(f=null!==(c=Y.width)&&void 0!==c?c:q)&&void 0!==f?f:0,height:null!==(p=null!==(v=Y.height)&&void 0!==v?v:K)&&void 0!==p?p:0,ellipsis:null===(g=Y.ellipsis)||void 0===g||g,wordBreak:null!==(y=Y.wordBreak)&&void 0!==y?y:"break-word",maxHeight:Y.maxHeight,maxWidth:Y.maxWidth,textConfig:[]},Y);this._mainTitle=at.createOrUpdateChild("mainTitle",t,"richtext")}else e.isValid(F)&&(this._mainTitle=at.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:[F]},Y),{maxLineWidth:null!==(b=Y.maxLineWidth)&&void 0!==b?b:q,heightLimit:Y.heightLimit,lineClamp:Y.lineClamp,ellipsis:null===(m=Y.ellipsis)||void 0===m||m,x:0,y:0}),"wrapText"));const st=this._mainTitle?this._mainTitle.AABBBounds.height():0,ot=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==$.visible)if("rich"===G||e.isValid($.character)){const t=Object.assign({x:null!==(x=$.x)&&void 0!==x?x:0,y:null!==(_=$.y)&&void 0!==_?_:0,width:null!==(k=null!==(A=$.width)&&void 0!==A?A:q)&&void 0!==k?k:0,height:null!==(S=null!==(B=$.height)&&void 0!==B?B:K)&&void 0!==S?S:0,ellipsis:null===(w=$.ellipsis)||void 0===w||w,wordBreak:null!==(T=$.wordBreak)&&void 0!==T?T:"break-word",maxHeight:$.maxHeight,maxWidth:$.maxWidth,textConfig:null!==(P=$.character)&&void 0!==P?P:X},$);this._subTitle=at.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===G){const t=Object.assign({html:Object.assign(Object.assign({dom:X},zv),$),x:null!==(C=$.x)&&void 0!==C?C:0,y:null!==(M=$.y)&&void 0!==M?M:0,width:null!==(E=null!==(O=$.width)&&void 0!==O?O:q)&&void 0!==E?E:0,height:null!==(R=null!==(L=$.height)&&void 0!==L?L:K)&&void 0!==R?R:0,ellipsis:null===(I=$.ellipsis)||void 0===I||I,wordBreak:null!==(j=$.wordBreak)&&void 0!==j?j:"break-word",maxHeight:$.maxHeight,maxWidth:$.maxWidth,textConfig:[]},$);this._subTitle=at.createOrUpdateChild("subTitle",t,"richtext")}else e.isValid(X)&&(this._subTitle=at.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:[X]},$),{maxLineWidth:null!==(D=$.maxLineWidth)&&void 0!==D?D:q,heightLimit:$.heightLimit,lineClamp:$.lineClamp,ellipsis:null===(N=$.ellipsis)||void 0===N||N,x:0,y:st}),"wrapText"));const lt=this._subTitle?this._subTitle.AABBBounds.height():0,ut=this._subTitle?this._subTitle.AABBBounds.width():0;let ht=Math.max(ot,ut),dt=st+(null!==(U=$.height)&&void 0!==U?U:lt);if(e.isValid(q)&&(ht=q,this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",q),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",q)),e.isValid(K)&&(dt=K),e.isValid(Z)&&ht<Z&&(ht=Z),e.isValid(J)&&(this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",J),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",J),this._mainTitle&&this._mainTitle.setAttribute("maxWidth",J),this._subTitle&&this._subTitle.setAttribute("maxWidth",J),ht>J&&(ht=J)),e.isValid(Q)&&dt<Q&&(dt=Q),e.isValid(tt)&&(this._mainTitle&&this._mainTitle.setAttribute("maxHeight",tt),this._subTitle&&this._subTitle.setAttribute("maxHeight",tt-st),dt>tt&&(dt=tt)),at.attribute.width=ht,at.attribute.height=dt,at.attribute.boundsPadding=rt,this._mainTitle){if(e.isValid(et)||e.isValid(Y.align)){const t=Y.align?Y.align:et,e=null!==(z=Y.width)&&void 0!==z?z:ot;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(e.isValid(it)||e.isValid(Y.verticalAlign)){const t=Y.verticalAlign?Y.verticalAlign:it,e=Y.height?Y.height:dt;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(e.isValid(et)||e.isValid($.align)){const t=$.align?$.align:et,e=null!==(H=$.width)&&void 0!==H?H:ut;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(e.isValid(it)||e.isValid(Y.verticalAlign)){const t=$.verticalAlign?$.verticalAlign:it,e=st,i=null!==(W=$.height)&&void 0!==W?W:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}}ry.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};const ay={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};ev(),yv(),fv();const sy=(t,e)=>{let i=t.x0,n=t.x1;const r="number"==typeof e?t.thickness*e:t.thickness;let a=t.y0-t.thickness/2,s=t.y1-t.thickness/2;"center"===t.align?(a=t.y0-r/2,s=t.y1-r/2):"end"===t.align&&(a=t.y0+t.thickness/2-r,s=t.y1+t.thickness/2-r);let o=(i+n)/2,l=a+r,u=s+r;t.round&&(i=Math.round(i),n=Math.round(n),a=Math.round(a),s=Math.round(s),l=Math.round(l),u=Math.round(u),o=Math.round(o));const h=Math.abs(n-i)>1e-6,d=t.endArrow&&h?`L${n},${s-r/2}L${n+r},${(s+u)/2}L${n},${u+r/2}`:"",c=t.startArrow&&h?`L${i},${l+r/2}L${i-r},${(a+l)/2}L${i},${a-r/2}`:"";return!1===t.isSmooth?`M${i},${a}L${n},${s}${d}L${n},${u}L${i},${l}${c}Z`:`M${i},${a}\n C${o},${a},${o},${s},${n},${s}\n ${d}\n L${n},${u}\n C${o},${u},${o},${l},${i},${l}\n ${c}\n Z`},oy=(t,e)=>{let i=t.y0,n=t.y1,r=t.x0-t.thickness/2,a=t.x1-t.thickness/2;const s="number"==typeof e?t.thickness*e:t.thickness;"center"===t.align?(r=t.x0-s/2,a=t.x1-s/2):"end"===t.align&&(r=t.x0+t.thickness/2-s,a=t.x1+t.thickness/2-s);let o=(i+n)/2,l=r+s,u=a+s;t.round&&(i=Math.round(i),n=Math.round(n),r=Math.round(r),a=Math.round(a),l=Math.round(l),u=Math.round(u),o=Math.round(o));const h=Math.abs(n-i)>1e-6,d=t.endArrow&&h?`L${a-s/2},${n}L${(a+u)/2},${n+s}L${u+s/2},${n}`:"",c=t.startArrow&&h?`L${l+s/2},${i}L${(l+r)/2},${i-s}L${r-s/2},${i}`:"";return!1===t.isSmooth?`M${r},${i}L${a},${n}${d}L${u},${n}L${l},${i}${c}Z`:`M${r},${i}\n C${r},${o},${a},${o},${a},${n}\n ${d}\n L${u},${n}\n C${u},${o},${l},${o},${l},${i}\n ${c}\n Z`};ev(),ov();class ly extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ly.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?oy:sy,i="number"==typeof this.attribute.ratio&&this.attribute.ratio>=0&&this.attribute.ratio<=1,n=["direction","x0","x1","y0","y1","thickness","round","ratio","align","isSmooth","backgroudStyle"],r={};if(Object.keys(this.attribute).forEach((t=>{n.includes(t)||(r[t]=this.attribute[t])})),i){const t=this.createOrUpdateChild("sankey-link-background",Object.assign({},r,this.attribute.backgroudStyle,{path:e(this.attribute,1),visible:!0,pickable:!1,zIndex:-1}),"path");this._backPath=t}else this._backPath&&this._backPath.setAttribute("visible",!1);const a=this.createOrUpdateChild("sankey-link-front",Object.assign({},r,{path:e(this.attribute,i?this.attribute.ratio:1),pickable:!1}),"path");this._frontPath=a}}ly.defaultAttributes={direction:"horizontal",align:"start"};class uy extends xs{constructor(t){super(t)}}var hy,dy;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(hy||(hy={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(dy||(dy={}));class cy extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},cy.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},cy.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},cy.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},cy.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},cy.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,n;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(n=this._forwardAttr.style.symbolType)&&void 0!==n?n:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{e.isNil(this._playController)&&(this._playController=new uy(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{e.isNil(this._backwardController)&&(this._backwardController=new uy(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{e.isNil(this._forwardController)&&(this._forwardController=new uy(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent("ControllerEventEnum.OnPlay")},this.pause=()=>{this._dispatchEvent("ControllerEventEnum.OnPause")},this.forward=()=>{this._dispatchEvent("ControllerEventEnum.OnForward")},this.backward=()=>{this._dispatchEvent("ControllerEventEnum.OnBackward")},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}cy.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},cy.defaultAttributes={[dy.Start]:{},[dy.Pause]:{},[dy.Backward]:{},[dy.Forward]:{}};const fy={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},vy=[200,10];var py,gy;t.DirectionEnum=void 0,(py=t.DirectionEnum||(t.DirectionEnum={})).Default="default",py.Reverse="reverse",t.PlayerEventEnum=void 0,(gy=t.PlayerEventEnum||(t.PlayerEventEnum={})).change="change",gy.play="play",gy.pause="pause",gy.backward="backward",gy.forward="forward",gy.end="end",gy.OnChange="change",gy.OnPlay="play",gy.OnPause="pause",gy.OnBackward="backward",gy.OnForward="forward",gy.OnEnd="end";const yy=({direction:e,maxIndex:i,minIndex:n,dataIndex:r})=>(({direction:e,maxIndex:i,dataIndex:n})=>e===t.DirectionEnum.Default&&n===i)({direction:e,maxIndex:i,dataIndex:r})||(({direction:e,minIndex:i,dataIndex:n})=>e===t.DirectionEnum.Reverse&&n===i)({direction:e,minIndex:n,dataIndex:r}),by=({direction:e,maxIndex:i,minIndex:n,dataIndex:r})=>(({direction:e,minIndex:i,dataIndex:n})=>e===t.DirectionEnum.Default&&n===i)({direction:e,minIndex:n,dataIndex:r})||(({direction:e,maxIndex:i,dataIndex:n})=>e===t.DirectionEnum.Reverse&&n===i)({direction:e,maxIndex:i,dataIndex:r}),my=t=>"top"===t||"bottom"===t;class xy extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},xy.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var t,i,n;let r;e.isValidNumber(this._handlerStyle.size)?r=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(r=e.max(this._handlerStyle.size[0],this._handlerStyle.size[1]));const a={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:e.isValidNumber(r)?r:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(my(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(i=this._railStyle.height)&&void 0!==i?i:vy[1];a.layout="horizontal",a.railHeight=e,a.railWidth=t,a.x=this._layoutInfo.slider.x,a.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(n=this._railStyle.width)&&void 0!==n?n:vy[1];a.layout="vertical",a.railWidth=e,a.railHeight=t,a.x=this._layoutInfo.slider.x,a.y=this._layoutInfo.slider.y}return a},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new ty(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return my(this._orient)?(t.layout="horizontal",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})):(t.layout="vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new cy(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initLayoutInfo(){var t,i,n;const r=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),a=r.filter((t=>"end"!==t.position)),s=r.filter((t=>"end"===t.position)),o=null!==(t=my(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:vy[1],l=r.reduce(((t,i)=>{const n=i.style.size,r=e.isNumber(n)?n:e.max(n[0],n[1]);return t+i.space+r}),0),u=this._sliderVisible?(my(this._orient)?null===(i=this._size)||void 0===i?void 0:i.width:null===(n=this._size)||void 0===n?void 0:n.height)-l:0,h=u-this.attribute.slider.space,d=a.reduce(((t,i)=>{const{key:n,space:r,style:{size:a}}=i,s=e.isNumber(a)?a:e.max(a[0],a[1]);return this._layoutInfo[n]=Object.assign(Object.assign({},this._layoutInfo[n]),{size:s,x:my(this._orient)?t+r:(this._size.width-s)/2,y:my(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:my(this._orient)?d+this.attribute.slider.space:(this._size.width-o)/2,y:my(this._orient)?(this._size.height-o)/2:d+this.attribute.slider.space}),s.reduce(((t,i)=>{const{key:n,space:r,style:{size:a}}=i,s=e.isNumber(a)?a:e.max(a[0],a[1]);return this._layoutInfo[n]=Object.assign(Object.assign({},this._layoutInfo[n]),{size:s,x:my(this._orient)?t+r:(this._size.width-s)/2,y:my(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),d+u)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}function _y(){Xg(),ev(),pv()}xy.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},fy),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},fy),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},fy),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},fy),{key:"backward",position:"start"})}},_y();_y();var Ay;t.IOperateType=void 0,(Ay=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",Ay.drawEnd="drawEnd",Ay.drawing="drawing",Ay.moving="moving",Ay.moveStart="moveStart",Ay.moveEnd="moveEnd",Ay.brushClear="brushClear";const ky={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},By=5;const Sy={debounce:e.debounce,throttle:e.throttle};ev(),uv();class wy extends rd{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},wy.defaultAttributes,i)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||(t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushEnd=e=>{e.preventDefault();const{removeOnClick:i=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&i?(this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={},this._dispatchEvent(t.IOperateType.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})):this._outOfInteractiveRange(e)||(this._activeDrawState&&this._dispatchEvent(t.IOperateType.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e}),this._activeMoveState&&this._dispatchEvent(t.IOperateType.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0,trigger:i=ky.trigger,updateTrigger:n=ky.updateTrigger,endTrigger:r=ky.endTrigger,resetTrigger:a=ky.resetTrigger}=this.attribute;this.stage.addEventListener(i,this._onBrushStart),this.stage.addEventListener(n,Sy[t](this._onBrushing,e)),this.stage.addEventListener(r,this._onBrushEnd),this.stage.addEventListener(a,this._onBrushEnd)}_isPosInBrushMask(t){const i=this.eventPosToStagePos(t),n=this._container.getChildren();for(let t=0;t<n.length;t++){const{points:r=[],dx:a=0,dy:s=0}=n[t].attribute,o=r.map((t=>({x:t.x+a,y:t.y+s})));if(e.polygonContainPoint(o,i.x,i.y))return this._operatingMask=n[t],!0}return!1}_initDraw(e){const{brushMode:i}=this.attribute,n=this.eventPosToStagePos(e);this._cacheDrawPoints=[n],this._isDrawedBeforeEnd=!1,"single"===i&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(t.IOperateType.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_initMove(e){var i,n;this._cacheMovePoint=this.eventPosToStagePos(e),this._operatingMaskMoveDx=null!==(i=this._operatingMask.attribute.dx)&&void 0!==i?i:0,this._operatingMaskMoveDy=null!==(n=this._operatingMask.attribute.dy)&&void 0!==n?n:0;const{interactiveRange:r}=this.attribute,{minY:a=-1/0,maxY:s=1/0,minX:o=-1/0,maxX:l=1/0}=r,{x1:u,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,f=o-u,v=l-h,p=a-d,g=s-c;this._operatingMaskMoveRangeX=[f,v],this._operatingMaskMoveRangeY=[p,g],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(t.IOperateType.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_drawing(e){var i,n;const r=this.eventPosToStagePos(e),{x1:a=0,x2:s=0,y1:o=0,y2:l=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds,{sizeThreshold:u=By,brushType:h}=this.attribute,d=this._cacheDrawPoints.length;if(this._isDrawedBeforeEnd=!!(Math.abs(s-a)>u||Math.abs(o-l)>u),d>0){const t=null!==(n=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==n?n:{};if(r.x===t.x&&r.y===t.y)return}"polygon"===h||d<=1?this._cacheDrawPoints.push(r):this._cacheDrawPoints[d-1]=r;const c=this._computeMaskPoints();this._operatingMask.setAttribute("points",c),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(t.IOperateType.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_moving(e){const i=this._cacheMovePoint,n=this.eventPosToStagePos(e);if(n.x===(null==i?void 0:i.x)&&n.y===(null==i?void 0:i.y))return;const r=n.x-i.x,a=n.y-i.y,s=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],r))+this._operatingMaskMoveDx,o=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],a))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:s,dy:o}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(t.IOperateType.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_computeMaskPoints(){const{brushType:t,xRange:i=[0,0],yRange:n=[0,0]}=this.attribute;let r=[];const a=this._cacheDrawPoints[0],s=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return r="rect"===t?[a,{x:s.x,y:a.y},s,{x:a.x,y:s.y}]:"x"===t?[{x:a.x,y:n[0]},{x:s.x,y:n[0]},{x:s.x,y:n[1]},{x:a.x,y:n[1]}]:"y"===t?[{x:i[0],y:a.y},{x:i[0],y:s.y},{x:i[1],y:s.y},{x:i[1],y:a.y}]:e.cloneDeep(this._cacheDrawPoints),r}_addBrushMask(){var t;const{brushStyle:i,hasMask:n}=this.attribute,r=co.polygon(Object.assign(Object.assign({points:e.cloneDeep(this._cacheDrawPoints),cursor:"move",pickable:!1},i),{opacity:n?null!==(t=i.opacity)&&void 0!==t?t:1:0}));r.name=`brush-${Date.now()}`,this._operatingMask=r,this._container.add(r),this._brushMaskAABBBoundsDict[r.name]=r.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:n=1/0,minX:r=-1/0,maxX:a=1/0}=e,s=this.eventPosToStagePos(t);return s.x>a||s.x<r||s.y>n||s.y<i}eventPosToStagePos(t){var e,i;const{x:n,y:r}=wh.mapToCanvasPoint(t);return{x:n-((null===(e=this.stage)||void 0===e?void 0:e.x)||0),y:r-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}render(){this._bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0,trigger:i=ky.trigger,updateTrigger:n=ky.updateTrigger,endTrigger:r=ky.endTrigger,resetTrigger:a=ky.resetTrigger}=this.attribute;this.stage.removeEventListener(i,this._onBrushStart),this.stage.removeEventListener(n,Sy[t](this._onBrushing,e)),this.stage.removeEventListener(r,this._onBrushEnd),this.stage.removeEventListener(a,this._onBrushEnd)}}wy.defaultAttributes=ky;const Ty=(t,...i)=>{const n=[t.shape,...i.map((t=>null==t?void 0:t.shape))],r=[t.key,...i.map((t=>null==t?void 0:t.key))],a=[t.value,...i.map((t=>null==t?void 0:t.value))];return e.merge(t,...i,{shape:n.every(e.isNil)?void 0:e.merge({},...n),key:r.every(e.isNil)?void 0:e.merge({},...r),value:a.every(e.isNil)?void 0:e.merge({},...a)})},Py=t=>{const{width:i,height:n,wordBreak:r="break-word",textAlign:a,textBaseline:s,text:o}=t;return Array.isArray(o)?{width:i,height:n,wordBreak:r,textAlign:a,textBaseline:s,singleLine:!1,textConfig:e.array(o).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:i,height:n,wordBreak:r,textAlign:a,textBaseline:s,singleLine:!1,textConfig:o.text}},Cy={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Dv,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Dv,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Dv,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new e.AABBBounds).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},My=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];const Oy="tooltip-title",Ey="tooltip-content",Ly="shape",Ry="value";ev(),dv(),pv(),yv(),fv();class Iy extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Iy.defaultAttributes,t),i),this.name="tooltip"}render(){var t;const{visible:i,content:n,panel:r,keyWidth:a,valueWidth:s,hasContentShape:o,autoCalculatePosition:l,autoMeasure:u}=this.attribute;if(!i)return void this.hideAll();u&&Iy.measureTooltip(this.attribute),l&&Iy.calculateTooltipPosition(this.attribute);const h=e.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},r),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(Oy,{visible:!0,x:h[3],y:h[0]},"group");const d=Iy.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${Oy}-${Ly}`,e.merge({symbolType:"circle"},d.shape,{visible:wv(d)&&wv(d.shape)}),"symbol"),"object"!=typeof d.value.text||null===d.value.text||"rich"!==d.value.text.type&&"html"!==d.value.text.type?d.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Oy}-${Ry}`,Object.assign({visible:wv(d)&&wv(d.value)},Py(d.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Oy}-${Ry}`,Object.assign({text:null!==(t=d.value.text)&&void 0!==t?t:"",visible:wv(d)&&wv(d.value)},d.value),"text"):"rich"===d.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Oy}-${Ry}`,Object.assign({visible:wv(d)&&wv(d.value)},Py(d.value)),"richtext"):"html"===d.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Oy}-${Ry}`,Object.assign({html:Object.assign(Object.assign({dom:d.value.text.text},zv),d.value),visible:wv(d)&&wv(d.value),width:d.value.width,height:d.value.height,wordBreak:d.value.wordBreak,textAlign:d.value.textAlign,textBaseline:d.value.textBaseline,singleLine:!1,textConfig:[]},d.value),"richtext"));const c=wv(d.shape)?d.shape.size+d.shape.spacing:0,{textAlign:f,textBaseline:v}=d.value,p=r.width-h[3]-h[0]-c;"center"===f?this._tooltipTitle.setAttribute("x",c+p/2):"right"===f||"end"===f?this._tooltipTitle.setAttribute("x",c+p):this._tooltipTitle.setAttribute("x",c),"bottom"===v?this._tooltipTitle.setAttribute("y",d.height):"middle"===v?this._tooltipTitle.setAttribute("y",d.height/2):this._tooltipTitle.setAttribute("y",0);const g=wv(d)?d.height+d.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(Ey,{visible:!0},"group"),this._tooltipContent.removeAllChild(),n&&n.length){this._tooltipContent.setAttribute("x",h[3]),this._tooltipContent.setAttribute("y",h[0]+g);let t=0;n.forEach(((i,n)=>{var r,l,u;const h=Iy.getContentAttr(this.attribute,n);if(!wv(h))return;const d=`${Ey}-${n}`,c=this._tooltipContent.createOrUpdateChild(d,{visible:!0,x:0,y:t},"group");let f=0;if(wv(h.shape)&&c.createOrUpdateChild(`${d}-${Ly}`,Object.assign({visible:!0,x:h.shape.size/2,y:h.shape.size/2+((null!==(r=nn(h.key.lineHeight,h.key.fontSize))&&void 0!==r?r:h.key.fontSize)-h.shape.size)/2},h.shape),"symbol"),o&&(f+=h.shape.size+h.shape.spacing),wv(h.key)){let t;t=h.key.multiLine?c.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},Py(h.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.key.text||null===h.key.text||"rich"!==h.key.text.type&&"html"!==h.key.text.type?c.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0,text:null!==(l=h.key.text)&&void 0!==l?l:""},h.key),{textBaseline:"top"}),"text"):"rich"===h.key.text.type?c.createOrUpdateChild(`${d}-${Ry}`,Object.assign(Object.assign({visible:!0},Py(h.key)),{textBaseline:"top"}),"richtext"):c.createOrUpdateChild(`${d}-${Ry}`,{html:Object.assign(Object.assign({dom:h.key.text.text},zv),h.key)},"richtext");const{textAlign:e}=h.key;"center"===e?t.setAttribute("x",f+a/2):"right"===e||"end"===e?t.setAttribute("x",f+a):t.setAttribute("x",f),t.setAttribute("y",0),f+=a+h.key.spacing}if(wv(h.value)){let t;t=h.value.multiLine?c.createOrUpdateChild(`${d}-${Ry}`,Object.assign(Object.assign({visible:!0},Py(h.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.value.text||null===h.value.text||"rich"!==h.value.text.type&&"html"!==h.value.text.type?c.createOrUpdateChild(`${d}-${Ry}`,Object.assign(Object.assign({visible:!0,text:null!==(u=h.value.text)&&void 0!==u?u:""},h.value),{textBaseline:"top"}),"text"):"rich"===h.value.text.type?c.createOrUpdateChild(`${d}-${Ry}`,Object.assign(Object.assign({visible:!0},Py(h.value)),{textBaseline:"top"}),"richtext"):c.createOrUpdateChild(`${d}-${Ry}`,{html:Object.assign({dom:h.value.text.text,container:"",width:30,height:30,style:{}},h.value)},"richtext");let i="right";e.isValid(h.value.textAlign)?i=h.value.textAlign:wv(h.key)||(i="left"),t.setAttribute("textAlign",i),"center"===i?t.setAttribute("x",f+s/2):"right"===i||"end"===i?t.setAttribute("x",f+s):t.setAttribute("x",f),f+=s,t.setAttribute("y",0),c.add(t)}t+=h.height+h.spaceRow}))}}setAttributes(t,i){const n=Object.keys(t);this.attribute.autoCalculatePosition&&n.every((t=>My.includes(t)))?(this._mergeAttributes(t,n),e.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&Iy.measureTooltip(this.attribute),Iy.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},i)):super.setAttributes(t,i)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:n,offsetY:r,pointerX:a,pointerY:s,positionX:o,positionY:l,parentBounds:u}=t;let h=a,d=s;return"left"===o?h-=e+n:"center"===o?h-=e/2:h+=n,"top"===l?d-=i+r:"middle"===l?d-=i/2:d+=r,h+e>u.x2&&(h-=e+n),d+i>u.y2&&(d-=i+r),h<u.x1&&(h=u.x1),d<u.y1&&(d=u.y1),t.x=h,t.y=d,t}static measureTooltip(t){const{content:i,contentStyle:n}=t,r=e.normalizePadding(t.padding),a=Iy.getTitleAttr(t);let s=0,o=r[0]+r[2],l=0;const{value:u,shape:h}=a,{visible:d=!1,symbolType:c=""}=null!=h?h:{};if(e.isValid(u)&&"object"!=typeof a.value.text){const{width:t,height:e}=Hv(u).quickMeasure(u.text);s=t,l=e}if(d&&gs[c]&&(s+=h.size+h.spacing,l=Math.max(h.size,l)),t.title&&(t.title.width=s,t.title.height=l),wv(a)&&(o+=l+a.spaceRow),i&&i.length){const e=[];if(i.forEach(((i,n)=>{const r=Iy.getContentAttr(t,n);(i.key||i.value)&&wv(r)&&e.push([i,r])})),e.length){let r=!1;const a=[],l=[],u=[];e.forEach((([t,i],s)=>{var h;const{key:d,value:c,shape:f,spaceRow:v}=i,p=wv(f),g=null!==(h=null==f?void 0:f.symbolType)&&void 0!==h?h:"",y=Hv(d),b=Hv(c);let m=0;if(wv(d)){const{width:t,height:e}=y.quickMeasure(d.text);l.push(t),m=Math.max(m,e)}if(wv(c)){const{width:t,height:e}=b.quickMeasure(c.text);u.push(t),m=Math.max(m,e)}p&&gs[g]&&(r=!0,a.push(f.size),m=Math.max(f.size,m)),t.height=m,o+=m,s<e.length-1&&(o+=null!=v?v:n.spaceRow)}));const h=a.length?Math.max(...a):0,d=l.length?Math.max(...l):0,c=u.length?Math.max(...u):0;s=Math.max(d+c+n.key.spacing+n.value.spacing+(r?h+n.shape.spacing:0),s),i.forEach((t=>{t.width=s})),t.hasContentShape=r,t.keyWidth=d,t.valueWidth=c}}return t.panel.width=s+r[1]+r[3],t.panel.height=o,t}static getTitleAttr(t){return Ty({},Iy.defaultAttributes.titleStyle,Iy.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return Ty({},Iy.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}Iy.defaultAttributes=Cy;ev(),dv(),mv(),nv();class jy extends rd{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},jy.defaultAttributes,t)),this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("click",this.handleClick)}render(){this.removeAllChild(),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new ws(e.merge({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t&&this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new Os(e.merge({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Os(e.merge({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new Xr(e.merge({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,i=this._text.AABBBounds.height(),n=Math.max(t,e,i),r=n/2-t/2,a=n/2-e/2,s=n/2-i/2,o=this.attribute.box.width,l=this.attribute.icon.width,u=Math.max(o,l),h=u/2-o/2,d=u/2-l/2,c=u+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:h,y:r}),this._checkIcon.setAttributes({x:d,y:a}),this._indeterminateIcon.setAttributes({x:d,y:a}),this._text.setAttributes({x:c,y:s})}handleClick(){this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}))}}jy.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};t.AbstractComponent=rd,t.ArcInfo=Rp,t.ArcLabel=Ip,t.AreaLabel=jp,t.BasePlayer=xy,t.Brush=wy,t.CheckBox=jy,t.CircleAxis=ug,t.CircleAxisGrid=pg,t.CircleCrosshair=ip,t.ColorContinuousLegend=ey,t.ContinuousPlayer=class extends xy{constructor(e){super(e),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t,e;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3,this._dataIndex=null!==(e=this.attribute.dataIndex)&&void 0!==e?e:this._minIndex;const i=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=i?i:1)):(this._totalDuration=this._interval*i,this._interval=this.attribute.interval)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(hy.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(hy.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(hy.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(hy.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,n=i/this._maxIndex;this._elapsed=n*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=e=>{const i=Math.floor(e);i!==this._activeIndex&&(this._dataIndex=i,this._activeIndex=i,i!==this._maxIndex&&this.dispatchCustomEvent(t.PlayerEventEnum.change))},this.play=()=>Bv(this,void 0,void 0,(function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(t.PlayerEventEnum.play),this._rafId=wh.getRequestAnimationFrame()(this._play.bind(this)))})),this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=wh.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,wh.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,wh.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed-i;n<=0?(this._elapsed=0,this._startTime=e):(this._elapsed=n,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed+i;n>=this._totalDuration?(this._startTime=e-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-i,this._elapsed=n),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=Ug,t.DEFAULT_ITEM_SPACE_ROW=zg,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=Wg,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=Fp,t.DEFAULT_TITLE_SPACE=Hg,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=Up,t.DataZoom=_g,t.DiscreteLegend=Kg,t.DiscretePlayer=class extends xy{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},i)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var i,n,r,a;super._initAttributes(),this._alternate=null!==(i=this.attribute.alternate)&&void 0!==i&&i,this._interval=null!==(n=this.attribute.interval)&&void 0!==n?n:1e3,this._direction=null!==(r=this.attribute.direction)&&void 0!==r?r:t.DirectionEnum.Default,this._dataIndex=e.isNil(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(a=this.attribute.dataIndex)&&void 0!==a?a:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(hy.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(hy.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(hy.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(hy.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(e=>{const i=Math.floor(e.detail.value)+.5;this._dataIndex=e.detail.value>=i?Math.ceil(e.detail.value):Math.floor(e.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(t.PlayerEventEnum.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(yy({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||by({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===t.DirectionEnum.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(t.PlayerEventEnum.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=wh.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=e=>{const i=Date.now();if(this._isReachEnd&&i-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();e&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(t.PlayerEventEnum.change),this._activeIndex=this._dataIndex):i-this._tickTime>=this._interval&&(this._tickTime=i,this._updateDataIndex(((t,e,i,n)=>"default"===t?Math.min(e+1,n):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(t.PlayerEventEnum.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=wh.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),wh.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,wh.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.GroupFadeIn=class extends ji{constructor(t,e,i,n){super(null,null,i,n)}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 ji{constructor(t,e,i,n){super(null,null,i,n)}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.GroupTransition=class extends ji{constructor(){super(...arguments),this.mode=_t.NORMAL}onBind(){const t=this.target.getInnerView(),i=this.target.getPrevInnerView();i&&(this._oldElementMap=function(t){const e={};return Sv(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(i),this._newElementAttrMap={},Sv(t,(t=>{var i,n,r,a,s,o;if("group"!==t.type&&t.id){const l=this._oldElementMap[t.id];if(l){if(!e.isEqual(t.attribute,l.attribute)){const a=e.cloneDeep(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},a),{opacity:null!==(i=a.opacity)&&void 0!==i?i:1,fillOpacity:null!==(n=a.fillOpacity)&&void 0!==n?n:1,strokeOpacity:null!==(r=a.strokeOpacity)&&void 0!==r?r:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(a=t.attribute.opacity)&&void 0!==a?a:1,fillOpacity:null!==(s=t.attribute.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,i=this.easing;Object.keys(this._newElementAttrMap).forEach((n=>{var r;const{node:a,attrs:s,state:o}=this._newElementAttrMap[n];if("enter"===o){const{enter:n={}}=null!==(r=this.params)&&void 0!==r?r:{};t=e.isValidNumber(n.duration)?n.duration:t,i=n.easing?n.easing:i}"path"===a.type?a.animate({interpolate:(t,i,n,r,a)=>"path"===t&&(a.path=e.interpolateString(n,r)(i),!0)}).to(s,t,i):a.animate().to(s,t,i)}))}onUpdate(t,e,i){}},t.Indicator=class extends rd{constructor(){super(...arguments),this.name="indicator"}render(){var t,i,n;const{visible:r,title:a={},content:s,size:o,limitRatio:l=1/0}=this.attribute,u=Math.min(o.width,o.height)*l,h=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1},"group");if(!0!==r)return void(h&&h.hideAll());if(e.isValid(a))if(!1!==a.visible){const n=e.merge({},e.get(ay,"title.style"),a.style);"rich"===n.type?this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:n.text},n),{visible:a.visible,x:0,y:0,width:null!==(t=n.width)&&void 0!==t?t:0,height:null!==(i=n.height)&&void 0!==i?i:0}),"richtext"):"html"===n.type?this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:n.text},zv),n)},n),{visible:a.visible,x:0,y:0}),"richtext"):this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({},n),{lineHeight:e.isValid(n.lineHeight)?n.lineHeight:n.fontSize,visible:a.visible,x:0,y:0}),"text"),a.autoFit&&e.isValidNumber(u)&&this._setAutoFit(u,this._title,a),a.autoLimit&&e.isValidNumber(l)&&this._title.setAttribute("maxLineWidth",u)}else{const t=h.find((t=>"indicator-title"===t.name),!1);t&&h.removeChild(t),this._title=void 0}const d=this._title?this._title.AABBBounds.height():0;if(e.isValid(s)){const t=this._title&&a.space?a.space:0,i=e.array(s),n=[];let r=0;i.forEach(((i,s)=>{var o,c;if(!1!==i.visible){const f=e.merge({},e.get(ay,"content.style"),i.style);let v;v="rich"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:f.text},f),{visible:a.visible,x:0,y:d+t+r,width:null!==(o=f.width)&&void 0!==o?o:0,height:null!==(c=f.height)&&void 0!==c?c:0}),"richtext"):"html"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:f.text},zv),f)},f),{visible:a.visible,x:0,y:d+t+r}),"richtext"):h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({},f),{lineHeight:e.isValid(f.lineHeight)?f.lineHeight:f.fontSize,visible:i.visible,x:0,y:d+t+r}),"text"),i.autoFit&&e.isValidNumber(u)&&this._setAutoFit(u,v,i),i.autoLimit&&e.isValidNumber(l)&&v.setAttribute("maxLineWidth",u),n.push(v);const p=i.space?i.space:0;r+=v.AABBBounds.height()+p}else{const t=h.find((t=>t.name==="indicator-content-"+s),!1);t&&h.removeChild(t)}})),this._content=n}const c=null!==(n=null==h?void 0:h.AABBBounds.height())&&void 0!==n?n:0;h.setAttribute("y",o.height/2-c/2),h.setAttribute("x",o.width/2)}_setAutoFit(t,i,n){var r,a,s,o,l,u;const h=Wv(null!==(a=null===(r=n.style)||void 0===r?void 0:r.text)&&void 0!==a?a:"",null!==(s=n.style)&&void 0!==s?s:{}).width;if(h>0){const r=t*(null!==(o=n.fitPercent)&&void 0!==o?o:.5)/h,a=Math.floor((null!==(u=null===(l=n.style)||void 0===l?void 0:l.fontSize)&&void 0!==u?u:20)*r);i.setAttribute("fontSize",a),i.setAttribute("lineHeight",e.isValid(n.style.lineHeight)?n.style.lineHeight:a)}}},t.LabelBase=Mp,t.LineAxis=ag,t.LineAxisGrid=vg,t.LineCrosshair=tp,t.LineDataLabel=Dp,t.LineLabel=Lp,t.LinkPath=ly,t.MarkArea=Rg,t.MarkLine=Lg,t.MarkPoint=Ig,t.Pager=Ng,t.PolygonCrosshair=rp,t.PopTip=$v,t.RectCrosshair=ep,t.RectLabel=Ep,t.ScrollBar=_v,t.SectorCrosshair=np,t.Segment=Hp,t.SizeContinuousLegend=ny,t.Slider=ty,t.SymbolLabel=Op,t.Tag=Fv,t.Title=ry,t.Tooltip=Iy,t.VTag=function(t){return new Fv(t?t.attribute:{})},t.getHorizontalPath=sy,t.getSizeHandlerPath=iy,t.getVerticalPath=oy,t.loadPoptip=function(){ri.load(Jv)},t.setPoptipTheme=function(t){e.merge(Yv.poptip,Gv,t)},t.version="0.18.0-alpha.0"}));