@visactor/vrender 0.19.4-alpha.4 → 0.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";function e(t,e,i){return e=h(e),v(t,n()?Reflect.construct(e,i||[],h(t).constructor):e.apply(t,i))}function n(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(n=function(){return!!t})()}function i(){i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,i){var r=e&&e.prototype instanceof m?e:m,o=Object.create(r.prototype),s=new M(i||[]);return a(o,"_invoke",{value:C(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",v="suspendedYield",p="executing",y="completed",g={};function m(){}function b(){}function k(){}var x={};c(x,s,(function(){return this}));var w=Object.getPrototypeOf,A=w&&w(w(E([])));A&&A!==n&&r.call(A,s)&&(x=A);var S=k.prototype=m.prototype=Object.create(x);function T(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function B(t,e){function n(i,a,o,s){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(c).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(a,a):a()}})}function C(e,n,i){var r=f;return function(a,o){if(r===p)throw Error("Generator is already running");if(r===y){if("throw"===a)throw o;return{value:t,done:!0}}for(i.method=a,i.arg=o;;){var s=i.delegate;if(s){var u=_(s,i);if(u){if(u===g)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===f)throw r=y,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=p;var l=d(e,n,i);if("normal"===l.type){if(r=i.done?y:v,l.arg===g)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=y,i.method="throw",i.arg=l.arg)}}}function _(e,n){var i=n.method,r=e.iterator[i];if(r===t)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=t,_(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),g;var a=d(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function R(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function E(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=k,a(S,"constructor",{value:k,configurable:!0}),a(k,"constructor",{value:b,configurable:!0}),b.displayName=c(k,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,c(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},T(B.prototype),c(B.prototype,u,(function(){return this})),e.AsyncIterator=B,e.async=function(t,n,i,r,a){void 0===a&&(a=Promise);var o=new B(h(t,n,i,r),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},T(S),c(S,l,"Generator"),c(S,s,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=E,M.prototype={constructor:M,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(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(i,r){return s.type="throw",s.arg=e,n.next=i,r&&(n.method="next",n.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;P(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:E(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),g}},e}function r(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function a(t){return a="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},a(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(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 f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return f(t)}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},p.apply(this,arguments)}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);u=!0);}catch(t){l=!0,r=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw r}}return s}}(t,e)||m(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 g(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(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 m(t,e){if(t){if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function k(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=m(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var x=function(){function t(){o(this,t)}return u(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}])}();x.auto_increment_id=0;var w=u((function t(e){o(this,t),this.id=x.GenAutoIncrementId(),this.registry=e})),A="named",S="inject",T="multi_inject",B="inversify:tagged",C="inversify:paramtypes",_=function(){return u((function t(e,n){o(this,t),this.key=e,this.value=n}),[{key:"toString",value:function(){return this.key===A?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")}}])}(),R=function(t){var e;return function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!o&&!s,l={create:o?function(){return T(Object.create(null))}:s?function(){return T({__proto__:null})}:function(){return T({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),h="object"==("undefined"==typeof process?"undefined":a(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=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:n,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 n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,r=n+1;r<i;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,a)},e.prototype.entries=function(){return new n(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function a(t,e){return e}function o(t,e){return[t,e]}}():Map,f=(h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new d}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()}}():Set,new(h||"function"!=typeof WeakMap?function(){var t=16,n=l.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=a(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=a(t,!1);return void 0!==e?l.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@@"+s()}while(l.has(n,t));return n[t]=!0,t}function a(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(){var e,n=(e=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):o(new Uint8Array(e),e):o(new Array(e),e));n[6]=79&n[6]|64,n[8]=191&n[8]|128;for(var i="",r=0;r<t;++r){var a=n[r];4!==r&&6!==r&&8!==r||(i+="-"),a<16&&(i+="0"),i+=a.toString(16).toLowerCase()}return i}}():WeakMap));function v(t,e,n){var i=f.get(t);if(m(i)){if(!n)return;i=new d,f.set(t,i)}var r=i.get(e);if(m(r)){if(!n)return;r=new d,i.set(e,r)}return r}function p(t,e,n){if(y(t,e,n))return!0;var i=S(e);return!b(i)&&p(t,i,n)}function y(t,e,n){var i=v(e,n,!1);return!m(i)&&!!i.has(t)}function g(t,e,n){if(y(t,e,n))return function(t,e,n){var i=v(e,n,!1);if(!m(i))return i.get(t)}(t,e,n);var i=S(e);return b(i)?void 0:g(t,i,n)}function m(t){return void 0===t}function b(t){return null===t}function k(t){return"object"==a(t)?null!==t:"function"==typeof t}function x(t,e){switch(function(t){if(null===t)return 1;switch(a(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 n=3===e?"string":5===e?"number":"default",r=function(t,e){var n=t[e];if(null!=n){if(!A(n))throw new TypeError;return n}}(t,i);if(void 0!==r){var o=r.call(t,n);if(k(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(A(n)){var i=n.call(t);if(!k(i))return i}var r=t.valueOf;if(A(r)){var a=r.call(t);if(!k(a))return a}}else{var o=t.valueOf;if(A(o)){var s=o.call(t);if(!k(s))return s}var u=t.toString;if(A(u)){var l=u.call(t);if(!k(l))return l}}throw new TypeError}(t,"default"===n?"number":n)}function w(t){var e=x(t,3);return function(t){return"symbol"==a(t)}(e)?e:function(t){return""+t}(e)}function A(t){return"function"==typeof t}function S(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var r=i.constructor;return"function"!=typeof r||r===t?e:r}function T(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,n,i){if(!k(n))throw new TypeError;return function(t,e,n,i){v(n,i,!0).set(t,e)}(t,e,n,i)})),t("hasMetadata",(function(t,e,n){if(!k(e))throw new TypeError;return m(n)||(n=w(n)),p(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!k(e))throw new TypeError;return m(n)||(n=w(n)),y(t,e,n)})),t("getMetadata",(function(t,e,n){if(!k(e))throw new TypeError;return m(n)||(n=w(n)),g(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function P(t,e,n,i){!function(t,e,n,i){var r,a=[i],o={};R.hasOwnMetadata(t,e)&&(o=R.getMetadata(t,e));var s=o[n];void 0===s&&(s=[]),(r=s).push.apply(r,a),o[n]=s,R.defineMetadata(t,o,e)}(B,t,n.toString(),i)}function M(t){return function(e,n,i){P(e,0,i,t)}}function E(t){return function(e){return function(n,i,r){return M(new _(t,e))(n,i,r)}}}var O=E(S),L=E(T);function I(){return function(t){return R.defineMetadata(C,null,t),t}}function D(t){return M(new _(A,t))}var j,U="Singleton",W="Transient",N="ConstantValue",F="DynamicValue",z="Factory",G="Function",H="Instance",V="Invalid",Y=function(){function t(e,n){o(this,t),this.id=x.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=e,this.scope=n,this.type=V,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}return u(t,[{key:"clone",value:function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===U&&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}}])}(),X=function(){return u((function t(){o(this,t)}),[{key:"getConstructorMetadata",value:function(t){return{compilerGeneratedMetadata:R.getMetadata(C,t),userGeneratedMetadata:R.getMetadata(B,t)||{}}}},{key:"getPropertiesMetadata",value:function(t){throw new Error("暂未实现")}}])}(),K=(j=A,function(t){var e=function(e){if(null==e)return!1;if(e.key===j&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;for(var n=e.constructorArgsMetadata,i=0;i<n.length;i++)if(n[i].key===j&&n[i].value===t)return!0;return!1};return e.metaData=new _(j,t),e}),q=function(){return u((function t(e){o(this,t),this._binding=e}),[{key:"inRequestScope",value:function(){throw new Error("暂未实现")}},{key:"inSingletonScope",value:function(){return this._binding.scope=U,this}},{key:"inTransientScope",value:function(){return this._binding.scope=W,this}},{key:"whenTargetNamed",value:function(t){return this._binding.constraint=K(t),this}}])}(),Z=function(){return u((function t(e){o(this,t),this._binding=e}),[{key:"to",value:function(t){return this._binding.type=H,this._binding.implementationType=t,new q(this._binding)}},{key:"toSelf",value:function(){var t=this._binding.serviceIdentifier;return this.to(t)}},{key:"toDynamicValue",value:function(t){return this._binding.type=F,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new q(this._binding)}},{key:"toConstantValue",value:function(t){return this._binding.type=N,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=U,new q(this._binding)}},{key:"toFactory",value:function(t){return this._binding.type=z,this._binding.factory=t,this._binding.scope=U,new q(this._binding)}},{key:"toService",value:function(t){this.toDynamicValue((function(e){return e.container.get(t)}))}}])}(),J=function(){return u((function t(e){o(this,t);var n=e||{};n.defaultScope=n.defaultScope||W,this.options=n,this.id=x.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new X}),[{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,n){var i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}},{key:"getNamed",value:function(t,e){return this.getTagged(t,A,e)}},{key:"isBound",value:function(t){return this._bindingDictionary.has(t)}},{key:"bind",value:function(t){var e=this.options.defaultScope,n=new Y(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new Z(n)}},{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},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}};return function(i){return{bindFunction:(r=i,function(n){var i=t.bind(n);return e(i,r),i}),isboundFunction:function(e){return t.isBound(e)},rebindFunction:n(i),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(t){return null}};var r}}},{key:"_getNotAllArgs",value:function(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}},{key:"_getAllArgs",value:function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}},{key:"_get",value:function(t){var e=this,n=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((function(e){return e.constraint(t)})).forEach((function(t){n.push(e._resolveFromBinding(t))})),t.isMultiInject||1!==n.length?n:n[0]}},{key:"_getChildRequest",value:function(t){for(var e=this,n=t.implementationType,i=this._metadataReader.getConstructorMetadata(n).userGeneratedMetadata,r=Object.keys(i),a=[],o=function(){var t=i[s],n={};t.forEach((function(t){n[t.key]=t.value}));var r={inject:n[S],multiInject:n[T]},o=r.inject||r.multiInject,u={serviceIdentifier:o,constructorArgsMetadata:t},l={injectIdentifier:o,metadata:t,bindings:e._bindingDictionary.get(o).filter((function(t){return t.constraint(u)}))};a.push(l)},s=0;s<r.length;s++)o();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 N:case G:e=t.cache;break;case H: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 n=this._getChildRequest(t);return this._createInstance(e,n)}},{key:"_createInstance",value:function(t,e){return e.length?function(t,e,i){if(n())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return i&&d(a,i.prototype),a}(t,g(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===U&&(t.cache=e,t.activated=!0)}}])}(),Q=Symbol("ContributionProvider"),$=function(){return u((function t(e,n){o(this,t),this.serviceIdentifier=e,this.container=n}),[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&(t=this.caches).push.apply(t,g(this.container.getAll(this.serviceIdentifier)))),this.caches}}])}();function et(t,e){t(Q).toDynamicValue((function(t){var n=t.container;return new $(e,n)})).inSingletonScope().whenTargetNamed(e)}function nt(t,e){t(Q).toDynamicValue((function(t){var n=t.container;return new $(e,n)})).whenTargetNamed(e)}var it=function(){return u((function t(e,n){o(this,t),this._args=e,this.name=n,this.taps=[]}),[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((function(t){return t.name!==n&&(!e||t.fn===e)})))}},{key:"_parseOptions",value:function(t,e,n){var i;if("string"==typeof e)i={name:e.trim()};else if("object"!=a(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i)}},{key:"_tap",value:function(t,e,n){this._insert(this._parseOptions(t,e,n))}},{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 n=0;"number"==typeof t.stage&&(n=t.stage);for(var i=this.taps.length;i>0;){i--;var r=this.taps[i];this.taps[i+1]=r;var a=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(a>n)){i++;break}}this.taps[i]=t}}])}(),rt=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}])}(it),at=Symbol.for("EnvContribution"),ot=Symbol.for("VGlobal"),st=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ut=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lt=function(t,e){return function(n,i){e(n,i,t)}};function ct(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.DefaultGlobal=function(){return u((function t(e){o(this,t),this.contributions=e,this.id=x.GenAutoIncrementId(),this.hooks={onSetEnv:new rt(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}),[{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,n=[];if(this.contributions.getContributions().forEach((function(i){var r=i.configure(e,t);r&&r.then&&n.push(r)})),n.length)return Promise.all(n)}},{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 n=this,i=this._env;this._env=t;var r=this.bindContribution(e);if(r&&r.then)return r.then((function(){n.envParams=e,n.hooks.onSetEnv.call(i,t,n)}));this.envParams=e,this.hooks.onSetEnv.call(i,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,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}},{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:"updateDom",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}},{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.DefaultGlobal=st([I(),lt(0,O(Q)),lt(0,D(at)),ut("design:paramtypes",[Object])],t.DefaultGlobal);var ht={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,o=new Array(a);r<a;r++)o[r]=i[r].fn;return o},s.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},s.prototype.emit=function(t,e,i,r,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,a),!0;case 6:return c.fn.call(c.context,e,i,r,a,o),!0}for(l=1,u=new Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,r);break;default:if(!u)for(d=1,u=new Array(h-1);d<h;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||o(this,a);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==e||r&&!s[u].once||i&&s[u].context!==i)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(ht);var dt=ct(ht.exports),ft=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},vt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||ft(t,"Boolean")},pt=function(t){return"function"==typeof t},yt=function(t){return null==t},gt=function(t){return null!=t},mt=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e},bt=function(t){return void 0===t},kt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"string"===n:"string"===n||ft(t,"String")},xt=function(t){return Array.isArray?Array.isArray(t):ft(t,"Array")},wt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"number"===n:"number"===n||ft(t,"Number")},At=function(t){return wt(t)&&Number.isFinite(t)},St=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Tt=function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)},Bt=Object.prototype.hasOwnProperty,Ct=function(t,e){return null!=t&&Bt.call(t,e)};function _t(t,e){if(!xt(t)||!xt(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var Rt=1e-10,Pt=1e-10;function Mt(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Rt,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Pt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}var Et=function(t,e,n){return t<e?e:t>n?n:t},Ot=1e-12,Lt=Math.PI,It=Lt/2,Dt=2*Lt,jt=2*Math.PI,Ut=Math.abs,Wt=Math.atan2,Nt=Math.cos,Ft=Math.max,zt=Math.min,Gt=Math.sin,Ht=Math.sqrt,Vt=Math.pow;function Yt(t){return t>1?0:t<-1?Lt:Math.acos(t)}function Xt(t){return t>=1?It:t<=-1?-It:Math.asin(t)}function Kt(t,e,n,i,r){var a,o;return"number"==typeof t&&"number"==typeof n&&(a=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(o=(1-r)*e+r*i),{x:a,y:o}}function qt(t,e){return t[0]*e[1]-t[1]*e[0]}function Zt(t){var e=t.toString().split(/[eE]/),n=(e[0].split(".")[1]||"").length-(+e[1]||0);return n>0?n:0}var Jt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n,this.x1=i,this.y1=r}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return wt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return wt(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}])}(),Qt=function(){return u((function t(){o(this,t)}),null,[{key:"distancePP",value:function(t,e){return Ht(Vt(t.x-e.x,2)+Vt(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,n,i){return Ht(Vt(t-n,2)+Vt(e-i,2))}},{key:"distancePN",value:function(t,e,n){return Ht(Vt(e-t.x,2)+Vt(n-t.y,2))}},{key:"pointAtPP",value:function(t,e,n){return new Jt((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}])}();function $t(t,e,n){var i=e.x1,r=e.y1,a=e.x2,o=e.y2;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*a+n.c*r+n.e,n.b*a+n.d*r+n.f),t.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),t.add(n.a*i+n.c*o+n.e,n.b*i+n.d*o+n.f),e)}var te=function(){function t(e){o(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return u(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return xt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return $t(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,n){var i=this.x1,r=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*i-u*r+l,u*i+s*r+c,s*i-u*o+l,u*i+s*o+c,s*a-u*r+l,u*a+s*r+c,s*a-u*o+l,u*a+s*o+c]}},{key:"scalePoints",value:function(t,e,n,i){return[t*this.x1+(1-t)*n,e*this.y1+(1-e)*i,t*this.x2+(1-t)*n,e*this.y2+(1-e)*i]}}])}(),ee=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(te);var ne=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Dt;)t+=Dt;else if(t>0)for(;t>Dt;)t-=Dt;return t};function ie(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var re=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;o(this,t),this.a=e,this.b=n,this.c=i,this.d=r,this.e=a,this.f=s}return u(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,n,i,r,a){return!(this.e!==r||this.f!==a||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}},{key:"setValue",value:function(t,e,n,i,r,a){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=a,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,n=this.b,i=this.c,r=this.d,a=this.e,o=this.f,s=new t,u=e*r-n*i;return s.a=r/u,s.b=-n/u,s.c=-i/u,s.d=e/u,s.e=(i*o-r*a)/u,s.f=-(e*o-n*a)/u,s}},{key:"rotate",value:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,a=this.a*-n+this.c*e,o=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=a,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,n){var i=Math.cos(t),r=Math.sin(t),a=(1-i)*e+r*n,o=(1-i)*n-r*e,s=i*this.a-r*this.b,u=r*this.a+i*this.b,l=i*this.c-r*this.d,c=r*this.c+i*this.d,h=i*this.e-r*this.f+a,d=r*this.e+i*this.f+o;return this.a=s,this.b=u,this.c=l,this.d=c,this.e=h,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,n,i,r,a){return this.multiply(t,e,n,i,r,a),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,a=this.f;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=a,this.f=r,this}},{key:"multiply",value:function(t,e,n,i,r,a){var o=this.a,s=this.b,u=this.c,l=this.d,c=o*t+u*e,h=s*t+l*e,d=o*n+u*i,f=s*n+l*i,v=o*r+u*a+this.e,p=s*r+l*a+this.f;return this.a=c,this.b=h,this.c=d,this.d=f,this.e=v,this.f=p,this}},{key:"interpolate",value:function(e,n){var i=new t;return i.a=this.a+(e.a-this.a)*n,i.b=this.b+(e.b-this.b)*n,i.c=this.c+(e.c-this.c)*n,i.d=this.d+(e.d-this.d)*n,i.e=this.e+(e.e-this.e)*n,i.f=this.f+(e.f-this.f)*n,i}},{key:"transformPoint",value:function(t,e){var n=this.a,i=this.b,r=this.c,a=this.d,o=this.e,s=this.f,u=n*a-i*r,l=a/u,c=-i/u,h=-r/u,d=n/u,f=(r*s-a*o)/u,v=-(n*s-i*o)/u,p=t.x,y=t.y;e.x=p*l+y*h+f,e.y=p*c+y*d+v}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var o=Math.sqrt(t*t+e*e);a.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),a.scaleX=o,a.scaleY=r/o,a.skewX=(t*n+e*i)/r,a.skewY=0}else if(0!==n||0!==i){var s=Math.sqrt(n*n+i*i);a.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/s):-Math.acos(n/s)),a.scaleX=r/s,a.scaleY=s,a.skewX=0,a.skewY=(t*n+e*i)/r}return a.rotateDeg=180*a.rotateDeg/Math.PI,a}}])}();var ae=function(){return u((function t(){o(this,t),this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}),[{key:"clearCache",value:function(t,e){var n=e.CLEAN_THRESHOLD,i=void 0===n?this.CLEAN_THRESHOLD:n,r=e.L_TIME,a=void 0===r?this.L_TIME:r,o=e.R_COUNT,s=void 0===o?this.R_COUNT:o;if(t.size<i)return 0;var u=0,l=function(e){u++,t.delete(e)},c=Date.now();return t.forEach((function(t,e){if(t.timestamp.length<s)return l(e);for(var n=0;c-t.timestamp[t.timestamp.length-1-n]<a&&!(++n>=s););if(n<s)return l(e);for(;c-t.timestamp[0]>a;)t.timestamp.shift()})),u}},{key:"addLimitedTimestamp",value:function(t,e,n){var i=n.R_TIMESTAMP_MAX_SIZE,r=void 0===i?this.R_TIMESTAMP_MAX_SIZE:i;t.timestamp.length>r&&t.timestamp.shift(),t.timestamp.push(e)}},{key:"clearTimeStamp",value:function(t,e){var n=e.L_TIME,i=void 0===n?this.L_TIME:n,r=Date.now();t.forEach((function(t){for(;r-t.timestamp[0]>i;)t.timestamp.shift()}))}},{key:"clearItemTimestamp",value:function(t,e){for(var n=e.L_TIME,i=void 0===n?this.L_TIME:n,r=Date.now();r-t.timestamp[0]>i;)t.timestamp.shift()}}])}();function oe(t,e,n){e/=100,n/=100;var i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),a=n-i/2,o=0,s=0,u=0;return 0<=t&&t<60?(o=i,s=r,u=0):60<=t&&t<120?(o=r,s=i,u=0):120<=t&&t<180?(o=0,s=i,u=r):180<=t&&t<240?(o=0,s=r,u=i):240<=t&&t<300?(o=r,s=0,u=i):300<=t&&t<360&&(o=i,s=0,u=r),{r:o=Math.round(255*(o+a)),g:s=Math.round(255*(s+a)),b:u=Math.round(255*(u+a))}}function se(t,e,n){t/=255,e/=255,n/=255;var i=Math.min(t,e,n),r=Math.max(t,e,n),a=r-i,o=0,s=0;return o=0===a?0:r===t?(e-n)/a%6:r===e?(n-t)/a+2:(t-e)/a+4,(o=Math.round(60*o))<0&&(o+=360),s=(r+i)/2,{h:o,s:+(100*(0===a?0:a/(1-Math.abs(2*s-1)))).toFixed(1),l:s=+(100*s).toFixed(1)}}var ue=/^#([0-9a-f]{3,8})$/,le={transparent:4294967040},ce={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function he(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function de(t){return wt(t)?new Te(t>>16,t>>8&255,255&t,1):xt(t)?new Te(t[0],t[1],t[2]):new Te(255,255,255)}function fe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ve(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var pe,ye,ge,me,be,ke,xe,we,Ae,Se=function(){function t(e){o(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new Te(255,255,255))}return u(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"brighter",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"add",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r+=Math.min(255,n+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}},{key:"sub",value:function(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}},{key:"multiply",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,n){var i=this.color.opacity,r=se(this.color.r,this.color.g,this.color.b),a=oe(yt(t)?r.h:Et(t,0,360),yt(e)?r.s:e>=0&&e<=1?100*e:e,yt(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Te(a.r,a.g,a.b,i),this}},{key:"setRGB",value:function(t,e,n){return!yt(t)&&(this.color.r=t),!yt(e)&&(this.color.g=e),!yt(n)&&(this.color.b=n),this}},{key:"setHex",value:function(t){var e="".concat(t).trim().toLowerCase(),n=ue.exec(e),i=parseInt(n[1],16),r=n[1].length;return 3===r?new Te((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?de(i):8===r?new Te(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):this}},{key:"setColorName",value:function(t){var e=ce[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"setScalar",value:function(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}},{key:"clone",value:function(){return new t(this.color.toString())}},{key:"copyGammaToLinear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.color.r=fe(t.color.r),this.color.g=fe(t.color.g),this.color.b=fe(t.color.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.color.r=ve(t.color.r),this.color.g=ve(t.color.g),this.color.b=ve(t.color.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",i=e instanceof t?e:new t(e);switch(n){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}},{key:"parseColorString",value:function(t){if(gt(le[t]))return function(t){return wt(t)?new Te(t>>>24,t>>>16&255,t>>>8&255,255&t):xt(t)?new Te(t[0],t[1],t[2],t[3]):new Te(255,255,255,1)}(le[t]);if(gt(ce[t]))return de(ce[t]);var e="".concat(t).trim().toLowerCase(),n=ue.exec(e);if(n){var i=parseInt(n[1],16),r=n[1].length;return 3===r?new Te((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?de(i):8===r?new Te(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var a=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Te(parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10),parseFloat(a[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),s=oe(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new Te(s.r,s.g,s.b,parseFloat(o[3]))}}}])}(),Te=function(){return u((function t(e,n,i,r){o(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),gt(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}),[{key:"formatHex",value:function(){return"#".concat(he(this.r)+he(this.g)+he(this.b)+(1===this.opacity?"":he(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=se(this.r,this.g,this.b),n=e.h,i=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(i,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}])}();function Be(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1]}function Ce(t,e,n,i){if(!function(t,e,n,i){var r,a=t[0],o=e[0],s=n[0],u=i[0];return o<a&&(r=o,o=a,a=r),u<s&&(r=u,u=s,s=r),!(o<s||u<a||(a=t[1],o=e[1],s=n[1],u=i[1],o<a&&(r=o,o=a,a=r),u<s&&(r=u,u=s,s=r),o<s||u<a))}(t,e,n,i))return!1;var r=[0,0],a=[0,0],o=[0,0];if(Be(r,e,t),Be(a,i,n),function(t,e){return Ut(t[0]-e[0])+Ut(t[1]-e[1])<1e-12}(r,a))return!0;Be(o,n,t);var s=qt(o,a)/qt(r,a);return s>=0&&s<=1&&[t[0]+r[0]*s,t[1]+r[1]*s]}function _e(t,e,n){var i,r,a,o;return!(t&&e&&(n?(pe=t.x1,ye=t.x2,ge=t.y1,me=t.y2,be=e.x1,ke=e.x2,xe=e.y1,we=e.y2,pe>ye&&(i=[ye,pe],pe=i[0],ye=i[1]),ge>me&&(r=[me,ge],ge=r[0],me=r[1]),be>ke&&(a=[ke,be],be=a[0],ke=a[1]),xe>we&&(o=[we,xe],xe=o[0],we=o[1]),pe>ke||ye<be||ge>we||me<xe):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Ae||(Ae={}));var Re=function(t){var e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(i=(e&=1023)<<10|(n&=1023),i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};var Pe=function(){function t(e,n){o(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=n?n:{},this.textSpec=this._initSpec(),gt(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=gt(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return u(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(yt(this._canvas)&&(gt(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),yt(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&gt(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),yt(this._context)&&gt(this._canvas)){var t=this._canvas.getContext("2d");gt(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fontStyle,i=void 0===n?e.fontStyle:n,r=t.fontVariant,a=void 0===r?e.fontVariant:r,o=t.fontWeight,s=void 0===o?e.fontWeight:o,u=t.fontSize,l=void 0===u?e.fontSize:u,c=t.fontFamily;return(i?i+" ":"")+(a?a+" ":"")+(s?s+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!yt(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,n,i=this._option.defaultFontParams,r=void 0===i?{}:i,a=this._userSpec,o=a.fontStyle,s=void 0===o?r.fontStyle:o,u=a.fontVariant,l=void 0===u?r.fontVariant:u,c=a.fontWeight,h=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=a.fontSize,f=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,v=a.fontFamily,p=void 0===v?null!==(n=r.fontFamily)&&void 0!==n?n:"sans-serif":v,y=a.align,g=a.textAlign,m=void 0===g?null!=y?y:"center":g,b=a.baseline,k=a.textBaseline,x=void 0===k?null!=b?b:"middle":k,w=a.ellipsis,A=a.limit,S=this._userSpec.lineHeight,T=void 0===S?f:S;if(kt(T)&&"%"===T[T.length-1]){var B=Number.parseFloat(T.substring(0,T.length-1))/100;T=f*B}return{fontStyle:s,fontVariant:l,fontFamily:p,fontSize:f,fontWeight:h,textAlign:m,textBaseline:x,ellipsis:w,limit:A,lineHeight:T}}},{key:"measure",value:function(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(yt(t))return{width:0,height:0};if(yt(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,n=this.textSpec,i=n.fontFamily,r=n.fontSize,a=n.fontWeight,o=n.textAlign,s=n.textBaseline,u=n.ellipsis,l=n.limit,c=n.lineHeight;try{var h=this._option.getTextBounds({text:t,fontFamily:i,fontSize:r,fontWeight:a,textAlign:o,textBaseline:s,ellipsis:!!u,maxLineWidth:l||1/0,lineHeight:c});e={width:h.width(),height:h.height()}}catch(n){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var n=this._context.measureText(t),i=this.textSpec,r=i.fontSize,a=i.lineHeight;return{width:n.width,height:null!==(e=a)&&void 0!==e?e:r}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var n={width:0,height:0},i=0;i<e.length;i++){var r=e[i],a=this._measureSpecialChar(r);yt(a)&&t.NUMBERS_CHAR_SET.includes(r)&&(a=this._measureNumberChar()),yt(a)&&["F","W"].includes(Re(r))&&(a=this._measureFullSizeChar()),yt(a)&&(a=this._measureLetterChar()),n.width+=a.width,n.height=Math.max(n.height,a.height)}return n}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e,n={width:0,height:0},i=this.textSpec,r=i.fontSize,a=i.lineHeight,o=0;o<t.length;o++){var s=t[o],u=["F","W"].includes(Re(s))?1:.53;n.width+=u*r}return n.height=null!==(e=a)&&void 0!==e?e:r,n}},{key:"_measureReduce",value:function(t,e){var n,i=this.textSpec,r=i.fontSize,a=i.lineHeight,o={width:0,height:0};if(yt(t))return o;if(xt(t)){var s=t.filter(gt).map((function(t){return t.toString()}));return 0===s.length?o:1===s.length?e(s[0]):{width:s.reduce((function(t,n){return Math.max(t,e(n).width)}),0),height:s.length*((null!==(n=a)&&void 0!==n?n:r)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(yt(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return yt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(yt(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return gt(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){gt(this._canvas)&&(this._canvas=null),gt(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}])}();Pe.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Pe.NUMBERS_CHAR_SET="0123456789",Pe.FULL_SIZE_CHAR="字";var Me,Ee="undefined"!=typeof console;function Oe(t,e,n){var i=[e].concat([].slice.call(n));Ee&&console[t].apply(console,i)}!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Me||(Me={}));var Le=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Me.None,n=arguments.length>1?arguments[1]:void 0;o(this,t),this._onErrorHandler=[],this._level=e,this._method=n}return u(t,[{key:"addErrorHandler",value:function(t){this._onErrorHandler.find((function(e){return e===t}))||this._onErrorHandler.push(t)}},{key:"removeErrorHandler",value:function(t){var e=this._onErrorHandler.findIndex((function(e){return e===t}));e<0||this._onErrorHandler.splice(e,1)}},{key:"callErrorHandler",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._onErrorHandler.forEach((function(t){return t.apply(void 0,e)}))}},{key:"canLogInfo",value:function(){return this._level>=Me.Info}},{key:"canLogDebug",value:function(){return this._level>=Me.Debug}},{key:"canLogError",value:function(){return this._level>=Me.Error}},{key:"canLogWarn",value:function(){return this._level>=Me.Warn}},{key:"level",value:function(t){return arguments.length?(this._level=+t,this):this._level}},{key:"error",value:function(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this._level>=Me.Error&&(this._onErrorHandler.length?this.callErrorHandler.apply(this,n):Oe(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",n)),this}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Me.Warn&&Oe(this._method||"warn","WARN",e),this}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Me.Info&&Oe(this._method||"log","INFO",e),this}},{key:"debug",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Me.Debug&&Oe(this._method||"log","DEBUG",e),this}}],[{key:"getInstance",value:function(e,n){return t._instance&&wt(e)?t._instance.level(e):t._instance||(t._instance=new t(e,n)),t._instance}},{key:"setInstance",value:function(e){return t._instance=e}},{key:"setInstanceLevel",value:function(e){t._instance?t._instance.level(e):t._instance=new t(e)}},{key:"clearInstance",value:function(){t._instance=null}}])}();Le._instance=null;var Ie,De,je,Ue,We,Ne,Fe,ze,Ge,He,Ve,Ye,Xe,Ke,qe=function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},Ze=Dt-1e-8,Je=function(){return u((function t(e){o(this,t),this.init(e)}),[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,e,n,i,r,a){if(Math.abs(r-i)>Ze)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);var o,s,u,l,c=1/0,h=-1/0,d=1/0,f=-1/0;function v(t){u=n*Math.cos(t),l=n*Math.sin(t),u<c&&(c=u),u>h&&(h=u),l<d&&(d=l),l>f&&(f=l)}if(v(i),v(r),r!==i)if((i%=Dt)<0&&(i+=Dt),(r%=Dt)<0&&(r+=Dt),r<i&&(a=!a,o=i,i=r,r=o),a)for(r-=Dt,o=i-i%It,s=0;s<4&&o>r;++s,o-=It)v(o);else for(o=i-i%It+It,s=0;s<4&&o<r;++s,o+=It)v(o);this.bounds.add(t+c,e+d),this.bounds.add(t+h,e+f)}},{key:"arcTo",value:function(t,e,n,i,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){this.bounds.add(t,e),this.bounds.add(n,i),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,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}},{key:"rect",value:function(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}])}(),Qe=function(){return u((function t(){o(this,t),this.curves=[],this.bounds=new ee}),[{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}}])}(),$e=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,tn={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},en={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};function nn(t){if(!t)return[];var e,n,i=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===i)return[];for(var r=[],a=0,o=i.length;a<o;a++)if(Ie=i[a],De=Ie.slice(1),e=[je=Ie[0]],null!==(n=De.match($e))){for(var s=0,u=n.length;s<u;s++)Ue=n[s],We=parseFloat(Ue),Number.isNaN(We)||e.push(We);if(Ne=tn[je],e.length-1>Ne)for(var l=void 0,c=1,h=e.length;c<h;c+=Ne){l=[je];for(var d=c,f=c+Ne;d<f;d++)l.push(e[d]);r.push(l)}else r.push(e)}else r.push(e);return r}function rn(t,e,n,i,r,a,o,s,u){var l=o*(Math.PI/180),c=Math.sin(l),h=Math.cos(l),d=h*(s-t)*.5+c*(u-e)*.5,f=h*(u-e)*.5-c*(s-t)*.5,v=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);v>1&&(n*=v=Math.sqrt(v),i*=v);var p=h/n,y=c/n,g=-c/i,m=h/i,b=p*s+y*u,k=g*s+m*u,x=p*t+y*e,w=g*t+m*e,A=1/((x-b)*(x-b)+(w-k)*(w-k))-.25;A<0&&(A=0);var S=Math.sqrt(A);a===r&&(S=-S);var T=.5*(b+x)-S*(w-k),B=.5*(k+w)+S*(x-b),C=Math.atan2(k-B,b-T),_=Math.atan2(w-B,x-T)-C;_<0&&1===a?_+=Dt:_>0&&0===a&&(_-=Dt);for(var R=Math.ceil(Math.abs(_/(It+.001))),P=[],M=0;M<R;++M){var E=C+M*_/R,O=C+(M+1)*_/R;P[M]=[T,B,E,O,n,i,c,h]}return P}function an(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=u*a,c=-s*o,h=s*a,d=u*o,f=Math.cos(i),v=Math.sin(i),p=Math.cos(r),y=Math.sin(r),g=.5*(r-i),m=Math.sin(.5*g),b=8/3*m*m/Math.sin(g),k=e+f-b*v,x=n+v+b*f,w=e+p,A=n+y,S=w+b*y,T=A-b*p;return[l*k+c*x,h*k+d*x,l*S+c*T,h*S+d*T,l*w+c*A,h*w+d*A]}function on(t,e,n,i){for(var r=rn(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),a=0;a<r.length;++a){var o=an(r[a]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}t.UpdateTag=void 0,(Fe=t.UpdateTag||(t.UpdateTag={}))[Fe.NONE=0]="NONE",Fe[Fe.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Fe[Fe.UPDATE_SHAPE=2]="UPDATE_SHAPE",Fe[Fe.CLEAR_SHAPE=253]="CLEAR_SHAPE",Fe[Fe.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Fe[Fe.INIT=179]="INIT",Fe[Fe.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Fe[Fe.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Fe[Fe.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Fe[Fe.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Fe[Fe.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Fe[Fe.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Fe[Fe.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Fe[Fe.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(ze=t.IContainPointMode||(t.IContainPointMode={}))[ze.GLOBAL=1]="GLOBAL",ze[ze.LOCAL=16]="LOCAL",ze[ze.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",ze[ze.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Ge=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Ge.INIT=0]="INIT",Ge[Ge.DEFAULT=1]="DEFAULT",Ge[Ge.STATE=2]="STATE",Ge[Ge.ANIMATE_BIND=10]="ANIMATE_BIND",Ge[Ge.ANIMATE_PLAY=11]="ANIMATE_PLAY",Ge[Ge.ANIMATE_START=12]="ANIMATE_START",Ge[Ge.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Ge[Ge.ANIMATE_END=14]="ANIMATE_END",Ge[Ge.TRANSLATE=20]="TRANSLATE",Ge[Ge.TRANSLATE_TO=21]="TRANSLATE_TO",Ge[Ge.SCALE=22]="SCALE",Ge[Ge.SCALE_TO=23]="SCALE_TO",Ge[Ge.ROTATE=24]="ROTATE",Ge[Ge.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(He=t.AnimateStatus||(t.AnimateStatus={}))[He.INITIAL=0]="INITIAL",He[He.RUNNING=1]="RUNNING",He[He.PAUSED=2]="PAUSED",He[He.END=3]="END",t.AnimateMode=void 0,(Ve=t.AnimateMode||(t.AnimateMode={}))[Ve.NORMAL=0]="NORMAL",Ve[Ve.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Ye=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Ye.from="from",Ye.to="to",Ye.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(Xe=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Xe.CubicBezierCurve=0]="CubicBezierCurve",Xe[Xe.QuadraticBezierCurve=1]="QuadraticBezierCurve",Xe[Xe.ArcCurve=2]="ArcCurve",Xe[Xe.LineCurve=3]="LineCurve",Xe[Xe.EllipseCurve=4]="EllipseCurve",Xe[Xe.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Ke=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Ke.beforeFillStroke=0]="beforeFillStroke",Ke[Ke.afterFillStroke=1]="afterFillStroke";var sn=function(t,e,n,i,r,a,o){var s=Math.abs(n-e),u=4*Math.tan(s/4)/3,l=n<e?-1:1,c=Math.cos(e),h=Math.sin(e),d=Math.cos(n),f=Math.sin(n),v=c*a+i,p=h*o+r,y=d*a+i,g=f*o+r,m=a*u*l,b=o*u*l;t.push(v-m*h,p+b*c,y+m*f,g-b*d,y,g)},un=[function(t,e,n,i,r,a,o){return e.arc(t[1]*r+n,t[2]*a+i,t[3]*(r+a)/2,t[4],t[5],t[6],o)},function(t,e,n,i,r,a,o){return e.arcTo(t[1]*r+n,t[2]*a+i,t[3]*r+n,t[4]*a+i,t[5]*(r+a)/2,o)},function(t,e,n,i,r,a,o){return e.bezierCurveTo(t[1]*r+n,t[2]*a+i,t[3]*r+n,t[4]*a+i,t[5]*r+n,t[6]*a+i,o)},function(t,e,n,i){return e.closePath()},function(t,e,n,i,r,a){return e.ellipse(t[1]*r+n,t[2]*a+i,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8])},function(t,e,n,i,r,a,o){return e.lineTo(t[1]*r+n,t[2]*a+i,o)},function(t,e,n,i,r,a,o){return e.moveTo(t[1]*r+n,t[2]*a+i,o)},function(t,e,n,i,r,a,o){return e.quadraticCurveTo(t[1]*r+n,t[2]*a+i,t[3]*r+n,t[4]*a+i,o)},function(t,e,n,i,r,a,o){return e.rect(t[1]*r+n,t[2]*a+i,t[3]*r,t[4]*a,o)}];function ln(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=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,o=arguments.length>6?arguments[6]:void 0,s=0;s<t.length;s++){var u=t[s];un[u[0]](u,e,n,i,r,a,o)}}var cn=function(){return u((function t(){o(this,t)}),[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}])}();function hn(t,e){for(var n=0,i=t.length,r=0;r<i;r++){var a=t[r],o=e[r],s=t[(r+1)%i],u=e[(r+1)%i];n+=Qt.distanceNN(a,o,s,u)}return n/2}function dn(t,e,n,i,r){return hn([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function fn(t,e,n,i,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*n*r*r*a+i*r*r*r}function vn(t,e,n,i,r){var a=fn(t.x,e.x,n.x,i.x,r),o=fn(t.y,e.y,n.y,i.y,r);return new Jt(a,o)}function pn(t,e){var n=t.p0,i=t.p1,r=t.p2,a=t.p3,o=vn(n,i,r,a,e),s=Qt.pointAtPP(n,i,e),u=Qt.pointAtPP(i,r,e),l=Qt.pointAtPP(r,a,e),c=Qt.pointAtPP(s,u,e),h=Qt.pointAtPP(u,l,e);return[new yn(n,s,c,o),new yn(o,h,l,a)]}var yn=function(n){function i(n,r,a,s){var u;return o(this,i),(u=e(this,i)).type=t.CurveTypeEnum.CubicBezierCurve,u.p0=n,u.p1=r,u.p2=a,u.p3=s,u}return c(i,n),u(i,[{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 vn(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?dn(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(e){return e===t.Direction.ROW?Ut(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Ut(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var e=Ft(t-.01,0),n=zt(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return Wt(r.y-i.y,r.x-i.x)}}])}(cn);function gn(t,e){var n=t.p0,i=t.p1,r=Qt.pointAtPP(n,i,e);return[new mn(n,r),new mn(r,i)]}var mn=function(n){function i(n,r){var a;return o(this,i),(a=e(this,i)).type=t.CurveTypeEnum.LineCurve,a.p0=n,a.p1=r,a}return c(i,n),u(i,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return Qt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=Wt(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()?Qt.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(e){return e===t.Direction.ROW?Ut(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Ut(this.p0.y-this.p1.y):0}}])}(cn),bn=function(){return u((function t(e,n){o(this,t),this.init(e,n)}),[{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,e,n,i,r,a,o,s){var u=new yn(new Jt(this._lastX,this._lastY),new Jt(t,e),new Jt(n,i),new Jt(r,a));u.originP1=this._lastOriginP,u.originP2=s,u.defined=o,this.curves.push(u),this._lastX=r,this._lastY=a,this._lastOriginP=s}},{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,n,i){var r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}},{key:"moveTo",value:function(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}},{key:"quadraticCurveTo",value:function(t,e,n,i){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,e,n,i,r){var a=new mn(new Jt(this._lastX,this._lastY),new Jt(t,e));return a.originP1=i,a.originP2=r,a.defined=n,a}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(e){var n,i;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;var r=this.curves[0],a=this.curves[this.curves.length-1],o=null!==(n=a.p3)&&void 0!==n?n:a.p1;return Ut(r.p0.y-o.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;var s=this.curves[0],u=this.curves[this.curves.length-1],l=null!==(i=u.p3)&&void 0!==i?i:u.p1;return Ut(s.p0.x-l.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}])}(),kn=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"bezierCurveTo",value:function(t,e,i,r,a,o,s,u){return p(h(n.prototype),"bezierCurveTo",this).call(this,e,t,r,i,o,a,s,u)}},{key:"lineTo",value:function(t,e,i,r){return p(h(n.prototype),"lineTo",this).call(this,e,t,i,r)}},{key:"moveTo",value:function(t,e,i){return p(h(n.prototype),"moveTo",this).call(this,e,t,i)}},{key:"clear",value:function(){return p(h(n.prototype),"clear",this).call(this)}}])}(bn);function xn(t,e){for(var n=!1,i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function wn(e,n,i){var r=null!=n?n:Ut(i[i.length-1].x-i[0].x)>Ut(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN;return"monotoneY"===e?new kn(e,r):new bn(e,r)}var An=function(){return u((function t(e,n){o(this,t),this.context=e,n&&(this.startPoint=n)}),[{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function Sn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=wn("linear",n,t);return Tn(new An(r,i),t),r}function Tn(t,e){return xn(t,e)}function Bn(t,e,n,i,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+n)/6,i,t.lastPoint1)}var Cn=function(){return u((function t(e,n){o(this,t),this.context=e,this.startPoint=n}),[{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&&Bn(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:Bn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function _n(t,e){return xn(t,e)}function Rn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Sn(t,e);var r=wn("basis",n,t);return _n(new Cn(r,i),t),r}function Pn(t){return t<0?-1:1}function Mn(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||Number(r<0&&-0)),o=(n-t._y1)/(r||Number(i<0&&-0)),s=(a*r+o*i)/(i+r);return(Pn(a)+Pn(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function En(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function On(t,e,n,i,r){var a=t._x0,o=t._y0,s=t._x1,u=t._y1,l=(s-a)/3;t.context.bezierCurveTo(a+l,o+l*e,s-l,u-l*n,s,u,i,t.lastPoint1)}var Ln=function(){return u((function t(e,n){o(this,t),this.context=e,this.startPoint=n}),[{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:On(this,this._t0,En(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,n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,On(this,En(this,e=Mn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:On(this,this._t0,e=Mn(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,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()}}])}(),In=function(t){function n(t,i){return o(this,n),e(this,n,[t,i])}return c(n,t),u(n,[{key:"point",value:function(t){return p(h(n.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}])}(Ln);function Dn(t,e){return xn(t,e)}function jn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Sn(t,e);var r=wn("monotoneX",n,t);return Dn(new Ln(r,i),t),r}function Un(t,e){return xn(t,e)}function Wn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Sn(t,e);var r=wn("monotoneY",n,t);return Un(new In(r,i),t),r}var Nn=function(){return u((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this._t=n,this.startPoint=i}),[{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{var i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function Fn(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.direction,a=i.startPoint;if(e.length<2-Number(!!a))return null;var o=new bn("step",null!=r?r:Ut(e[e.length-1].x-e[0].x)>Ut(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return zn(new Nn(o,n,a),e),o}function zn(t,e){return xn(t,e)}var Gn=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"lineEnd",value:function(){this.context.closePath()}}])}(An);function Hn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=wn("linear",n,t);return Vn(new Gn(r,i),t),r}function Vn(t,e){return xn(t,e)}var Yn=function(){return u((function t(e){o(this,t),this.path=e,this._lastX=this._lastY=this._startX=this._startY=0}),[{key:"moveTo",value:function(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}},{key:"lineTo",value:function(t,e){var n=this.addLinearCurve(t,e);this.path.curves.push(n),this._lastX=t,this._lastY=e}},{key:"addLinearCurve",value:function(t,e){return new mn(new Jt(this._lastX,this._lastY),new Jt(t,e))}},{key:"quadraticCurveTo",value:function(t,e,n,i){throw new Error("CurveContext不支持调用quadraticCurveTo")}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){var o=new yn(new Jt(this._lastX,this._lastY),new Jt(t,e),new Jt(n,i),new Jt(r,a));this.path.curves.push(o),this._lastX=r,this._lastY=a}},{key:"arcTo",value:function(t,e,n,i,r){throw new Error("CurveContext不支持调用arcTo")}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){throw new Error("CurveContext不支持调用ellipse")}},{key:"rect",value:function(t,e,n,i){throw new Error("CurveContext不支持调用rect")}},{key:"arc",value:function(t,e,n,i,r,a){throw new Error("CurveContext不支持调用arc")}},{key:"closePath",value:function(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}])}();function Xn(t,e,n){switch(e){case"linear":default:return Sn(t,n);case"basis":return Rn(t,n);case"monotoneX":return jn(t,n);case"monotoneY":return Wn(t,n);case"step":return Fn(t,.5,n);case"stepBefore":return Fn(t,0,n);case"stepAfter":return Fn(t,1,n);case"linearClosed":return Hn(t,n)}}var Kn=function(n){function i(t){var n;return o(this,i),(n=e(this,i)).commandList=[],t&&(n._ctx=t),n._boundsContext=new Je(n.bounds),n}return c(i,n),u(i,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([en.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([en.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,n,i){return this.commandList.push([en.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){return this.commandList.push([en.C,t,e,n,i,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,a),this}},{key:"arcTo",value:function(t,e,n,i,r){return this.commandList.push([en.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){return this.commandList.push([en.E,t,e,n,i,r,a,o,s]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,a,o,s),this}},{key:"rect",value:function(t,e,n,i){return this.commandList.push([en.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}},{key:"arc",value:function(t,e,n,i,r,a){return this.commandList.push([en.A,t,e,n,i,r,a]),this._ctx&&this._ctx.arc(t,e,n,i,r,a),this}},{key:"closePath",value:function(){return this.commandList.push([en.Z]),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:"beginPath",value:function(){this.clear()}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[en.M]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[en.L]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[en.Q]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[en.C]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[en.A]=function(t){var e=[];sn(e,t[4],t[5],t[1],t[2],t[3],t[3]);for(var n="",i=0;i<e.length;i+=6)n+="C".concat(e[i]," ").concat(e[i+1]," ").concat(e[i+2]," ").concat(e[i+3]," ").concat(e[i+4]," ").concat(e[i+5]);return n},t[en.R]=function(t){return"M".concat(t[1]," ").concat(t[2]," h").concat(t[3]," v").concat(t[4]," H").concat(t[1],"Z")},t[en.Z]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,n="";return this.commandList.forEach((function(t){n+=e[t[0]](t)})),n}},{key:"fromString",value:function(t,e,n,i,r){this.clear();var a=nn(t);return this._runCommandStrList(a,e,n,i,r),this._updateBounds(),this}},{key:"fromLine",value:function(e){var n=e.attribute,i=n.points,r=n.curveType,a=n.clipRangeByDimension;if(i){var o=Xn(i,r);"x"===a?this.direction=t.Direction.ROW:"y"===a?this.direction=t.Direction.COLUMN:"auto"===a&&(this.direction=o.direction),this.curves=o.curves}}},{key:"fromCustomPath2D",value:function(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,n,i){var r=this,a=this.commandList;if(!this.transformCbList){var o=[];o[en.M]=this.moveToTransform,o[en.L]=this.lineToTransform,o[en.Q]=this.quadraticCurveToTransform,o[en.C]=this.bezierCurveToTransform,o[en.AT]=this.arcToTransform,o[en.E]=this.ellipseTransform,o[en.R]=this.rectTransform,o[en.A]=this.arcTransform,o[en.Z]=this.closePathTransform,this.transformCbList=o}a.forEach((function(a){r.transformCbList[a[0]](a,t,e,n,i)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"lineToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"quadraticCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}},{key:"bezierCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}},{key:"arcToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}},{key:"ellipseTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,n,i,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,h=0,d=0,f=0,v=0,p=0,y=t.length;p<y;++p){switch(e=t[p],1===u&&1===l||(e=Zn(e,u,l)),e[0]){case"l":h+=e[1],d+=e[2],this.lineTo(h+o,d+s);break;case"L":h=e[1],d=e[2],this.lineTo(h+o,d+s);break;case"h":h+=e[1],this.lineTo(h+o,d+s);break;case"H":h=e[1],this.lineTo(h+o,d+s);break;case"v":d+=e[1],this.lineTo(h+o,d+s);break;case"V":d=e[1],this.lineTo(h+o,d+s);break;case"m":h+=e[1],d+=e[2],this.moveTo(h+o,d+s);break;case"M":h=e[1],d=e[2],this.moveTo(h+o,d+s);break;case"c":n=h+e[5],i=d+e[6],f=h+e[3],v=d+e[4],this.bezierCurveTo(h+e[1]+o,d+e[2]+s,f+o,v+s,n+o,i+s),h=n,d=i;break;case"C":h=e[5],d=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+o,e[2]+s,f+o,v+s,h+o,d+s);break;case"s":n=h+e[3],i=d+e[4],f=2*h-f,v=2*d-v,this.bezierCurveTo(f+o,v+s,h+e[1]+o,d+e[2]+s,n+o,i+s),f=h+e[1],v=d+e[2],h=n,d=i;break;case"S":n=e[3],i=e[4],f=2*h-f,v=2*d-v,this.bezierCurveTo(f+o,v+s,e[1]+o,e[2]+s,n+o,i+s),h=n,d=i,f=e[1],v=e[2];break;case"q":n=h+e[3],i=d+e[4],f=h+e[1],v=d+e[2],this.quadraticCurveTo(f+o,v+s,n+o,i+s),h=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+o,e[2]+s,n+o,i+s),h=n,d=i,f=e[1],v=e[2];break;case"t":n=h+e[1],i=d+e[2],null===c[0].match(/[QqTt]/)?(f=h,v=d):"t"===c[0]?(f=2*h-r,v=2*d-a):"q"===c[0]&&(f=2*h-f,v=2*d-v),r=f,a=v,this.quadraticCurveTo(f+o,v+s,n+o,i+s),d=i,f=(h=n)+e[1],v=d+e[2];break;case"T":n=e[1],i=e[2],f=2*h-f,v=2*d-v,this.quadraticCurveTo(f+o,v+s,n+o,i+s),h=n,d=i;break;case"a":on(this,h+o,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+h+o,e[7]+d+s]),h+=e[6],d+=e[7];break;case"A":on(this,h+o,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+s]),h=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=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!==n||1!==i||1!==r)for(var a=0,o=t.length;a<o;++a){var s=t[a].slice();switch(s[0]){case en.L:this.lineToTransform(s,e,n,i,r);break;case en.M:this.moveToTransform(s,e,n,i,r);break;case en.C:this.bezierCurveToTransform(s,e,n,i,r);break;case en.Q:this.quadraticCurveToTransform(s,e,n,i,r);break;case en.A:this.arcToTransform(s,e,n,i,r);break;case en.E:this.ellipseTransform(s,e,n,i,r);break;case en.R:this.rectTransform(s,e,n,i,r);break;case en.AT:this.arcToTransform(s,e,n,i,r);break;case en.Z:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),ln(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;var e=this.curves[0],n=this.curves[this.curves.length-1];return Ut(e.p0.y-n.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;var i=this.curves[0],r=this.curves[this.curves.length-1];return Ut(i.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,n=0,i=0;i<this.curves.length;i++){var r=(e=this.curves[i]).getLength(this.direction);if(n+r>=t)break;n+=r}var a=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(a),angle:e.getAngleAt(a)}}}])}(Qe),qn=["l",0,0,0,0,0,0,0];function Zn(t,e,n){var i=qn[0]=t[0];if("a"===i||"A"===i)qn[1]=e*t[1],qn[2]=n*t[2],qn[3]=t[3],qn[4]=t[4],qn[5]=t[5],qn[6]=e*t[6],qn[7]=n*t[7];else if("h"===i||"H"===i)qn[1]=e*t[1];else if("v"===i||"V"===i)qn[1]=n*t[1];else for(var r=1,a=t.length;r<a;++r)qn[r]=(r%2==1?e:n)*t[r];return qn}var Jn={alignSelf:"auto"},Qn={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 re},$n={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},ti={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ei=Object.assign({outerBorder:Object.assign(Object.assign({},ti),{distance:0}),innerBorder:Object.assign(Object.assign({},ti),{distance:0})},ti),ni={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},ii={pickStrokeBuffer:0},ri=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},$n),ei),Jn),ii),ai={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},oi={_debug_bounds:!1},si=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},oi),ri),Qn);var ui=Object.assign(Object.assign({},si),{startAngle:0,endAngle:jt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),li=Object.assign(Object.assign(Object.assign({},si),ai),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),ci=Object.assign(Object.assign({},si),{radius:1,startAngle:0,endAngle:jt}),hi=Object.assign(Object.assign({},si),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),di=Object.assign(Object.assign({},si),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),fi=Object.assign(Object.assign(Object.assign({},si),ai),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),vi=Object.assign(Object.assign({},si),{path:new Kn,customPath:function(){Le.getInstance().warn("空函数")}}),pi=Object.assign(Object.assign({},si),{points:[],cornerRadius:0,closePath:!0}),yi=Object.assign(Object.assign({},si),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),gi=Object.assign(Object.assign({},si),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),mi=Object.assign(Object.assign({},si),{symbolType:"circle",size:10,keepDirIn3d:!0}),bi=Object.assign(Object.assign(Object.assign({},si),ni),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ki=Object.assign(Object.assign(Object.assign({},si),ni),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),xi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},si),{fill:!0,cornerRadius:0}),wi=Object.assign(Object.assign({},xi),{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}),Ai=u((function t(){o(this,t)})),Si=new Ai,Ti={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"}},Bi=!0,Ci=!1,_i=/\w|\(|\)|-/,Ri=/[.?!,;:/,。?!、;:]/,Pi=/\S/;function Mi(t,e,n,i,r){if(!e||e<=0)return 0;for(var a=Si.graphicUtil.textMeasure,o=i,s=t.slice(0,o),u=Math.floor(a.measureText(s,n).width),l=t.slice(0,o+1),c=Math.floor(a.measureText(l,n).width);u>e||c<=e;){if(u>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}s=t.slice(0,o),u=Math.floor(a.measureText(s,n).width),l=t.slice(0,o+1),c=Math.floor(a.measureText(l,n).width)}return r&&(o=Ei(t,o)),o}function Ei(t,e){for(var n=e;_i.test(t[n-1])&&_i.test(t[n])||Ri.test(t[n]);)if(--n<=0)return e;return n}function Oi(t,e){var n=Si.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var Li=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ii=function(){return u((function t(){o(this,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 n=e.fontSize,i=void 0===n?bi.fontSize:n,r=0,a=0,o=0;o<t.length;o++)t.charCodeAt(o)<128?r++:a++;return{width:~~(.8*r*i+a*i),height:i}}},{key:"measureTextPixelHeight",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:ni.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:ni.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.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,n,i){var r=this;if(0===t.length)return{verticalList:t,width:0};var a=e.fontSize,o=void 0===a?12:a;t.forEach((function(t){t.width=0===t.direction?o:r.measureTextWidth(t.text,e)}));for(var s=[],u=0,l=0;l<t.length&&u+t[l].width<n;l++)u+=t[l].width,s.push(t[l]);if(t[l]&&t[l].text.length>1){var c=this._clipText(t[l].text,e,n-u,0,t[l].text.length-1,"end",!1);if(i&&c.str!==t[l].text){for(var h="",d=0,f=0;f<l;f++){var v=t[f];h+=v.text,d+=v.text.length}var p=Ei(h+=t[l].text,d+c.str.length);(p-=d)!==c.str.length-1&&(c.str=c.str.substring(0,p),c.width=this.measureTextWidth(c.str,e))}s.push(Object.assign(Object.assign({},t[l]),{text:c.str,width:c.width})),u+=c.width}return{verticalList:s,width:u}}},{key:"clipText",value:function(t,e,n,i){if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};if((r=this.measureTextWidth(t[0],e))>n)return{str:"",width:0};var a=this._clipText(t,e,n,0,t.length-1,"end",!1);if(i&&a.str!==t){var o=Ei(t,a.str.length);o!==a.str.length&&(a.str=t.substring(0,o),a.width=this.measureTextWidth(a.str,e))}return a}},{key:"_clipText",value:function(t,e,n,i,r,a,o){var s;if("start"===a)s=this._clipTextStart(t,e,n,i,r),o&&(s.result=o+s.str);else if("middle"===a){var u=this._clipTextMiddle(t,e,n,"","",0,0,1);s={str:"none",width:u.width,result:u.left+o+u.right}}else s=this._clipTextEnd(t,e,n,i,r),o&&(s.result=s.str+o);return s}},{key:"_clipTextEnd",value:function(t,e,n,i,r){var a,o=Math.floor((i+r)/2),s=t.substring(0,o+1),u=this.measureTextWidth(s,e);if(u>n){if(s.length<=1)return{str:"",width:0};var l=t.substring(0,o);return(a=this.measureTextWidth(l,e))<=n?{str:l,width:a}:this._clipTextEnd(t,e,n,i,o)}if(u<n){if(o>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var c=t.substring(0,o+2);return(a=this.measureTextWidth(c,e))>=n?{str:s,width:u}:this._clipTextEnd(t,e,n,o,r)}return{str:s,width:u}}},{key:"_clipTextStart",value:function(t,e,n,i,r){var a,o=Math.ceil((i+r)/2),s=t.substring(o-1,t.length-1),u=this.measureTextWidth(s,e);if(u>n){if(s.length<=1)return{str:"",width:0};var l=t.substring(o,t.length-1);return(a=this.measureTextWidth(l,e))<=n?{str:l,width:a}:this._clipTextStart(t,e,n,o,t.length-1)}if(u<n){if(o<=0)return{str:t,width:this.measureTextWidth(t,e)};var c=t.substring(o-2,t.length-1);return(a=this.measureTextWidth(c,e))>=n?{str:s,width:u}:this._clipTextStart(t,e,n,i,o)}return{str:s,width:u}}},{key:"_clipTextMiddle",value:function(t,e,n,i,r,a,o,s){var u=t.substring(0,s),l=this.measureTextWidth(u,e);if(l+o>n)return{left:i,right:r,width:a+o};var c=t.substring(t.length-s,t.length),h=this.measureTextWidth(c,e);return l+h>n?{left:u,right:r,width:l+o}:this._clipTextMiddle(t,e,n,u,c,l,h,s+1)}},{key:"clipTextWithSuffixVertical",value:function(t,e,n,i,r,a){if(""===i)return this.clipTextVertical(t,e,n,r);if(0===t.length)return{verticalList:t,width:0};var o=this.clipTextVertical(t,e,n,r);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;var s,u=this.measureTextWidth(i,e);if(u>n)return o;if(n-=u,"start"===a){var l=this.revertVerticalList(t);s=this.clipTextVertical(l,e,n,r);var c=this.revertVerticalList(s.verticalList);c.unshift({text:i,direction:1,width:u}),s.verticalList=c}else if("middle"===a){var h=this.clipTextVertical(t,e,n/2,r),d=this.revertVerticalList(t),f=this.clipTextVertical(d,e,n/2,r);h.verticalList.push({text:i,direction:1,width:u}),this.revertVerticalList(f.verticalList).forEach((function(t){return h.verticalList.push(t)})),s={verticalList:h.verticalList,width:h.width+f.width}}else(s=this.clipTextVertical(t,e,n,r)).verticalList.push({text:i,direction:1,width:u});return s.width+=u,s}},{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,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===i)return this.clipText(t,e,n,r);if(0===t.length)return{str:"",width:0};var s=this.measureTextWidth(t,e);if(!o&&s<=n)return{str:t,width:s};var u=this.measureTextWidth(i,e);if(u>n)return{str:"",width:0};if(o&&s+u<=n)return{str:t+i,width:s+u};n-=u;var l=this._clipText(t,e,n,0,t.length-1,a,i);if(r&&l.str!==t){var c=Ei(t,l.str.length);c!==l.str.length&&(l.result=t.substring(0,c),l.width=this.measureTextWidth(l.str,e))}else o&&l.str===t&&(l.result=t+i);return l.str=l.result,l.width+=u,l}}])}();Ii=Li([I()],Ii);var Di=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ji=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(Ii),t.DefaultTextMeasureContribution=Di([I()],t.DefaultTextMeasureContribution);var Ui=new J,Wi=Symbol.for("CanvasFactory"),Ni=Symbol.for("Context2dFactory");function Fi(t){return Ui.getNamed(Wi,Si.global.env)(t)}var zi=1e-4,Gi=Math.sqrt(3),Hi=1/3;function Vi(t){return t>-ar&&t<ar}function Yi(t){return t>ar||t<-ar}var Xi=[0,0],Ki=[0,0],qi=[0,0];function Zi(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Ji(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function Qi(t,e,n,i,r){var a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*i+3*a*n)}function $i(t){return(t%=jt)<0&&(t+=jt),t}function tr(t,e,n,i,r,a){if(a>e&&a>i||a<e&&a<i)return 0;if(i===e)return 0;var o=(a-e)/(i-e),s=i<e?1:-1;1!==o&&0!==o||(s=i<e?.5:-.5);var u=o*(n-t)+t;return u===r?1/0:u>r?s:0}function er(t,e,n,i,r,a,o,s,u){if(0===o)return!1;var l=o;return!(u>e+l&&u>i+l&&u>a+l||u<e-l&&u<i-l&&u<a-l||s>t+l&&s>n+l&&s>r+l||s<t-l&&s<n-l&&s<r-l)&&function(t,e,n,i,r,a,o,s,u){var l=0,c=.005,h=1/0;Xi[0]=o,Xi[1]=s;for(var d=0;d<1;d+=.05){Ki[0]=Ji(t,n,r,d),Ki[1]=Ji(e,i,a,d);var f=Zi(Xi,Ki);f<h&&(l=d,h=f)}h=1/0;for(var v=0;v<32&&!(c<zi);v++){var p=l-c,y=l+c;Ki[0]=Ji(t,n,r,p),Ki[1]=Ji(e,i,a,p);var g=Zi(Ki,Xi);if(p>=0&&g<h)l=p,h=g;else{qi[0]=Ji(t,n,r,y),qi[1]=Ji(e,i,a,y);var m=Zi(qi,Xi);y<=1&&m<h?(l=y,h=m):c*=.5}}return u&&(u[0]=Ji(t,n,r,l),u[1]=Ji(e,i,a,l)),Math.sqrt(h)}(t,e,n,i,r,a,s,u,null)<=l/2}function nr(t,e,n,i,r,a,o,s,u,l,c){if(0===u)return!1;var h=u;return!(c>e+h&&c>i+h&&c>a+h&&c>s+h||c<e-h&&c<i-h&&c<a-h&&c<s-h||l>t+h&&l>n+h&&l>r+h&&l>o+h||l<t-h&&l<n-h&&l<r-h&&l<o-h)&&function(t,e,n,i,r,a,o,s,u,l,c){var h,d,f,v,p=0,y=.005,g=1/0;Xi[0]=u,Xi[1]=l;for(var m=0;m<1;m+=.05)Ki[0]=Qi(t,n,r,o,m),Ki[1]=Qi(e,i,a,s,m),(f=Zi(Xi,Ki))<g&&(p=m,g=f);g=1/0;for(var b=0;b<32&&!(y<zi);b++)h=p-y,d=p+y,Ki[0]=Qi(t,n,r,o,h),Ki[1]=Qi(e,i,a,s,h),f=Zi(Ki,Xi),h>=0&&f<g?(p=h,g=f):(qi[0]=Qi(t,n,r,o,d),qi[1]=Qi(e,i,a,s,d),v=Zi(qi,Xi),d<=1&&v<g?(p=d,g=v):y*=.5);return c&&(c[0]=Qi(t,n,r,o,p),c[1]=Qi(e,i,a,s,p)),Math.sqrt(g)}(t,e,n,i,r,a,o,s,l,c,null)<=h/2}function ir(t,e,n,i,r,a,o,s,u){if(0===o)return!1;var l=o;s-=t,u-=e;var c=Math.sqrt(s*s+u*u);if(c-l>n||c+l<n)return!1;if(Math.abs(i-r)%jt<1e-4)return!0;if(a){var h=i;i=$i(r),r=$i(h)}else i=$i(i),r=$i(r);i>r&&(r+=jt);var d=Math.atan2(u,s);return d<0&&(d+=jt),d>=i&&d<=r||d+jt>=i&&d+jt<=r}function rr(t,e,n,i,r,a,o){if(0===r)return!1;var s,u=r,l=r/2;if(o>e+l&&o>i+l||o<e-l&&o<i-l||a>t+l&&a>n+l||a<t-l&&a<n-l)return!1;if(t===n)return Math.abs(a-t)<=u/2;var c=(s=(e-i)/(t-n))*a-o+(t*i-n*e)/(t-n);return c*c/(s*s+1)<=u/2*u/2}var ar=1e-4;function or(t,e,n,i,r){var a=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,s=3*e-3*t,u=0;if(Vi(o)){if(Yi(a)){var l=-s/a;l>=0&&l<=1&&(r[u++]=l)}}else{var c=a*a-4*o*s;if(Vi(c))r[0]=-a/(2*o);else if(c>0){var h=Math.sqrt(c),d=(-a+h)/(2*o),f=(-a-h)/(2*o);d>=0&&d<=1&&(r[u++]=d),f>=0&&f<=1&&(r[u++]=f)}}return u}var sr=[-1,-1,-1],ur=[-1,-1];function lr(t,e,n,i,r,a,o,s,u,l){if(l>e&&l>i&&l>a&&l>s||l<e&&l<i&&l<a&&l<s)return 0;var c=function(t,e,n,i,r,a){var o=i+3*(e-n)-t,s=3*(n-2*e+t),u=3*(e-t),l=t-r,c=s*s-3*o*u,h=s*u-9*o*l,d=u*u-3*s*l,f=0;if(Vi(c)&&Vi(h))if(Vi(s))a[0]=0;else{var v=-u/s;v>=0&&v<=1&&(a[f++]=v)}else{var p=h*h-4*c*d;if(Vi(p)){var y=h/c,g=-s/o+y,m=-y/2;g>=0&&g<=1&&(a[f++]=g),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var b=Math.sqrt(p),k=c*s+1.5*o*(-h+b),x=c*s+1.5*o*(-h-b),w=(-s-((k=k<0?-Math.pow(-k,Hi):Math.pow(k,Hi))+(x=x<0?-Math.pow(-x,Hi):Math.pow(x,Hi))))/(3*o);w>=0&&w<=1&&(a[f++]=w)}else{var A=(2*c*s-3*o*h)/(2*Math.sqrt(c*c*c)),S=Math.acos(A)/3,T=Math.sqrt(c),B=Math.cos(S),C=(-s-2*T*B)/(3*o),_=(-s+T*(B+Gi*Math.sin(S)))/(3*o),R=(-s+T*(B-Gi*Math.sin(S)))/(3*o);C>=0&&C<=1&&(a[f++]=C),_>=0&&_<=1&&(a[f++]=_),R>=0&&R<=1&&(a[f++]=R)}}return f}(e,i,a,s,l,sr);if(0===c)return 0;for(var h,d=0,f=-1,v=0,p=0,y=0;y<c;y++){var g=sr[y],m=0===g||1===g?.5:1;Qi(t,n,r,o,g)<u||(f<0&&(f=or(e,i,a,s,ur),ur[1]<ur[0]&&f>1&&(h=void 0,h=ur[0],ur[0]=ur[1],ur[1]=h),v=Qi(e,i,a,s,ur[0]),f>1&&(p=Qi(e,i,a,s,ur[1]))),2===f?g<ur[0]?d+=v<e?m:-m:g<ur[1]?d+=p<v?m:-m:d+=s<p?m:-m:g<ur[0]?d+=v<e?m:-m:d+=s<v?m:-m)}return d}function cr(t,e,n,i,r,a,o,s){if(s>e&&s>i&&s>a||s<e&&s<i&&s<a)return 0;var u=function(t,e,n,i,r){var a=t-2*e+n,o=2*(e-t),s=t-i,u=0;if(Vi(a)){if(Yi(o)){var l=-s/o;l>=0&&l<=1&&(r[u++]=l)}}else{var c=o*o-4*a*s;if(Vi(c)){var h=-o/(2*a);h>=0&&h<=1&&(r[u++]=h)}else if(c>0){var d=Math.sqrt(c),f=(-o+d)/(2*a),v=(-o-d)/(2*a);f>=0&&f<=1&&(r[u++]=f),v>=0&&v<=1&&(r[u++]=v)}}return u}(e,i,a,s,sr);if(0===u)return 0;var l,c,h,d=0===(h=(l=e)+a-2*(c=i))?.5:(l-c)/h;if(d>=0&&d<=1){for(var f=0,v=Ji(e,i,a,d),p=0;p<u;p++){var y=0===sr[p]||1===sr[p]?.5:1;Ji(t,n,r,sr[p])<o||(sr[p]<d?f+=v<e?y:-y:f+=a<v?y:-y)}return f}var g=0===sr[0]||1===sr[0]?.5:1;return Ji(t,n,r,sr[0])<o?0:a<e?g:-g}function hr(t,e,n,i,r,a,o,s){if((s-=e)>n||s<-n)return 0;var u=Math.sqrt(n*n-s*s);sr[0]=-u,sr[1]=u;var l=Math.abs(i-r);if(l<1e-4)return 0;if(l>=jt-1e-4){i=0,r=jt;var c=a?1:-1;return o>=sr[0]+t&&o<=sr[1]+t?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=jt,r+=jt);for(var d=0,f=0;f<2;f++){var v=sr[f];if(v+t>o){var p=Math.atan2(s,v),y=a?1:-1;p<0&&(p=jt+p),(p>=i&&p<=r||p+jt>=i&&p+jt<=r)&&(p>Lt/2&&p<1.5*Lt&&(y=-y),d+=y)}}return d}function dr(t){return Math.round(t/Lt*1e8)/1e8%2*Lt}function fr(t,e){var n=dr(t[0]);n<0&&(n+=jt);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=jt?r=n+jt:e&&n-r>=jt?r=n-jt:!e&&n>r?r=n+(jt-dr(n-r)):e&&n<r&&(r=n-(jt-dr(r-n))),t[0]=n,t[1]=r}var vr=[0,0];function pr(t,e,n,i,r){for(var a,o,s=t,u=t.length,l=0,c=0,h=0,d=0,f=0,v=0;v<u;v++){var p=s[v],y=0===v;p[0]===en.M&&v>1&&(n||(l+=tr(c,h,d,f,i,r))),y&&(d=c=p[1],f=h=p[2]);var g=p[0],m=p[1],b=p[2],k=p[3],x=p[4],w=p[5],A=p[6],S=x,T=w;vr[0]=S,vr[1]=T,fr(vr,Boolean(p[6]));var B=S=vr[0],C=(T=vr[1])-S,_=!!(1-(p[6]?0:1)),R=(i-m)*k/k+m;switch(g){case en.M:c=d=m,h=f=b;break;case en.L:if(n){if(rr(c,h,m,b,e,i,r))return!0}else l+=tr(c,h,m,b,i,r)||0;c=m,h=b;break;case en.C:if(n){if(nr(c,h,m,b,k,x,w,A,e,i,r))return!0}else l+=lr(c,h,m,b,k,x,w,A,i,r)||0;c=w,h=A;break;case en.Q:if(n){if(er(c,h,m,b,k,x,e,i,r))return!0}else l+=cr(c,h,m,b,k,x,i,r)||0;c=k,h=x;break;case en.A:if(a=Math.cos(B)*k+m,o=Math.sin(B)*k+b,y?(d=a,f=o):l+=tr(c,h,a,o,i,r),n){if(ir(m,b,k,B,B+C,_,e,R,r))return!0}else l+=hr(m,b,k,B,B+C,_,R,r);c=Math.cos(B+C)*k+m,h=Math.sin(B+C)*k+b;break;case en.R:if(a=(d=c=m)+k,o=(f=h=b)+x,n){if(rr(d,f,a,f,e,i,r)||rr(a,f,a,o,e,i,r)||rr(a,o,d,o,e,i,r)||rr(d,o,d,f,e,i,r))return!0}else l+=tr(a,f,a,o,i,r),l+=tr(d,o,d,f,i,r);break;case en.Z:if(n){if(rr(c,h,d,f,e,i,r))return!0}else l+=tr(c,h,d,f,i,r);c=d,h=f}}return n||function(t,e){return Math.abs(t-e)<ar}(h,f)||(l+=tr(c,h,d,f,i,r)||0),0!==l}var yr=function(){return u((function t(){o(this,t),this.pools=[],this.allocatedCanvas=[]}),[{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=Fi(Object.assign({nativeCanvas:Si.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}var n=this.pools.pop();return n.resize(t.width,t.height),n.dpr=t.dpr,n}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},n=Fi(Object.assign({nativeCanvas:Si.global.createCanvas(e)},e));return this.allocatedCanvas.push(n),n}var i=this.pools.pop();return i.width=t.width,i.height=t.height,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),gr=new yr,mr=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},br=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kr=Symbol.for("VWindow"),xr=Symbol.for("WindowHandlerContribution");t.DefaultWindow=function(){return u((function t(){var e=this;o(this,t),this.hooks={onChange:new rt(["x","y","width","height"])},this.active=function(){var t=e.global;t.env&&!e.actived&&(Ui.getNamed(xr,t.env).configure(e,t),e.actived=!0)},this._uid=x.GenAutoIncrementId(),this.global=Si.global,this.postInit()}),[{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(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}},{key:"style",get:function(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){var e,n;this._handler.createWindow(t);var i=this._handler.getWH();this._width=i.width,this._height=i.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(n=t.height)&&void 0!==n?n:this._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.global.hooks.onSetEnv.unTap("window",this.active),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,n){return this._handler.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._handler.removeEventListener(t,e,n)}},{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){this._handler.clearViewBox(t)}},{key:"setViewBox",value:function(t){this._handler.setViewBox(t)}},{key:"setViewBoxTransform",value:function(t,e,n,i,r,a){this._handler.setViewBoxTransform(t,e,n,i,r,a)}},{key:"getViewBox",value:function(){return this._handler.getViewBox()}},{key:"getViewBoxTransform",value:function(){return this._handler.getViewBoxTransform()}},{key:"pointTransform",value:function(t,e){var n=this._handler.getViewBox(),i={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},i),i.x-=n.x1,i.y-=n.y1,i}},{key:"hasSubView",value:function(){var t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}},{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.DefaultWindow=mr([I(),br("design:paramtypes",[])],t.DefaultWindow);var wr,Ar=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Sr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tr=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultGraphicUtil=function(){return u((function t(e){var n=this;o(this,t),this.contributions=e,this.configured=!1,this.global=Si.global,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,i){n.configured=!1,n.configure(i,e)}))}),[{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 n=this;this.configured||(this.contributions.getContributions().forEach((function(t){t.configure(n,e)})),this.configured=!0)}},{key:"tryInitCanvas",value:function(){if(!this._canvas){var t=gr.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var n,i=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=i;var a={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:ni.fontSize};return this.global.measureTextMethod=r,a}},{key:"createTextMeasureInstance",value:function(t,e,n){var i=this;return this.configure(this.global,this.global.env),new Pe(Object.assign({defaultFontParams:{fontFamily:ni.fontFamily,fontSize:ni.fontSize},getCanvasForMeasure:n||function(){return i.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Pe.ALPHABET_CHAR_SET+Pe.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},{key:"drawGraphicToCanvas",value:function(t,e,n){if(!e.defaultLayer)return null;var i=Ui.get(kr),r=t.AABBBounds,a=r.width(),o=r.height(),s=-r.x1,u=-r.y1;i.create({viewBox:{x1:s,y1:u,x2:r.x2,y2:r.y2},width:a,height:o,canvas:n,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});var l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(i,[t],{transMatrix:i.getViewBoxTransform(),viewBox:i.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;var c=i.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}}])}(),t.DefaultGraphicUtil=Ar([I(),Tr(0,O(Q)),Tr(0,D(ji)),Sr("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(wr||(wr={}));var Br=new re;t.DefaultTransformUtil=function(){return u((function t(){o(this,t),this.matrix=new re}),[{key:"init",value:function(t){return this.mode=wr.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=wr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,n){var i=this.outSourceMatrix;if(Br.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){var r=n.x,a=n.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(Br.a,Br.b,Br.c,Br.d,Br.e,Br.f),this}},{key:"rotateMatrix",value:function(t,e){var n=this.outSourceMatrix;if(Br.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),e){var i=e.x,r=e.y;this.outTargetMatrix.translate(i,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Br.a,Br.b,Br.c,Br.d,Br.e,Br.f),this}},{key:"scale",value:function(t,e,n){return this.mode===wr.matrix?this.scaleMatrix(t,e,n):this}},{key:"rotate",value:function(t,e){return this.mode===wr.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var n=this.outSourceMatrix;return Br.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Br.a,Br.b,Br.c,Br.d,Br.e,Br.f),this}},{key:"translate",value:function(t,e){return this.mode===wr.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===wr.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}])}(),t.DefaultTransformUtil=Ar([I(),Sr("design:paramtypes",[])],t.DefaultTransformUtil);var Cr={arc:ui,area:li,circle:ci,line:fi,path:vi,symbol:mi,text:bi,rect:yi,polygon:pi,richtext:ki,richtextIcon:wi,image:xi,group:hi,glyph:di},_r=Object.keys(Cr);function Rr(){return{arc:Object.assign({},Cr.arc),area:Object.assign({},Cr.area),circle:Object.assign({},Cr.circle),line:Object.assign({},Cr.line),path:Object.assign({},Cr.path),symbol:Object.assign({},Cr.symbol),text:Object.assign({},Cr.text),rect:Object.assign({},Cr.rect),polygon:Object.assign({},Cr.polygon),richtext:Object.assign({},Cr.richtext),richtextIcon:Object.assign({},Cr.richtextIcon),image:Object.assign({},Cr.image),group:Object.assign({},Cr.group),glyph:Object.assign({},Cr.glyph)}}function Pr(t,e){Object.keys(e).forEach((function(n){t[n]=e[n]}))}var Mr=Rr(),Er=function(){return u((function t(){o(this,t),this.initTheme(),this.dirty=!1}),[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},_r.forEach((function(e){t._defaultTheme[e]=Object.create(Mr[e])})),this.combinedTheme=this._defaultTheme}},{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},n=this.getParentWithTheme(t);return n&&(e=n.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,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var i=this.getParentWithTheme(t);if(i){var r=i.theme;(r.dirty||n)&&r.applyTheme(i,e,!0)}this.userTheme?this.doCombine(i&&i.theme.combinedTheme):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Le.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this,n=this.userTheme,i=this.combinedTheme;_r.forEach((function(r){var a=Object.create(Mr[r]);t&&t[r]&&Pr(a,t[r]),i[r]&&Pr(a,i[r]),n[r]&&Pr(a,n[r]),e.combinedTheme[r]=a})),n.common&&_r.forEach((function(t){Pr(e.combinedTheme[t],n.common)})),this.dirty=!1}},{key:"setTheme",value:function(t,e){var n=this.userTheme;n?Object.keys(t).forEach((function(e){n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,this.userTheme=n,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))}))}}])}(),Or=new Er;function Lr(t,e){return t.glyphHost?Lr(t.glyphHost):e?(t.isContainer,e):Ir(t)||t.attachedThemeGraphic&&Lr(t.attachedThemeGraphic)||Or.getTheme()}function Ir(t){var e;if(e=t.isContainer?t:t.parent){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Or.getTheme()}return null}var Dr=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},jr=function(t){function n(){var t;return o(this,n),(t=e(this,n))._uid=x.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return c(n,t),u(n,[{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,n=0;e;){if(t(e,n++))return;e=e._prev}else for(var i=this._firstChild,r=0;i;){if(t(i,r++))return;i=i._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Dr(this,void 0,void 0,i().mark((function n(){var r,a,o,s,u,l;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e){n.next=16;break}r=this._lastChild,a=0;case 2:if(!r){n.next=14;break}if(o=t(r,a++),n.t0=o.then,!n.t0){n.next=9;break}return n.next=8,o;case 8:o=n.sent;case 9:if(!o){n.next=11;break}return n.abrupt("return");case 11:r=r._prev;case 12:n.next=2;break;case 14:n.next=29;break;case 16:s=this._firstChild,u=0;case 17:if(!s){n.next=29;break}if(l=t(s,u++),n.t1=l.then,!n.t1){n.next=24;break}return n.next=23,l;case 23:l=n.sent;case 24:if(!l){n.next=26;break}return n.abrupt("return");case 26:s=s._next;case 27:n.next=17;break;case 29:case"end":return n.stop()}}),n,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,e){if(!this._ignoreWarn&&this._nodeList&&Le.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,i=0;i<e;i++){if(!n)return null;i>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 n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}var i;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(i=this._nodeList[r]);r--);if(i)return i._next?this.insertBefore(t,i._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(t){if(this._idMap){for(var e=this._firstChild;e;){var n=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=n}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,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren((function(n,r){return!(n===e||!t(n,r)||(i=n,0))})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}},{key:"findAll",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren((function(n,r){n!==e&&t(n,r)&&i.push(n)})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}},{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 n=0;n<t;n++){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 n=this._firstChild;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._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,e,i){var r=vt(i,!0)&&i||mt(i)&&i.capture,a=mt(i)&&i.once,o=pt(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=pt(e)?e:e.handleEvent,a?p(h(n.prototype),"once",this).call(this,t,e,o):p(h(n.prototype),"on",this).call(this,t,e,o),this}},{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,i){var r=vt(i,!0)&&i||mt(i)&&i.capture,a=pt(e)?void 0:e;t=r?"".concat(t,"capture"):t,e=pt(e)?e:e.handleEvent;var o=mt(i)&&i.once;return p(h(n.prototype),"off",this).call(this,t,e,a,o),this}},{key:"off",value:function(t,e,n){return this.removeEventListener(t,e,n)}},{key:"once",value:function(t,e,n){return mt(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}},{key:"removeAllEventListeners",value:function(){return p(h(n.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,r=new Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];return(e=p(h(n.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(r)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}])}(dt),Ur=function(){return u((function t(e){o(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}),[{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.composedDetailPath(),this.path}},{key:"composedDetailPath",value:function(){this.pickParams&&this.pickParams.graphic&&(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams))}},{key:"_composedDetailPath",value:function(t){if(t&&t.graphic){var e=this.pickParams.graphic;if(e.stage){var n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}},{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.")}}])}(),Wr=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).client={x:0,y:0},t.movement={x:0,y:0},t.offset={x:0,y:0},t.global={x:0,y:0},t.screen={x:0,y:0},t}return c(n,t),u(n,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d,f,v){throw new Error("Method not implemented.")}}])}(Ur),Nr=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).width=0,t.height=0,t.isPrimary=!1,t}return c(n,t),u(n,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){var t,e,i,r=new n(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}])}(Wr),Fr=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).DOM_DELTA_PIXEL=0,t.DOM_DELTA_LINE=1,t.DOM_DELTA_PAGE=2,t}return c(n,t),u(n,[{key:"clone",value:function(){var t,e,i,r=new n(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}])}(Wr);Fr.DOM_DELTA_PIXEL=0,Fr.DOM_DELTA_LINE=1,Fr.DOM_DELTA_PAGE=2;var zr=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n)).type=t,r.detail=i,r}return c(n,t),u(n)}(Ur),Gr="object"==("undefined"==typeof performance?"undefined":a(performance))&&performance.now?performance:Date;function Hr(t){return"mouse"===t||"pen"===t}var Vr,Yr=function(){return u((function t(e,n){var i=this;o(this,t),this.dispatch=new dt,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=function(t,e){if(t instanceof Nr){var n=i.createPointerEvent(t,t.type,e);if(i.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)i.dispatchEvent(n,"touchstart");else if(Hr(n.pointerType)){var r=2===n.button;i.dispatchEvent(n,r?"rightdown":"mousedown")}i.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),i.freeEvent(n)}else Le.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerMove=function(t,e){var n,r;if(t instanceof Nr){var a=i.createPointerEvent(t,t.type,e),o=Hr(a.pointerType),s=i.trackingData(t.pointerId),u=i.findMountedTarget(s.overTargets);if(s.overTargets&&u&&u!==i.rootTarget&&u!==a.target){var l="mousemove"===t.type?"mouseout":"pointerout",c=i.createPointerEvent(t,l,u||void 0);if(i.dispatchEvent(c,"pointerout"),o&&i.dispatchEvent(c,"mouseout"),!a.composedPath().includes(u)){var h=i.createPointerEvent(t,"pointerleave",u||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&!a.composedPath().includes(h.target);)h.currentTarget=h.target,i.notifyTarget(h),o&&i.notifyTarget(h,"mouseleave"),h.target=h.target.parent;i.freeEvent(h)}i.freeEvent(c)}if(u!==a.target){var d="mousemove"===t.type?"mouseover":"pointerover",f=i.clonePointerEvent(a,d);i.dispatchEvent(f,"pointerover"),o&&i.dispatchEvent(f,"mouseover");for(var v=null==u?void 0:u.parent;v&&v!==i.rootTarget.parent&&v!==a.target;)v=v.parent;if(!v||v===i.rootTarget.parent){var p=i.clonePointerEvent(a,"pointerenter");p.eventPhase=p.AT_TARGET;for(var y=p.target,g=new Set,m=u;m&&m!==i.rootTarget;)g.add(m),m=m.parent;for(;y&&y!==u&&y!==i.rootTarget.parent;)g.has(y)||(p.currentTarget=y,i.notifyTarget(p),o&&i.notifyTarget(p,"mouseenter")),y=y.parent;i.freeEvent(p)}i.freeEvent(f)}i.dispatchEvent(a,"pointermove"),"touch"===a.pointerType&&i.dispatchEvent(a,"touchmove"),o&&(i.dispatchEvent(a,"mousemove"),i.cursorTarget=a.target,i.cursor=(null===(r=null===(n=a.target)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.cursor)||i.rootTarget.getCursor()),s.overTargets=a.composedPath(),i.freeEvent(a)}else Le.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOver=function(t,e){var n,r;if(t instanceof Nr){var a=i.trackingData(t.pointerId),o=i.createPointerEvent(t,t.type,e),s=Hr(o.pointerType);i.dispatchEvent(o,"pointerover"),s&&i.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(i.cursorTarget=o.target,i.cursor=(null===(r=null===(n=o.target)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.cursor)||i.rootTarget.getCursor());var u=i.clonePointerEvent(o,"pointerenter");for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==i.rootTarget.parent;)u.currentTarget=u.target,i.notifyTarget(u),s&&i.notifyTarget(u,"mouseenter"),u.target=u.target.parent;a.overTargets=o.composedPath(),i.freeEvent(o),i.freeEvent(u)}else Le.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOut=function(t,e){if(t instanceof Nr){var n=i.trackingData(t.pointerId);if(n.overTargets){var r=Hr(t.pointerType),a=i.findMountedTarget(n.overTargets),o=i.createPointerEvent(t,"pointerout",a||void 0);i.dispatchEvent(o),r&&i.dispatchEvent(o,"mouseout");var s=i.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==i.rootTarget.parent;)s.currentTarget=s.target,i.notifyTarget(s),r&&i.notifyTarget(s,"mouseleave"),s.target=s.target.parent;n.overTargets=[],i.freeEvent(o),i.freeEvent(s)}i.cursorTarget=null,i.cursor=""}else Le.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUp=function(t,e){var n;if(t instanceof Nr){var r=Gr.now(),a=i.createPointerEvent(t,t.type,e);if(i.dispatchEvent(a,"pointerup"),"touch"===a.pointerType)i.dispatchEvent(a,"touchend");else if(Hr(a.pointerType)){var o=2===a.button;i.dispatchEvent(a,o?"rightup":"mouseup")}var s=i.trackingData(t.pointerId),u=i.findMountedTarget(s.pressTargetsByButton[t.button]),l=u;if(u&&!a.composedPath().includes(u)){for(var c=u;c&&!a.composedPath().includes(c);){if(a.currentTarget=c,i.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType)i.notifyTarget(a,"touchendoutside");else if(Hr(a.pointerType)){var h=2===a.button;i.notifyTarget(a,h?"rightupoutside":"mouseupoutside")}c=c.parent}delete s.pressTargetsByButton[t.button],l=c}if(l){var d=i.clonePointerEvent(a,"click");d.target=l,d.path=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:d.target,timeStamp:r});var f=s.clicksByButton[t.button];f.target===d.target&&r-f.timeStamp<(null!==(n=i._config.clickInterval)&&void 0!==n?n:200)?++f.clickCount:f.clickCount=1,f.target=d.target,f.timeStamp=r,d.detail=f.clickCount,Hr(d.pointerType)?(i.dispatchEvent(d,"click"),2===f.clickCount&&i.dispatchEvent(d,"dblclick")):"touch"===d.pointerType&&(i.dispatchEvent(d,"tap"),2===f.clickCount&&i.dispatchEvent(d,"dbltap")),i.dispatchEvent(d,"pointertap"),i.freeEvent(d)}i.freeEvent(a)}else Le.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUpOutside=function(t,e){if(t instanceof Nr){var n=i.trackingData(t.pointerId),r=i.findMountedTarget(n.pressTargetsByButton[t.button]),a=i.createPointerEvent(t,t.type,e);if(r){for(var o=r;o;)a.currentTarget=o,i.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType?i.notifyTarget(a,"touchendoutside"):Hr(a.pointerType)&&i.notifyTarget(a,2===a.button?"rightupoutside":"mouseupoutside"),o=o.parent;delete n.pressTargetsByButton[t.button]}i.freeEvent(a)}else Le.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onWheel=function(t,e){if(t instanceof Fr){var n=i.createWheelEvent(t,e);i.dispatchEvent(n),i.freeEvent(n)}else Le.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event")},this.rootTarget=e,this.mappingTable={},this._config=Object.assign({clickInterval:200},n),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}),[{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"dispatchEvent",value:function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}},{key:"mapEvent",value:function(t){var e,n,i,r,a,o,s;if(this.rootTarget){var u,c=this.mappingTable[t.type],h="".concat(t.canvasX,"-").concat(t.canvasY);if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[h])&&(null===(i=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[h])||void 0===i?void 0:i.stage)&&(null===(a=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[h])||void 0===a?void 0:a.stage.renderCount)===(null===(o=this._prePointTargetCache)||void 0===o?void 0:o.stageRenderCount)?u=this._prePointTargetCache[h]:(u=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache=l(l({},h,u),"stageRenderCount",null!==(s=null==u?void 0:u.stage.renderCount)&&void 0!==s?s:-1))),c)for(var d=0,f=c.length;d<f;d++)c[d].fn(t,u);else Le.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(t.type))}}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=0,r=n.length-1;i<r;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(var a=n.length-2;a>=0;a--)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){for(var e=[t],n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}},{key:"notifyTarget",value:function(t,e){if(!this.pauseNotify){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[0],n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}},{key:"createPointerEvent",value:function(t,e,n){var i,r,a=this.allocateEvent(Nr);return this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t,a.target=n||this.pickTarget(null!==(i=a.viewX)&&void 0!==i?i:a.global.x,null!==(r=a.viewY)&&void 0!==r?r:a.global.y,a),"string"==typeof e&&(a.type=e),a}},{key:"createWheelEvent",value:function(t,e){var n,i,r=this.allocateEvent(Fr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(n=r.viewX)&&void 0!==n?n:r.global.x,null!==(i=r.viewY)&&void 0!==i?i:r.global.y,r),r}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Nr);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyPointerData",value:function(t,e){t instanceof Nr&&e instanceof Nr&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}},{key:"copyMouseData",value:function(t,e){t instanceof Wr&&e instanceof Wr&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((function(n){e[n].x=t[n].x,e[n].y=t[n].y})))}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Gr.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"allocateEvent",value:function(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);var n=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),null===(e=this.eventPool.get(n))||void 0===e||e.push(t)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeEventListener(e,n.fn,{once:!0}),n.fn.call(n.context,t);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeEventListener(e,n[i].fn,{once:!0}),n[i].fn.call(n[i].context,t);this.emitDelegation(t,e)}},{key:"emitDelegation",value:function(t,e){var n=t.currentTarget._events["*"];if(n)if("fn"in n)n.fn.call(n.context,t,e);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].fn.call(n[i].context,t,e)}},{key:"pickTarget",value:function(t,e,n){var i,r=this.rootTarget.pick(t,e);return i=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,n&&(n.pickParams=r.params),i}},{key:"release",value:function(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}])}(),Xr={dispatchEvent:function(t){var e;if(!(t instanceof Ur))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit:function(t,e){return this.dispatchEvent(new zr(t,e))}},Kr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},qr=function(){return u((function t(e){var n=this;o(this,t),this.resolution=1,this.onPointerDown=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerData(t);n.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=0,r=e.length;i<r;i++){var a=e[i],o=n.bootstrapEvent(n.rootPointerEvent,a);n.manager.mapEvent(o)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onPointerMove=function(t){if(!(n.supportsTouchEvents&&"touch"===t.pointerType||n.isEventOutsideOfTargetElement(t))){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var a=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(a)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onPointerUp=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.isEventOutsideOfTargetViewPort(t)?"outside":"",i=n.normalizeToPointerData(t),r=0,a=i.length;r<a;r++){var o=n.bootstrapEvent(n.rootPointerEvent,i[r]);o.type+=e,n.manager.mapEvent(o)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onPointerOverOut=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var a=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(a)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onWheel=function(t){var e=n.normalizeWheelEvent(t);n.manager.mapEvent(e)};var i=e.targetElement,r=e.resolution,a=e.rootNode,s=e.global,u=e.autoPreventDefault,l=void 0!==u&&u,c=e.clickInterval,h=e.supportsTouchEvents,d=void 0===h?s.supportsTouchEvents:h,f=e.supportsPointerEvents,v=void 0===f?s.supportsPointerEvents:f;this.manager=new Yr(a,{clickInterval:c}),this.globalObj=s,this.supportsPointerEvents=v,this.supportsTouchEvents=d,this.supportsMouseEvents=s.supportsMouseEvents,this.applyStyles=s.applyStyles,this.autoPreventDefault=l,this.eventsAdded=!1,this.rootPointerEvent=new Nr,this.rootWheelEvent=new Fr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=r,this.setTargetElement(i)}),[{key:"release",value:function(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}},{key:"setCursor",value:function(t,e){if(e||this.manager.rootTarget.window._handler.canvas.controled){t||(t="default");var n=this.applyStyles,i=this.domElement;if(this.currentCursor!==t){this.currentCursor=t;var r=this.cursorStyles[t];r?"string"==typeof r&&n?i.style.cursor=r:"function"==typeof r?r(t):"object"==a(r)&&n&&Object.assign(i.style,r):n&&kt(t)&&!Ct(this.cursorStyles,t)&&(i.style.cursor=t)}}}},{key:"setTargetElement",value:function(t){this.removeEvents(),this.domElement=t,this.addEvents()}},{key:"addEvents",value:function(){if(!this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}}},{key:"removeEvents",value:function(){if(this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}}},{key:"mapToViewportPoint",value:function(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}},{key:"mapToCanvasPoint",value:function(t){var e,n,i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;var r=0,a=0;if(t.changedTouches){var o=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};r=o.clientX||0,a=o.clientY||0}else r=t.clientX||0,a=t.clientY||0;var s=this.domElement.getBoundingClientRect();return{x:r-s.left,y:a-s.top}}},{key:"normalizeToPointerData",value:function(t){var e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(var n=0,i=t.changedTouches.length;n<i;n++){var r=t.changedTouches[n];bt(r.button)&&(r.button=0),bt(r.buttons)&&(r.buttons=1),bt(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),bt(r.width)&&(r.width=r.radiusX||1),bt(r.height)&&(r.height=r.radiusY||1),bt(r.tiltX)&&(r.tiltX=0),bt(r.tiltY)&&(r.tiltY=0),bt(r.pointerType)&&(r.pointerType="touch"),bt(r.pointerId)&&(r.pointerId=r.identifier||0),bt(r.pressure)&&(r.pressure=r.force||.5),bt(r.twist)&&(r.twist=0),bt(r.tangentialPressure)&&(r.tangentialPressure=0),bt(r.layerX)&&(r.layerX=r.offsetX=r.clientX),bt(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){var a=t;bt(a.isPrimary)&&(a.isPrimary=!0),bt(a.width)&&(a.width=1),bt(a.height)&&(a.height=1),bt(a.tiltX)&&(a.tiltX=0),bt(a.tiltY)&&(a.tiltY=0),bt(a.pointerType)&&(a.pointerType="mouse"),bt(a.pointerId)&&(a.pointerId=1),bt(a.pressure)&&(a.pressure=.5),bt(a.twist)&&(a.twist=0),bt(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,e.push(a)}else e.push(t);return e}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.mapToCanvasPoint(t),i=n.x,r=n.y;e.canvas.x=i,e.canvas.y=r,e.global.x=i,e.global.y=r,e.offset.x=i,e.offset.y=r;var a=this.mapToViewportPoint(e),o=a.x,s=a.y;return e.viewport.x=o,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}},{key:"bootstrapEvent",value:function(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.mapToCanvasPoint(e),i=n.x,r=n.y;t.canvas.x=i,t.canvas.y=r,t.global.x=i,t.global.y=r,t.offset.x=i,t.offset.y=r;var a=this.mapToViewportPoint(t),o=a.x,s=a.y;return t.viewport.x=o,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Kr[t.type]||t.type),t}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Gr.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}},{key:"isEventOutsideOfTargetViewPort",value:function(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){var e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),n=this.domElement.getViewBox(),i=n.width(),r=n.height();return!(e.x<i&&e.y<r&&e.x>0&&e.y>0)}return!1}},{key:"isEventOutsideOfTargetElement",value:function(t){var e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}},{key:"pauseTriggerEvent",value:function(){this.manager.pauseNotify=!0}},{key:"resumeTriggerEvent",value:function(){this.manager.pauseNotify=!1}}])}(),Zr=function(){function t(){o(this,t),this.time=0}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}},{key:"tickTo",value:function(t,e){this.time=Math.max(0,t),e(this,{once:!0})}},{key:"release",value:function(){this.timerId>0&&(this.timerId=-1)}},{key:"getTime",value:function(){return this.time}}],[{key:"Avaliable",value:function(){return!0}}])}(),Jr=function(){function t(){o(this,t)}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;this.timerId=setTimeout((function(){e(n)}),t)}},{key:"release",value:function(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!0}}])}(),Qr=function(){function t(){o(this,t)}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;Si.global.getRequestAnimationFrame()((function(){n.released||e(n)}))}},{key:"release",value:function(){this.released=!0}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!!Si.global.getRequestAnimationFrame()}}])}();!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Vr||(Vr={}));var $r=function(){return u((function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o(this,t),this.handleTick=function(t,n){var i=(null!=n?n:{}).once,r=void 0!==i&&i;e.ifCanStop()?e.stop():(e._handlerTick(t),r||t.tick(e.interval,e.handleTick))},this._handlerTick=function(t){var n=e.tickerHandler.getTime(),i=0;e.lastFrameTime>=0&&(i=n-e.lastFrameTime),e.lastFrameTime=n,e.status===Vr.RUNNING&&(e.tickCounts++,e.timelines.forEach((function(t){t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=n,this.autoStop=!0}),[{key:"mode",get:function(){return this._mode},set:function(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}},{key:"init",value:function(){var t=this;this.interval=NaN,this.status=Vr.INITIAL,Si.global.hooks.onSetEnv.tap("default-ticker",(function(){t.initHandler()})),Si.global.env&&this.initHandler()}},{key:"addTimeline",value:function(t){this.timelines.push(t)}},{key:"remTimeline",value:function(t){this.timelines=this.timelines.filter((function(e){return e!==t}))}},{key:"initHandler",value:function(){if(this._mode)return null;for(var t=[{mode:"raf",cons:Qr},{mode:"timeout",cons:Jr},{mode:"manual",cons:Zr}],e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}},{key:"setupTickHandler",value:function(){var t;switch(this._mode){case"raf":t=new Qr;break;case"timeout":t=new Jr;break;case"manual":t=new Zr;break;default:Le.getInstance().warn("非法的计时器模式"),t=new Qr}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}},{key:"setInterval",value:function(t){this.interval=t}},{key:"getInterval",value:function(){return this.interval}},{key:"setFPS",value:function(t){this.setInterval(1e3/t)}},{key:"getFPS",value:function(){return 1e3/this.interval}},{key:"tick",value:function(t){var e=this;this.tickerHandler.tick(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"tickTo",value:function(t){var e=this;this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"pause",value:function(){return this.status!==Vr.INITIAL&&(this.status=Vr.PAUSE,!0)}},{key:"resume",value:function(){return this.status!==Vr.INITIAL&&(this.status=Vr.RUNNING,!0)}},{key:"ifCanStop",value:function(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!0}return!1}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Vr.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Vr.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!1}return this.status=Vr.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}},{key:"stop",value:function(){this.status=Vr.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}])}(),ta=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"mode",get:function(){return this._mode},set:function(t){this.setupTickHandler()}},{key:"initHandler",value:function(){return this.mode="manual",null}},{key:"setupTickHandler",value:function(){var t=new Zr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"tickAt",value:function(t){var e=this;this.tickerHandler.tick(t-this.lastFrameTime,(function(t){e.handleTick(t,{once:!0})}))}},{key:"ifCanStop",value:function(){return!1}}])}($r),ea=function(){function t(){o(this,t)}return u(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,e){return function(n){if(0===n||1===n)return n;var i=e/jt*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*jt/e)}}},{key:"getElasticOut",value:function(t,e){return function(n){if(0===n||1===n)return n;var i=e/jt*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*jt/e)+1}}},{key:"getElasticInOut",value:function(t,e){return function(n){var i=e/jt*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*jt/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*jt/e)*.5+1}}}])}();ea.quadIn=ea.getPowIn(2),ea.quadOut=ea.getPowOut(2),ea.quadInOut=ea.getPowInOut(2),ea.cubicIn=ea.getPowIn(3),ea.cubicOut=ea.getPowOut(3),ea.cubicInOut=ea.getPowInOut(3),ea.quartIn=ea.getPowIn(4),ea.quartOut=ea.getPowOut(4),ea.quartInOut=ea.getPowInOut(4),ea.quintIn=ea.getPowIn(5),ea.quintOut=ea.getPowOut(5),ea.quintInOut=ea.getPowInOut(5),ea.backIn=ea.getBackIn(1.7),ea.backOut=ea.getBackOut(1.7),ea.backInOut=ea.getBackInOut(1.7),ea.elasticIn=ea.getElasticIn(1,.3),ea.elasticOut=ea.getElasticOut(1,.3),ea.elasticInOut=ea.getElasticInOut(1,.3*1.5);var na=function(){return u((function t(){o(this,t),this.id=x.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}),[{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(e){if(!this.paused){var n=this.animateHead;for(this.animateCount=0;n;)n.status===t.AnimateStatus.END?this.removeAnimate(n):n.status===t.AnimateStatus.RUNNING||n.status===t.AnimateStatus.INITIAL?(this.animateCount++,n.advance(e)):n.status===t.AnimateStatus.PAUSED&&this.animateCount++,n=n.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()}}])}(),ia=new na,ra=function(){return u((function t(e,n,i,r,a){o(this,t),this.from=e,this.to=n,this.duration=i,this.easing=r,this.params=a,this.updateCount=0}),[{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,n){var i=this;if(0===this.updateCount){this.onFirstRun();var r=this.step.getLastProps();Object.keys(r).forEach((function(t){i.subAnimate.animate.validAttr(t)&&(n[t]=r[t])}))}this.updateCount+=1,this.onUpdate(t,e,n),t&&this.onEnd()}}])}(),aa=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[null,null,0,"linear"])).cb=t,i}return c(n,t),u(n,[{key:"onUpdate",value:function(t,e,n){}},{key:"onStart",value:function(){this.cb()}}])}(ra),oa=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ia;o(this,e),this.id=n,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new ua(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return u(e,[{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 e=-1/0;return t.forEach((function(t){e=Ft(t.getDuration(),e)})),this._startTime=e,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(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.mode;n&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(n,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,n=new aa((function(){t(e,n.step.prev)}));return this.tailAnimate.play(n),this}},{key:"customInterpolate",value:function(t,n,i,r,a,o){var s=e.interpolateMap.get(t)||e.interpolateMap.get("");return!!s&&s(t,n,i,r,a,o)}},{key:"pause",value:function(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}},{key:"resume",value:function(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}},{key:"to",value:function(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),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 ua(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(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,n=0,i=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===i)return a;for(var o=0;o<this.subAnimates.length&&!(n+(e=this.subAnimates[o]).totalDuration>=t);o++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),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=t.AnimateStatus.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(t,n){e.interpolateMap.set(t,n)}}])}();oa.mode=t.AnimateMode.NORMAL,oa.interpolateMap=new Map;var sa,ua=function(){return u((function t(e,n){o(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new la(0,0,n?Object.assign({},n.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}),[{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(e){var n=e.duration;(null==n||n<0)&&(n=0);var i=e.easing,r="string"==typeof i?ea[i]:i,a=this._addStep(n,null,r);return a.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),a,!1),this._appendCustomAnimate(e,a),this}},{key:"to",value:function(e,n,i,r){var a=this;(null==n||n<0)&&(n=0);var o="string"==typeof i?ea[i]:i,s=this._addStep(n,null,o);return s.type=t.AnimateStepType.to,this._appendProps(e,s,!!r&&r.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),r&&r.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==a.animate.id&&t.preventAttrs(s.propKeys)})),this}},{key:"from",value:function(e,n,i,r){var a=this;this.to(e,0,i,r);var o={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){o[t]=a.getLastPropByName(t,a.stepTail)})),this.to(o,n,i,r),this.stepTail.type=t.AnimateStepType.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(e){if(e>0){var n=this._addStep(+e,null);n.type=t.AnimateStepType.wait,n.prev.customAnimate?n.props=n.prev.customAnimate.getEndProps():n.props=n.prev.props,this.target.onAddStep&&this.target.onAddStep(n)}return this}},{key:"_addStep",value:function(t,e,n){var i=new la(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}},{key:"_appendProps",value:function(t,e,n){var i=this;e.props=n?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]=i.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 o=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(a)),e.propKeys.forEach((function(t){if(void 0===o[t]){var e=i.animate.getStartProps();o[t]=e[t]=i.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,n,i,r=this.duration,a=this.loop,o=this.rawPosition,s=!1,u=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<u)return this.rawPosition=t,!1;if(r<=0)return s=!0;if(i=(t-=u)-(n=Math.floor(t/r))*r,(s=t>=a*r+r)&&(t=(i=r)*(n=a)+r),t===o)return s;var l=!this.reversed!=!(this.bounce&&n%2);return l&&(i=r-i),this._deltaPosition=i-this.position,this.position=i,this.rawPosition=t+u,this.updatePosition(s,l),s}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var n=this.stepHead.next,i=this.position,r=this.duration;if(this.target&&n){for(var a=n.next;a&&a.position<=i;)a=(n=a).next;var o=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(o=n.easing(o)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,o,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(n,o)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,n){if(t!==e)if(n){for(var i=e.prev;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{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,e){for(var n=e.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var i=n.customAnimate.getEndProps()[t];if(void 0!==i)return i}n=n.prev}return Le.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}},{key:"updateTarget",value:function(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}])}(),la=function(){return u((function t(e,n,i,r){o(this,t),this.duration=n,this.position=e,this.props=i,this.easing=r}),[{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}}])}(),ca={duration:200,easing:"cubicOut"},ha={duration:1e3,easing:"quadInOut"};t.Edge=void 0,(sa=t.Edge||(t.Edge={}))[sa.Top=1]="Top",sa[sa.Right=2]="Right",sa[sa.Bottom=4]="Bottom",sa[sa.Left=8]="Left",sa[sa.ALL=15]="ALL";var da=[!1,!1,!1,!1],fa=function(t){var e,n=!0;if(vt(t,!0)){for(var i=0;i<4;i++)da[i]=t,n&&(n=!(null!==(e=da[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(var r=0;r<4;r++)da[r]=!!t[r],n&&(n=!!da[r]);else da[0]=!1,da[1]=!1,da[2]=!1,da[3]=!1;return{isFullStroke:n,stroke:da}},va=[0,0,0,0],pa=function(t){return t?xt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(va[0]=t[0],va[2]=t[0],va[1]=t[1],va[3]=t[1],va):t:t:0},ya=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],ga=[1,2,3,0,1,2,3,0];function ma(t,e,n,i){for(;t>=jt;)t-=jt;for(;t<0;)t+=jt;for(;t>e;)e+=jt;ya[0].x=n,ya[1].y=n,ya[2].x=-n,ya[3].y=-n;var r=Math.ceil(t/It)%4,a=Math.ceil(e/It)%4;if(i.add(Nt(t)*n,Gt(t)*n),i.add(Nt(e)*n,Gt(e)*n),r!==a||e-t>Lt)for(var o=!1,s=0;s<ga.length;s++)if(o||r!==ga[s]){if(o&&a===ga[s])break;if(o){var u=ya[ga[s]];i.add(u.x,u.y)}}else{o=!0;var l=ya[r];i.add(l.x,l.y)}}function ba(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function ka(t,e,n){var i=Kt(t.x,t.y,e.x,e.y,n),r=i.x,a=i.y,o=Kt(t.x1,t.y1,e.x1,e.y1,n),s=o.x,u=o.y,l=new Jt(r,a,s,u);return l.defined=e.defined,l}function xa(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);var i=[];if(t.length>e.length){i=e.map((function(t){var e=new Jt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var r=0;r<e.length;r++)i[r]=ka(t[r],e[r],n)}else{i=e.map((function(t){var e=new Jt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var a=0;a<t.length;a++)i[a]=ka(t[a],e[a],n)}return i}var wa=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],Aa=function(t){return wa.includes(t)};function Sa(t,e){if(xt(t)){for(var n,i=0;i<t.length&&void 0===n;i++)n=t[i][e];return n}return t[e]}var Ta=function(){return u((function t(){o(this,t),this.durations=[],this.timeout=t.TimeOut,this.lastDate=0,this.durationsListThreshold=30}),[{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)}}])}();Ta.TimeOut=1e3/60;var Ba,Ca=new Ta,_a=function(t,e){return kt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t},Ra=function(t){function n(t,i,r,a,s){return o(this,n),e(this,n,[t,i,r,a,s])}return c(n,t),u(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,e,n,i,r,a,o,s;this.fromNumber=wt(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=wt(null===(i=this.to)||void 0===i?void 0:i.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(a=this.to)||void 0===a?void 0:a.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(s=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==s?s:Math.max(Zt(this.fromNumber),Zt(this.toNumber)))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){!1!==this.valid&&(n.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}])}(ra);!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"}(Ba||(Ba={}));var Pa=function(t){function n(t,i,r,a,s){var u;o(this,n),u=e(this,n,[t,i,r,a,s]);var l=s||{},c=l.direction,h=void 0===c?Ba.LEFT_TO_RIGHT:c,d=l.fill,f=void 0===d||d,v=l.stroke,p=void 0===v||v;return u.direction=h,u.fill=f,u.stroke=p,u.fillGradient={gradient:"linear",stops:[]},u.strokeGradient={gradient:"linear",stops:[]},u}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{fill:this.toFill,stroke:this.toStroke}}},{key:"onBind",value:function(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){if(this.toFill&&this.toStroke)switch(this.direction){case Ba.RIGHT_TO_LEFT:this.rightToLeft(t,e,n);break;case Ba.TOP_TO_BOTTOM:this.topToBottom(t,e,n);break;case Ba.BOTTOM_TO_TOP:this.bottomToTop(t,e,n);break;case Ba.STROKE:this.strokePath(t,e,n);break;default:this.leftToRight(t,e,n)}}},{key:"leftToRight",value:function(t,e,n){if(this.fill){var i=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:i},{offset:e,color:i},{offset:Math.min(1,2*e),color:"transparent"}],n.fill=this.fillGradient}if(this.stroke){var r=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:r},{offset:e,color:r},{offset:Math.min(1,6*e),color:"transparent"}],n.stroke=this.strokeGradient}}},{key:"strokePath",value:function(t,e,n){if(this.fill){var i=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:i},{offset:e,color:i},{offset:Math.min(1,2*e),color:"transparent"}],n.fill=this.fillGradient}if(this.stroke){var r=300*e;n.lineDash=[r,300-r]}}},{key:"rightToLeft",value:function(t,e,n){}},{key:"topToBottom",value:function(t,e,n){}},{key:"bottomToTop",value:function(t,e,n){}}])}(ra),Ma=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).fromText="",t.toText="",t}return c(n,t),u(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,e,n,i;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(i=null===(n=this.to)||void 0===n?void 0:n.text)&&void 0!==i?i:"",!this.toText||xt(this.toText))this.valid=!1;else{this.toText=this.toText.toString();var r=this.target.attachShadow(),a=Si.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});r.add(a)}}},{key:"onEnd",value:function(){this.target.detachShadow()}},{key:"onUpdate",value:function(t,e,n){var i;if(!1!==this.valid){var r=this.fromText.length,a=this.toText.length,o=Math.ceil(r+(a-r)*e);n.text=this.toText.substr(0,o);var s=null===(i=this.target.shadowRoot)||void 0===i?void 0:i.at(0),u=this.target.clipedWidth+2;s.setAttribute("x",u)}}}])}(ra),Ea=function(n){function i(t,n,r,a,s){return o(this,i),e(this,i,[t,n,r,a,s])}return c(i,n),u(i,[{key:"getEndProps",value:function(){return{}}},{key:"onStart",value:function(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}},{key:"onStartLineOrArea",value:function(t){var e,n=this.target.attachShadow(),i=Si.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=i,i.pathProxy=new Kn,n.add(i)}},{key:"onStartRect",value:function(){var t,e=this.target.attachShadow(),n=this.target.AABBBounds.height(),i=Si.graphicService.creator.rect(Object.assign(Object.assign({height:n,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=i,e.add(i)}},{key:"onBind",value:function(){}},{key:"onEnd",value:function(){this.target.detachShadow()}},{key:"onUpdate",value:function(t,e,n){return this.rect?this.onUpdateRect(t,e,n):this.line||this.area?this.onUpdateLineOrArea(t,e,n):void 0}},{key:"onUpdateRect",value:function(e,n,i){var r,a,o,s,u,l,c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,h=null!==(o=null===(a=this.params)||void 0===a?void 0:a.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(u=null===(s=this.params)||void 0===s?void 0:s.attribute)||void 0===u?void 0:u.width)&&void 0!==l?l:60,f=-d,v=f+(h-f)*n,p=Math.max(v,0),y=Math.min(Math.min(v+d,d),h-v),g=y+p>c?Math.max(c-p,0):y;this.rect.setAttributes({x:p,width:g},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:n,end:e}})}},{key:"onUpdateLineOrArea",value:function(t,e,n){var i=this.line||this.area;if(i){var r=i.pathProxy,a=this.target;a.cache||a.cacheArea?this._onUpdateLineOrAreaWithCache(r,a,t,e,n):this._onUpdateLineWithoutCache(r,a,t,e,n);var o=a.attribute;i.setAttributes(Object.assign({stroke:o.stroke},i.attribute)),i.addUpdateBoundTag()}}},{key:"_onUpdateLineOrAreaWithCache",value:function(t,e,n,i,r){if(t.clear(),"line"===e.type){var a=e.cache;Array.isArray(a)||(a=[a]);var o=a.reduce((function(t,e){return t+e.getLength()}),0),s=[];return a.forEach((function(t){t.curves.forEach((function(t){return s.push(t)}))})),this._updateCurves(t,s,o,i)}if("area"===e.type){var u=e.cacheArea,l=u.top.curves.reduce((function(t,e){return t+e.getLength()}),0);return this._updateCurves(t,u.top.curves,l,i)}}},{key:"_updateCurves",value:function(t,e,n,i){for(var r,a,o=n*i,s=Math.min(null!==(a=o+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==a?a:10,n),u=0,l=!1,c=0;c<e.length;c++){var h=e[c],d=h.getLength(),f=1-(u+d-o)/d,v=void 0,p=1-(u+d-s)/d;if(u<o&&u+d>o)if(l=!0,h.p2&&h.p3){var g=y(pn(h,f),2);g[0];var m=g[1];t.moveTo(m.p0.x,m.p0.y),v=m}else{var b=h.getPointAt(f);t.moveTo(b.x,b.y)}if(u<s&&u+d>s){if(h.p2&&h.p3){v&&(p=(s-o)/v.getLength());var k=y(pn(v||h,p),1)[0];t.bezierCurveTo(k.p1.x,k.p1.y,k.p2.x,k.p2.y,k.p3.x,k.p3.y)}else{var x=h.getPointAt(p);t.lineTo(x.x,x.y)}break}if(l)if(h.p2&&h.p3){var w=v||h;t.bezierCurveTo(w.p1.x,w.p1.y,w.p2.x,w.p2.y,w.p3.x,w.p3.y)}else t.lineTo(h.p1.x,h.p1.y);u+=d}}},{key:"_onUpdateLineWithoutCache",value:function(t,e,n,i,r){var a,o,s=e.attribute,u=s.points,l=s.curveType;if(u&&!(u.length<2)&&"linear"===l){for(var c=0,h=1;h<u.length;h++)c+=Qt.distancePP(u[h],u[h-1]);for(var d=c*i,f=Math.min(null!==(o=d+(null===(a=this.params)||void 0===a?void 0:a.streamLength))&&void 0!==o?o:10,c),v=[],p=0,y=1;y<u.length;y++){var g=Qt.distancePP(u[y],u[y-1]);if(p<d&&p+g>d&&v.push(Qt.pointAtPP(u[y-1],u[y],1-(p+g-d)/g)),p<f&&p+g>f){v.push(Qt.pointAtPP(u[y-1],u[y],1-(p+g-f)/g));break}v.length&&v.push(u[y]),p+=g}if(v.length&&!(v.length<2)){t.clear(),t.moveTo(v[0].x,v[0].y);for(var m=1;m<v.length;m++)t.lineTo(v[m].x,v[m].y)}}}}])}(ra),Oa=function(n){function i(t,n,r,a){var s;return o(this,i),(s=e(this,i,[null,null,n,r,a])).size=t,s.posList=[],s}return c(i,n),u(i,[{key:"lastPos",get:function(){return this.posList[this.posList.length-1]}},{key:"onBind",value:function(){var e=this.target.attachShadow();this.root=e;for(var n=0;n<this.size;n++){var i=this.target.clone(),r=Math.min((this.size-n)/this.size*3,1),a=Math.min(.2+.7/this.size);i.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:a},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(i)}}},{key:"onUpdate",value:function(t,e,n){var i=this;if(t)return this.target.detachShadow(),void(this.posList.length=0);var r=this.target.getComputedAttribute("x"),a=this.target.getComputedAttribute("y"),o=new Jt(r,a);this.posList.length?(this.target.shadowRoot.forEachChildren((function(t,e){var n=i.posList[Math.max(i.posList.length-e-1,0)];t.setAttributes({x:n.x-r,y:n.y-a},!1)})),this.posList.push(o)):this.posList.push(o)}}])}(ra),La=function(t){function n(t,i,r,a,s){var u,l;return o(this,n),u=e(this,n,[t,i,r,a,s]),s&&(u.pathLength=s.path.getLength(),u.path=s.path,u.distance=s.distance,u.to=s.distance*u.pathLength,u.initAngle=null!==(l=s.initAngle)&&void 0!==l?l:0,u.changeAngle=!!s.changeAngle,u.cb=s.cb),u}return c(n,t),u(n,[{key:"onUpdate",value:function(t,e,n){var i=this.to*e,r=this.path.getAttrAt(i),a=r.pos,o=r.angle;n.x=a.x,n.y=a.y,this.changeAngle&&(n.angle=o+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}}])}(ra),Ia=function(t){function n(t,i,r,a,s){var u;return o(this,n),(u=e(this,n,[t,i,r,a,s])).newPointAnimateType="appear"===(null==s?void 0:s.newPointAnimateType)?"appear":"grow",u}return c(n,t),u(n,[{key:"onBind",value:function(){var t,e,n=this,i=null===(t=this.from)||void 0===t?void 0:t.points,r=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=r?Array.isArray(r)?r:[r]:[];var a=new Map;this.fromPoints.forEach((function(t){t.context&&a.set(t.context,t)}));for(var o,s,u=1/0,l=-1/0,c=0;c<this.toPoints.length;c+=1)if(a.has(this.toPoints[c].context)){u=c,o=a.get(this.toPoints[c].context);break}for(var h=this.toPoints.length-1;h>=0;h-=1)if(a.has(this.toPoints[h].context)){l=h,s=a.get(this.toPoints[h].context);break}var d=this.toPoints[0];this.interpolatePoints=this.toPoints.map((function(t,e){var i=a.get(t.context);return i?(d=i,[i,t]):"appear"===n.newPointAnimateType?[t,t]:e<u&&o?[o,t]:e>l&&s?[s,t]:[d,t]})),this.points=this.interpolatePoints.map((function(t){var e=t[0],n=t[1],i=new Jt(e.x,e.y,e.x1,e.y1);return i.defined=n.defined,i.context=n.context,i}))}},{key:"onUpdate",value:function(t,e,n){var i=this;this.points=this.points.map((function(t,n){var r=ka(i.interpolatePoints[n][0],i.interpolatePoints[n][1],e);return r.context=t.context,r})),n.points=this.points}}])}(ra),Da=function(t){function n(t,i,r,a,s){var u;return o(this,n),(u=e(this,n,[t,i,r,a,s])).graphic=null==s?void 0:s.graphic,u}return c(n,t),u(n,[{key:"onUpdate",value:function(t,e,n){var i=this;this.graphic&&Object.keys(this.from).forEach((function(t){n[t]=i.from[t]+(i.to[t]-i.from[t])*e}))}}])}(ra),ja=function(n){function i(t,n,r,a,s){var u;return o(this,i),(u=e(this,i,[null,null,r,a,s])).clipFromAttribute=t,u.clipToAttribute=n,u._group=null==s?void 0:s.group,u._clipGraphic=null==s?void 0:s.clipGraphic,u}return c(i,n),u(i,[{key:"onBind",value:function(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}},{key:"onEnd",value:function(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}},{key:"onUpdate",value:function(e,n,i){var r=this;if(this._clipGraphic){var a={};Object.keys(this.clipFromAttribute).forEach((function(t){a[t]=r.clipFromAttribute[t]+(r.clipToAttribute[t]-r.clipFromAttribute[t])*n})),this._clipGraphic.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:n,end:e}})}}}])}(ra),Ua=function(t){function n(t,i,r,a,s){var u,l,c,h,d,f,v,p,y,g,m,b;o(this,n);var k=null!==(l=null===(u=null==s?void 0:s.group)||void 0===u?void 0:u.attribute)&&void 0!==l?l:{},x=null!==(c=k.width)&&void 0!==c?c:0,w=null!==(h=k.height)&&void 0!==h?h:0,A=null!==(d=null==s?void 0:s.animationType)&&void 0!==d?d:"in",S=null!==(f=null==s?void 0:s.startAngle)&&void 0!==f?f:0,T=null!==(v=null==s?void 0:s.orient)&&void 0!==v?v:"clockwise",B=0,C=0;"anticlockwise"===T?(C="in"===A?S+2*Math.PI:S,C=S+2*Math.PI):(B=S,C="out"===A?S+2*Math.PI:S);var _,R,P=Si.graphicService.creator.arc({x:null!==(y=null===(p=null==s?void 0:s.center)||void 0===p?void 0:p.x)&&void 0!==y?y:x/2,y:null!==(m=null===(g=null==s?void 0:s.center)||void 0===g?void 0:g.y)&&void 0!==m?m:w/2,outerRadius:null!==(b=null==s?void 0:s.radius)&&void 0!==b?b:(x+w)/2,innerRadius:0,startAngle:B,endAngle:C,fill:!0});return"anticlockwise"===T?(_={startAngle:S+2*Math.PI},R={startAngle:S}):(_={endAngle:S},R={endAngle:S+2*Math.PI}),e(this,n,["in"===A?_:R,"in"===A?R:_,r,a,{group:null==s?void 0:s.group,clipGraphic:P}])}return c(n,t),u(n)}(ja),Wa=function(t){function n(t,i,r,a,s){var u,l,c,h,d,f,v,p,y,g,m;o(this,n);var b=null!==(l=null===(u=null==s?void 0:s.group)||void 0===u?void 0:u.attribute)&&void 0!==l?l:{},k=null!==(c=b.width)&&void 0!==c?c:0,x=null!==(h=b.height)&&void 0!==h?h:0,w=null!==(d=null==s?void 0:s.animationType)&&void 0!==d?d:"in",A=null!==(f=null==s?void 0:s.startRadius)&&void 0!==f?f:0,S=null!==(v=null==s?void 0:s.endRadius)&&void 0!==v?v:Math.sqrt(Math.pow(k/2,2)+Math.pow(x/2,2)),T=Si.graphicService.creator.arc({x:null!==(y=null===(p=null==s?void 0:s.center)||void 0===p?void 0:p.x)&&void 0!==y?y:k/2,y:null!==(m=null===(g=null==s?void 0:s.center)||void 0===g?void 0:g.y)&&void 0!==m?m:x/2,outerRadius:"out"===w?S:A,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),B={outerRadius:A},C={outerRadius:S};return e(this,n,["in"===w?B:C,"in"===w?C:B,r,a,{group:null==s?void 0:s.group,clipGraphic:T}])}return c(n,t),u(n)}(ja),Na=function(t){function n(t,i,r,a,s){var u,l,c,h,d,f,v,p,y;o(this,n);var g=null!==(l=null===(u=null==s?void 0:s.group)||void 0===u?void 0:u.attribute)&&void 0!==l?l:{},m=null!==(h=null!==(c=null==s?void 0:s.width)&&void 0!==c?c:g.width)&&void 0!==h?h:0,b=null!==(f=null!==(d=null==s?void 0:s.height)&&void 0!==d?d:g.height)&&void 0!==f?f:0,k=null!==(v=null==s?void 0:s.animationType)&&void 0!==v?v:"in",x=null!==(p=null==s?void 0:s.direction)&&void 0!==p?p:"x",w=null!==(y=null==s?void 0:s.orient)&&void 0!==y?y:"positive",A=Si.graphicService.creator.rect({x:0,y:0,width:"in"===k&&"x"===x?0:m,height:"in"===k&&"y"===x?0:b,fill:!0}),S={},T={};return"y"===x?"negative"===w?(S={y:b,height:0},T={y:0,height:b}):(S={height:0},T={height:b}):"negative"===w?(S={x:m,width:0},T={x:0,width:m}):(S={width:0},T={width:m}),e(this,n,["in"===k?S:T,"in"===k?T:S,r,a,{group:null==s?void 0:s.group,clipGraphic:A}])}return c(n,t),u(n)}(ja),Fa=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"onStart",value:function(){var t="function"==typeof this.params?this.params():this.params,e=t.center,n=t.r,i=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),a=this.target.getComputedAttribute("z"),o=Math.acos((r-e.y)/n),s=Math.acos((i-e.x)/n/Math.sin(o));a-e.z<0&&(s=jt-s),this.theta=s,this.phi=o}},{key:"onBind",value:function(){}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){if(null!=this.phi&&null!=this.theta){var i="function"==typeof this.params?this.params():this.params,r=i.center,a=i.r,o=i.cb,s=2*Math.PI*e,u=this.theta+s,l=this.phi,c=a*Math.sin(l)*Math.cos(u)+r.x,h=a*Math.cos(l)+r.y,d=a*Math.sin(l)*Math.sin(u)+r.z;for(n.x=c,n.y=h,n.z=d,n.alpha=u+Lt/2;n.alpha>jt;)n.alpha-=jt;n.alpha=jt-n.alpha,n.zIndex=-1e4*n.z,o&&o(n)}}}])}(ra),za=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.target.setTheme({common:{opacity:0}})}},{key:"onEnd",value:function(){this.target.setTheme({common:{opacity:1}})}},{key:"onUpdate",value:function(t,e,n){this.target.setTheme({common:{opacity:e}})}}])}(ra),Ga=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.target.setTheme({common:{opacity:1}})}},{key:"onEnd",value:function(){this.target.setTheme({common:{opacity:0}})}},{key:"onUpdate",value:function(t,e,n){this.target.setTheme({common:{opacity:1-e}})}}])}(ra),Ha=function(t){function n(t,i,r){return o(this,n),e(this,n,[{},t,i,r])}return c(n,t),u(n,[{key:"getEndProps",value:function(){return this.to}},{key:"onBind",value:function(){var t=this;Object.keys(this.to).forEach((function(e){t.from[e]=t.target.getComputedAttribute(e)}))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,n,this.step,e,t,this.to,this.from)}}])}(ra),Va=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[null,null,t,"linear"])).customAnimates=i,r}return c(n,t),u(n,[{key:"initAnimates",value:function(){var t=this;this.customAnimates.forEach((function(e){e.step=t.step,e.subAnimate=t.subAnimate,e.target=t.target}))}},{key:"getEndProps",value:function(){var t={};return this.customAnimates.forEach((function(e){Object.assign(t,e.getEndProps())})),t}},{key:"onBind",value:function(){this.initAnimates(),this.customAnimates.forEach((function(t){t.onBind()}))}},{key:"onEnd",value:function(){this.customAnimates.forEach((function(t){t.onEnd()}))}},{key:"onStart",value:function(){this.customAnimates.forEach((function(t){t.onStart()}))}},{key:"onUpdate",value:function(t,e,n){this.updating||(this.updating=!0,this.customAnimates.forEach((function(i){var r=i.easing,a="string"==typeof r?ea[r]:r;e=a(e),i.onUpdate(t,e,n)})),this.updating=!1)}}])}(ra),Ya=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[null,null,t,"linear"])).customAnimates=i,r}return c(n,t),u(n,[{key:"initAnimates",value:function(){var t=this;this.customAnimates.forEach((function(e){e.step=t.step,e.subAnimate=t.subAnimate,e.target=t.target}))}},{key:"getEndProps",value:function(){var t={};return this.customAnimates.forEach((function(e){Object.assign(t,e.getEndProps())})),t}},{key:"onBind",value:function(){this.initAnimates(),this.customAnimates.forEach((function(t){t.onBind()}))}},{key:"onEnd",value:function(){this.customAnimates.forEach((function(t){t.onEnd()}))}},{key:"onUpdate",value:function(t,e,n){this.updating||(this.updating=!0,this.customAnimates.forEach((function(i){var r=i.easing,a="string"==typeof r?ea[r]:r;e=a(e),i.onUpdate(t,e,n)})),this.updating=!1)}}])}(ra);function Xa(t,e,n,i,r,a){var o=(e-t)*r+t,s=(n-e)*r+e,u=(i-n)*r+n,l=(s-o)*r+o,c=(u-s)*r+s,h=(c-l)*r+l;a[0]=t,a[1]=o,a[2]=l,a[3]=h,a[4]=h,a[5]=c,a[6]=u,a[7]=i}function Ka(t,e){var n=t.length,i=e.length;if(n===i)return[t,e];for(var r=[],a=[],o=n<i?t:e,s=Math.min(n,i),u=Math.abs(i-n)/6,l=(s-2)/6,c=Math.ceil(u/l),h=[o[0],o[1]],d=u,f=2;f<s;f+=6){var v=o[f-2],p=o[f-1],y=o[f],g=o[f+1],m=o[f+2],b=o[f+3],k=o[f+4],x=o[f+5];if(d<=0)h.push(y,g,m,b,k,x);else{for(var w=Math.min(d,c)+1,A=1;A<=w;A++){var S=A/w;Xa(v,y,m,k,S,r),Xa(p,g,b,x,S,a),v=r[3],p=a[3],h.push(r[1],a[1],r[2],a[2],v,p),y=r[5],g=a[5],m=r[6],b=a[6]}d-=w-1}}return o===t?[h,e]:[t,h]}function qa(t,e){for(var n=t||e,i=n.length,r=n[i-2],a=n[i-1],o=[],s=0;s<e.length;s+=2)o[s]=r,o[s+1]=a;return o}function Za(t){for(var e=[],n=t.length,i=0;i<n;i+=2)e[i]=t[n-i-2],e[i+1]=t[n-i-1];return e}function Ja(t){for(var e=0,n=0,i=0,r=t.length,a=0,o=r-2;a<r;o=a,a+=2){var s=t[o],u=t[o+1],l=t[a],c=t[a+1],h=s*c-l*u;e+=h,n+=(s+l)*h,i+=(u+c)*h}return 0===e?[t[0]||0,t[1]||0,0]:[n/e/3,i/e/3,e]}function Qa(t,e,n,i){for(var r=(t.length-2)/6,a=1/0,o=0,s=t.length,u=s-2,l=0;l<r;l++){for(var c=6*l,h=0,d=0;d<s;d+=2){var f=0===d?c:(c+d-2)%u+2,v=t[f]-n[0],p=t[f+1]-n[1],y=e[d]-i[0]-v,g=e[d+1]-i[1]-p;h+=y*y+g*g}h<a&&(a=h,o=l)}return o}function $a(t,e,n,i){for(var r,a=[],o=0;o<t.length;o++){var s=t[o],u=e[o],l=Ja(s),c=Ja(u);null==r&&(r=l[2]<0!=c[2]<0);var h=[],d=[],f=0,v=1/0,p=[],y=s.length;r&&(s=Za(s));for(var g=6*Qa(s,u,l,c),m=y-2,b=0;b<m;b+=2){var k=(g+b)%m+2;h[b+2]=s[k]-l[0],h[b+3]=s[k+1]-l[1]}if(h[0]=s[g]-l[0],h[1]=s[g+1]-l[1],n>0)for(var x=i/n,w=-i/2;w<=i/2;w+=x){for(var A=Math.sin(w),S=Math.cos(w),T=0,B=0;B<s.length;B+=2){var C=h[B],_=h[B+1],R=u[B]-c[0],P=u[B+1]-c[1],M=R*S-P*A,E=R*A+P*S;p[B]=M,p[B+1]=E;var O=M-C,L=E-_;T+=O*O+L*L}if(T<v){v=T,f=w;for(var I=0;I<p.length;I++)d[I]=p[I]}}else for(var D=0;D<y;D+=2)d[D]=u[D]-c[0],d[D+1]=u[D+1]-c[1];a.push({from:h,to:d,fromCp:l,toCp:c,rotation:-f})}return a}function to(t,e){for(var n,i,r=[],a=[],o=0;o<Math.max(t.length,e.length);o++){var s,u=t[o],l=e[o],c=void 0,h=void 0;u?l?(n=c=(s=y(Ka(u,l),2))[0],i=h=s[1]):(h=qa(i,u),c=u):(c=qa(n,l),h=l),r.push(c),a.push(h)}return[r,a]}var eo=function(t,e,n,i,r){Mt(e,i)&&Mt(n,r)||t.push(e,n,i,r,i,r)};function no(t){for(var e,n,i,r,a,o=t.commandList,s=[],u=0,l=0,c=0,h=0,d=function(t,n){e&&e.length>2&&s.push(e),e=[t,n]},f=0,v=o.length;f<v;f++){var p=o[f],y=0===f;switch(y&&(c=u=p[1],h=l=p[2],[en.L,en.C,en.Q].includes(p[0])&&(e=[c,h])),p[0]){case en.M:u=c=p[1],l=h=p[2],d(c,h);break;case en.L:n=p[1],i=p[2],eo(e,u,l,n,i),u=n,l=i;break;case en.C:e.push(p[1],p[2],p[3],p[4],u=p[5],l=p[6]);break;case en.Q:n=p[1],i=p[2],r=p[3],a=p[4],e.push(u+2/3*(n-u),l+2/3*(i-l),r+2/3*(n-r),a+2/3*(i-a),r,a),u=r,l=a;break;case en.A:var g=p[1],m=p[2],b=p[3],k=b,x=p[4],w=p[5],A=!!p[6];n=Math.cos(x)*b+g,i=Math.sin(x)*b+m,y?d(c=n,h=i):eo(e,u,l,n,i),u=Math.cos(w)*b+g,l=Math.sin(w)*b+m;for(var S=(A?-1:1)*Math.PI/2,T=x;A?T>w:T<w;T+=S){var B=A?Math.max(T+S,w):Math.min(T+S,w);sn(e,T,B,g,m,b,k)}break;case en.E:var C=p[1],_=p[2],R=p[3],P=p[4],M=p[5],E=p[6],O=p[7]+E,L=!!p[8],I=!Mt(M,0),D=Math.cos(M),j=Math.sin(M),U=Math.cos(E)*R,W=Math.sin(E)*P;I?(n=U*D-W*j+C,i=U*j+W*D+_):(n=U+C,i=W+_),y?d(c=n,h=i):eo(e,u,l,n,i),U=Math.cos(O)*R,W=Math.sin(O)*P,I?(u=U*D-W*j+C,l=U*j+W*D+_):(u=U+C,l=W+_);for(var N=(L?-1:1)*Math.PI/2,F=E;L?F>O:F<O;F+=N){var z=L?Math.max(F+N,O):Math.min(F+N,O);if(sn(e,F,z,C,_,R,P),I)for(var G=e.length,H=G-6;H<=G-1;H+=2)U=e[H],W=e[H+1],e[H]=(U-C)*D-(W-_)*j+C,e[H+1]=(U-C)*j+(W-_)*D+_}break;case en.R:c=u=p[1],h=l=p[2],n=c+p[3],i=h+p[4],d(n,h),eo(e,n,h,n,i),eo(e,n,i,c,i),eo(e,c,i,c,h),eo(e,c,h,n,h);break;case en.AT:var V=p[1],Y=p[2],X=p[3],K=p[4],q=p[5],Z=Qt.distancePP({x:u,y:l},{x:V,y:Y}),J=Qt.distancePP({x:X,y:K},{x:V,y:Y}),Q=((u-V)*(X-V)+(l-Y)*(K-Y))/(Z*J),$=q/Math.sin(Q/2),tt=(u+X-2*V)/2,et=(l+K-2*Y)/2,nt=Qt.distancePP({x:tt,y:et},{x:0,y:0}),it=V+$*tt/nt,rt=X+$*et/nt,at=Math.sqrt($*$-q*q);eo(e,u,l,c=V+at*(u-V)/Z,h=Y+at*(l-Y)/Z),u=V+at*(X-V)/J,l=Y+at*(K-Y)/J;var ot=ie({x:it,y:rt},{x:c,y:h}),st=ie({x:it,y:rt},{x:u,y:l});sn(e,ot,st,it,rt,q,q);break;case en.Z:e&&eo(e,u,l,c,h),u=c,l=h}}return e&&e.length>2&&s.push(e),s}function io(t,e){for(var n=0;n<t.length;n++)for(var i=t[n],r=0;r<i.length;r+=2){var a=i[r],o=i[r+1],s={x:a,y:o};e.transformPoint({x:a,y:o},s),i[r]=s.x,i[r+1]=s.y}}function ro(t){for(var e=new Kn,n=0;n<t.length;n++){var i=t[n];if(i.length>2){e.moveTo(i[0],i[1]);for(var r=2;r<i.length;r+=6)e.bezierCurveTo(i[r],i[r+1],i[r+2],i[r+3],i[r+4],i[r+5])}}return e}var ao=function(t){if(!t)return{x:0,y:0,width:0,height:0};var e=yt(t.width)?t.x1-t.x:t.width,n=yt(t.height)?t.y1-t.y:t.height,i=0,r=0;return e<0?(i=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:i,y:r,width:e,height:n}};function oo(t,e,n){var i,r,a=t/e;t>=e?(r=Math.ceil(Math.sqrt(n*a)),0===(i=Math.floor(n/r))&&(i=1,r=n)):(i=Math.ceil(Math.sqrt(n/a)),0===(r=Math.floor(n/i))&&(r=1,i=n));for(var o=[],s=0;s<i;s++)o.push(r);var u=n-i*r;if(u>0)for(var l=0;l<u;l+=r)l+r<u?o.push(r):o.push(u-l);return o}var so=function(t,e){for(var n=ao(t.attribute),i=n.width,r=n.height,a=oo(i,r,e),o=[],s=r/a.length,u=0,l=a.length;u<l;u++)for(var c=a[u],h=i/c,d=0;d<c;d++)o.push({x:0+d*h,y:0+u*s,width:h,height:s});return o},uo=function(t,e){for(var n=t.getParsedAngle(),i=n.startAngle,r=n.endAngle,a=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),s=Math.abs(i-r),u=Math.abs(o-a),l=oo(s*(a+o)/2,u,e),c=[],h=u/l.length,d=o>=a?1:-1,f=r>=i?1:-1,v=0,p=l.length;v<p;v++)for(var y=l[v],g=s/y,m=0;m<y;m++)c.push({innerRadius:o-h*v*d,outerRadius:o-h*(v+1)*d,startAngle:i+g*m*f,endAngle:i+g*(m+1)*f});return c},lo=function(t,e){for(var n=t.getComputedAttribute("startAngle"),i=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),a=Math.abs(n-i),o=oo(a*r,r,e),s=[],u=a/o[0],l=r/o.length,c=i>=n?1:-1,h=0,d=o.length;h<d;h++)for(var f=0,v=o[h];f<v;f++)s.push({innerRadius:l*h,outerRadius:l*(h+1),startAngle:n+u*f*c,endAngle:n+u*(f+1)*c});return s},co=function(t,e){var n=t.filter((function(t){return!1!==t.defined&&wt(t.x)&&wt(t.y)}));if(0===n.length)return[];if(1===n.length)return new Array(e).fill(0).map((function(t){return n[0]}));var i=[];if(e<=n.length){for(var r=n.length/e,a=0,o=0;a<e;)i.push(n[Math.floor(o)]),o+=r,a++;return i}for(var s=e-n.length,u=1/(s/(n.length-1)+1),l=0,c=0,h=t.length;c<h;c++)if(i.push(t[c]),c<h-1)for(var d=u,f=t[c].x,v=t[c].y,p=t[c+1].x,y=t[c+1].y;d<1&&l<s;)i.push({x:f+(p-f)*d,y:v+(y-v)*d}),d+=u,l+=1;return i},ho=function(t,e){var n,i,r=t.attribute,a=r.points,o=r.segments;a||(a=o.reduce((function(t,e){var n;return t.concat(null!==(n=e.points)&&void 0!==n?n:[])}),[]));var s=a.filter((function(t){return!1!==t.defined&&wt(t.x)&&wt(t.y)}));if(!s.length)return[];var u=[];s.forEach((function(t){u.push({x:t.x,y:t.y})}));for(var l=s.length-1;l>=0;l--){var c=s[l];u.push({x:null!==(n=c.x1)&&void 0!==n?n:c.x,y:null!==(i=c.y1)&&void 0!==i?i:c.y})}var h=[];return mo(a,e,h),h},fo=function(t,e){var n=t.attribute,i=n.points;if(i)return co(i,e);if(n.segments){var r=n.segments.reduce((function(t,e){var n;return t.concat(null!==(n=e.points)&&void 0!==n?n:[])}),[]);return co(r,e)}return[]};var vo,po=function(t){return t.map((function(t){return{x:t.x,y:t.y}}))},yo=function(t,e,n){for(var i,r,a,o=t.length,s=[],u=0;u<o;u++){var l=t[u],c=u===o-1?t[0]:t[u+1],h=Ce([e.x,e.y],[n.x,n.y],[l.x,l.y],[c.x,c.y]);h&&"boolean"!=typeof h&&s.push({dot:(r=[h[0]-e.x,h[1]-e.x],a=[n.x-e.x,n.y-e.x],r[0]*a[1]-r[1]*a[0]),point:{x:h[0],y:h[1]},edgeIndex:u})}if(s.length<2)return[po(t),po(t)];s.sort((function(t,e){return t.dot-e.dot}));var d=s[0],f=s[s.length-1];d.edgeIndex>f.edgeIndex&&(d=(i=[f,d])[0],f=i[1]);for(var v=d.point,p=f.point,y=[{x:v.x,y:v.y}],g=d.edgeIndex+1;g<=f.edgeIndex;g++)y.push({x:t[g].x,y:t[g].y});y.push({x:p.x,y:p.y});for(var m=[{x:p.x,y:p.y}],b=f.edgeIndex+1,k=d.edgeIndex+o;b<=k;b++){var x=t[b%o];m.push({x:x.x,y:x.y})}return m.push({x:v.x,y:v.y}),[y,m]},go=function(t){var e=new te;t.forEach((function(t){e.add(t.x,t.y)}));var n=e.width(),i=e.height();if(n>=i){var r=e.x1+n/2;return yo(t,{x:r,y:e.y1},{x:r,y:e.y2})}var a=e.y1+i/2;return yo(t,{x:e.x1,y:a},{x:e.x2,y:a})},mo=function t(e,n,i){if(1===n)i.push({points:e});else{var r=Math.floor(n/2),a=go(e);t(a[0],r,i),t(a[1],n-r,i)}},bo=function(t,e){var n=t.attribute.points;if(!n||!n.length)return[];if(1===e)return[{points:po(n)}];var i=[];return mo(n,e,i),i},ko=function(t,e){var n=no(t.getParsedPathShape());if(!n.length||e<0)return[];var i=n.length;if(n.length>=e){for(var r=[],a=Math.floor(n.length/e),o=0;o<e;o++){var s=n.slice(o*a,o===e-1?i:(o+1)*a);r.push({path:ro(s)})}return r}for(var u=[],l=Math.floor(e/i),c=e,h=0;h<i;h++){for(var d=[],f=2,v=n[h].length;f<v;f+=2)d.push({x:n[0][f],y:n[0][f+1]});mo(d,h===i-1?c:l,u),c-=l}return u};t.ColorType=void 0,(vo=t.ColorType||(t.ColorType={}))[vo.Color255=0]="Color255",vo[vo.Color1=1]="Color1";var xo=function(){function e(){o(this,e)}return u(e,null,[{key:"Get",value:function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){var a=e.store1[n];if(a)return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r;var o=Se.parseColorString(n);if(o){var s=[o.r/255,o.g/255,o.b/255,o.opacity];e.store1[n]=s,e.store255[n]=[o.r,o.g,o.b,o.opacity],r[0]=s[0],r[1]=s[1],r[2]=s[2],r[3]=s[3]}return r}var u=e.store255[n];if(u)return r[0]=u[0],r[1]=u[1],r[2]=u[2],r[3]=u[3],r;var l=Se.parseColorString(n);return l&&(e.store1[n]=[l.r/255,l.g/255,l.b/255,l.opacity],e.store255[n]=[l.r,l.g,l.b,l.opacity],r[0]=l.r,r[1]=l.g,r[2]=l.b,r[3]=l.opacity),r}},{key:"Set",value:function(n,i,r){if(i===t.ColorType.Color1){if(e.store1[n])return;e.store1[n]=r,e.store255[n]=[Math.floor(255*r[0]),Math.floor(255*r[1]),Math.floor(255*r[2]),Math.floor(255*r[3])]}else{if(e.store255[n])return;e.store255[n]=r,e.store1[n]=[r[0]/255,r[1]/255,r[2]/255,r[3]]}}}])}();function wo(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 Ao(e,n,i,r,a){if(!e||!n)return e&&wo(e)||n&&wo(n)||!1;var o,s,u=!1,l=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=xo.Get(e,t.ColorType.Color255):u=!0,Array.isArray(n)?s=n:"string"==typeof n?s=xo.Get(n,t.ColorType.Color255):l=!0,u!==l){var c=u?e:n,h=u?n:e,d=Object.assign(Object.assign({},c),{stops:c.stops.map((function(t){return Object.assign(Object.assign({},t),{color:wo(h)})}))});return u?Ao(c,d,i,r,a):Ao(d,c,i,r,a)}if(u){if(e.gradient===n.gradient){var f=e,v=n,p=f.stops,y=v.stops;if(p.length!==y.length)return!1;if("linear"===f.gradient)return So(f,v,i);if("radial"===f.gradient)return To(f,v,i);if("conical"===f.gradient)return Bo(f,v,i)}return!1}return a&&a(o,s),wo(Co(o,s,i),r)}function So(t,e,n){var i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:Po(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}function To(t,e,n){var i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:Po(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}function Bo(t,e,n){var i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:Po(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}function Co(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}xo.store255={},xo.store1={};var _o=[0,0,0,0],Ro=[0,0,0,0];function Po(e,n,i){return xo.Get(e,t.ColorType.Color255,_o),xo.Get(n,t.ColorType.Color255,Ro),"rgba(".concat(Math.round(_o[0]+(Ro[0]-_o[0])*i),",").concat(Math.round(_o[1]+(Ro[1]-_o[1])*i),",").concat(Math.round(_o[2]+(Ro[2]-_o[2])*i),",").concat(_o[3]+(Ro[3]-_o[3])*i,")")}var Mo=function(t,e,n){t.forEach((function(t){if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*n;else if("fill"===t.key||"stroke"===t.key){var i=Ao(t.from,t.to,n,!1);i&&(e[t.key]=i)}}))},Eo=function(t,e,n){var i=[],r=[];e.clear();for(var a=0;a<t.length;a++){var o=t[a],s=o.from,u=o.to,l=o.rotation*n,c=o.fromCp,h=o.toCp,d=Math.sin(l),f=Math.cos(l);r[0]=c[0]+(h[0]-c[0])*n,r[1]=c[1]+(h[1]-c[1])*n;for(var v=0;v<s.length;v+=2){var p=s[v],y=s[v+1],g=p*(1-n)+u[v]*n,m=y*(1-n)+u[v+1]*n;i[v]=g*f-m*d+r[0],i[v+1]=g*d+m*f+r[1]}var b=i[0],k=i[1];e.moveTo(b,k);for(var x=2;x<s.length;x+=6){var w=i[x],A=i[x+1],S=i[x+2],T=i[x+3],B=i[x+4],C=i[x+5];b===w&&k===A&&S===B&&T===C?e.lineTo(B,C):e.bezierCurveTo(w,A,S,T,B,C),b=B,k=C}}},Oo=function(t,e,n){var i=t?no(t):[],r=no(e);n&&i&&(n.fromTransform&&io(i,n.fromTransform.clone().getInverse()),io(i,n.toTransfrom));var a=y(to(i,r),2),o=a[0],s=a[1];return t?$a(o,s,10,Math.PI):s.map((function(t,e){return{from:o[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0}}))},Lo=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],Io=function(e,n){if(!e||!n)return null;var i=[],r=!1;return Object.keys(e).forEach((function(a){if(Lo.includes(a)){var o=n[a];yt(o)||yt(e[a])||o===e[a]||("fill"===a||"stroke"===a?i.push({from:"string"==typeof e[a]?xo.Get(e[a],t.ColorType.Color255):e[a],to:"string"==typeof o?xo.Get(o,t.ColorType.Color255):o,key:a}):i.push({from:e[a],to:o,key:a}),r=!0)}})),r?i:null},Do=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[0,1,i,r])).morphingData=t.morphingData,a.otherAttrs=t.otherAttrs,a.saveOnEnd=t.saveOnEnd,a}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){var i=this.target,r="function"==typeof i.pathProxy?i.pathProxy(i.attribute):i.pathProxy;Eo(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Mo(this.otherAttrs,n,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}])}(ra),jo=function(t,e,n,i){var r,a,o;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;var s=null==t?void 0:t.globalTransMatrix;i&&s&&(s=i.clone().multiply(s.a,s.b,s.c,s.d,s.e,s.f));var u=Oo(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:s,toTransfrom:e.globalTransMatrix}),l=Io(null==t?void 0:t.attribute,e.attribute),c=e.animate(n);return(null==n?void 0:n.delay)&&c.wait(n.delay),c.play(new Do({morphingData:u,otherAttrs:l},null!==(a=null==n?void 0:n.duration)&&void 0!==a?a:ha.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:ha.easing)),c},Uo=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[0,1,i,r])).morphingData=t.morphingData,a.otherAttrs=t.otherAttrs,a}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.addPathProxy()}},{key:"addPathProxy",value:function(){this.target.shadowRoot.forEachChildren((function(t){t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}},{key:"clearPathProxy",value:function(){this.target.shadowRoot.forEachChildren((function(t){t.pathProxy=null}))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){var i=this;this.target.shadowRoot.forEachChildren((function(t,n){var r;Eo(i.morphingData[n],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(r=i.otherAttrs)||void 0===r?void 0:r[n])&&i.otherAttrs[n].length&&Mo(i.otherAttrs[n],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}])}(ra),Wo=function(t){var e={};return Object.keys(t).forEach((function(n){Aa(n)||(e[n]=t[n])})),e},No=function(t,e,n){var i=Wo(t.attribute),r=t.attachShadow();if(e.length)r.setTheme(l({},e[0].type,i)),e.forEach((function(t){r.appendChild(t)}));else{var a=t.AABBBounds,o=a.width(),s=a.height();r.setTheme({rect:i}),new Array(n).fill(0).forEach((function(t){var n=Si.graphicService.creator.rect({x:0,y:0,width:o,height:s});r.appendChild(n),e.push(n)}))}},Fo=function(t,e,n){for(var i=[],r=n?null:Wo(t.attribute),a=t.toCustomPath(),o=0;o<e;o++){var s={path:(new Kn).fromCustomPath2D(a)};i.push(Si.graphicService.creator.path(n?s:Object.assign({},r,s)))}return n&&No(t,i,e),i},zo=function(t,e,n){var i=[],r=n?null:Wo(t.attribute);if("rect"===t.type)so(t,e).forEach((function(t){i.push(Si.graphicService.creator.rect(n?t:Object.assign({},r,t)))}));else if("arc"===t.type)uo(t,e).forEach((function(t){i.push(Si.graphicService.creator.arc(n?t:Object.assign({},r,t)))}));else if("circle"===t.type)lo(t,e).forEach((function(t){i.push(Si.graphicService.creator.arc(n?t:Object.assign({},r,t)))}));else if("line"===t.type){var a=fo(t,e),o={size:10,symbolType:"circle"};a.forEach((function(t){i.push(Si.graphicService.creator.symbol(n?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else"polygon"===t.type?bo(t,e).forEach((function(t){i.push(Si.graphicService.creator.polygon(n?t:Object.assign({},r,t)))})):"area"===t.type?ho(t,e).forEach((function(t){i.push(Si.graphicService.creator.polygon(n?t:Object.assign({},r,t)))})):"path"===t.type&&ko(t,e).forEach((function(t){"path"in t?i.push(Si.graphicService.creator.path(n?t:Object.assign({},r,t))):i.push(Si.graphicService.creator.polygon(n?t:Object.assign({},r,t)))}));return n&&No(t,i,e),i},Go=function(){function t(){o(this,t)}return u(t,null,[{key:"GetImage",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?Si.global.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&n.imageLoadSuccess(e,r.data):t.loadImage(e,n)}},{key:"GetSvg",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?Si.global.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&n.imageLoadSuccess(e,r.data):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Si.global.loadSvg(e),r.dataPromise?(r.waitingMark=[n],r.dataPromise.then((function(t){var n;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(n=r.waitingMark)||void 0===n||n.map((function(n,i){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,n.imageLoadSuccess(e,t.data)):(r.loadState="fail",n.imageLoadFail(e))}))}))):(r.loadState="fail",n.imageLoadFail(e)))}},{key:"GetFile",value:function(e,n){var i=t.cache.get(e);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((function(t){return t.data})):Promise.resolve(i.data):(i={type:n,loadState:"init"},t.cache.set(e,i),"arrayBuffer"===n?i.dataPromise=Si.global.loadArrayBuffer(e):"blob"===n?i.dataPromise=Si.global.loadBlob(e):"json"===n&&(i.dataPromise=Si.global.loadJson(e)),i.dataPromise.then((function(t){return t.data})))}},{key:"loading",value:function(){var e=this;setTimeout((function(){if(!t.isLoading&&t.toLoadAueue.length){t.isLoading=!0;var n=t.toLoadAueue.splice(0,10),i=[];n.forEach((function(e){var n=e.url,r=e.marks,a={type:"image",loadState:"init"};if(t.cache.set(n,a),a.dataPromise=Si.global.loadImage(n),a.dataPromise){a.waitingMark=r;var o=a.dataPromise.then((function(t){var e;a.loadState=(null==t?void 0:t.data)?"success":"fail",a.data=null==t?void 0:t.data,null===(e=a.waitingMark)||void 0===e||e.map((function(e,i){(null==t?void 0:t.data)?(a.loadState="success",a.data=t.data,e.imageLoadSuccess(n,t.data)):(a.loadState="fail",e.imageLoadFail(n))}))}));i.push(o)}else a.loadState="fail",r.forEach((function(t){return t.imageLoadFail(n)}))})),Promise.all(i).then((function(){t.isLoading=!1,e.onLoadSuccessCb.forEach((function(t){return t()})),t.loading()})).catch((function(n){console.error(n),t.isLoading=!1,e.onLoadSuccessCb.forEach((function(t){return t()})),t.loading()}))}}),0)}},{key:"loadImage",value:function(e,n){var i=Ho(e,t.toLoadAueue);if(-1!==i)return t.toLoadAueue[i].marks.push(n),void t.loading();t.toLoadAueue.push({url:e,marks:[n]}),t.loading()}},{key:"improveImageLoading",value:function(e){var n=Ho(e,t.toLoadAueue);if(-1!==n){var i=t.toLoadAueue.splice(n,1);t.toLoadAueue.unshift(i[0])}}},{key:"onLoadSuccess",value:function(t){this.onLoadSuccessCb.push(t)}}])}();function Ho(t,e){for(var n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}Go.cache=new Map,Go.isLoading=!1,Go.toLoadAueue=[],Go.onLoadSuccessCb=[];var Vo=new re,Yo=new ee,Xo=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ko=["x","y"],qo=["scaleX","scaleY"],Zo=["angle"],Jo=new Jt,Qo={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1},$o=function(n){function i(){var n,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,i),(n=e(this,i))._AABBBounds=new ee,n._updateTag=t.UpdateTag.INIT,n.attribute=a,n.valid=n.isValid(),a.background&&n.loadImage(null!==(r=a.background.background)&&void 0!==r?r:a.background,!0),n}return c(i,n),u(i,[{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,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attribute,a=r.dx,o=void 0===a?t.dx:a,s=r.dy,u=void 0===s?t.dy:s;if(i&&this.parent){var l=this.parent.attribute;Jo.x=o+(null!==(e=l.scrollX)&&void 0!==e?e:0),Jo.y=u+(null!==(n=l.scrollY)&&void 0!==n?n:0)}else Jo.x=o,Jo.y=u;return Jo}},{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;Si.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return Si.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(){var t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}},{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 re),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}},{key:"containsPoint",value:function(e,n,i,r){if(!r)return!1;if(i===t.IContainPointMode.GLOBAL){var a=new Jt(e,n);this.parent&&this.parent.globalTransMatrix.transformPoint(a,a),e=a.x,n=a.y}return r.containsPoint(this,{x:e,y:n})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,n)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=Object.keys(t),r=0;r<i.length;r++){var a=i[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}},{key:"setAttribute",value:function(t,e,n,i){var r,a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(l({},t,e),this.attribute,t,i);a?this._setAttributes(a,n,i):yt(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}},{key:"needUpdateTags",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xo,n=0;n<e.length;n++){var i=e[n];if(-1!==t.indexOf(i))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xo,n=0;n<e.length;n++)if(t===e[n])return!0;return!1}},{key:"initAttributes",value:function(e){var n={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,n)||e,this.attribute=e,e.background&&this.loadImage(e.background,!0),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(n)}},{key:"translate",value:function(e,n){var i,r;if(0===e&&0===n)return this;var a={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:n},this.attribute,Ko,a);o&&(e=o.x,n=o.y,delete o.x,delete o.y,this._setAttributes(o));var s=this.attribute,u=s.postMatrix;return u?Si.transformUtil.fromMatrix(u,u).translate(e,n):(s.x=(null!==(i=s.x)&&void 0!==i?i:Qn.x)+e,s.y=(null!==(r=s.y)&&void 0!==r?r:Qn.y)+n),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}},{key:"translateTo",value:function(e,n){var i=this.attribute;if(i.x===e&&i.y===n)return this;var r={type:t.AttributeUpdateType.TRANSLATE_TO},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:n},this.attribute,Ko,r);return a?(this._setAttributes(a,!1,r),this):(i.x=e,i.y=n,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}},{key:"scale",value:function(e,n,i){var r,a;if(1===e&&1===n)return this;var o={type:t.AttributeUpdateType.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:n,scaleCenter:i},this.attribute,qo,o);s&&(e=s.scaleX,n=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));var u=this.attribute;if(i){var l=this.attribute.postMatrix;l||(l=new re,u.postMatrix=l),Si.transformUtil.fromMatrix(l,l).scale(e,n,i)}else u.scaleX=(null!==(r=u.scaleX)&&void 0!==r?r:Qn.scaleX)*e,u.scaleY=(null!==(a=u.scaleY)&&void 0!==a?a:Qn.scaleY)*n;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}},{key:"scaleTo",value:function(e,n){var i=this.attribute;if(i.scaleX===e&&i.scaleY===n)return this;var r={type:t.AttributeUpdateType.SCALE_TO},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:n},this.attribute,qo,r);return a?(this._setAttributes(a,!1,r),this):(i.scaleX=e,i.scaleY=n,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}},{key:"rotate",value:function(e,n){var i;if(0===e)return this;var r={type:t.AttributeUpdateType.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:n},this.attribute,Zo,r);a&&(delete a.angle,this._setAttributes(a,!1,r));var o=this.attribute;if(n){var s=this.attribute.postMatrix;s||(s=new re,o.postMatrix=s),Si.transformUtil.fromMatrix(s,s).rotate(e,n)}else o.angle=(null!==(i=o.angle)&&void 0!==i?i:Qn.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"rotateTo",value:function(e){var n=this.attribute;if(n.angle===e)return this;var i={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,Zo,i);return r?(this._setAttributes(r,!1,i),this):(n.angle=e,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 n=new oa(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){var i=t.onStart,r=t.onFrame,a=t.onEnd,o=t.onRemove;null!=i&&n.onStart(i),null!=r&&n.onFrame(r),null!=a&&n.onEnd(a),null!=o&&n.onRemove(o),n.interpolateFunc=t.interpolate}return this.animates.set(n.id,n),n.onRemove((function(){e.animates.delete(n.id)})),n}},{key:"onAttributeUpdate",value:function(t){t&&t.skipUpdateCallback||(Si.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)&&(!!yt(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(e,n,i,r){var a,o,s,u,l=this;if(i){var c,h=Object.keys(e),d=this.getNoWorkAnimateAttr(),f={};h.forEach((function(t){d[t]?(c||(c={}),c[t]=e[t]):f[t]=r&&void 0===e[t]?l.getDefaultAttribute(t):e[t]}));var v=this.animate();v.stateNames=n,v.to(f,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.duration)&&void 0!==o?o:ca.duration,null!==(u=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==u?u:ca.easing),c&&this.setAttributes(c,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,n={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(n[t]=e.normalAttrs[t],delete e.normalAttrs[t]):n[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(n){t[n]=e.normalAttrs[n]}))):Object.keys(t).forEach((function(t){n[t]=e.getNormalAttribute(t)})),this.normalAttrs=n}},{key:"stopStateAnimates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((function(e){e.stateNames&&e.stop(t)}))}},{key:"getNormalAttribute",value:function(t){var e=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var i=n.getEndProps();Ct(i,t)&&(e=i[t])}})),e}},{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 n=this.currentStates.filter((function(e){return e!==t}));this.useStates(n,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 n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}},{key:"addState",value:function(t,e,n){var i;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}}},{key:"useStates",value:function(t,e){var n,i=this;if(t.length){if((null===(n=this.currentStates)||void 0===n?void 0:n.length)!==t.length||t.some((function(t,e){return i.currentStates[e]!==t}))){var r={};t.forEach((function(e){var n,a=i.stateProxy?i.stateProxy(e,t):null===(n=i.states)||void 0===n?void 0:n[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|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}},{key:"getAnchor",value:function(t,e){var n=this,i=[0,0],r=function(){if(e.b)return e.b;var t=n.attribute,i=t.scaleX,r=t.scaleY,a=t.angle;return Yo.copy(n._AABBBounds),n.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=n.AABBBounds.clone(),n._AABBBounds.copy(Yo),n.setAttributes({scaleX:i,scaleY:r,angle:a}),e.b};if("string"==typeof t[0]){var a=parseFloat(t[0])/100,o=r();i[0]=o.x1+(o.x2-o.x1)*a}else i[0]=t[0];if("string"==typeof t[1]){var s=parseFloat(t[1])/100,u=r();i[1]=u.y1+(u.y2-u.y1)*s}else i[1]=t[1];return i}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?Qn.x:e,i=t.y,r=void 0===i?Qn.y:i,a=t.scaleX,o=void 0===a?Qn.scaleX:a,s=t.scaleY,u=void 0===s?Qn.scaleY:s,l=t.angle,c=void 0===l?Qn.angle:l,h=t.scaleCenter,d=t.anchor,f=t.postMatrix,v=[0,0],p={};if(d&&(v=this.getAnchor(d,p)),!h||1===o&&1===u)!function(t,e,n,i,r,a,o,s){var u,l,c=e.a,h=e.b,d=e.c,f=e.d,v=e.e,p=e.f,y=Nt(o),g=Gt(o);s?(u=s[0],l=s[1]):(u=n,l=i);var m=u-n,b=l-i,k=c*y+d*g,x=h*y+f*g,w=d*y-c*g,A=f*y-h*g;t.a=r*k,t.b=r*x,t.c=a*w,t.d=a*A,t.e=v+c*u+d*l-k*m-w*b,t.f=p+h*u+f*l-x*m-A*b}(this._transMatrix,this._transMatrix.reset(),n,r,o,u,c,d&&v);else{var y=this._transMatrix;y.reset(),y.translate(v[0],v[1]),y.rotate(c),y.translate(-v[0],-v[1]),y.translate(n,r),v=this.getAnchor(h,p),Si.transformUtil.fromMatrix(y,y).scale(o,u,{x:v[0],y:v[1]})}var g=this.getOffsetXY(Qn);if(this._transMatrix.e+=g.x,this._transMatrix.f+=g.y,f){var m=Vo.setValue(f.a,f.b,f.c,f.d,f.e,f.f),b=this._transMatrix;m.multiply(b.a,b.b,b.c,b.d,b.e,b.f),b.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,n=void 0===e?0:e,i=t.scrollY,r=void 0===i?0:i;this._globalTransMatrix.translate(n,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 n=t.getTimeline();this.animates.forEach((function(t){t.setTimeline(n)}))}this._onSetStage&&this._onSetStage(this,t,e),Si.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(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}},{key:"onStep",value:function(e,n,i,r,a){var o={};if(i.customAnimate)i.customAnimate.update(a,r,o);else{var s=i.props,u=i.parsedProps,l=i.propKeys;this.stepInterpolate(e,n,o,i,r,a,s,void 0,u,l)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:a,step:i,isFirstFrameOfStep:e.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,n,i,r,a,o,s,u,l){var c=this;l||(l=Object.keys(o),i.propKeys=l),a?i.propKeys.forEach((function(t){e.validAttr(t)&&(n[t]=o[t])})):l.forEach((function(a){var l;if(e.validAttr(a)){var h=o[a],d=null!==(l=s&&s[a])&&void 0!==l?l:t.getLastPropByName(a,i);if(null!=h&&null!=d)e.interpolateFunc&&e.interpolateFunc(a,r,d,h,n)||(e.customInterpolate(a,r,d,h,c,n)||c.defaultInterpolate(h,d,a,n,u,r)||c._interpolate(a,r,d,h,n));else n[a]=h}})),i.parsedProps=u}},{key:"defaultInterpolate",value:function(t,e,n,i,r,a){if(Number.isFinite(t))return i[n]=e+(t-e)*a,!0;if("fill"===n){r||(r={});var o=r.fillColorArray,s=Ao(e,null!=o?o:t,a,!1,(function(t,e){r.fillColorArray=e}));return s&&(i[n]=s),!0}if("stroke"===n){r||(r={});var u=r.strokeColorArray,l=Ao(e,null!=u?u:t,a,!1,(function(t,e){r.strokeColorArray=e}));return l&&(i[n]=l),!0}if("shadowColor"===n){r||(r={});var c=r.shadowColorArray,h=Ao(e,null!=c?c:t,a,!0,(function(t,e){r.shadowColorArray=e}));return h&&(i[n]=h),!0}return!1}},{key:"_interpolate",value:function(t,e,n,i,r){}},{key:"getDefaultAttribute",value:function(t){return Lr(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:Si.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 kt(t,!0)?this.pathProxy=(new Kn).fromString(t):this.pathProxy=new Kn,this.pathProxy}},{key:"loadImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))){var n=t;this.resources||(this.resources=new Map);var i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(Go.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(St(t)||t.includes("/")||Tt(t))&&(Go.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):mt(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}}},{key:"imageLoadSuccess",value:function(t,e,n){if(this.resources){var i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var n=this.resources.get(t);n&&(n.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",Si.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var n,i;if(this._events&&t in this._events){var r=new zr(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),n=0;n<e.length;++n){var r=e[n];Object.defineProperty(i.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}])}(jr);$o.mixin(Xr);var ts=function(){return u((function t(e){o(this,t),this.tagname=e,this.child=[],this[":@"]={}}),[{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))}}])}();function es(t,e,n,i){var r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function ns(t,e,n){var i=function(t,e){for(var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",a=e;a<t.length;a++){var o=t[a];if(n)o===n&&(n="");else if('"'===o||"'"===o)n=o;else if(o===i[0]){if(!i[1])return{data:r,index:a};if(t[a+1]===i[1])return{data:r,index:a}}else"\t"===o&&(o=" ");r+=o}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(i){var r=i.data,a=i.index,o=r.search(/\s/),s=r,u=!0;-1!==o&&(s=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));var l=s;if(n){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==i.data.substr(c+1))}return{tagName:s,tagExp:r,closeIndex:a,attrExpPresent:u,rawTagName:l}}}var is=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),rs=function(){return u((function t(e){o(this,t),this.currentNode=null,this.options=e,this.tagsNodeStack=[],this.docTypeEntities={}}),[{key:"addChild",value:function(t,e,n){var i=e.tagname;"string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e)}},{key:"buildAttributesMap",value:function(t,e,n){var i={};if(t){for(var r=function(t,e){for(var n=[],i=e.exec(t);i;){var r=[];r.startIndex=e.lastIndex-i[0].length;for(var a=i.length,o=0;o<a;o++)r.push(i[o]);n.push(r),i=e.exec(t)}return n}(t,is),a=r.length,o=0;o<a;o++){var s=r[o][1],u=r[o][4];s&&(i[s]=void 0===u||(isNaN(u)?u:Number(u)))}return i}}},{key:"parseXml",value:function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new ts("!xml"),n=e,i="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var o=es(t,">",a,"Closing Tag is not closed."),s=r.lastIndexOf(".");r=r.substring(0,s),(n=this.tagsNodeStack.pop())&&n.child&&i&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=i),i="",a=o}else if("?"===t[a+1])a=ns(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=es(t,"--\x3e",a+4,"Comment is not closed.");else{var u=ns(t,a,!1),l=u.tagName,c=u.tagExp,h=u.attrExpPresent,d=u.closeIndex;if(l!==e.tagname&&(r+=r?"."+l:l),c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),c=l):c=c.substr(0,c.length-1);var f=new ts(l);l!==c&&h&&(f[":@"]=this.buildAttributesMap(c,r,l)),this.addChild(n,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new ts(l);this.tagsNodeStack.push(n),l!==c&&h&&(v[":@"]=this.buildAttributesMap(c,r,l)),this.addChild(n,v,r),n=v}i="",a=d}else i+=t[a];return e.child}}])}();function as(t,e){return os(t)}function os(t,e){for(var n,i={},r=0;r<t.length;r++){var a=t[r],o=ss(a);if(void 0!==o&&a[o]){var s=os(a[o]);n=s,Object.keys(n).length,a[":@"]&&us(s,a[":@"]),void 0!==i[o]&&i.hasOwnProperty(o)?(Array.isArray(i[o])||(i[o]=[i[o]]),i[o].push(s)):i[o]=s}}return i}function ss(t){for(var e=Object.keys(t),n=0;n<e.length;n++){var i=e[n];if(":@"!==i)return i}}function us(t,e,n){if(e)for(var i=Object.keys(e),r=i.length,a=0;a<r;a++){var o=i[a];t[o]=e[o]}}var ls=function(){return u((function t(e){o(this,t),this.options=Object.assign({},t.defaultOptions,e)}),[{key:"valid",value:function(t){return t.startsWith("<")}},{key:"parse",value:function(t){return!!this.valid&&as(new rs(this.options).parseXml(t),this.options)}}])}();function cs(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function hs(t){return t.startsWith("<")}ls.defaultOptions={};var ds=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};function fs(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}var vs,ps=0;function ys(){return ps++}function gs(e){for(var n=[],i=0,r="",a=0;a<e.length;a++)ks(e[a])?i?r+=e[a]:(i=1,r=e[a]):(i&&(n.push({text:r,direction:t.TextDirection.VERTICAL}),r="",i=0),n.push({text:e[a],direction:t.TextDirection.HORIZONTAL}));return r&&n.push({text:r,direction:t.TextDirection.VERTICAL}),n}t.TextDirection=void 0,(vs=t.TextDirection||(t.TextDirection={}))[vs.HORIZONTAL=0]="HORIZONTAL",vs[vs.VERTICAL=1]="VERTICAL";var ms=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return ms.set(t,!0)}));var bs=new Map;function ks(t){if(ms.has(t))return!0;if(bs.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}function xs(t,e){var n=t.attribute;n&&n.split(";").forEach((function(t){if(t){var n=t.split(":");if(2===n.length){var i=parseFloat(n[1]);e[n[0].trim()]=isFinite(i)?i:n[1].trim()}else{for(var r="",a=1;a<n.length;a++)a>1&&(r+=":"),r+=n[a].trim();e[n[0].trim()]=r}}}))}[""].forEach((function(t){return bs.set(t,!0)}));var ws,As=ys(),Ss=ys(),Ts=ys(),Bs=ys(),Cs=ys(),_s=ys(),Rs=ys(),Ps=ys(),Ms=ys(),Es=ys(),Os=ys(),Ls=ys(),Is=ys(),Ds=ys(),js=ys(),Us=ys(),Ws=Symbol.for("GraphicService"),Ns=Symbol.for("GraphicCreator"),Fs={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},zs=Object.keys(Fs),Gs={"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"},Hs=Object.keys(Gs);t.GroupUpdateAABBBoundsMode=void 0,(ws=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[ws.LESS_GROUP=0]="LESS_GROUP",ws[ws.MORE_GROUP=1]="MORE_GROUP";var Vs=function(n){function i(n){var r;return o(this,i),(r=e(this,i,[n])).type="group",r.parent=null,r.isContainer=!0,r.numberType=_s,r._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS,r}return c(i,n),u(i,[{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 Er),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new Er)}},{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(e,n,i){if(i===t.IContainPointMode.GLOBAL){var r=new Jt(e,n);return this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),this.AABBBounds.contains(r.x,r.y)}return this.AABBBounds.contains(e,n)}},{key:"shouldUpdateAABBBounds",value:function(){return!!p(h(i.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Si.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Si.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?Qn.x:e,r=t.y,a=void 0===r?Qn.y:r,o=t.dx,s=void 0===o?Qn.dx:o,u=t.dy,l=void 0===u?Qn.dy:u,c=t.scaleX,d=void 0===c?Qn.scaleX:c,f=t.scaleY,v=void 0===f?Qn.scaleY:f,y=t.angle,g=void 0===y?Qn.angle:y,m=t.postMatrix;if(0!==n||0!==a||0!==s||0!==l||1!==d||1!==v||0!==g||m)return p(h(i.prototype),"doUpdateLocalMatrix",this).call(this);this._transMatrix.reset()}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=Lr(this).group;this._AABBBounds.clear();var n=Si.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),i=t.boundsPadding,r=void 0===i?e.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=p(h(i.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),Si.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){p(h(i.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),Si.graphicService.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=p(h(i.prototype),"appendChild",this).call(this,t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertBefore",value:function(t,e){var n=p(h(i.prototype),"insertBefore",this).call(this,t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertAfter",value:function(t,e){var n=p(h(i.prototype),"insertAfter",this).call(this,t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertInto",value:function(t,e){var n=p(h(i.prototype),"insertInto",this).call(this,t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"removeChild",value:function(t){var e=p(h(i.prototype),"removeChild",this).call(this,t);return t.stage=null,Si.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((function(e){Si.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),p(h(i.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var n=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Si.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,n.layer)})))}},{key:"addUpdatePositionTag",value:function(){p(h(i.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){p(h(i.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&t.UpdateTag.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,n){var i=this._getChildByName(t);return i?i.setAttributes(e):((i=Si.graphicService.creator[n](e)).name=t,this.add(i)),i}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}($o);function Ys(t){return new Vs(t)}Vs.NOWORK_ANIMATE_ATTR=Qo;var Xs,Ks=function(t){function n(t,i,r,a){var s,u;return o(this,n),(s=e(this,n,[{}])).stage=t,s.global=i,s.window=r,s.main=a.main,s.layerHandler=a.layerHandler,s.layerHandler.init(f(s),r,{main:a.main,canvasId:a.canvasId,width:s.viewWidth,height:s.viewHeight,zIndex:null!==(u=a.zIndex)&&void 0!==u?u:0}),s.layer=f(s),s.subLayers=new Map,s.theme=new Er,s.background="rgba(0, 0, 0, 0)",s.afterDrawCbs=[],s}return c(n,t),u(n,[{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],n=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(n.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&n.forEach((function(t){t.group&&(t.group.incremental=0)})),n.forEach((function(e){Si.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){p(h(n.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"tryRenderSecondaryLayer",value:function(t,e){var n=this;this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((function(i){i.layer.renderCount=n.renderCount,i.layer.render(t,e)}))}},{key:"render",value:function(t,e){var n,i=this;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((function(t){return t(i)})),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:"release",value:function(){var t=this;p(h(n.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){Si.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var n,i=this;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((function(t){return t(i)}))}}])}(Vs),qs=Symbol.for("TransformUtil"),Zs=Symbol.for("GraphicUtil"),Js=Symbol.for("LayerService"),Qs=Symbol.for("StaticLayerHandlerContribution"),$s=Symbol.for("DynamicLayerHandlerContribution"),tu=Symbol.for("VirtualLayerHandlerContribution"),eu=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},nu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=Xs=function(){return u((function t(){o(this,t),this.layerMap=new Map,this.global=Si.global}),[{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?Ui.get(Qs):"dynamic"===t?Ui.get($s):Ui.get(tu)}},{key:"createLayer",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();var i=this.getRecommendedLayerType(n.layerMode);i=n.main||n.canvasId?"static":i;var r=this.getLayerHandler(i),a=new Ks(t,this.global,t.window,Object.assign(Object.assign({main:!1},n),{layerMode:i,canvasId:null!==(e=n.canvasId)&&void 0!==e?e:Xs.GenerateLayerId(),layerHandler:r})),o=this.layerMap.get(t)||[];return o.push(a),this.layerMap.set(t,o),this.staticLayerCountInEnv--,a}},{key:"prepareStageLayer",value:function(t){var e;t.forEachChildren((function(t){var n=t.getNativeHandler();"virtual"===n.type?(n.mainHandler=e,e.secondaryHandlers.push(n)):(e=n).secondaryHandlers=[]}))}},{key:"releaseLayer",value:function(t,e){e.release();var n=this.layerMap.get(t)||[];this.layerMap.set(t,n.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:"releaseStage",value:function(t){this.layerMap.delete(t)}}],[{key:"GenerateLayerId",value:function(){return"".concat(Xs.idprefix,"_").concat(Xs.prefix_count++)}}])}(),t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=Xs=eu([I(),nu("design:paramtypes",[])],t.DefaultLayerService);var iu=new w((function(e){e(ot).to(t.DefaultGlobal).inSingletonScope(),e(kr).to(t.DefaultWindow),e(Zs).to(t.DefaultGraphicUtil).inSingletonScope(),e(qs).to(t.DefaultTransformUtil).inSingletonScope(),e(Js).to(t.DefaultLayerService).inSingletonScope()}));function ru(t,e){return!(!t&&!e)}function au(t,e){return(xt(t)?t.some((function(t){return t||void 0===t})):!!t)&&e>0}function ou(t,e,n){return n&&t*e>0}function su(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}function uu(t,e){return t*e>0}function lu(t,e,n,i){return t*e>0&&0!==n&&0!==i}function cu(t,e,n,i,r,a,o,s){if(!t.pathProxy)return!1;var u=Lr(t,null==a?void 0:a.theme)[t.type.replace("3d","")],l=t.attribute,c=l.fill,h=void 0===c?u.fill:c,d=l.stroke,f=void 0===d?u.stroke:d,v=l.opacity,p=void 0===v?u.opacity:v,y=l.fillOpacity,g=void 0===y?u.fillOpacity:y,m=l.lineWidth,b=void 0===m?u.lineWidth:m,k=l.strokeOpacity,x=void 0===k?u.strokeOpacity:k,w=l.visible,A=void 0===w?u.visible:w,S=l.x,T=void 0===S?u.x:S,B=l.y,C=void 0===B?u.y:B,_=ou(p,g,h),R=uu(p,x),P=ru(h),M=au(f,b);return!A||(!P&&!M||(!(_||R||o||s)||(e.beginPath(),ln(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),M&&(s?s(e,t.attribute,u):R&&(e.setStrokeStyle(t,t.attribute,n-T,i-C,u),e.stroke())),P&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,n-T,i-C,u),e.fill())),!0)))}function hu(t,e,n,i,r,a,o,s){var u=n-t,l=i-e,c=o-r,h=s-a,d=h*u-c*l;return d*d<Ot?[]:[t+(d=(c*(e-a)-h*(t-r))/d)*u,e+d*l]}function du(t,e,n,i,r,a,o){var s=t-n,u=e-i,l=(o?a:-a)/Math.sqrt(s*s+u*u),c=l*u,h=-l*s,d=t+c,f=e+h,v=n+c,p=i+h,y=(d+v)/2,g=(f+p)/2,m=v-d,b=p-f,k=m*m+b*b,x=r-a,w=d*p-v*f,A=(b<0?-1:1)*Math.sqrt(Math.max(0,x*x*k-w*w)),S=(w*b-m*A)/k,T=(-w*m-b*A)/k,B=(w*b+m*A)/k,C=(-w*m+b*A)/k,_=S-y,R=T-g,P=B-y,M=C-g;return _*_+R*R>P*P+M*M&&(S=B,T=C),{cx:S,cy:T,x01:-c,y01:-h,x11:S*(r/x-1),y11:T*(r/x-1)}}function fu(t,e,n,i,r,a,o){var s=t.getParsedAngle(),u=s.startAngle,l=s.endAngle,c=Ut(l-u),h=l>u,d=!1;if(r<a){var f=r;r=a,a=f}if(r<=Ot)e.moveTo(n,i);else if(c>=jt-Ot)e.moveTo(n+r*Nt(u),i+r*Gt(u)),e.arc(n,i,r,u,l,!h),a>Ot&&(e.moveTo(n+a*Nt(l),i+a*Gt(l)),e.arc(n,i,a,l,u,h));else{var v,p,y,g,m=t.getParsedCornerRadius(),b=t.getParsePadAngle(u,l),k=b.outerDeltaAngle,x=b.innerDeltaAngle,w=b.outerStartAngle,A=b.outerEndAngle,S=b.innerEndAngle,T=b.innerStartAngle,B=m,C=m,_=m,R=m,P=Math.max(C,B),M=Math.max(_,R),E=P,O=M,L=r*Nt(w),I=r*Gt(w),D=a*Nt(S),j=a*Gt(S);if((M>Ot||P>Ot)&&(v=r*Nt(A),p=r*Gt(A),y=a*Nt(T),g=a*Gt(T),c<Lt)){var U=hu(L,I,y,g,v,p,D,j);if(U){var W=L-U[0],N=I-U[1],F=v-U[0],z=p-U[1],G=1/Gt(Yt((W*F+N*z)/(Ht(W*W+N*N)*Ht(F*F+z*z)))/2),H=Ht(U[0]*U[0]+U[1]*U[1]);O=zt(M,(a-H)/(G-1)),E=zt(P,(r-H)/(G+1))}}if(k<.001)o&&(o[3]||o[1])&&e.moveTo(n+L,i+I),d=!0;else if(E>Ot){var V=zt(B,E),Y=zt(C,E),X=du(y,g,L,I,r,V,Number(h)),K=du(v,p,D,j,r,Y,Number(h));E<P&&V===Y?!o||o[0]?(e.moveTo(n+X.cx+X.x01,i+X.cy+X.y01),e.arc(n+X.cx,i+X.cy,E,Wt(X.y01,X.x01),Wt(K.y01,K.x01),!h)):e.moveTo(n+X.cx+E*Nt(Wt(K.y01,K.x01)),i+X.cy+E*Gt(Wt(K.y01,K.x01))):!o||o[0]?(e.moveTo(n+X.cx+X.x01,i+X.cy+X.y01),V>0&&e.arc(n+X.cx,i+X.cy,V,Wt(X.y01,X.x01),Wt(X.y11,X.x11),!h),e.arc(n,i,r,Wt(X.cy+X.y11,X.cx+X.x11),Wt(K.cy+K.y11,K.cx+K.x11),!h),Y>0&&e.arc(n+K.cx,i+K.cy,Y,Wt(K.y11,K.x11),Wt(K.y01,K.x01),!h)):Y>0?e.moveTo(n+K.cx+Y*Nt(Wt(K.y01,K.x01)),i+K.cy+Y*Gt(Wt(K.y01,K.x01))):e.moveTo(n+v,i+r*Gt(A))}else!o||o[0]?(e.moveTo(n+L,i+I),e.arc(n,i,r,w,A,!h)):e.moveTo(n+r*Nt(A),i+r*Gt(A));if(!(a>Ot)||x<.001)!o||o[1]?e.lineTo(n+D,i+j):e.moveTo(n+D,i+j),d=!0;else if(O>Ot){var q=zt(R,O),Z=zt(_,O),J=du(D,j,v,p,a,-Z,Number(h)),Q=du(L,I,y,g,a,-q,Number(h));if(!o||o[1]?e.lineTo(n+J.cx+J.x01,i+J.cy+J.y01):e.moveTo(n+J.cx+J.x01,i+J.cy+J.y01),O<M&&q===Z){var $=Wt(Q.y01,Q.x01);!o||o[2]?e.arc(n+J.cx,i+J.cy,O,Wt(J.y01,J.x01),$,!h):e.moveTo(n+J.cx+Nt($),i+J.cy+Gt($))}else!o||o[2]?(Z>0&&e.arc(n+J.cx,i+J.cy,Z,Wt(J.y01,J.x01),Wt(J.y11,J.x11),!h),e.arc(n,i,a,Wt(J.cy+J.y11,J.cx+J.x11),Wt(Q.cy+Q.y11,Q.cx+Q.x11),h),q>0&&e.arc(n+Q.cx,i+Q.cy,q,Wt(Q.y11,Q.x11),Wt(Q.y01,Q.x01),!h)):q>0?e.moveTo(n+Q.cx+q*Nt(Wt(Q.y01,Q.x01)),i+Q.cy+q*Gt(Wt(Q.y01,Q.x01))):e.moveTo(n+y,i+g)}else!o||o[1]?e.lineTo(n+D,i+j):e.moveTo(n+D,i+j),!o||o[2]?e.arc(n,i,a,S,T,h):e.moveTo(n+a*Nt(T),i+a*Gt(T))}return o?o[3]&&e.lineTo(n+r*Nt(u),i+r*Gt(u)):e.closePath(),d}var vu=function(){function t(){o(this,t)}return u(t,null,[{key:"GetCanvas",value:function(){try{return t.canvas||(t.canvas=Si.global.createCanvas({})),t.canvas}catch(t){return null}}},{key:"GetCtx",value:function(){if(!t.ctx){var e=t.GetCanvas();t.ctx=e.getContext("2d")}return t.ctx}}])}(),pu=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;o(this,n),(t=e(this,n)).cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},t.dataMap=new Map;var a=vu.GetCanvas(),s=vu.GetCtx();if(a.width=r,a.height=1,!s)return v(t);if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");var u=s.createLinearGradient(0,0,r,0);return i.forEach((function(t){u.addColorStop(t[0],t[1])})),s.fillStyle=u,s.fillRect(0,0,r,1),t.rgbaSet=s.getImageData(0,0,r,1).data,t}return c(n,t),u(n,[{key:"getColor",value:function(t){var e=this.rgbaSet.slice(4*t,4*t+4);return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3]/255,")")}},{key:"GetOrCreate",value:function(t,e,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,s="".concat(t).concat(e).concat(i).concat(r);a.forEach((function(t){return s+=t.join()})),s+=o;var u=this.dataMap.get(s);return u||(u={data:new n(a,o),timestamp:[]},this.addLimitedTimestamp(u,Date.now(),{}),this.dataMap.set(s,u)),this.clearCache(this.dataMap,this.cacheParams),u.data}}],[{key:"getInstance",value:function(){return n._instance||(n._instance=new n),n._instance}}])}(ae),yu=function(){function t(){o(this,t)}return u(t,null,[{key:"GetSize",value:function(e){for(var n=0;n<t.ImageSize.length;n++)if(t.ImageSize[n]>=e)return t.ImageSize[n];return e}},{key:"Get",value:function(e,n,i,r,a,o,s){var u=t.GenKey(e,n,i,r,a),l=t.cache[u];if(!l||0===l.length)return null;for(var c=0;c<l.length;c++)if(l[c].width>=o&&l[c].height>=s)return l[c].pattern;return null}},{key:"Set",value:function(e,n,i,r,a,o,s,u){var l=t.GenKey(e,n,i,r,a);t.cache[l]?t.cache[l].push({width:s,height:u,pattern:o}):t.cache[l]=[{width:s,height:u,pattern:o}]}},{key:"GenKey",value:function(t,e,n,i,r){return"".concat(e,",").concat(n,",").concat(i,",").concat(r,",").concat(t.join())}}])}();function gu(t,e,n,i){for(var r=i.stops,a=i.startAngle,o=i.endAngle;n<0;)n+=jt;for(;n>jt;)n-=jt;if(n<a)return r[0].color;if(n>o)return r[0].color;for(var s,u,l=(n-a)/(o-a),c=0;c<r.length;c++)if(r[c].offset>=l){s=r[c-1],u=r[c];break}return l=(l-s.offset)/(u.offset-s.offset),Ao(s.color,u.color,l,!1)}function mu(t,e,n,i,r,a,o,s,u){var l=Math.floor(180*r/Math.PI),c=vu.GetCanvas(),h=vu.GetCtx();if(!h)return null;var d=yu.GetSize(s),f=yu.GetSize(u),v=yu.Get(e,n,i,a,o,d,f);if(v)return v;var p=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),y=l+1,g=r/Math.max(1,y-1),m=pu.getInstance().GetOrCreate(n,i,d,f,e,y),b=2*Math.PI*p/360;c.width=d,c.height=f,h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,d,f),h.translate(n,i),h.rotate(a);for(var k=0,x=y-1;k<x&&!(a+k*g>o);k++){var w=m.getColor(k);h.beginPath(),h.rotate(g),h.moveTo(0,0),h.lineTo(p,-2*b),h.lineTo(p,0),h.fillStyle=w,h.closePath(),h.fill()}var A=h.getImageData(0,0,d,f);return c.width=A.width,c.height=A.height,h.putImageData(A,0,0),(v=t.createPattern(c,"no-repeat"))&&yu.Set(e,n,i,a,o,v,d,f),v}yu.cache={},yu.ImageSize=[20,40,80,160,320,640,1280,2560];var bu=Symbol.for("ArcRenderContribution"),ku=Symbol.for("AreaRenderContribution"),xu=Symbol.for("CircleRenderContribution"),wu=Symbol.for("GroupRenderContribution"),Au=Symbol.for("ImageRenderContribution"),Su=Symbol.for("PathRenderContribution"),Tu=Symbol.for("PolygonRenderContribution"),Bu=Symbol.for("RectRenderContribution"),Cu=Symbol.for("SymbolRenderContribution"),_u=Symbol.for("TextRenderContribution"),Ru=Symbol.for("CommonRenderContribution"),Pu=Symbol.for("InteractiveSubRenderContribution"),Mu=["radius","startAngle","endAngle"].concat(g(Xo)),Eu=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return o(this,n),(t=e(this,n,[i])).type="circle",t.numberType=Bs,t}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.radius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}},{key:"doUpdateAABBBounds",value:function(t){var e=Lr(this).circle;this._AABBBounds.clear();var n=this.attribute,i=Si.graphicService.updateCircleAABBBounds(n,Lr(this).circle,this._AABBBounds,t,this),r=n.boundsPadding,a=void 0===r?e.boundsPadding:r,o=pa(a);return o&&i.expand(o),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Lr(this).circle[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Mu)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Mu)}},{key:"toCustomPath",value:function(){var t,e,n,i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),a=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),s=new Kn;return s.arc(0,0,r,a,o),s}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Ou(t){return new Eu(t)}function Lu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);var i=t.fontStyle,r=void 0===i?e.fontStyle:i,a=t.fontVariant,o=void 0===a?e.fontVariant:a,s=t.fontWeight,u=void 0===s?e.fontWeight:s,l=t.fontSize,c=void 0===l?e.fontSize:l,h=t.fontFamily;return(r?r+" ":"")+(o?o+" ":"")+(u?u+" ":"")+c*n+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}function Iu(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0}function Du(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function ju(t,e,n){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:(n||(n=e),-(e-n)/2-.79*n)}function Uu(t){var e={};return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((function(n){t[n]&&(e[qe(n)]=t[n])})),["fontSize","lineHeight"].forEach((function(n){var i=qe(n);yt(t[n])||(e[i]=/^[0-9]*$/.test("".concat(t[n]))?"".concat(t[n],"px"):"".concat(t[n]))})),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&kt(t.fill)&&(e.color=t.fill),e}Eu.NOWORK_ANIMATE_ATTR=Qo;var Wu=function(){return u((function t(e,n,i){o(this,t),this.fontFamily=e,this.textOptions=n,this.textMeasure=i}),[{key:"LayoutBBox",value:function(t,e,n){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"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,n,i,r,a,o,s,u){for(var l=[],c=[e,n],h=[0,0];t.length>0;){var d=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,s,u).str;l.push({str:d,width:this.textMeasure.measureTextWidth(d,this.textOptions)}),t=t.substring(d.length)}"left"===i||"start"===i||("center"===i?h[0]=c[0]/-2:"right"!==i&&"end"!==i||(h[0]=-c[0])),"top"===r||("middle"===r?h[1]=c[1]/-2:"bottom"===r&&(h[1]=-c[1]));var f={xOffset:h[0],yOffset:h[1],width:c[0],height:c[1]};return this.layoutWithBBox(f,l,i,r,a)}},{key:"GetLayoutByLines",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((function(t){return t.toString()}));var u=[],l=[0,0];if("number"==typeof o&&o!==1/0){for(var c,h=0,d=t.length;h<d;h++)c=Math.min(this.textMeasure.measureTextWidth(t[h],this.textOptions),o),u.push({str:this.textMeasure.clipTextWithSuffix(t[h],this.textOptions,c,r,a,s).str,width:c});l[0]=o}else{var f,v;o=0;for(var p=0,y=t.length;p<y;p++)v=t[p],f=this.textMeasure.measureTextWidth(v,this.textOptions),o=Math.max(o,f),u.push({str:v,width:f});l[0]=o}l[1]=u.length*i,l[0]=u.reduce((function(t,e){return Math.max(t,e.width)}),0);var g={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(g,e,n),this.layoutWithBBox(g,u,e,n,i)}},{key:"layoutWithBBox",value:function(t,e,n,i,r){var a=[0,0],o=e.length*r;"top"===i||("middle"===i?a[1]=(t.height-o)/2:"bottom"===i&&(a[1]=t.height-o));for(var s=0;s<e.length;s++)this.lineOffset(t,e[s],n,i,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}},{key:"lineOffset",value:function(t,e,n,i,r,a){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+a[1],a[1]+=r,e}}])}(),Nu=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp"].concat(g(Xo)),Fu=function(n){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return o(this,i),(t=e(this,i,[n])).type="text",t.numberType=Us,t.cache={},t}return c(i,n),u(i,[{key:"font",get:function(){var t=Lr(this).text;return this._font||(this._font=Lu(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,n=Lr(this).text;if(this.isSimplify()){var i=e.maxLineWidth,r=void 0===i?n.maxLineWidth:i;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}}},{key:"clipedWidth",get:function(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=Lr(this).text,e=this.attribute;if(!this.isMultiLine){var n=e.maxLineWidth,i=void 0===n?t.maxLineWidth:n;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((function(t){return t.text})).join("")!==e.text.toString():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 p(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return xt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).text;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),i=this.attribute.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"updateWrapAABBBounds",value:function(t){var e,n,i,r,a=Lr(this).text,o=this.attribute,s=o.fontFamily,u=void 0===s?a.fontFamily:s,l=o.textAlign,c=void 0===l?a.textAlign:l,h=o.textBaseline,d=void 0===h?a.textBaseline:h,f=o.fontSize,v=void 0===f?a.fontSize:f,p=o.ellipsis,y=void 0===p?a.ellipsis:p,g=o.maxLineWidth,m=o.stroke,b=void 0===m?a.stroke:m,k=o.lineWidth,x=void 0===k?a.lineWidth:k,w=o.wordBreak,A=void 0===w?a.wordBreak:w,S=o.fontWeight,T=void 0===S?a.fontWeight:S,B=o.ignoreBuf,C=void 0===B?a.ignoreBuf:B,_=o.suffixPosition,R=void 0===_?a.suffixPosition:_,P=o.heightLimit,M=void 0===P?0:P,E=o.lineClamp,O=null!==(e=_a(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,L=C?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var I=this.cache.layoutData.bbox;return this._AABBBounds.set(I.xOffset,I.yOffset,I.xOffset+I.width,I.yOffset+I.height),b&&this._AABBBounds.expand(x/2),this._AABBBounds}var D=Si.graphicUtil.textMeasure,j=new Wu(u,{fontSize:v,fontWeight:T,fontFamily:u},D),U=xt(t)?t.map((function(t){return t.toString()})):[t.toString()],W=[],N=[0,0],F=1/0;if(M>0&&(F=Math.max(Math.floor(M/O),1)),E&&(F=Math.min(F,E)),"number"==typeof g&&g!==1/0){if(g>0)for(var z=0;z<U.length;z++){var G=U[z],H=!0;if(z===F-1){var V=j.textMeasure.clipTextWithSuffix(G,j.textOptions,g,y,!1,R,z!==U.length-1);W.push({str:V.str,width:V.width});break}var Y=j.textMeasure.clipText(G,j.textOptions,g,"break-word"===A);if(""!==G&&""===Y.str){if(y){var X=j.textMeasure.clipTextWithSuffix(G,j.textOptions,g,y,!1,R);Y.str=null!==(i=X.str)&&void 0!==i?i:"",Y.width=null!==(r=X.width)&&void 0!==r?r:0}else Y.str="",Y.width=0;H=!1}if(W.push({str:Y.str,width:Y.width}),Y.str.length===G.length);else if(H){var K=G.substring(Y.str.length);U.splice(z+1,0,K)}}var q=0;W.forEach((function(t){q=Math.max(q,t.width)})),N[0]=q}else{for(var Z,J,Q=0,$=0,tt=U.length;$<tt;$++){if($===F-1){var et=j.textMeasure.clipTextWithSuffix(U[$],j.textOptions,g,y,!1,R);W.push({str:et.str,width:et.width}),Q=Math.max(Q,et.width);break}J=U[$],Z=j.textMeasure.measureTextWidth(J,j.textOptions,"break-word"===A),Q=Math.max(Q,Z),W.push({str:J,width:Z})}N[0]=Q}N[1]=W.length*(O+L);var nt={xOffset:0,yOffset:0,width:N[0],height:N[1]};j.LayoutBBox(nt,c,d);var it=j.layoutWithBBox(nt,W,c,d,O);return this.cache.layoutData=it,this.clearUpdateShapeTag(),this._AABBBounds.set(nt.xOffset,nt.yOffset,nt.xOffset+nt.width,nt.yOffset+nt.height),b&&this._AABBBounds.expand(x/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=Lr(this).text,n=this.attribute,i=n.direction,r=void 0===i?e.direction:i,a=n.underlineOffset,o=void 0===a?e.underlineOffset:a,s="horizontal"===r?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===r&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),s}},{key:"updateMultilineAABBBounds",value:function(t){var e=Lr(this).text,n=this.attribute,i=n.direction,r=void 0===i?e.direction:i,a=n.underlineOffset,o=void 0===a?e.underlineOffset:a,s="horizontal"===r?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===r&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),s}},{key:"updateHorizontalSinglelineAABBBounds",value:function(t){var e,n,i=Lr(this).text,r=this.attribute.wrap;if(void 0===r?i.wrap:r)return this.updateWrapAABBBounds([t]);var a,o,s=Si.graphicUtil.textMeasure,u=this.attribute,l=u.maxLineWidth,c=void 0===l?i.maxLineWidth:l,h=u.ellipsis,d=void 0===h?i.ellipsis:h,f=u.textAlign,v=void 0===f?i.textAlign:f,p=u.textBaseline,y=void 0===p?i.textBaseline:p,g=u.fontFamily,m=void 0===g?i.fontFamily:g,b=u.fontSize,k=void 0===b?i.fontSize:b,x=u.fontWeight,w=void 0===x?i.fontWeight:x,A=u.stroke,S=void 0===A?i.stroke:A,T=u.lineWidth,B=void 0===T?i.lineWidth:T,C=u.ignoreBuf,_=void 0===C?i.ignoreBuf:C,R=u.whiteSpace,P=void 0===R?i.whiteSpace:R,M=u.suffixPosition,E=void 0===M?i.suffixPosition:M;if("normal"===P)return this.updateWrapAABBBounds(t);var O=_?0:Math.max(2,.075*k),L=u.fontSize||i.fontSize,I=null!==(e=_a(u.lineHeight,L))&&void 0!==e?e:L+O;if(!this.shouldUpdateShape()&&this.cache){var D=Du(v,a=null!==(n=this.cache.clipedWidth)&&void 0!==n?n:0),j=ju(y,I,k);return this._AABBBounds.set(D,j,D+a,j+I),S&&this._AABBBounds.expand(B/2),this._AABBBounds}if(Number.isFinite(c)){if(d){var U=!0===d?i.ellipsis:d,W=s.clipTextWithSuffix(t.toString(),{fontSize:k,fontWeight:w,fontFamily:m},c,U,!1,E);o=W.str,a=W.width}else{var N=s.clipText(t.toString(),{fontSize:k,fontWeight:w,fontFamily:m},c,!1);o=N.str,a=N.width}this.cache.clipedText=o,this.cache.clipedWidth=a}else a=s.measureTextWidth(t.toString(),{fontSize:k,fontWeight:w,fontFamily:m}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();var F=Du(v,a),z=I;Si.global&&Si.global.isSafari()&&(z+=.2*k);var G=ju(y,z,k,O);return this._AABBBounds.set(F,G,F+a,G+z),S&&this._AABBBounds.expand(B/2),this._AABBBounds}},{key:"getBaselineMapAlign",value:function(){return i.baselineMapAlign}},{key:"getAlignMapBaseline",value:function(){return i.alignMapBaseline}},{key:"updateVerticalSinglelineAABBBounds",value:function(e){var n,r,a,o,s=Lr(this).text,u=Si.graphicUtil.textMeasure,l=this.attribute,c=l.ignoreBuf,h=(void 0===c?s.ignoreBuf:c)?0:2,d=l.maxLineWidth,f=void 0===d?s.maxLineWidth:d,v=l.ellipsis,p=void 0===v?s.ellipsis:v,y=l.fontSize,g=void 0===y?s.fontSize:y,m=l.fontWeight,b=void 0===m?s.fontWeight:m,k=l.fontFamily,x=void 0===k?s.fontFamily:k,w=l.stroke,A=void 0===w?s.stroke:w,S=l.lineWidth,T=void 0===S?s.lineWidth:S,B=l.verticalMode,C=void 0===B?s.verticalMode:B,_=l.suffixPosition,R=void 0===_?s.suffixPosition:_,P=null!==(n=_a(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==n?n:(l.fontSize||s.fontSize)+h,M=l.textAlign,E=void 0===M?s.textAlign:M,O=l.textBaseline,L=void 0===O?s.textBaseline:O;if(!C){var I=E;E=null!==(r=i.baselineMapAlign[L])&&void 0!==r?r:"left",L=null!==(a=i.alignMapBaseline[I])&&void 0!==a?a:"top"}if(!this.shouldUpdateShape()&&this.cache){var D=Du(E,o=this.cache.clipedWidth),j=ju(L,P,g);return this._AABBBounds.set(j,D,j+P,D+o),A&&this._AABBBounds.expand(T/2),this._AABBBounds}var U=[gs(e.toString())];if(Number.isFinite(f)){if(p){var W=!0===p?s.ellipsis:p,N=u.clipTextWithSuffixVertical(U[0],{fontSize:g,fontWeight:b,fontFamily:x},f,W,!1,R);U=[N.verticalList],o=N.width}else{var F=u.clipTextVertical(U[0],{fontSize:g,fontWeight:b,fontFamily:x},f,!1);U=[F.verticalList],o=F.width}this.cache.verticalList=U,this.cache.clipedWidth=o}else o=0,U[0].forEach((function(e){var n=e.direction===t.TextDirection.HORIZONTAL?g:u.measureTextWidth(e.text,{fontSize:g,fontWeight:b,fontFamily:x});o+=n,e.width=n})),this.cache.verticalList=U,this.cache.clipedWidth=o;this.clearUpdateShapeTag();var z=Du(E,o),G=ju(L,P,g);return this._AABBBounds.set(G,z,G+P,z+o),A&&this._AABBBounds.expand(T/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,n,i=Lr(this).text,r=this.attribute.wrap;if(void 0===r?i.wrap:r)return this.updateWrapAABBBounds(t);var a=this.attribute,o=a.fontFamily,s=void 0===o?i.fontFamily:o,u=a.textAlign,l=void 0===u?i.textAlign:u,c=a.textBaseline,h=void 0===c?i.textBaseline:c,d=a.fontSize,f=void 0===d?i.fontSize:d,v=a.fontWeight,p=void 0===v?i.fontWeight:v,y=a.ellipsis,g=void 0===y?i.ellipsis:y,m=a.maxLineWidth,b=a.stroke,k=void 0===b?i.stroke:b,x=a.lineWidth,w=void 0===x?i.lineWidth:x,A=a.whiteSpace,S=void 0===A?i.whiteSpace:A,T=a.suffixPosition,B=void 0===T?i.suffixPosition:T,C=null!==(e=_a(a.lineHeight,a.fontSize||i.fontSize))&&void 0!==e?e:a.fontSize||i.fontSize;if("normal"===S)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var _=this.cache.layoutData.bbox;return this._AABBBounds.set(_.xOffset,_.yOffset,_.xOffset+_.width,_.yOffset+_.height),k&&this._AABBBounds.expand(w/2),this._AABBBounds}var R=Si.graphicUtil.textMeasure,P=new Wu(s,{fontSize:f,fontWeight:p,fontFamily:s},R).GetLayoutByLines(t,l,h,C,!0===g?i.ellipsis:g||void 0,!1,m,B),M=P.bbox;return this.cache.layoutData=P,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),k&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(e){var n,r,a,o,s=Lr(this).text,u=Si.graphicUtil.textMeasure,l=this.attribute,c=l.ignoreBuf,h=(void 0===c?s.ignoreBuf:c)?0:2,d=l.maxLineWidth,f=void 0===d?s.maxLineWidth:d,v=l.ellipsis,p=void 0===v?s.ellipsis:v,y=l.fontFamily,g=void 0===y?s.fontFamily:y,m=l.fontSize,b=void 0===m?s.fontSize:m,k=l.fontWeight,x=void 0===k?s.fontWeight:k,w=l.stroke,A=void 0===w?s.stroke:w,S=l.lineWidth,T=void 0===S?s.lineWidth:S,B=l.verticalMode,C=void 0===B?s.verticalMode:B,_=l.suffixPosition,R=void 0===_?s.suffixPosition:_,P=null!==(n=_a(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==n?n:(l.fontSize||s.fontSize)+h,M=l.textAlign,E=void 0===M?s.textAlign:M,O=l.textBaseline,L=void 0===O?s.textBaseline:O;if(!C){var I=E;E=null!==(r=i.baselineMapAlign[L])&&void 0!==r?r:"left",L=null!==(a=i.alignMapBaseline[I])&&void 0!==a?a:"top"}if(o=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((function(t){var e=t.reduce((function(t,e){return t+e.width}),0);o=Ft(e,o)}));var D=Du(E,o),j=this.cache.verticalList.length*P,U=ju(L,j,b);return this._AABBBounds.set(U,D,U+j,D+o),A&&this._AABBBounds.expand(T/2),this._AABBBounds}var W=e.map((function(t){return gs(t.toString())}));W.forEach((function(e,n){if(Number.isFinite(f))if(p){var i=!0===p?s.ellipsis:p,r=u.clipTextWithSuffixVertical(e,{fontSize:b,fontWeight:x,fontFamily:g},f,i,!1,R);W[n]=r.verticalList,o=r.width}else{var a=u.clipTextVertical(e,{fontSize:b,fontWeight:x,fontFamily:g},f,!1);W[n]=a.verticalList,o=a.width}else o=0,e.forEach((function(e){var n=e.direction===t.TextDirection.HORIZONTAL?b:u.measureTextWidth(e.text,{fontSize:b,fontWeight:x,fontFamily:g});o+=n,e.width=n}))})),this.cache.verticalList=W,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((function(t){var e=t.reduce((function(t,e){return t+e.width}),0);o=Ft(e,o)}));var N=Du(E,o),F=this.cache.verticalList.length*P,z=ju(L,F,b);return this._AABBBounds.set(z,N,z+F,N+o),A&&this._AABBBounds.expand(T/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Lr(this).text[t]}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nu;return p(h(i.prototype),"needUpdateTags",this).call(this,t,e)}},{key:"needUpdateTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nu;return p(h(i.prototype),"needUpdateTag",this).call(this,t,e)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}($o);function zu(t){return new Fu(t)}Fu.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Qo),Fu.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Fu.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var Gu=["heightLimit","lineClamp"],Hu=function(t){function n(t){return o(this,n),e(this,n,[Object.assign(Object.assign({},t),{wrap:!0})])}return c(n,t),u(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return xt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,n,i,r,a=Lr(this).text,o=this.attribute,s=o.fontFamily,u=void 0===s?a.fontFamily:s,l=o.textAlign,c=void 0===l?a.textAlign:l,h=o.textBaseline,d=void 0===h?a.textBaseline:h,f=o.fontSize,v=void 0===f?a.fontSize:f,p=o.ellipsis,y=void 0===p?a.ellipsis:p,g=o.maxLineWidth,m=o.stroke,b=void 0===m?a.stroke:m,k=o.lineWidth,x=void 0===k?a.lineWidth:k,w=o.wordBreak,A=void 0===w?a.wordBreak:w,S=o.fontWeight,T=void 0===S?a.fontWeight:S,B=o.ignoreBuf,C=void 0===B?a.ignoreBuf:B,_=o.heightLimit,R=void 0===_?0:_,P=o.suffixPosition,M=void 0===P?a.suffixPosition:P,E=o.lineClamp,O=null!==(e=_a(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,L=C?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var I=this.cache.layoutData.bbox;return this._AABBBounds.set(I.xOffset,I.yOffset,I.xOffset+I.width,I.yOffset+I.height),b&&this._AABBBounds.expand(x/2),this._AABBBounds}var D=Si.graphicUtil.textMeasure,j=new Wu(u,{fontSize:v,fontWeight:T,fontFamily:u},D),U=t.map((function(t){return t.toString()})),W=[],N=[0,0],F=1/0;if(R>0&&(F=Math.max(Math.floor(R/O),1)),E&&(F=Math.min(F,E)),"number"==typeof g&&g!==1/0){if(g>0)for(var z=0;z<U.length;z++){var G=U[z],H=!0;if(z===F-1){var V=j.textMeasure.clipTextWithSuffix(G,j.textOptions,g,y,!1,M);W.push({str:V.str,width:V.width});break}var Y=j.textMeasure.clipText(G,j.textOptions,g,"break-word"===A);if(""!==G&&""===Y.str){if(y){var X=j.textMeasure.clipTextWithSuffix(G,j.textOptions,g,y,!1,M);Y.str=null!==(i=X.str)&&void 0!==i?i:"",Y.width=null!==(r=X.width)&&void 0!==r?r:0}else Y.str="",Y.width=0;H=!1}if(W.push({str:Y.str,width:Y.width}),Y.str.length===G.length);else if(H){var K=G.substring(Y.str.length);U.splice(z+1,0,K)}}var q=0;W.forEach((function(t){q=Math.max(q,t.width)})),N[0]=q}else{for(var Z,J,Q=0,$=0,tt=U.length;$<tt;$++){if($===F-1){var et=j.textMeasure.clipTextWithSuffix(U[$],j.textOptions,g,y,!1,M);W.push({str:et.str,width:et.width}),Q=Math.max(Q,et.width);break}J=U[$],Z=j.textMeasure.measureTextWidth(J,j.textOptions,"break-word"===A),Q=Math.max(Q,Z),W.push({str:J,width:Z})}N[0]=Q}N[1]=W.length*(O+L);var nt={xOffset:0,yOffset:0,width:N[0],height:N[1]};j.LayoutBBox(nt,c,d);var it=j.layoutWithBBox(nt,W,c,d,O);return this.cache.layoutData=it,this.clearUpdateShapeTag(),this._AABBBounds.set(nt.xOffset,nt.yOffset,nt.xOffset+nt.width,nt.yOffset+nt.height),b&&this._AABBBounds.expand(x/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Gu.length;e++){var i=Gu[e];if(-1!==t.indexOf(i))return!0}return p(h(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Gu.length;e++)if(t===Gu[e])return!0;return p(h(n.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(Fu);function Vu(t){return new Hu(t)}var Yu=function(){return u((function t(){o(this,t)}),[{key:"bounds",value:function(t,e){if(wt(t)){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}])}();function Xu(t,e,n,i,r){return r?t.arc(n,i,e,0,Dt,!1,r):t.arc(n,i,e,0,Dt),!1}var Ku=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return Xu(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return Xu(t,e/2+r,n,i,a)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e-r,", ").concat(n," a ").concat(r,",").concat(r," 0 1,0 ").concat(2*r,",0 a ").concat(r,",").concat(r," 0 1,0 -").concat(2*r,",0")}}])}(Yu),qu=new Ku;var Zu=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return function(t,e,n,i,r,a){return t.moveTo(-3*e+n-r,-e+i-r,a),t.lineTo(-e+n-r,-e+i-r,a),t.lineTo(-e+n-r,-3*e+i-r,a),t.lineTo(e+n+r,-3*e+i-r,a),t.lineTo(e+n+r,-e+i-r,a),t.lineTo(3*e+n+r,-e+i-r,a),t.lineTo(3*e+n+r,e+i+r,a),t.lineTo(e+n+r,e+i+r,a),t.lineTo(e+n+r,3*e+i+r,a),t.lineTo(-e+n-r,3*e+i+r,a),t.lineTo(-e+n-r,e+i+r,a),t.lineTo(-3*e+n-r,e+i+r,a),t.closePath(),!0}(t,e/6,n,i,r,a)}}])}(Yu),Ju=new Zu;function Qu(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var $u=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="diamond",t.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return Qu(t,e/2,n,i,r)}},{key:"drawFitDir",value:function(t,e,n,i,r){return Qu(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return Qu(t,e/2+r,n,i,a)}}])}(Yu),tl=new $u;function el(t,e,n,i){var r=2*e;return t.rect(n-e,i-e,r,r),!1}var nl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="square",t.pathStr="M-0.5,-0.5h1v1h-1Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return el(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return el(t,e/2+r,n,i)}}])}(Yu),il=new nl;var rl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleUp",t.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(Yu),al=new rl,ol=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangle",t}return c(n,t),u(n)}(rl),sl=new ol,ul=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ll=Math.sin(Dt/10)*ul,cl=-Math.cos(Dt/10)*ul;function hl(t,e,n,i){var r=ll*e,a=cl*e;t.moveTo(n,-e+i),t.lineTo(r+n,a+i);for(var o=1;o<5;++o){var s=Dt*o/5,u=Math.cos(s),l=Math.sin(s);t.lineTo(l*e+n,-u*e+i),t.lineTo(u*r-l*a+n,l*r+u*a+i)}return t.closePath(),!0}var dl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="star",t.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return hl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return hl(t,e/2+r,n,i)}}])}(Yu),fl=new dl,vl=Ht(3);function pl(t,e,n,i){var r=e,a=r/vl,o=a/5,s=e;return t.moveTo(0+n,-r+i),t.lineTo(a/2+n,i),t.lineTo(o/2+n,i),t.lineTo(o/2+n,s+i),t.lineTo(-o/2+n,s+i),t.lineTo(-o/2+n,i),t.lineTo(-a/2+n,i),t.closePath(),!0}var yl=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return pl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return pl(t,e/2+r,n,i)}}])}(Yu),gl=new yl;function ml(t,e,n,i){var r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var bl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="wedge",t.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return ml(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ml(t,e/2+r,n,i)}}])}(Yu),kl=new bl;function xl(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var wl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="stroke",t.pathStr="",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return xl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return xl(t,e/2+r,n,i)}}])}(Yu),Al=new wl,Sl=-.5,Tl=Ht(3)/2,Bl=1/Ht(12);function Cl(t,e,n,i){var r=e/2,a=e*Bl,o=r,s=e*Bl+e,u=-o,l=s;return t.moveTo(r+n,a+i),t.lineTo(o+n,s+i),t.lineTo(u+n,l+i),t.lineTo(Sl*r-Tl*a+n,Tl*r+Sl*a+i),t.lineTo(Sl*o-Tl*s+n,Tl*o+Sl*s+i),t.lineTo(Sl*u-Tl*l+n,Tl*u+Sl*l+i),t.lineTo(Sl*r+Tl*a+n,Sl*a-Tl*r+i),t.lineTo(Sl*o+Tl*s+n,Sl*s-Tl*o+i),t.lineTo(Sl*u+Tl*l+n,Sl*l-Tl*u+i),t.closePath(),!1}var _l=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="wye",t.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Cl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Cl(t,e/2+r,n,i)}}])}(Yu),Rl=new _l;var Pl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleLeft",t.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(Yu),Ml=new Pl;var El=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleRight",t.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(Yu),Ol=new El;var Ll=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleDown",t.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(Yu),Il=new Ll,Dl=Ht(3);function jl(t,e,n,i){var r=e*Dl;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var Ul=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return jl(t,e/2/Dl,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return jl(t,e/2/Dl+r,n,i)}}])}(rl),Wl=new Ul;function Nl(t,e,n,i){var r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var Fl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Left",t.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Nl(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Nl(t,e/4+r,n,i)}}])}(Yu),zl=new Fl;function Gl(t,e,n,i){var r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var Hl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Right",t.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Gl(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Gl(t,e/4+r,n,i)}}])}(Yu),Vl=new Hl;function Yl(t,e,n,i){var r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var Xl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Up",t.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Yl(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Yl(t,e/4+r,n,i)}}])}(Yu),Kl=new Xl;function ql(t,e,n,i){var r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var Zl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Down",t.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return ql(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ql(t,e/4+r,n,i)}}])}(Yu),Jl=new Zl;function Ql(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var $l=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="lineV",t.pathStr="M0,-0.5L0,0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return Ql(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return Ql(t,e/2+r,n,i)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e,", ").concat(n-r," L ").concat(e,",").concat(n+r)}}])}(Yu),tc=new $l;function ec(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var nc=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="lineH",t.pathStr="M-0.5,0L0.5,0",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return ec(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return ec(t,e/2+r,n,i)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e-r,", ").concat(n," L ").concat(e+r,",").concat(n)}}])}(Yu),ic=new nc;function rc(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var ac=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="close",t.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return rc(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return rc(t,e/2+r,n,i)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e-r,", ").concat(n-r," L ").concat(e+r,",").concat(n+r," M ").concat(e+r,", ").concat(n-r," L ").concat(e-r,",").concat(n+r)}}])}(Yu),oc=new ac;function sc(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function uc(t,e,n,i){var r=e,a=e/2;return t.rect(n-r/2,i-a/2,r,a),!1}var lc=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return wt(e)?uc(t,e,n,i):sc(t,e,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return wt(e)?uc(t,e+2*r,n,i):sc(t,[e[0]+2*r,e[1]+2*r],n,i)}}])}(Yu),cc=new lc,hc=new ee,dc=function(){return u((function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,t),this.pathStr="",this.type=e,xt(n)?this.svgCache=n:this.path=n,this.isSvg=i}),[{key:"drawOffset",value:function(t,e,n,i,r,a,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),ln(r.path.commandList,t,n,i,e,e),o&&o(r.path,r.attribute)})),!1):(ln(this.path.commandList,t,n,i,e+r,e+r),!1)}},{key:"draw",value:function(t,e,n,i,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),ln(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(ln(this.path.commandList,t,n,i,e,e),!1)}},{key:"bounds",value:function(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((function(n){var i=n.path;hc.x1=i.bounds.x1*t,hc.y1=i.bounds.y1*t,hc.x2=i.bounds.x2*t,hc.y2=i.bounds.y2*t,e.union(hc)}))}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)}}])}(),fc=[qu,Ju,tl,il,Wl,sl,fl,gl,kl,Al,Rl,Ml,Ol,al,Il,zl,Vl,Kl,Jl,cc,tc,ic,oc],vc={};fc.forEach((function(t){vc[t.type]=t}));var pc={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"},yc=new ee,gc=["symbolType","size"].concat(g(Xo)),mc=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return o(this,n),(t=e(this,n,[i])).type="symbol",t.numberType=js,t}return c(n,t),u(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return xt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t=Lr(this).symbol,e=this.attribute.symbolType,i=void 0===e?t.symbolType:e,r=vc[i];if(r)return this._parsedPath=r,r;if(r=n.userSymbolMap[i])return this._parsedPath=r,r;if(!0===cs(i=pc[i]||i)){var a=(new ls).parse(i).svg;if(!a)return null;var o=xt(a.path)?a.path:[a.path];yc.clear();var s=[];o.forEach((function(t){var e=(new Kn).fromString(t.d),n={};Hs.forEach((function(e){t[e]&&(n[Gs[e]]=t[e])})),s.push({path:e,attribute:n}),yc.union(e.bounds)}));var u=yc.width(),l=yc.height(),c=1/Ft(u,l);return s.forEach((function(t){return t.path.transform(0,0,c,c)})),this._parsedPath=new dc(i,s,!0),n.userSymbolMap[i]=this._parsedPath,this._parsedPath}var h=(new Kn).fromString(i),d=h.bounds.width(),f=h.bounds.height(),v=1/Ft(d,f);return h.transform(0,0,v,v),this._parsedPath=new dc(i,h),n.userSymbolMap[i]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=Lr(this).symbol;this._AABBBounds.clear();var n=this.attribute,i=Si.graphicService.updateSymbolAABBBounds(n,Lr(this).symbol,this._AABBBounds,t,this),r=n.boundsPadding,a=void 0===r?e.boundsPadding:r,o=pa(a);return o&&i.expand(o),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Lr(this).symbol[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,gc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,gc)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),e=this.attribute.size,n=xt(e)?e:[e,e];return t.path?(new Kn).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Kn).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}}])}($o);function bc(t){return new mc(t)}mc.userSymbolMap={},mc.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Qo);var kc=["segments","points","curveType"].concat(g(Xo)),xc=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(t=e(this,n,[i])).type="line",t.numberType=Ps,t}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=xa(n,i,e))}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).line;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateLineAABBBounds(e,Lr(this).line,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Lr(this).line[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,kc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,kc)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new Kn,n=t.segments,i=function(t){if(t&&t.length){var n=!0;t.forEach((function(t){!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((function(t){i(t.points)})):t.points&&i(t.points),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function wc(t){return new xc(t)}xc.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Qo);var Ac=["width","x1","y1","height","cornerRadius"].concat(g(Xo)),Sc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="rect",i.numberType=Ls,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).rect;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateRectAABBBounds(e,Lr(this).rect,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Lr(this).rect[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Ac)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Ac)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=ao(t),n=e.x,i=e.y,r=e.width,a=e.height,o=new Kn;return o.moveTo(n,i),o.rect(n,i,r,a),o}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Tc(t){return new Sc(t)}Sc.NOWORK_ANIMATE_ATTR=Qo;var Bc=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]],Cc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="rect3d",i.numberType=Is,i}return c(n,t),u(n,[{key:"findFace",value:function(){var t={polygons:[],vertices:[],edges:[]},e=Lr(this).rect,n=this.attribute,i=n.x1,r=n.y1,a=n.x,o=n.y,s=n.length,u=void 0===s?zt(e.width,e.height):s,l=this.attribute,c=l.width,h=l.height;c=null!=c?c:i-a,h=null!=h?h:r-o;for(var d=0;d<Bc.length;d++){var f=Bc[d];t.vertices.push([f[0]*c,f[1]*h,f[2]*u])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(Sc);function _c(t){return new Cc(t)}Cc.NOWORK_ANIMATE_ATTR=Qo;var Rc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="glyph",i.numberType=Cs,i.subGraphic=[],i._onInit&&i._onInit(f(i)),i.valid=i.isValid(),i}return c(n,t),u(n,[{key:"setSubGraphic",value:function(t){var e=this;this.detachSubGraphic(),this.subGraphic=t,t.forEach((function(t){t.glyphHost=e,Object.setPrototypeOf(t.attribute,e.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}},{key:"detachSubGraphic",value:function(){this.subGraphic.forEach((function(t){t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}},{key:"getSubGraphic",value:function(){return this.subGraphic}},{key:"onInit",value:function(t){this._onInit=t}},{key:"onUpdate",value:function(t){this._onUpdate=t}},{key:"isValid",value:function(){return!0}},{key:"setAttribute",value:function(t,e,i,r){p(h(n.prototype),"setAttribute",this).call(this,t,e,i,r),this.subGraphic.forEach((function(t){t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;p(h(n.prototype),"setAttributes",this).call(this,t,e,i),this.subGraphic.forEach((function(t){t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}},{key:"translate",value:function(t,e){return p(h(n.prototype),"translate",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"translateTo",value:function(t,e){return p(h(n.prototype),"translateTo",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"scale",value:function(t,e,i){return p(h(n.prototype),"scale",this).call(this,t,e,i),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"scaleTo",value:function(t,e){return p(h(n.prototype),"scaleTo",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"rotate",value:function(t){return p(h(n.prototype),"rotate",this).call(this,t),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"rotateTo",value:function(t){return p(h(n.prototype),"rotate",this).call(this,t),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"doUpdateAABBBounds",value:function(){this._AABBBounds.clear();var t=Si.graphicService.updateGlyphAABBBounds(this.attribute,Lr(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){return!1}},{key:"needUpdateTag",value:function(t){return!1}},{key:"useStates",value:function(t,e){var n,i=this;if(t.length){if((null===(n=this.currentStates)||void 0===n?void 0:n.length)!==t.length||t.some((function(t,e){return i.currentStates[e]!==t}))){var r={},a=this.subGraphic.map((function(){return{}}));t.forEach((function(e){var n,o=i.glyphStateProxy?i.glyphStateProxy(e,t):i.glyphStates[e];o&&(Object.assign(r,o.attributes),(null===(n=o.subAttributes)||void 0===n?void 0:n.length)&&a.forEach((function(t,e){Object.assign(t,o.subAttributes[e])})))})),this.subGraphic.forEach((function(n,i){n.updateNormalAttrs(a[i]),n.applyStateAttrs(a[i],t,e)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"clearStates",value:function(t){var e=this;this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((function(n){n.applyStateAttrs(n.normalAttrs,e.currentStates,t,!0),n.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}},{key:"clone",value:function(){var t=new n(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((function(t){return t.clone()}))),t}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Pc(t){return new Rc(t)}Rc.NOWORK_ANIMATE_ATTR=Qo;var Mc=function(){return u((function t(e,n,i,r,a,s,u,l,c,h,d,f,v,p){o(this,t),this.left=e,this.top=n,this.width=i,this.height=r,this.actualHeight=0,this.bottom=n+r,this.right=e+i,this.ellipsis=a,this.wordBreak=s,this.verticalDirection=u,this.lines=[],this.globalAlign=l,this.globalBaseline=c,this.layoutDirection=h,this.directionKey=Ti[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=f,this.singleLine=v,p?(p.clear(),this.icons=p):this.icons=new Map}),[{key:"draw",value:function(t,e){var n=this.getActualSize(),i=n.width,r=n.height,a=this.isWidthMax?Math.min(this.width,i):this.width||i||0,o=this.isHeightMax?Math.min(this.height,r):this.height||r||0;o=Math.min(o,r);var s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-o/2;break;case"bottom":s=-o}var u=0;"right"===this.globalAlign||"end"===this.globalAlign?u=-a:"center"===this.globalAlign&&(u=-a/2);var l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);var c=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(var h=0;h<this.lines.length;h++){var d=this.lines[h],f=d.top,v=d.height;if(f+v<this[this.directionKey.top]||f+v>this[this.directionKey.top]+l)return c;var p=!1;this.ellipsis&&this.lines[h+1]&&this.lines[h+1].top+this.lines[h+1].height>this[this.directionKey.top]+l&&(p=!0,c=!0),this.lines[h].draw(t,p,this.lines[h][this.directionKey.left]+u,this.lines[h][this.directionKey.top]+s,this.ellipsis,e)}else{var y=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?u+=y:s+=y;for(var g=0;g<this.lines.length;g++)this.lines[g].draw(t,!1,this.lines[g][this.directionKey.left]+u,this.lines[g][this.directionKey.top]+s,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var m=0;m<this.lines.length;m++){var b=this.lines[m];b.top;var k=b.height,x=l-this.lines[m].top-this.lines[m].height;if(0===l)this.lines[m].draw(t,!1,u,x+s,this.ellipsis,e);else{if(x+k>this[this.directionKey.top]+l||x<this[this.directionKey.top])return c;var w=!1;this.ellipsis&&this.lines[m+1]&&x-this.lines[m+1].height<this[this.directionKey.top]&&(w=!0,c=!0),this.lines[m].draw(t,w,u,x+s,this.ellipsis,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(u+=this.lines[0].height+1);for(var A=0;A<this.lines.length;A++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(u-=this.lines[A].height+this.lines[A].top);var S=this.lines[A],T=S.top,B=S.height;if(0===l)this.lines[A].draw(t,!1,this.lines[A][this.directionKey.left]+u,this.lines[A][this.directionKey.top]+s,this.ellipsis,e);else{if(T+B<this[this.directionKey.top]||T+B>this[this.directionKey.top]+l)return c;var C=!1;this.ellipsis&&this.lines[A+1]&&this.lines[A+1].top+this.lines[A+1].height>this[this.directionKey.top]+l&&(C=!0,c=!0),this.lines[A].draw(t,C,this.lines[A][this.directionKey.left]+u,this.lines[A][this.directionKey.top]+s,this.ellipsis,e)}}}return c}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,n=0;n<this.lines.length;n++){var i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,n=this.getRawActualSize();n.width;n.height;this.width,this.height;var i=this[this.directionKey.height];if(this.singleLine&&(i=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=i&&0!==i)for(var r=0;r<this.lines.length;r++){var a=this.lines[r],o=a.top,s=a.height;if(o+s<this[this.directionKey.top]||o+s>this[this.directionKey.top]+i);else if(this.ellipsis&&this.lines[r+1]&&this.lines[r+1].top+this.lines[r+1].height>this[this.directionKey.top]+i){var u=!0===this.ellipsis?"...":this.ellipsis||"",l=this.lines[r].getWidthWithEllips(u);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((i-this.actualHeight)/2);for(var c=0;c<this.lines.length;c++)this.lines[c].actualWidth>t&&(t=this.lines[c].actualWidth),e+=this.lines[c].height}else if("bottom"===this.verticalDirection)for(var h=0;h<this.lines.length;h++){var d=this.lines[h];d.top;var f=d.height,v=i-this.lines[h].top-this.lines[h].height;if(0===i)this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height;else if(v+f>this[this.directionKey.top]+i||v<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[h+1]&&v-this.lines[h+1].height<this[this.directionKey.top]){var p=!0===this.ellipsis?"...":this.ellipsis||"",y=this.lines[h].getWidthWithEllips(p);y>t&&(t=y),e+=this.lines[h].height}else this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height}else for(var g=0;g<this.lines.length;g++){var m=this.lines[g],b=m.top,k=m.height;if(0===i)this.lines[g].actualWidth>t&&(t=this.lines[g].actualWidth),e+=this.lines[g].height;else if(b+k<this[this.directionKey.top]||b+k>this[this.directionKey.top]+i);else if(this.ellipsis&&this.lines[g+1]&&this.lines[g+1].top+this.lines[g+1].height>this[this.directionKey.top]+i){var x=!0===this.ellipsis?"...":this.ellipsis||"",w=this.lines[g].getWidthWithEllips(x);w>t&&(t=w),e+=this.lines[g].height}else this.lines[g].actualWidth>t&&(t=this.lines[g].actualWidth),e+=this.lines[g].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}])}(),Ec=function(){return u((function t(e,n,i){o(this,t),this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";var r=_a(i.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 a=Oi(e,i),s=a.ascent,u=a.height,l=a.descent,c=a.width,h=0,d=0,f=0;this.height>u&&(h=(this.height-u)/2,d=Math.ceil(h),f=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=u-h):"bottom"===this.textBaseline?(this.ascent=u-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=s+d,this.descent=l+f),this.length=e.length,this.width=c||0,this.text=e||"",this.newLine=n||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}),[{key:"updateWidth",value:function(){var t=Oi(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,n,i,r){var a=this.text,o=this.left+n;e+=this.top;var s=this.direction;if(this.verticalEllipsis)a=this.ellipsisStr,s="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)a+=this.ellipsisStr,"right"!==r&&"end"!==r||(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){var u=Mi(a,("vertical"===s?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,a.length-1);if(a=a.slice(0,u),a+=this.ellipsisStr,"right"===r||"end"===r){var l=Oi(this.text.slice(u),this.character).width;"vertical"===s||(o-=this.ellipsisWidth-l)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===s&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){var n=e&&e.stroke||Ci;if(n){var i=e.strokeOpacity,r=void 0===i?1:i,a=e.opacity,o=void 0===a?1:a;t.globalAlpha=r*o,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=n;var s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),t.strokeText(a,o,e)),function(t,e){var n=e&&e.fill||Bi;if(n){var i=e.fillOpacity,r=void 0===i?1:i,a=e.opacity,o=void 0===a?1:a;t.globalAlpha=r*o,t.fillStyle=n;var s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),this.character.fill&&t.fillText(a,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===s&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){var i=Mi(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,i),e+=this.ellipsisStr;var r=Oi(this.text.slice(i),this.character).width;return n+this.ellipsisWidth-r}return n}}])}();var Oc=["width","height","image"].concat(g(Xo)),Lc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="image",i.numberType=Rs,i.loadImage(i.attribute.image),i}return c(n,t),u(n,[{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,i){var r=this;p(h(n.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var i=this;p(h(n.prototype),"imageLoadFail",this).call(this,t,(function(){i.failCallback&&i.failCallback()}))}},{key:"setAttributes",value:function(t,e,i){return t.image&&this.loadImage(t.image),p(h(n.prototype),"setAttributes",this).call(this,t,e,i)}},{key:"setAttribute",value:function(t,e,i,r){return"image"===t&&this.loadImage(e),p(h(n.prototype),"setAttribute",this).call(this,t,e,i,r)}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).image;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateImageAABBBounds(e,Lr(this).image,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return xi[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Oc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Oc)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Ic(t){return new Lc(t)}Lc.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Qo);var Dc=function(t){function n(t){var i;if(o(this,n),(i=e(this,n,[t]))._x=0,i._y=0,i._hovered=!1,i._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(i._hovered=!0),t.margin){var r=pa(t.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}return i.onBeforeAttributeUpdate=function(t,e,n){if(xt(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){var r=pa(e.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}else i._marginArray=[0,0,0,0]},f(i)}return c(n,t),u(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,n=void 0===e?xi.width:e,i=t.height,r=void 0===i?xi.height:i,a=this.attribute,o=a.backgroundWidth,s=void 0===o?n:o,u=a.backgroundHeight,l=(s-n)/2,c=((void 0===u?r:u)-r)/2;return this._AABBBounds.expand([0,2*l,2*c,0]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}])}(Lc),jc=function(){return u((function t(e,n,i,r,a,s,u,l){var c=this;o(this,t),this.left=e,this.width=n,this.baseline=i,this.ascent=r,this.descent=a,this.top=i-r,this.paragraphs=s.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof Dc?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=u,this.directionKey=Ti[this.direction],this.actualWidth=0;var h=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof Ec){var n=Pi.exec(t.text);0!==(null==n?void 0:n.index)&&(t.text=t.text.slice(null==n?void 0:n.index),t.updateWidth())}c.actualWidth+=t[c.directionKey.width],h=Math.max(t[c.directionKey.height],h)})),this.height=h,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(n,l)}),[{key:"calcOffset",value:function(t,e){var n=this.directionKey,i=this.height,r=this.left,a=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Dc?(t["_"+n.x]=r,r+=t[n.width]+a,t["_"+n.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?i-t.height:(i-t.height)/2):(t[n.left]=r,r+=t[n.width]+a)}))}},{key:"draw",value:function(t,e,n,i,r,a){var o=this;if(r&&(e||this.paragraphs.some((function(t){return t.overflow}))))for(var s=0,u=this.paragraphs.length-1;u>=0;u--){var l=this.paragraphs[u];if(!l.overflow){if(l instanceof Dc)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var c=!0===r?"...":r||"";l.ellipsisStr=c;var h=Oi(c,l.character).width||0;if(h<=this.blankWidth+s){e&&(l.ellipsis="add");break}if(h<=this.blankWidth+s+l.width){l.ellipsis="replace",l.ellipsisWidth=h,l.ellipsisOtherParagraphWidth=this.blankWidth+s;break}l.ellipsis="hide",s+=l.width}}this.paragraphs.map((function(e,r){if(e instanceof Dc)return e.setAttributes({x:n+e._x,y:i+e._y}),void a(e,t,n+e._x,i+e._y,o.ascent);e.draw(t,i+o.ascent,n,0===r,o.textAlign)}))}},{key:"getWidthWithEllips",value:function(t){for(var e=this,n=0,i=this.paragraphs.length-1;i>=0;i--){var r=this.paragraphs[i];if(r instanceof Dc)break;var a=Oi(t,r.character).width||0;if(a<=this.blankWidth+n){r.ellipsis="add",r.ellipsisWidth=a;break}if(a<=this.blankWidth+n+r.width){r.ellipsis="replace",r.ellipsisWidth=a,r.ellipsisOtherParagraphWidth=this.blankWidth+n;break}r.ellipsis="hide",n+=r.width}var o=0;return this.paragraphs.map((function(t,n){o+=t instanceof Dc?t.width:t.getWidthWithEllips(e.direction)})),o}}])}(),Uc=function(){return u((function t(e){o(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=Ti[this.direction]}),[{key:"store",value:function(t){if(t instanceof Dc){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}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,n=new jc(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(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}}},{key:"deal",value:function(t){t instanceof Dc?"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,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=Mi(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){var r=function(t,e){var n=t.text.slice(0,e),i=t.text.slice(e);return[new Ec(n,t.newLine,t.character),new Ec(i,!0,t.character)]}(t,i),a=y(r,2),o=a[0],s=a[1];this.store(o),this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}])}(),Wc=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(g(Xo)),Nc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="richtext",i._currentHoverIcon=null,i.numberType=Ds,i}return c(n,t),u(n,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ki.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:ki.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:ki.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:ki.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:ki.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:ki.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:ki.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:ki.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).richtext;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateRichTextAABBBounds(e,Lr(this).richtext,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return ki[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Wc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Wc)}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"combinedStyleToCharacter",value:function(t){var e=this.attribute,n=e.fill,i=e.stroke,r=e.fontSize,a=e.fontFamily,o=e.fontStyle,s=e.fontWeight,u=e.lineWidth,l=e.opacity,c=e.fillOpacity,h=e.strokeOpacity;return Object.assign({fill:n,stroke:i,fontSize:r,fontFamily:a,fontStyle:o,fontWeight:s,lineWidth:u,opacity:l,fillOpacity:c,strokeOpacity:h},t)}},{key:"doUpdateFrameCache",value:function(){for(var t,e=this,n=this.attribute,i=n.textConfig,r=void 0===i?[]:i,a=n.maxWidth,o=n.maxHeight,s=n.width,u=n.height,l=n.ellipsis,c=n.wordBreak,h=n.verticalDirection,d=n.textAlign,f=n.textBaseline,v=n.layoutDirection,p=n.singleLine,y=n.disableAutoWrapLine,g=[],m=0;m<r.length;m++)if("image"in r[m]){var b=this.combinedStyleToCharacter(r[m]),k=b.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(b.id);if(k)g.push(k);else{var x=new Dc(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{var w=this.combinedStyleToCharacter(r[m]);if(wt(w.text)&&(w.text="".concat(w.text)),w.text&&w.text.includes("\n"))for(var A=w.text.split("\n"),S=0;S<A.length;S++)g.push(new Ec(A[S],0!==S,w));else w.text&&g.push(new Ec(w.text,!1,w))}var T="number"==typeof a&&Number.isFinite(a)&&a>0,B="number"==typeof o&&Number.isFinite(o)&&o>0,C="number"==typeof s&&Number.isFinite(s)&&s>0&&(!T||s<=a),_="number"==typeof u&&Number.isFinite(u)&&u>0&&(!B||u<=o),R=new Mc(0,0,(C?s:T?a:0)||0,(_?u:B?o:0)||0,l,c,h,d,f,v||"horizontal",!C&&T,!_&&B,p||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),P=new Uc(R);if(y)for(var M=0,E=!1,O=0;O<g.length;O++){var L=g[O];E?(L.overflow=!0,L.left=1/0,L.top=1/0,!L.newLine&&R.lines[R.lines.length-1].paragraphs.push(L)):P.deal(L),R.lines.length!==M&&(M=R.lines.length,P.lineBuffer.length=0,L.overflow=!0,L.left=1e3,L.top=1e3,R.lines[R.lines.length-1].paragraphs.push(L),E=!0),L.newLine&&(E=!1,P.lineWidth=0)}else for(var I=0;I<g.length;I++)P.deal(g[I]);if(P.send(),!("horizontal"===R.layoutDirection?C:_)){var D=R.getActualSizeWidthEllipsis(),j="horizontal"===R.layoutDirection?D.width:D.height;("horizontal"===R.layoutDirection?T:B)&&(j=Math.min(j,"horizontal"===R.layoutDirection?a:o)),R.lines.forEach((function(t){t.calcOffset(j,!1)}))}this._frameCache=R}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){p(h(n.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(n){n.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var n,i,r,a,o,s=t.pickIcon(e.global);s&&s===t._currentHoverIcon||(s?(null===(n=t._currentHoverIcon)||void 0===n||n.setHoverState(!1),t._currentHoverIcon=s,t._currentHoverIcon.setHoverState(!0),null===(i=t.stage)||void 0===i||i.setCursor(s.attribute.cursor),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!s&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(a=t.stage)||void 0===a||a.setCursor(),null===(o=t.stage)||void 0===o||o.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var n,i;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(n=t.stage)||void 0===n||n.setCursor(),null===(i=t.stage)||void 0===i||i.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,n=this.getFrameCache(),i=this.globalTransMatrix,r=i.e,a=i.f;return n.icons.forEach((function(n){var i,o;n.AABBBounds.containsPoint({x:t.x-r,y:t.y-a})&&(e=n,e.globalX=(null!==(i=e.attribute.x)&&void 0!==i?i:0)+r,e.globalY=(null!==(o=e.attribute.y)&&void 0!==o?o:0)+a)})),e}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Fc(t){return new Nc(t)}Nc.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Qo);var zc=["path","customPath"].concat(g(Xo)),Gc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="path",i.numberType=Ms,i}return c(n,t),u(n,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return p(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=Lr(this).path;if(!this.valid)return t.path;var e=this.attribute;return e.path instanceof Kn?e.path:(yt(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Kn?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updatePathAABBBounds(e,Lr(this).path,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;kt(t.path,!0)?this.cache=(new Kn).fromString(t.path):t.customPath&&(this.cache=new Kn,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Lr(this).path[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,zc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,zc)}},{key:"toCustomPath",value:function(){return(new Kn).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}}])}($o);function Hc(t){return new Gc(t)}Gc.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Qo);var Vc=["segments","points","curveType"].concat(g(Xo)),Yc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="area",i.numberType=Ts,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!!e&&0!==e.length}},{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).area;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateAreaAABBBounds(e,Lr(this).area,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=xa(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return Lr(this).area[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Vc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Vc)}},{key:"toCustomPath",value:function(){var t=new Kn,e=this.attribute,n=e.segments,i=function(e){if(e&&e.length){var n=!0,i=[];if(e.forEach((function(e){var r,a;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(a=e.y1)&&void 0!==a?a:e.y}),n=!1)})),i.length){for(var r=i.length-1;r>=0;r--)t.lineTo(i[r].x,i[r].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((function(t){i(t.points)})),t}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Xc(t){return new Yc(t)}Yc.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Qo);var Kc=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(g(Xo)),qc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="arc",i.numberType=As,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=Lr(this).arc,e=this.attribute,n=e.cornerRadius,i=void 0===n?t.cornerRadius:n,r=e.innerPadding,a=void 0===r?t.innerPadding:r,o=e.outerPadding,s=void 0===o?t.outerPadding:o,u=this.attribute,l=u.outerRadius,c=void 0===l?t.outerRadius:l,h=u.innerRadius,d=void 0===h?t.innerRadius:h;if(c+=s,d-=a,0===i||"0%"===i)return 0;var f=Math.abs(c-d);return Math.min(wt(i,!0)?i:f*parseFloat(i)/100,f/2)}},{key:"getParsedAngle",value:function(){var t=Lr(this).arc,e=this.attribute,n=e.startAngle,i=void 0===n?t.startAngle:n,r=e.endAngle,a=void 0===r?t.endAngle:r,o=this.attribute.cap,s=void 0===o?t.cap:o,u=a-i>=0?1:-1,l=a-i;if(a=(i=ne(i))+l,s&&Ut(l)<jt-Ot){var c=1,h=1;s.length&&(c=Number(s[0]),h=Number(s[1]));var d=this.attribute,f=d.outerRadius,v=void 0===f?t.outerRadius:f,p=d.innerRadius,y=void 0===p?t.innerRadius:p,g=this.attribute,m=g.outerPadding,b=void 0===m?t.outerPadding:m,k=g.innerPadding;v+=b,y-=void 0===k?t.innerPadding:k;var x=Math.abs(v-y)/2,w=x/v;if(x>Ot&&v>Ot)return{startAngle:i-u*w*c,endAngle:a+u*w*h,sc:u*w*c,ec:u*w*h}}return{startAngle:i,endAngle:a}}},{key:"getParsePadAngle",value:function(t,e){var n=Lr(this).arc,i=this.attribute,r=i.innerPadding,a=void 0===r?n.innerPadding:r,o=i.outerPadding,s=void 0===o?n.outerPadding:o,u=i.padAngle,l=void 0===u?n.padAngle:u,c=this.attribute,h=c.outerRadius,d=void 0===h?n.outerRadius:h,f=c.innerRadius,v=void 0===f?n.innerRadius:f;d+=s,v-=a;var p=this.attribute.padRadius,y=void 0===p?Ht(d*d+v*v):p,g=Ut(e-t),m=t,b=e,k=t,x=e,w=l/2,A=g,S=g;if(w>Ot&&y>Ot){var T=e>t?1:-1,B=Xt(Number(y)/v*Gt(w)),C=Xt(Number(y)/d*Gt(w));return(A-=2*B)>Ot?(k+=B*=T,x-=B):(A=0,k=x=(t+e)/2),(S-=2*C)>Ot?(m+=C*=T,b-=C):(S=0,m=b=(t+e)/2),{outerStartAngle:m,outerEndAngle:b,innerStartAngle:k,innerEndAngle:x,innerDeltaAngle:A,outerDeltaAngle:S}}return{outerStartAngle:m,outerEndAngle:b,innerStartAngle:k,innerEndAngle:x,innerDeltaAngle:A,outerDeltaAngle:S}}},{key:"doUpdateAABBBounds",value:function(t){var e=Lr(this).arc;this._AABBBounds.clear();var n=this.attribute,i=Si.graphicService.updateArcAABBBounds(n,Lr(this).arc,this._AABBBounds,t,this),r=n.boundsPadding,a=void 0===r?e.boundsPadding:r,o=pa(a);return o&&i.expand(o),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Kc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Kc)}},{key:"getDefaultAttribute",value:function(t){return Lr(this).arc[t]}},{key:"toCustomPath",value:function(){var t=this.attribute,e=this.getParsedAngle(),n=e.startAngle,i=e.endAngle,r=t.innerRadius-(t.innerPadding||0),a=t.outerRadius-(t.outerPadding||0),o=Ut(i-n),s=i>n;if(a<r){var u=a;a=r,r=u}var l=new Kn;if(a<=Ot)l.moveTo(0,0);else if(o>=jt-Ot)l.moveTo(0+a*Nt(n),0+a*Gt(n)),l.arc(0,0,a,n,i,!s),r>Ot&&(l.moveTo(0+r*Nt(i),0+r*Gt(i)),l.arc(0,0,r,i,n,s));else{var c=a*Nt(n),h=a*Gt(n),d=r*Nt(i),f=r*Gt(i);l.moveTo(0+c,0+h),l.arc(0,0,a,n,i,!s),l.lineTo(0+d,0+f),l.arc(0,0,r,i,n,s),l.closePath()}return l}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function Zc(t){return new qc(t)}qc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Qo);var Jc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="arc3d",i.numberType=Ss,i}return c(n,t),u(n,[{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).arc;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updateArc3dAABBBounds(e,Lr(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(qc);function Qc(t){return new Jc(t)}Jc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Qo);var $c=["points","cornerRadius"].concat(g(Xo)),th=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="polygon",i.numberType=Es,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.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=Lr(this).polygon;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updatePolygonAABBBounds(e,Lr(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=xa(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return Lr(this).polygon[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,$c)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,$c)}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new Kn;return t.forEach((function(t,n){0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($o);function eh(t){return new th(t)}th.NOWORK_ANIMATE_ATTR=Qo;var nh=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="pyramid3d",i.numberType=Os,i}return c(n,t),u(n,[{key:"doUpdateAABBBounds",value:function(){var t=Lr(this).polygon;this._AABBBounds.clear();var e=this.attribute,n=Si.graphicService.updatePyramid3dAABBBounds(e,Lr(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=pa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"findFace",value:function(){for(var t=this.attribute.points,e=t.map((function(e,n){var i=3===n?t[0]:t[n+1],r=e.x-i.x;return 0===r?0:(e.y-i.y)/r})),n=t.map((function(t){return{p:t,d:0}})),i=!1,r=0,a=0;a<e.length-1;a++){for(var o=a+1;o<e.length;o++){if(e[a]===e[o]){i=!0;var s=Qt.distancePP(n[a].p,n[a+1].p);n[a].d=s,n[a+1].d=s,r=Ft(r,s);var u=Qt.distancePP(n[o].p,n[o+1].p);n[o].d=u,n[o+1].d=u,r=Ft(r,u)}if(i)break}if(i)break}for(var l=t.length-1;l>=0;l--){var c=t[l];n.unshift({p:c,d:0})}for(var h=0;h<t.length;h++){var d=(r-n[h+t.length].d)/2;n[h].d+=d,n[h+t.length].d+=d}var f={polygons:[],vertices:[],edges:[]};return n.forEach((function(t){f.vertices.push([t.p.x,t.p.y,t.d])})),f.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),f.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),f.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),f.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),f.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),f.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),f.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],f}},{key:"_isValid",value:function(){return p(h(n.prototype),"_isValid",this).call(this)&&4===this.attribute.points.length}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(th);function ih(t){return new nh(t)}nh.NOWORK_ANIMATE_ATTR=Qo;var rh=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[{x:0,y:0}])).type="shadowroot",i.shadowHost=t,i}return c(n,t),u(n,[{key:"addUpdateBoundTag",value:function(){p(h(n.prototype),"addUpdateBoundTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"addUpdateShapeAndBoundsTag",value:function(){p(h(n.prototype),"addUpdateShapeAndBoundsTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){var e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"doUpdateGlobalMatrix",value:function(){if(this.shadowHost){var t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}},{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.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}])}(Vs);function ah(t){return new rh(t)}var oh=function(){return u((function t(){o(this,t)}),[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,a=t.shadowBlur,o=void 0===a?e.shadowBlur:a;if(r){var s=e.outerBorder,u=r.distance,l=void 0===u?s.distance:u,c=r.lineWidth,h=void 0===c?s.lineWidth:c;n.expand(l+(o+h)/2)}return n}}])}(),sh=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,a=t.shadowBlur,o=void 0===a?e.shadowBlur:a,s=t.strokeBoundsBuffer,u=void 0===s?e.strokeBoundsBuffer:s;if(r){var l=e.outerBorder,c=r.distance,h=void 0===c?l.distance:c,d=r.lineWidth;fs(n,h+(o+(void 0===d?l.lineWidth:d))/2,!0,u)}return n}}])}(oh),uh=Symbol.for("MatrixAllocate"),lh=Symbol.for("Mat4Allocate");function ch(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}var hh=function(){return u((function t(){o(this,t),this.pools=[]}),[{key:"allocate",value:function(t,e,n,i,r,a){if(!this.pools.length)return new re(t,e,n,i,r,a);var o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=i,o.e=r,o.f=a,o}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new re(t.a,t.b,t.c,t.d,t.e,t.f);var e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),dh=function(){function t(){o(this,t),this.pools=[]}return u(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 n=0;n<e.length;n++)e[n]=t[n];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}}])}(),fh=new hh,vh=new dh,ph=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},yh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gh=function(t,e){return function(n,i){e(n,i,t)}};function mh(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+l*i,t[5]=o*r+c*i,t[6]=s*r+h*i,t[7]=u*r+d*i,t[8]=l*r-a*i,t[9]=c*r-o*i,t[10]=h*r-s*i,t[11]=d*r-u*i,t}function bh(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-l*i,t[1]=o*r-c*i,t[2]=s*r-h*i,t[3]=u*r-d*i,t[8]=a*i+l*r,t[9]=o*i+c*r,t[10]=s*i+h*r,t[11]=u*i+d*r,t}function kh(t,e,n){var i,r,a,o,s,u,l,c,h,d,f,v,p=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*g+e[12],t[13]=e[1]*p+e[5]*y+e[9]*g+e[13],t[14]=e[2]*p+e[6]*y+e[10]*g+e[14],t[15]=e[3]*p+e[7]*y+e[11]*g+e[15]):(i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=v,t[12]=i*p+s*y+h*g+e[12],t[13]=r*p+u*y+d*g+e[13],t[14]=a*p+l*y+f*g+e[14],t[15]=o*p+c*y+v*g+e[15]),t}function xh(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function wh(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],b=n[0],k=n[1],x=n[2],w=n[3];return t[0]=b*i+k*s+x*h+w*p,t[1]=b*r+k*u+x*d+w*y,t[2]=b*a+k*l+x*f+w*g,t[3]=b*o+k*c+x*v+w*m,b=n[4],k=n[5],x=n[6],w=n[7],t[4]=b*i+k*s+x*h+w*p,t[5]=b*r+k*u+x*d+w*y,t[6]=b*a+k*l+x*f+w*g,t[7]=b*o+k*c+x*v+w*m,b=n[8],k=n[9],x=n[10],w=n[11],t[8]=b*i+k*s+x*h+w*p,t[9]=b*r+k*u+x*d+w*y,t[10]=b*a+k*l+x*f+w*g,t[11]=b*o+k*c+x*v+w*m,b=n[12],k=n[13],x=n[14],w=n[15],t[12]=b*i+k*s+x*h+w*p,t[13]=b*r+k*u+x*d+w*y,t[14]=b*a+k*l+x*f+w*g,t[15]=b*o+k*c+x*v+w*m,t}function Ah(t,e,n){var i,r=e.attribute,a=r.x,o=void 0===a?n.x:a,s=r.y,u=void 0===s?n.y:s,l=r.z,c=void 0===l?n.z:l,h=r.dx,d=void 0===h?n.dx:h,f=r.dy,v=void 0===f?n.dy:f,p=r.dz,y=void 0===p?n.dz:p,g=r.scaleX,m=void 0===g?n.scaleX:g,b=r.scaleY,k=void 0===b?n.scaleY:b,x=r.scaleZ,w=void 0===x?n.scaleZ:x,A=r.alpha,S=void 0===A?n.alpha:A,T=r.beta,B=void 0===T?n.beta:T,C=r.angle,_=void 0===C?n.angle:C,R=r.anchor3d,P=void 0===R?e.attribute.anchor:R,M=r.anchor,E=[0,0,0];if(P){if("string"==typeof P[0]){var O=parseFloat(P[0])/100,L=e.AABBBounds;E[0]=L.x1+(L.x2-L.x1)*O}else E[0]=P[0];if("string"==typeof P[1]){var I=parseFloat(P[1])/100,D=e.AABBBounds;E[1]=D.x1+(D.x2-D.x1)*I}else E[1]=P[1];E[2]=null!==(i=P[2])&&void 0!==i?i: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),kh(t,t,[o+d,u+v,c+y]),kh(t,t,[E[0],E[1],E[2]]),mh(t,t,B),bh(t,t,S),kh(t,t,[-E[0],-E[1],E[2]]),function(t,e,n){var i=n[0],r=n[1],a=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*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,[m,k,w]),_){var j=vh.allocate(),U=[0,0];if(M){if("string"==typeof P[0]){var W=parseFloat(P[0])/100,N=e.AABBBounds;U[0]=N.x1+(N.x2-N.x1)*W}else U[0]=P[0];if("string"==typeof P[1]){var F=parseFloat(P[1])/100,z=e.AABBBounds;U[1]=z.x1+(z.x2-z.x1)*F}else U[1]=P[1]}kh(j,j,[U[0],U[1],0]),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+l*i,t[1]=o*r+c*i,t[2]=s*r+h*i,t[3]=u*r+d*i,t[4]=l*r-a*i,t[5]=c*r-o*i,t[6]=h*r-s*i,t[7]=d*r-u*i}(j,j,_),kh(j,j,[-U[0],-U[1],0]),wh(t,t,j)}}function Sh(t){var e=t.attribute,n=e.alpha,i=e.beta;return n||i}t.DefaultGraphicService=function(){return u((function t(e){o(this,t),this.creator=e,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 ee,this.tempAABBBounds2=new ee,this._rectBoundsContribitions=[new oh],this._symbolBoundsContribitions=[new sh],this._circleBoundsContribitions=[new oh],this._arcBoundsContribitions=[new oh],this._pathBoundsContribitions=[new oh]}),[{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,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}},{key:"afterUpdateAABBBounds",value:function(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;var i=new Je(t);return ln(n.commandList,i,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,a=t.height,o=t.x1,s=t.y1,u=t.x,l=t.y;r=null!=r?r:o-u,a=null!=a?a:s-l,n.set(0,0,r||0,a||0)}var c=this.tempAABBBounds1,h=this.tempAABBBounds2;return c.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,c,i),n.union(c),c.setValue(h.x1,h.y1,h.x2,h.y2)})),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updateGroupAABBBounds",value:function(t,e,n,i){var r=n;n=n.clone();var a=t.width,o=t.height,s=t.path,u=t.clip,l=void 0===u?e.clip:u;s&&s.length?s.forEach((function(t){n.union(t.AABBBounds)})):null!=a&&null!=o&&n.set(0,0,Math.max(0,a),Math.max(0,o)),l||i.forEachChildren((function(t){n.union(t.AABBBounds)}));var c=this.tempAABBBounds1,h=this.tempAABBBounds2;return c.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),r.copy(n),r}},{key:"updateGlyphAABBBounds",value:function(t,e,n,i){return this._validCheck(t,e,n,i)?(i.getSubGraphic().forEach((function(t){n.union(t.AABBBounds)})),n):n}},{key:"updateHTMLTextAABBBounds",value:function(t,e,n,i){var r=t.textAlign,a=t.textBaseline;if(null!=t.forceBoundsHeight){var o=wt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=ju(a,o,o);n.set(n.x1,s,n.x2,s+o)}if(null!=t.forceBoundsWidth){var u=wt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),l=Du(r,u);n.set(l,n.y1,l+u,n.y2)}}},{key:"updateRichTextAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!i)return n;var r=t.width,a=void 0===r?e.width:r,o=t.height,s=void 0===o?e.height:o,u=t.maxWidth,l=void 0===u?e.maxWidth:u,c=t.maxHeight,h=void 0===c?e.maxHeight:c,d=t.textAlign,f=void 0===d?e.textAlign:d,v=t.textBaseline,p=void 0===v?e.textBaseline:v;if(a>0&&s>0)n.set(0,0,a,s);else{var y=i.getFrameCache().getActualSize(),g=y.width,m=y.height,b=a||g||0,k=s||m||0;k="number"==typeof h&&k>h?h:k||0,b="number"==typeof l&&b>l?l:b||0,n.set(0,0,b,k)}var x=0;switch(p){case"top":x=0;break;case"middle":x=-n.height()/2;break;case"bottom":x=-n.height()}var w=0;switch(f){case"left":w=0;break;case"center":w=-n.width()/2;break;case"right":w=-n.width()}n.translate(w,x);var A=this.tempAABBBounds1,S=this.tempAABBBounds2;return A.setValue(n.x1,n.y1,n.x2,n.y2),S.setValue(n.x1,n.y1,n.x2,n.y2),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,n),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updateTextAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!i)return n;var r=i.attribute.text,a=void 0===r?e.text:r;Array.isArray(a)?i.updateMultilineAABBBounds(a):i.updateSingallineAABBBounds(a);var o=this.tempAABBBounds1,s=this.tempAABBBounds2;o.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);var u=t.scaleX,l=void 0===u?e.scaleX:u,c=t.scaleY,h=void 0===c?e.scaleY:c,d=t.shadowBlur,f=void 0===d?e.shadowBlur:d,v=t.strokeBoundsBuffer,p=void 0===v?e.strokeBoundsBuffer:v;f&&(fs(o,f/Math.abs(l+h),!0,p),n.union(o));return this.combindShadowAABBBounds(n,i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,n),$t(n,n,i.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(o){o.updateBounds(t,e,r,i),n.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)}));var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,n,i){if(!i)return n;var r=i.getParsedPathShape();return n.union(r.getBounds()),n}},{key:"updatePyramid3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((function(t){var e=t[0],i=t[1];n.add(e,i)}));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;return a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updateArc3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;var a=t.outerRadius,o=void 0===a?e.outerRadius:a,s=t.height,u=o+(void 0===s?0:s);n.setValue(-u,-u,u,u);var l=this.tempAABBBounds1,c=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),c.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updatePolygonAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2);var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,n,i){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){n.add(t.x,t.y)})),n}},{key:"updateLineAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2);var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,a=void 0===r?e.points:r,o=n;return a.forEach((function(t){o.add(t.x,t.y)})),o}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,a=void 0===r?e.segments:r,o=n;return a.forEach((function(t){t.points.forEach((function(t){o.add(t.x,t.y)}))})),o}},{key:"updateAreaAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2);var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,a=void 0===r?e.points:r,o=n;return a.forEach((function(t){var e,n;o.add(t.x,t.y),o.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),o}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,a=void 0===r?e.segments:r,o=n;return a.forEach((function(t){t.points.forEach((function(t){var e,n;o.add(t.x,t.y),o.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),o}},{key:"updateCircleAABBBounds",value:function(t,e,n,i,r){if(!this._validCheck(t,e,n,r))return n;this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;return a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(i){i.updateBounds(t,e,a,r),n.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,n,e,!1,r),n}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,n,i){var r=t.radius,a=void 0===r?e.radius:r;return n.set(-a,-a,a,a),n}},{key:"updateCircleAABBBoundsAccurate",value:function(t,e,n,i){var r=t.startAngle,a=void 0===r?e.startAngle:r,o=t.endAngle,s=void 0===o?e.endAngle:o,u=t.radius,l=void 0===u?e.radius:u;return s-a>jt-Ot?n.set(-l,-l,l,l):ma(a,s,l,n),n}},{key:"updateArcAABBBounds",value:function(t,e,n,i,r){if(!this._validCheck(t,e,n,r))return n;this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(i){i.updateBounds(t,e,a,r),n.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2)}));var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,n,e,"miter"===u,r),n}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,n,i){var r=t.outerRadius,a=void 0===r?e.outerRadius:r,o=t.innerRadius,s=void 0===o?e.innerRadius:o,u=t.outerPadding,l=void 0===u?e.outerPadding:u,c=t.innerPadding;return(a+=l)<(s-=void 0===c?e.innerPadding:c)&&(a=s),n.set(-a,-a,a,a),n}},{key:"updateArcAABBBoundsAccurate",value:function(t,e,n,i){var r=t.outerRadius,a=void 0===r?e.outerRadius:r,o=t.innerRadius,s=void 0===o?e.innerRadius:o,u=t.outerPadding,l=void 0===u?e.outerPadding:u,c=t.innerPadding;if((a+=l)<(s-=void 0===c?e.innerPadding:c)){var h=a;a=s,s=h}var d=t.endAngle,f=void 0===d?e.endAngle:d,v=t.startAngle,p=void 0===v?e.startAngle:v;if(p>f){var y=p;p=f,f=y}return a<=Ot?n.set(0,0,0,0):Math.abs(f-p)>jt-Ot?n.set(-a,-a,a,a):(ma(p,f,a,n),ma(p,f,s,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,n,i,r){if(!this._validCheck(t,e,n,r))return n;this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(i){i.updateBounds(t,e,a,r),n.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2)}));var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,n,e,"miter"===u,r),n}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,e,n,i){var r=t.size,a=void 0===r?e.size:r;if(xt(a))n.set(-a[0]/2,-a[1]/2,a[0]/2,a[1]/2);else{var o=a/2;n.set(-o,-o,o,o)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,n,i){if(!i)return n;var r=t.size,a=void 0===r?e.size:r;return i.getParsedPath().bounds(a,n),n}},{key:"updateImageAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,a=void 0===r?e.width:r,o=t.height,s=void 0===o?e.height:o;n.set(0,0,a,s)}var u=this.tempAABBBounds1,l=this.tempAABBBounds2;return u.setValue(n.x1,n.y1,n.x2,n.y2),l.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var n=e.shadowRoot.AABBBounds;t.union(n)}}},{key:"transformAABBBounds",value:function(t,e,n,i,r){if(!e.empty()){var a=t.scaleX,o=void 0===a?n.scaleX:a,s=t.scaleY,u=void 0===s?n.scaleY:s,l=t.stroke,c=void 0===l?n.stroke:l,h=t.shadowBlur,d=void 0===h?n.shadowBlur:h,f=t.lineWidth,v=void 0===f?n.lineWidth:f,p=t.pickStrokeBuffer,y=void 0===p?n.pickStrokeBuffer:p,g=t.strokeBoundsBuffer,m=void 0===g?n.strokeBoundsBuffer:g,b=this.tempAABBBounds1,k=this.tempAABBBounds2;if(c&&v)fs(b,(v+y)/Math.abs(o+u),i,m),e.union(b),b.setValue(k.x1,k.y1,k.x2,k.y2);if(d){var x=t.shadowOffsetX,w=void 0===x?n.shadowOffsetX:x,A=t.shadowOffsetY,S=void 0===A?n.shadowOffsetY:A;fs(b,d/Math.abs(o+u)*2,!1,m+1),b.translate(w,S),e.union(b)}}if(this.combindShadowAABBBounds(e,r),!e.empty()){var T=!0,B=r.transMatrix;r&&r.isContainer&&(T=!(1===B.a&&0===B.b&&0===B.c&&1===B.d&&0===B.e&&0===B.f)),T&&$t(e,e,B)}}},{key:"_validCheck",value:function(t,e,n,i){if(!i)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!i.valid)return n.clear(),!1;var r=t.visible;return!!(void 0===r?e.visible:r)||(n.clear(),!1)}}])}(),t.DefaultGraphicService=ph([I(),gh(0,O(Ns)),yh("design:paramtypes",[Object])],t.DefaultGraphicService);var Th,Bh,Ch=new(function(){return u((function t(){o(this,t),this.store=new Map}),[{key:"RegisterGraphicCreator",value:function(t,e){this.store.set(t,e),this[t]=e}},{key:"CreateGraphic",value:function(t,e){var n=this.store.get(t);return n?n(e):null}}])}());function _h(t){return Th||(Th=Ch.CreateGraphic("text",{})),Th.initAttributes(t),Th.AABBBounds}var Rh={x:0,y:0,z:0,lastModelMatrix:null},Ph=function(){return u((function t(){o(this,t)}),[{key:"init",value:function(e){var n=this;e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((function(t){return n._renderContribitions.push(t)})),this._renderContribitions.length&&(this._renderContribitions.sort((function(t,e){return e.order-t.order})),this._beforeRenderContribitions=this._renderContribitions.filter((function(e){return e.time===t.BaseRenderContributionTime.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(e){return e.time===t.BaseRenderContributionTime.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,a,o,s,u,l,c,h,d)}))}},{key:"afterRenderStep",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,a,o,s,u,l,c,h,d)}))}},{key:"valid",value:function(t,e,n,i){var r=t.attribute,a=r.fill,o=void 0===a?e.fill:a,s=r.background,u=r.stroke,l=void 0===u?e.stroke:u,c=r.opacity,h=void 0===c?e.opacity:c,d=r.fillOpacity,f=void 0===d?e.fillOpacity:d,v=r.lineWidth,p=void 0===v?e.lineWidth:v,y=r.strokeOpacity,g=void 0===y?e.strokeOpacity:y,m=r.visible,b=void 0===m?e.visible:m,k=ou(h,f,o),x=uu(h,g),w=ru(o,s),A=au(l,p);return!(!t.valid||!b)&&!(!w&&!A)&&!!(k||x||n||i||s)&&{fVisible:k,sVisible:x,doFill:w,doStroke:A}}},{key:"transform",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.attribute,a=r.x,o=void 0===a?e.x:a,s=r.y,u=void 0===s?e.y:s,l=r.z,c=void 0===l?e.z:l,h=r.scaleX,d=void 0===h?e.scaleX:h,f=r.scaleY,v=void 0===f?e.scaleY:f,p=r.angle,y=void 0===p?e.angle:p,g=r.postMatrix,m=n.modelMatrix,b=n.camera;Rh.x=o,Rh.y=u,Rh.z=c,Rh.lastModelMatrix=m;var k=b&&(i||Sh(t)),x=k?t.transMatrix.onlyTranslate()&&!g:1===d&&1===v&&0===y&&!g;if(k){var w=vh.allocate(),A=vh.allocate();Ah(A,t,e),wh(w,m||w,A),Rh.x=0,Rh.y=0,Rh.z=0,n.modelMatrix=w,n.setTransform(1,0,0,1,0,0,!0),vh.free(A)}if(x&&!m){var S=t.getOffsetXY(e);Rh.x+=S.x,Rh.y+=S.y,Rh.z=c,n.setTransformForCurrent()}else if(k)Rh.x=0,Rh.y=0,Rh.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(b&&n.project){var T=t.getOffsetXY(e);Rh.x+=T.x,Rh.y+=T.y,this.transformWithoutTranslate(n,Rh.x,Rh.y,Rh.z,d,v,y)}else n.transformFromMatrix(t.transMatrix,!0),Rh.x=0,Rh.y=0,Rh.z=0;return Rh}},{key:"transformUseContext2d",value:function(t,e,n,i){var r=i.camera;if(this.camera=r,r){var a=t.AABBBounds,o=a.x2-a.x1,s=a.y2-a.y1,u=i.project(0,0,n),l=i.project(o,0,n),c=i.project(o,s,n),h={x:0,y:0},d={x:o,y:0},f={x:o,y:s};i.camera=null;var v=1/(h.x*(f.y-d.y)-d.x*f.y+f.x*d.y+(d.x-f.x)*h.y),p=-(h.y*(c.x-l.x)-d.y*c.x+f.y*l.x+(d.y-f.y)*u.x)*v,y=(d.y*c.y+h.y*(l.y-c.y)-f.y*l.y+(f.y-d.y)*u.y)*v,g=(h.x*(c.x-l.x)-d.x*c.x+f.x*l.x+(d.x-f.x)*u.x)*v,m=-(d.x*c.y+h.x*(l.y-c.y)-f.x*l.y+(f.x-d.x)*u.y)*v,b=(h.x*(f.y*l.x-d.y*c.x)+h.y*(d.x*c.x-f.x*l.x)+(f.x*d.y-d.x*f.y)*u.x)*v,k=(h.x*(f.y*l.y-d.y*c.y)+h.y*(d.x*c.y-f.x*l.y)+(f.x*d.y-d.x*f.y)*u.y)*v;i.setTransform(p,y,g,m,b,k,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,n,i){this.camera&&(i.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,n,i,r,a,o){var s=t.project(e,n,i);t.translate(s.x,s.y,!1),t.scale(r,a,!1),t.rotate(o,!1),t.translate(-s.x,-s.y,!1),t.setTransformForCurrent()}},{key:"_draw",value:function(t,e,n,i,r){var a=i.context;if(a&&!1!==t.attribute.renderable){a.highPerformanceSave();var o=this.transform(t,e,a,n),s=o.x,u=o.y,l=o.z,c=o.lastModelMatrix;this.z=l,cu(t,a,s,u,0,r)||(this.drawShape(t,a,s,u,i,r),this.z=0,a.modelMatrix!==c&&vh.free(a.modelMatrix),a.modelMatrix=c),a.highPerformanceRestore()}}}])}(),Mh=function(){var t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){var n=new Error(e+": "+t);throw n.source=e,n}function i(){return r("linear",t.linearGradient,a)||r("radial",t.radialGradient,s)||r("conic",t.conicGradient,o)}function r(e,i,r){return function(i,a){var o,s=g(i);if(s){g(t.startCall)||n("Missing (");var u=((o=r())&&(g(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(f)});return g(t.endCall)||n("Missing )"),u}}(i)}function a(){return y("directional",t.sideOrCorner,1)||y("angular",t.angleValue,1)}function o(){return y("angular",t.fromAngleValue,1)}function s(){var n,i,r=u();return r&&((n=[]).push(r),i=e,g(t.comma)&&((r=u())?n.push(r):e=i)),n}function u(){var t,e=function(){var t=y("shape",/^(circle)/i,0);return t&&(t.style=p()||l()),t}()||((t=y("shape",/^(ellipse)/i,0))&&(t.style=v()||l()),t);if(e)e.at=c();else{var n=l();if(n){e=n;var i=c();i&&(e.at=i)}else{var r=h();r&&(e={type:"default-radial",at:r})}}return e}function l(){return y("extent-keyword",t.extentKeywords,1)}function c(){if(y("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var i=e(),r=[];if(i)for(r.push(i);g(t.comma);)(i=e())?r.push(i):n("One extra comma");return r}function f(){var e=y("hex",t.hexColor,1)||y("rgba",t.rgbaColor,1)||y("rgb",t.rgbColor,1)||y("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function v(){return y("%",t.percentageValue,1)||y("position-keyword",t.positionKeywords,1)||p()}function p(){return y("px",t.pixelValue,1)||y("em",t.emValue,1)}function y(t,e,n){var i=g(e);if(i)return{type:t,value:i[n]}}function g(t){var n=/^[\n\r\t\s]+/.exec(e);n&&m(n[0].length);var i=t.exec(e);return i&&m(i[0].length),i}function m(t){e=e.substr(t)}return function(t){return e=t.toString(),r=d(i),e.length>0&&n("Invalid input not EOF"),r;var r}}(),Eh=function(){function t(){o(this,t)}return u(t,null,[{key:"IsGradient",value:function(t){return!("string"==typeof t&&!t.includes("gradient"))}},{key:"IsGradientStr",value:function(t){return"string"==typeof t&&t.includes("gradient")}},{key:"Parse",value:function(e){if(t.IsGradientStr(e))try{var n=Mh(e)[0];if(n){if("linear"===n.type)return t.ParseLinear(n);if("radial"===n.type)return t.ParseRadial(n);if("conic"===n.type)return t.ParseConic(n)}}catch(t){return e}return e}},{key:"ParseConic",value:function(t){var e=t.orientation,n=t.colorStops,i=void 0===n?[]:n,r=Lt/2,a=parseFloat(e.value)/180*Lt-r;return{gradient:"conical",x:.5,y:.5,startAngle:a,endAngle:a+jt,stops:i.map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}},{key:"ParseRadial",value:function(t){var e=t.colorStops;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:(void 0===e?[]:e).map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}},{key:"ParseLinear",value:function(t){for(var e=t.orientation,n=t.colorStops,i=void 0===n?[]:n,r=Lt/2,a="angular"===e.type?parseFloat(e.value)/180*Lt:0;a<0;)a+=jt;for(;a>jt;)a-=jt;var o=0,s=0,u=0,l=0;return a<r?(o=0,s=1,u=Math.sin(a),l=Math.cos(a)):a<Lt?(o=0,s=0,u=Math.cos(a-r),l=Math.sin(a-r)):a<Lt+r?(s=0,u=(o=1)-Math.sin(a-Lt),l=Math.cos(a-Lt)):(u=(o=1)-Math.cos(a-r-Lt),l-=Math.sin(a-r-Lt)),{gradient:"linear",x0:o,y0:s,x1:u,y1:l,stops:i.map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}}])}();function Oh(t,e,n){var i=e,r=t.currentMatrix,a=r.a,o=r.b,s=r.c,u=r.d,l=Math.sign(a)*Math.sqrt(a*a+o*o),c=Math.sign(u)*Math.sqrt(s*s+u*u);return l+c===0?0:i=i/Math.abs(l+c)*2*n}function Lh(t,e,n,i,r){if(!e||!0===e)return"black";var a,o;if(xt(e))for(var s=0;s<e.length&&!(o=e[s]);s++);else o=e;return"string"==typeof(o=Eh.Parse(o))?o:("linear"===o.gradient?a=function(t,e,n){var i,r,a,o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=n.AABBBounds;if(!l)return;var c=l.x2-l.x1,h=l.y2-l.y1,d=l.x1-s,f=l.y1-u;if(n.attribute){var v=n.attribute,p=v.scaleX,y=void 0===p?1:p,g=v.scaleY,m=void 0===g?1:g;if(y*m==0)return;c/=y,h/=m,d/=y,f/=m}var b=t.createLinearGradient(d+(null!==(i=e.x0)&&void 0!==i?i:0)*c,f+(null!==(r=e.y0)&&void 0!==r?r:0)*h,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,f+(null!==(o=e.y1)&&void 0!==o?o:0)*h);return e.stops.forEach((function(t){b.addColorStop(t.offset,t.color)})),b}(t,o,n,i,r):"conical"===o.gradient?a=function(t,e,n){var i,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=n.AABBBounds;if(!s)return;var u=s.x2-s.x1,l=s.y2-s.y1,c=s.x1-a,h=s.y1-o;if(n.attribute){var d=n.attribute,f=d.scaleX,v=void 0===f?1:f,p=d.scaleY,y=void 0===p?1:p;if(v*y==0)return;u/=v,l/=y,c/=v,h/=y}var g=t.createConicGradient(c+(null!==(i=e.x)&&void 0!==i?i:0)*u,h+(null!==(r=e.y)&&void 0!==r?r:0)*l,e.startAngle,e.endAngle);return e.stops.forEach((function(t){g.addColorStop(t.offset,t.color)})),g.GetPattern(u+c,l+h,void 0)}(t,o,n,i,r):"radial"===o.gradient&&(a=function(t,e,n){var i,r,a,o,s,u,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=n.AABBBounds;if(!h)return;var d=h.x2-h.x1,f=h.y2-h.y1,v=h.x1-l,p=h.y1-c;if(n.attribute){var y=n.attribute,g=y.scaleX,m=void 0===g?1:g,b=y.scaleY,k=void 0===b?1:b;if(m*k==0)return;v/=m,p/=k,d/=m,f/=k}var x=t.createRadialGradient(v+(null!==(i=e.x0)&&void 0!==i?i:.5)*d,p+(null!==(r=e.y0)&&void 0!==r?r:.5)*f,Math.max(d,f)*(null!==(a=e.r0)&&void 0!==a?a:0),v+(null!==(o=e.x1)&&void 0!==o?o:.5)*d,p+(null!==(s=e.y1)&&void 0!==s?s:.5)*f,Math.max(d,f)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((function(t){x.addColorStop(t.offset,t.color)})),x}(t,o,n,i,r)),a||"orange")}var Ih=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Dh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jh=function(t,e){return function(n,i){e(n,i,t)}},Uh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f,v=t.attribute,p=v.background,y=v.backgroundOpacity,g=void 0===y?null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:u.backgroundOpacity:y,m=v.opacity,b=void 0===m?u.opacity:m,k=v.backgroundMode,x=void 0===k?u.backgroundMode:k,w=v.backgroundFit,A=void 0===w?u.backgroundFit:w;if(p)if(t.backgroundImg&&t.resources){var S=t.resources.get(p);if("success"!==S.state||!S.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var T=Lr(t.parent).group,B=t.parent.attribute,C=B.scrollX,_=void 0===C?T.scrollX:C,R=B.scrollY,P=void 0===R?T.scrollY:R;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(_,P)}e.clip();var M=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,u),e.globalAlpha=g*b,this.doDrawImage(e,S.data,M,x,A),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,u),e.globalAlpha=g*b,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},{key:"doDrawImage",value:function(t,e,n,i,r){if("no-repeat"===i)t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{var a=n.width(),o=n.height(),s=a,u=o;if(r&&"repeat"!==i&&(e.width||e.height)){var l=e.width,c=e.height;"repeat-x"===i?(s=l*(o/c),u=o):"repeat-y"===i&&(u=c*(a/l),s=a);var h=t.dpr,d=gr.allocate({width:s,height:u,dpr:h}),f=d.getContext("2d");f&&(f.inuse=!0,f.clearMatrix(),f.setTransformForCurrent(!0),f.clearRect(0,0,s,u),f.drawImage(e,0,0,s,u),e=d.nativeCanvas),gr.free(d)}var v=t.dpr,p=t.createPattern(e,i);p.setTransform&&p.setTransform(new DOMMatrix([1/v,0,0,1/v,0,0])),t.fillStyle=p,t.translate(n.x1,n.y1),t.fillRect(0,0,a,o),t.translate(-n.x1,-n.y1)}}}])}(),Wh=new Uh;t.DefaultBaseInteractiveRenderContribution=function(){return u((function e(n){o(this,e),this.subRenderContribitions=n,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((function(f){f.render(t,e,n,i,r,a,o,s,u,l,c,h,d)}))}}])}(),t.DefaultBaseInteractiveRenderContribution=Ih([I(),jh(0,O(Q)),jh(0,D(Pu)),Dh("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);var Nh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}),[{key:"createCommonPattern",value:function(t,e,n,i,r){var a=(t-2*e)/2,o=i.dpr,s=gr.allocate({width:t,height:t,dpr:o}),u=s.getContext("2d");if(!u)return null;u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,t,t),r(a,u);var l=i.createPattern(s.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),gr.free(s),l}},{key:"createCirclePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,e){e.fillStyle=n,e.arc(t,t,t,0,jt),e.fill()}))}},{key:"createDiamondPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){var r=t/2,a=r;i.fillStyle=n,i.moveTo(r,a-e),i.lineTo(e+r,a),i.lineTo(r,a+e),i.lineTo(r-e,a),i.closePath(),i.fill()}))}},{key:"createRectPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,a=r;i.fillStyle=n,i.fillRect(r,a,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var a=e;r.fillStyle=n,r.fillRect(a,0,2*i,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var a=e;r.fillStyle=n,r.fillRect(0,a,t,2*i)}))}},{key:"createBiasLRLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);var r=t/2,a=-r;i.moveTo(r,a),i.lineTo(r+t,a+t),i.moveTo(-r,-a),i.lineTo(-r+t,-a+t),i.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);var r=t/2,a=r;i.moveTo(t+r,a),i.lineTo(r,a+t),i.moveTo(t-r,-a),i.lineTo(-r,-a+t),i.stroke()}))}},{key:"createGridPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,a=r;i.fillStyle=n,i.fillRect(r,a,t,t),i.fillRect(r+t,a+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this.textureMap||this.initTextureMap(e,t.stage);var f=t.attribute,v=f.texture,p=void 0===v?u.texture:v,y=f.textureColor,g=void 0===y?u.textureColor:y,m=f.textureSize,b=void 0===m?u.textureSize:m,k=f.texturePadding,x=void 0===k?u.texturePadding:k;p&&this.drawTexture(p,t,e,n,i,u,g,b,x)}},{key:"drawTexture",value:function(t,e,n,i,r,a,o,s,u){var l=this.textureMap.get(t);if(!l)switch(t){case"circle":l=this.createCirclePattern(s,u,o,n);break;case"diamond":l=this.createDiamondPattern(s,u,o,n);break;case"rect":l=this.createRectPattern(s,u,o,n);break;case"vertical-line":l=this.createVerticalLinePattern(s,u,o,n);break;case"horizontal-line":l=this.createHorizontalLinePattern(s,u,o,n);break;case"bias-lr":l=this.createBiasLRLinePattern(s,u,o,n);break;case"bias-rl":l=this.createBiasRLLinePattern(s,u,o,n);break;case"grid":l=this.createGridPattern(s,u,o,n)}l&&(n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,a),n.fillStyle=l,n.fill(),n.highPerformanceRestore())}}])}(),Fh=new Nh,zh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.outerBorder,v=d.innerBorder,p=f&&!1!==f.visible,y=v&&!1!==v.visible;if(p||y){var g=t.attribute,m=g.innerPadding,b=void 0===m?u.innerPadding:m,k=g.outerPadding,x=void 0===k?u.outerPadding:k,w=g.startAngle,A=void 0===w?u.startAngle:w,S=g.endAngle,T=void 0===S?u.endAngle:S,B=g.opacity,C=void 0===B?u.opacity:B,_=g.x,R=void 0===_?u.x:_,P=g.y,M=void 0===P?u.y:P,E=g.scaleX,O=void 0===E?u.scaleX:E,L=g.scaleY,I=void 0===L?u.scaleY:L,D=t.attribute,j=D.innerRadius,U=void 0===j?u.innerRadius:j,W=D.outerRadius,N=void 0===W?u.outerRadius:W;N+=x,U-=b;var F=!(!f||!f.stroke),z=!(!v||!v.stroke);if(p){var G=f.distance,H=void 0===G?u.outerBorder.distance:G,V=Oh(e,H,e.dpr),Y=H/N;if(t.setAttributes({outerRadius:N+V,innerRadius:U-V,startAngle:A-Y,endAngle:T+Y}),e.beginPath(),fu(t,e,n,i,N+V,U-V),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,f,u.outerBorder);else if(F){var X=u.outerBorder.opacity;u.outerBorder.opacity=C,e.setStrokeStyle(t,f,(R-n)/O,(M-i)/I,u.outerBorder),u.outerBorder.opacity=X,e.stroke()}}if(y){var K=v.distance,q=void 0===K?u.innerBorder.distance:K,Z=Oh(e,q,e.dpr),J=q/N;if(t.setAttributes({outerRadius:N-Z,innerRadius:U+Z,startAngle:A+J,endAngle:T-J}),e.beginPath(),fu(t,e,n,i,N-Z,U+Z),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.innerBorder);else if(z){var Q=u.innerBorder.opacity;u.innerBorder.opacity=C,e.setStrokeStyle(t,v,(R-n)/O,(M-i)/I,u.innerBorder),u.innerBorder.opacity=Q,e.stroke()}}t.setAttributes({outerRadius:N,innerRadius:U,startAngle:A,endAngle:T})}}}])}(),Gh=new zh,Hh=Fh,Vh=Wh,Yh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.outerBorder,v=d.innerBorder,p=f&&!1!==f.visible,y=v&&!1!==v.visible;if(p||y){var g=t.attribute,m=g.radius,b=void 0===m?u.radius:m,k=g.startAngle,x=void 0===k?u.startAngle:k,w=g.endAngle,A=void 0===w?u.endAngle:w,S=g.opacity,T=void 0===S?u.opacity:S,B=g.x,C=void 0===B?u.x:B,_=g.y,R=void 0===_?u.y:_,P=g.scaleX,M=void 0===P?u.scaleX:P,E=g.scaleY,O=void 0===E?u.scaleY:E,L=!(!f||!f.stroke),I=!(!v||!v.stroke);if(p){var D=f.distance,j=Oh(e,void 0===D?u.outerBorder.distance:D,e.dpr);if(e.beginPath(),e.arc(n,i,b+j,x,A),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,f,u.outerBorder);else if(L){var U=u.outerBorder.opacity;u.outerBorder.opacity=T,e.setStrokeStyle(t,f,(C-n)/M,(R-i)/O,u.outerBorder),u.outerBorder.opacity=U,e.stroke()}}if(y){var W=v.distance,N=Oh(e,void 0===W?u.innerBorder.distance:W,e.dpr);if(e.beginPath(),e.arc(n,i,b-N,x,A),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.innerBorder);else if(I){var F=u.innerBorder.opacity;u.innerBorder.opacity=T,e.setStrokeStyle(t,v,(C-n)/M,(R-i)/O,u.innerBorder),u.innerBorder.opacity=F,e.stroke()}}}}}])}(),Xh=new Yh,Kh=Fh,qh=Wh,Zh=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.beforeFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.background,v=d.backgroundMode,p=void 0===v?u.backgroundMode:v,y=d.backgroundFit,g=void 0===y?u.backgroundFit:y;if(f)if(t.backgroundImg&&t.resources){var m=t.resources.get(f);if("success"!==m.state||!m.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var b=t.AABBBounds;this.doDrawImage(e,m.data,b,p,g),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}}])}(Uh),Jh=new Zh,Qh=Lt/2;function $h(t,e,n,i,r,a){var o;if(i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),wt(a,!0))o=[a=Ut(a),a,a,a];else if(Array.isArray(a)){var s,u,l=a;switch(l.length){case 0:o=[0,0,0,0];break;case 1:o=[s=Ut(l[0]),s,s,s];break;case 2:case 3:o=[s=Ut(l[0]),u=Ut(l[1]),s,u];break;default:(o=l)[0]=Ut(o[0]),o[1]=Ut(o[1]),o[2]=Ut(o[2]),o[3]=Ut(o[3])}}else o=[0,0,0,0];if(i<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,n,i,r);var c=[e,n],h=[e+i,n],d=[e+i,n+r],f=[e,n+r],v=Math.min(i/2,r/2),p=[Math.min(v,o[0]),Math.min(v,o[1]),Math.min(v,o[2]),Math.min(v,o[3])],y=[c[0]+p[0],c[1]],g=[c[0],c[1]+p[0]],m=[h[0]-p[1],h[1]],b=[h[0],h[1]+p[1]],k=[d[0]-p[2],d[1]],x=[d[0],d[1]-p[2]],w=[f[0]+p[3],f[1]],A=[f[0],f[1]-p[3]];if(t.moveTo(y[0],y[1]),t.lineTo(m[0],m[1]),!_t(m,b)){var S=m[0],T=m[1]+p[1];t.arc(S,T,p[1],-Qh,0,!1)}if(t.lineTo(x[0],x[1]),!_t(k,x)){var B=x[0]-p[2],C=x[1];t.arc(B,C,p[2],0,Qh,!1)}if(t.lineTo(w[0],w[1]),!_t(w,A)){var _=w[0],R=w[1]-p[3];t.arc(_,R,p[3],Qh,Lt,!1)}if(t.lineTo(g[0],g[1]),!_t(y,g)){var P=y[0],M=y[1]+p[0];t.arc(P,M,p[0],Lt,Lt+Qh,!1)}return t.closePath(),t}var td=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.beforeFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.background,v=d.backgroundMode,p=void 0===v?u.backgroundMode:v,y=d.backgroundFit,g=void 0===y?u.backgroundFit:y;if(f)if(t.backgroundImg){var m=t.resources.get(f);if("success"!==m.state||!m.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var b=Lr(t.parent).group,k=t.parent.attribute,x=k.scrollX,w=void 0===x?b.scrollX:x,A=k.scrollY,S=void 0===A?b.scrollY:A;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(w,S)}var T=t.AABBBounds;this.doDrawImage(e,m.data,T,p,g),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(mt(f)){var B=f.stroke,C=f.fill,_=f.lineWidth,R=void 0===_?1:_,P=f.cornerRadius,M=void 0===P?0:P,E=f.expandX,O=void 0===E?0:E,L=f.expandY,I=void 0===L?0:L;if(!B&&!C)return;e.beginPath();var D=function(t){var e=pa(t.attribute.boundsPadding),n=t.AABBBounds,i=n.x1,r=n.y1,a=n.width(),o=n.height();return wt(e)?(i+=e,r+=e,a-=2*e,o-=2*e):(i+=e[3],r+=e[0],a-=e[1]+e[3],o-=e[0]+e[2]),{x:i,y:r,width:a,height:o}}(t),j=D.x,U=D.y,W=D.width,N=D.height;M?$h(e,j-O,U-I,W+2*O,N+2*I,M):e.rect(j-O,U-I,W+2*O,N+2*I),e.globalAlpha=1,C&&(e.fillStyle=C,e.fill()),B&&R>0&&(e.lineWidth=R,e.strokeStyle=B,e.stroke())}else{e.beginPath();var F=t.AABBBounds;e.rect(n,i,F.width(),F.height()),e.fillStyle=f,e.globalAlpha=1,e.fill()}}}])}(Uh);var ed=new td,nd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},id=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.outerBorder,v=d.innerBorder,p=f&&!1!==f.visible,y=v&&!1!==v.visible;if(p||y){var g=t.attribute,m=g.cornerRadius,b=void 0===m?u.cornerRadius:m,k=g.opacity,x=void 0===k?u.opacity:k,w=g.x,A=void 0===w?u.x:w,S=g.y,T=void 0===S?u.y:S,B=g.scaleX,C=void 0===B?u.scaleX:B,_=g.scaleY,R=void 0===_?u.scaleY:_,P=g.x1,M=g.y1,E=t.attribute,O=E.width,L=E.height;O=(null!=O?O:P-n)||0,L=(null!=L?L:M-i)||0;var I=!(!f||!f.stroke),D=!(!v||!v.stroke);if(p){var j=f.distance,U=Oh(e,void 0===j?u.outerBorder.distance:j,e.dpr),W=n-U,N=i-U,F=2*U;if(0===b||xt(b)&&b.every((function(t){return 0===t}))?(e.beginPath(),e.rect(W,N,O+F,L+F)):(e.beginPath(),$h(e,W,N,O+F,L+F,b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,f,u.outerBorder);else if(I){var z=u.outerBorder.opacity;u.outerBorder.opacity=x,e.setStrokeStyle(t,f,(A-n)/C,(T-i)/R,u.outerBorder),u.outerBorder.opacity=z,e.stroke()}}if(y){var G=v.distance,H=Oh(e,void 0===G?u.innerBorder.distance:G,e.dpr),V=n+H,Y=i+H,X=2*H;if(0===b||xt(b)&&b.every((function(t){return 0===t}))?(e.beginPath(),e.rect(V,Y,O-X,L-X)):(e.beginPath(),$h(e,V,Y,O-X,L-X,b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.innerBorder);else if(D){var K=u.innerBorder.opacity;u.innerBorder.opacity=x,e.setStrokeStyle(t,v,(A-n)/C,(T-i)/R,u.innerBorder),u.innerBorder.opacity=K,e.stroke()}}}}}])}();t.SplitRectBeforeRenderContribution=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f=t.attribute.stroke,v=void 0===f?u.stroke:f;Array.isArray(v)&&v.some((function(t){return!1===t}))&&(d.doStroke=!1)}}])}(),t.SplitRectBeforeRenderContribution=nd([I()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.x1,v=d.y1,p=d.x,y=void 0===p?u.x:p,g=d.y,m=void 0===g?u.y:g,b=d.stroke,k=void 0===b?u.stroke:b,x=t.attribute,w=x.width,A=x.height;if(w=(null!=w?w:f-y)||0,A=(null!=A?A:v-m)||0,Array.isArray(k)&&k.some((function(t){return!1===t}))){if(e.setStrokeStyle(t,t.attribute,n,i,u),e.beginPath(),e.moveTo(n,i),k[0]?e.lineTo(n+w,i):e.moveTo(n+w,i),k[1]?e.lineTo(n+w,i+A):e.moveTo(n+w,i+A),k[2]?e.lineTo(n,i+A):e.moveTo(n,i+A),k[3]){var S=k[0]?i-e.lineWidth/2:i;e.lineTo(n,S)}else e.moveTo(n,i);e.stroke()}}}])}(),t.SplitRectAfterRenderContribution=nd([I()],t.SplitRectAfterRenderContribution);var rd=new id,ad=Fh,od=Wh,sd=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.getParsedPath();if(d){var f=t.attribute,v=f.outerBorder,p=f.innerBorder,y=v&&!1!==v.visible,g=p&&!1!==p.visible;if(y||g){var m=t.attribute,b=m.size,k=void 0===b?u.size:b,x=m.opacity,w=void 0===x?u.opacity:x,A=m.x,S=void 0===A?u.x:A,T=m.y,B=void 0===T?u.y:T,C=m.scaleX,_=void 0===C?u.scaleX:C,R=m.scaleY,P=void 0===R?u.scaleY:R,M=!(!v||!v.stroke),E=!(!p||!p.stroke);if(y){var O=v.distance,L=Oh(e,void 0===O?u.outerBorder.distance:O,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,k,n,i,L)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.outerBorder);else if(M){var I=u.outerBorder.opacity;u.outerBorder.opacity=w,e.setStrokeStyle(t,v,(S-n)/_,(B-i)/P,u.outerBorder),u.outerBorder.opacity=I,e.stroke()}}if(g){var D=p.distance,j=Oh(e,void 0===D?u.innerBorder.distance:D,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,k,n,i,-j)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,p,u.innerBorder);else if(E){var U=u.innerBorder.opacity;u.innerBorder.opacity=w,e.setStrokeStyle(t,p,(S-n)/_,(B-i)/P,u.innerBorder),u.innerBorder.opacity=U,e.stroke()}}}}}}])}(),ud=new sd,ld=Fh,cd=Wh,hd=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.afterFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f,v,p,y;this.textureMap||this.initTextureMap(e,t.stage);var g=(d||{}).attribute,m=void 0===g?t.attribute:g,b=m.texture,k=void 0===b?null!==(f=t.attribute.texture)&&void 0!==f?f:Sa(u,"texture"):b,x=m.textureColor,w=void 0===x?null!==(v=t.attribute.textureColor)&&void 0!==v?v:Sa(u,"textureColor"):x,A=m.textureSize,S=void 0===A?null!==(p=t.attribute.textureSize)&&void 0!==p?p:Sa(u,"textureSize"):A,T=m.texturePadding,B=void 0===T?null!==(y=t.attribute.texturePadding)&&void 0!==y?y:Sa(u,"texturePadding"):T;k&&this.drawTexture(k,t,e,n,i,u,w,S,B)}}])}(Nh),dd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},fd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasArcRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).arcRenderContribitions=t,i.numberType=As,i.builtinContributions=[Gh,Vh,Hh],i.init(t),i}return c(n,t),u(n,[{key:"drawArcTailCapPath",value:function(t,e,n,i,r,a,o,s){var u=s-o,l=t.getParsedAngle(),c=l.startAngle,h=l.endAngle,d=Ut((h=s)-c),f=h>c,v=!1;if(r<a){var p=r;r=a,a=p}var y=t.getParsedCornerRadius(),g=t.getParsePadAngle(c,h);g.outerDeltaAngle;var m,b,k,x,w=g.innerDeltaAngle,A=g.outerStartAngle,S=g.outerEndAngle,T=g.innerEndAngle,B=g.innerStartAngle,C=y,_=y,R=y,P=y,M=Math.max(_,C),E=Math.max(R,P),O=M,L=E,I=r*Nt(A),D=r*Gt(A),j=a*Nt(T),U=a*Gt(T);if((E>Ot||M>Ot)&&(m=r*Nt(S),b=r*Gt(S),k=a*Nt(B),x=a*Gt(B),d<Lt)){var W=hu(I,D,k,x,m,b,j,U);if(W){var N=I-W[0],F=D-W[1],z=m-W[0],G=b-W[1],H=1/Gt(Yt((N*z+F*G)/(Ht(N*N+F*F)*Ht(z*z+G*G)))/2),V=Ht(W[0]*W[0]+W[1]*W[1]);L=zt(E,(a-V)/(H-1)),O=zt(M,(r-V)/(H+1))}}if(O>Ot){var Y=zt(C,O),X=zt(_,O),K=du(k,x,I,D,r,Y,Number(f)),q=du(m,b,j,U,r,X,Number(f));if(O<M&&Y===X)e.moveTo(n+K.cx+K.x01,i+K.cy+K.y01),e.arc(n+K.cx,i+K.cy,O,Wt(K.y01,K.x01),Wt(q.y01,q.x01),!f);else{var Z=h-u-.03,J=Wt(q.y11,q.x11);e.arc(n,i,r,Z,J,!f),X>0&&e.arc(n+q.cx,i+q.cy,X,Wt(q.y11,q.x11),Wt(q.y01,q.x01),!f)}}else e.moveTo(n+I,i+D);if(!(a>Ot)||w<.001)e.lineTo(n+j,i+U),v=!0;else if(L>Ot){var Q=zt(P,L),$=zt(R,L),tt=du(j,U,m,b,a,-$,Number(f)),et=du(I,D,k,x,a,-Q,Number(f));if(e.lineTo(n+tt.cx+tt.x01,i+tt.cy+tt.y01),L<E&&Q===$){var nt=Wt(et.y01,et.x01);e.arc(n+tt.cx,i+tt.cy,L,Wt(tt.y01,tt.x01),nt,!f)}else{$>0&&e.arc(n+tt.cx,i+tt.cy,$,Wt(tt.y01,tt.x01),Wt(tt.y11,tt.x11),!f);var it=Wt(tt.cy+tt.y11,tt.cx+tt.x11),rt=h-u-.03;e.arc(n,i,a,it,rt,f)}}else e.lineTo(n+a*Nt(B),i+a*Gt(B));return v}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=Lr(t,null==a?void 0:a.theme).arc,l=t.attribute,c=l.fill,h=void 0===c?u.fill:c,d=l.stroke,f=void 0===d?u.stroke:d,v=l.x,p=void 0===v?u.x:v,y=l.y,g=void 0===y?u.y:y,m=this.valid(t,u,o,s);if(m){var b=m.fVisible,k=m.sVisible,x=m.doFill,w=m.doStroke,A=t.attribute,S=A.outerPadding,T=void 0===S?u.outerPadding:S,B=A.innerPadding,C=void 0===B?u.innerPadding:B,_=A.cap,R=void 0===_?u.cap:_,P=A.forceShowCap,M=void 0===P?u.forceShowCap:P,E=t.attribute,O=E.outerRadius,L=void 0===O?u.outerRadius:O,I=E.innerRadius,D=void 0===I?u.innerRadius:I;L+=T,D-=C;var j=0,U=(vt(R)&&R||R[0])&&"conical"===h.gradient;if(U){var W=t.getParsedAngle(),N=W.sc,F=W.startAngle,z=W.endAngle;Ut(z-F)<jt-Ot&&(j=N||0,h.startAngle-=j,h.endAngle-=j)}var G=!1,H=fa(f),V=H.isFullStroke,Y=H.stroke;if((x||V)&&(e.beginPath(),fu(t,e,n,i,L,D),G=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,x,w,b,k,u,r,o,s),x&&(o?o(e,t.attribute,u):b&&(e.setCommonStyle(t,t.attribute,p-n,g-i,u),e.fill())),w&&V&&(s?s(e,t.attribute,u):k&&(e.setStrokeStyle(t,t.attribute,p-n,g-i,u),e.stroke()))),!V&&w&&(e.beginPath(),fu(t,e,n,i,L,D,Y),G||this.beforeRenderStep(t,e,n,i,x,w,b,k,u,r,o,s),s?s(e,t.attribute,u):k&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke())),(vt(R)&&R||R[1])&&M){var X=t.getParsedAngle(),K=X.startAngle,q=X.endAngle;if(Ut(q-K)>=jt-Ot){e.beginPath();var Z=Math.abs(L-D)/2/L,J=t.attribute,Q=J.endAngle,$=void 0===Q?u.endAngle:Q,tt=J.fill,et=void 0===tt?u.fill:tt,nt=$;if(this.drawArcTailCapPath(t,e,n,i,L,D,nt,nt+Z),G||this.beforeRenderStep(t,e,n,i,x,w,b,k,u,r,o,s),x){var it=et;if("conical"===it.gradient){var rt=gu(0,0,$,it);o||ou&&(e.setCommonStyle(t,t.attribute,n,i,u),e.fillStyle=rt,e.fill())}}w&&(s||k&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke()))}}this.afterRenderStep(t,e,n,i,x,w,b,k,u,r,o,s),U&&(h.startAngle+=j,h.endAngle+=j)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).arc;this._draw(t,r,!1,n,i)}}])}(Ph),t.DefaultCanvasArcRender=dd([I(),vd(0,O(Q)),vd(0,D(bu)),fd("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var pd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},yd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gd=function(t,e){return function(n,i){e(n,i,t)}};function md(t,e,n,i){if(e.p1){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,c=void 0===l?0:l;if(1===n)e.p2&&e.p3?t.bezierCurveTo(o+e.p1.x,u+e.p1.y,o+e.p2.x,u+e.p2.y,o+e.p3.x,u+e.p3.y,c):t.lineTo(o+e.p1.x,u+e.p1.y,c);else if(e.p2&&e.p3){var h=y(pn(e,n),1)[0];t.bezierCurveTo(o+h.p1.x,u+h.p1.y,o+h.p2.x,u+h.p2.y,o+h.p3.x,u+h.p3.y,c)}else{var d=e.getPointAt(n);t.lineTo(o+d.x,u+d.y,c)}}}function bd(e,n,i,r,a){var o,s=a||{},u=s.offsetX,l=void 0===u?0:u,c=s.offsetY,h=void 0===c?0:c,d=s.offsetZ,f=void 0===d?0:d,v=s.mode,p=void 0===v?"none":v,y=s.drawConnect,g=void 0!==y&&y;if(s.zeroX,s.zeroY,(!g||"none"!==p)&&n){var m=!0,b=n.curves;if(i>=1)if(g){var k,x=!0;b.forEach((function(t,n){var i,r=t.p0;if(t.originP1!==t.originP2){if(k&&k.originP1===k.originP2&&(r=k.p0),t.defined)x||(e.lineTo(r.x+l,r.y+h,f),x=!x);else{var a,o=t.originP1,s=t.originP2;if(o&&!1!==o.defined?a=r:o&&!1!==s.defined&&(a=null!==(i=t.p3)&&void 0!==i?i:t.p1),x){x=!x;var u=a?a.x:t.p0.x,c=a?a.y:t.p0.y;e.moveTo(u+l,c+h,f)}else a&&(x=!x,e.lineTo(a.x+l,a.y+h,f))}k=t}else k=t}))}else b.forEach((function(t){t.defined?(m&&e.moveTo(t.p0.x+l,t.p0.y+h,f),md(e,t,1,a),m=!1):m=!0}));else if(!(i<=0)){var w;"x"===r?w=t.Direction.ROW:"y"===r?w=t.Direction.COLUMN:"auto"===r&&(w=n.direction);for(var A=i*n.tryUpdateLength(w),S=0,T=!0,B=null,C=0,_=b.length;C<_;C++){var R=b[C],P=R.getLength(w),M=(A-S)/P;if(S+=P,M<0)break;if(g){var E=R.p0;if(R.originP1===R.originP2){B=R;continue}if(B&&B.originP1===B.originP2&&(E=B.p0),R.defined)T||(e.lineTo(E.x+l,E.y+h,f),T=!T);else{var O=R.originP1,L=R.originP2,I=void 0;if(O&&!1!==O.defined?I=E:O&&!1!==L.defined&&(I=null!==(o=R.p3)&&void 0!==o?o:R.p1),T){T=!T;var D=I?I.x:R.p0.x,j=I?I.y:R.p0.y;e.moveTo(D+l,j+h,f)}else I&&(T=!T,e.lineTo(I.x+l,I.y+h,f))}B=R}else{if(!R.defined){m=!0;continue}m&&e.moveTo(R.p0.x+l,R.p0.y+h,f),md(e,R,zt(M,1),a),m=!1}}}}}function kd(t,e,n,i){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=e?e.points[e.points.length-1]:n.points[0];t.moveTo(l.x+o,l.y+u),n.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+o,e.y+u):t.moveTo(e.x+o,e.y+u)}))}function xd(t,e,n,i){for(var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=n.points,c=[],h=0;h<l.length;h++)l[h].defined;c.push(l),c.forEach((function(n,i){var r,a,s,l,c=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(c.x+o,c.y+u),n.forEach((function(e){!1!==e.defined?t.lineTo(e.x+o,e.y+u):t.moveTo(e.x+o,e.y+u)}));for(var h=n.length-1;h>=0;h--){var d=n[h];t.lineTo(null!==(r=d.x1)&&void 0!==r?r:d.x,null!==(a=d.y1)&&void 0!==a?a:d.y)}t.lineTo(null!==(s=c.x1)&&void 0!==s?s:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}t.DefaultCanvasCircleRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).circleRenderContribitions=t,i.numberType=Bs,i.builtinContributions=[Xh,qh,Kh],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=Lr(t,null==a?void 0:a.theme).circle,l=t.attribute,c=l.radius,h=void 0===c?u.radius:c,d=l.startAngle,f=void 0===d?u.startAngle:d,v=l.endAngle,p=void 0===v?u.endAngle:v,y=l.x,g=void 0===y?u.x:y,m=l.y,b=void 0===m?u.y:m,k=this.valid(t,u,o,s);if(k){var x=k.fVisible,w=k.sVisible,A=k.doFill,S=k.doStroke;e.beginPath(),e.arc(n,i,h,f,p),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,A,S,x,w,u,r,o,s),A&&(o?o(e,t.attribute,u):x&&(e.setCommonStyle(t,t.attribute,g-n,b-i,u),e.fill())),S&&(s?s(e,t.attribute,u):w&&(e.setStrokeStyle(t,t.attribute,g-n,b-i,u),e.stroke())),this.afterRenderStep(t,e,n,i,A,S,x,w,u,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).circle;this._draw(t,r,!1,n,i)}}])}(Ph),t.DefaultCanvasCircleRender=pd([I(),gd(0,O(Q)),gd(0,D(xu)),yd("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var wd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};function Ad(e,n,i,r){var a,o=r||{},s=o.drawConnect,u=void 0!==s&&s,l=o.mode;if(!u||"none"!==(void 0===l?"none":l)){var c=n.top,h=n.bottom;if(c.curves.length===h.curves.length)if(i>=1){var d=[],f=[],v=!0;if(u){var p,y,g=!0,m=c.curves.length;c.curves.forEach((function(t,n){var i=h.curves[m-n-1],a=t,o=i;if(t.originP1===t.originP2)return p=t,void(y=i);if(p&&p.originP1===p.originP2&&(a=p,o=y),t.defined)g||(d.push(a),f.push(o),Sd(e,d,f,r),d.length=0,f.length=0,g=!g);else{var s,u,l=t.originP1,c=t.originP2;l&&!1!==l.defined?(s=a,u=o):l&&!1!==c.defined&&(s=t,u=i),g?(g=!g,d.push(s||t),f.push(u||i)):s&&(g=!g,d.push(s||t),f.push(u||i),Sd(e,d,f,r),d.length=0,f.length=0)}p=t})),Sd(e,d,f,r)}else{for(var b=0,k=c.curves.length;b<k;b++){var x=c.curves[b];v!==x.defined?(v?(Td(e,d,f,r),d.length=0,f.length=0):(d.push(x),f.push(h.curves[k-b-1])),v=!v):v&&(d.push(x),f.push(h.curves[k-b-1]))}Td(e,d,f,r)}}else if(!(i<=0)){var w=(r||{}).direction,A=c.curves,S=null!==(a=A[A.length-1].p3)&&void 0!==a?a:A[A.length-1].p1,T=Ut(S.x-A[0].p0.x),B=Ut(S.y-A[0].p0.y);w=null!=w?w:T>B?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(T)||(w=t.Direction.COLUMN),Number.isFinite(B)||(w=t.Direction.ROW);for(var C,_,R=i*(w===t.Direction.ROW?T:B),P=0,M=!0,E=[],O=[],L=!0,I=0,D=c.curves.length;I<D;I++){var j=c.curves[I],U=j.getLength(w),W=(R-P)/U;if(W<0)break;if(P+=U,u){var N=h.curves[D-I-1],F=j,z=N;if(j.originP1===j.originP2){C=j,_=N;continue}if(C&&C.originP1===C.originP2&&(F=C,z=_),j.defined)L||(E.push(F),O.push(z),Sd(e,E,O,r),E.length=0,O.length=0,L=!L);else{var G=j.originP1,H=j.originP2,V=void 0,Y=void 0;G&&!1!==G.defined?(V=F,Y=z):G&&!1!==H.defined&&(V=j,Y=N),L?(L=!L,E.push(V||j),O.push(Y||N)):V&&(L=!L,E.push(V||j),O.push(Y||N),Sd(e,E,O,r),E.length=0,O.length=0)}C=j}else{var X=null,K=null;M!==j.defined?(M?(Td(e,E,O,r),E.length=0,O.length=0):(X=j,K=h.curves[D-I-1]),M=!M):M&&(X=j,K=h.curves[D-I-1]),X&&K&&(W<1&&(X=X.p2&&X.p3?pn(X,W)[0]:gn(X,W)[0],K=K.p2&&K.p3?pn(K,1-W)[1]:gn(K,1-W)[1]),X.defined=M,K.defined=M,E.push(X),O.push(K)),X=null,K=null}}u?Sd(e,E,O,r):Td(e,E,O,r)}}}function Sd(t,e,n,i){if(!(e.length<2)){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,c=void 0===l?0:l;r.mode;var h=e[0];t.moveTo(h.p0.x+o,h.p0.y+u,c);var d=(h=e[e.length-1]).p3||h.p1;t.lineTo(d.x+o,d.y+u,c),h=n[n.length-1],t.lineTo(h.p0.x+o,h.p0.y+u,c),d=(h=n[0]).p3||h.p1,t.lineTo(d.x+o,d.y+u,c),t.closePath()}}function Td(t,e,n,i){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,c=void 0===l?0:l,h=!0;e.forEach((function(e){e.defined?(h&&t.moveTo(e.p0.x+o,e.p0.y+u,c),md(t,e,1,i),h=!1):h=!0})),h=!0;for(var d=n.length-1;d>=0;d--){var f=n[d];f.defined?(h&&t.lineTo(f.p0.x+o,f.p0.y+u,c),md(t,f,1,i),h=!1):h=!0}t.closePath()}t.DefaultCanvasLineRender=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).numberType=Ps,t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).line;this._draw(t,r,!1,n,i)}},{key:"drawSegmentItem",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d,f,v){var p,y,g,m,b;if(e){t.beginPath();var k=null!==(p=this.z)&&void 0!==p?p:0;bd(t.camera?t:t.nativeContext,e,u,l,{offsetX:c,offsetY:h,offsetZ:k}),d.cache&&!xt(d.cache)&&d.cache.curves.every((function(t){return t.defined}))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,o,s);var x=o.x,w=void 0===x?0:x,A=o.x,S=void 0===A?0:A;!1!==n&&(f?f(t,o,s):r&&(t.setCommonStyle(d,o,w-c,S-h,s),t.fill())),!1!==i&&(v?v(t,o,s):a&&(t.setStrokeStyle(d,o,w-c,S-h,s),t.stroke()));var T=o.connectedType,B=o.connectedX,C=o.connectedY,_=o.connectedStyle;if(xt(s)?(T=null!==(y=null!=T?T:s[0].connectedType)&&void 0!==y?y:s[1].connectedType,B=null!==(g=null!=B?B:s[0].connectedX)&&void 0!==g?g:s[1].connectedX,C=null!==(m=null!=C?C:s[0].connectedY)&&void 0!==m?m:s[1].connectedY,_=null!==(b=null!=_?_:s[0].connectedStyle)&&void 0!==b?b:s[1].connectedStyle):(T=null!=T?T:s.connectedType,B=null!=B?B:s.connectedX,C=null!=C?C:s.connectedY,_=null!=_?_:s.connectedStyle),"connect"!==T&&"zero"!==T&&(T="none"),"none"!==T){t.beginPath(),bd(t.camera?t:t.nativeContext,e,u,l,{offsetX:c,offsetY:h,offsetZ:k,drawConnect:!0,mode:T,zeroX:B,zeroY:C});var R=[];xt(s)?s.forEach((function(t){return R.push(t)})):R.push(s),R.push(o),!1!==n&&(f?f(t,o,s):r&&(t.setCommonStyle(d,_,w-c,S-h,R),t.fill())),!1!==i&&(v?v(t,o,s):a&&(t.setStrokeStyle(d,_,w-c,S-h,R),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f;e.beginPath();var v=null!==(f=this.z)&&void 0!==f?f:0,p=t.attribute.points,y=p[0];e.moveTo(y.x+o,y.y+s,v);for(var g=1;g<p.length;g++){var m=p[g];e.lineTo(m.x+o,m.y+s,v)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u);var b=t.attribute,k=b.x,x=void 0===k?0:k,w=b.x,A=void 0===w?0:w;!1!==n&&(h?h(e,t.attribute,u):r&&(e.setCommonStyle(t,t.attribute,x-o,A-s,u),e.fill())),!1!==i&&(d?d(e,t.attribute,u):a&&(e.setStrokeStyle(t,t.attribute,x-o,A-s,u),e.stroke()))}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=this,l=Lr(t,null==a?void 0:a.theme).line,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.stroke,v=void 0===f?l.stroke:f,p=c.fillOpacity,y=void 0===p?l.fillOpacity:p,g=c.strokeOpacity,m=void 0===g?l.strokeOpacity:g,b=c.segments,k=c.points,x=c.closePath;if(this.valid(t,l,o,s)){var w=t.attribute.curveType,A=void 0===w?l.curveType:w;x&&"linear"===A&&(A="linearClosed");var S=t.attribute,T=S.clipRange,B=void 0===T?l.clipRange:T,C=S.clipRangeByDimension,_=void 0===C?l.clipRangeByDimension:C;if(1===B&&!b&&!k.some((function(t){return!1===t.defined}))&&"linear"===A)return this.drawLinearLineHighPerformance(t,e,!!d,!!v,y,m,n,i,l,r,a,o,s);if(t.shouldUpdateShape()){var R=t.attribute,P=R.points,M=R.segments,E=P;if(M&&M.length){var O,L;if(t.cache=M.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(L={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===e?O={x:L.endX,y:L.endY,defined:L.curves[L.curves.length-1].defined}:e>1&&(O.x=L.endX,O.y=L.endY,O.defined=L.curves[L.curves.length-1].defined);var n=Xn(t.points,A,{startPoint:O});return L=n,n})).filter((function(t){return!!t})),"linearClosed"===A){for(var I,D=0;D<t.cache.length;D++){for(var j=t.cache[D],U=0;U<j.curves.length;U++)if(j.curves[U].defined){I=j.curves[U].p0;break}if(I)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(I.x,I.y,!0)}}else{if(!P||!P.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Xn(E,A)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){var W=t.attribute.segments.filter((function(t){return t.points.length}));if(1===W[0].points.length&&W.shift(),1===B){var N=!1;t.cache.forEach((function(r,a){N||(N=u.drawSegmentItem(e,r,!!d,!!v,y,m,W[a],[l,t.attribute],B,_,n,i,t,o,s))}))}else{var F=t.cache.reduce((function(t,e){return t+e.getLength()}),0),z=B*F,G=0,H=!1;t.cache.forEach((function(r,a){if(!H){var c=r.getLength(),h=(z-G)/c;G+=c,h>0&&(H=u.drawSegmentItem(e,r,!!d,!!v,y,m,W[a],[l,t.attribute],zt(h,1),_,n,i,t,o,s))}}))}}else this.drawSegmentItem(e,t.cache,!!d,!!v,y,m,t.attribute,l,B,_,n,i,t,o,s)}}}])}(Ph),t.DefaultCanvasLineRender=wd([I()],t.DefaultCanvasLineRender);var Bd=new hd,Cd=Wh,_d=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Rd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pd=function(t,e){return function(n,i){e(n,i,t)}};function Md(t,e,n){switch(e){case"linear":default:return Sn(t,n);case"basis":return Rn(t,n);case"monotoneX":return jn(t,n);case"monotoneY":return Wn(t,n);case"step":return Fn(t,.5,n);case"stepBefore":return Fn(t,0,n);case"stepAfter":return Fn(t,1,n);case"linearClosed":return Hn(t,n)}}t.DefaultCanvasAreaRender=function(n){function i(t){var n;return o(this,i),(n=e(this,i)).areaRenderContribitions=t,n.numberType=Ts,n.builtinContributions=[Bd,Cd],n.init(t),n}return c(i,n),u(i,[{key:"drawLinearAreaHighPerformance",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f,v,p,y,g,m=t.attribute.points;if(!(m.length<2)){e.beginPath();var b=null!==(f=this.z)&&void 0!==f?f:0,k=m[0];e.moveTo(k.x+o,k.y+s,b);for(var x=1;x<m.length;x++){var w=m[x];e.lineTo(w.x+o,w.y+s,b)}for(var A=m.length-1;A>=0;A--){var S=m[A];e.lineTo((null!==(v=S.x1)&&void 0!==v?v:S.x)+o,(null!==(p=S.y1)&&void 0!==p?p:S.y)+s,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,o,s,!!r,!1,n,!1,u,l,h,null,{attribute:t.attribute});var T=t.attribute,B=T.x,C=void 0===B?0:B,_=T.x,R=void 0===_?0:_;if(!1!==n&&(h?h(e,t.attribute,u):r&&(e.setCommonStyle(t,t.attribute,C-o,R-s,u),e.fill())),this.afterRenderStep(t,e,o,s,!!r,!1,n,!1,u,l,h,null,{attribute:t.attribute}),i){var P=t.attribute.stroke,M=void 0===P?u&&u.stroke:P;if(xt(M)&&(M[0]||M[2])&&!1===M[1])if(e.beginPath(),M[0]){e.moveTo(k.x+o,k.y+s,b);for(var E=1;E<m.length;E++){var O=m[E];e.lineTo(O.x+o,O.y+s,b)}}else if(M[2]){var L=m[m.length-1];e.moveTo(L.x+o,L.y+s,b);for(var I=m.length-2;I>=0;I--){var D=m[I];e.lineTo((null!==(y=D.x1)&&void 0!==y?y:D.x)+o,(null!==(g=D.y1)&&void 0!==g?g:D.y)+s,b)}}d?d(e,t.attribute,u):(e.setStrokeStyle(t,t.attribute,C-o,R-s,u),e.stroke())}}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l,c,h,d,f,v=this,p=Lr(t,null==a?void 0:a.theme).area,y=t.attribute,g=y.fill,m=void 0===g?p.fill:g,b=y.stroke;void 0===b&&p.stroke;var k=y.fillOpacity,x=void 0===k?p.fillOpacity:k,w=y.z,A=void 0===w?p.z:w,S=y.strokeOpacity,T=void 0===S?p.strokeOpacity:S,B=this.valid(t,p,o,s);if(B){var C=B.doFill,_=B.doStroke,R=t.attribute,P=R.clipRange,M=void 0===P?p.clipRange:P,E=R.closePath,O=R.points,L=R.segments,I=t.attribute.curveType,D=void 0===I?p.curveType:I;if(E&&"linear"===D&&(D="linearClosed"),1===M&&!L&&!O.some((function(t){return!1===t.defined}))&&"linear"===D)return this.drawLinearAreaHighPerformance(t,e,!!m,_,x,T,n,i,p,r,a,o,s);if(t.shouldUpdateShape()){if(L&&L.length){for(var j,U,W,N=L.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?j={x:U.endX,y:U.endY}:e>1&&(j.x=U.endX,j.y=U.endY);var n=Md(t.points,D,{startPoint:j});return U=n,n})).filter((function(t){return!!t})),F=[],z=L.length-1;z>=0;z--){for(var G=L[z].points,H=[],V=G.length-1;V>=0;V--)H.push({x:null!==(u=G[V].x1)&&void 0!==u?u:G[V].x,y:null!==(l=G[V].y1)&&void 0!==l?l:G[V].y});if(0!==z){var Y=L[z-1].points,X=Y[Y.length-1];X&&H.push({x:null!==(c=X.x1)&&void 0!==c?c:X.x,y:null!==(h=X.y1)&&void 0!==h?h:X.y})}H.length>1&&(W=Md(H,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D),F.unshift(W))}t.cacheArea=F.map((function(t,e){return{top:N[e],bottom:t}}))}else{if(!O||!O.length)return t.cacheArea=null,void t.clearUpdateShapeTag();for(var K=O,q=[],Z=O.length-1;Z>=0;Z--)q.push({x:null!==(d=O[Z].x1)&&void 0!==d?d:O[Z].x,y:null!==(f=O[Z].y1)&&void 0!==f?f:O[Z].y});var J=Md(K,D),Q=Md(q,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D);t.cacheArea={top:J,bottom:Q}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){var $=t.attribute.segments.filter((function(t){return t.points.length}));if(1===$[0].points.length&&$.shift(),1===M){var tt=!1;t.cacheArea.forEach((function(a,u){tt||(tt=v.drawSegmentItem(e,a,C,x,_,T,$[u],[p,t.attribute],M,n,i,A,t,r,o,s))}))}else{var et=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),nt=M*et,it=0,rt=!1;t.cacheArea.forEach((function(a,u){if(!rt){var l=a.top.getLength(),c=(nt-it)/l;it+=l,c>0&&(rt=v.drawSegmentItem(e,a,C,x,_,T,$[u],[p,t.attribute],zt(c,1),n,i,A,t,r,o,s))}}))}}else this.drawSegmentItem(e,t.cacheArea,C,x,_,T,t.attribute,p,M,n,i,A,t,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).area;this._draw(t,r,!1,n,i)}},{key:"drawSegmentItem",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d,f,v,p){var y=!1;return y=(y=y||this._drawSegmentItem(t,e,n,i,r,a,o,s,u,l,c,h,d,f,!1,v,p))||this._drawSegmentItem(t,e,n,i,r,a,o,s,u,l,c,h,d,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(e,n,i,r,a,o,s,u,l,c,h,d,f,v,p,y,g){var m,b,k,x;if(n&&n.top&&n.bottom&&n.top.curves&&n.top.curves.length&&n.bottom.curves&&n.bottom.curves.length){var w=s.connectedType,A=s.connectedX,S=s.connectedY,T=s.connectedStyle,B=[];if(p&&(xt(u)?(w=null!==(m=null!=w?w:u[0].connectedType)&&void 0!==m?m:u[1].connectedType,A=null!==(b=null!=A?A:u[0].connectedX)&&void 0!==b?b:u[1].connectedX,S=null!==(k=null!=S?S:u[0].connectedY)&&void 0!==k?k:u[1].connectedY,T=null!==(x=null!=T?T:u[0].connectedStyle)&&void 0!==x?x:u[1].connectedStyle):(w=null!=w?w:u.connectedType,A=null!=A?A:u.connectedX,S=null!=S?S:u.connectedY,T=null!=T?T:u.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),xt(u)?u.forEach((function(t){return B.push(t)})):B.push(u),B.push(s)),p&&"none"===w)return!1;e.beginPath();var C,_,R=f.attribute,P=R.points,M=R.segments,E=t.Direction.ROW;if(M){var O=M[M.length-1];_=M[0].points[0],C=O.points[O.points.length-1]}else _=P[0],C=P[P.length-1];var L=Ut(C.x-_.x),I=Ut(C.y-_.y);E=Number.isFinite(L+I)?L>I?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,Ad(e.camera?e:e.nativeContext,n,l,{offsetX:c,offsetY:h,offsetZ:d,direction:E,drawConnect:p,mode:w,zeroX:A,zeroY:S}),this.beforeRenderStep(f,e,c,h,!!r,!1,i,!1,u,v,y,null,{attribute:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(f,s,u);var D=s.x,j=void 0===D?0:D,U=s.x,W=void 0===U?0:U;if(!1!==i&&(y?y(e,s,u):r&&(e.setCommonStyle(f,p?T:s,j-c,W-h,p?B:u),e.fill())),this.afterRenderStep(f,e,c,h,!!r,!1,i,!1,u,v,y,null,{attribute:s}),!1!==a)if(g)g(e,s,u);else{var N=s.stroke,F=void 0===N?u&&u[1]&&u[1].stroke:N;xt(F)&&(F[0]||F[2])&&!1===F[1]&&(e.beginPath(),bd(e.camera?e:e.nativeContext,F[0]?n.top:n.bottom,l,E===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:h,offsetZ:d,drawConnect:p,mode:w,zeroX:A,zeroY:S})),e.setStrokeStyle(f,p?T:s,j-c,W-h,p?B:u),e.stroke()}return!1}}}])}(Ph),t.DefaultCanvasAreaRender=_d([I(),Pd(0,O(Q)),Pd(0,D(ku)),Rd("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);var Ed=Fh,Od=Wh,Ld=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Id=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasPathRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).pathRenderContribitions=t,i.numberType=Ms,i.builtinContributions=[Od,Ed],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l,c,h=null!==(u=this.tempTheme)&&void 0!==u?u:Lr(t,null==a?void 0:a.theme).path,d=t.attribute,f=d.x,v=void 0===f?h.x:f,p=d.y,y=void 0===p?h.y:p,g=null!==(l=this.z)&&void 0!==l?l:0,m=this.valid(t,h,o,s);if(m){var b=m.fVisible,k=m.sVisible,x=m.doFill,w=m.doStroke;if(e.beginPath(),t.pathShape)ln(t.pathShape.commandList,e,n,i,1,1,g);else ln((null!==(c=t.attribute.path)&&void 0!==c?c:h.path).commandList,e,n,i,1,1,g);e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,x,w,b,k,h,r,o,s),w&&(s?s(e,t.attribute,h):k&&(e.setStrokeStyle(t,t.attribute,v-n,y-i,h),e.stroke())),x&&(o?o(e,t.attribute,h):b&&(e.setCommonStyle(t,t.attribute,v-n,y-i,h),e.fill())),this.afterRenderStep(t,e,n,i,x,w,b,k,h,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).path;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}}])}(Ph),t.DefaultCanvasPathRender=Ld([I(),Dd(0,O(Q)),Dd(0,D(Su)),Id("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var jd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ud=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasRectRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).rectRenderContribitions=t,i.type="rect",i.numberType=Ls,i.builtinContributions=[rd,od,ad],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=null!==(u=this.tempTheme)&&void 0!==u?u:Lr(t,null==a?void 0:a.theme).rect,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.background,v=c.stroke,p=void 0===v?l.stroke:v,y=c.cornerRadius,g=void 0===y?l.cornerRadius:y,m=c.opacity,b=void 0===m?l.opacity:m,k=c.fillOpacity,x=void 0===k?l.fillOpacity:k,w=c.lineWidth,A=void 0===w?l.lineWidth:w,S=c.strokeOpacity,T=void 0===S?l.strokeOpacity:S,B=c.visible,C=void 0===B?l.visible:B,_=c.x1,R=c.y1,P=c.x,M=void 0===P?l.x:P,E=c.y,O=void 0===E?l.y:E,L=t.attribute,I=L.width,D=L.height,j=su(b,x,I=(null!=I?I:_-M)||0,D=(null!=D?D:R-O)||0,d),U=lu(b,T,I,D),W=ru(d,f),N=au(p,A);if(t.valid&&C&&(W||N)&&(j||U||o||s||f)){0===g||xt(g)&&g.every((function(t){return 0===t}))?(e.beginPath(),e.rect(n,i,I,D)):(e.beginPath(),$h(e,n,i,I,D,g));var F={doFill:W,doStroke:N};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,W,N,j,U,l,r,o,s,F),F.doFill&&(o?o(e,t.attribute,l):j&&(e.setCommonStyle(t,t.attribute,M-n,O-i,l),e.fill())),F.doStroke&&(s?s(e,t.attribute,l):U&&(e.setStrokeStyle(t,t.attribute,M-n,O-i,l),e.stroke())),this.afterRenderStep(t,e,n,i,W,N,j,U,l,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).rect;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}}])}(Ph),t.DefaultCanvasRectRender=jd([I(),Wd(0,O(Q)),Wd(0,D(Bu)),Ud("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var Nd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Fd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasSymbolRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).symbolRenderContribitions=t,i.numberType=js,i.builtinContributions=[ud,cd,ld],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=Lr(t,null==a?void 0:a.theme).symbol,c=t.attribute,h=c.size,d=void 0===h?l.size:h,f=c.x,v=void 0===f?l.x:f,p=c.y,y=void 0===p?l.y:p,g=c.scaleX,m=void 0===g?l.scaleX:g,b=c.scaleY,k=void 0===b?l.scaleY:b,x=this.valid(t,l,o,s);if(x){var w=x.fVisible,A=x.sVisible,S=x.doFill,T=x.doStroke,B=t.getParsedPath();if(B){var C=t.attribute.keepDirIn3d,_=void 0===C?l.keepDirIn3d:C,R=null!==(u=this.z)&&void 0!==u?u:0;if(e.beginPath(),_&&e.camera&&e.project){var P=e.project(n,i,R),M=e.camera;e.camera=null,!1===B.draw(e,xt(d)?[d[0]*m,d[1]*k]:d*m,P.x,P.y,void 0,(function(r,a){var u,c,h;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(u=a.fill)&&void 0!==u?u:t.attribute.fill,d.opacity=null!==(c=a.fill)&&void 0!==c?c:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(h=a.stroke)&&void 0!==h?h:t.attribute.stroke,a=d}a.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,a,v-n,y-i,l),e.fill())),a.stroke&&(s?s(e,t.attribute,l):(e.setStrokeStyle(t,a,(v-n)/m,(y-i)/k,l),e.stroke()))}))&&e.closePath(),e.camera=M}else!1===B.draw(e,d,n,i,R,(function(r,a){var u,c,h;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(u=a.fill)&&void 0!==u?u:t.attribute.fill,d.opacity=null!==(c=a.opacity)&&void 0!==c?c:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(h=a.stroke)&&void 0!==h?h:t.attribute.stroke,a=d}a.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,a,v-n,y-i,l),e.fill())),a.stroke&&(s?s(e,t.attribute,l):(e.setStrokeStyle(t,a,(v-n)/m,(y-i)/k,l),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,S,T,w,A,l,r,o,s),S&&!B.isSvg&&(o?o(e,t.attribute,l):w&&(e.setCommonStyle(t,t.attribute,v-n,y-i,l),e.fill())),T&&!B.isSvg&&(s?s(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,(v-n)/m,(y-i)/k,l),e.stroke())),this.afterRenderStep(t,e,n,i,S,T,w,A,l,r,o,s)}}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}}])}(Ph),t.DefaultCanvasSymbolRender=Nd([I(),zd(0,O(Q)),zd(0,D(Cu)),Fd("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);var Gd=function(){return u((function t(){o(this,t),this.pools=[];for(var e=0;e<10;e++)this.pools.push(new ee)}),[{key:"allocate",value:function(t,e,n,i){if(!this.pools.length)return(new ee).setValue(t,e,n,i);var r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=i,r}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new ee(t);var e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),Hd=new Gd,Vd=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.beforeFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d,f,v,p,y,g,m,b,k,x,w,A=t.attribute,S=A.backgroundMode,T=void 0===S?u.backgroundMode:S,B=A.backgroundFit,C=void 0===B?u.backgroundFit:B,_=t.attribute.background;if(_){var R,P=function(){"richtext"===t.type&&(e.restore(),e.save(),w&&e.setTransformFromMatrix(w,!0,1))};"richtext"===t.type&&(w=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());var M=mt(_)&&_.background,E=t.transMatrix.onlyTranslate();if(M){var O=t.AABBBounds,L=(null!==(d=_.x)&&void 0!==d?d:O.x1)+(null!==(f=_.dx)&&void 0!==f?f:0),I=(null!==(v=_.y)&&void 0!==v?v:O.y1)+(null!==(p=_.dy)&&void 0!==p?p:0),D=null!==(y=_.width)&&void 0!==y?y:O.width(),j=null!==(g=_.height)&&void 0!==g?g:O.height();if(R=Hd.allocate(L,I,L+D,I+j),_=_.background,!E){var U=R.width(),W=R.height();R.set((null!==(m=_.x)&&void 0!==m?m:0)+(null!==(b=_.dx)&&void 0!==b?b:0),(null!==(k=_.y)&&void 0!==k?k:0)+(null!==(x=_.dy)&&void 0!==x?x:0),U,W)}}else R=t.AABBBounds,E||(R=_h(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){var N=t.resources.get(_);if("success"!==N.state||!N.data)return void P();e.highPerformanceSave(),E&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,i,u),this.doDrawImage(e,N.data,R,T,C),e.highPerformanceRestore(),e.setTransformForCurrent()}else{var F=t.attribute.backgroundCornerRadius;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,u),e.fillStyle=_,F?($h(e,R.x1,R.y1,R.width(),R.height(),F),e.fill()):e.fillRect(R.x1,R.y1,R.width(),R.height()),e.highPerformanceRestore()}M&&Hd.free(R),P()}}}])}(Uh),Yd=new Vd,Xd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Kd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasTextRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).textRenderContribitions=t,i.numberType=Us,i.builtinContributions=[Yd],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l,c,h=this,d=Lr(t,null==a?void 0:a.theme).text,f=t.attribute;f.text;var v=f.underline,p=void 0===v?d.underline:v,y=f.lineThrough,g=void 0===y?d.lineThrough:y,m=f.keepDirIn3d,b=void 0===m?d.keepDirIn3d:m,k=f.direction,x=void 0===k?d.direction:k,w=f.whiteSpace;void 0===w&&d.whiteSpace;var A=f.fontSize,S=void 0===A?d.fontSize:A,T=f.verticalMode,B=void 0===T?d.verticalMode:T,C=f.x,_=void 0===C?d.x:C,R=f.y,P=void 0===R?d.y:R,M=t.attribute,E=M.textAlign,O=void 0===E?d.textAlign:E,L=M.textBaseline,I=void 0===L?d.textBaseline:L;if(!B&&"vertical"===x){var D=O;O=null!==(u=t.getBaselineMapAlign()[I])&&void 0!==u?u:"left",I=null!==(l=t.getAlignMapBaseline()[D])&&void 0!==l?l:"top"}var j=null!==(c=_a(t.attribute.lineHeight,S))&&void 0!==c?c:S,U=this.valid(t,d,o,s);if(U){var W=U.fVisible,N=U.sVisible,F=U.doFill,z=U.doStroke,G=!b,H=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,n,i,F,z,W,N,d,r,o,s),G&&this.transformUseContext2d(t,d,H,e);var V=function(r,a,u,l){var c=n+a,f=i+u;if(l){e.highPerformanceSave(),c+=S;var v=fh.allocate(1,0,0,1,0,0);v.rotateByCenter(Math.PI/2,c,f),e.transformFromMatrix(v,!0),fh.free(v)}z&&(s?s(e,t.attribute,d):N&&(e.setStrokeStyle(t,t.attribute,_-n,P-i,d),e.strokeText(r,c,f,H))),F&&(o?o(e,t.attribute,d):W&&(e.setCommonStyle(t,t.attribute,_-n,P-i,d),e.fillText(r,c,f,H),h.drawUnderLine(p,g,t,c,f,H,d,e))),l&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,d,H),"horizontal"===x){var Y=t.multilineLayout;if(!Y)return void e.highPerformanceRestore();var X=Y.bbox,K=X.xOffset,q=X.yOffset;z&&(s?s(e,t.attribute,d):N&&(e.setStrokeStyle(t,t.attribute,_-n,P-i,d),Y.lines.forEach((function(t){e.strokeText(t.str,(t.leftOffset||0)+K+n,(t.topOffset||0)+q+i,H)})))),F&&(o?o(e,t.attribute,d):W&&(e.setCommonStyle(t,t.attribute,_-n,P-i,d),Y.lines.forEach((function(r){e.fillText(r.str,(r.leftOffset||0)+K+n,(r.topOffset||0)+q+i,H),h.drawMultiUnderLine(p,g,t,(r.leftOffset||0)+K+n,(r.topOffset||0)+q+i-Iu("bottom",S)-.05*S,H,r.width,d,e)}))))}else{t.tryUpdateAABBBounds();var Z=t.cache.verticalList;e.textAlign="left",e.textBaseline="top";var J=j*Z.length,Q=0;Z.forEach((function(t){var e=t.reduce((function(t,e){return t+(e.width||0)}),0);Q=Ft(e,Q)}));var $=0,tt=0;"bottom"===I?tt=-J:"middle"===I&&(tt=-J/2),"center"===O?$-=Q/2:"right"===O&&($-=Q),Z.forEach((function(t,e){var n=t.reduce((function(t,e){return t+(e.width||0)}),0),i=Q-n,r=$;"center"===O?r+=i/2:"right"===O&&(r+=i),t.forEach((function(t){var n=t.text,i=t.width,a=t.direction;V(n,J-(e+1)*j+tt,r,a),r+=i}))}))}else if("horizontal"===x){e.setTextStyle(t.attribute,d,H);var et=t.clipedText,nt=0;j!==S&&("top"===I?nt=(j-S)/2:"middle"===I||"bottom"===I&&(nt=-(j-S)/2)),V(et,0,nt,0)}else{t.tryUpdateAABBBounds();var it=t.cache;if(it){e.setTextStyleWithoutAlignBaseline(t.attribute,d,H);var rt=it.verticalList,at=0,ot=rt[0].reduce((function(t,e){return t+(e.width||0)}),0),st=0;"bottom"===I?st=-j:"middle"===I&&(st=-j/2),"center"===O?at-=ot/2:"right"===O&&(at-=ot),e.textAlign="left",e.textBaseline="top",rt[0].forEach((function(t){var e=t.text,n=t.width,i=t.direction;V(e,st,at,i),at+=n}))}}G&&this.restoreTransformUseContext2d(t,d,H,e),this.afterRenderStep(t,e,n,i,F,z,W,N,d,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).text,a=t.attribute.keepDirIn3d,o=!(void 0===a?r.keepDirIn3d:a);this._draw(t,r,o,n,i)}},{key:"drawUnderLine",value:function(t,e,n,i,r,a,o,s){if(!(e+t<=0)){var u=n.attribute,l=u.textAlign,c=void 0===l?o.textAlign:l,h=u.textBaseline,d=void 0===h?o.textBaseline:h,f=u.fontSize,v=void 0===f?o.fontSize:f,p=u.fill,y=void 0===p?o.fill:p,g=u.opacity,m=void 0===g?o.opacity:g,b=u.underlineOffset,k=void 0===b?o.underlineOffset:b,x=u.underlineDash,w=void 0===x?o.underlineDash:x,A=u.fillOpacity,S=void 0===A?o.fillOpacity:A,T=n.clipedWidth,B=Du(c,T),C=ju(d,v,v),_={lineWidth:0,stroke:y,opacity:m,strokeOpacity:S};if(t){_.lineWidth=t,s.setStrokeStyle(n,_,i,r,o),w&&s.setLineDash(w),s.beginPath();var R=r+C+v+k;s.moveTo(i+B,R,a),s.lineTo(i+B+T,R,a),s.stroke()}if(e){_.lineWidth=e,s.setStrokeStyle(n,_,i,r,o),s.beginPath();var P=r+C+v/2;s.moveTo(i+B,P,a),s.lineTo(i+B+T,P,a),s.stroke()}}}},{key:"drawMultiUnderLine",value:function(t,e,n,i,r,a,o,s,u){if(!(e+t<=0)){var l=n.attribute,c=l.fontSize,h=void 0===c?s.fontSize:c,d=l.fill,f=void 0===d?s.fill:d,v=l.opacity,p=void 0===v?s.opacity:v,y=l.underlineOffset,g=void 0===y?s.underlineOffset:y,m=l.underlineDash,b=void 0===m?s.underlineDash:m,k=l.fillOpacity,x=void 0===k?s.fillOpacity:k,w=ju("alphabetic",h,h),A={lineWidth:0,stroke:f,opacity:p,strokeOpacity:x},S=-3;if(t){A.lineWidth=t,u.setStrokeStyle(n,A,i,r,s),b&&u.setLineDash(b),u.beginPath();var T=r+w+h+S+g;u.moveTo(i+0,T,a),u.lineTo(i+0+o,T,a),u.stroke()}if(S=-1,e){A.lineWidth=e,u.setStrokeStyle(n,A,i,r,s),u.beginPath();var B=r+w+h/2+S;u.moveTo(i+0,B,a),u.lineTo(i+0+o,B,a),u.stroke()}}}}])}(Ph),t.DefaultCanvasTextRender=Xd([I(),qd(0,O(Q)),qd(0,D(_u)),Kd("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var Zd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};function Jd(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function Qd(t,e){return Math.sqrt(t*t+e*e)}function $d(t,e,n,i,r){var a=e/n;return{x:t.x-i*a,y:t.y-r*a}}t.AbstractGraphicRender=u((function t(){o(this,t)})),t.AbstractGraphicRender=Zd([I()],t.AbstractGraphicRender);var tf=Fh,ef=Wh,nf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},rf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},af=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasPolygonRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).polygonRenderContribitions=t,i.numberType=Es,i.builtinContributions=[ef,tf],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=Lr(t,null==a?void 0:a.theme).polygon,l=t.attribute,c=l.points,h=void 0===c?u.points:c,d=l.cornerRadius,f=void 0===d?u.cornerRadius:d,v=l.x,p=void 0===v?u.x:v,y=l.y,g=void 0===y?u.y:y,m=l.closePath,b=void 0===m?u.closePath:m,k=this.valid(t,u,o,s);if(k){var x=k.fVisible,w=k.sVisible,A=k.doFill,S=k.doStroke;e.beginPath(),f<=0||xt(f)&&f.every((function(t){return 0===t}))?Jd(e.camera?e:e.nativeContext,h,n,i):function(t,e,n,i,r){var a,o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)Jd(t,e,n,i);else{var s=0,u=e.length-1;o||(s+=1,u-=1,t.moveTo(e[0].x+n,e[0].y+i));for(var l=s;l<=u;l++){var c=e[0===l?u:(l-1)%e.length],h=e[l%e.length],d=e[(l+1)%e.length],f=h.x-c.x,v=h.y-c.y,p=h.x-d.x,y=h.y-d.y,g=(Math.atan2(v,f)-Math.atan2(y,p))/2,m=Math.abs(Math.tan(g)),b=Array.isArray(r)?null!==(a=r[l%e.length])&&void 0!==a?a:0:r,k=b/m,x=Qd(f,v),w=Qd(p,y),A=Math.min(x,w);k>A&&(k=A,b=A*m);var S=$d(h,k,x,f,v),T=$d(h,k,w,p,y),B=2*h.x-S.x-T.x,C=2*h.y-S.y-T.y,_=Qd(B,C),R=$d(h,Qd(k,b),_,B,C),P=Math.atan2(S.y-R.y,S.x-R.x),M=Math.atan2(T.y-R.y,T.x-R.x),E=M-P;E<0&&(P=M,E=-E),E>Math.PI&&(E-=Math.PI),0===l?t.moveTo(S.x+n,S.y+i):t.lineTo(S.x+n,S.y+i),E&&t.arcTo(h.x+n,h.y+i,T.x+n,T.y+i,b),t.lineTo(T.x+n,T.y+i)}o||t.lineTo(e[u+1].x+n,e[u+1].y+i)}}(e.camera?e:e.nativeContext,h,n,i,f,b),b&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,A,S,x,w,u,r,o,s),A&&(o?o(e,t.attribute,u):x&&(e.setCommonStyle(t,t.attribute,p-n,g-i,u),e.fill())),S&&(s?s(e,t.attribute,u):w&&(e.setStrokeStyle(t,t.attribute,p-n,g-i,u),e.stroke())),this.afterRenderStep(t,e,n,i,A,S,x,w,u,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).polygon;this._draw(t,r,!1,n,i)}}])}(Ph),t.DefaultCanvasPolygonRender=nf([I(),af(0,O(Q)),af(0,D(Tu)),rf("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var of=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},sf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uf=function(t,e){return function(n,i){e(n,i,t)}},lf=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).imageRenderContribitions=t,i.numberType=Rs,i.builtinContributions=[ed],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o){var s=Lr(t).image,u=t.attribute,l=u.width,c=void 0===l?s.width:l,h=u.height,d=void 0===h?s.height:h,f=u.repeatX,v=void 0===f?s.repeatX:f,p=u.repeatY,y=void 0===p?s.repeatY:p,g=u.cornerRadius,m=void 0===g?s.cornerRadius:g,b=u.image,k=this.valid(t,s,o);if(k){var x=k.fVisible;k.sVisible;var w=k.doFill;if(k.doStroke,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s),this.beforeRenderStep(t,e,n,i,w,!1,x,!1,s,r,o),w)if(o)o(e,t.attribute,s);else if(x){if(!b||!t.resources)return;var A=t.resources.get(b);if("success"!==A.state)return;var S=!1;0===m||xt(m)&&m.every((function(t){return 0===t}))||(e.beginPath(),$h(e,n,i,c,d,m),e.save(),e.clip(),S=!0),e.setCommonStyle(t,t.attribute,n,i,s);var T=0;if("repeat"===v&&(T|=1),"repeat"===y&&(T|=2),T){var B=e.createPattern(A.data,lf[T]);e.fillStyle=B,e.translate(n,i,!0),e.fillRect(0,0,c,d),e.translate(-n,-i,!0)}else e.drawImage(A.data,n,i,c,d);S&&e.restore()}this.afterRenderStep(t,e,n,i,w,!1,x,!1,s,r,o)}}},{key:"draw",value:function(t,e,n){var i=t.attribute.image;if(i&&t.resources){var r=t.resources.get(i);if("loading"===r.state&&kt(i))Go.improveImageLoading(i);else if("success"===r.state)if(e.drawParams.context){var a=Lr(t).image;this._draw(t,a,!1,n)}}}}])}(Ph),t.DefaultCanvasImageRender=of([I(),uf(0,O(Q)),uf(0,D(Au)),sf("design:paramtypes",[Object])],t.DefaultCanvasImageRender);var cf=Symbol.for("IncrementalDrawContribution"),hf=Symbol.for("ArcRender"),df=Symbol.for("Arc3dRender"),ff=Symbol.for("AreaRender"),vf=Symbol.for("CircleRender"),pf=Symbol.for("GraphicRender"),yf=Symbol.for("GroupRender"),gf=Symbol.for("LineRender"),mf=Symbol.for("PathRender"),bf=Symbol.for("PolygonRender"),kf=Symbol.for("RectRender"),xf=Symbol.for("Rect3DRender"),wf=Symbol.for("SymbolRender"),Af=Symbol.for("TextRender"),Sf=Symbol.for("RichTextRender"),Tf=Symbol.for("Pyramid3dRender"),Bf=Symbol.for("GlyphRender"),Cf=Symbol.for("ImageRender"),_f=Symbol.for("RenderSelector"),Rf=Symbol.for("DrawContribution"),Pf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Mf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ef=Symbol.for("DrawItemInterceptor"),Of=new ee,Lf=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterDrawItem",value:function(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,n,i,r),!1}},{key:"beforeDrawItem",value:function(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,n,i,r),!1}},{key:"drawItem",value:function(t,e,n,i,r){if(!t.shadowRoot)return!1;var a=n.context;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){Of.copy(i.dirtyBounds);var o=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(o)}return i.renderGroup(t.shadowRoot,n,t.parent.globalTransMatrix),a.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&i.dirtyBounds.copy(Of),!0}}])}(),If=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterDrawItem",value:function(t,e,n,i,r){return t.attribute._debug_bounds&&this.drawItem(t,e,n,i,r),!1}},{key:"drawItem",value:function(t,e,n,i,r){if(!t.attribute._debug_bounds)return!1;var a=n.context;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);var o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(o.x1,o.y1,o.width(),o.height()),a.highPerformanceRestore(),!0}}])}();t.CommonDrawItemInterceptorContribution=function(){return u((function t(){o(this,t),this.order=1,this.interceptors=[new Lf,new jf,new Df,new If]}),[{key:"afterDrawItem",value:function(t,e,n,i,r){for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,n,i,r))return!0;return!1}},{key:"beforeDrawItem",value:function(t,e,n,i,r){if((!t.in3dMode||n.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,n,i,r))return!0;return!1}}])}(),t.CommonDrawItemInterceptorContribution=Pf([I(),Mf("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);var Df=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforeDrawItem",value:function(t,e,n,i,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,n,i,r):this.beforeSetInteractive(t,e,n,i,r))}},{key:"beforeSetInteractive",value:function(t,e,n,i,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}),n.stage.tryInitInteractiveLayer();var o=n.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).add(a),!0}if(a){n.stage.tryInitInteractiveLayer();var s=n.stage.getLayer("_builtin_interactive");s&&this.getShadowRoot(s).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}},{key:"beforeDrawInteractive",value:function(t,e,n,i,r){var a=t.baseGraphic;if(!a.stage){var o=n.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).removeChild(t),!0}if(a){this.processing=!0;var s=n.context;return s.highPerformanceSave(),s.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?i.renderGroup(a,n,a.parent.globalTransMatrix):i.renderItem(a,n),s.highPerformanceRestore(),this.processing=!1,!0}return!1}},{key:"getShadowRoot",value:function(t){var e,n=t.getElementById("_interactive_group");return n||((n=Ch.CreateGraphic("group",{})).id="_interactive_group",t.add(n)),null!==(e=n.shadowRoot)&&void 0!==e?e:n.attachShadow()}}])}(),jf=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforeDrawItem",value:function(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var a=e.drawParams,o=a.context,s=a.stage;o.canvas,o.save(),this.initCanvasCtx(o),o.camera=s.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 l=vh.allocate();xh(l,u);var c=o.modelMatrix;if(c){if(l){var h=vh.allocate();o.modelMatrix=wh(h,c,l)}}else o.modelMatrix=l;if(o.setTransform(1,0,0,1,0,0,!0),t.isContainer){var d=!1,f=!1;if(t.forEachChildren((function(t){return!(d=t.numberType===Ss)})),t.forEachChildren((function(t){return!(f=!!t.findFace)})),d){var v=t.getChildren(),p=g(v);p.sort((function(t,e){for(var n,i,r,a,o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i:0))/2,s=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(a=e.attribute.endAngle)&&void 0!==a?a:0))/2;o<0;)o+=jt;for(;s<0;)s+=jt;return s-o})),p.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),p.forEach((function(e){t.appendChild(e)}));var y=t.parent.globalTransMatrix;n.hack_pieFace="outside",i.renderGroup(t,n,y),n.hack_pieFace="inside",i.renderGroup(t,n,y),n.hack_pieFace="top",i.renderGroup(t,n,y),t.removeAllChild(),v.forEach((function(t){t._next=null,t._prev=null})),v.forEach((function(e){t.appendChild(e)}))}else if(f){var m=t.getChildren(),b=m.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return o.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));b.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),b.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),b.forEach((function(e){t.add(e.g)})),i.renderGroup(t,n,t.parent.globalTransMatrix,!0),t.removeAllChild(),m.forEach((function(t){t._next=null,t._prev=null})),t.update(),m.forEach((function(e){t.add(e)}))}else i.renderGroup(t,n,t.parent.globalTransMatrix)}else i.renderItem(t,n);return o.camera=null,o.restore(),o.modelMatrix!==c&&vh.free(o.modelMatrix),o.modelMatrix=c,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}])}(),Uf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Wf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nf=function(t,e){return function(n,i){e(n,i,t)}},Ff=Symbol.for("RenderService"),zf=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=function(){return u((function t(e){o(this,t),this.drawContribution=e}),[{key:"prepare",value:function(t){var e=this;t&&this.renderTreeRoots.forEach((function(n){e._prepare(n,t)}))}},{key:"_prepare",value:function(t,e){var n=this;t.forEachChildren((function(t){n._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 n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}}])}(),t.DefaultRenderService=Uf([I(),Nf(0,O(Rf)),Wf("design:paramtypes",[Object])],t.DefaultRenderService);var Gf=new w((function(e){e(Ff).to(t.DefaultRenderService)})),Hf=Symbol.for("GraphicPicker"),Vf=Symbol.for("PickerService"),Yf=Symbol.for("BoundsPicker"),Xf=Symbol.for("GlobalPickerService"),Kf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},qf=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterPickItem",value:function(t,e,n,i,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,n,i,r):null}},{key:"beforePickItem",value:function(t,e,n,i,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,n,i,r):null}},{key:"_pickItem",value:function(t,e,n,i,r){if(!t.shadowRoot)return null;var a=(r||{}).parentMatrix;if(!a)return null;var o=e.pickContext;o.highPerformanceSave();var s=t.shadowRoot,u=fh.allocateByObj(a),l=new Jt(u.a*n.x+u.c*n.y+u.e,u.b*n.x+u.d*n.y+u.f),c=e.pickGroup(s,l,u,i);return o.highPerformanceRestore(),c}}])}(),t.ShadowRootPickItemInterceptorContribution=Kf([I()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforePickItem",value:function(t,e,n,i,r){var a=t.baseGraphic;if(a&&a.parent){var o=new Jt(n.x,n.y),s=e.pickContext;s.highPerformanceSave();var u=a.parent.globalTransMatrix;u.transformPoint(o,o);var l=a.isContainer?e.pickGroup(a,o.clone(),u,i):e.pickItem(a,o.clone(),u,i);return s.highPerformanceRestore(),l}return null}}])}(),t.InteractivePickItemInterceptorContribution=Kf([I()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforePickItem",value:function(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;var a=e.pickContext,o=t.stage;if(!a||!o)return null;if(i.in3dInterceptor=!0,a.save(),this.initCanvasCtx(a),a.camera=o.camera,t.isContainer){var s,u=!1,l=!1;if(t.forEachChildren((function(t){return!(u=t.numberType===Ss)})),t.forEachChildren((function(t){return!(l=!!t.findFace)})),u){var c=t.getChildren(),h=g(c);h.sort((function(t,e){for(var n,i,r,a,o=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i:0)/2,s=(null!==(a=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==a?a:0)/2;o<0;)o+=jt;for(;s<0;)s+=jt;return s-o})),h.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),h.forEach((function(e){t.appendChild(e)})),i.hack_pieFace="outside",(s=e.pickGroup(t,n,r.parentMatrix,i)).graphic||(i.hack_pieFace="inside",s=e.pickGroup(t,n,r.parentMatrix,i)),s.graphic||(i.hack_pieFace="top",s=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),c.forEach((function(t){t._next=null,t._prev=null})),c.forEach((function(e){t.appendChild(e)}))}else if(l){var d=t.getChildren(),f=d.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return a.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));f.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),f.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),f.forEach((function(e){t.add(e.g)})),s=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),t.update(),d.forEach((function(e){t.add(e)}))}else s=e.pickGroup(t,n,r.parentMatrix,i);return a.camera=null,i.in3dInterceptor=!1,a.restore(),s}return a.restore(),null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}])}(),t.Canvas3DPickItemInterceptor=Kf([I()],t.Canvas3DPickItemInterceptor);var Zf=new w((function(e,n,i){i(Vf)||(e(Xf).toSelf(),e(Vf).toService(Xf)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(qf).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(qf).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(qf).toService(t.InteractivePickItemInterceptorContribution),et(e,qf)})),Jf=new w((function(e){e(Ws).to(t.DefaultGraphicService).inSingletonScope(),e(Ns).toConstantValue(Ch)})),Qf=Symbol.for("AutoEnablePlugins"),$f=Symbol.for("PluginService"),tv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ev=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nv=function(t,e){return function(n,i){e(n,i,t)}},iv=function(){return u((function t(e){o(this,t),this.autoEnablePlugins=e,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}),[{key:"active",value:function(t,e){var n=this;this.stage=t,this.actived=!0;var i=e.pluginList;i&&Ui.isBound(Qf)&&this.autoEnablePlugins.getContributions().forEach((function(t){i.includes(t.name)&&n.register(t)}))}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(n){n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((function(n){n.name===t&&e.push(n)})),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=[]}}])}();iv=tv([I(),nv(0,O(Q)),nv(0,D(Qf)),ev("design:paramtypes",[Object])],iv);var rv=new w((function(t){t($f).to(iv),nt(t,Qf)})),av=new w((function(t){et(t,at)})),ov=new w((function(e){e(ji).to(t.DefaultTextMeasureContribution).inSingletonScope(),et(e,ji)})),sv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},uv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lv=function(){return u((function t(){o(this,t),this.type="static",this.offscreen=!1,this.global=Si.global}),[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,n){if(this.layer=t,this.window=e,n.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var i;this.main=!1,n.canvasId&&(i=this.global.getElementById(n.canvasId)),i||(i=this.global.createCanvas({width:e.width,height:e.height})),i.style&&(i.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=Fi({nativeCanvas:i,width:e.width,height:e.height,dpr:e.dpr,id:n.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,n){var i;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!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var n=t.getContext().canvas.nativeCanvas;e.context.drawImage(n,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,n){var i,r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}])}();lv=sv([I(),uv("design:paramtypes",[])],lv);var cv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},hv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dv=function(){return u((function t(){o(this,t),this.offscreen=!1,this.type="virtual",this.global=Si.global}),[{key:"setDpr",value:function(t){}},{key:"init",value:function(t,e,n){if(this.layer=t,this.window=e,n.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,n){this.mainHandler.render(t,e,Object.assign(Object.assign({},n),{clear:!1}))}},{key:"merge",value:function(t){}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,n){var i,r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}},{key:"getContext",value:function(){return null}},{key:"release",value:function(){}}])}();dv=cv([I(),hv("design:paramtypes",[])],dv);var fv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},vv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pv=function(){return u((function t(){o(this,t),this.offscreen=!0,this.type="dynamic",this.global=Si.global}),[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,n){this.layer=t;var i=Fi({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.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 n;e.renderService.render(t,Object.assign(Object.assign({context:this.context,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform()},e),{clear:null!==(n=e.background)&&void 0!==n?n:"#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,n){var i=t.getContext(),r=t.dpr,a=n.viewBox,o=a.x1,s=a.y1,u=a.width(),l=a.height();i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(o,s,u,l),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,o,s,u,l),i.nativeContext.restore()}},{key:"merge",value:function(t){}}])}();pv=fv([I(),vv("design:paramtypes",[])],pv);var yv=new w((function(t){t(lv).toSelf(),t(pv).toSelf(),t(dv).toSelf(),t(Qs).toService(lv),t($s).toService(pv),t(tu).toService(dv)}));var gv=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};function mv(t,e,n){var i,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={},s=[],u=!1;a?u=!0:t.forEachChildren((function(t,n){var r=t.attribute.zIndex,a=void 0===r?e:r;if(0===n)i=a;else if(i!==a)return u=!0,!0;return!1}),r);if(u){t.forEachChildren((function(t){var n=t.attribute.zIndex,i=void 0===n?e:n;o[i]?o[i].push(t):(o[i]=[t],s.push(i))}),r),s.sort((function(t,e){return r?e-t:t-e}));for(var l=!1,c=0;c<s.length&&!l;c++){var h=s[c],d=o[h];a&&d.sort((function(t,e){var n,i;return(r?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(i=t.attribute.z)&&void 0!==i?i:0))}));for(var f=0;f<d.length;f++)if(n(d[f],f)){l=!0;break}}}else t.forEachChildren(n,r)}function bv(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return gv(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(n,r);case 2:case"end":return e.stop()}}),e)})))}function kv(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a=[],o=!1;t.forEachChildren((function(t,e){var i=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===i?n:i))return o=!0,!0;return!1}),i);var s=null,u=!1;if(o){t.forEachChildren((function(t){var e=t.attribute.zIndex,i=void 0===e?n:e;r[i]?r[i].push(t):(r[i]=[t],a.push(i))}),i),a.sort((function(t,e){return i?e-t:t-e}));for(var l=!1,c=0;c<a.length&&!l;c++)for(var h=a[c],d=r[h],f=0;f<d.length;f++){if(u){l=!0,s=d[f];break}d[f]._uid!==e||(u=!0)}}else t.forEachChildren((function(t){return u?(s=t,!0):(t._uid===e&&(u=!0),!1)}),i);return s}var xv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},wv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Av=function(t,e){return function(n,i){e(n,i,t)}},Sv=function(){return u((function t(e,n){o(this,t),this.contributions=e,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new te,this.backupDirtyBounds=new te,this.global=Si.global,this.layerService=Si.layerService,this.init()}),[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var n=t.styleRenderMap.get(e.style)||new Map;n.set(e.numberType,e),t.styleRenderMap.set(e.style,n)}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,e){var n=this;this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var i=e.context,r=e.stage,a=e.viewBox,o=e.transMatrix;if(i){var s,u,l,c,h,d,f,v=this.dirtyBounds.setValue(0,0,a.width(),a.height());if(r.dirtyBounds&&!r.dirtyBounds.empty()){var p=(s=v,u=r.dirtyBounds,l=!1,null===s?u:null===u?s:(pe=s.x1,ye=s.x2,ge=s.y1,me=s.y2,be=u.x1,ke=u.x2,xe=u.y1,we=u.y2,l&&(pe>ye&&(pe=(c=[ye,pe])[0],ye=c[1]),ge>me&&(ge=(h=[me,ge])[0],me=h[1]),be>ke&&(be=(d=[ke,be])[0],ke=d[1]),xe>we&&(xe=(f=[we,xe])[0],we=f[1])),pe>=ke||ye<=be||ge>=we||me<=xe?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(pe,be),y1:Math.max(ge,xe),x2:Math.min(ye,ke),y2:Math.min(me,we)}));v.x1=Math.floor(p.x1),v.y1=Math.floor(p.y1),v.x2=Math.ceil(p.x2),v.y2=Math.ceil(p.y2)}var y=i.dpr%1;(y||.5!==y)&&(v.x1=Math.floor(v.x1*i.dpr)/i.dpr,v.y1=Math.floor(v.y1*i.dpr)/i.dpr,v.x2=Math.ceil(v.x2*i.dpr)/i.dpr,v.y2=Math.ceil(v.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(v),i.inuse=!0,i.setClearMatrix(o.a,o.b,o.c,o.d,o.e,o.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(a.x1,a.y1,!0),i.beginPath(),i.rect(v.x1,v.y1,v.width(),v.height()),i.clip(),r.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:si.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:si.zIndex)})).forEach((function(t){t.isContainer?n.renderGroup(t,e,fh.allocate(1,0,0,1,0,0)):n.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,n=t._uid;e;){var i=kv(e,n,si.zIndex);if(i)return i;n=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,e,n,i){var r=this;if(!e.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!this.useDirtyBounds||_e(t.AABBBounds,this.dirtyBounds,!1)){var a,o=n;if(this.useDirtyBounds){a=Hd.allocateByObj(this.dirtyBounds);var s=t.transMatrix;o=fh.allocateByObj(n).multiply(s.a,s.b,s.c,s.d,s.e,s.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o.getInverse())}this.renderItem(t,e,{drawingCb:function(){var n;i?t.forEachChildren((function(t){e.break||(t.isContainer?r.renderGroup(t,e,o):r.renderItem(t,e))})):mv(t,si.zIndex,(function(t){e.break||(t.isContainer?r.renderGroup(t,e,o):r.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(a),Hd.free(a),fh.free(o))}}}},{key:"_increaseRender",value:function(t,e){var n=e.layer,i=e.stage,r=n.subLayers,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,a));var o=a.layer.getNativeHandler().getContext(),s=a.drawContribution||Ui.get(cf);s.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:a.layer,context:o,startAtId:t._uid,break:!1})),a.drawContribution=s;var u=this._findNextGraphic(t);if(u)if(u.isContainer&&u.incremental)this._increaseRender(u,e);else{var l=r.get(u._uid);l||(l={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(u._uid,l));var c=l.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:l.layer,context:c,startAtId:u._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,e,n){if(this.InterceptorContributions.length)for(var i=0;i<this.InterceptorContributions.length;i++){var r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}var a=this.getRenderContribution(t);if(a){var o,s=!1;if(t.parent){var u=t.parent.attribute,l=u.scrollX,c=void 0===l?0:l,h=u.scrollY,d=void 0===h?0:h;if(s=!(!c&&!d)){o=this.dirtyBounds.clone();var f=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(f),this.dirtyBounds.translate(-c,-d)}}if(!this.useDirtyBounds||t.isContainer||_e(t.AABBBounds,this.dirtyBounds,!1)){var v=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=v),v?t.isContainer&&a.draw(t,this.currentRenderService,e,n):a.draw(t,this.currentRenderService,e,n),s&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(var p=0;p<this.InterceptorContributions.length;p++){var y=this.InterceptorContributions[p];if(y.afterDrawItem&&y.afterDrawItem(t,this.currentRenderService,e,this))return}}else s&&this.dirtyBounds.copy(o)}}},{key:"selectRenderByType",value:function(t){return Le.getInstance().warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t,e){var n;if(e.attribute.renderStyle){var i=this.styleRenderMap.get(e.attribute.renderStyle);n=i&&i.get(t)}return n||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,n){var i,r,a=n.clear,o=n.viewBox,s=o.width(),u=o.height();if(a){e.clearRect(0,0,s,u);var l=null===(i=t.drawParams)||void 0===i?void 0:i.stage;if(l&&(e.globalAlpha=null!==(r=l.attribute.opacity)&&void 0!==r?r:1),l&&l.backgroundImg&&l.resources){var c=l.resources.get(a);c&&"success"===c.state&&c.data&&e.drawImage(c.data,0,0,s,u)}else e.fillStyle=Lh(e,a,{AABBBounds:{x1:0,y1:0,x2:0+s,y2:0+u}},0,0),e.fillRect(0,0,s,u)}}},{key:"afterDraw",value:function(t,e){}}])}();Sv=xv([I(),Av(0,L(pf)),Av(1,O(Q)),Av(1,D(Ef)),wv("design:paramtypes",[Array,Object])],Sv);var Tv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Bv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cv=function(t,e){return function(n,i){e(n,i,t)}},_v=function(){return u((function t(e){o(this,t),this.groupRenderContribitions=e,this.numberType=_s}),[{key:"drawShape",value:function(e,n,i,r,a,o,s,u){var l=Lr(e,null==o?void 0:o.theme).group,c=e.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.background,v=c.stroke,p=void 0===v?l.stroke:v,y=c.opacity,g=void 0===y?l.opacity:y,m=c.width,b=void 0===m?l.width:m,k=c.height,x=void 0===k?l.height:k,w=c.clip,A=void 0===w?l.clip:w,S=c.fillOpacity,T=void 0===S?l.fillOpacity:S,B=c.strokeOpacity,C=void 0===B?l.strokeOpacity:B,_=c.cornerRadius,R=void 0===_?l.cornerRadius:_,P=c.path,M=void 0===P?l.path:P,E=c.lineWidth,O=void 0===E?l.lineWidth:E,L=c.visible,I=void 0===L?l.visible:L,D=su(g,T,b,x,d),j=lu(g,C,b,x),U=ru(d,f),W=au(p,O);if(e.valid&&I){if(!A){if(!U&&!W)return;if(!(D||j||s||u||f))return}if(M&&M.length&&a.drawContribution){var N=n.disableFill,F=n.disableStroke,z=n.disableBeginPath;n.disableFill=!0,n.disableStroke=!0,n.disableBeginPath=!0,M.forEach((function(t){a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,o)})),n.disableFill=N,n.disableStroke=F,n.disableBeginPath=z}else 0===R||xt(R)&&R.every((function(t){return 0===t}))?(n.beginPath(),n.rect(i,r,b,x)):(n.beginPath(),$h(n,i,r,b,x,R));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Jh));var G={doFill:U,doStroke:W};this._groupRenderContribitions.forEach((function(o){o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,n,i,r,U,W,D,j,l,a,s,u,G)})),A&&n.clip(),n.setShadowBlendStyle&&n.setShadowBlendStyle(e,e.attribute,l),G.doFill&&(s?s(n,e.attribute,l):D&&(n.setCommonStyle(e,e.attribute,i,r,l),n.fill())),G.doStroke&&(u?u(n,e.attribute,l):j&&(n.setStrokeStyle(e,e.attribute,i,r,l),n.stroke())),this._groupRenderContribitions.forEach((function(o){o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,n,i,r,U,W,D,j,l,a,s,u)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=t.attribute,o=a.clip,s=a.baseOpacity,u=void 0===s?1:s;o?r.save():r.highPerformanceSave(),r.baseGlobalAlpha*=u;var l=Lr(t,null==i?void 0:i.theme).group,c=r.modelMatrix;if(r.camera){var h=vh.allocate(),d=vh.allocate();Ah(d,t,l),wh(h,c||h,d),r.modelMatrix=h,vh.free(d),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,n);var f,v=t.attribute,p=v.scrollX,y=void 0===p?l.scrollX:p,g=v.scrollY,m=void 0===g?l.scrollY:g;(y||m)&&r.translate(y,m),i&&i.drawingCb&&(f=i.drawingCb()),r.modelMatrix!==c&&vh.free(r.modelMatrix),r.modelMatrix=c,r.baseGlobalAlpha/=u,f&&f.then?f.then((function(){o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}}}])}();_v=Tv([I(),Cv(0,O(Q)),Cv(0,D(wu)),Bv("design:paramtypes",[Object])],_v);var Rv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Pv=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).numberType=Ps,t}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,i,r,a,o,s,u){if(t.incremental&&a.multiGraphicOptions){var l=a.multiGraphicOptions,c=l.startAtIdx,d=l.length,f=t.attribute.segments,v=void 0===f?[]:f;if(c>v.length)return;var y=Lr(t).line,g=t.attribute,m=g.fill,b=void 0===m?y.fill:m,k=g.stroke,x=void 0===k?y.stroke:k,w=g.opacity,A=void 0===w?y.opacity:w,S=g.fillOpacity,T=void 0===S?y.fillOpacity:S,B=g.strokeOpacity,C=void 0===B?y.strokeOpacity:B,_=g.lineWidth,R=void 0===_?y.lineWidth:_,P=g.visible,M=void 0===P?y.visible:P,E=ou(A,T,b),O=uu(A,C),L=ru(b),I=au(x,R);if(!t.valid||!M)return;if(!L&&!I)return;if(!(E||O||s||u))return;for(var D=a.context,j=c;j<c+d;j++)this.drawIncreaseSegment(t,D,v[j-1],v[j],t.attribute.segments[j],[y,t.attribute],i,r)}else p(h(n.prototype),"drawShape",this).call(this,t,e,i,r,a,o,s,u)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,a,o,s){i&&(e.beginPath(),kd(e.nativeContext,n,i,{offsetX:o,offsetY:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,o,s,a),e.stroke())}}])}(t.DefaultCanvasLineRender);Pv=Rv([I()],Pv);var Mv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ev=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).numberType=Ts,t}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,i,r,a,o,s){if(t.incremental&&a.multiGraphicOptions){var u=a.multiGraphicOptions,l=u.startAtIdx,c=u.length,d=t.attribute.segments,f=void 0===d?[]:d;if(l>f.length)return;var v=Lr(t).area,y=t.attribute,g=y.fill,m=void 0===g?v.fill:g,b=y.fillOpacity,k=void 0===b?v.fillOpacity:b,x=y.opacity,w=void 0===x?v.opacity:x,A=y.visible,S=void 0===A?v.visible:A,T=ou(w,k,m),B=ru(m);if(!t.valid||!S)return;if(!B)return;if(!T&&!s)return;for(var C=l;C<l+c;C++)this.drawIncreaseSegment(t,e,f[C-1],f[C],t.attribute.segments[C],[v,t.attribute],i,r)}else p(h(n.prototype),"drawShape",this).call(this,t,e,i,r,a,o,s)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,a,o,s){i&&(e.beginPath(),xd(e.camera?e:e.nativeContext,n,i,{offsetX:o,offsetY:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,o,s,a),e.fill())}}])}(t.DefaultCanvasAreaRender);Ev=Mv([I()],Ev);var Ov,Lv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Iv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dv=function(t,e){return function(n,i){e(n,i,t)}},jv=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Ov||(Ov={}));var Uv=function(t){function n(t,i,r,a){var s;return o(this,n),(s=e(this,n,[t,a])).contributions=t,s.lineRender=i,s.areaRender=r,s.drawItemInterceptorContributions=a,s.rendering=!1,s.currFrameStartAt=0,s.currentIdx=0,s.status=Ov.NORMAL,s.checkingForDrawPromise=null,s.hooks={completeDraw:new rt([])},s.defaultRenderMap.set(s.lineRender.numberType,s.lineRender),s.defaultRenderMap.set(s.areaRender.numberType,s.areaRender),s}return c(n,t),u(n,[{key:"draw",value:function(t,e){return jv(this,void 0,void 0,i().mark((function n(){var r,a,o,s=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.checkingForDrawPromise){n.next=2;break}return n.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),n.next=5,this.checkingForDrawPromise;case 5:if(r=n.sent,this.checkingForDrawPromise=null,!r){n.next=8;break}return n.abrupt("return");case 8:this.currentRenderService=t,a=e.context,o=e.viewBox,a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,a,e),a.translate(o.x1,o.y1,!0),a.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:si.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:si.zIndex)})).forEach((function(t){s.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){a.restore(),a.restore(),a.draw(),a.inuse=!1,s.rendering=!1})));case 11:case"end":return n.stop()}}),n,this)})))}},{key:"_increaseRender",value:function(t,e){return jv(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.rendering=!0,n.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return jv(this,void 0,void 0,i().mark((function n(){var r=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.count=t.count,n.next=3,new Promise((function(n){r.renderItem(t,e,{drawingCb:function(){return jv(r,void 0,void 0,i().mark((function r(){var a,o=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(2===t.count){i.next=6;break}return i.next=3,bv(t,si.zIndex,(function(n,i){if(o.status===Ov.STOP)return!0;if(n.isContainer)return!1;if(i<o.currentIdx)return!1;var r=o.currFrameStartAt+t.incremental;return i<r&&(o.currentIdx=i+1,o.renderItem(n,e)),i===r-1&&(o.currFrameStartAt=o.currentIdx,o.waitToNextFrame())}));case 3:n(!1),i.next=21;break;case 6:if(!(a=t.getChildAt(0)).incremental||!a.attribute.segments){i.next=19;break}a.incrementalAt||(a.incrementalAt=0);case 9:if(!(a.incrementalAt<a.attribute.segments.length)){i.next=17;break}return e.multiGraphicOptions={startAtIdx:a.incrementalAt,length:a.incremental},this.renderItem(a,e),a.incrementalAt+=a.incremental,i.next=15,this.waitToNextFrame();case 15:i.next=9;break;case 17:i.next=20;break;case 19:this.renderItem(a,e);case 20:n(!1);case 21:case"end":return i.stop()}}),r,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return n.stop()}}),n,this)})))}},{key:"waitToNextFrame",value:function(){return jv(this,void 0,void 0,i().mark((function t(){var e=this;return i().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 jv(this,void 0,void 0,i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return n=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return jv(this,void 0,void 0,i().mark((function t(){var e=this;return i().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=Ov.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=Ov.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 jv(this,void 0,void 0,i().mark((function n(){var r=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.break||!1===t.attribute.visibleAll){n.next=11;break}if(!t.incremental||e.startAtId!==t._uid){n.next=7;break}return n.next=4,this._increaseRender(t,e);case 4:n.t0=void(e.break=!0),n.next=10;break;case 7:return n.next=9,new Promise((function(n){r.renderItem(t,e,{drawingCb:function(){return jv(r,void 0,void 0,i().mark((function r(){var a=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,bv(t,si.zIndex,(function(t){return jv(a,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=e.break,n.t0){n.next=6;break}if(n.t1=t.isContainer,!n.t1){n.next=6;break}return n.next=6,this.renderGroup(t,e);case 6:case"end":return n.stop()}}),n,this)})))}));case 2:n(!1);case 3:case"end":return r.stop()}}),r)})))}})}));case 9:n.t0=void n.sent;case 10:return n.abrupt("return",n.t0);case 11:case"end":return n.stop()}}),n,this)})))}}])}(Sv);Uv=Lv([I(),Dv(0,L(pf)),Dv(1,O(Pv)),Dv(2,O(Ev)),Dv(3,O(Q)),Dv(3,D(Ef)),Iv("design:paramtypes",[Array,Object,Object,Object])],Uv);var Wv=new w((function(e){e(Uh).toSelf().inSingletonScope(),e(Nh).toSelf().inSingletonScope(),e(Rf).to(Sv),e(cf).to(Uv),e(yf).to(_v).inSingletonScope(),e(pf).toService(yf),et(e,wu),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),et(e,Pu),et(e,pf),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Ef).toService(t.CommonDrawItemInterceptorContribution),et(e,Ef)}));function Nv(){Nv.__loaded||(Nv.__loaded=!0,Ui.load(iu),Ui.load(Jf),Ui.load(Gf),Ui.load(Zf),Ui.load(rv),function(t){t.load(av),t.load(ov),t.load(yv)}(Ui),function(t){t.load(Wv)}(Ui))}Nv.__loaded=!1,Nv();var Fv=Ui.get(ot);Si.global=Fv;var zv=Ui.get(Zs);Si.graphicUtil=zv;var Gv=Ui.get(qs);Si.transformUtil=Gv;var Hv=Ui.get(Ws);Si.graphicService=Hv;var Vv=Ui.get(Js);Si.layerService=Vv;var Yv=function(){return u((function t(){o(this,t),this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=x.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){this.pluginService=t,Si.graphicService.hooks.onAttributeUpdate.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),Si.graphicService.hooks.onSetStage.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}},{key:"deactivate",value:function(t){var e=this;Si.graphicService.hooks.onAttributeUpdate.taps=Si.graphicService.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.onSetStage.taps=Si.graphicService.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}])}(),Xv=function(){return u((function t(){var e=this;o(this,t),this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=x.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!0,e.pageX=t.page.x,e.pageY=t.page.y)},this.onMouseUp=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!1)},this.onMouseMove=function(t){var n,i,r=e.pluginService.stage;if(e.option3d||(e.option3d=r.option3d),e.option3d&&e.mousedown)if(e.pageX&&e.pageY){var a=t.page.x-e.pageX,o=t.page.y-e.pageY;e.pageX=t.page.x,e.pageY=t.page.y;var s=a/100,u=o/100;e.option3d.alpha=(null!==(n=e.option3d.alpha)&&void 0!==n?n:0)+s,e.option3d.beta=(null!==(i=e.option3d.beta)&&void 0!==i?i:0)+u,r.set3dOptions(e.option3d),r.renderNextFrame()}else e.pageX=t.page.x,e.pageY=t.page.y}}),[{key:"activate",value:function(t){this.pluginService=t;var e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}},{key:"deactivate",value:function(t){var e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}])}(),Kv=function(){return u((function t(){o(this,t),this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=x.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,Si.graphicService.hooks.onAddIncremental.tap(this.key,(function(n,i,r){n.glyphHost&&(n=n.glyphHost),n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=i._uid,e.renderNextFrame(i))})),Si.graphicService.hooks.onClearIncremental.tap(this.key,(function(n,i){n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=n._uid,e.nextUserParams.restartIncremental=!0,e.renderNextFrame(n))}))}},{key:"deactivate",value:function(t){var e=this;Si.graphicService.hooks.onAddIncremental.taps=Si.graphicService.hooks.onAddIncremental.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.onClearIncremental.taps=Si.graphicService.hooks.onClearIncremental.taps.filter((function(t){return t.name!==e.key}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Si.global.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this,e=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((function(n){var i=n.layer;if(i&&n.layer.subLayers){var r=n.layer.subLayers.get(n._uid);r&&r.drawContribution&&r.drawContribution.draw(e.renderService,Object.assign({stage:e,layer:i,viewBox:e.window.getViewBox(),transMatrix:e.window.getViewBoxTransform(),clear:"transparent",renderService:e.renderService,updateBounds:!1,startAtId:n._uid,context:r.layer.getNativeHandler().getContext()},t.nextUserParams))}})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}])}(),qv=function(){return u((function t(){o(this,t),this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=x.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(n){n&&n===e.pluginService.stage&&e.drawHTML(t.stage.renderService)}))}},{key:"deactivate",value:function(t){var e=this;t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.onRemove.unTap(this.key),Si.graphicService.hooks.onRelease.unTap(this.key),this.release()}},{key:"getWrapContainer",value:function(t,e,n){var i;return i=e?"string"==typeof e?Si.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Si.global.createDom(Object.assign({tagName:"div",parent:i},n)),nativeContainer:i}}},{key:"parseDefaultStyleFromGraphic",value:function(t){return Uu("text"===t.type&&t.attribute?t.attribute:Lr(t).text)}},{key:"getTransformOfText",value:function(t){var e=Lr(t).text,n=t.attribute,i=n.textAlign,r=void 0===i?e.textAlign:i,a=n.textBaseline,o=void 0===a?e.textBaseline:a,s=t.globalTransMatrix.toTransformAttrs(),u=s.rotateDeg,l=s.scaleX,c=s.scaleY,h={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},d={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:r,transform:"translate(".concat(h[r],",").concat(h[o],") rotate(").concat(u,"deg) scaleX(").concat(l,") scaleY(").concat(c,")"),transformOrigin:"".concat(d[r]," ").concat(d[o])}}},{key:"updateStyleOfWrapContainer",value:function(t,e,n,i,r){var a=r.pointerEvents,o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===a?"all":a||"none",n.style.position||(n.style.position="absolute",i.style.position="relative");var s=0,u=0,l=t.globalAABBBounds,c=r.anchorType;if(yt(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||l.empty()){var h=t.globalTransMatrix;s=h.e,u=h.f}else{var d=function(t,e){var n=t.x1,i=t.x2,r=t.y1,a=t.y2,o=Math.abs(i-n),s=Math.abs(a-r),u=(n+i)/2,l=(r+a)/2,c=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,h=-.5;break;case"top-left":c=-.5,h=-.5;break;case"bottom-right":c=.5,h=.5;break;case"bottom-left":c=-.5,h=.5}return{x:u+=c*o,y:l+=h*s}}(l,c);s=d.x,u=d.y}var f=Si.global.getElementTopLeft(i,!1),v=e.window.getTopLeft(!1),p=s+v.left-f.left,y=u+v.top-f.top;if(o.left="".concat(p,"px"),o.top="".concat(y,"px"),"text"===t.type&&"position"===c&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),pt(r.style)){var g=r.style({top:y,left:p,width:l.width(),height:l.height()},t,n);g&&(o=Object.assign(Object.assign({},o),g))}else mt(r.style)?o=Object.assign(Object.assign({},o),r.style):kt(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){var t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((function(e){if(e){var n=e.split(":");if(2===n.length){var i=n[0].trim(),r=n[1].trim();i&&r&&(t[i]=r)}}})),t}(r.style)));Si.global.updateDom(n,{width:r.width,height:r.width,style:o})}},{key:"clearCacheContainer",value:function(){var t=this;this.htmlMap&&Object.keys(this.htmlMap).forEach((function(e){t.htmlMap[e]&&t.htmlMap[e].renderId!==t.renderId&&t.removeElement(e)})),this.renderId+=1}},{key:"drawHTML",value:function(t){var e=this;"browser"===Si.global.env&&(t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:si.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:si.zIndex)})).forEach((function(t){e.renderGroupHTML(t)})),this.clearCacheContainer())}},{key:"renderGroupHTML",value:function(t){var e=this;this.renderGraphicHTML(t),t.forEachChildren((function(t){t.isContainer?e.renderGroupHTML(t):e.renderGraphicHTML(t)}))}},{key:"removeElement",value:function(t){if(this.htmlMap&&this.htmlMap[t]){var e=this.htmlMap[t].wrapContainer;e&&Si.global.removeDom(e),this.htmlMap[t]=null}}},{key:"renderGraphicHTML",value:function(t){var e,n=t.attribute.html;if(n){var i=t.stage;if(i){var r=n.dom,a=n.container;if(r){var o=yt(n.id)?"".concat(null!==(e=t.id)&&void 0!==e?e:t._uid,"_react"):n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])"string"==typeof r?this.htmlMap[o].wrapContainer.innerHTML=r:r!==this.htmlMap[o].wrapContainer.firstChild&&(this.htmlMap[o].wrapContainer.removeChild(this.htmlMap[o].wrapContainer.firstChild),this.htmlMap[o].wrapContainer.appendChild(r));else{var s=this.getWrapContainer(i,a),u=s.wrapContainer,l=s.nativeContainer;u&&("string"==typeof r?u.innerHTML=r:u.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[o]={wrapContainer:u,nativeContainer:l,container:a,renderId:this.renderId})}if(this.htmlMap&&this.htmlMap[o]){var c=this.htmlMap[o],h=c.wrapContainer,d=c.nativeContainer;this.updateStyleOfWrapContainer(t,i,h,d,n),this.htmlMap[o].renderId=this.renderId}}}}}},{key:"release",value:function(){"browser"===Si.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}},{key:"removeAllDom",value:function(t){var e=this;this.htmlMap&&(Object.keys(this.htmlMap).forEach((function(t){e.removeElement(t)})),this.htmlMap=null)}}])}(),Zv=new ee,Jv=function(){return u((function t(){o(this,t),this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=x.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(t){t&&t===e.pluginService.stage&&t.dirtyBounds.clear()})),Si.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,n,i,r){t.glyphHost&&(t=t.glyphHost),n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Zv.setValue(r.x1,r.y1,r.x2,r.y2),n.dirty(Zv,t.parent&&t.parent.globalTransMatrix)))})),Si.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,n,i,r,a){n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!a||n.dirty(r.globalAABBBounds))})),Si.graphicService.hooks.onRemove.tap(this.key,(function(t){var n=t.stage;n&&n===e.pluginService.stage&&n.renderCount&&n&&n.dirty(t.globalAABBBounds)}))}},{key:"deactivate",value:function(t){var e=this;Si.graphicService.hooks.beforeUpdateAABBBounds.taps=Si.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.afterUpdateAABBBounds.taps=Si.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.onRemove.taps=Si.graphicService.hooks.onRemove.taps.filter((function(t){return t.name!==e.key}))}}])}(),Qv=new ee,$v=function(){return u((function t(){o(this,t),this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=x.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new ee}),[{key:"pauseLayout",value:function(t){this.pause=t}},{key:"tryLayoutChildren",value:function(t){t.firstChild&&this.tryLayout(t.firstChild)}},{key:"tryLayout",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.pause){var i=t.parent;if(n||i&&t.needUpdateLayout()){var r=Lr(i).group,a=i.attribute.display;if("flex"===(void 0===a?r.display:a)){var o=i.attribute,s=o.flexDirection,u=void 0===s?r.flexDirection:s,l=o.flexWrap,c=void 0===l?r.flexWrap:l,h=o.alignItems,d=void 0===h?r.alignItems:h,f=o.clip,v=void 0===f?r.clip:f,p=i.attribute.alignContent,y=void 0===p?null!=d?d:r.alignContent:p,g=i.attribute,m=g.width,b=g.height,k=g.justifyContent,x=void 0===k?r.justifyContent:k,w=i.getChildren();if(null==m||null==b){var A=0,S=0,T=0;if(w.forEach((function(t){var n=e.getAABBBounds(t);n.empty()||("column"===u||"column-reverse"===u?(S+=n.height(),A=Math.max(A,n.width())):(A+=n.width(),S=Math.max(S,n.height())),T+=n.x1,T+=n.y1,T+=n.x2,T+=n.y2)})),!isFinite(T))return;m=A,b=S}null==i.attribute.width?i.attribute.width=m:m=i.attribute.width,null==i.attribute.height?i.attribute.height=b:b=i.attribute.height,this.tempBounds.copy(i._AABBBounds);var B={main:{len:m,field:"x"},cross:{len:b,field:"y"}},C=B.main,_=B.cross;"column"!==u&&"column-reverse"!==u||(C.len=b,_.len=m,C.field="y",_.field="x"),"row-reverse"!==u&&"column-reverse"!==u||("flex-start"===x?x="flex-end":"flex-end"===x?x="flex-start":w.reverse());var R=0,P=0,M=[];w.forEach((function(t){var n=e.getAABBBounds(t);if(!n.empty()){var i="x"===C.field?n.width():n.height(),r="x"===_.field?n.width():n.height();M.push({mainLen:i,crossLen:r}),R+=i,P=Math.max(P,r)}}));var E=[];if(R>C.len&&"wrap"===c){var O=0,L=0;M.forEach((function(t,e){var n=t.mainLen,i=t.crossLen;O+n>C.len?0===O?(E.push({idx:e,mainLen:O+n,crossLen:i}),O=0,L=0):(E.push({idx:e-1,mainLen:O,crossLen:L}),O=n,L=i):(O+=n,L=Math.max(L,i))})),E.push({idx:M.length-1,mainLen:O,crossLen:L})}else E.push({idx:M.length-1,mainLen:R,crossLen:P});var I=0;if(E.forEach((function(t){e.layoutMain(i,w,x,C,M,I,t),I=t.idx+1})),P=E.reduce((function(t,e){return t+e.crossLen}),0),1===E.length){var D={"flex-start":0,"flex-end":_.len,center:_.len/2};this.layoutCross(w,d,_,D,M,E[0],0)}else if("flex-start"===y){I=0;var j=0;E.forEach((function(t,n){var i={"flex-start":j,"flex-end":j+t.crossLen,center:j+t.crossLen/2};e.layoutCross(w,"flex-start",_,i,M,E[n],I),I=t.idx+1,j+=t.crossLen}))}else if("center"===y){I=0;var U=Math.max(0,(_.len-P)/2);E.forEach((function(t,n){var i={"flex-start":U,"flex-end":U+t.crossLen,center:U+t.crossLen/2};e.layoutCross(w,"center",_,i,M,E[n],I),I=t.idx+1,U+=t.crossLen}))}else if("space-around"===y){I=0;var W=Math.max(0,(_.len-P)/E.length/2),N=W;E.forEach((function(t,n){var i={"flex-start":N,"flex-end":N+t.crossLen,center:N+t.crossLen/2};e.layoutCross(w,"flex-start",_,i,M,E[n],I),I=t.idx+1,N+=t.crossLen+2*W}))}else if("space-between"===y){I=0;var F=Math.max(0,(_.len-P)/(2*E.length-2)),z=0;E.forEach((function(t,n){var i={"flex-start":z,"flex-end":z+t.crossLen,center:z+t.crossLen/2};e.layoutCross(w,"flex-start",_,i,M,E[n],I),I=t.idx+1,z+=t.crossLen+2*F}))}w.forEach((function(t,e){t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();var G=this.getAABBBounds(i);v||this.tempBounds.equals(G)||this.tryLayout(i,!1)}}}}},{key:"getAABBBounds",value:function(t){this.skipBoundsTrigger=!0;var e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}},{key:"updateChildPos",value:function(t,e,n){return t+(null!=e?e:0)-n}},{key:"layoutMain",value:function(t,e,n,i,r,a,o){if("flex-start"===n)for(var s=0,u=a;u<=o.idx;u++){var l=s+(e[u],i.field,0),c=this.getAABBBounds(e[u]);!c.empty()&&(e[u].attribute[i.field]=this.updateChildPos(l,e[u].attribute[i.field],c["".concat(i.field,"1")])),s+=r[u].mainLen}else if("flex-end"===n)for(var h=i.len,d=o.idx;d>=a;d--){var f=(h-=r[d].mainLen)+(e[d],i.field,0),v=this.getAABBBounds(e[d]);!v.empty()&&(e[d].attribute[i.field]=this.updateChildPos(f,e[d].attribute[i.field],v["".concat(i.field,"1")]))}else if("space-around"===n)if(o.mainLen>=i.len)for(var p=0,y=a;y<=o.idx;y++){var g=p+(e[y],i.field,0),m=this.getAABBBounds(e[y]);!m.empty()&&(e[y].attribute[i.field]=this.updateChildPos(g,e[y].attribute[i.field],m["".concat(i.field,"1")])),p+=r[y].mainLen}else for(var b=o.idx-a+1,k=(i.len-o.mainLen)/b/2,x=k,w=a;w<=o.idx;w++){var A=x+(e[w],i.field,0),S=this.getAABBBounds(e[w]);!S.empty()&&(e[w].attribute[i.field]=this.updateChildPos(A,e[w].attribute[i.field],S["".concat(i.field,"1")])),x+=r[w].mainLen+2*k}else if("space-between"===n)if(o.mainLen>=i.len)for(var T=0,B=a;B<=o.idx;B++){var C=T+(e[B],i.field,0),_=this.getAABBBounds(e[B]);!_.empty()&&(e[B].attribute[i.field]=this.updateChildPos(C,e[B].attribute[i.field],_["".concat(i.field,"1")])),T+=r[B].mainLen}else for(var R=o.idx-a+1,P=(i.len-o.mainLen)/(2*R-2),M=0,E=a;E<=o.idx;E++){var O=M+(e[E],i.field,0),L=this.getAABBBounds(e[E]);!L.empty()&&(e[E].attribute[i.field]=this.updateChildPos(O,e[E].attribute[i.field],L["".concat(i.field,"1")])),M+=r[E].mainLen+2*P}else if("center"===n)for(var I=(i.len-o.mainLen)/2,D=a;D<=o.idx;D++){var j=I+(e[D],i.field,0),U=this.getAABBBounds(e[D]);!U.empty()&&(e[D].attribute[i.field]=this.updateChildPos(j,e[D].attribute[i.field],U["".concat(i.field,"1")])),I+=r[D].mainLen}}},{key:"layoutCross",value:function(t,e,n,i,r,a,o){for(var s,u=o;u<=a.idx;u++){var l=t[u],c=l.attribute.alignSelf;c&&"auto"!==c||(c=e);var h=this.getAABBBounds(l),d=null!==(s=i[c])&&void 0!==s?s:i["flex-start"];"flex-end"===c?!h.empty()&&(l.attribute[n.field]=this.updateChildPos(d-r[u].crossLen+(n.field,0),l.attribute[n.field],h["".concat(n.field,"1")])):"center"===c?!h.empty()&&(l.attribute[n.field]=this.updateChildPos(d-r[u].crossLen/2+(n.field,0),l.attribute[n.field],h["".concat(n.field,"1")])):!h.empty()&&(l.attribute[n.field]=this.updateChildPos(d+(n.field,0),l.attribute[n.field],h["".concat(n.field,"1")]))}}},{key:"activate",value:function(t){var e=this;this.pluginService=t,Si.graphicService.hooks.onAttributeUpdate.tap(this.key,(function(t){t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===e.pluginService.stage&&e.tryLayout(t,!1)})),Si.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,n,i,r){t.glyphHost&&(t=t.glyphHost),n&&n===e.pluginService.stage&&t.isContainer&&!e.skipBoundsTrigger&&Qv.copy(r)})),Si.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,n,i,r,a){n&&n===e.pluginService.stage&&t.isContainer&&!e.skipBoundsTrigger&&(Qv.equals(i)||e.tryLayout(t,!1))})),Si.graphicService.hooks.onSetStage.tap(this.key,(function(t){t.glyphHost&&(t=t.glyphHost),e.tryLayout(t,!1)}))}},{key:"deactivate",value:function(t){var e=this;Si.graphicService.hooks.onAttributeUpdate.taps=Si.graphicService.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.beforeUpdateAABBBounds.taps=Si.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.afterUpdateAABBBounds.taps=Si.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Si.graphicService.hooks.onSetStage.taps=Si.graphicService.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}])}();var tp=new $r;tp.addTimeline(ia),tp.setFPS(60);var ep=function(){return u((function e(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;o(this,e),this.dir=n,this.color=i,this.colorRgb=xo.Get(i,t.ColorType.Color1),this.ambient=r;var a=Ht(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);this.formatedDir=[n[0]/a,n[1]/a,n[2]/a]}),[{key:"computeColor",value:function(e,n){var i,r=this.formatedDir,a=zt(Ft((e[0]*r[0]+e[1]*r[1]+e[2]*r[2])*(1-this.ambient/2),0)+this.ambient,1);i=kt(n)?xo.Get(n,t.ColorType.Color1):n;var o=this.colorRgb;return"rgb(".concat(o[0]*i[0]*a,", ").concat(o[1]*i[1]*a,", ").concat(o[2]*i[2]*a,")")}}])}();function np(t,e,n,i){var r,a,o,s,u,l,c,h,d,f,v=e[0],p=e[1],y=e[2],g=i[0],m=i[1],b=i[2],k=n[0],x=n[1],w=n[2];return Math.abs(v-k)<Ot&&Math.abs(p-x)<Ot&&Math.abs(y-w)<Ot?dh.identity(t):(c=v-k,h=p-x,d=y-w,r=m*(d*=f=1/Math.hypot(c,h,d))-b*(h*=f),a=b*(c*=f)-g*d,o=g*h-m*c,(f=Math.hypot(r,a,o))?(r*=f=1/f,a*=f,o*=f):(r=0,a=0,o=0),s=h*o-d*a,u=d*r-c*o,l=c*a-h*r,(f=Math.hypot(s,u,l))?(s*=f=1/f,u*=f,l*=f):(s=0,u=0,l=0),t[0]=r,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*v+a*p+o*y),t[13]=-(s*v+u*p+l*y),t[14]=-(c*v+h*p+d*y),t[15]=1,t)}function ip(t,e,n,i,r,a,o){var s=1/(e-n),u=1/(i-r),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*u,t[14]=(o+a)*l,t[15]=1,t}function rp(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],b=n[0],k=n[1],x=n[2],w=n[3];return t[0]=b*i+k*s+x*h+w*p,t[1]=b*r+k*u+x*d+w*y,t[2]=b*a+k*l+x*f+w*g,t[3]=b*o+k*c+x*v+w*m,b=n[4],k=n[5],x=n[6],w=n[7],t[4]=b*i+k*s+x*h+w*p,t[5]=b*r+k*u+x*d+w*y,t[6]=b*a+k*l+x*f+w*g,t[7]=b*o+k*c+x*v+w*m,b=n[8],k=n[9],x=n[10],w=n[11],t[8]=b*i+k*s+x*h+w*p,t[9]=b*r+k*u+x*d+w*y,t[10]=b*a+k*l+x*f+w*g,t[11]=b*o+k*c+x*v+w*m,b=n[12],k=n[13],x=n[14],w=n[15],t[12]=b*i+k*s+x*h+w*p,t[13]=b*r+k*u+x*d+w*y,t[14]=b*a+k*l+x*f+w*g,t[15]=b*o+k*c+x*v+w*m,t}function ap(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t}var op,sp=function(){return u((function t(e){o(this,t),this.params=e}),[{key:"params",get:function(){return Object.assign({},this._params)},set:function(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}},{key:"getViewMatrix",value:function(){return this._viewMatrixCached||(this._viewMatrixCached=vh.allocate()),this._viewMatrixCached}},{key:"forceGetViewMatrix",value:function(){this._viewMatrixCached||(this._viewMatrixCached=vh.allocate());var t=this.params.viewParams,e=t.pos,n=t.center,i=t.up;return np(this._viewMatrixCached,e,n,i),this._vp||(this._vp=vh.allocate()),this._vp=rp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}},{key:"getProjectionMatrix",value:function(){return this._projectionMatrixCached||(this._projectionMatrixCached=vh.allocate()),this._projectionMatrixCached}},{key:"forceGetProjectionMatrix",value:function(){this._projectionMatrixCached||(this._projectionMatrixCached=vh.allocate());var t=this._params,e=t.left,n=t.top,i=t.right,r=t.bottom;return ip(this._projectionMatrixCached,e,i,r,n,0,-2e6),this._vp||(this._vp=vh.allocate()),this._vp=rp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}},{key:"getField",value:function(){var t=this._params,e=t.fieldRatio,n=void 0===e?.8:e,i=t.fieldDepth,r=t.left,a=t.right;return(null!=i?i:a-r)*n}},{key:"getProjectionScale",value:function(t){var e=this.getField();return e/(e+t)}},{key:"view",value:function(t,e,n){var i=[0,0,0];return ap(i,[t,e,n],this._viewMatrixCached),i}},{key:"vp",value:function(t,e,n){var i=[0,0,0],r=this._params.viewParams.pos;ap(i,[t,e,n],this._viewMatrixCached),t=i[0],e=i[1],n=i[2];var a=this.getProjectionScale(n);return{x:t*a+r[0],y:e*a+r[1]}}}])}();function up(){if(null==op)try{(op=globalThis===window)&&(op=!!document.createElement)}catch(t){op=!1}}function lp(){up();var t=Si.global&&Si.global.env;return t?"browser"===t:op}function cp(){up();var t=Si.global&&Si.global.env;return t?"node"===t:!op}var hp=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).name="ReactAttributePlugin",t.activeEvent="onRegister",t._uid=x.GenAutoIncrementId(),t.key=t.name+t._uid,t.htmlMap={},t}return c(n,t),u(n,[{key:"removeElement",value:function(t){if(this.htmlMap&&this.htmlMap[t]){var e=this.htmlMap[t],n=e.root,i=e.wrapContainer;n&&Si.global.getRequestAnimationFrame()((function(){n.unmount()})),i&&Si.global.removeDom(i),this.htmlMap[t]=null}}},{key:"renderGraphicHTML",value:function(t){var e,n=t.attribute.react;if(n){var i=t.stage;if(i){var r=i.params.ReactDOM,a=n.element,o=n.container;if(a&&r&&r.createRoot){var s=yt(n.id)?"".concat(null!==(e=t.id)&&void 0!==e?e:t._uid,"_react"):n.id;if(this.htmlMap&&this.htmlMap[s]&&o&&o!==this.htmlMap[s].container&&this.removeElement(s),this.htmlMap&&this.htmlMap[s])this.htmlMap[s].root.render(a);else{var u=this.getWrapContainer(i,o),l=u.wrapContainer,c=u.nativeContainer;if(l){var h=r.createRoot(l);h.render(a),this.htmlMap||(this.htmlMap={}),this.htmlMap[s]={root:h,wrapContainer:l,nativeContainer:c,container:o,renderId:this.renderId}}}if(this.htmlMap&&this.htmlMap[s]){var d=this.htmlMap[s],f=d.wrapContainer,v=d.nativeContainer;this.updateStyleOfWrapContainer(t,i,f,v,n),this.htmlMap[s].renderId=this.renderId}}}}}}])}(qv),dp="white",fp=function(t){function n(){var t,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(t=e(this,n,[{}]))._onVisibleChange=function(e){if(!(t._skipRender<0))if(e){if(t.dirtyBounds){var n=t.window.getViewBox();t.dirtyBounds.setValue(n.x1,n.y1,n.width(),n.height())}t._skipRender>1&&t.renderNextFrame(),t._skipRender=0}else t._skipRender=1},t.beforeRender=function(e){t._beforeRender&&t._beforeRender(e)},t.afterRender=function(e){t.renderCount++,t._afterRender&&t._afterRender(e),t._afterNextRenderCbs&&t._afterNextRenderCbs.forEach((function(t){return t(e)})),t._afterNextRenderCbs=null},t.params=r,t.theme=new Er,t.hooks={beforeRender:new rt(["stage"]),afterRender:new rt(["stage"])},t.global=Si.global,!t.global.env&&lp()&&t.global.setEnv("browser"),t.window=Ui.get(kr),t.renderService=Ui.get(Ff),t.pluginService=Ui.get($f),t.layerService=Ui.get(Js),t.pluginService.active(f(t),r),t.window.create({width:r.width,height:r.height,viewBox:r.viewBox,container:r.container,dpr:r.dpr||t.global.devicePixelRatio,canvasControled:!1!==r.canvasControled,title:r.title||"",canvas:r.canvas}),t.state="normal",t.renderCount=0,t.tryInitEventSystem(),t._background=null!==(i=r.background)&&void 0!==i?i:dp,t.appendChild(t.layerService.createLayer(f(t),{main:!0})),t.nextFrameRenderLayerSet=new Set,t.willNextFrameRender=!1,t.stage=f(t),t.renderStyle=r.renderStyle,r.autoRender&&t.enableAutoRender(),!1===r.disableDirtyBounds&&t.enableDirtyBounds(),r.enableHtmlAttribute&&t.enableHtmlAttribute(r.enableHtmlAttribute),r.ReactDOM&&t.enableReactAttribute(r.ReactDOM),r.enableLayout&&t.enableLayout(),t.hooks.beforeRender.tap("constructor",t.beforeRender),t.hooks.afterRender.tap("constructor",t.afterRender),t._beforeRender=r.beforeRender,t._afterRender=r.afterRender,t.ticker=r.ticker||tp,t.supportInteractiveLayer=!1!==r.interactiveLayer,t.timeline=new na,t.ticker.addTimeline(t.timeline),t.timeline.pause(),r.optimize||(r.optimize={}),t.optmize(r.optimize),r.background&&kt(t._background)&&t._background.includes("/")&&t.setAttributes({background:t._background}),t}return c(n,t),u(n,[{key:"viewBox",get:function(){return this.window.getViewBox()},set:function(t){this.window.setViewBox(t)}},{key:"x",get:function(){return this.window.getViewBox().x1},set:function(t){var e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}},{key:"y",get:function(){return this.window.getViewBox().y1},set:function(t){var e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}},{key:"width",get:function(){return this.window.width},set:function(t){this.resize(t,this.height)}},{key:"viewWidth",get:function(){return this.window.getViewBox().width()},set:function(t){this.resizeView(t,this.viewHeight)}},{key:"viewHeight",get:function(){return this.window.getViewBox().height()},set:function(t){this.resizeView(this.viewWidth,t)}},{key:"height",get:function(){return this.window.height},set:function(t){this.resize(this.width,t)}},{key:"dpr",get:function(){return this.window.dpr},set:function(t){this.setDpr(t)}},{key:"background",get:function(){var t;return null!==(t=this._background)&&void 0!==t?t:dp},set:function(t){this._background=t}},{key:"defaultLayer",get:function(){return this.at(0)}},{key:"eventSystem",get:function(){return this._eventSystem}},{key:"pauseRender",value:function(){this._skipRender=-1}},{key:"resumeRender",value:function(){this._skipRender=0}},{key:"tryInitEventSystem",value:function(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new qr(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}},{key:"preventRender",value:function(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}},{key:"optmize",value:function(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}},{key:"optmizeRender",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}},{key:"getTimeline",value:function(){return this.timeline}},{key:"get3dOptions",value:function(t){var e=t.center,n=void 0===e?{x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0}:e,i=t.light,r=void 0===i?{}:i,a=t.alpha,o=void 0===a?0:a,s=t.beta,u=void 0===s?0:s,l=t.camera,c=t.fieldRatio,h=void 0===c?1:c,d=t.fieldDepth;return Object.assign(Object.assign({},t),{center:n,light:r,alpha:o,beta:u,camera:l,fieldRatio:h,fieldDepth:d})}},{key:"set3dOptions",value:function(t){var e,n,i,r,a,o;this.option3d=t;var s=this.get3dOptions(t),u=s.light,l=s.center,c=s.camera,h=s.alpha,d=s.beta,f=s.fieldRatio,v=s.fieldDepth,p=u.dir,y=void 0===p?[1,1,-1]:p,g=u.color,m=void 0===g?"white":g,b=u.ambient,k=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(n=l.dx)&&void 0!==n?n:0),x=(null!==(i=l.y)&&void 0!==i?i:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),w=[k,x,(null!==(a=l.z)&&void 0!==a?a:0)+(null!==(o=l.dz)&&void 0!==o?o:0)],A=0,S=0,T=0;c||(A=Math.sin(h)+k,S=Math.sin(d)+x,T=Math.cos(h)*Math.cos(d)*1),this.light=new ep(y,m,b);var B={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:f,fieldDepth:v,viewParams:{pos:[A,S,T],center:w,up:[0,1,0]}};this.camera?this.camera.params=B:this.camera=new sp(B),t.enableView3dTransform&&this.enableView3dTransform()}},{key:"setBeforeRender",value:function(t){this._beforeRender=t}},{key:"setAfterRender",value:function(t){this._afterRender=t}},{key:"afterNextRender",value:function(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}},{key:"enableView3dTransform",value:function(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new Xv))}},{key:"disableView3dTranform",value:function(){var t=this;this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableAutoRender",value:function(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new Yv))}},{key:"disableAutoRender",value:function(){var t=this;this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableIncrementalAutoRender",value:function(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Kv))}},{key:"disableIncrementalAutoRender",value:function(){var t=this;this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableDirtyBounds",value:function(){if(!this.dirtyBounds){this.dirtyBounds=new te;var t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new Jv,this.pluginService.register(t))}}},{key:"disableDirtyBounds",value:function(){var t=this;this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableLayout",value:function(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new $v))}},{key:"disableLayout",value:function(){var t=this;this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableHtmlAttribute",value:function(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new qv))}},{key:"disableHtmlAttribute",value:function(){var t=this;this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableReactAttribute",value:function(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new hp))}},{key:"disableReactAttribute",value:function(){var t=this;this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"getPluginsByName",value:function(t){return this.pluginService.findPluginsByName(t)}},{key:"tryUpdateAABBBounds",value:function(){var t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}},{key:"combineLayer",value:function(t,e){throw new Error("暂不支持")}},{key:"createLayer",value:function(t,e){var n=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(n),n}},{key:"sortLayer",value:function(t){var e=this,n=this.children;n.sort(t),this.removeAllChild(),n.forEach((function(t){e.appendChild(t)}))}},{key:"removeLayer",value:function(t){return this.removeChild(this.findChildByUid(t))}},{key:"tryInitInteractiveLayer",value:function(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}},{key:"clearViewBox",value:function(t){this.window.clearViewBox(t)}},{key:"render",value:function(t,e){this.ticker.start(),this.timeline.resume();var n=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=n,this._skipRender&&this._skipRender++}},{key:"combineLayersToWindow",value:function(){}},{key:"renderNextFrame",value:function(t,e){var n=this;this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((function(t){n.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((function(){n._doRenderInThisFrame(),n.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){this.timeline.resume(),this.ticker.start();var t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}},{key:"renderLayerList",value:function(t,e){for(var n=this,i=[],r=0;r<t.length;r++){var a=t[r];"virtual"===a.layerMode&&(a=a.getNativeHandler().mainHandler.layer),i.includes(a)||i.push(a)}i.forEach((function(t){t.renderCount>n.renderCount||(t.renderCount=n.renderCount+1,t.render({renderService:n.renderService,background:t===n.defaultLayer?n.background:void 0,updateBounds:!(!n.dirtyBounds||n.dirtyBounds.empty()),viewBox:n.window.getViewBox(),transMatrix:n.window.getViewBoxTransform()},Object.assign({renderStyle:n.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}},{key:"resizeWindow",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),n&&this.render()}},{key:"resize",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((function(n){n.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),n&&this.render()}},{key:"resizeView",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((function(n){n.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),n&&this.render()}},{key:"setViewBox",value:function(t,e,n,i,r){var o=this,s=!0;"object"==a(t)?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+n,e+i),!1===r&&(s=!1)),this.forEachChildren((function(t){t.resizeView(o.viewBox.width(),o.viewBox.height())})),s&&this.render()}},{key:"setDpr",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((function(e){e.setDpr(t)})),e&&this.render()}},{key:"setOrigin",value:function(t,e){throw new Error("暂不支持")}},{key:"export",value:function(t){throw new Error("暂不支持")}},{key:"pick",value:function(t,e){this.pickerService||(this.pickerService=Ui.get(Vf));var n=this.pickerService.pick(this.children,new Jt(t,e),{bounds:this.AABBBounds});return!(!(null==n?void 0:n.graphic)&&!(null==n?void 0:n.group))&&n}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((function(t){t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}},{key:"setStage",value:function(t){}},{key:"dirty",value:function(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}},{key:"getLayer",value:function(t){return this.children.filter((function(e){return e.name===t}))[0]}},{key:"renderTo",value:function(t){var e=this;this.forEachChildren((function(n,i){n.drawTo(t,{renderService:e.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:n===e.defaultLayer?e.background:void 0,clear:0===i,updateBounds:!(!e.dirtyBounds||e.dirtyBounds.empty())})}))}},{key:"renderToNewWindow",value:function(){var t=arguments.length>1?arguments[1]:void 0,e=Ui.get(kr),n=t?-t.x1:0,i=t?-t.y1:0,r=t?t.x2:this.viewWidth,a=t?t.y2:this.viewHeight,o=t?t.width():this.viewWidth,s=t?t.height():this.viewHeight;return e.create({viewBox:{x1:n,y1:i,x2:r,y2:a},width:o,height:s,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}},{key:"toCanvas",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0,n=this.renderToNewWindow(t,e).getNativeHandler();return n.nativeCanvas?n.nativeCanvas:null}},{key:"setCursor",value:function(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}},{key:"getCursor",value:function(){return this._cursor}},{key:"eventPointTransform",value:function(t){var e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}},{key:"pauseTriggerEvent",value:function(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}},{key:"resumeTriggerEvent",value:function(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}])}(Vs);var vp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},pp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yp=new re(1,0,0,1,0,0),gp={x:0,y:0};t.EmptyContext2d=function(){return u((function t(e,n){o(this,t),this.matrix=new re(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new re(1,0,0,1,0,0),this.path=new Kn,this._clearMatrix=new re(1,0,0,1,0,0)}),[{key:"nativeContext",get:function(){return this.path}},{key:"getCanvas",value:function(){throw new Error("不支持getCanvas")}},{key:"getContext",value:function(){throw new Error("不支持getContext")}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return fh.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.restore()}},{key:"restore",value:function(){this.stack.length>0&&(fh.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(fh.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*a),o&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,a),o&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.path.clear()}},{key:"clip",value:function(t,e){}},{key:"arc",value:function(t,e,n,i,r,a){this.path.arc(t,e,n,i,r,a)}},{key:"arcTo",value:function(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){this.path.bezierCurveTo(t,e,n,i,r,a)}},{key:"closePath",value:function(){this.path.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){}},{key:"lineTo",value:function(t,e){this.path.lineTo(t,e)}},{key:"moveTo",value:function(t,e){this.path.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"createImageData",value:function(t,e){return null}},{key:"createLinearGradient",value:function(t,e,n,i){throw new Error("不支持createLinearGradient")}},{key:"createPattern",value:function(t,e){throw new Error("不支持createPattern")}},{key:"createRadialGradient",value:function(t,e,n,i,r,a){throw new Error("不支持createRadialGradient")}},{key:"createConicGradient",value:function(t,e,n,i){return null}},{key:"fill",value:function(t,e){}},{key:"fillRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){}},{key:"fillText",value:function(t,e,n){}},{key:"getImageData",value:function(t,e,n,i){return null}},{key:"getLineDash",value:function(){return[]}},{key:"isPointInPath",value:function(t,e){return this.matrix.transformPoint({x:t,y:e},gp),function(t,e,n){return pr(t,0,!1,e,n)}(this.path.commandList,gp.x,gp.y)}},{key:"isPointInStroke",value:function(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},gp);var n=Oh(this,this.lineWidth,this.dpr);return function(t,e,n,i){return pr(t,e,!0,n,i)}(this.path.commandList,n,gp.x,gp.y)}},{key:"measureText",value:function(t){throw new Error("不支持measureText")}},{key:"putImageData",value:function(t,e,n){throw new Error("不支持measureText")}},{key:"setLineDash",value:function(t){}},{key:"stroke",value:function(t){}},{key:"strokeRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n){}},{key:"drawImage",value:function(){}},{key:"setCommonStyle",value:function(t,e,n,i,r){}},{key:"_setCommonStyle",value:function(t,e,n,i){}},{key:"setStrokeStyle",value:function(t,e,n,i,r){}},{key:"_setStrokeStyle",value:function(t,e,n,i){}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){}},{key:"setTextStyle",value:function(t,e){}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(yp,t,e)}},{key:"setClearMatrix",value:function(t,e,n,i,r,a){this._clearMatrix.setValue(t,e,n,i,r,a)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return fh.free(t)})),this.stack.length=0}}])}(),t.EmptyContext2d=vp([I(),pp("design:paramtypes",[Object,Number])],t.EmptyContext2d);var mp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},bp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kp=500,xp=500,wp=1;t.BaseCanvas=function(){return u((function t(e){var n;o(this,t);var i=e.nativeCanvas,r=e.width,a=void 0===r?kp:r,s=e.height,u=void 0===s?xp:s,l=e.dpr,c=void 0===l?wp:l,h=e.x,d=e.y,f=e.id,v=e.canvasControled,p=void 0===v||v;this._x=null!=h?h:0,this._y=null!=d?d:0,this._pixelWidth=a*c,this._pixelHeight=u*c,this._visiable=!1!==e.visiable,this.controled=p,this._displayWidth=a,this._displayHeight=u,this._dpr=c,this._nativeCanvas=i,this._id=null!==(n=i.id)&&void 0!==n?n:f,f&&(i.id=f),this.init(e)}),[{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x},set:function(t){this._x=t}},{key:"y",get:function(){return this._y},set:function(t){this._y=t}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"applyPosition",value:function(){}},{key:"resetStyle",value:function(t){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){return this._context.getImageData(t,e,n,i)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}])}(),t.BaseCanvas.env="browser",t.BaseCanvas=mp([I(),bp("design:paramtypes",[Object])],t.BaseCanvas);var Ap=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};t.BaseEnvContribution=function(){return u((function t(){o(this,t)}),[{key:"configure",value:function(t){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getNativeAABBBounds",value:function(t){return new ee}},{key:"removeDom",value:function(t){return!1}},{key:"createDom",value:function(t){return null}},{key:"updateDom",value:function(t,e){return!1}},{key:"getDynamicCanvasCount",value:function(){return 999}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadBlob",value:function(t){return fetch(t).then((function(t){return t.blob()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"getElementTop",value:function(t,e){return 0}},{key:"getElementLeft",value:function(t,e){return 0}},{key:"getElementTopLeft",value:function(t,e){return{top:0,left:0}}}])}(),t.BaseEnvContribution=Ap([I()],t.BaseEnvContribution);var Sp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Tp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=function(){return u((function t(){o(this,t),this._uid=x.GenAutoIncrementId(),this.viewBox=new ee,this.modelMatrix=new re(1,0,0,1,0,0)}),[{key:"onChange",value:function(t){this._onChangeCb=t}},{key:"configure",value:function(t,e){e.env===this.type&&t.setWindowHandler(this)}},{key:"release",value:function(){this.releaseWindow()}},{key:"isVisible",value:function(t){return!0}},{key:"onVisibleChange",value:function(t){}},{key:"getTopLeft",value:function(t){return{top:0,left:0}}},{key:"setViewBox",value:function(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}},{key:"getViewBox",value:function(){return this.viewBox}},{key:"setViewBoxTransform",value:function(t,e,n,i,r,a){this.modelMatrix.setValue(t,e,n,i,r,a)}},{key:"getViewBoxTransform",value:function(){return this.modelMatrix}}])}(),t.BaseWindowHandlerContribution=Sp([I(),Tp("design:paramtypes",[])],t.BaseWindowHandlerContribution);var Bp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Cp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_p=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultPickService=function(){return u((function t(e){o(this,t),this.pickItemInterceptorContributions=e,this.type="default",this.global=Si.global}),[{key:"_init",value:function(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"pick",value:function(t,e,n){var i={graphic:null,group:null};n.pickerService=this;var r=n.bounds.width(),a=n.bounds.height();if(!(new ee).setValue(0,0,r,a).containsPoint(e))return i;this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);for(var o,s=new re(1,0,0,1,0,0),u=t.length-1;u>=0&&!(i=t[u].isContainer?this.pickGroup(t[u],e,s,n):this.pickItem(t[u],e,s,n)).graphic;u--)o||(o=i.group);if(i.graphic||(i.group=o),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){for(var l=i.graphic;l.parent;)l=l.parent;l.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=l.shadowHost)}return i}},{key:"containsPoint",value:function(t,e,n){var i;return!!(null===(i=this.pickItem(t,e,null,null!=n?n:{pickContext:this.pickContext,pickerService:this}))||void 0===i?void 0:i.graphic)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,a={group:null,graphic:null};if(!1===t.attribute.visibleAll)return a;var o=i.pickContext,s=o.modelMatrix;if(o.camera){var u=t.transMatrix,l=vh.allocate();if(xh(l,u),s){if(l){var c=vh.allocate();o.modelMatrix=wh(c,s,l),vh.free(l)}}else xh(l,t.globalTransMatrix),o.modelMatrix=l}if(this.InterceptorContributions.length)for(var h=0;h<this.InterceptorContributions.length;h++){var d=this.InterceptorContributions[h];if(d.beforePickItem){var f=d.beforePickItem(t,this,e,i,{parentMatrix:n});if(f)return o.modelMatrix!==s&&vh.free(o.modelMatrix),o.modelMatrix=s,f}}var v=t.transMatrix,p=fh.allocateByObj(n),y=new Jt(e.x,e.y);p.transformPoint(y,y);var g=t.AABBBounds.containsPoint(y);if(!g&&!t.stage.camera)return a;var m=this.pickItem(t,y.clone(),n,i);m&&m.graphic&&(a.graphic=m.graphic,a.params=m.params);var b=!1!==t.attribute.pickable&&g;return p.multiply(v.a,v.b,v.c,v.d,v.e,v.f),!1===t.attribute.childrenPickable||m&&m.graphic||mv(t,si.zIndex,(function(o){if(o.isContainer){var s=new Jt(e.x,e.y),u=Lr(t).group,l=t.attribute,c=l.scrollX,h=void 0===c?u.scrollX:c,d=l.scrollY,f=void 0===d?u.scrollY:d;s.x-=h,s.y-=f,a=r.pickGroup(o,s,p,i)}else{var v=new Jt(e.x,e.y);p.transformPoint(v,v);var y=Lr(t).group,g=t.attribute,m=g.scrollX,b=void 0===m?y.scrollX:m,k=g.scrollY,x=void 0===k?y.scrollY:k;v.x-=b,v.y-=x;var w=r.pickItem(o,v,n,i);w&&w.graphic&&(a.graphic=w.graphic,a.params=w.params)}return!!a.graphic||!!a.group}),!0,!!o.camera),o.modelMatrix!==s&&vh.free(o.modelMatrix),o.modelMatrix=s,a.graphic||a.group||!b||t.stage.camera||(a.group=t),fh.free(p),a}},{key:"selectPicker",value:function(t){return this.pickerMap.get(t.numberType)||null}}])}(),t.DefaultPickService=Bp([I(),_p(0,O(Q)),_p(0,D(qf)),Cp("design:paramtypes",[Object])],t.DefaultPickService);var Rp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Pp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function Mp(t,e,n,i,r){for(var a,o,s=i,u=e,l=t[e].x,c=t[e].y,h=t[n].x-l,d=t[n].y-c,f=h*h+d*d,v=e+1,p=n-1;v<p;v++)(o=(a=(t[v].x-l)*d-h*(t[v].y-c))*a/f)>s&&(s=o,u=v);s>i&&(u-e>2&&Mp(t,e,u,i,r),r.push(t[u],t[u+1]),n-u>2&&Mp(t,u,n,i,r))}function Ep(t,e){var n=t.length-1,i=[t[0]];return Mp(t,0,n,e,i),i.push(t[n]),i}t.DefaultGlobalPickerService=function(){return u((function t(){var e=this;o(this,t),this.global=Si.global,this.global.hooks.onSetEnv.tap("global-picker-service",(function(t,n,i){e.configure(i,n)})),this.configure(this.global,this.global.env)}),[{key:"configure",value:function(t,e){}},{key:"pick",value:function(t,e,n){for(var i,r={graphic:null,group:null},a=new re(1,0,0,1,0,0),o=0;o<t.length;o++){if(t[o].isContainer)r=this.pickGroup(t[o],e,a,n);else{var s=this.pickItem(t[o],e,a,n);s&&(r.graphic=s.graphic,r.params=s.params)}if(r.graphic)break;i||(i=r.group)}if(r.graphic||(r.group=i),r.graphic){for(var u=r.graphic;u.parent;)u=u.parent;u.shadowHost&&(r.params={shadowTarget:r.graphic},r.graphic=u.shadowHost)}return r}},{key:"containsPoint",value:function(t,e,n){return!!this.pickItem(t,e,null,n)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,a={group:null,graphic:null};if(!1===t.attribute.visibleAll)return a;var o=t.transMatrix,s=new Jt(e.x,e.y);n.transformPoint(s,s);var u=t.AABBBounds.containsPoint(s);if(!u)return a;var l=!1!==t.attribute.pickable&&u;return n.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((function(t){if(t.isContainer)a=r.pickGroup(t,e,n,i);else{var o=new Jt(e.x,e.y);n.transformPoint(o,o);var s=r.pickItem(t,o,n,i);s&&(a.graphic=s.graphic,a.params=s.params)}return!!a.graphic||!!a.group})),a.graphic||a.group||!l||(a.group=t),a}},{key:"pickItem",value:function(t,e,n,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}}])}(),t.DefaultGlobalPickerService=Rp([I(),Pp("design:paramtypes",[])],t.DefaultGlobalPickerService);var Op=function(){return u((function t(){o(this,t),this.pools=[]}),[{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),Lp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.rect(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.rect(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),Ip=new Lp,Dp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.arc(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.arc(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),jp=new Dp,Up=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.area(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.area(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),Wp=new Up,Np=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.circle(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.circle(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),Fp=new Np,zp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.line(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.line(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),Gp=new zp,Hp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.path(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.path(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),Vp=new Hp,Yp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.symbol(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.symbol(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),Xp=new Yp,Kp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Si.graphicService.creator.text(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Si.graphicService.creator.text(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}(Op),qp=new Kp,Zp=function(){return u((function t(){o(this,t),this.map={text:qp,symbol:Xp}}),[{key:"gc",value:function(t){var e=this;t.isContainer?t.forEachChildren((function(t){return e.gc(t)})):this.gcItem(t)}},{key:"gcItem",value:function(t){var e=this.map[t.type];e&&e.free(t)}}])}(),Jp=new Zp,Qp=!1,$p=new w((function(e){Qp||(Qp=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(hf).to(t.DefaultCanvasArcRender).inSingletonScope(),e(pf).toService(hf),e(bu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,bu))})),ty=!1,ey=new w((function(e){ty||(ty=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(kf).to(t.DefaultCanvasRectRender).inSingletonScope(),e(pf).toService(kf),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(Bu).toService(t.SplitRectAfterRenderContribution),e(Bu).toService(t.SplitRectBeforeRenderContribution),e(Bu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Bu))})),ny=!1,iy=new w((function(e){ny||(ny=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Pv).toSelf().inSingletonScope(),e(gf).to(t.DefaultCanvasLineRender).inSingletonScope(),e(pf).toService(gf))})),ry=!1,ay=new w((function(e){ry||(ry=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(ff).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(pf).toService(ff),e(ku).toService(t.DefaultBaseInteractiveRenderContribution),et(e,ku),e(Ev).toSelf().inSingletonScope())})),oy=!1,sy=new w((function(e){oy||(oy=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(wf).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(pf).toService(wf),e(Cu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Cu))})),uy=!1,ly=new w((function(e){uy||(uy=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(vf).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(pf).toService(vf),e(xu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,xu))})),cy=!1,hy=new w((function(e){cy||(cy=!0,e(Af).to(t.DefaultCanvasTextRender).inSingletonScope(),e(pf).toService(Af),e(_u).toService(t.DefaultBaseInteractiveRenderContribution),et(e,_u))})),dy=!1,fy=new w((function(e){dy||(dy=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(mf).to(t.DefaultCanvasPathRender).inSingletonScope(),e(pf).toService(mf),e(Su).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Su))})),vy=!1,py=new w((function(e){vy||(vy=!0,e(bf).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(pf).toService(bf),e(Tu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Tu))})),yy=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},gy=function(){return u((function t(){o(this,t),this.numberType=Cs}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){r.drawContribution&&t.getSubGraphic().forEach((function(t){var u=r.drawContribution.getRenderContribution(t);u&&u.drawShape&&u.drawShape(t,e,n,i,r,a,o,s)}))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r&&(r.highPerformanceSave(),n.drawContribution)){var a=Lr(t),o=t.getSubGraphic();o.length&&o.forEach((function(t){n.drawContribution.renderItem(t,n,{theme:a})})),r.highPerformanceRestore()}}}])}();gy=yy([I()],gy);var my=!1,by=new w((function(t){my||(my=!0,t(Bf).to(gy).inSingletonScope(),t(pf).toService(Bf))})),ky=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},xy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wy=function(t){function n(){var t;return o(this,n),(t=e(this,n)).numberType=Ds,t.builtinContributions=[Yd],t.init(),t}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r){var a=Lr(t).richtext,o=t.attribute,s=o.strokeOpacity,u=void 0===s?a.strokeOpacity:s,l=o.opacity,c=void 0===l?a.opacity:l,h=o.fillOpacity,d=void 0===h?a.fillOpacity:h,f=o.visible,v=void 0===f?a.visible:f;if(t.valid&&v){var p=ou(c,d,!0),y=ou(c,u,!0);p&&(e.translate(n,i),this.beforeRenderStep(t,e,n,i,p,y,p,y,a,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,p,y,p,y,a,r))}}},{key:"drawIcon",value:function(t,e,n,i,r){var a,o=Lr(t).richtextIcon,s=t.attribute,u=s.width,l=void 0===u?o.width:u,c=s.height,h=void 0===c?o.height:c,d=s.opacity,f=void 0===d?o.opacity:d,v=s.image,p=s.backgroundFill,y=void 0===p?o.backgroundFill:p,g=s.backgroundFillOpacity,m=void 0===g?o.backgroundFillOpacity:g,b=s.backgroundStroke,k=void 0===b?o.backgroundStroke:b,x=s.backgroundStrokeOpacity,w=void 0===x?o.backgroundStrokeOpacity:x,A=s.backgroundRadius,S=void 0===A?o.backgroundRadius:A,T=s.margin,B=t.attribute,C=B.backgroundWidth,_=void 0===C?l:C,R=B.backgroundHeight,P=void 0===R?h:R;if(T&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){var M=(_-l)/2,E=(P-h)/2;0===S?(e.beginPath(),e.rect(n-M,i-E,_,P)):(e.beginPath(),$h(e,n-M,i-E,_,P,S)),y&&(e.globalAlpha=m,e.fillStyle=y,e.fill()),k&&(e.globalAlpha=w,e.strokeStyle=k,e.stroke())}var O=v&&(null===(a=null==t?void 0:t.resources)||void 0===a?void 0:a.get(v));O&&"success"===O.state&&(e.globalAlpha=f,e.drawImage(O.data,n,i,l,h))}},{key:"draw",value:function(t,e,n){var i=Lr(t).richtext;this._draw(t,i,!1,n)}}])}(Ph);wy=ky([I(),xy("design:paramtypes",[])],wy);var Ay=!1,Sy=new w((function(t){Ay||(Ay=!0,t(Sf).to(wy).inSingletonScope(),t(pf).toService(Sf))})),Ty=!1,By=new w((function(e){Ty||(Ty=!0,e(Cf).to(t.DefaultCanvasImageRender).inSingletonScope(),e(pf).toService(Cf),e(Au).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Au))})),Cy=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},_y=function(n){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="rect3d",t.numberType=Is,t}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=Lr(t,null==a?void 0:a.theme).rect,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.stroke,v=void 0===f?l.stroke:f,p=c.x1,y=c.y1,g=c.x,m=c.y,b=c.opacity,k=void 0===b?l.opacity:b,x=c.fillOpacity,w=void 0===x?l.fillOpacity:x,A=c.lineWidth,S=void 0===A?l.lineWidth:A,T=c.strokeOpacity,B=void 0===T?l.strokeOpacity:T,C=c.visible,_=void 0===C?l.visible:C,R=t.attribute,P=R.width,M=R.height;P=(null!=P?P:p-g)||0,M=(null!=M?M:y-m)||0;var E=null!==(u=this.z)&&void 0!==u?u:0,O=su(k,w,P,M,d),L=lu(k,B,P,M),I=ru(d),D=au(v,S);if(t.valid&&_&&(I||D)&&(O||L||o||s)){var j=r.stage||{},U=j.light;j.camera;var W=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,l);var N=d;"string"!=typeof N&&(N="black"),this.fill(n,i,E,W,N,e,U,o)}!1!==v&&(e.setStrokeStyle(t,t.attribute,n,i,l),this.stroke(n,i,E,W,e))}}},{key:"stroke",value:function(t,e,n,i,r){var a=i.vertices;i.edges.forEach((function(i){var o=a[i[0]],s={x:t+o[0],y:e+o[1],z:n+o[2]},u=a[i[1]],l={x:t+u[0],y:e+u[1],z:n+u[2]};r.beginPath(),r.moveTo(s.x,s.y,s.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}},{key:"fill",value:function(e,n,i,r,a,o,s,u){var l=xo.Get(a,t.ColorType.Color255),c=r.vertices,h=c.map((function(t){return o.view(t[0],t[1],t[2])[2]})),d=[];r.polygons.forEach((function(t,e){d.push({faceIdx:e,polygon:t});var n=t.polygon;t.normal;var i=h[n[0]],r=h[n[1]],a=h[n[2]],o=h[n[3]];t.ave_z=i+r+a+o})),d.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),d.forEach((function(t){var r=t.polygon,h=r.polygon,d=r.normal,f=c[h[0]],v=c[h[1]],p=c[h[2]],y=c[h[3]],g={x:e+f[0],y:n+f[1],z:i+f[2]},m={x:e+v[0],y:n+v[1],z:i+v[2]},b={x:e+p[0],y:n+p[1],z:i+p[2]},k={x:e+y[0],y:n+y[1],z:i+y[2]};o.beginPath(),o.moveTo(g.x,g.y,g.z),o.lineTo(m.x,m.y,m.z),o.lineTo(b.x,b.y,b.z),o.lineTo(k.x,k.y,k.z),o.closePath(),u?u(o,null,null):(o.fillStyle=s?s.computeColor(d,l):a,o.fill())}))}},{key:"draw",value:function(t,e,n){var i=Lr(t).rect;this._draw(t,i,!1,n)}}])}(Ph);_y=Cy([I()],_y);var Ry=!1,Py=new w((function(t){Ry||(Ry=!0,t(xf).to(_y).inSingletonScope(),t(pf).toService(xf))})),My=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};var Ey=function(n){function i(){var t;return o(this,i),(t=e(this,i,arguments)).numberType=Ss,t}return c(i,n),u(i,[{key:"drawShape",value:function(e,n,i,r,a,o,s,u){var l,c=Lr(e,null==o?void 0:o.theme).arc,h=e.attribute.fill,d=void 0===h?c.fill:h,f=this.valid(e,c,s,u);if(f){var v=f.fVisible,p=f.sVisible,y=f.doFill,g=f.doStroke,m=null!==(l=this.z)&&void 0!==l?l:0,b=e.attribute,k=b.outerPadding,x=void 0===k?c.outerPadding:k,w=b.innerPadding,A=void 0===w?c.innerPadding:w,S=b.height,T=void 0===S?10:S,B=e.attribute,C=B.outerRadius,_=void 0===C?c.outerRadius:C,R=B.innerRadius,P=void 0===R?c.innerRadius:R;_+=x,P-=A;var M=xo.Get(d,t.ColorType.Color255),E=(a.stage||{}).light,O=a.hack_pieFace,L={top:m,bottom:m+T},I={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===O||"top"===O?(n.beginPath(),function(t,e,n,i,r,a,o){var s=t.getParsedAngle(),u=s.startAngle,l=s.endAngle,c=Ut(l-u),h=l>u,d=!1;if(a<o){var f=a;a=o,o=f}if(a<=Ot)e.moveTo(n,i,r);else if(c>=jt-Ot)e.moveTo(n+a*Nt(u),i+a*Gt(u),r),e.arc(n,i,a,u,l,!h,r),o>Ot&&(e.moveTo(n+o*Nt(l),i+o*Gt(l),r),e.arc(n,i,o,l,u,h,r));else{var v=t.getParsePadAngle(u,l),p=v.outerDeltaAngle,y=v.innerDeltaAngle,g=v.outerStartAngle,m=v.outerEndAngle,b=v.innerEndAngle,k=v.innerStartAngle,x=a*Nt(g),w=a*Gt(g),A=o*Nt(b),S=o*Gt(b);p<.001?d=!0:(e.moveTo(n+x,i+w,r),e.arc(n,i,a,g,m,!h,r)),!(o>Ot)||y<.001?(e.lineTo(n+A,i+S,r),d=!0):(e.lineTo(n+A,i+S,r),e.arc(n,i,o,b,k,h,r))}e.closePath()}(e,n,i,r,L[O],_,P),n.setShadowBlendStyle&&n.setShadowBlendStyle(e,e.attribute,c),y&&(s?s(n,e.attribute,c):v&&(n.setCommonStyle(e,e.attribute,i,r,c),n.fillStyle=E?E.computeColor(I[O],M):d,n.fill())),g&&(u?u(n,e.attribute,c):p&&(n.setStrokeStyle(e,e.attribute,i,r,c),n.stroke()))):"outside"!==O&&"inside"!==O||("inside"===O&&(n.save(),n.beginPath(),n.arc(i,r,P,0,jt,!0,L.top),n.clip()),n.beginPath(),function(t,e,n,i,r,a,o,s){var u=t.getParsedAngle(),l=u.startAngle,c=u.endAngle,h=Ut(c-l),d=c>l,f=!1;if(o<=Ot)e.moveTo(n,i,r);else if(h>=jt-Ot)e.moveTo(n+o*Nt(l),i+o*Gt(l),r),e.arc(n,i,o,l,c,!d,r),e.lineTo(n+o*Nt(c),i+o*Gt(c),a),e.arc(n,i,o,c,l,d,a);else{var v=s(l,c),p=v.innerouterDeltaAngle,y=v.innerouterStartAngle,g=v.innerouterEndAngle,m=o*Nt(y),b=o*Gt(y),k=o*Nt(g),x=o*Gt(g);p<.001?f=!0:(e.moveTo(n+m,i+b,r),e.arc(n,i,o,y,g,!d,r),e.lineTo(n+k,i+x,a),e.arc(n,i,o,g,y,d,a))}e.closePath()}(e,n,i,r,L.top,L.bottom,"outside"===O?_:P,(function(t,n){var i=e.getParsePadAngle(t,n),r=i.outerDeltaAngle,a=i.innerDeltaAngle,o=i.outerStartAngle,s=i.outerEndAngle,u=i.innerEndAngle,l=i.innerStartAngle;return"outside"===O?{innerouterDeltaAngle:r,innerouterEndAngle:s,innerouterStartAngle:o}:{innerouterDeltaAngle:a,innerouterEndAngle:u,innerouterStartAngle:l}})),n.setShadowBlendStyle&&n.setShadowBlendStyle(e,e.attribute,c),y&&(s?s(n,e.attribute,c):v&&(n.setCommonStyle(e,e.attribute,i,r,c),n.fillStyle=E?E.computeColor(I[O],M):d,n.fill())),g&&(u?u(n,e.attribute,c):p&&(n.setStrokeStyle(e,e.attribute,i,r,c),n.stroke())),"inside"===O&&n.restore())}}},{key:"draw",value:function(t,e,n,i){var r=Lr(t,null==i?void 0:i.theme).arc;this._draw(t,r,!1,n,i)}}])}(Ph);Ey=My([I()],Ey);var Oy=!1,Ly=new w((function(t){Oy||(Oy=!0,t(df).to(Ey).inSingletonScope(),t(pf).toService(df))})),Iy=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Dy=function(n){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="pyramid3d",t.numberType=Os,t}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=Lr(t,null==a?void 0:a.theme).polygon,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.stroke,v=void 0===f?l.stroke:f,p=c.face,y=void 0===p?[!0,!0,!0,!0,!0,!0]:p,g=null!==(u=this.z)&&void 0!==u?u:0;if(this.valid(t,l,o,s)){var m=r.stage||{},b=m.light,k=m.camera,x=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,l);var w=d;"string"!=typeof w&&(w="black"),this.fill(n,i,g,x,y,w,e,b,k,t,l,o)}!1!==v&&(e.setStrokeStyle(t,t.attribute,n,i,l),this.stroke(n,i,g,x,e))}}},{key:"stroke",value:function(t,e,n,i,r){var a=i.vertices;i.edges.forEach((function(i){var o=a[i[0]],s=a[i[1]],u={x:t+o[0],y:e+o[1],z:n+o[2]},l={x:t+s[0],y:e+s[1],z:n+s[2]};r.beginPath(),r.moveTo(u.x,u.y,u.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}},{key:"fill",value:function(e,n,i,r,a,o,s,u,l,c,h,d){var f=xo.Get(o,t.ColorType.Color255),v=r.vertices,p=v.map((function(t){return s.view(t[0],t[1],t[2])[2]})),y=[];r.polygons.forEach((function(t,e){if(a[e]){y.push({faceIdx:e,polygon:t});var n=t.polygon;t.normal;var i=p[n[0]],r=p[n[1]],o=p[n[2]],s=p[n[3]];t.ave_z=i+r+o+s}})),y.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),y.forEach((function(t){var r=t.polygon,a=r.polygon,l=r.normal,p=v[a[0]],y=v[a[1]],g=v[a[2]],m=v[a[3]],b={x:e+p[0],y:n+p[1],z:i+p[2]},k={x:e+y[0],y:n+y[1],z:i+y[2]},x={x:e+g[0],y:n+g[1],z:i+g[2]},w={x:e+m[0],y:n+m[1],z:i+m[2]};s.beginPath(),s.moveTo(b.x,b.y,b.z),s.lineTo(k.x,k.y,k.z),s.lineTo(x.x,x.y,x.z),s.lineTo(w.x,w.y,w.z),s.closePath(),d?d(s,c.attribute,h):(s.fillStyle=u?u.computeColor(l,f):o,s.fill())}))}},{key:"draw",value:function(t,e,n){var i=Lr(t).polygon;this._draw(t,i,!1,n)}}])}(Ph);Dy=Iy([I()],Dy);var jy=!1,Uy=new w((function(t){jy||(jy=!0,t(Tf).to(Dy).inSingletonScope(),t(pf).toService(Tf))}));function Wy(){Ch.RegisterGraphicCreator("arc",Zc)}function Ny(){Ch.RegisterGraphicCreator("arc3d",Qc)}function Fy(){Ch.RegisterGraphicCreator("area",Xc)}function zy(){Ch.RegisterGraphicCreator("circle",Ou)}function Gy(){Ch.RegisterGraphicCreator("glyph",Pc)}function Hy(){Ch.RegisterGraphicCreator("group",Ys)}function Vy(){Ch.RegisterGraphicCreator("image",Ic)}function Yy(){Ch.RegisterGraphicCreator("line",wc)}function Xy(){Ch.RegisterGraphicCreator("path",Hc)}function Ky(){Ch.RegisterGraphicCreator("polygon",eh)}function qy(){Ch.RegisterGraphicCreator("pyramid3d",ih)}function Zy(){Ch.RegisterGraphicCreator("rect",Tc)}function Jy(){Ch.RegisterGraphicCreator("rect3d",_c)}function Qy(){Ch.RegisterGraphicCreator("richtext",Fc)}function $y(){Ch.RegisterGraphicCreator("symbol",bc)}function tg(){Ch.RegisterGraphicCreator("text",zu)}function eg(){Ch.RegisterGraphicCreator("shadowRoot",ah)}function ng(){Ch.RegisterGraphicCreator("wrapText",Vu)}function ig(t,e,n){if(t&&t.length){var i=y(e,2),r=i[0],a=i[1],o=Math.PI/180*n,s=Math.cos(o),u=Math.sin(o);t.forEach((function(t){var e=y(t,2),n=e[0],i=e[1];t[0]=(n-r)*s-(i-a)*u+r,t[1]=(n-r)*u+(i-a)*s+a}))}}function rg(t){var e=t[0],n=t[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}function ag(t,e){var n=e.hachureAngle+90,i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);var r=[0,0];if(n){var a,o=k(t);try{for(o.s();!(a=o.n()).done;){ig(a.value,r,n)}}catch(t){o.e(t)}finally{o.f()}}var s=function(t,e){var n,i=[],r=k(t);try{for(r.s();!(n=r.n()).done;){var a=g(n.value);a[0].join(",")!==a[a.length-1].join(",")&&a.push([a[0][0],a[0][1]]),a.length>2&&i.push(a)}}catch(t){r.e(t)}finally{r.f()}var o=[];e=Math.max(e,.1);for(var s=[],u=0,l=i;u<l.length;u++)for(var c=l[u],h=0;h<c.length-1;h++){var d=c[h],f=c[h+1];if(d[1]!==f[1]){var v=Math.min(d[1],f[1]);s.push({ymin:v,ymax:Math.max(d[1],f[1]),x:v===d[1]?d[0]:f[0],islope:(f[0]-d[0])/(f[1]-d[1])})}}if(s.sort((function(t,e){return t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)})),!s.length)return o;for(var p=[],y=s[0].ymin;p.length||s.length;){if(s.length){for(var m=-1,b=0;b<s.length&&!(s[b].ymin>y);b++)m=b;s.splice(0,m+1).forEach((function(t){p.push({s:y,edge:t})}))}if(p=p.filter((function(t){return!(t.edge.ymax<=y)})),p.sort((function(t,e){return t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)})),p.length>1)for(var x=0;x<p.length;x+=2){var w=x+1;if(w>=p.length)break;var A=p[x].edge,S=p[w].edge;o.push([[Math.round(A.x),y],[Math.round(S.x),y]])}y+=e,p.forEach((function(t){t.edge.x=t.edge.x+e*t.edge.islope}))}return o}(t,i);if(n){var u,l=k(t);try{for(l.s();!(u=l.n()).done;){ig(u.value,r,-n)}}catch(t){l.e(t)}finally{l.f()}!function(t,e,n){var i=[];t.forEach((function(t){return i.push.apply(i,g(t))})),ig(i,e,n)}(s,r,-n)}return s}var og=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){return this._fillPolygons(t,e)}},{key:"_fillPolygons",value:function(t,e){var n=ag(t,e);return{type:"fillSketch",ops:this.renderLines(n,e)}}},{key:"renderLines",value:function(t,e){var n,i=[],r=k(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;i.push.apply(i,g(this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],e)))}}catch(t){r.e(t)}finally{r.f()}return i}}])}(),sg=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"fillPolygons",value:function(t,e){var n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);var i,r=ag(t,Object.assign({},e,{hachureGap:n})),a=Math.PI/180*e.hachureAngle,o=[],s=.5*n*Math.cos(a),u=.5*n*Math.sin(a),l=k(r);try{for(l.s();!(i=l.n()).done;){var c=y(i.value,2),h=c[0],d=c[1];rg([h,d])&&o.push([[h[0]-s,h[1]+u],g(d)],[[h[0]+s,h[1]-u],g(d)])}}catch(t){l.e(t)}finally{l.f()}return{type:"fillSketch",ops:this.renderLines(o,e)}}}])}(og),ug=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"fillPolygons",value:function(t,e){var n=this._fillPolygons(t,e),i=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,i);return n.ops=n.ops.concat(r.ops),n}}])}(og),lg=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){var n=ag(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(n,e)}},{key:"dotsOnLines",value:function(t,e){var n=[],i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);var r=e.fillWeight;r<0&&(r=e.strokeWidth/2);var a,o=i/4,s=k(t);try{for(s.s();!(a=s.n()).done;)for(var u=a.value,l=rg(u),c=l/i,h=Math.ceil(c)-1,d=l-h*i,f=(u[0][0]+u[1][0])/2-i/4,v=Math.min(u[0][1],u[1][1]),p=0;p<h;p++){var y=v+d+p*i,m=f-o+2*Math.random()*o,b=y-o+2*Math.random()*o,x=this.helper.ellipse(m,b,r,r,e);n.push.apply(n,g(x.ops))}}catch(t){s.e(t)}finally{s.f()}return{type:"fillSketch",ops:n}}}])}(),cg=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){var n=ag(t,e);return{type:"fillSketch",ops:this.dashedLine(n,e)}}},{key:"dashedLine",value:function(t,e){var n=this,i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,r=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,a=[];return t.forEach((function(t){var o=rg(t),s=Math.floor(o/(i+r)),u=(o+r-s*(i+r))/2,l=t[0],c=t[1];l[0]>c[0]&&(l=t[1],c=t[0]);for(var h=Math.atan((c[1]-l[1])/(c[0]-l[0])),d=0;d<s;d++){var f=d*(i+r),v=f+i,p=[l[0]+f*Math.cos(h)+u*Math.cos(h),l[1]+f*Math.sin(h)+u*Math.sin(h)],y=[l[0]+v*Math.cos(h)+u*Math.cos(h),l[1]+v*Math.sin(h)+u*Math.sin(h)];a.push.apply(a,g(n.helper.doubleLineOps(p[0],p[1],y[0],y[1],e)))}})),a}}])}(),hg=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){var n=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,i=e.zigzagOffset<0?n:e.zigzagOffset,r=ag(t,e=Object.assign({},e,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(r,i,e)}}},{key:"zigzagLines",value:function(t,e,n){var i=this,r=[];return t.forEach((function(t){var a=rg(t),o=Math.round(a/(2*e)),s=t[0],u=t[1];s[0]>u[0]&&(s=t[1],u=t[0]);for(var l=Math.atan((u[1]-s[1])/(u[0]-s[0])),c=0;c<o;c++){var h=2*c*e,d=2*(c+1)*e,f=Math.sqrt(2*Math.pow(e,2)),v=[s[0]+h*Math.cos(l),s[1]+h*Math.sin(l)],p=[s[0]+d*Math.cos(l),s[1]+d*Math.sin(l)],y=[v[0]+f*Math.cos(l+Math.PI/4),v[1]+f*Math.sin(l+Math.PI/4)];r.push.apply(r,g(i.helper.doubleLineOps(v[0],v[1],y[0],y[1],n)).concat(g(i.helper.doubleLineOps(y[0],y[1],p[0],p[1],n))))}})),r}}])}(),dg={},fg=function(){return u((function t(e){o(this,t),this.seed=e}),[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}])}(),vg={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function pg(t,e){return t.type===e}function yg(t){for(var e=[],n=function(t){for(var e=new Array;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t),i="BOD",r=0,a=n[r];!pg(a,2);){var o=0,s=[];if("BOD"===i){if("M"!==a.text&&"m"!==a.text)return yg("M0,0"+t);r++,o=vg[a.text],i=a.text}else pg(a,1)?o=vg[i]:(r++,o=vg[a.text],i=a.text);if(!(r+o<n.length))throw new Error("Path data ended short");for(var u=r;u<r+o;u++){var l=n[u];if(!pg(l,1))throw new Error("Param not a number: "+i+","+l.text);s[s.length]=+l.text}if("number"!=typeof vg[i])throw new Error("Bad segment: "+i);var c={key:i,data:s};e.push(c),a=n[r+=o],"M"===i&&(i="L"),"m"===i&&(i="l")}return e}function gg(t){var e,n,i,r,a=0,o=0,s=0,u=0,l=[],c=k(t);try{for(c.s();!(r=c.n()).done;){var h=r.value,d=h.key,f=h.data;switch(d){case"M":l.push({key:"M",data:g(f)}),e=y(f,2),a=e[0],o=e[1],s=(n=y(f,2))[0],u=n[1];break;case"m":a+=f[0],o+=f[1],l.push({key:"M",data:[a,o]}),s=a,u=o;break;case"L":l.push({key:"L",data:g(f)}),i=y(f,2),a=i[0],o=i[1];break;case"l":a+=f[0],o+=f[1],l.push({key:"L",data:[a,o]});break;case"C":l.push({key:"C",data:g(f)}),a=f[4],o=f[5];break;case"c":var v=f.map((function(t,e){return e%2?t+o:t+a}));l.push({key:"C",data:v}),a=v[4],o=v[5];break;case"Q":l.push({key:"Q",data:g(f)}),a=f[2],o=f[3];break;case"q":var p=f.map((function(t,e){return e%2?t+o:t+a}));l.push({key:"Q",data:p}),a=p[2],o=p[3];break;case"A":l.push({key:"A",data:g(f)}),a=f[5],o=f[6];break;case"a":a+=f[5],o+=f[6],l.push({key:"A",data:[f[0],f[1],f[2],f[3],f[4],a,o]});break;case"H":l.push({key:"H",data:g(f)}),a=f[0];break;case"h":a+=f[0],l.push({key:"H",data:[a]});break;case"V":l.push({key:"V",data:g(f)}),o=f[0];break;case"v":o+=f[0],l.push({key:"V",data:[o]});break;case"S":l.push({key:"S",data:g(f)}),a=f[2],o=f[3];break;case"s":var m=f.map((function(t,e){return e%2?t+o:t+a}));l.push({key:"S",data:m}),a=m[2],o=m[3];break;case"T":l.push({key:"T",data:g(f)}),a=f[0],o=f[1];break;case"t":a+=f[0],o+=f[1],l.push({key:"T",data:[a,o]});break;case"Z":case"z":l.push({key:"Z",data:[]}),a=s,o=u}}}catch(t){c.e(t)}finally{c.f()}return l}function mg(t){var e,n,i,r,a=[],o="",s=0,u=0,l=0,c=0,h=0,d=0,f=k(t);try{for(f.s();!(r=f.n()).done;){var v=r.value,p=v.key,m=v.data;switch(p){case"M":a.push({key:"M",data:g(m)}),s=(e=y(m,2))[0],u=e[1],l=(n=y(m,2))[0],c=n[1];break;case"C":a.push({key:"C",data:g(m)}),s=m[4],u=m[5],h=m[2],d=m[3];break;case"L":a.push({key:"L",data:g(m)}),s=(i=y(m,2))[0],u=i[1];break;case"H":s=m[0],a.push({key:"L",data:[s,u]});break;case"V":u=m[0],a.push({key:"L",data:[s,u]});break;case"S":var b=0,x=0;"C"===o||"S"===o?(b=s+(s-h),x=u+(u-d)):(b=s,x=u),a.push({key:"C",data:[b,x].concat(g(m))}),h=m[0],d=m[1],s=m[2],u=m[3];break;case"T":var w=y(m,2),A=w[0],S=w[1],T=0,B=0;"Q"===o||"T"===o?(T=s+(s-h),B=u+(u-d)):(T=s,B=u);var C=s+2*(T-s)/3,_=u+2*(B-u)/3,R=A+2*(T-A)/3,P=S+2*(B-S)/3;a.push({key:"C",data:[C,_,R,P,A,S]}),h=T,d=B,s=A,u=S;break;case"Q":var M=y(m,4),E=M[0],O=M[1],L=M[2],I=M[3],D=s+2*(E-s)/3,j=u+2*(O-u)/3,U=L+2*(E-L)/3,W=I+2*(O-I)/3;a.push({key:"C",data:[D,j,U,W,L,I]}),h=E,d=O,s=L,u=I;break;case"A":var N=Math.abs(m[0]),F=Math.abs(m[1]),z=m[2],G=m[3],H=m[4],V=m[5],Y=m[6];0===N||0===F?(a.push({key:"C",data:[s,u,V,Y,V,Y]}),s=V,u=Y):s===V&&u===Y||(kg(s,u,V,Y,N,F,z,G,H).forEach((function(t){a.push({key:"C",data:t})})),s=V,u=Y);break;case"Z":a.push({key:"Z",data:[]}),s=l,u=c}o=p}}catch(t){f.e(t)}finally{f.f()}return a}function bg(t,e,n){return[t*Math.cos(n)-e*Math.sin(n),t*Math.sin(n)+e*Math.cos(n)]}function kg(t,e,n,i,r,a,o,s,u,l){var c,h=(c=o,Math.PI*c/180),d=[],f=0,v=0,p=0,g=0;if(l){var m=y(l,4);f=m[0],v=m[1],p=m[2],g=m[3]}else{var b,k;t=(b=y(bg(t,e,-h),2))[0],e=b[1];var x=(t-(n=(k=y(bg(n,i,-h),2))[0]))/2,w=(e-(i=k[1]))/2,A=x*x/(r*r)+w*w/(a*a);A>1&&(r*=A=Math.sqrt(A),a*=A);var S=r*r,T=a*a,B=S*T-S*w*w-T*x*x,C=S*w*w+T*x*x,_=(s===u?-1:1)*Math.sqrt(Math.abs(B/C));p=_*r*w/a+(t+n)/2,g=_*-a*x/r+(e+i)/2,f=Math.asin(parseFloat(((e-g)/a).toFixed(9))),v=Math.asin(parseFloat(((i-g)/a).toFixed(9))),t<p&&(f=Math.PI-f),n<p&&(v=Math.PI-v),f<0&&(f=2*Math.PI+f),v<0&&(v=2*Math.PI+v),u&&f>v&&(f-=2*Math.PI),!u&&v>f&&(v-=2*Math.PI)}var R=v-f;if(Math.abs(R)>120*Math.PI/180){var P=v,M=n,E=i;v=u&&v>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,d=kg(n=p+r*Math.cos(v),i=g+a*Math.sin(v),M,E,r,a,o,0,u,[v,P,p,g])}R=v-f;var O=Math.cos(f),L=Math.sin(f),I=Math.cos(v),D=Math.sin(v),j=Math.tan(R/4),U=4/3*r*j,W=4/3*a*j,N=[t,e],F=[t+U*L,e-W*O],z=[n+U*D,i-W*I],G=[n,i];if(F[0]=2*N[0]-F[0],F[1]=2*N[1]-F[1],l)return[F,z,G].concat(d);d=[F,z,G].concat(d);for(var H=[],V=0;V<d.length;V+=3){var Y=bg(d[V][0],d[V][1],h),X=bg(d[V+1][0],d[V+1][1],h),K=bg(d[V+2][0],d[V+2][1],h);H.push([Y[0],Y[1],X[0],X[1],K[0],K[1]])}return H}var xg={randOffset:function(t,e){return Mg(t,e)},randOffsetWithRange:function(t,e,n){return Pg(t,e,n)},ellipse:function(t,e,n,i,r){return Tg(t,e,r,Sg(n,i,r)).opset},doubleLineOps:function(t,e,n,i,r){return Eg(t,e,n,i,r,!0)}};function wg(t,e,n,i,r){return{type:"path",ops:Eg(t,e,n,i,r)}}function Ag(t,e,n){var i=(t||[]).length;if(i>2){for(var r=[],a=0;a<i-1;a++)r.push.apply(r,g(Eg(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n)));return e&&r.push.apply(r,g(Eg(t[i-1][0],t[i-1][1],t[0][0],t[0][1],n))),{type:"path",ops:r}}return 2===i?wg(t[0][0],t[0][1],t[1][0],t[1][1],n):{type:"path",ops:[]}}function Sg(t,e,n){var i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/r,o=Math.abs(t/2),s=Math.abs(e/2),u=1-n.curveFitting;return{increment:a,rx:o+=Mg(o*u,n),ry:s+=Mg(s*u,n)}}function Tg(t,e,n,i){var r=y(Dg(i.increment,t,e,i.rx,i.ry,1,i.increment*Pg(.1,Pg(.4,1,n),n),n),2),a=r[0],o=r[1],s=Ig(a,null,n);if(!n.disableMultiStroke&&0!==n.roughness){var u=Ig(y(Dg(i.increment,t,e,i.rx,i.ry,1.5,0,n),1)[0],null,n);s=s.concat(u)}return{estimatedPoints:o,opset:{type:"path",ops:s}}}function Bg(t,e,n,i,r,a,o,s,u){var l=t,c=e,h=Math.abs(n/2),d=Math.abs(i/2);h+=Mg(.01*h,u),d+=Mg(.01*d,u);for(var f=r,v=a;f<0;)f+=2*Math.PI,v+=2*Math.PI;v-f>2*Math.PI&&(f=0,v=2*Math.PI);var p=2*Math.PI/u.curveStepCount,y=Math.min(p/2,(v-f)/2),m=jg(y,l,c,h,d,f,v,1,u);if(!u.disableMultiStroke){var b=jg(y,l,c,h,d,f,v,1.5,u);m.push.apply(m,g(b))}return o&&(s?m.push.apply(m,g(Eg(l,c,l+h*Math.cos(f),c+d*Math.sin(f),u)).concat(g(Eg(l,c,l+h*Math.cos(v),c+d*Math.sin(v),u)))):m.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+h*Math.cos(f),c+d*Math.sin(f)]})),{type:"path",ops:m}}function Cg(t,e){var n,i=[],r=k(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a.length){var o=e.maxRandomnessOffset||0,s=a.length;if(s>2){i.push({op:"move",data:[a[0][0]+Mg(o,e),a[0][1]+Mg(o,e)]});for(var u=1;u<s;u++)i.push({op:"lineTo",data:[a[u][0]+Mg(o,e),a[u][1]+Mg(o,e)]})}}}}catch(t){r.e(t)}finally{r.f()}return{type:"fillPath",ops:i}}function _g(t,e){return function(t,e){var n=t.fillStyle||"hachure";if(!dg[n])switch(n){case"zigzag":dg[n]||(dg[n]=new sg(e));break;case"cross-hatch":dg[n]||(dg[n]=new ug(e));break;case"dots":dg[n]||(dg[n]=new lg(e));break;case"dashed":dg[n]||(dg[n]=new cg(e));break;case"zigzag-line":dg[n]||(dg[n]=new hg(e));break;default:dg[n="hachure"]||(dg[n]=new og(e))}return dg[n]}(e,xg).fillPolygons(t,e)}function Rg(t){return t.randomizer||(t.randomizer=new fg(t.seed||0)),t.randomizer.next()}function Pg(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return n.roughness*i*(Rg(n)*(e-t)+t)}function Mg(t,e){return Pg(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Eg(t,e,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,o=Og(t,e,n,i,r,!0,!1);if(a)return o;var s=Og(t,e,n,i,r,!0,!0);return o.concat(s)}function Og(t,e,n,i,r,a,o){var s,u=Math.pow(t-n,2)+Math.pow(e-i,2),l=Math.sqrt(u);s=l<200?1:l>500?.4:-.0016668*l+1.233334;var c=r.maxRandomnessOffset||0;c*c*100>u&&(c=l/10);var h=c/2,d=.2+.2*Rg(r),f=r.bowing*r.maxRandomnessOffset*(i-e)/200,v=r.bowing*r.maxRandomnessOffset*(t-n)/200;f=Mg(f,r,s),v=Mg(v,r,s);var p=[],y=function(){return Mg(h,r,s)},g=function(){return Mg(c,r,s)},m=r.preserveVertices;return a&&(o?p.push({op:"move",data:[t+(m?0:y()),e+(m?0:y())]}):p.push({op:"move",data:[t+(m?0:Mg(c,r,s)),e+(m?0:Mg(c,r,s))]})),o?p.push({op:"bcurveTo",data:[f+t+(n-t)*d+y(),v+e+(i-e)*d+y(),f+t+2*(n-t)*d+y(),v+e+2*(i-e)*d+y(),n+(m?0:y()),i+(m?0:y())]}):p.push({op:"bcurveTo",data:[f+t+(n-t)*d+g(),v+e+(i-e)*d+g(),f+t+2*(n-t)*d+g(),v+e+2*(i-e)*d+g(),n+(m?0:g()),i+(m?0:g())]}),p}function Lg(t,e,n){var i=[];i.push([t[0][0]+Mg(e,n),t[0][1]+Mg(e,n)]),i.push([t[0][0]+Mg(e,n),t[0][1]+Mg(e,n)]);for(var r=1;r<t.length;r++)i.push([t[r][0]+Mg(e,n),t[r][1]+Mg(e,n)]),r===t.length-1&&i.push([t[r][0]+Mg(e,n),t[r][1]+Mg(e,n)]);return Ig(i,null,n)}function Ig(t,e,n){var i=t.length,r=[];if(i>3){var a=[],o=1-n.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(var s=1;s+2<i;s++){var u=t[s];a[0]=[u[0],u[1]],a[1]=[u[0]+(o*t[s+1][0]-o*t[s-1][0])/6,u[1]+(o*t[s+1][1]-o*t[s-1][1])/6],a[2]=[t[s+1][0]+(o*t[s][0]-o*t[s+2][0])/6,t[s+1][1]+(o*t[s][1]-o*t[s+2][1])/6],a[3]=[t[s+1][0],t[s+1][1]],r.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){var l=n.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+Mg(l,n),e[1]+Mg(l,n)]})}}else 3===i?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===i&&r.push.apply(r,g(Eg(t[0][0],t[0][1],t[1][0],t[1][1],n)));return r}function Dg(t,e,n,i,r,a,o,s){var u=[],l=[];if(0===s.roughness){t/=4,l.push([e+i*Math.cos(-t),n+r*Math.sin(-t)]);for(var c=0;c<=2*Math.PI;c+=t){var h=[e+i*Math.cos(c),n+r*Math.sin(c)];u.push(h),l.push(h)}l.push([e+i*Math.cos(0),n+r*Math.sin(0)]),l.push([e+i*Math.cos(t),n+r*Math.sin(t)])}else{var d=Mg(.5,s)-Math.PI/2;l.push([Mg(a,s)+e+.9*i*Math.cos(d-t),Mg(a,s)+n+.9*r*Math.sin(d-t)]);for(var f=2*Math.PI+d-.01,v=d;v<f;v+=t){var p=[Mg(a,s)+e+i*Math.cos(v),Mg(a,s)+n+r*Math.sin(v)];u.push(p),l.push(p)}l.push([Mg(a,s)+e+i*Math.cos(d+2*Math.PI+.5*o),Mg(a,s)+n+r*Math.sin(d+2*Math.PI+.5*o)]),l.push([Mg(a,s)+e+.98*i*Math.cos(d+o),Mg(a,s)+n+.98*r*Math.sin(d+o)]),l.push([Mg(a,s)+e+.9*i*Math.cos(d+.5*o),Mg(a,s)+n+.9*r*Math.sin(d+.5*o)])}return[l,u]}function jg(t,e,n,i,r,a,o,s,u){var l=a+Mg(.1,u),c=[];c.push([Mg(s,u)+e+.9*i*Math.cos(l-t),Mg(s,u)+n+.9*r*Math.sin(l-t)]);for(var h=l;h<=o;h+=t)c.push([Mg(s,u)+e+i*Math.cos(h),Mg(s,u)+n+r*Math.sin(h)]);return c.push([e+i*Math.cos(o),n+r*Math.sin(o)]),c.push([e+i*Math.cos(o),n+r*Math.sin(o)]),Ig(c,null,u)}function Ug(t){return g(t)}function Wg(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function Ng(t,e,n){var i=Wg(e,n);if(0===i)return Wg(t,e);var r=((t[0]-e[0])*(n[0]-e[0])+(t[1]-e[1])*(n[1]-e[1]))/i;return Wg(t,Fg(e,n,r=Math.max(0,Math.min(1,r))))}function Fg(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function zg(t,e,n,i){var r,a,o=i||[];if(function(t,e){var n=t[e+0],i=t[e+1],r=t[e+2],a=t[e+3],o=3*i[0]-2*n[0]-a[0];o*=o;var s=3*i[1]-2*n[1]-a[1];s*=s;var u=3*r[0]-2*a[0]-n[0];u*=u;var l=3*r[1]-2*a[1]-n[1];return o<u&&(o=u),s<(l*=l)&&(s=l),o+s}(t,e)<n){var s=t[e+0];o.length?(r=o[o.length-1],a=s,Math.sqrt(Wg(r,a))>1&&o.push(s)):o.push(s),o.push(t[e+3])}else{var u=.5,l=t[e+0],c=t[e+1],h=t[e+2],d=t[e+3],f=Fg(l,c,u),v=Fg(c,h,u),p=Fg(h,d,u),y=Fg(f,v,u),g=Fg(v,p,u),m=Fg(y,g,u);zg([l,f,y,m],0,n,o),zg([m,g,p,d],0,n,o)}return o}function Gg(t,e){return Hg(t,0,t.length,e)}function Hg(t,e,n,i,r){for(var a=r||[],o=t[e],s=t[n-1],u=0,l=1,c=e+1;c<n-1;++c){var h=Ng(t[c],o,s);h>u&&(u=h,l=c)}return Math.sqrt(u)>i?(Hg(t,e,l+1,i,a),Hg(t,l,n,i,a)):(a.length||a.push(o),a.push(s)),a}function Vg(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,n=arguments.length>2?arguments[2]:void 0,i=[],r=(t.length-1)/3,a=0;a<r;a++)zg(t,3*a,e,i);return n&&n>0?Hg(i,0,i.length,n):i}var Yg="none",Xg=function(){return u((function t(e){o(this,t),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}),[{key:"_o",value:function(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}},{key:"_d",value:function(t,e,n){return{shape:t,sets:e||[],options:n||this.defaultOptions}}},{key:"line",value:function(t,e,n,i,r){var a=this._o(r);return this._d("line",[wg(t,e,n,i,a)],a)}},{key:"rectangle",value:function(t,e,n,i,r){var a=this._o(r),o=[],s=function(t,e,n,i,r){return function(t,e){return Ag(t,!0,e)}([[t,e],[t+n,e],[t+n,e+i],[t,e+i]],r)}(t,e,n,i,a);if(a.fill){var u=[[t,e],[t+n,e],[t+n,e+i],[t,e+i]];"solid"===a.fillStyle?o.push(Cg([u],a)):o.push(_g([u],a))}return a.stroke!==Yg&&o.push(s),this._d("rectangle",o,a)}},{key:"ellipse",value:function(t,e,n,i,r){var a=this._o(r),o=[],s=Sg(n,i,a),u=Tg(t,e,a,s);if(a.fill)if("solid"===a.fillStyle){var l=Tg(t,e,a,s).opset;l.type="fillPath",o.push(l)}else o.push(_g([u.estimatedPoints],a));return a.stroke!==Yg&&o.push(u.opset),this._d("ellipse",o,a)}},{key:"circle",value:function(t,e,n,i){var r=this.ellipse(t,e,n,n,i);return r.shape="circle",r}},{key:"linearPath",value:function(t,e){var n=this._o(e);return this._d("linearPath",[Ag(t,!1,n)],n)}},{key:"arc",value:function(t,e,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0,u=this._o(s),l=[],c=Bg(t,e,n,i,r,a,o,!0,u);if(o&&u.fill)if("solid"===u.fillStyle){var h=Object.assign({},u);h.disableMultiStroke=!0;var d=Bg(t,e,n,i,r,a,!0,!1,h);d.type="fillPath",l.push(d)}else l.push(function(t,e,n,i,r,a,o){var s=t,u=e,l=Math.abs(n/2),c=Math.abs(i/2);l+=Mg(.01*l,o),c+=Mg(.01*c,o);for(var h=r,d=a;h<0;)h+=2*Math.PI,d+=2*Math.PI;d-h>2*Math.PI&&(h=0,d=2*Math.PI);for(var f=(d-h)/o.curveStepCount,v=[],p=h;p<=d;p+=f)v.push([s+l*Math.cos(p),u+c*Math.sin(p)]);return v.push([s+l*Math.cos(d),u+c*Math.sin(d)]),v.push([s,u]),_g([v],o)}(t,e,n,i,r,a,u));return u.stroke!==Yg&&l.push(c),this._d("arc",l,u)}},{key:"curve",value:function(t,e){var n=this._o(e),i=[],r=function(t,e){var n=Lg(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){var i=Lg(t,1.5*(1+.22*e.roughness),function(t){var e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));n=n.concat(i)}return{type:"path",ops:n}}(t,n);if(n.fill&&n.fill!==Yg&&t.length>=3){var a=Vg(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.length;if(n<3)throw new Error("A curve must have at least three points.");var i=[];if(3===n)i.push(Ug(t[0]),Ug(t[1]),Ug(t[2]),Ug(t[2]));else{var r=[];r.push(t[0],t[0]);for(var a=1;a<t.length;a++)r.push(t[a]),a===t.length-1&&r.push(t[a]);var o=[],s=1-e;i.push(Ug(r[0]));for(var u=1;u+2<r.length;u++){var l=r[u];o[0]=[l[0],l[1]],o[1]=[l[0]+(s*r[u+1][0]-s*r[u-1][0])/6,l[1]+(s*r[u+1][1]-s*r[u-1][1])/6],o[2]=[r[u+1][0]+(s*r[u][0]-s*r[u+2][0])/6,r[u+1][1]+(s*r[u][1]-s*r[u+2][1])/6],o[3]=[r[u+1][0],r[u+1][1]],i.push(o[1],o[2],o[3])}}return i}(t),10,(1+n.roughness)/2);"solid"===n.fillStyle?i.push(Cg([a],n)):i.push(_g([a],n))}return n.stroke!==Yg&&i.push(r),this._d("curve",i,n)}},{key:"polygon",value:function(t,e){var n=this._o(e),i=[],r=Ag(t,!0,n);return n.fill&&("solid"===n.fillStyle?i.push(Cg([t],n)):i.push(_g([t],n))),n.stroke!==Yg&&i.push(r),this._d("polygon",i,n)}},{key:"path",value:function(t,e){var n=this._o(e),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var r=n.fill&&"transparent"!==n.fill&&n.fill!==Yg,a=n.stroke!==Yg,o=!!(n.simplification&&n.simplification<1),s=function(t,e,n){var i,r=mg(gg(yg(t))),a=[],o=[],s=[0,0],u=[],l=function(){var t;u.length>=4&&(t=o).push.apply(t,g(Vg(u,1))),u=[]},c=function(){l(),o.length&&(a.push(o),o=[])},h=k(r);try{for(h.s();!(i=h.n()).done;){var d=i.value,f=d.key,v=d.data;switch(f){case"M":c(),s=[v[0],v[1]],o.push(s);break;case"L":l(),o.push([v[0],v[1]]);break;case"C":if(!u.length){var p=o.length?o[o.length-1]:s;u.push([p[0],p[1]])}u.push([v[0],v[1]]),u.push([v[2],v[3]]),u.push([v[4],v[5]]);break;case"Z":l(),o.push([s[0],s[1]])}}}catch(t){h.e(t)}finally{h.f()}if(c(),!n)return a;for(var y=[],m=0,b=a;m<b.length;m++){var x=Gg(b[m],n);x.length&&y.push(x)}return y}(t,0,o?4-4*n.simplification:(1+n.roughness)/2);return r&&("solid"===n.fillStyle?i.push(Cg(s,n)):i.push(_g(s,n))),a&&(o?s.forEach((function(t){i.push(Ag(t,!1,n))})):i.push(function(t,e){var n,i=mg(gg(yg(t))),r=[],a=[0,0],o=[0,0],s=k(i);try{var u=function(){var t=n.value,i=t.key,s=t.data;switch(i){case"M":var u=1*(e.maxRandomnessOffset||0),l=e.preserveVertices;r.push({op:"move",data:s.map((function(t){return t+(l?0:Mg(u,e))}))}),o=[s[0],s[1]],a=[s[0],s[1]];break;case"L":r.push.apply(r,g(Eg(o[0],o[1],s[0],s[1],e))),o=[s[0],s[1]];break;case"C":var c=y(s,6),h=c[0],d=c[1],f=c[2],v=c[3],p=c[4],m=c[5];r.push.apply(r,g(function(t,e,n,i,r,a,o,s){for(var u=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],c=[0,0],h=s.disableMultiStroke?1:2,d=s.preserveVertices,f=0;f<h;f++)0===f?u.push({op:"move",data:[o[0],o[1]]}):u.push({op:"move",data:[o[0]+(d?0:Mg(l[0],s)),o[1]+(d?0:Mg(l[0],s))]}),c=d?[r,a]:[r+Mg(l[f],s),a+Mg(l[f],s)],u.push({op:"bcurveTo",data:[t+Mg(l[f],s),e+Mg(l[f],s),n+Mg(l[f],s),i+Mg(l[f],s),c[0],c[1]]});return u}(h,d,f,v,p,m,o,e))),o=[p,m];break;case"Z":r.push.apply(r,g(Eg(o[0],o[1],a[0],a[1],e))),o=[a[0],a[1]]}};for(s.s();!(n=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}return{type:"path",ops:r}}(t,n))),this._d("path",i,n)}},{key:"opsToPath",value:function(t,e){var n,i="",r=k(t.ops);try{for(r.s();!(n=r.n()).done;){var a=n.value,o="number"==typeof e&&e>=0?a.data.map((function(t){return+t.toFixed(e)})):a.data;switch(a.op){case"move":i+="M".concat(o[0]," ").concat(o[1]," ");break;case"bcurveTo":i+="C".concat(o[0]," ").concat(o[1],", ").concat(o[2]," ").concat(o[3],", ").concat(o[4]," ").concat(o[5]," ");break;case"lineTo":i+="L".concat(o[0]," ").concat(o[1]," ")}}}catch(t){r.e(t)}finally{r.f()}return i.trim()}},{key:"toPaths",value:function(t){var e,n=t.sets||[],i=t.options||this.defaultOptions,r=[],a=k(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=null;switch(o.type){case"path":s={d:this.opsToPath(o),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Yg};break;case"fillPath":s={d:this.opsToPath(o),stroke:Yg,strokeWidth:0,fill:i.fill||Yg};break;case"fillSketch":s=this.fillSketch(o,i)}s&&r.push(s)}}catch(t){a.e(t)}finally{a.f()}return r}},{key:"fillSketch",value:function(t,e){var n=e.fillWeight;return n<0&&(n=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||Yg,strokeWidth:n,fill:Yg}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}])}(),Kg=function(){return u((function t(e,n){o(this,t),this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new Xg(n)}),[{key:"draw",value:function(t){var e,n=t.sets||[],i=t.options||this.getDefaultOptions(),r=this.ctx,a=t.options.fixedDecimalPlaceDigits,o=k(n);try{for(o.s();!(e=o.n()).done;){var s=e.value;switch(s.type){case"path":r.save(),r.strokeStyle="none"===i.stroke?"transparent":i.stroke,r.lineWidth=i.strokeWidth,i.strokeLineDash&&r.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(r.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(r,s,a),r.restore();break;case"fillPath":r.save(),r.fillStyle=i.fill||"";var u="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(r,s,a,u),r.restore();break;case"fillSketch":this.fillSketch(r,s,i)}}}catch(t){o.e(t)}finally{o.f()}}},{key:"fillSketch",value:function(t,e,n){var i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,e,n.fixedDecimalPlaceDigits),t.restore()}},{key:"_drawToContext",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();var r,a=k(e.ops);try{for(a.s();!(r=a.n()).done;){var o=r.value,s="number"==typeof n&&n>=0?o.data.map((function(t){return+t.toFixed(n)})):o.data;switch(o.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}}catch(t){a.e(t)}finally{a.f()}"fillPath"===e.type?t.fill(i):t.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(t,e,n,i,r){var a=this.gen.line(t,e,n,i,r);return this.draw(a),a}},{key:"rectangle",value:function(t,e,n,i,r){var a=this.gen.rectangle(t,e,n,i,r);return this.draw(a),a}},{key:"ellipse",value:function(t,e,n,i,r){var a=this.gen.ellipse(t,e,n,i,r);return this.draw(a),a}},{key:"circle",value:function(t,e,n,i){var r=this.gen.circle(t,e,n,i);return this.draw(r),r}},{key:"linearPath",value:function(t,e){var n=this.gen.linearPath(t,e);return this.draw(n),n}},{key:"polygon",value:function(t,e){var n=this.gen.polygon(t,e);return this.draw(n),n}},{key:"arc",value:function(t,e,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0,u=this.gen.arc(t,e,n,i,r,a,o,s);return this.draw(u),u}},{key:"curve",value:function(t,e){var n=this.gen.curve(t,e);return this.draw(n),n}},{key:"path",value:function(t,e){var n=this.gen.path(t,e);return this.draw(n),n}}])}(),qg=function(t,e){return new Kg(t,e)},Zg=3,Jg=1,Qg=1,$g=.95,tm=void 0,em=9,nm="hachure",im=void 0,rm=60,am=6,om=0,sm=void 0,um=void 0,lm=void 0,cm=1,hm=void 0,dm=void 0,fm=!1,vm=!1,pm=!0,ym=void 0,gm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},mm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bm=function(t,e){return function(n,i){e(n,i,t)}},km=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="arc",this.numberType=As}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=qg(a);r.highPerformanceSave();var s=Lr(t).arc,u=t.attribute,l=u.x,c=void 0===l?s.x:l,h=u.y,d=void 0===h?s.y:h;if(t.transMatrix.onlyTranslate()){var f=t.attribute,v=f.dx,p=void 0===v?s.dx:v,y=f.dy;c+=p,d+=void 0===y?s.dy:y,r.setTransformForCurrent()}else c=0,d=0,r.transformFromMatrix(t.transMatrix,!0);var g=new Kn,m=t.attribute,b=m.fill,k=void 0===b?s.fill:b,x=m.stroke,w=void 0===x?s.stroke:x,A=m.lineWidth,S=void 0===A?s.lineWidth:A,T=m.outerRadius,B=void 0===T?s.outerRadius:T,C=m.innerRadius,_=void 0===C?s.innerRadius:C,R=m.maxRandomnessOffset,P=void 0===R?Zg:R,M=m.roughness,E=void 0===M?Jg:M,O=m.bowing,L=void 0===O?Qg:O,I=m.curveFitting,D=void 0===I?$g:I,j=m.curveTightness,U=void 0===j?tm:j,W=m.curveStepCount,N=void 0===W?em:W,F=m.fillStyle,z=void 0===F?nm:F,G=m.fillWeight,H=void 0===G?im:G,V=m.hachureAngle,Y=void 0===V?rm:V,X=m.hachureGap,K=void 0===X?am:X,q=m.simplification,Z=void 0===q?om:q,J=m.dashOffset,Q=void 0===J?sm:J,$=m.dashGap,tt=void 0===$?um:$,et=m.zigzagOffset,nt=void 0===et?lm:et,it=m.seed,rt=void 0===it?cm:it,at=m.fillLineDash,ot=void 0===at?hm:at,st=m.fillLineDashOffset,ut=void 0===st?dm:st,lt=m.disableMultiStroke,ct=void 0===lt?fm:lt,ht=m.disableMultiStrokeFill,dt=void 0===ht?vm:ht,ft=m.preserveVertices,vt=void 0===ft?pm:ft,pt=m.fixedDecimalPlaceDigits,yt=void 0===pt?ym:pt;fu(t,g,c,d,B,_),o.path(g.toString(),{fill:k||void 0,stroke:w||void 0,strokeWidth:S,maxRandomnessOffset:P,roughness:E,bowing:L,curveFitting:D,curveTightness:U,curveStepCount:N,fillStyle:z,fillWeight:H,hachureAngle:Y,hachureGap:K,simplification:Z,dashOffset:Q,dashGap:tt,zigzagOffset:nt,seed:rt,fillLineDash:ot,fillLineDashOffset:ut,disableMultiStroke:ct,disableMultiStrokeFill:dt,preserveVertices:vt,fixedDecimalPlaceDigits:yt}),r.highPerformanceRestore()}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();km=gm([I(),bm(0,O(t.DefaultCanvasArcRender)),mm("design:paramtypes",[Object])],km);var xm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},wm=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).style="rough",t}return c(n,t),u(n,[{key:"drawSegmentItem",value:function(t,e,i,r,a,o,s,u,l,c,d,f,v,y,g){if(g)return p(h(n.prototype),"drawSegmentItem",this).call(this,t,e,i,r,a,o,s,u,l,c,d,f,v,y,g);t.highPerformanceSave();var m=t.canvas.nativeCanvas,b=qg(m,{}),k=new Kn;Ad(k,e,l,{offsetX:c,offsetY:d});var x=s.maxRandomnessOffset,w=void 0===x?Zg:x,A=s.roughness,S=void 0===A?Jg:A,T=s.bowing,B=void 0===T?Qg:T,C=s.curveFitting,_=void 0===C?$g:C,R=s.curveTightness,P=void 0===R?tm:R,M=s.curveStepCount,E=void 0===M?em:M,O=s.fillStyle,L=void 0===O?nm:O,I=s.fillWeight,D=void 0===I?im:I,j=s.hachureAngle,U=void 0===j?rm:j,W=s.hachureGap,N=void 0===W?am:W,F=s.simplification,z=void 0===F?om:F,G=s.dashOffset,H=void 0===G?sm:G,V=s.dashGap,Y=void 0===V?um:V,X=s.zigzagOffset,K=void 0===X?lm:X,q=s.seed,Z=void 0===q?cm:q,J=s.fillLineDash,Q=void 0===J?hm:J,$=s.fillLineDashOffset,tt=void 0===$?dm:$,et=s.disableMultiStroke,nt=void 0===et?fm:et,it=s.disableMultiStrokeFill,rt=void 0===it?vm:it,at=s.preserveVertices,ot=void 0===at?pm:at,st=s.fixedDecimalPlaceDigits,ut=void 0===st?ym:st,lt=s.fill,ct=s.stroke,ht=s.lineWidth;return Array.isArray(u)?u.forEach((function(t){lt=null!=lt?lt:t.fill,ct=null!=ct?ct:t.stroke,ht=null!=ht?ht:t.lineWidth})):(lt=null!=lt?lt:u.fill,ct=null!=ct?ct:u.stroke,ht=null!=ht?ht:u.lineWidth),b.path(k.toString(),{fill:i?lt:void 0,strokeWidth:ht,maxRandomnessOffset:w,roughness:S,bowing:B,curveFitting:_,curveTightness:P,curveStepCount:E,fillStyle:L,fillWeight:D,hachureAngle:U,hachureGap:N,simplification:z,dashOffset:H,dashGap:Y,zigzagOffset:K,seed:Z,fillLineDash:Q,fillLineDashOffset:tt,disableMultiStroke:nt,disableMultiStrokeFill:rt,preserveVertices:ot,fixedDecimalPlaceDigits:ut}),t.highPerformanceRestore(),!1}}])}(t.DefaultCanvasAreaRender);wm=xm([I()],wm);var Am=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Sm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tm=function(t,e){return function(n,i){e(n,i,t)}},Bm=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="circle",this.numberType=Bs}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=qg(a,{}),s=Lr(t).circle,u=t.attribute,l=u.x,c=void 0===l?s.x:l,h=u.y,d=void 0===h?s.y:h;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(c=0,d=0,r.transformFromMatrix(t.transMatrix,!0));var f=t.attribute,v=f.radius,p=void 0===v?s.radius:v,y=f.fill,g=void 0===y?s.fill:y,m=f.stroke,b=void 0===m?s.stroke:m,k=f.lineWidth,x=void 0===k?s.lineWidth:k;o.circle(c,d,p,{fill:g||void 0,stroke:b||void 0,strokeWidth:x,fillStyle:"zigzag",roughness:.5})}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();Bm=Am([I(),Tm(0,O(t.DefaultCanvasCircleRender)),Sm("design:paramtypes",[Object])],Bm);var Cm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},_m=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).style="rough",t}return c(n,t),u(n,[{key:"drawSegmentItem",value:function(t,e,i,r,a,o,s,u,l,c,d,f,v,y,g){if(y||g)return p(h(n.prototype),"drawSegmentItem",this).call(this,t,e,i,r,a,o,s,u,l,c,d,f,v,y,g);t.highPerformanceSave();var m=t.canvas.nativeCanvas,b=qg(m,{}),k=new Kn;bd(t.camera?t:t.nativeContext,e,l,c,{offsetX:d,offsetY:f});var x=s.maxRandomnessOffset,w=void 0===x?Zg:x,A=s.roughness,S=void 0===A?Jg:A,T=s.bowing,B=void 0===T?Qg:T,C=s.curveFitting,_=void 0===C?$g:C,R=s.curveTightness,P=void 0===R?tm:R,M=s.curveStepCount,E=void 0===M?em:M,O=s.fillStyle,L=void 0===O?nm:O,I=s.fillWeight,D=void 0===I?im:I,j=s.hachureAngle,U=void 0===j?rm:j,W=s.hachureGap,N=void 0===W?am:W,F=s.simplification,z=void 0===F?om:F,G=s.dashOffset,H=void 0===G?sm:G,V=s.dashGap,Y=void 0===V?um:V,X=s.zigzagOffset,K=void 0===X?lm:X,q=s.seed,Z=void 0===q?cm:q,J=s.fillLineDash,Q=void 0===J?hm:J,$=s.fillLineDashOffset,tt=void 0===$?dm:$,et=s.disableMultiStroke,nt=void 0===et?fm:et,it=s.disableMultiStrokeFill,rt=void 0===it?vm:it,at=s.preserveVertices,ot=void 0===at?pm:at,st=s.fixedDecimalPlaceDigits,ut=void 0===st?ym:st,lt=s.fill,ct=s.stroke,ht=s.lineWidth;return Array.isArray(u)?u.forEach((function(t){lt=null!=lt?lt:t.fill,ct=null!=ct?ct:t.stroke,ht=null!=ht?ht:t.lineWidth})):(lt=null!=lt?lt:u.fill,ct=null!=ct?ct:u.stroke,ht=null!=ht?ht:u.lineWidth),b.path(k.toString(),{fill:i?lt:void 0,stroke:r?ct:void 0,strokeWidth:ht,maxRandomnessOffset:w,roughness:S,bowing:B,curveFitting:_,curveTightness:P,curveStepCount:E,fillStyle:L,fillWeight:D,hachureAngle:U,hachureGap:N,simplification:z,dashOffset:H,dashGap:Y,zigzagOffset:K,seed:Z,fillLineDash:Q,fillLineDashOffset:tt,disableMultiStroke:nt,disableMultiStrokeFill:rt,preserveVertices:ot,fixedDecimalPlaceDigits:ut}),t.highPerformanceRestore(),!1}}])}(t.DefaultCanvasLineRender);_m=Cm([I()],_m);var Rm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Pm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mm=function(t,e){return function(n,i){e(n,i,t)}},Em=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="path",this.numberType=Ms}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=qg(a,{});r.highPerformanceSave();var s=Lr(t).path;r.transformFromMatrix(t.transMatrix,!0);var u=t.attribute,l=u.fill,c=void 0===l?s.fill:l,h=u.stroke,d=void 0===h?s.stroke:h,f=u.lineWidth,v=void 0===f?s.lineWidth:f,p=u.path,y=void 0===p?s.path:p,g=u.maxRandomnessOffset,m=void 0===g?Zg:g,b=u.roughness,k=void 0===b?Jg:b,x=u.bowing,w=void 0===x?Qg:x,A=u.curveFitting,S=void 0===A?$g:A,T=u.curveTightness,B=void 0===T?tm:T,C=u.curveStepCount,_=void 0===C?em:C,R=u.fillStyle,P=void 0===R?nm:R,M=u.fillWeight,E=void 0===M?im:M,O=u.hachureAngle,L=void 0===O?rm:O,I=u.hachureGap,D=void 0===I?am:I,j=u.simplification,U=void 0===j?om:j,W=u.dashOffset,N=void 0===W?sm:W,F=u.dashGap,z=void 0===F?um:F,G=u.zigzagOffset,H=void 0===G?lm:G,V=u.seed,Y=void 0===V?cm:V,X=u.fillLineDash,K=void 0===X?hm:X,q=u.fillLineDashOffset,Z=void 0===q?dm:q,J=u.disableMultiStroke,Q=void 0===J?fm:J,$=u.disableMultiStrokeFill,tt=void 0===$?vm:$,et=u.preserveVertices,nt=void 0===et?pm:et,it=u.fixedDecimalPlaceDigits,rt=void 0===it?ym:it;"string"==typeof y&&o.path(y,{fill:c||void 0,stroke:d||void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:k,bowing:w,curveFitting:S,curveTightness:B,curveStepCount:_,fillStyle:P,fillWeight:E,hachureAngle:L,hachureGap:D,simplification:U,dashOffset:N,dashGap:z,zigzagOffset:H,seed:Y,fillLineDash:K,fillLineDashOffset:Z,disableMultiStroke:Q,disableMultiStrokeFill:tt,preserveVertices:nt,fixedDecimalPlaceDigits:rt}),r.highPerformanceRestore()}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();Em=Rm([I(),Mm(0,O(t.DefaultCanvasPathRender)),Pm("design:paramtypes",[Object])],Em);var Om=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Lm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Im=function(t,e){return function(n,i){e(n,i,t)}},Dm=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="rect",this.numberType=Ls}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=qg(a);r.highPerformanceSave();var s=Lr(t).rect,u=t.attribute,l=u.x,c=void 0===l?s.x:l,h=u.y,d=void 0===h?s.y:h;if(t.transMatrix.onlyTranslate()){var f=t.attribute,v=f.dx,p=void 0===v?s.dx:v,y=f.dy;c+=p,d+=void 0===y?s.dy:y,r.setTransformForCurrent()}else c=0,d=0,r.transformFromMatrix(t.transMatrix,!0);var g=t.attribute,m=g.fill,b=void 0===m?s.fill:m,k=g.stroke,x=void 0===k?s.stroke:k,w=g.fillColor,A=void 0===w?s.fill:w,S=g.strokeColor,T=void 0===S?s.stroke:S,B=g.x1,C=g.y1,_=g.lineWidth,R=void 0===_?s.lineWidth:_,P=g.maxRandomnessOffset,M=void 0===P?Zg:P,E=g.roughness,O=void 0===E?Jg:E,L=g.bowing,I=void 0===L?Qg:L,D=g.curveFitting,j=void 0===D?$g:D,U=g.curveTightness,W=void 0===U?tm:U,N=g.curveStepCount,F=void 0===N?em:N,z=g.fillStyle,G=void 0===z?nm:z,H=g.fillWeight,V=void 0===H?im:H,Y=g.hachureAngle,X=void 0===Y?rm:Y,K=g.hachureGap,q=void 0===K?am:K,Z=g.simplification,J=void 0===Z?om:Z,Q=g.dashOffset,$=void 0===Q?sm:Q,tt=g.dashGap,et=void 0===tt?um:tt,nt=g.zigzagOffset,it=void 0===nt?lm:nt,rt=g.seed,at=void 0===rt?cm:rt,ot=g.fillLineDash,st=void 0===ot?hm:ot,ut=g.fillLineDashOffset,lt=void 0===ut?dm:ut,ct=g.disableMultiStroke,ht=void 0===ct?fm:ct,dt=g.disableMultiStrokeFill,ft=void 0===dt?vm:dt,vt=g.preserveVertices,pt=void 0===vt?pm:vt,yt=g.fixedDecimalPlaceDigits,gt=void 0===yt?ym:yt,mt=t.attribute,bt=mt.width,kt=void 0===bt?s.width:bt,xt=mt.height,wt=void 0===xt?s.height:xt;kt=(null!=kt?kt:B-c)||0,wt=(null!=wt?wt:C-d)||0,o.rectangle(c,d,kt,wt,{fill:b?A:void 0,stroke:x?T:void 0,strokeWidth:R,maxRandomnessOffset:M,roughness:O,bowing:I,curveFitting:j,curveTightness:W,curveStepCount:F,fillStyle:G,fillWeight:V,hachureAngle:X,hachureGap:q,simplification:J,dashOffset:$,dashGap:et,zigzagOffset:it,seed:at,fillLineDash:st,fillLineDashOffset:lt,disableMultiStroke:ht,disableMultiStrokeFill:ft,preserveVertices:pt,fixedDecimalPlaceDigits:gt}),r.highPerformanceRestore()}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();Dm=Om([I(),Im(0,O(t.DefaultCanvasRectRender)),Lm("design:paramtypes",[Object])],Dm);var jm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Um=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wm=function(t,e){return function(n,i){e(n,i,t)}},Nm=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="symbol",i.numberType=js,i.style="rough",i}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=qg(a);r.highPerformanceSave();var s=Lr(t).symbol,u=this.transform(t,s,r),l=u.x,c=u.y;u.z,u.lastModelMatrix;var h=t.getParsedPath();if(h){var d=t.attribute,f=d.fill,v=void 0===f?s.fill:f,p=d.stroke,y=void 0===p?s.stroke:p,g=d.fillColor,m=void 0===g?s.fill:g,b=d.strokeColor,k=void 0===b?s.stroke:b,x=d.size,w=void 0===x?s.size:x,A=d.lineWidth,S=void 0===A?s.lineWidth:A,T=d.maxRandomnessOffset,B=void 0===T?Zg:T,C=d.roughness,_=void 0===C?Jg:C,R=d.bowing,P=void 0===R?Qg:R,M=d.curveFitting,E=void 0===M?$g:M,O=d.curveTightness,L=void 0===O?tm:O,I=d.curveStepCount,D=void 0===I?em:I,j=d.fillStyle,U=void 0===j?nm:j,W=d.fillWeight,N=void 0===W?im:W,F=d.hachureAngle,z=void 0===F?rm:F,G=d.hachureGap,H=void 0===G?am:G,V=d.simplification,Y=void 0===V?om:V,X=d.dashOffset,K=void 0===X?sm:X,q=d.dashGap,Z=void 0===q?um:q,J=d.zigzagOffset,Q=void 0===J?lm:J,$=d.seed,tt=void 0===$?cm:$,et=d.fillLineDash,nt=void 0===et?hm:et,it=d.fillLineDashOffset,rt=void 0===it?dm:it,at=d.disableMultiStroke,ot=void 0===at?fm:at,st=d.disableMultiStrokeFill,ut=void 0===st?vm:st,lt=d.preserveVertices,ct=void 0===lt?pm:lt,ht=d.fixedDecimalPlaceDigits,dt=void 0===ht?ym:ht,ft="";if(h.drawToSvgPath)ft=h.drawToSvgPath(w,l,c);else{var vt=new Kn;h.draw(vt,w,l,c)&&vt.closePath(),ft=vt.toString()}o.path(ft,{fill:v?m:void 0,stroke:y?k:void 0,strokeWidth:S,maxRandomnessOffset:B,roughness:_,bowing:P,curveFitting:E,curveTightness:L,curveStepCount:D,fillStyle:U,fillWeight:N,hachureAngle:z,hachureGap:H,simplification:Y,dashOffset:K,dashGap:Z,zigzagOffset:Q,seed:tt,fillLineDash:nt,fillLineDashOffset:rt,disableMultiStroke:ot,disableMultiStrokeFill:ut,preserveVertices:ct,fixedDecimalPlaceDigits:dt}),r.highPerformanceRestore()}}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}(Ph);Nm=jm([I(),Wm(0,O(t.DefaultCanvasSymbolRender)),Um("design:paramtypes",[Object])],Nm);var Fm=new w((function(t){t(Bm).toSelf().inSingletonScope(),t(pf).to(Bm),t(Dm).toSelf().inSingletonScope(),t(pf).to(Dm),t(Em).toSelf().inSingletonScope(),t(pf).to(Em),t(Nm).toSelf().inSingletonScope(),t(pf).to(Nm),t(_m).toSelf().inSingletonScope(),t(pf).to(_m),t(wm).toSelf().inSingletonScope(),t(pf).to(wm),t(km).toSelf().inSingletonScope(),t(pf).to(km)})),zm=Symbol.for("MathPickerContribution"),Gm=Symbol.for("MathArcPicker"),Hm=Symbol.for("MathAreaPicker"),Vm=Symbol.for("MathCirclePicker"),Ym=Symbol.for("MathImagePicker"),Xm=Symbol.for("MathLinePicker"),Km=Symbol.for("MathPathPicker"),qm=Symbol.for("MathRectPicker"),Zm=Symbol.for("MathSymbolPicker"),Jm=Symbol.for("MathTextPicker"),Qm=Symbol.for("MathPolygonPicker"),$m=Symbol.for("MathGlyphPicker"),tb=Symbol.for("CanvasArcPicker"),eb=Symbol.for("CanvasArc3dPicker"),nb=Symbol.for("CanvasAreaPicker"),ib=Symbol.for("CanvasCirclePicker"),rb=Symbol.for("CanvasImagePicker"),ab=Symbol.for("CanvasLinePicker"),ob=Symbol.for("CanvasPathPicker"),sb=Symbol.for("CanvasRectPicker"),ub=Symbol.for("CanvasRect3dPicker"),lb=Symbol.for("CanvasSymbolPicker"),cb=Symbol.for("CanvasTextPicker"),hb=Symbol.for("CanvasPolygonPicker"),db=Symbol.for("CanvasPyramid3dPicker"),fb=Symbol.for("CanvasRichTextPicker"),vb=Symbol.for("CanvasGlyphPicker"),pb=Symbol.for("CanvasGroupPicker"),yb=Symbol.for("CanvasPickerContribution"),gb={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},mb=Object.keys(gb);function bb(t){return Ch.richtext(t?t.attribute:{})}bb.Text=function(t){return Object.assign({type:"rich/text"},t)},bb.Image=function(t){return Object.assign({type:"rich/image"},t)};var kb=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function xb(t,e){if(xt(t))return t.forEach((function(t){return xb(t,e)}));e.push(t)}var wb=Vs;function Ab(t){if(!t||!t.$$typeof)return t;var e=t.type,n=t.props,i=n.attribute,r=n.children,a=n.stateProxy,o=n.id,s=n.name,u=e({attribute:i}),l=function(t,e,n){var i,r=!1;switch(t.type){case"richtext":break;case"rich/text":i=t.attribute||{},n&&(i.text=n),t.attribute=i;break;case"rich/image":i=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((function(n){var i=gb[n];i&&t.on(i,e[n])})):"richtext"===t.type&&(t.attribute.textConfig=n.map((function(t){return Ab(t)})).filter((function(t){return t}))),i}(u,t.props,r);return l||(a&&(u.stateProxy=a),u.id=o,u.name=s,Sb(r,u),u)}function Sb(t,e){xt(t)?t.forEach((function(t){if(xt(t))Sb(t,e);else{var n=Ab(t);n&&n.type&&e.add(n)}})):t&&e.add(Ab(t))}var Tb=function(){return u((function t(e){var n=this;o(this,t),this.onPointerDown=function(t){var e=t.target,i=n.rootNode,r=e===i;if(e&&!r){var a,o=function(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!r){e.attribute.pickable=!1;var n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.attribute.pickable=!0,a!==n&&(a&&(t.type="dragleave",t.target=a,a.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),(a=n)&&(t.type="dragover",t.target=a,a.dispatchEvent(t)))}},s=!1;null==i||i.addEventListener("pointermove",o);var u=function(){s&&(a&&(t.type="drop",t.target=a,a.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",u,{once:!0}),e.addEventListener("pointerupoutside",u,{once:!0})}},this.rootNode=e,this.initEvents()}),[{key:"initEvents",value:function(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}},{key:"removeEvents",value:function(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}},{key:"release",value:function(){this.removeEvents(),this.rootNode=null}}])}(),Bb=function(t,e){var n=e.x-t.x,i=e.y-t.y;return Math.abs(n)>Math.abs(i)?n>0?"right":"left":i>0?"down":"up"},Cb=function(t,e){var n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return Math.sqrt(n*n+i*i)},_b=function(t){function n(t){var i,r,a,s,u,l,c,h,d,v,p,y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,n),(i=e(this,n)).cachedEvents=[],i.startPoints=[],i.processEvent={},i.throttleTimer=0,i.emitThrottles=[],i.lastTapTarget=null,i.onStart=function(t){i.reset(),i.startTime=Gr.now();var e=f(i),n=e.cachedEvents,r=e.startPoints;t&&n.push(t.clone()),r.length=n.length;for(var a=0;a<n.length;a++){var o=n[a],s={x:o.x,y:o.y};r[a]=s}if(1!==r.length)i.startDistance=Cb(r[0],r[1]),i.center=function(t){var e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};for(var n=0,i=0,r=0;r<e;)n+=t[r].x,i+=t[r].y,r++;return{x:Math.round(n/e),y:Math.round(i/e)}}([r[0],r[1]]);else{var u=n[0];i.pressTimeout=setTimeout((function(){u.direction="none",u.deltaX=0,u.deltaY=0,u.points=r,i.triggerStartEvent("press",u),i.triggerEvent("press",u),i.eventType="press",i.direction="none"}),i.config.press.time)}},i.onMove=function(t){i.clearPressTimeout();var e=f(i),n=e.startPoints,r=e.cachedEvents;if(n.length){for(var a=t.clone(),o=a.x,s=a.y,u=a.pointerId,l=0,c=r.length;l<c;l++)if(u===r[l].pointerId){r[l]=a;break}var h={x:o,y:s},d=r.map((function(t){return{x:t.x,y:t.y}})),v=Gr.now();if(i.prevMoveTime=i.lastMoveTime,i.prevMovePoint=i.lastMovePoint,i.lastMoveTime=v,i.lastMovePoint=h,1===n.length){var p=n[0],y=o-p.x,g=s-p.y,m=i.direction||Bb(p,h);i.direction=m;var b=i.getEventType(h);return a.direction=m,a.deltaX=y,a.deltaY=g,a.points=d,i.triggerStartEvent(b,a),void i.triggerEvent(b,a)}var k=f(i).startDistance,x=Cb(d[0],d[1]);a.scale=x/k,a.center=i.center,a.points=d,i.triggerStartEvent("pinch",a),i.triggerEvent("pinch",a)}},i.onEnd=function(t){var e=t.clone(),n=f(i),r=n.cachedEvents,a=n.startPoints,o=r.map((function(t){return{x:t.x,y:t.y}}));if(e.points=o,i.triggerEndEvent(e),1===r.length){var s=Gr.now(),u=i.lastMoveTime;if(s-u<100){var l=u-(i.prevMoveTime||i.startTime);if(l>0){var c=i.prevMovePoint||a[0],h=i.lastMovePoint||a[0],d=Cb(c,h),v=d/l;v>i.config.swipe.velocity&&d>i.config.swipe.threshold&&(e.velocity=v,e.direction=Bb(c,h),i.triggerEvent("swipe",e))}}s-i.lastTapTime<i.config.tap.interval&&t.target===i.lastTapTarget?i.tapCount++:i.tapCount=1,i.lastTapTime=s,i.lastTapTarget=t.target,1===i.tapCount?i.triggerEvent("tap",e):2===i.tapCount&&(i.triggerEvent("doubletap",e),i.tapCount=0)}for(var p=0,y=r.length;p<y;p++)if(r[p].pointerId===e.pointerId){r.splice(p,1),a.splice(p,1);break}i.reset(),r.length>0&&i.onStart()},i.element=t,i.tapCount=0,i.lastTapTime=0,i.config={press:{time:null!==(a=null===(r=null==y?void 0:y.press)||void 0===r?void 0:r.time)&&void 0!==a?a:251,threshold:null!==(u=null===(s=null==y?void 0:y.press)||void 0===s?void 0:s.threshold)&&void 0!==u?u:9},swipe:{threshold:null!==(c=null===(l=null==y?void 0:y.swipe)||void 0===l?void 0:l.threshold)&&void 0!==c?c:10,velocity:null!==(d=null===(h=null==y?void 0:y.swipe)||void 0===h?void 0:h.velocity)&&void 0!==d?d:.3},tap:{interval:null!==(p=null===(v=null==y?void 0:y.tap)||void 0===v?void 0:v.interval)&&void 0!==p?p:300}},i.initEvents(),i}return c(n,t),u(n,[{key:"initEvents",value:function(){var t=this.element;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}},{key:"removeEvents",value:function(){var t=this.element;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}},{key:"release",value:function(){this.removeEvents(),this.element=null}},{key:"getEventType",value:function(t){var e,n=this.eventType,i=this.startTime,r=this.startPoints;return n||(e=Gr.now()-i>this.config.press.time&&Cb(r[0],t)<this.config.press.threshold?"press":"pan",this.eventType=e,e)}},{key:"enable",value:function(t){this.processEvent[t]=!0}},{key:"isProcess",value:function(t){return this.processEvent[t]}},{key:"pushEvent",value:function(t,e){for(var n=this.emitThrottles,i={type:t,ev:e},r=0,a=n.length;r<a;r++)if(n[r].type===t)return void n.splice(r,1,i);n.push(i)}},{key:"clearPressTimeout",value:function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}},{key:"reset",value:function(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}},{key:"triggerEvent",value:function(t,e){var n=this;this.pushEvent(t,e);var i=this.throttleTimer,r=this.emitThrottles;i||(this.throttleTimer=Si.global.getRequestAnimationFrame()((function(){for(var t=0,e=r.length;t<e;t++){var i=r[t],a=i.type,o=i.ev;n.emitEvent(a,o)}n.throttleTimer=0,n.emitThrottles.length=0})))}},{key:"triggerStartEvent",value:function(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent("".concat(t,"start"),e))}},{key:"triggerEndEvent",value:function(t){var e=this,n=this.processEvent;Object.keys(n).forEach((function(i){e.triggerEvent("".concat(i,"end"),t),"press"===i&&e.triggerEvent("".concat(i,"up"),t),delete n[i]}))}},{key:"emitEvent",value:function(t,e){var n=this.element._events["*"];if(n)if("fn"in n)n.fn.call(n.context,e,t);else for(var i=0,r=n.length;i<r&&!e.propagationImmediatelyStopped;i++)n[i].fn.call(n[i].context,e,t);this.emit(t,e)}}])}(dt),Rb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Pb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mb=[0,0,0],Eb=function(){return u((function t(e,n){o(this,t),this.fillAttributes=Object.assign(Object.assign({},$n),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},ei),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},ni),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;var i=e.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=e,this.matrix=new re(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new re(1,0,0,1,0,0),this._clearMatrix=new re(1,0,0,1,0,0),this.baseGlobalAlpha=1}),[{key:"fillStyle",get:function(){return this.nativeContext.fillStyle},set:function(t){this.nativeContext.fillStyle=t}},{key:"font",get:function(){return this.nativeContext.font},set:function(t){this.nativeContext.font=t}},{key:"globalAlpha",get:function(){return this.nativeContext.globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}},{key:"lineCap",get:function(){return this.nativeContext.lineCap},set:function(t){this.nativeContext.lineCap=t}},{key:"lineDashOffset",get:function(){return this.nativeContext.lineDashOffset},set:function(t){this.nativeContext.lineDashOffset=t}},{key:"lineJoin",get:function(){return this.nativeContext.lineJoin},set:function(t){this.nativeContext.lineJoin=t}},{key:"lineWidth",get:function(){return this.nativeContext.lineWidth},set:function(t){this.nativeContext.lineWidth=t}},{key:"miterLimit",get:function(){return this.nativeContext.miterLimit},set:function(t){this.nativeContext.miterLimit=t}},{key:"shadowBlur",get:function(){return this.nativeContext.shadowBlur},set:function(t){this.nativeContext.shadowBlur=t}},{key:"shadowColor",get:function(){return this.nativeContext.shadowColor},set:function(t){this.nativeContext.shadowColor=t}},{key:"shadowOffsetX",get:function(){return this.nativeContext.shadowOffsetX},set:function(t){this.nativeContext.shadowOffsetX=t}},{key:"shadowOffsetY",get:function(){return this.nativeContext.shadowOffsetY},set:function(t){this.nativeContext.shadowOffsetY=t}},{key:"strokeStyle",get:function(){return this.nativeContext.strokeStyle},set:function(t){this.nativeContext.strokeStyle=t}},{key:"textAlign",get:function(){return this.nativeContext.textAlign},set:function(t){this.nativeContext.textAlign=t}},{key:"textBaseline",get:function(){return this.nativeContext.textBaseline},set:function(t){this.nativeContext.textBaseline=t}},{key:"inuse",get:function(){return!!this._inuse},set:function(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}},{key:"reset",value:function(){this.stack.length&&Le.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new re(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getContext",value:function(){return this.nativeContext}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return fh.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}},{key:"restore",value:function(){this.nativeContext.restore(),this.stack.length>0&&(fh.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(fh.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*a),o&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,a),o&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.disableBeginPath||this.nativeContext.beginPath()}},{key:"clip",value:function(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}},{key:"arc",value:function(t,e,n,i,r,a,o){if(o=o||0,this.camera){var s=[];!function(t,e,n,i,r,a,o,s){if(s)for(;n>e;)n-=jt;else for(;n<e;)n+=jt;for(var u=Lt/3*(n>e?1:-1),l=e,c=l;c!==n;){c=u>0?Math.min(c+u,n):Math.max(c+u,n);var h=Math.abs(c-l),d=4*Math.tan(h/4)/3,f=c<l?-1:1,v=Math.cos(l),p=Math.sin(l),y=Math.cos(c),g=Math.sin(c),m=v*a+i,b=p*o+r,k=y*a+i,x=g*o+r,w=a*d*f,A=o*d*f;t.push([m-w*p,b+A*v,k+w*g,x-A*y,k,x]),l=c}}(s,i,r,t,e,n,n,a);for(var u=0;u<s.length;++u){var l=s[u];this.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5],o)}}else this.nativeContext.arc(t,e,n,i,r,a)}},{key:"arcTo",value:function(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a,o){if(o=o||0,this.camera){var s=o,u=o;this.modelMatrix&&(ap(Mb,[t,e,o],this.modelMatrix),t=Mb[0],e=Mb[1],s=Mb[2],ap(Mb,[n,i,o],this.modelMatrix),n=Mb[0],i=Mb[1],u=Mb[2],ap(Mb,[r,a,o],this.modelMatrix),r=Mb[0],a=Mb[1],o=Mb[2]);var l=this.camera.vp(r,a,o);r=l.x,a=l.y,t=(l=this.camera.vp(t,e,s)).x,e=l.y,n=(l=this.camera.vp(n,i,u)).x,i=l.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,a)}},{key:"closePath",value:function(){this.nativeContext.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){null==s?this.nativeContext.ellipse(t,e,n,i,r,a,o):this.nativeContext.ellipse(t,e,n,i,r,a,o,s)}},{key:"lineTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(ap(Mb,[t,e,n],this.modelMatrix),t=Mb[0],e=Mb[1],n=Mb[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}},{key:"moveTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(ap(Mb,[t,e,n],this.modelMatrix),t=Mb[0],e=Mb[1],n=Mb[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i,r){if(r=r||0,this.camera){var a=r;this.modelMatrix&&(ap(Mb,[t,e,r],this.modelMatrix),t=Mb[0],e=Mb[1],a=Mb[2],ap(Mb,[n,i,r],this.modelMatrix),n=Mb[0],i=Mb[1],r=Mb[2]);var o=this.camera.vp(n,i,r);n=o.x,i=o.y,t=(o=this.camera.vp(t,e,a)).x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}},{key:"createImageData",value:function(){var t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}},{key:"createLinearGradient",value:function(t,e,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}},{key:"createPattern",value:function(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}},{key:"createRadialGradient",value:function(t,e,n,i,r,a){return this.nativeContext.createRadialGradient(t,e,n,i,r,a)}},{key:"createConicGradient",value:function(t,e,n,i){var r,a=!1,o=this;return{stops:[],addColorStop:function(t,e){this.stops.push([t,e]),a=!0},GetPattern:function(s,u,l){return a&&(l||(l=i-n),r=mu(o,this.stops,t,e,l,n,i,s,u),a=!1),r}}}},{key:"fill",value:function(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}},{key:"fillRect",value:function(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}},{key:"project",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(ap(Mb,[t,e,n],this.modelMatrix),t=Mb[0],e=Mb[1],n=Mb[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}},{key:"view",value:function(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(ap(Mb,[t,e,n],this.modelMatrix),t=Mb[0],e=Mb[1],n=Mb[2]),this.camera.view(t,e,n)):[t,e,n]}},{key:"fillText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(ap(Mb,[e,n,i],this.modelMatrix),e=Mb[0],n=Mb[1],i=Mb[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.fillText(t,e,n)}},{key:"getImageData",value:function(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}},{key:"getLineDash",value:function(){return this.nativeContext.getLineDash()}},{key:"isPointInPath",value:function(t,e){return this.nativeContext.isPointInPath(t,e)}},{key:"isPointInStroke",value:function(t,e){return this.nativeContext.isPointInStroke(t,e)}},{key:"measureText",value:function(t){var e,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Si.global.measureTextMethod;if(!r||"native"===r)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=Si.graphicUtil.createTextMeasureInstance({},{},(function(){return i.canvas.nativeCanvas})));var a=null!==(e=this.fontFamily)&&void 0!==e?e:ni.fontFamily,o=null!==(n=this.fontSize)&&void 0!==n?n:ni.fontSize;return this.mathTextMeasure.textSpec.fontFamily===a&&this.mathTextMeasure.textSpec.fontSize===o||(this.mathTextMeasure.textSpec.fontFamily=a,this.mathTextMeasure.textSpec.fontSize=o,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,r)}},{key:"putImageData",value:function(t,e,n){this.nativeContext.putImageData(t,e,n)}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?e[0]&&n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}},{key:"stroke",value:function(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}},{key:"strokeRect",value:function(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(ap(Mb,[e,n,i],this.modelMatrix),e=Mb[0],n=Mb[1],i=Mb[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.strokeText(t,e,n)}},{key:"drawImage",value:function(){var t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}},{key:"setCommonStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);var a=Object.create(r[0]);return r.forEach((function(t,e){0!==e&&Object.assign(a,t)})),this._setCommonStyle(t,e,n,i,a)}return this._setCommonStyle(t,e,n,i,r)}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.fillAttributes);var o=e.fillOpacity,s=void 0===o?r.fillOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u,c=e.fill,h=void 0===c?r.fill:c;s>1e-12&&l>1e-12?(a.globalAlpha=s*l*this.baseGlobalAlpha,a.fillStyle=Lh(this,h,t,n,i)):a.globalAlpha=s*l*this.baseGlobalAlpha}},{key:"setShadowBlendStyle",value:function(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowBlendStyle(t,n[0]);var i=Object.create(n[0]);return n.forEach((function(t,e){0!==e&&Object.assign(i,t)})),this._setShadowBlendStyle(t,e,i)}return this._setShadowBlendStyle(t,e,n)}},{key:"_setShadowBlendStyle",value:function(t,e,n){var i=this.nativeContext;n||(n=this.fillAttributes);var r=e.opacity,a=void 0===r?n.opacity:r,o=e.shadowBlur,s=void 0===o?n.shadowBlur:o,u=e.shadowColor,l=void 0===u?n.shadowColor:u,c=e.shadowOffsetX,h=void 0===c?n.shadowOffsetX:c,d=e.shadowOffsetY,f=void 0===d?n.shadowOffsetY:d,v=e.blur,p=void 0===v?n.blur:v,y=e.globalCompositeOperation,g=void 0===y?n.globalCompositeOperation:y;a<=1e-12||(s||h||f?(i.shadowBlur=s*this.dpr,i.shadowColor=l,i.shadowOffsetX=h*this.dpr,i.shadowOffsetY=f*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),p?(i.filter="blur(".concat(p,"px)"),this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1),g?(i.globalCompositeOperation=g,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(i.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}},{key:"setStrokeStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);var a=Object.create(r[0]);return r.forEach((function(t,e){0!==e&&Object.assign(a,t)})),this._setStrokeStyle(t,e,n,i,a)}return this._setStrokeStyle(t,e,n,i,r)}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,y=e.lineDash,g=void 0===y?r.lineDash:y,m=e.lineCap,b=void 0===m?r.lineCap:m,k=e.miterLimit,x=void 0===k?r.miterLimit:k;a.globalAlpha=s*l*this.baseGlobalAlpha,a.lineWidth=Oh(this,h,this.dpr),a.strokeStyle=Lh(this,f,t,n,i),a.lineJoin=p,g&&a.setLineDash(g),a.lineCap=b,a.miterLimit=x}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e,n){var i=this.nativeContext;e||(e=this.textAttributes);var r=t.scaleIn3d,a=void 0===r?e.scaleIn3d:r;t.font?i.font=t.font:i.font=Lu(t,e,a&&this.camera&&this.camera.getProjectionScale(n));var o=t.fontFamily,s=void 0===o?e.fontFamily:o,u=t.fontSize,l=void 0===u?e.fontSize:u;this.fontFamily=s,this.fontSize=l,i.textAlign="left",i.textBaseline="alphabetic"}},{key:"setTextStyle",value:function(t,e,n){var i,r,a=this.nativeContext;e||(e=this.textAttributes),t.font?a.font=t.font:a.font=Lu(t,e,this.camera&&this.camera.getProjectionScale(n));var o=t.fontFamily,s=void 0===o?e.fontFamily:o,u=t.fontSize,l=void 0===u?e.fontSize:u;this.fontFamily=s,this.fontSize=l,a.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,a.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}},{key:"setClearMatrix",value:function(t,e,n,i,r,a){this._clearMatrix.setValue(t,e,n,i,r,a)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return fh.free(t)})),this.stack.length=0}}])}();Eb.env="browser",Eb=Rb([I(),Pb("design:paramtypes",[Object,Number])],Eb);var Ob=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Lb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ib=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(t){var e=t.container;if("string"==typeof e){var n=Si.global.getElementById(e);n&&(this._container=n)}else this._container=e;this._context=new Eb(this,this._dpr),this.initStyle()}},{key:"initStyle",value:function(){if(this.controled){var t=this.nativeCanvas;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}}},{key:"hide",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}},{key:"show",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}},{key:"applyPosition",value:function(){var t=this._nativeCanvas;t.style.position="absolute",t.style.top="".concat(this._y,"px"),t.style.left="".concat(this._x,"px")}},{key:"resetStyle",value:function(t){if(this.controled){var e=t.width,n=void 0===e?this._displayWidth:e,i=t.height,r=void 0===i?this._displayHeight:i,a=t.dpr,o=void 0===a?this._dpr:a,s=t.x,u=void 0===s?this._x:s,l=t.y,c=void 0===l?this._y:l,h=this.nativeCanvas;h.width=n*o,h.height=r*o,!h.style||this.setCanvasStyle(h,u,c,n,r),t.id&&(h.id=t.id),this.visiable||this.hide()}}},{key:"setCanvasStyle",value:function(t,e,n,i,r){this.controled&&(t.style.width="".concat(i,"px"),t.style.height="".concat(r,"px"))}},{key:"toDataURL",value:function(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}},{key:"resize",value:function(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width="".concat(t,"px"),this._nativeCanvas.style.height="".concat(e,"px")),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}}])}(t.BaseCanvas);function Db(t,e){return new w((function(n){n(Wi).toDynamicValue((function(){return function(e){return new t(e)}})).whenTargetNamed(t.env),n(Ni).toDynamicValue((function(){return function(t,n){return new e(t,n)}})).whenTargetNamed(e.env)}))}Ib.env="browser";var jb=Db(Ib=Ob([I(),Lb("design:paramtypes",[Object])],Ib),Eb),Ub=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Wb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nb=function(t,e){return function(n,i){e(n,i,t)}},Fb=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[r])).contributions=t,a.drawContribution=i,a.pickItemInterceptorContributions=r,a.global.hooks.onSetEnv.tap("canvas-picker-service",(function(t,e,n){a.configure(n,e)})),a.configure(a.global,a.global.env),a.pickerMap=new Map,a.init(),a}return c(n,t),u(n,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),p(h(n.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){this.pickCanvas=gr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}},{key:"pickItem",value:function(t,e,n,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(var r=0;r<this.InterceptorContributions.length;r++){var a=this.InterceptorContributions[r];if(a.beforePickItem){var o=a.beforePickItem(t,this,e,i,{parentMatrix:n});if(o)return o}}var s=this.pickerMap.get(t.numberType);if(!s)return null;var u=s.contains(t,e,i),l=u?t:null,c={graphic:l,params:u};if(l)return c;if(this.InterceptorContributions.length)for(var h=0;h<this.InterceptorContributions.length;h++){var d=this.InterceptorContributions[h];if(d.afterPickItem){var f=d.afterPickItem(t,this,e,i,{parentMatrix:n});if(f)return f}}return c}}])}(t.DefaultPickService);Fb=Ub([I(),Nb(0,O(Q)),Nb(0,D(yb)),Nb(1,O(Rf)),Nb(2,O(Q)),Nb(2,D(qf)),Wb("design:paramtypes",[Object,Object,Object])],Fb);var zb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Gb=function(){return u((function t(){o(this,t),this.type="group",this.numberType=_s}),[{key:"contains",value:function(t,e,n){return!1}}])}();Gb=zb([I()],Gb);var Hb=new w((function(t,e,n,i){Hb.__vloaded||(Hb.__vloaded=!0,t(pb).to(Gb).inSingletonScope(),t(yb).toService(pb),et(t,yb))}));Hb.__vloaded=!1;var Vb=Hb,Yb=new w((function(t,e,n,i){n(Fb)||t(Fb).toSelf().inSingletonScope(),n(Vf)?i(Vf).toService(Fb):t(Vf).toService(Fb)}));function Xb(t){t.load(Vb),t.load(Yb)}var Kb,qb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Zb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jb=Kb=function(t){function n(){var t;return o(this,n),(t=e(this,n)).type="browser",t._canvasIsIntersecting=!0,t.global=Si.global,t.viewBox=new ee,t.modelMatrix=new re(1,0,0,1,0,0),t}return c(n,t),u(n,[{key:"container",get:function(){return this.canvas.nativeCanvas.parentElement}},{key:"getTitle",value:function(){return this.canvas.id&&this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return this.canvas.nativeCanvas.getBoundingClientRect()}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}},{key:"postInit",value:function(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}},{key:"isElementVisible",value:function(t){var e=t.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>n||e.top>i)}},{key:"observerCanvas",value:function(){var t=this;this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);var e=new IntersectionObserver((function(e,n){e.forEach((function(e){t._canvasIsIntersecting!==e.isIntersecting?(t._canvasIsIntersecting=e.isIntersecting,t._onVisibleChangeCb&&t._onVisibleChangeCb(e.isIntersecting)):t._canvasIsIntersecting=e.isIntersecting}))}));e&&e.observe(this.canvas.nativeCanvas)}},{key:"createWindowByConfig",value:function(t){var e,n=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw new Error("发生错误,containerId可能传入有误");t.offscreen?e=null:e.appendChild(n);var i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:n,container:e,id:Kb.GenerateCanvasId(),canvasControled:!0};this.canvas=new Ib(i)}},{key:"createWindowByCanvas",value:function(t){var e,n;if("string"==typeof t.canvas){if(!(n=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");var i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){var a=n.getBoundingClientRect();i=a.width,r=a.height}var o=t.dpr;null==o&&(o=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new Ib({width:i,height:r,dpr:o,nativeCanvas:n,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this.canvas.nativeCanvas.dispatchEvent(t)}},{key:"getStyle",value:function(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}},{key:"setStyle",value:function(t){this.canvas.nativeCanvas.style=t}},{key:"getBoundingClientRect",value:function(){var t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}},{key:"isVisible",value:function(t){return this._canvasIsIntersecting}},{key:"onVisibleChange",value:function(t){this._onVisibleChangeCb=t}},{key:"getTopLeft",value:function(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}}],[{key:"GenerateCanvasId",value:function(){return"".concat(Kb.idprefix,"_").concat(Kb.prefix_count++)}}])}(t.BaseWindowHandlerContribution);Jb.env="browser",Jb.idprefix="visactor_window",Jb.prefix_count=0,Jb=Kb=qb([I(),Zb("design:paramtypes",[])],Jb);var Qb=new w((function(t){t(Jb).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(Jb)})).whenTargetNamed(Jb.env)})),$b=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},tk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ek=function(){return u((function t(e){o(this,t),this.dom=e}),[{key:"x1",get:function(){return this.dom.getBoundingClientRect().left}},{key:"x2",get:function(){return this.dom.getBoundingClientRect().right}},{key:"y1",get:function(){return this.dom.getBoundingClientRect().top}},{key:"y2",get:function(){return this.dom.getBoundingClientRect().bottom}},{key:"width",get:function(){return this.dom.getBoundingClientRect().width}},{key:"height",get:function(){return this.dom.getBoundingClientRect().height}}])}();function nk(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.createElement("img");if(n.crossOrigin="anonymous",e){var i=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(i)}return n.src=t,n.complete?Promise.resolve(n):new Promise((function(t,e){n.onload=function(){t(n)},n.onerror=function(){e(new Error("加载失败"))}}))}var ik=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="browser",t.supportEvent=!0;try{t.supportsTouchEvents="ontouchstart"in globalThis,t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsTouchEvents=!1,t.supportsPointerEvents=!1,t.supportsPointerEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"mapToCanvasPoint",value:function(t,e){var n,i,r=0,a=0,o=0,s=0;if(t.changedTouches){var u=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};o=r=u.clientX||0,s=a=u.clientY||0}else r=t.clientX||0,a=t.clientY||0,o=t.offsetX||0,s=t.offsetY||0;if(e){var l,c,h=r,d=a,f=e.getBoundingClientRect(),v=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;return v&&(l=f.width/v.offsetWidth,c=f.height/v.offsetHeight),{x:(h-f.left)/(At(l)?l:1),y:(d-f.top)/(At(c)?c:1)}}return{x:o,y:s}}},{key:"getNativeAABBBounds",value:function(t){var e=t;if("string"==typeof t&&((e=(new DOMParser).parseFromString(t,"text/html").firstChild).lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){var n=e.getBoundingClientRect();return new ek(n)}return new ee}},{key:"removeDom",value:function(t){return t.parentElement.removeChild(t),!0}},{key:"updateDom",value:function(t,e){var n=e.width,i=e.height,r=e.style;return r&&(kt(r)?t.setAttribute("style",r):Object.keys(r).forEach((function(e){t.style[e]=r[e]}))),null!=n&&(t.style.width="".concat(n,"px")),null!=i&&(t.style.height="".concat(i,"px")),!0}},{key:"createDom",value:function(t){var e=t.tagName,n=void 0===e?"div":e,i=t.parent,r=document.createElement(n);if(this.updateDom(r,t),i){var a=kt(i)?this.getElementById(i):i;a&&a.appendChild&&a.appendChild(r)}return r}},{key:"loadImage",value:function(t){return nk(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return nk(t,!0).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"createCanvas",value:function(t){var e,n,i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:x.GenAutoIncrementId().toString());var r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width="".concat(t.width,"px"),i.style.height="".concat(t.height,"px"),i.width=t.width*r,i.height=t.height*r),i}},{key:"createOffscreenCanvas",value:function(t){var e,n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}},{key:"releaseCanvas",value:function(t){var e;(e="string"==typeof t?document.getElementById(t):t)&&e.parentElement&&e.parentElement.removeChild(e)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getRequestAnimationFrame",value:function(){return window.requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return window.cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return document.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return document.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return document.dispatchEvent(t)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"getDocument",value:function(){return document}},{key:"release",value:function(){}},{key:"getElementTop",value:function(t,e){for(var n=t.offsetTop,i=t.offsetParent;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}},{key:"getElementLeft",value:function(t,e){for(var n=t.offsetLeft,i=t.offsetParent;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}},{key:"getElementTopLeft",value:function(t,e){for(var n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}}])}(t.BaseEnvContribution);ik=$b([I(),tk("design:paramtypes",[])],ik);var rk=new w((function(t){rk.isBrowserBound||(rk.isBrowserBound=!0,t(ik).toSelf().inSingletonScope(),t(at).toService(ik))}));function ak(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ak.__loaded||(ak.__loaded=!0,t.load(rk),t.load(jb),t.load(Qb),e&&Xb(t))}rk.isBrowserBound=!1,ak.__loaded=!1;var ok=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},sk=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}},{key:"getImageData",value:function(t,e,n,i){var r=this;return new Promise((function(a,o){var s;try{tt.canvasGetImageData({canvasId:null!==(s=r.canvas.nativeCanvas.id)&&void 0!==s?s:r.canvas.id,x:t,y:e,width:n,height:i,success:function(t){a(t)}})}catch(t){o(t)}}))}},{key:"draw",value:function(){var t=this,e=this.nativeContext;e.draw&&(this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))})))}},{key:"createPattern",value:function(t,e){return null}}])}(Eb);sk.env="feishu",sk=ok([I()],sk);var uk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},lk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ck=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new sk(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);ck.env="feishu";var hk=Db(ck=uk([I(),lk("design:paramtypes",[Object])],ck),sk),dk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},fk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vk=function(t,e){return function(n,i){e(n,i,t)}},pk=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),yk=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="feishu",i.eventManager=new pk,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:x.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new ck(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new ck({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);yk.env="feishu",yk=dk([I(),vk(0,O(ot)),fk("design:paramtypes",[Object])],yk);var gk=new w((function(t){t(yk).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(yk)})).whenTargetNamed(yk.env)})),mk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},bk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kk=function(t,e){return function(n,i){e(n,i,t)}},xk=function(n){function i(t,n){var r;return o(this,i),(r=e(this,i,[n])).contributions=t,r.pickItemInterceptorContributions=n,r.global.hooks.onSetEnv.tap("math-picker-service",(function(t,e,n){r.configure(n,e)})),r.configure(r.global,r.global.env),r.pickerMap=new Map,r.init(),r}return c(i,n),u(i,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),p(h(i.prototype),"_init",this).call(this)}},{key:"configure",value:function(e,n){this.pickContext=new t.EmptyContext2d(null,1)}},{key:"pickItem",value:function(t,e,n,i){if(!1===t.attribute.pickable)return null;var r=this.pickerMap.get(t.numberType);if(!r)return null;var a=r.contains(t,e,i),o=a?t:null;return o?{graphic:o,params:a}:null}}])}(t.DefaultPickService);xk=mk([I(),kk(0,O(Q)),kk(0,D(zm)),kk(1,O(Q)),kk(1,D(qf)),bk("design:paramtypes",[Object,Object])],xk);var wk=new w((function(t){wk.__vloaded||(wk.__vloaded=!0,et(t,zm))}));wk.__vloaded=!1;var Ak=wk,Sk=new w((function(t,e,n,i){n(xk)||t(xk).toSelf().inSingletonScope(),n(Vf)?i(Vf).toService(xk):t(Vf).toService(xk)}));function Tk(t){t.load(Ak),t.load(Sk)}var Bk=function(){return u((function t(e,n,i,r,a,s){o(this,t),this.nativeCanvas=e,this.ctx=n,this._w=r,this._h=a,this.id=s,e.id=s,this.dpr=i}),[{key:"width",get:function(){return this._w*this.dpr},set:function(t){}},{key:"height",get:function(){return this._h*this.dpr},set:function(t){}},{key:"offsetWidth",get:function(){return this._w},set:function(t){}},{key:"offsetHeight",get:function(){return this._h},set:function(t){}},{key:"getContext",value:function(){return this.ctx}},{key:"getBoundingClientRect",value:function(){return{width:this._w,height:this._h}}}])}(),Ck=function(){return u((function t(e,n,i,r,a,s){o(this,t),this.nativeCanvas=e,this.ctx=n,this._w=r,this._h=a,this.id=s,e.id=s,this.dpr=i}),[{key:"width",get:function(){return this._w*this.dpr},set:function(t){this._w=t/this.dpr,this.nativeCanvas.width=t}},{key:"height",get:function(){return this._h*this.dpr},set:function(t){this._h=t/this.dpr,this.nativeCanvas.height=t}},{key:"offsetWidth",get:function(){return this._w},set:function(t){this._w=t,this.nativeCanvas.width=t*this.dpr}},{key:"offsetHeight",get:function(){return this._h},set:function(t){this._h=t,this.nativeCanvas.height=t*this.dpr}},{key:"getContext",value:function(){return this.ctx}},{key:"getBoundingClientRect",value:function(){return{width:this._w,height:this._h}}}])}(),_k=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Rk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var Pk=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="feishu",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"getDynamicCanvasCount",value:function(){return this.freeCanvasList.length}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"configure",value:function(t,e){var n,i,r,a,o,s,u;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,a=e.freeCanvasIdx,o=this.freeCanvasList,s=e.pixelRatio,u=null!=s?s:tt.getSystemInfoSync().pixelRatio,i.forEach((function(t,e){var i=tt.createCanvasContext(t),s=new Bk(i.canvas||{},i,u,n.width,n.height,t);i.canvas=s,r.set(t,s),e>=a&&o.push(s)})))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return tt.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ca.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ca.clear(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}}])}(t.BaseEnvContribution);Pk=_k([I(),Rk("design:paramtypes",[])],Pk);var Mk=new w((function(t){Mk.isFeishuBound||(Mk.isFeishuBound=!0,t(Pk).toSelf().inSingletonScope(),t(at).toService(Pk))}));function Ek(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Ek.__loaded||(Ek.__loaded=!0,t.load(Mk),t.load(hk),t.load(gk),e&&Tk(t))}Mk.isFeishuBound=!1,Ek.__loaded=!1;var Ok=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Lk=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;if(this.nativeContext.setLineDash){var i=e[0];if(0===i[0]&&0===i[1])return;i&&n.setLineDash(i)}}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,y=e.lineDash,g=void 0===y?r.lineDash:y,m=e.lineCap,b=void 0===m?r.lineCap:m,k=e.miterLimit,x=void 0===k?r.miterLimit:k;a.globalAlpha=s*l*this.baseGlobalAlpha,a.lineWidth=Oh(this,h,this.dpr),a.strokeStyle=Lh(this,f,t,n,i),a.lineJoin=p,0===g[0]&&0===g[1]||g&&a.setLineDash(g),a.lineCap=b,a.miterLimit=x}}},{key:"measureText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Si.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,Si.global.devicePixelRatio),p(h(n.prototype),"measureText",this).call(this,t,e)}},{key:"createPattern",value:function(t,e){return null}},{key:"draw",value:function(){var t=this,e=this.nativeContext;e.draw&&(this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))})))}}])}(Eb);Lk.env="lynx",Lk=Ok([I()],Lk);var Ik=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Dk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jk=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Lk(this,this._dpr)}},{key:"resize",value:function(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}},{key:"release",value:function(){}}])}(t.BaseCanvas);jk.env="lynx",jk=Ik([I(),Dk("design:paramtypes",[Object])],jk);var Uk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Wk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nk=function(t,e){return function(n,i){e(n,i,t)}},Fk=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),zk=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="lynx",i.eventManager=new Fk,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id&&this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:x.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new jk(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new jk({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);zk.env="lynx",zk=Uk([I(),Nk(0,O(ot)),Wk("design:paramtypes",[Object])],zk);var Gk=new w((function(t){t(zk).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(zk)})).whenTargetNamed(zk.env)})),Hk=Db(jk,Lk),Vk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Yk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xk=!1;try{Xk=!!lynx.createCanvasNG}catch(t){}var Kk=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="lynx",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){var n,i,r,a,o,s,u,l;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,a=e.freeCanvasIdx,o=this.freeCanvasList,s=!!e.offscreen,u=e.pixelRatio,l=null!=u?u:SystemInfo.pixelRatio,i.forEach((function(t,e){var i;s?i=lynx.createOffscreenCanvas():(i=Xk?lynx.createCanvasNG(t):lynx.createCanvas(t),Xk&&i.attachToCanvasView(t)),i.width=n.width*l,i.height=n.height*l;var u=i.getContext("2d"),c=new Ck(i,u,l,n.width,n.height,t);r.set(t,c),e>=a&&o.push(c)})))}},{key:"getDynamicCanvasCount",value:function(){return this.freeCanvasList.length}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"loadImage",value:function(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();var e=lynx.createImage(t);return new Promise((function(t,n){e.onload=function(){t(e)},e.onerror=function(){n(new Error("加载失败"))}}))}(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return SystemInfo.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ca.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ca.clear(t)}}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}])}(t.BaseEnvContribution);Kk=Vk([I(),Yk("design:paramtypes",[])],Kk);var qk=new w((function(t){qk.isLynxBound||(qk.isLynxBound=!0,t(Kk).toSelf().inSingletonScope(),t(at).toService(Kk))}));function Zk(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Zk.__loaded||(Zk.__loaded=!0,t.load(qk),t.load(Hk),t.load(Gk),e&&Tk(t))}qk.isLynxBound=!1,Zk.__loaded=!1;var Jk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Qk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$k=function(t){function n(t,i){var r;o(this,n),r=e(this,n,[t,i]);var a=t.nativeCanvas.getContext("2d");if(!a)throw new Error("发生错误,获取2d上下文失败");return r.nativeContext=a,r.canvas=t,r.matrix=new re(1,0,0,1,0,0),r.stack=[],r.dpr=null!=i?i:1,r}return c(n,t),u(n,[{key:"release",value:function(){}}])}(Eb);$k.env="node",$k=Jk([I(),Qk("design:paramtypes",[Object,Number])],$k);var tx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ex=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nx=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new $k(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}},{key:"release",value:function(){this._nativeCanvas.release&&pt(this._nativeCanvas.release)&&this._nativeCanvas.release()}}])}(t.BaseCanvas);nx.env="node";var ix=Db(nx=tx([I(),ex("design:paramtypes",[Object])],nx),$k),rx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ax=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ox=function(t,e){return function(n,i){e(n,i,t)}},sx=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="node",i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return""}},{key:"getWH",value:function(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:x.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new nx(n)}},{key:"createWindowByCanvas",value:function(t){var e=t.canvas,n=t.width,i=t.height;null!=n&&null!=i&&t.canvasControled||(n=e.width,i=e.height),this.canvas=new nx({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"getImageBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}},{key:"addEventListener",value:function(t,e,n){}},{key:"dispatchEvent",value:function(t){return!0}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getStyle",value:function(){}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){return null}},{key:"clearViewBox",value:function(t){}}])}(t.BaseWindowHandlerContribution);sx.env="node",sx=rx([I(),ox(0,O(ot)),ax("design:paramtypes",[Object])],sx);var ux=new w((function(t){t(sx).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(sx)})).whenTargetNamed(sx.env)})),lx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},cx=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="node",t._lastTime=0,t.supportEvent=!1,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}},{key:"getDynamicCanvasCount",value:function(){return 0}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadImage",value:function(t){var e=this.pkg.loadImage;return e?e(t).then((function(t){return{loadState:t?"success":"fail",data:t}})).catch((function(){return{loadState:"fail",data:null}})):Promise.reject(new Error("node-canvas loadImage could not be found!"))}},{key:"loadSvg",value:function(t){var e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));var n=new e(t).render().asPng();return this.loadImage(n)}},{key:"createCanvas",value:function(t){return this.pkg.createCanvas(t.width,t.height)}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ca.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ca.clear(t)}}},{key:"addEventListener",value:function(t,e,n){}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getElementById",value:function(t){return null}},{key:"getRootElement",value:function(){return null}},{key:"dispatchEvent",value:function(t){}},{key:"release",value:function(){}},{key:"createOffscreenCanvas",value:function(t){}}])}(t.BaseEnvContribution);cx=lx([I()],cx);var hx=new w((function(t){hx.isNodeBound||(hx.isNodeBound=!0,t(cx).toSelf().inSingletonScope(),t(at).toService(cx))}));function dx(t){dx.__loaded||(dx.__loaded=!0,t.load(hx),t.load(ix),t.load(ux))}hx.isNodeBound=!1,dx.__loaded=!1;var fx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},vx=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}},{key:"draw",value:function(){this.nativeContext.draw()}},{key:"strokeText",value:function(t,e,n){}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.fillAttributes);var o=e.fillOpacity,s=void 0===o?r.fillOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u,c=e.fill,h=void 0===c?r.fill:c;s>1e-12&&l>1e-12&&(a.setGlobalAlpha(s*l),a.setFillStyle(Lh(this,h,t,n,i)))}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,y=e.lineDash,g=void 0===y?r.lineDash:y,m=e.lineCap,b=void 0===m?r.lineCap:m,k=e.miterLimit,x=void 0===k?r.miterLimit:k;a.setGlobalAlpha(s*l),a.setLineWidth(Oh(this,h,this.dpr)),a.setStrokeStyle(Lh(this,f,t,n,i)),a.setLineJoin(p),g&&a.setLineDash(g),a.setLineCap(b),a.setMiterLimit(x)}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){var n,i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Lu(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}},{key:"setTextStyle",value:function(t,e){var n,i,r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Lu(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}},{key:"createConicGradient",value:function(t,e,n,i){return null}},{key:"createPattern",value:function(t,e){return null}},{key:"getImageData",value:function(t,e,n,i){var r=this,a=this.nativeContext,o=a.taro;if(a&&o)return!a.getImageData&&o.canvasGetImageData?new Promise((function(a,s){try{o.canvasGetImageData({canvasId:r.canvas.nativeCanvas.id,sx:t,sy:e,sw:n,sh:i,success:function(t){a(t)}})}catch(t){s(t)}})):void 0}},{key:"createRadialGradient",value:function(t,e,n,i,r,a){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,n,i,r,a)}}])}(Eb);vx.env="taro",vx=fx([I()],vx);var px=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},yx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gx=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new vx(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);gx.env="taro";var mx=Db(gx=px([I(),yx("design:paramtypes",[Object])],gx),vx),bx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},kx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xx=function(t,e){return function(n,i){e(n,i,t)}},Ax=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),Sx=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="taro",i.eventManager=new Ax,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:x.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new gx(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new gx({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach((function(e,n){t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach((function(e,n){t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);Sx.env="taro",Sx=bx([I(),xx(0,O(ot)),kx("design:paramtypes",[Object])],Sx);var Tx=new w((function(t){t(Sx).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(Sx)})).whenTargetNamed(Sx.env)})),Bx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Cx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var _x=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="taro",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"getDynamicCanvasCount",value:function(){return this.freeCanvasList.length}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}},{key:"configure",value:function(t,e){var n,i,r,a,o,s,u;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,a=e.freeCanvasIdx,o=this.freeCanvasList,s=e.taro,u=e.pixelRatio,i.forEach((function(t,e){var i=s.createCanvasContext(t),l=new Bk(i.canvas||{},i,u,n.width,n.height,t);return i.canvas=l,r.set(t,l),e>=a&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){var e=window||globalThis;if(e.DOMParser){var n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(i));return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){var a=new e.Blob([t],{type:"image/svg+xml"}),o=e.URL.createObjectURL(a);return Promise.resolve({data:o,loadState:"success"})}return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return this.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}])}(t.BaseEnvContribution);_x=Bx([I(),Cx("design:paramtypes",[])],_x);var Rx=new w((function(t){Rx.isTaroBound||(Rx.isTaroBound=!0,t(_x).toSelf().inSingletonScope(),t(at).toService(_x))}));function Px(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Px.__loaded||(Px.__loaded=!0,t.load(Rx),t.load(mx),t.load(Tx),e&&Tk(t))}Rx.isTaroBound=!1,Px.__loaded=!1;var Mx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ex=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"draw",value:function(){}},{key:"createPattern",value:function(t,e){return null}}])}(Eb);Ex.env="wx",Ex=Mx([I()],Ex);var Ox=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Lx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ix=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Ex(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);Ix.env="wx";var Dx=Db(Ix=Ox([I(),Lx("design:paramtypes",[Object])],Ix),Ex),jx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ux=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wx=function(t,e){return function(n,i){e(n,i,t)}},Nx=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),Fx=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="wx",i.eventManager=new Nx,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:x.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Ix(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new Ix({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e,n,i,r,a=t.type;return!!this.eventManager.cache[a]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(n=t.changedTouches[0].x)&&void 0!==n?n:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(i=t.changedTouches[0].y)&&void 0!==i?i:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[a].listener&&this.eventManager.cache[a].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);Fx.env="wx",Fx=jx([I(),Wx(0,O(ot)),Ux("design:paramtypes",[Object])],Fx);var zx=new w((function(t){t(Fx).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(Fx)})).whenTargetNamed(Fx.env)})),Gx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Hx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vx=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};var Yx=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="wx",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,n,r,a,o){return Vx(this,void 0,void 0,i().mark((function t(){var s,u,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=wx.getSystemInfoSync().pixelRatio,u=i().mark((function t(u){var l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=e[u],t.next=3,new Promise((function(t){var e=wx.createSelectorQuery();o&&(e=e.in(o)),e.select("#".concat(l)).fields({node:!0,size:!0}).exec((function(e){if(e[0]){var i=e[0].node,o=e[0].width,c=e[0].height;i.width=o*s,i.height=c*s,n.set(l,i),u>=r&&a.push(i),t(null)}}))}));case 3:case"end":return t.stop()}}),t)})),l=0;case 3:if(!(l<e.length)){t.next=8;break}return t.delegateYield(u(l),"t0",5);case 5:l++,t.next=3;break;case 8:case"end":return t.stop()}}),t)})))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((function(){}))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return wx.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ca.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ca.clear(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}}])}(t.BaseEnvContribution);Yx=Gx([I(),Hx("design:paramtypes",[])],Yx);var Xx=new w((function(t){Xx._isWxBound||(Xx._isWxBound=!0,t(Yx).toSelf().inSingletonScope(),t(at).toService(Yx))}));function Kx(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Kx.__loaded||(Kx.__loaded=!0,t.load(Xx),t.load(Dx),t.load(zx),e&&Tk(t))}function qx(t){Zx(t)}function Zx(t){Zx.__loaded||(Zx.__loaded=!0,ak(t,!1),Ek(t,!1),Zk(t,!1),dx(t),Px(t,!1),Kx(t,!1),Xb(t),Fv.hooks.onSetEnv.tap("loadMathPicker",(function(e,n){"browser"!==n&&Tk(t)})))}Xx._isWxBound=!1,Kx.__loaded=!1,Zx.__loaded=!1;var Jx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Qx=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(sk);Qx.env="tt",Qx=Jx([I()],Qx);var $x=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},tw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ew=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Qx(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);ew.env="tt";var nw=Db(ew=$x([I(),tw("design:paramtypes",[Object])],ew),Qx),iw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},rw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aw=function(t,e){return function(n,i){e(n,i,t)}},ow=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),sw=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="tt",i.eventManager=new ow,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:x.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new ew(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new ew({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);sw.env="tt",sw=iw([I(),aw(0,O(ot)),rw("design:paramtypes",[Object])],sw);var uw=new w((function(t){t(sw).toSelf(),t(xr).toDynamicValue((function(t){return t.container.get(sw)})).whenTargetNamed(sw.env)})),lw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},cw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};var dw=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="tt",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,n,r,a,o){return hw(this,void 0,void 0,i().mark((function t(){var s,u,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=tt.getSystemInfoSync().pixelRatio,u=i().mark((function t(u){var l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=e[u],t.next=3,new Promise((function(t){var e=tt.createSelectorQuery();o&&(e=e.in(o)),e.select("#".concat(l)).node().exec((function(e){var i=e[0].node,o=i.width,c=i.height;i.width=o*s,i.height=c*s,n.set(l,i),u>=r&&a.push(i),t(null)}))}));case 3:case"end":return t.stop()}}),t)})),l=0;case 3:if(!(l<e.length)){t.next=8;break}return t.delegateYield(u(l),"t0",5);case 5:l++,t.next=3;break;case 8:case"end":return t.stop()}}),t)})))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((function(){}))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return tt.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ca.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ca.clear(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}}])}(t.BaseEnvContribution);dw=lw([I(),cw("design:paramtypes",[])],dw);var fw=new w((function(t){fw.isTTBound||(fw.isTTBound=!0,t(dw).toSelf().inSingletonScope(),t(at).toService(dw))}));function vw(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];vw.__loaded||(vw.__loaded=!0,t.load(fw),t.load(nw),t.load(uw),e&&Tk(t))}fw.isTTBound=!1,vw.__loaded=!1;var pw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},yw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gw=function(t,e){return function(n,i){e(n,i,t)}},mw=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=As}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).arc;i.highPerformanceSave();var a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Oh(i,a+o,i.dpr),h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();mw=pw([I(),gw(0,O(hf)),yw("design:paramtypes",[Object])],mw);var bw=!1,kw=new w((function(t,e,n,i){bw||(bw=!0,t(tb).to(mw).inSingletonScope(),t(yb).toService(tb))})),xw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ww=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Aw=function(t,e){return function(n,i){e(n,i,t)}},Sw=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=As}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).arc;i.highPerformanceSave();var a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();Sw=xw([I(),Aw(0,O(hf)),ww("design:paramtypes",[Object])],Sw);var Tw=!1,Bw=new w((function(t,e,n,i){Tw||(Tw=!0,t(Gm).to(Sw).inSingletonScope(),t(zm).toService(Gm))})),Cw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},_w=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rw=function(t,e){return function(n,i){e(n,i,t)}},Pw=new ee,Mw=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=Ls}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).rect,a=t.attribute.cornerRadius,o=void 0===a?r.cornerRadius:a,s=t.attribute,u=s.x,l=void 0===u?r.x:u,c=s.y,h=void 0===c?r.y:c;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);l+=f.x,h+=f.y,i.setTransformForCurrent()}else l=0,h=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var v=!0;if(!d||t.shadowRoot||wt(o,!0)&&0!==o||xt(o)&&o.some((function(t){return 0!==t})))v=!1,this.canvasRenderer.drawShape(t,i,l,h,{},null,(function(t,n,i){return!!v||(v=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(v)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Oh(i,a+o,i.dpr),v=t.isPointInStroke(e.x,e.y)}));else{var p=t.attribute,y=p.fill,g=void 0===y?r.fill:y,m=p.stroke,b=void 0===m?r.stroke:m,k=p.lineWidth,x=void 0===k?r.lineWidth:k;if(g)v=!0;else if(b){var w=t.AABBBounds;Pw.setValue(w.x1,w.y1,w.x2,w.y2),Pw.expand(-x/2),v=!Pw.containsPoint(e)}}return i.highPerformanceRestore(),v}}])}();Mw=Cw([I(),Rw(0,O(kf)),_w("design:paramtypes",[Object])],Mw);var Ew=!1,Ow=new w((function(t,e,n,i){Ew||(Ew=!0,t(sb).to(Mw).inSingletonScope(),t(yb).toService(sb))})),Lw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Iw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dw=function(t,e){return function(n,i){e(n,i,t)}},jw=new ee,Uw=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=Ls}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).rect,a=t.attribute.cornerRadius,o=void 0===a?r.cornerRadius:a,s=t.attribute,u=s.x,l=void 0===u?r.x:u,c=s.y,h=void 0===c?r.y:c;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);l+=f.x,h+=f.y,i.setTransformForCurrent()}else l=0,h=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var v=!0;if(!d||wt(o,!0)&&0!==o||xt(o)&&o.some((function(t){return 0!==t})))v=!1,this.canvasRenderer.drawShape(t,i,l,h,{},null,(function(t,n,i){return!!v||(v=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(v)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,v=t.isPointInStroke(e.x,e.y)}));else if(v){var p=t.attribute,y=p.fill,g=void 0===y?r.fill:y,m=p.stroke,b=void 0===m?r.stroke:m,k=p.lineWidth,x=void 0===k?r.lineWidth:k;if(g)v=!0;else if(b){var w=t.AABBBounds;jw.setValue(w.x1,w.y1,w.x2,w.y2),jw.expand(-x/2),v=!jw.containsPoint(e)}}return i.highPerformanceRestore(),v}}])}();Uw=Lw([I(),Dw(0,O(kf)),Iw("design:paramtypes",[Object])],Uw);var Ww=!1,Nw=new w((function(t,e,n,i){Ww||(Ww=!0,t(qm).to(Uw).inSingletonScope(),t(zm).toService(qm))})),Fw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},zw=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(Ph),Gw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Hw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vw=function(t,e){return function(n,i){e(n,i,t)}},Yw=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="line",i.numberType=Ps,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;i.highPerformanceSave();var r=Lr(t).line,a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,{},null,(function(t){return!!d||(d=t.isPointInPath(c.x,c.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth,a=e.pickStrokeBuffer||n.pickStrokeBuffer;return i.lineWidth=Oh(i,r+a,i.dpr),d=t.isPointInStroke(c.x,c.y)})),this.canvasRenderer.z=0,i.modelMatrix!==l&&vh.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(zw=Fw([I()],zw));Yw=Gw([I(),Vw(0,O(gf)),Hw("design:paramtypes",[Object])],Yw);var Xw=!1,Kw=new w((function(t,e,n,i){Xw||(Xw=!0,t(ab).to(Yw).inSingletonScope(),t(yb).toService(ab))})),qw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Zw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jw=function(t,e){return function(n,i){e(n,i,t)}},Qw=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="line",this.numberType=Ps}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).line,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();Qw=qw([I(),Jw(0,O(gf)),Zw("design:paramtypes",[Object])],Qw);var $w=!1,tA=new w((function(t,e,n,i){$w||($w=!0,t(Xm).to(Qw).inSingletonScope(),t(zm).toService(Xm))})),eA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},nA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iA=function(t,e){return function(n,i){e(n,i,t)}},rA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Ts}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).area,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u,c=t.attribute,h=c.fillPickable,d=void 0===h?r.fillPickable:h,f=c.strokePickable,v=void 0===f?r.strokePickable:f;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var p=t.getOffsetXY(r);s+=p.x,l+=p.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var y=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t){return!!y||!!d&&(y=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(y)return!0;if(!v)return!1;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Oh(i,a+o,i.dpr),y=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),y}}])}();rA=eA([I(),iA(0,O(ff)),nA("design:paramtypes",[Object])],rA);var aA=!1,oA=new w((function(t,e,n,i){aA||(aA=!0,t(nb).to(rA).inSingletonScope(),t(yb).toService(nb))})),sA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},uA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lA=function(t,e){return function(n,i){e(n,i,t)}},cA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Ts}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).area,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t){return!!h||(h=t.isPointInPath(e.x,e.y))})),i.highPerformanceRestore(),h}}])}();cA=sA([I(),lA(0,O(ff)),uA("design:paramtypes",[Object])],cA);var hA=!1,dA=new w((function(t,e,n,i){hA||(hA=!0,t(Hm).to(cA).inSingletonScope(),t(zm).toService(Hm))})),fA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},vA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pA=function(t,e){return function(n,i){e(n,i,t)}},yA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="symbol",i.numberType=js,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();var a=Lr(t).symbol,o=this.transform(t,a,i),s=o.x,u=o.y,l=o.z,c=o.lastModelMatrix,h=e;if(i.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 f=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,e,n){return!!f||(f=t.isPointInPath(h.x,h.y))}),(function(t,e,n){if(f)return!0;var r=e.lineWidth||n.lineWidth,a=e.pickStrokeBuffer||n.pickStrokeBuffer;return i.lineWidth=Oh(i,r+a,i.dpr),f=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,i.modelMatrix!==c&&vh.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),f}}])}(zw);yA=fA([I(),pA(0,O(wf)),vA("design:paramtypes",[Object])],yA);var gA=!1,mA=new w((function(t,e,n,i){gA||(gA=!0,t(lb).to(yA).inSingletonScope(),t(yb).toService(lb))})),bA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},kA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xA=function(t,e){return function(n,i){e(n,i,t)}},wA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="symbol",this.numberType=js}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).symbol,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();wA=bA([I(),xA(0,O(wf)),kA("design:paramtypes",[Object])],wA);var AA=!1,SA=new w((function(t,e,n,i){AA||(AA=!0,t(Zm).to(wA).inSingletonScope(),t(zm).toService(Zm))})),TA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},BA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},CA=function(t,e){return function(n,i){e(n,i,t)}},_A=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Bs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).circle,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Oh(i,a+o,i.dpr),h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();_A=TA([I(),CA(0,O(vf)),BA("design:paramtypes",[Object])],_A);var RA=!1,PA=new w((function(t,e,n,i){RA||(RA=!0,t(ib).to(_A).inSingletonScope(),t(yb).toService(ib))})),MA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},EA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},OA=function(t,e){return function(n,i){e(n,i,t)}},LA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Bs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).circle,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();LA=MA([I(),OA(0,O(vf)),EA("design:paramtypes",[Object])],LA);var IA=!1,DA=new w((function(t,e,n,i){IA||(IA=!0,t(Vm).to(LA).inSingletonScope(),t(zm).toService(Vm))})),jA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},UA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},WA=function(t,e){return function(n,i){e(n,i,t)}},NA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="text",i.numberType=Us,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();var a=Lr(t).text,o=t.attribute.keepDirIn3d,s=!(void 0===o?a.keepDirIn3d:o),u=this.transform(t,a,i,s),l=u.x,c=u.y,h=u.z,d=u.lastModelMatrix;this.canvasRenderer.z=h;var f=e;if(i.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,i,l,c,{},null,(function(e,n,i){if(p)return!0;var r=t.attribute,o=r.fontSize,s=void 0===o?a.fontSize:o,u=r.textBaseline,d=void 0===u?a.textBaseline:u,v=r.textAlign,y=void 0===v?a.textAlign:v,g=t.AABBBounds,m=g.height(),b=g.width(),k=ju(d,m,s),x=Du(y,b);return e.rect(x+l,k+c,b,m,h),p=e.isPointInPath(f.x,f.y)}),(function(t,e,n){return p})),this.canvasRenderer.z=0,i.modelMatrix!==d&&vh.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}}])}(zw);NA=jA([I(),WA(0,O(Af)),UA("design:paramtypes",[Object])],NA);var FA=!1,zA=new w((function(t,e,n,i){FA||(FA=!0,t(cb).to(NA).inSingletonScope(),t(yb).toService(cb))})),GA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},HA=function(){return u((function t(){o(this,t),this.type="text",this.numberType=Us}),[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}])}();HA=GA([I()],HA);var VA=!1,YA=new w((function(t,e,n,i){VA||(VA=!0,t(Jm).to(HA).inSingletonScope(),t(zm).toService(Jm))})),XA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},KA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qA=function(t,e){return function(n,i){e(n,i,t)}},ZA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="path",i.numberType=Ms,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).path;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth,a=e.pickStrokeBuffer||n.pickStrokeBuffer;return i.lineWidth=Oh(i,r+a,i.dpr),d=t.isPointInStroke(c.x,c.y)})),this.canvasRenderer.z=0,i.modelMatrix!==l&&vh.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(zw);ZA=XA([I(),qA(0,O(mf)),KA("design:paramtypes",[Object])],ZA);var JA=!1,QA=new w((function(t,e,n,i){JA||(JA=!0,t(ob).to(ZA).inSingletonScope(),t(yb).toService(ob))})),$A=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},tS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eS=function(t,e){return function(n,i){e(n,i,t)}},nS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="path",this.numberType=Ms}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).path,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();nS=$A([I(),eS(0,O(mf)),tS("design:paramtypes",[Object])],nS);var iS=!1,rS=new w((function(t,e,n,i){iS||(iS=!0,t(Km).to(nS).inSingletonScope(),t(zm).toService(Km))})),aS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},oS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sS=function(t,e){return function(n,i){e(n,i,t)}},uS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Es}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).polygon,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Oh(i,a+o,i.dpr),h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();uS=aS([I(),sS(0,O(bf)),oS("design:paramtypes",[Object])],uS);var lS=!1,cS=new w((function(t,e,n,i){lS||(lS=!0,t(hb).to(uS).inSingletonScope(),t(yb).toService(hb))})),hS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},dS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fS=function(t,e){return function(n,i){e(n,i,t)}},vS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Es}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).polygon,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();vS=hS([I(),fS(0,O(bf)),dS("design:paramtypes",[Object])],vS);var pS=!1,yS=new w((function(t,e,n,i){pS||(pS=!0,t(Qm).to(vS).inSingletonScope(),t(zm).toService(Qm))})),gS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},mS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bS=function(t,e){return function(n,i){e(n,i,t)}},kS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=Cs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){if(!r){var a=i.pickItem(t,e,null,n);r=!(!a||!a.graphic)}})),r}return!1}}])}();kS=gS([I(),bS(0,O(Bf)),mS("design:paramtypes",[Object])],kS);var xS=!1,wS=new w((function(t,e,n,i){xS||(xS=!0,t(vb).to(kS).inSingletonScope(),t(yb).toService(vb))})),AS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},SS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},TS=function(t,e){return function(n,i){e(n,i,t)}},BS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=Cs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){r||(r=!!i.pickItem(t,e,null,n))})),r}return!1}}])}();BS=AS([I(),TS(0,O(Bf)),SS("design:paramtypes",[Object])],BS);var CS=!1,_S=new w((function(t,e,n,i){CS||(CS=!0,t($m).to(BS).inSingletonScope(),t(BS).toService($m))})),RS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},PS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},MS=function(t,e){return function(n,i){e(n,i,t)}},ES=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=Ds}),[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}])}();ES=RS([I(),MS(0,O(Sf)),PS("design:paramtypes",[Object])],ES);var OS=!1,LS=new w((function(t,e,n,i){OS||(OS=!0,t(fb).to(ES).inSingletonScope(),t(yb).toService(fb))})),IS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},DS=function(){return u((function t(){o(this,t),this.type="image",this.numberType=Rs}),[{key:"contains",value:function(t,e,n){return!!(null!=n?n:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}])}();DS=IS([I()],DS);var jS=!1,US=new w((function(t,e,n,i){jS||(jS=!0,t(Ym).to(DS).inSingletonScope(),t(DS).toService(Ym))})),WS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},NS=function(){return u((function t(){o(this,t),this.type="image",this.numberType=Rs}),[{key:"contains",value:function(t,e,n){return!!(null!=n?n:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}])}();NS=WS([I()],NS);var FS=!1,zS=new w((function(t,e,n,i){FS||(FS=!0,t(rb).to(NS).inSingletonScope(),t(yb).toService(rb))})),GS=!1,HS=new w((function(t,e,n,i){GS||(GS=!0,t(Ym).to(DS).inSingletonScope(),t(DS).toService(Ym))})),VS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},YS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XS=function(t,e){return function(n,i){e(n,i,t)}};new ee;var KS=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="rect3d",i.numberType=Is,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).rect;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))})),this.canvasRenderer.z=0,i.modelMatrix!==l&&vh.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(zw);KS=VS([I(),XS(0,O(xf)),YS("design:paramtypes",[Object])],KS);var qS=!1,ZS=new w((function(t,e,n,i){qS||(qS=!0,t(ub).to(KS).inSingletonScope(),t(yb).toService(ub))})),JS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},QS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$S=function(t,e){return function(n,i){e(n,i,t)}},tT=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="arc3d",i.numberType=Ss,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).arc;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))})),this.canvasRenderer.z=0,i.modelMatrix!==l&&vh.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(zw);tT=JS([I(),$S(0,O(df)),QS("design:paramtypes",[Object])],tT);var eT=!1,nT=new w((function(t,e,n,i){eT||(eT=!0,t(eb).to(tT).inSingletonScope(),t(yb).toService(eb))})),iT=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},rT=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aT=function(t,e){return function(n,i){e(n,i,t)}},oT=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="pyramid3d",i.numberType=Os,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Lr(t).polygon;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))}),(function(t,e,n){return!1})),this.canvasRenderer.z=0,i.modelMatrix!==l&&vh.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(zw);oT=iT([I(),aT(0,O(Tf)),rT("design:paramtypes",[Object])],oT);var sT=!1,uT=new w((function(t,e,n,i){sT||(sT=!0,t(db).to(oT).inSingletonScope(),t(yb).toService(db))})),lT=lp();function cT(){cT.__loaded||(cT.__loaded=!0,Wy(),Ui.load($p),Ui.load(lT?kw:Bw))}cT.__loaded=!1;var hT=cT;function dT(){dT.__loaded||(dT.__loaded=!0,Ny(),Ui.load(Ly),Ui.load(nT))}dT.__loaded=!1;var fT=dT;function vT(){vT.__loaded||(vT.__loaded=!0,Fy(),Ui.load(ay),Ui.load(lT?oA:dA))}vT.__loaded=!1;var pT=vT;function yT(){yT.__loaded||(yT.__loaded=!0,zy(),Ui.load(ly),Ui.load(lT?PA:DA))}yT.__loaded=!1;var gT=yT;function mT(){mT.__loaded||(mT.__loaded=!0,Gy(),Ui.load(by),Ui.load(lT?wS:_S))}mT.__loaded=!1;var bT=mT;function kT(){kT.__loaded||(kT.__loaded=!0,Hy())}kT.__loaded=!1;var xT=kT;function wT(){wT.__loaded||(wT.__loaded=!0,Vy(),Ui.load(By),Ui.load(lT?zS:HS))}wT.__loaded=!1;var AT=wT;function ST(){ST.__loaded||(ST.__loaded=!0,Yy(),Ui.load(iy),Ui.load(lT?Kw:tA))}ST.__loaded=!1;var TT=ST;function BT(){BT.__loaded||(BT.__loaded=!0,Xy(),Ui.load(fy),Ui.load(lT?QA:rS))}BT.__loaded=!1;var CT=BT;function _T(){_T.__loaded||(_T.__loaded=!0,Ky(),Ui.load(py),Ui.load(lT?cS:yS))}_T.__loaded=!1;var RT=_T;function PT(){PT.__loaded||(PT.__loaded=!0,qy(),Ui.load(Uy),Ui.load(uT))}PT.__loaded=!1;var MT=PT;function ET(){ET.__loaded||(ET.__loaded=!0,Zy(),Ui.load(ey),Ui.load(lT?Ow:Nw))}ET.__loaded=!1;var OT=ET;function LT(){LT.__loaded||(LT.__loaded=!0,Jy(),Ui.load(Py),Ui.load(ZS))}LT.__loaded=!1;var IT=LT;function DT(){DT.__loaded||(DT.__loaded=!0,Qy(),Ui.load(Sy),Ui.load(lT?LS:US))}DT.__loaded=!1;var jT=DT;function UT(){UT.__loaded||(UT.__loaded=!0,eg())}UT.__loaded=!1;var WT=UT;function NT(){NT.__loaded||(NT.__loaded=!0,$y(),Ui.load(sy),Ui.load(lT?mA:SA))}NT.__loaded=!1;var FT=NT;function zT(){zT.__loaded||(zT.__loaded=!0,tg(),Ui.load(hy),Ui.load(lT?zA:YA))}zT.__loaded=!1;var GT=zT;function HT(){HT.__loaded||(HT.__loaded=!0,ng())}HT.__loaded=!1;var VT=HT,YT=Fm;Nv(),lp()?ak(Ui):cp()&&dx(Ui),hT(),fT(),pT(),gT(),bT(),xT(),AT(),TT(),CT(),RT(),MT(),OT(),IT(),jT(),WT(),FT(),GT(),VT(),t.ACustomAnimate=ra,t.ARC3D_NUMBER_TYPE=Ss,t.ARC_NUMBER_TYPE=As,t.AREA_NUMBER_TYPE=Ts,t.Animate=oa,t.AnimateGroup=Va,t.AnimateGroup1=Ya,t.Application=Ai,t.Arc=qc,t.Arc3d=Jc,t.Arc3dRender=df,t.ArcRender=hf,t.ArcRenderContribution=bu,t.Area=Yc,t.AreaRender=ff,t.AreaRenderContribution=ku,t.AttributeAnimate=Ha,t.AutoEnablePlugins=Qf,t.BaseRender=Ph,t.Basis=Cn,t.BeforeRenderConstribution=zf,t.BoundsContext=Je,t.BoundsPicker=Yf,t.CIRCLE_NUMBER_TYPE=Bs,t.Canvas3DDrawItemInterceptor=jf,t.CanvasArc3dPicker=eb,t.CanvasArcPicker=tb,t.CanvasAreaPicker=nb,t.CanvasCirclePicker=ib,t.CanvasFactory=Wi,t.CanvasGlyphPicker=vb,t.CanvasGroupPicker=pb,t.CanvasImagePicker=rb,t.CanvasLinePicker=ab,t.CanvasPathPicker=ob,t.CanvasPickerContribution=yb,t.CanvasPolygonPicker=hb,t.CanvasPyramid3dPicker=db,t.CanvasRect3dPicker=ub,t.CanvasRectPicker=sb,t.CanvasRichTextPicker=fb,t.CanvasSymbolPicker=lb,t.CanvasTextLayout=Wu,t.CanvasTextPicker=cb,t.CbAnimate=aa,t.Circle=Eu,t.CircleRender=vf,t.CircleRenderContribution=xu,t.ClipAngleAnimate=Ua,t.ClipDirectionAnimate=Na,t.ClipGraphicAnimate=ja,t.ClipRadiusAnimate=Wa,t.ColorInterpolate=pu,t.ColorStore=xo,t.CommonRenderContribution=Ru,t.Container=J,t.ContainerModule=w,t.Context2dFactory=Ni,t.ContributionProvider=Q,t.CurveContext=Yn,t.CustomEvent=zr,t.CustomPath2D=Kn,t.CustomSymbolClass=dc,t.DebugDrawItemInterceptorContribution=If,t.DefaultArcAllocate=Dp,t.DefaultArcAttribute=ui,t.DefaultArcRenderContribution=zh,t.DefaultAreaAllocate=Up,t.DefaultAreaAttribute=li,t.DefaultAreaTextureRenderContribution=hd,t.DefaultAttribute=si,t.DefaultBaseBackgroundRenderContribution=Uh,t.DefaultBaseTextureRenderContribution=Nh,t.DefaultCanvasAllocate=yr,t.DefaultCircleAllocate=Np,t.DefaultCircleAttribute=ci,t.DefaultCircleRenderContribution=Yh,t.DefaultConnectAttribute=ai,t.DefaultDebugAttribute=oi,t.DefaultFillStyle=$n,t.DefaultGlyphAttribute=di,t.DefaultGraphicAllocate=Op,t.DefaultGraphicMemoryManager=Zp,t.DefaultGroupAttribute=hi,t.DefaultGroupBackgroundRenderContribution=Zh,t.DefaultImageAttribute=xi,t.DefaultImageBackgroundRenderContribution=td,t.DefaultLayout=Jn,t.DefaultLineAllocate=zp,t.DefaultLineAttribute=fi,t.DefaultMat4Allocate=dh,t.DefaultMatrixAllocate=hh,t.DefaultMorphingAnimateConfig=ha,t.DefaultPathAllocate=Hp,t.DefaultPathAttribute=vi,t.DefaultPickStyle=ii,t.DefaultPolygonAttribute=pi,t.DefaultRect3dAttribute=gi,t.DefaultRectAllocate=Lp,t.DefaultRectAttribute=yi,t.DefaultRectRenderContribution=id,t.DefaultRichTextAttribute=ki,t.DefaultRichTextIconAttribute=wi,t.DefaultStateAnimateConfig=ca,t.DefaultStrokeStyle=ei,t.DefaultStyle=ri,t.DefaultSymbolAllocate=Yp,t.DefaultSymbolAttribute=mi,t.DefaultSymbolRenderContribution=sd,t.DefaultTextAllocate=Kp,t.DefaultTextAttribute=bi,t.DefaultTextStyle=ni,t.DefaultTicker=$r,t.DefaultTimeline=na,t.DefaultTransform=Qn,t.DragNDrop=Tb,t.DrawContribution=Rf,t.DrawItemInterceptor=Ef,t.DynamicLayerHandlerContribution=$s,t.EnvContribution=at,t.EventManager=Yr,t.EventSystem=qr,t.EventTarget=Xr,t.FadeInPlus=Pa,t.FederatedEvent=Ur,t.FederatedMouseEvent=Wr,t.FederatedPointerEvent=Nr,t.FederatedWheelEvent=Fr,t.Fragment=wb,t.GLYPH_NUMBER_TYPE=Cs,t.GRAPHIC_UPDATE_TAG_KEY=Xo,t.GROUP_NUMBER_TYPE=_s,t.Generator=x,t.Gesture=_b,t.GlobalPickerService=Xf,t.Glyph=Rc,t.GlyphRender=Bf,t.Graphic=$o,t.GraphicAnimate=Da,t.GraphicCreator=Ns,t.GraphicPicker=Hf,t.GraphicRender=pf,t.GraphicService=Ws,t.GraphicUtil=Zs,t.Group=Vs,t.GroupFadeIn=za,t.GroupFadeOut=Ga,t.GroupRender=yf,t.GroupRenderContribution=wu,t.IMAGE_NUMBER_TYPE=Rs,t.Image=Lc,t.ImageRender=Cf,t.ImageRenderContribution=Au,t.IncreaseCount=Ra,t.IncrementalDrawContribution=cf,t.InputText=Ma,t.InteractiveDrawItemInterceptorContribution=Df,t.InteractiveSubRenderContribution=Pu,t.LINE_NUMBER_TYPE=Ps,t.Layer=Ks,t.LayerService=Js,t.Line=xc,t.LineRender=gf,t.Linear=An,t.LinearClosed=Gn,t.ManualTickHandler=Zr,t.ManualTicker=ta,t.Mat4Allocate=lh,t.MathArcPicker=Gm,t.MathAreaPicker=Hm,t.MathCirclePicker=Vm,t.MathGlyphPicker=$m,t.MathImagePicker=Ym,t.MathLinePicker=Xm,t.MathPathPicker=Km,t.MathPickerContribution=zm,t.MathPolygonPicker=Qm,t.MathRectPicker=qm,t.MathSymbolPicker=Zm,t.MathTextPicker=Jm,t.MatrixAllocate=uh,t.Meteor=Oa,t.MonotoneX=Ln,t.MonotoneY=In,t.MorphingPath=Do,t.MotionPath=La,t.MultiToOneMorphingPath=Uo,t.NOWORK_ANIMATE_ATTR=Qo,t.Node=jr,t.PATH_NUMBER_TYPE=Ms,t.POLYGON_NUMBER_TYPE=Es,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=Os,t.Path=Gc,t.PathRender=mf,t.PathRenderContribution=Su,t.PickItemInterceptor=qf,t.PickerService=Vf,t.PluginService=$f,t.Polygon=th,t.PolygonRender=bf,t.PolygonRenderContribution=Tu,t.Pyramid3d=nh,t.Pyramid3dRender=Tf,t.RAFTickHandler=Qr,t.REACT_TO_CANOPUS_EVENTS=gb,t.REACT_TO_CANOPUS_EVENTS_LIST=mb,t.RECT3D_NUMBER_TYPE=Is,t.RECT_NUMBER_TYPE=Ls,t.RICHTEXT_NUMBER_TYPE=Ds,t.RafBasedSTO=Ta,t.Rect=Sc,t.Rect3DRender=xf,t.Rect3d=Cc,t.RectRender=kf,t.RectRenderContribution=Bu,t.ReflectSegContext=kn,t.RenderSelector=_f,t.RenderService=Ff,t.ResourceLoader=Go,t.RichText=Nc,t.RichTextRender=Sf,t.RotateBySphereAnimate=Fa,t.SVG_ATTRIBUTE_MAP=Fs,t.SVG_ATTRIBUTE_MAP_KEYS=zs,t.SVG_PARSE_ATTRIBUTE_MAP=Gs,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=Hs,t.SYMBOL_NUMBER_TYPE=js,t.SegContext=bn,t.ShadowRoot=rh,t.ShadowRootDrawItemInterceptorContribution=Lf,t.Stage=fp,t.StaticLayerHandlerContribution=Qs,t.Step=Nn,t.StreamLight=Ea,t.SubAnimate=ua,t.Symbol=mc,t.SymbolRender=wf,t.SymbolRenderContribution=Cu,t.TEXT_NUMBER_TYPE=Us,t.TagPointsUpdate=Ia,t.Text=Fu,t.TextMeasureContribution=ji,t.TextRender=Af,t.TextRenderContribution=_u,t.Theme=Er,t.TimeOutTickHandler=Jr,t.TransformUtil=qs,t.VArc=function(t){return Ch.arc(t?t.attribute:{})},t.VArc3d=function(t){return Ch.arc3d(t?t.attribute:{})},t.VArea=function(t){return Ch.area(t?t.attribute:{})},t.VCircle=function(t){return Ch.circle(t?t.attribute:{})},t.VGlobal=ot,t.VGlyph=function(t){return Ch.glyph(t?t.attribute:{})},t.VGroup=function(t){return Ch.group(t?t.attribute:{})},t.VImage=function(t){return Ch.image(t?t.attribute:{})},t.VLine=function(t){return Ch.line(t?t.attribute:{})},t.VPath=function(t){return Ch.path(t?t.attribute:{})},t.VPolygon=function(t){return Ch.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Ch.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Ch.rect(t?t.attribute:{})},t.VRect3d=function(t){return Ch.rect3d(t?t.attribute:{})},t.VRichText=bb,t.VSymbol=function(t){return Ch.symbol(t?t.attribute:{})},t.VText=function(t){return Ch.text(t?t.attribute:{})},t.VWindow=kr,t.VirtualLayerHandlerContribution=tu,t.WILDCARD="*",t.WindowHandlerContribution=xr,t.WrapText=Hu,t.XMLParser=ls,t._registerArc=cT,t.addArcToBezierPath=sn,t.addAttributeToPrototype=function(t,e,n){n.forEach((function(n){e.prototype[n]=t[n]}))},t.alignBezierCurves=to,t.alignSubpath=Ka,t.application=Si,t.applyTransformOnBezierCurves=io,t.arc3dCanvasPickModule=nT,t.arc3dModule=Ly,t.arcCanvasPickModule=kw,t.arcMathPickModule=Bw,t.arcModule=$p,t.areaCanvasPickModule=oA,t.areaMathPickModule=dA,t.areaModule=ay,t.bezier=an,t.bezierCurversToPath=ro,t.binarySplitPolygon=go,t.bindContributionProvider=et,t.bindContributionProviderNoSingletonScope=nt,t.boundStroke=fs,t.browserEnvModule=rk,t.builtInSymbolStrMap=pc,t.builtinSymbols=fc,t.builtinSymbolsMap=vc,t.calcLineCache=Xn,t.calculateLineHeight=_a,t.canvasAllocate=gr,t.centroidOfSubpath=Ja,t.circleBounds=ma,t.circleCanvasPickModule=PA,t.circleMathPickModule=DA,t.circleModule=ly,t.clock=Gr,t.cloneGraphic=Fo,t.colorEqual=function(t,e){var n=Se.parseColorString(t),i=Se.parseColorString(e);return!(!n||!i)&&n.r===i.r&&n.g===i.g&&n.b===i.b&&n.opacity===i.opacity},t.colorStringInterpolationToStr=Po,t.container=Ui,t.cornerTangents=du,t.createArc=Zc,t.createArc3d=Qc,t.createArea=Xc,t.createCircle=Ou,t.createColor=Lh,t.createConicalGradient=mu,t.createGlyph=Pc,t.createGroup=Ys,t.createImage=Ic,t.createLine=wc,t.createMat4=ch,t.createPath=Hc,t.createPolygon=eh,t.createPyramid3d=ih,t.createRect=Tc,t.createRect3d=_c,t.createRectPath=$h,t.createRichText=Fc,t.createShadowRoot=ah,t.createStage=function(t){return new fp(t)},t.createSymbol=bc,t.createText=zu,t.createWrapText=Vu,t.cubicCalc=fn,t.cubicLength=dn,t.cubicPointAt=vn,t.cubicSubdivide=Xa,t.decodeReactDom=Ab,t.defaultArcAllocate=jp,t.defaultArcBackgroundRenderContribution=Vh,t.defaultArcRenderContribution=Gh,t.defaultArcTextureRenderContribution=Hh,t.defaultAreaAllocate=Wp,t.defaultBaseBackgroundRenderContribution=Wh,t.defaultBaseTextureRenderContribution=Fh,t.defaultCircleAllocate=Fp,t.defaultCircleBackgroundRenderContribution=qh,t.defaultCircleRenderContribution=Xh,t.defaultCircleTextureRenderContribution=Kh,t.defaultGraphicMemoryManager=Jp,t.defaultGroupBackgroundRenderContribution=Jh,t.defaultImageBackgroundRenderContribution=ed,t.defaultLineAllocate=Gp,t.defaultPathAllocate=Vp,t.defaultRectAllocate=Ip,t.defaultRectBackgroundRenderContribution=od,t.defaultRectRenderContribution=rd,t.defaultRectTextureRenderContribution=ad,t.defaultSymbolAllocate=Xp,t.defaultSymbolBackgroundRenderContribution=cd,t.defaultSymbolRenderContribution=ud,t.defaultSymbolTextureRenderContribution=ld,t.defaultTextAllocate=qp,t.defaultTicker=tp,t.defaultTimeline=ia,t.drawArc=on,t.drawArcPath=fu,t.drawAreaSegments=Ad,t.drawIncrementalAreaSegments=xd,t.drawIncrementalSegments=kd,t.drawPathProxy=cu,t.drawSegments=bd,t.enumCommandMap=en,t.feishuEnvModule=Mk,t.fillVisible=ou,t.findBestMorphingRotation=$a,t.findNextGraphic=kv,t.flatten_simplify=function(t,e,n){if(t.length<=10)return t;var i=void 0!==e?e*e:1;return Ep(t=n?t:function(t,e){for(var n,i,r=t[0].x,a=t[0].y,o=[t[0]],s=1,u=t.length;s<u;s++)(n=t[s].x-r)*n+(i=t[s].y-a)*i>e&&(r=t[s].x,a=t[s].y,o.push(t[s]));return t[t.length-1].x===r&&t[t.length-1].y===a||o.push(t[t.length-1]),o}(t,i),i)},t.foreach=mv,t.foreachAsync=bv,t.genBasisSegments=Rn,t.genBasisTypeSegments=_n,t.genLinearClosedSegments=Hn,t.genLinearClosedTypeSegments=Vn,t.genLinearSegments=Sn,t.genLinearTypeSegments=Tn,t.genMonotoneXSegments=jn,t.genMonotoneXTypeSegments=Dn,t.genMonotoneYSegments=Wn,t.genMonotoneYTypeSegments=Un,t.genNumberType=ys,t.genStepSegments=Fn,t.genStepTypeSegments=zn,t.getAttributeFromDefaultAttrList=Sa,t.getConicGradientAt=gu,t.getContextFont=Lu,t.getCurrentEnv=function(){return lp()?"browser":"node"},t.getExtraModelMatrix=function(t,e,n){var i=n.attribute,r=i.alpha,a=i.beta;if(!r&&!a)return null;var o=n.attribute.anchor3d,s=void 0===o?n.attribute.anchor:o,u=[0,0];if(s){if("string"==typeof s[0]){var l=parseFloat(s[0])/100,c=n.AABBBounds;u[0]=c.x1+(c.x2-c.x1)*l}else u[0]=s[0];if("string"==typeof s[1]){var h=parseFloat(s[1])/100,d=n.AABBBounds;u[1]=d.x1+(d.x2-d.x1)*h}else u[1]=s[1]}if("text"===n.type){var f=n.attribute.textAlign;u[0]+=Du(f,n.clipedWidth)}u[0]+=t,u[1]+=e;var v=vh.allocate();return kh(v,v,[u[0],u[1],0]),a&&mh(v,v,a),r&&bh(v,v,r),kh(v,v,[-u[0],-u[1],0]),v},t.getModelMatrix=Ah,t.getRichTextBounds=function(t){return Bh||(Bh=Ch.CreateGraphic("richtext",{})),Bh.setAttributes(t),Bh.AABBBounds},t.getScaledStroke=Oh,t.getTextBounds=_h,t.getTheme=Lr,t.getThemeFromGroup=Ir,t.globalTheme=Or,t.glyphCanvasPickModule=wS,t.glyphMathPickModule=_S,t.glyphModule=by,t.graphicCreator=Ch,t.graphicService=Hv,t.graphicUtil=zv,t.imageCanvasPickModule=zS,t.imageMathPickModule=HS,t.imageModule=By,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){qx(Ui)},t.initBrowserEnv=function(){ak(Ui)},t.initFeishuEnv=function(){Ek(Ui)},t.initLynxEnv=function(){Zk(Ui)},t.initNodeEnv=function(){dx(Ui)},t.initTTEnv=function(){vw(Ui)},t.initTaroEnv=function(){Px(Ui)},t.initWxEnv=function(){Kx(Ui)},t.inject=O,t.injectable=I,t.interpolateColor=Ao,t.interpolateGradientConicalColor=Bo,t.interpolateGradientLinearColor=So,t.interpolateGradientRadialColor=To,t.interpolatePureColorArray=Co,t.intersect=hu,t.isBrowserEnv=lp,t.isNodeEnv=cp,t.isSvg=cs,t.isTransformKey=Aa,t.isXML=hs,t.jsx=function(t,e){var n=e||{};n.key,n.name,n.id;var i=n.attribute,r=n.stateProxy,a=kb(n,["key","name","id","attribute","stateProxy"]),o=t;kt(t)&&(o=Ch[t]);for(var s=[],u=arguments.length,l=new Array(u>2?u-2:0),c=2;c<u;c++)l[c-2]=arguments[c];l.length&&xb(1===l.length?l[0]:l,s);var h="Group"===o.name?new o(i):o(e);return function(t,e,n){var i,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":i=t.attribute||{},e[0]&&(i.text=e[0]);break;default:r=!0}r?(e.forEach((function(e){e&&t.add(e)})),Object.keys(n).forEach((function(e){var i=gb[e];i&&t.on(i,n[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((function(t){return t.attribute})).filter((function(t){return t})))}(h,s,a),r&&(h.stateProxy=r),h},t.layerService=Vv,t.lineCanvasPickModule=Kw,t.lineMathPickModule=tA,t.lineModule=iy,t.loadAllEnv=qx,t.loadAllModule=Zx,t.loadBrowserEnv=ak,t.loadFeishuEnv=Ek,t.loadLynxEnv=Zk,t.loadNodeEnv=dx,t.loadTTEnv=vw,t.loadTaroEnv=Px,t.loadWxEnv=Kx,t.lookAt=np,t.lynxEnvModule=qk,t.mat3Tomat4=xh,t.mat4Allocate=vh,t.matrixAllocate=fh,t.morphPath=jo,t.multiInject=L,t.multiToOneMorph=function(e,n,i){var r,a,o,s=e.filter((function(t){return t.toCustomPath&&t.valid}));s.length||__DEV__&&console.error(e," is not validate"),n.valid&&n.toCustomPath||__DEV__&&console.error(n," is not validate");var u=("clone"===(null==i?void 0:i.splitPath)?Fo:null!==(r=null==i?void 0:i.splitPath)&&void 0!==r?r:zo)(n,s.length,!0),l=n.attribute;n.setAttribute("visible",!1);var c=s.map((function(t,e){return Oo(t.toCustomPath(),u[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:u[e].globalTransMatrix})})),h=s.map((function(t,e){return Io(t.attribute,l)}));if(null==i?void 0:i.individualDelay){var d=i.onEnd,f=s.length,v=function(){0===--f&&(n.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),n.detachShadow(),d&&d())};u.forEach((function(t,n){var r,a,o,u=(null!==(r=i.delay)&&void 0!==r?r:0)+i.individualDelay(n,s.length,e[n],t),l=t.animate(Object.assign({},i,{onEnd:v}));l.wait(u),l.play(new Do({morphingData:c[n],saveOnEnd:!0,otherAttrs:h[n]},null!==(a=i.duration)&&void 0!==a?a:ha.duration,null!==(o=i.easing)&&void 0!==o?o:ha.easing))}))}else{var p=null==i?void 0:i.onEnd,y=i?Object.assign({},i):{};y.onEnd=function(){n.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),n.detachShadow(),p&&p()};var g=n.animate(y);(null==i?void 0:i.delay)&&g.wait(i.delay),g.play(new Uo({morphingData:c,otherAttrs:h},null!==(a=null==i?void 0:i.duration)&&void 0!==a?a:ha.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:ha.easing))}},t.multiply=rp,t.multiplyMat4Mat3=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],b=n.a,k=n.b,x=0,w=0;return t[0]=b*i+k*s+x*h+w*p,t[1]=b*r+k*u+x*d+w*y,t[2]=b*a+k*l+x*f+w*g,t[3]=b*o+k*c+x*v+w*m,b=n.c,k=n.d,x=0,w=0,t[4]=b*i+k*s+x*h+w*p,t[5]=b*r+k*u+x*d+w*y,t[6]=b*a+k*l+x*f+w*g,t[7]=b*o+k*c+x*v+w*m,b=0,k=0,x=1,w=0,t[8]=b*i+k*s+x*h+w*p,t[9]=b*r+k*u+x*d+w*y,t[10]=b*a+k*l+x*f+w*g,t[11]=b*o+k*c+x*v+w*m,b=n.e,k=n.f,x=0,w=1,t[12]=b*i+k*s+x*h+w*p,t[13]=b*r+k*u+x*d+w*y,t[14]=b*a+k*l+x*f+w*g,t[15]=b*o+k*c+x*v+w*m,t},t.multiplyMat4Mat4=wh,t.named=D,t.newThemeObj=Rr,t.nodeEnvModule=hx,t.oneToMultiMorph=function(t,e,n){var i,r=e.filter((function(t){return t&&t.toCustomPath&&t.valid}));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");var a=("clone"===(null==n?void 0:n.splitPath)?Fo:null!==(i=null==n?void 0:n.splitPath)&&void 0!==i?i:zo)(t,r.length,!1),o=null==n?void 0:n.onEnd,s=r.length,u=function(){0===--s&&o&&o()};r.forEach((function(e,i){var o,s=a[i],l=(null!==(o=null==n?void 0:n.delay)&&void 0!==o?o:0)+((null==n?void 0:n.individualDelay)?n.individualDelay(i,r.length,s,e):0);jo(s,e,Object.assign({},n,{onEnd:u,delay:l}),t.globalTransMatrix)}))},t.ortho=ip,t.parsePadding=pa,t.parseStroke=fa,t.parseSvgPath=nn,t.pathCanvasPickModule=QA,t.pathMathPickModule=rS,t.pathModule=fy,t.pathToBezierCurves=no,t.point=Bn,t.pointEqual=ba,t.pointInterpolation=ka,t.pointInterpolationHighPerformance=function(t,e,n,i){var r=Kt(t.x,t.y,e.x,e.y,n),a=r.x,o=r.y,s=Kt(t.x1,t.y1,e.x1,e.y1,n),u=s.x,l=s.y;return i.x=a,i.y=o,i.x1=u,i.y1=l,i.defined=e.defined,i},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((function(t,n){return ba(t,e[n])})):!Number.isNaN(t.x+t.y)&&ba(t,e))},t.pointsInterpolation=xa,t.polygonCanvasPickModule=cS,t.polygonMathPickModule=yS,t.polygonModule=py,t.preLoadAllModule=Nv,t.pyramid3dCanvasPickModule=uT,t.pyramid3dModule=Uy,t.rafBasedSto=Ca,t.rect3dCanvasPickModule=ZS,t.rect3dModule=Py,t.rectCanvasPickModule=Ow,t.rectFillVisible=su,t.rectMathPickModule=Nw,t.rectModule=ey,t.rectStrokeVisible=lu,t.recursiveCallBinarySplit=mo,t.registerArc=hT,t.registerArc3d=fT,t.registerArc3dGraphic=Ny,t.registerArcGraphic=Wy,t.registerArea=pT,t.registerAreaGraphic=Fy,t.registerCircle=gT,t.registerCircleGraphic=zy,t.registerGlyph=bT,t.registerGlyphGraphic=Gy,t.registerGroup=xT,t.registerGroupGraphic=Hy,t.registerImage=AT,t.registerImageGraphic=Vy,t.registerLine=TT,t.registerLineGraphic=Yy,t.registerPath=CT,t.registerPathGraphic=Xy,t.registerPolygon=RT,t.registerPolygonGraphic=Ky,t.registerPyramid3d=MT,t.registerPyramid3dGraphic=qy,t.registerRect=OT,t.registerRect3d=IT,t.registerRect3dGraphic=Jy,t.registerRectGraphic=Zy,t.registerRichtext=jT,t.registerRichtextGraphic=Qy,t.registerShadowRoot=WT,t.registerShadowRootGraphic=eg,t.registerSymbol=FT,t.registerSymbolGraphic=$y,t.registerText=GT,t.registerTextGraphic=tg,t.registerWrapText=VT,t.registerWrapTextGraphic=ng,t.renderCommandList=ln,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=US,t.richtextCanvasPickModule=LS,t.richtextModule=Sy,t.rotateX=mh,t.rotateY=bh,t.roughModule=YT,t.runFill=ru,t.runStroke=au,t.segments=rn,t.shouldUseMat4=Sh,t.snapLength=hn,t.splitArc=uo,t.splitArea=ho,t.splitCircle=lo,t.splitGraphic=zo,t.splitLine=fo,t.splitPath=ko,t.splitPolygon=bo,t.splitRect=so,t.splitToGrids=oo,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=uu,t.symbolCanvasPickModule=mA,t.symbolMathPickModule=SA,t.symbolModule=sy,t.taroEnvModule=Rx,t.textAttributesToStyle=Uu,t.textCanvasPickModule=zA,t.textDrawOffsetX=Du,t.textDrawOffsetY=Iu,t.textLayoutOffsetY=ju,t.textMathPickModule=YA,t.textModule=hy,t.transformKeys=wa,t.transformMat4=ap,t.transformUtil=Gv,t.translate=kh,t.ttEnvModule=fw,t.version="0.19.4-alpha.4",t.verticalLayout=gs,t.vglobal=Fv,t.waitForAllSubLayers=function(t){return ds(this,void 0,void 0,i().mark((function e(){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],r=t.getChildren(),e.next=3,new Promise((function(t){Si.global.getRequestAnimationFrame()((function(){t(null)}))}));case 3:return r.forEach((function(t){t.subLayers.size&&t.subLayers.forEach((function(t){t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&n.push(new Promise((function(e){t.drawContribution.hooks.completeDraw.tap("outWait",(function(){t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((function(t){return"outWait"!==t.name})),e(null)}))})))}))})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e)})))},t.wrapCanvas=Fi,t.wrapContext=function(t,e){return Ui.getNamed(Ni,Si.global.env)(t,e)},t.wxEnvModule=Xx,t.xul=function(t){var e=xt(t)?t[0]:t,n=[];if(!e)return n;if(!0===hs(e)){var i=(new ls).parse(e);i.tc&&Object.keys(i.tc).forEach((function(t){"text"===t?n.push(function(t){var e={text:""};xs(t,e);var n=t["#text"];return n&&(e.text=n),e}(i.tc[t])):n.push(function(t){var e={image:"",width:0,height:0};xs(t,e);var n=e.image;return n&&(e.image=n.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">")),e}(i.tc[t]))}))}return n}}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";function e(t){var e=function(t,e){if("object"!=typeof t||!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:e+""}function i(t,i,n){return(i=e(i))in t?Object.defineProperty(t,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[i]=n,t}class n{static GenAutoIncrementId(){return n.auto_increment_id++}}i(n,"auto_increment_id",0);class r{constructor(t){i(this,"id",void 0),i(this,"registry",void 0),this.id=n.GenAutoIncrementId(),this.registry=t}}const s="named",o="inject",a="multi_inject",h="inversify:tagged",l="inversify:paramtypes";class c{constructor(t,e){i(this,"key",void 0),i(this,"value",void 0),this.key=t,this.value=e}toString(){return this.key===s?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var d=function(t){var e;return function(t){const e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,a=!s&&!o,h={create:s?function(){return T(Object.create(null))}:o?function(){return T({__proto__:null})}:function(){return T({})},has:a?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:a?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){const t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){const t=this._index;if(t>=0&&t<this._keys.length){const i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){const e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){const i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){const i=this._find(e,!1);if(i>=0){const n=this._keys.length;for(let t=i+1;t<n;t++)this._keys[t-1]=this._keys[t],this._values[t-1]=this._values[t];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,s)},e.prototype.entries=function(){return new i(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function s(t,e){return e}function o(t,e){return[t,e]}}():Map,u=(c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new d}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()}}():Set,new(c||"function"!=typeof WeakMap?function(){const t=16,i=h.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){const e=s(t,!1);return void 0!==e&&h.has(e,this._key)},t.prototype.get=function(t){const e=s(t,!1);return void 0!==e?h.get(e,this._key):void 0},t.prototype.set=function(t,e){return s(t,!0)[this._key]=e,this},t.prototype.delete=function(t){const e=s(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){let t;do{t="@@WeakMap@@"+a()}while(h.has(i,t));return i[t]=!0,t}function s(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:h.create()})}return t[n]}function o(t,e){for(let i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function a(){const e=(i=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(i)):o(new Uint8Array(i),i):o(new Array(i),i));var i;e[6]=79&e[6]|64,e[8]=191&e[8]|128;let n="";for(let i=0;i<t;++i){const t=e[i];4!==i&&6!==i&&8!==i||(n+="-"),t<16&&(n+="0"),n+=t.toString(16).toLowerCase()}return n}}():WeakMap));function p(t,e,i){let n=u.get(t);if(m(n)){if(!i)return;n=new d,u.set(t,n)}let r=n.get(e);if(m(r)){if(!i)return;r=new d,n.set(e,r)}return r}function f(t,e,i){if(g(t,e,i))return!0;const n=S(e);return!y(n)&&f(t,n,i)}function g(t,e,i){const n=p(e,i,!1);return!m(n)&&!!n.has(t)}function v(t,e,i){if(g(t,e,i))return function(t,e,i){const n=p(e,i,!1);if(!m(n))return n.get(t)}(t,e,i);const n=S(e);return y(n)?void 0:v(t,n,i)}function m(t){return void 0===t}function y(t){return null===t}function b(t){return"object"==typeof t?null!==t:"function"==typeof t}function x(t,e){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const i=3===e?"string":5===e?"number":"default",r=function(t,e){const i=t[e];if(null!=i){if(!A(i))throw new TypeError;return i}}(t,n);if(void 0!==r){const e=r.call(t,i);if(b(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(A(e)){const i=e.call(t);if(!b(i))return i}const i=t.valueOf;if(A(i)){const e=i.call(t);if(!b(e))return e}}else{const e=t.valueOf;if(A(e)){const i=e.call(t);if(!b(i))return i}const i=t.toString;if(A(i)){const e=i.call(t);if(!b(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function w(t){const e=x(t,3);return function(t){return"symbol"==typeof t}(e)?e:function(t){return""+t}(e)}function A(t){return"function"==typeof t}function S(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}function T(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,n){if(!b(i))throw new TypeError;return function(t,e,i,n){p(i,n,!0).set(t,e)}(t,e,i,n)})),t("hasMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),f(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),g(t,e,i)})),t("getMetadata",(function(t,e,i){if(!b(e))throw new TypeError;return m(i)||(i=w(i)),v(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function u(t,e,i,n){!function(t,e,i,n){const r=[n];let s={};d.hasOwnMetadata(t,e)&&(s=d.getMetadata(t,e));let o=s[i];void 0===o&&(o=[]),o.push(...r),s[i]=o,d.defineMetadata(t,s,e)}(h,t,i.toString(),n)}function p(t){return(e,i,n)=>{u(e,0,n,t)}}function f(t){return e=>(i,n,r)=>p(new c(t,e))(i,n,r)}const g=f(o),v=f(a);function m(){return function(t){return d.defineMetadata(l,null,t),t}}function y(t){return p(new c(s,t))}const b="Singleton",x="Transient",w="ConstantValue",A="DynamicValue",S="Factory",T="Function",B="Instance",C="Invalid";class _{constructor(t,e){i(this,"id",void 0),i(this,"moduleId",void 0),i(this,"activated",void 0),i(this,"serviceIdentifier",void 0),i(this,"implementationType",void 0),i(this,"cache",void 0),i(this,"dynamicValue",void 0),i(this,"scope",void 0),i(this,"type",void 0),i(this,"factory",void 0),i(this,"provider",void 0),i(this,"constraint",void 0),this.id=n.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=C,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new _(this.serviceIdentifier,this.scope);return t.activated=t.scope===b&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class P{getConstructorMetadata(t){return{compilerGeneratedMetadata:d.getMetadata(l,t),userGeneratedMetadata:d.getMetadata(h,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const R=(M=s,t=>{const e=e=>{if(null==e)return!1;if(e.key===M&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===M&&i[e].value===t)return!0;return!1};return e.metaData=new c(M,t),e});var M;class k{constructor(t){i(this,"_binding",void 0),this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=b,this}inTransientScope(){return this._binding.scope=x,this}whenTargetNamed(t){return this._binding.constraint=R(t),this}}class E{constructor(t){i(this,"_binding",void 0),this._binding=t}to(t){return this._binding.type=B,this._binding.implementationType=t,new k(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=A,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new k(this._binding)}toConstantValue(t){return this._binding.type=w,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=b,new k(this._binding)}toFactory(t){return this._binding.type=S,this._binding.factory=t,this._binding.scope=b,new k(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class O{constructor(t){i(this,"id",void 0),i(this,"options",void 0),i(this,"_bindingDictionary",void 0),i(this,"_metadataReader",void 0);const e=t||{};e.defaultScope=e.defaultScope||x,this.options=e,this.id=n.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new P}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,s,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new _(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new E(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),r=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:r(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),r=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const s={inject:n[o],multiInject:n[a]},h=s.inject||s.multiInject,l={serviceIdentifier:h,constructorArgsMetadata:e},c={injectIdentifier:h,metadata:e,bindings:this._bindingDictionary.get(h).filter((t=>t.constraint(l)))};r.push(c)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case w:case T:e=t.cache;break;case B:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===b&&(t.cache=e,t.activated=!0)}}const L=Symbol("ContributionProvider");class I{constructor(t,e){i(this,"caches",void 0),i(this,"serviceIdentifier",void 0),i(this,"container",void 0),this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function D(t,e){t(L).toDynamicValue((t=>{let{container:i}=t;return new I(e,i)})).inSingletonScope().whenTargetNamed(e)}function W(t,e){t(L).toDynamicValue((t=>{let{container:i}=t;return new I(e,i)})).whenTargetNamed(e)}class j{constructor(t,e){i(this,"_args",void 0),i(this,"name",void 0),i(this,"taps",void 0),this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>t.name!==i&&(!e||t.fn===e))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class U extends j{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const N=Symbol.for("EnvContribution"),F=Symbol.for("VGlobal");var G=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},z=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},H=function(t,e){return function(i,n){e(i,n,t)}};function V(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){i(this,"contributions",void 0),i(this,"id",void 0),i(this,"_env",void 0),i(this,"_isSafari",void 0),i(this,"_isChrome",void 0),i(this,"envContribution",void 0),i(this,"optimizeVisible",void 0),i(this,"envParams",void 0),this.contributions=t,this.id=n.GenAutoIncrementId(),this.hooks={onSetEnv:new U(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=G([m(),H(0,g(L)),H(0,y(N)),z("design:paramtypes",[Object])],t.DefaultGlobal);var Y={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(l=1,h=new Array(d-1);l<d;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var u,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(u=1,h=new Array(d-1);u<d;u++)h[u-1]=arguments[u];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Y);var X=V(Y.exports);var $=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var K=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||$(t,"Boolean")};var q=t=>"function"==typeof t;var Z=t=>null==t;var J=t=>null!=t;var Q=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var et=t=>void 0===t;var it=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||$(t,"String")};var nt=t=>Array.isArray?Array.isArray(t):$(t,"Array");var rt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||$(t,"Number")};var st=t=>rt(t)&&Number.isFinite(t);var ot=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var at=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const ht=Object.prototype.hasOwnProperty;var lt=(t,e)=>null!=t&&ht.call(t,e);function ct(t,e){if(!nt(t)||!nt(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const dt=1e-10,ut=1e-10;function pt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:dt,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:ut)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var ft=function(t,e,i){return t<e?e:t>i?i:t};const gt=1e-12,vt=Math.PI,mt=vt/2,yt=2*vt,bt=2*Math.PI,xt=Math.abs,wt=Math.atan2,At=Math.cos,St=Math.max,Tt=Math.min,Bt=Math.sin,Ct=Math.sqrt,_t=Math.pow;function Pt(t){return t>1?0:t<-1?vt:Math.acos(t)}function Rt(t){return t>=1?mt:t<=-1?-mt:Math.asin(t)}function Mt(t,e,i,n,r){let s,o;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function kt(t,e){return t[0]*e[1]-t[1]*e[0]}function Et(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}class Ot{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new Ot(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return rt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return rt(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class Lt{static distancePP(t,e){return Ct(_t(t.x-e.x,2)+_t(t.y-e.y,2))}static distanceNN(t,e,i,n){return Ct(_t(t-i,2)+_t(e-n,2))}static distancePN(t,e,i){return Ct(_t(e-t.x,2)+_t(i-t.y,2))}static pointAtPP(t,e,i){return new Ot((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function It(t,e,i){const{x1:n,y1:r,x2:s,y2:o}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}class Dt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Dt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return nt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return It(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:r,x2:s,y2:o}=this,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}scalePoints(t,e,i,n){const{x1:r,y1:s,x2:o,y2:a}=this;return[t*r+(1-t)*i,e*s+(1-e)*n,t*o+(1-t)*i,e*a+(1-e)*n]}}class Wt extends Dt{}const jt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-yt;)t+=yt;else if(t>0)for(;t>yt;)t-=yt;return t};function Ut(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}class Nt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f,o=new Nt,a=t*n-e*i;return o.a=n/a,o.b=-e/a,o.c=-i/a,o.d=t/a,o.e=(i*s-n*r)/a,o.f=-(t*s-e*r)/a,o}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}rotateByCenter(t,e,i){const n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,d=n*this.e-r*this.f+s,u=r*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,this.e=d,this.f=u,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:r,f:s}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}multiply(t,e,i,n,r,s){const o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,d=a*t+l*e,u=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,this.b=d,this.c=u,this.d=p,this.e=f,this.f=g,this}interpolate(t,e){const i=new Nt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:r,d:s,e:o,f:a}=this,h=i*s-n*r,l=s/h,c=-n/h,d=-r/h,u=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,{x:g,y:v}=t;e.x=g*l+v*d+p,e.y=g*c+v*u+f}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Nt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){const o=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}class Ft{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let s=0;const o=e=>{s++,t.delete(e)},a=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return o(e);let i=0;for(;a-t.timestamp[t.timestamp.length-1-i]<n&&(i++,!(i>=r)););if(i<r)return o(e);for(;a-t.timestamp[0]>n;)t.timestamp.shift()})),s}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>i;)t.timestamp.shift()}}function Gt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2;let o=0,a=0,h=0;return 0<=t&&t<60?(o=n,a=r,h=0):60<=t&&t<120?(o=r,a=n,h=0):120<=t&&t<180?(o=0,a=n,h=r):180<=t&&t<240?(o=0,a=r,h=n):240<=t&&t<300?(o=r,a=0,h=n):300<=t&&t<360&&(o=n,a=0,h=r),o=Math.round(255*(o+s)),a=Math.round(255*(a+s)),h=Math.round(255*(h+s)),{r:o,g:a,b:h}}function zt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n;let o=0,a=0,h=0;return o=0===s?0:r===t?(e-i)/s%6:r===e?(i-t)/s+2:(t-e)/s+4,o=Math.round(60*o),o<0&&(o+=360),h=(r+n)/2,a=0===s?0:s/(1-Math.abs(2*h-1)),a=+(100*a).toFixed(1),h=+(100*h).toFixed(1),{h:o,s:a,l:h}}const Ht=/^#([0-9a-f]{3,8})$/,Vt={transparent:4294967040},Yt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Xt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function $t(t){return rt(t)?new Jt(t>>16,t>>8&255,255&t,1):nt(t)?new Jt(t[0],t[1],t[2]):new Jt(255,255,255)}function Kt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function qt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Zt{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Zt(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Zt(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof Zt?t:new Zt(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(J(Vt[t]))return function(t){return rt(t)?new Jt(t>>>24,t>>>16&255,t>>>8&255,255&t):nt(t)?new Jt(t[0],t[1],t[2],t[3]):new Jt(255,255,255,1)}(Vt[t]);if(J(Yt[t]))return $t(Yt[t]);const e=`${t}`.trim().toLowerCase(),i=Ht.exec(e);if(i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Jt((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?$t(t):8===e?new Jt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Jt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Gt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Jt(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Zt.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Jt(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,r=zt(this.color.r,this.color.g,this.color.b),s=Gt(Z(t)?r.h:ft(t,0,360),Z(e)?r.s:e>=0&&e<=1?100*e:e,Z(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new Jt(s.r,s.g,s.b,n),this}setRGB(t,e,i){return!Z(t)&&(this.color.r=t),!Z(e)&&(this.color.g=e),!Z(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Ht.exec(e),n=parseInt(i[1],16),r=i[1].length;return 3===r?new Jt((n>>8&15)+((n>>8&15)<<4),(n>>4&15)+((n>>4&15)<<4),(15&n)+((15&n)<<4),1):6===r?$t(n):8===r?new Jt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):this}setColorName(t){const e=Yt[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Zt(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Kt(t.color.r),this.color.g=Kt(t.color.g),this.color.b=Kt(t.color.b),this}copyLinearToSRGB(t){return this.color.r=qt(t.color.r),this.color.g=qt(t.color.g),this.color.b=qt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Jt{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),J(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${Xt(this.r)+Xt(this.g)+Xt(this.b)+(1===this.opacity?"":Xt(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=zt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function Qt(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}let te,ee,ie,ne,re,se,oe,ae;function he(t,e,i,n){if(!function(t,e,i,n){let r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;const r=[0,0],s=[0,0],o=[0,0];if(Qt(r,e,t),Qt(s,n,i),function(t,e){return xt(t[0]-e[0])+xt(t[1]-e[1])<1e-12}(r,s))return!0;Qt(o,i,t);const a=kt(o,s)/kt(r,s);return a>=0&&a<=1&&[t[0]+r[0]*a,t[1]+r[1]*a]}var le;function ce(t,e,i){return!(t&&e&&(i?(te=t.x1,ee=t.x2,ie=t.y1,ne=t.y2,re=e.x1,se=e.x2,oe=e.y1,ae=e.y2,te>ee&&([te,ee]=[ee,te]),ie>ne&&([ie,ne]=[ne,ie]),re>se&&([re,se]=[se,re]),oe>ae&&([oe,ae]=[ae,oe]),te>se||ee<re||ie>ae||ne<oe):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(le||(le={}));const de=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};class ue{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),J(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=J(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(Z(this._canvas)&&(J(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Z(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&J(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Z(this._context)&&J(this._canvas)){const t=this._canvas.getContext("2d");J(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:i=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(n?n+" ":"")+(r?r+" ":"")+s+"px "+(o||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Z(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:s=n.fontVariant,fontWeight:o=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:h=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:l,textAlign:c=(null!=l?l:"center"),baseline:d,textBaseline:u=(null!=d?d:"middle"),ellipsis:p,limit:f}=this._userSpec;let{lineHeight:g=a}=this._userSpec;if(it(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=a*t}return{fontStyle:r,fontVariant:s,fontFamily:h,fontSize:a,fontWeight:o,textAlign:c,textBaseline:u,ellipsis:p,limit:f,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(Z(t))return{width:0,height:0};if(Z(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:o,limit:a,lineHeight:h}=this.textSpec;let l;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:!!o,maxLineWidth:a||1/0,lineHeight:h});l={width:c.width(),height:c.height()}}catch(e){this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(t)}return l}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:i.width,height:null!==(e=r)&&void 0!==e?e:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let r=this._measureSpecialChar(n);Z(r)&&ue.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),Z(r)&&["F","W"].includes(de(n))&&(r=this._measureFullSizeChar()),Z(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],s=["F","W"].includes(de(r))?1:.53;i.width+=s*n}return i.height=null!==(e=r)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:r}=this.textSpec,s={width:0,height:0};if(Z(t))return s;if(nt(t)){const o=t.filter(J).map((t=>t.toString()));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:o.length*((null!==(i=r)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(Z(this._numberCharSize)){const t=this._standardMethod(ue.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ue.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return Z(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ue.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(Z(this._letterCharSize)){const t=this._standardMethod(ue.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ue.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return J(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){J(this._canvas)&&(this._canvas=null),J(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}ue.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ue.NUMBERS_CHAR_SET="0123456789",ue.FULL_SIZE_CHAR="字";const pe="undefined"!=typeof console;function fe(t,e,i){const n=[e].concat([].slice.call(i));pe&&console[t].apply(console,n)}var ge;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(ge||(ge={}));class ve{static getInstance(t,e){return ve._instance&&rt(t)?ve._instance.level(t):ve._instance||(ve._instance=new ve(t,e)),ve._instance}static setInstance(t){return ve._instance=t}static setInstanceLevel(t){ve._instance?ve._instance.level(t):ve._instance=new ve(t)}static clearInstance(){ve._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=ge.Info}canLogDebug(){return this._level>=ge.Debug}canLogError(){return this._level>=ge.Error}canLogWarn(){return this._level>=ge.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=ge.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):fe(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=ge.Warn&&fe(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=ge.Info&&fe(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=ge.Debug&&fe(this._method||"log","DEBUG",e),this}}ve._instance=null;const me=function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const i=e.split(":");if(2===i.length){const e=i[0].trim(),n=i[1].trim();e&&n&&(t[e]=n)}}})),t},ye=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),be=yt-1e-8;class xe{constructor(t){i(this,"bounds",void 0),this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>be)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,d=-1/0,u=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>d&&(d=h),l<u&&(u=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=yt)<0&&(n+=yt),(r%=yt)<0&&(r+=yt),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=yt,o=n-n%mt,a=0;a<4&&o>r;++a,o-=mt)f(o);else for(o=n-n%mt+mt,a=0;a<4&&o<r;++a,o+=mt)f(o);this.bounds.add(t+c,e+u),this.bounds.add(t+d,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class we{constructor(){i(this,"curves",void 0),i(this,"bounds",void 0),this.curves=[],this.bounds=new Wt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Ae=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Se={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},Te={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Be,Ce,_e,Pe,Re,Me;function ke(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(Be=e[t],Ce=Be.slice(1),_e=Be[0],i=[_e],n=Ce.match(Ae),null!==n){for(let t=0,e=n.length;t<e;t++)Pe=n[t],Re=parseFloat(Pe),Number.isNaN(Re)||i.push(Re);if(Me=Se[_e],i.length-1>Me){let t;for(let e=1,n=i.length;e<n;e+=Me){t=[_e];for(let n=e,r=e+Me;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Ee,Oe,Le,Ie,De,We,je,Ue;function Ne(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180),c=Math.sin(l),d=Math.cos(l),u=d*(a-t)*.5+c*(h-e)*.5,p=d*(h-e)*.5-c*(a-t)*.5;let f=u*u/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=d/i,v=c/i,m=-c/n,y=d/n,b=g*a+v*h,x=m*a+y*h,w=g*t+v*e,A=m*t+y*e;let S=1/((w-b)*(w-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);s===r&&(T=-T);const B=.5*(b+w)-T*(A-x),C=.5*(x+A)+T*(w-b),_=Math.atan2(x-C,b-B);let P=Math.atan2(A-C,w-B)-_;P<0&&1===s?P+=yt:P>0&&0===s&&(P-=yt);const R=Math.ceil(Math.abs(P/(mt+.001))),M=[];for(let t=0;t<R;++t){const e=_+t*P/R,r=_+(t+1)*P/R;M[t]=[B,C,e,r,i,n,c,d]}return M}function Fe(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,d=a*s,u=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,A=e+g,S=i+v,T=A+b*v,B=S-b*g;return[l*x+c*w,d*x+u*w,l*T+c*B,d*T+u*B,l*A+c*S,d*A+u*S]}function Ge(t,e,i,n){const r=Ne(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=Fe(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Ee=t.UpdateTag||(t.UpdateTag={}))[Ee.NONE=0]="NONE",Ee[Ee.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Ee[Ee.UPDATE_SHAPE=2]="UPDATE_SHAPE",Ee[Ee.CLEAR_SHAPE=253]="CLEAR_SHAPE",Ee[Ee.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Ee[Ee.INIT=179]="INIT",Ee[Ee.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Ee[Ee.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Ee[Ee.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Ee[Ee.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Ee[Ee.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Ee[Ee.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Ee[Ee.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Ee[Ee.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Oe=t.IContainPointMode||(t.IContainPointMode={}))[Oe.GLOBAL=1]="GLOBAL",Oe[Oe.LOCAL=16]="LOCAL",Oe[Oe.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Oe[Oe.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Le=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Le.INIT=0]="INIT",Le[Le.DEFAULT=1]="DEFAULT",Le[Le.STATE=2]="STATE",Le[Le.ANIMATE_BIND=10]="ANIMATE_BIND",Le[Le.ANIMATE_PLAY=11]="ANIMATE_PLAY",Le[Le.ANIMATE_START=12]="ANIMATE_START",Le[Le.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Le[Le.ANIMATE_END=14]="ANIMATE_END",Le[Le.TRANSLATE=20]="TRANSLATE",Le[Le.TRANSLATE_TO=21]="TRANSLATE_TO",Le[Le.SCALE=22]="SCALE",Le[Le.SCALE_TO=23]="SCALE_TO",Le[Le.ROTATE=24]="ROTATE",Le[Le.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Ie=t.AnimateStatus||(t.AnimateStatus={}))[Ie.INITIAL=0]="INITIAL",Ie[Ie.RUNNING=1]="RUNNING",Ie[Ie.PAUSED=2]="PAUSED",Ie[Ie.END=3]="END",t.AnimateMode=void 0,(De=t.AnimateMode||(t.AnimateMode={}))[De.NORMAL=0]="NORMAL",De[De.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(We=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",We.from="from",We.to="to",We.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(je=t.CurveTypeEnum||(t.CurveTypeEnum={}))[je.CubicBezierCurve=0]="CubicBezierCurve",je[je.QuadraticBezierCurve=1]="QuadraticBezierCurve",je[je.ArcCurve=2]="ArcCurve",je[je.LineCurve=3]="LineCurve",je[je.EllipseCurve=4]="EllipseCurve",je[je.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Ue=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Ue.beforeFillStroke=0]="beforeFillStroke",Ue[Ue.afterFillStroke=1]="afterFillStroke";const ze=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=i<e?-1:1,c=Math.cos(e),d=Math.sin(e),u=Math.cos(i),p=Math.sin(i),f=c*s+n,g=d*o+r,v=u*s+n,m=p*o+r,y=s*h*l,b=o*h*l;t.push(f-y*d,g+b*c,v+y*p,m-b*u,v,m)},He=[(t,e,i,n,r,s,o)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,i,n,r,s,o)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,o),(t,e,i,n,r,s,o)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,o),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,o)=>e.lineTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.moveTo(t[1]*r+i,t[2]*s+n,o),(t,e,i,n,r,s,o)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,o),(t,e,i,n,r,s,o)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,o)];function Ve(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const h=t[a];He[h[0]](h,e,i,n,r,s,o)}}class Ye{constructor(){i(this,"type",void 0),i(this,"p0",void 0),i(this,"defined",void 0),i(this,"length",void 0)}getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Xe(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],o=e[r],a=t[(r+1)%n],h=e[(r+1)%n];i+=Lt.distanceNN(s,o,a,h)}return i/2}function $e(t,e,i,n,r){return Xe([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function Ke(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function qe(t,e,i,n,r){const s=Ke(t.x,e.x,i.x,n.x,r),o=Ke(t.y,e.y,i.y,n.y,r);return new Ot(s,o)}function Ze(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=qe(i,n,r,s,e),a=Lt.pointAtPP(i,n,e),h=Lt.pointAtPP(n,r,e),l=Lt.pointAtPP(r,s,e),c=Lt.pointAtPP(a,h,e),d=Lt.pointAtPP(h,l,e);return[new Je(i,a,c,o),new Je(o,d,l,s)]}class Je extends Ye{constructor(e,n,r,s){super(),i(this,"type",t.CurveTypeEnum.CubicBezierCurve),this.p0=e,this.p1=n,this.p2=r,this.p3=s}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return qe(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?$e(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?xt(this.p0.x-this.p3.x):e===t.Direction.COLUMN?xt(this.p0.y-this.p3.y):0}getAngleAt(t){const e=St(t-.01,0),i=Tt(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return wt(r.y-n.y,r.x-n.x)}}function Qe(t,e){const{p0:i,p1:n}=t,r=Lt.pointAtPP(i,n,e);return[new ti(i,r),new ti(r,n)]}class ti extends Ye{constructor(e,n){super(),i(this,"type",t.CurveTypeEnum.LineCurve),this.p0=e,this.p1=n}getPointAt(t){if(!1!==this.defined)return Lt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=wt(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?Lt.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?xt(this.p0.x-this.p1.x):e===t.Direction.COLUMN?xt(this.p0.y-this.p1.y):0}}class ei{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){i(this,"_lastX",void 0),i(this,"_lastY",void 0),i(this,"_startX",void 0),i(this,"_startY",void 0),i(this,"_lastOriginP",void 0),i(this,"_startOriginP",void 0),i(this,"curves",void 0),i(this,"direction",void 0),i(this,"curveType",void 0),i(this,"length",void 0),this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,o,a){const h=new Je(new Ot(this._lastX,this._lastY),new Ot(t,e),new Ot(i,n),new Ot(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,r){const s=new ti(new Ot(this._lastX,this._lastY),new Ot(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=e.p3??e.p1;return xt(t.p0.y-i.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=e.p3??e.p1;return xt(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class ii extends ei{bezierCurveTo(t,e,i,n,r,s,o,a){return super.bezierCurveTo(e,t,n,i,s,r,o,a)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function ni(t,e){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function ri(e,i,n){const r=i??(xt(n[n.length-1].x-n[0].x)>xt(n[n.length-1].y-n[0].y)?t.Direction.ROW:t.Direction.COLUMN);return"monotoneY"===e?new ii(e,r):new ei(e,r)}class si{constructor(t,e){i(this,"_lastDefined",void 0),i(this,"startPoint",void 0),i(this,"_x",void 0),i(this,"_y",void 0),i(this,"_x0",void 0),i(this,"_x1",void 0),i(this,"_y0",void 0),i(this,"_y1",void 0),i(this,"_line",void 0),i(this,"_point",void 0),this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function oi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ri("linear",i,t);return ai(new si(r,n),t),r}function ai(t,e){return ni(t,e)}function hi(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class li{constructor(t,e){i(this,"_lastDefined1",void 0),i(this,"_lastDefined2",void 0),i(this,"startPoint",void 0),i(this,"lastPoint0",void 0),i(this,"lastPoint1",void 0),i(this,"_x",void 0),i(this,"_y",void 0),i(this,"_x0",void 0),i(this,"_x1",void 0),i(this,"_y0",void 0),i(this,"_y1",void 0),i(this,"_line",void 0),i(this,"_point",void 0),this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&hi(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:hi(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function ci(t,e){return ni(t,e)}function di(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return oi(t,e);const r=ri("basis",i,t);return ci(new li(r,n),t),r}function ui(t){return t<0?-1:1}function pi(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),o=(i-t._y1)/(r||Number(n<0&&-0)),a=(s*r+o*n)/(n+r);return(ui(s)+ui(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function fi(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function gi(t,e,i,n,r){const s=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-s)/3;t.context.bezierCurveTo(s+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class vi{constructor(t,e){i(this,"_lastDefined1",void 0),i(this,"_lastDefined2",void 0),i(this,"startPoint",void 0),i(this,"lastPoint0",void 0),i(this,"lastPoint1",void 0),i(this,"_x",void 0),i(this,"_y",void 0),i(this,"_x0",void 0),i(this,"_x1",void 0),i(this,"_y0",void 0),i(this,"_y1",void 0),i(this,"_line",void 0),i(this,"_point",void 0),this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:gi(this,this._t0,fi(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,gi(this,fi(this,e=pi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:gi(this,this._t0,e=pi(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class mi extends vi{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function yi(t,e){return ni(t,e)}function bi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return oi(t,e);const r=ri("monotoneX",i,t);return yi(new vi(r,n),t),r}function xi(t,e){return ni(t,e)}function wi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return oi(t,e);const r=ri("monotoneY",i,t);return xi(new mi(r,n),t),r}let Ai=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;i(this,"_lastDefined",void 0),i(this,"startPoint",void 0),i(this,"lastPoint",void 0),i(this,"_x",void 0),i(this,"_y",void 0),i(this,"_x0",void 0),i(this,"_x1",void 0),i(this,"_y0",void 0),i(this,"_y1",void 0),i(this,"_line",void 0),i(this,"_point",void 0),this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Si(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new ei("step",r??(xt(e[e.length-1].x-e[0].x)>xt(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN));return Ti(new Ai(o,i,s),e),o}function Ti(t,e){return ni(t,e)}class Bi extends si{lineEnd(){this.context.closePath()}}function Ci(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ri("linear",i,t);return _i(new Bi(r,n),t),r}function _i(t,e){return ni(t,e)}function Pi(t,e,i){switch(e){case"linear":default:return oi(t,i);case"basis":return di(t,i);case"monotoneX":return bi(t,i);case"monotoneY":return wi(t,i);case"step":return Si(t,.5,i);case"stepBefore":return Si(t,0,i);case"stepAfter":return Si(t,1,i);case"linearClosed":return Ci(t,i)}}class Ri extends we{constructor(t){super(),i(this,"commandList",[]),i(this,"_boundsContext",void 0),i(this,"_ctx",void 0),i(this,"direction",void 0),i(this,"transformCbList",void 0),i(this,"toStringCbList",void 0),t&&(this._ctx=t),this._boundsContext=new xe(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Te.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Te.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Te.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Te.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Te.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,o,a){return this.commandList.push([Te.E,t,e,i,n,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,o,a),this}rect(t,e,i,n){return this.commandList.push([Te.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Te.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Te.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Te.M]=t=>`M${t[1]} ${t[2]}`,t[Te.L]=t=>`L${t[1]} ${t[2]}`,t[Te.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Te.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Te.A]=t=>{const e=[];ze(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Te.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Te.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=ke(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Pi(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Te.M]=this.moveToTransform,t[Te.L]=this.lineToTransform,t[Te.Q]=this.quadraticCurveToTransform,t[Te.C]=this.bezierCurveToTransform,t[Te.AT]=this.arcToTransform,t[Te.E]=this.ellipseTransform,t[Te.R]=this.rectTransform,t[Te.A]=this.arcTransform,t[Te.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,d=0,u=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(e=t[g],1===h&&1===l||(e=ki(e,h,l)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+o,u+a);break;case"L":d=e[1],u=e[2],this.lineTo(d+o,u+a);break;case"h":d+=e[1],this.lineTo(d+o,u+a);break;case"H":d=e[1],this.lineTo(d+o,u+a);break;case"v":u+=e[1],this.lineTo(d+o,u+a);break;case"V":u=e[1],this.lineTo(d+o,u+a);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+o,u+a);break;case"M":d=e[1],u=e[2],this.moveTo(d+o,u+a);break;case"c":i=d+e[5],n=u+e[6],p=d+e[3],f=u+e[4],this.bezierCurveTo(d+e[1]+o,u+e[2]+a,p+o,f+a,i+o,n+a),d=i,u=n;break;case"C":d=e[5],u=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,p+o,f+a,d+o,u+a);break;case"s":i=d+e[3],n=u+e[4],p=2*d-p,f=2*u-f,this.bezierCurveTo(p+o,f+a,d+e[1]+o,u+e[2]+a,i+o,n+a),p=d+e[1],f=u+e[2],d=i,u=n;break;case"S":i=e[3],n=e[4],p=2*d-p,f=2*u-f,this.bezierCurveTo(p+o,f+a,e[1]+o,e[2]+a,i+o,n+a),d=i,u=n,p=e[1],f=e[2];break;case"q":i=d+e[3],n=u+e[4],p=d+e[1],f=u+e[2],this.quadraticCurveTo(p+o,f+a,i+o,n+a),d=i,u=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,i+o,n+a),d=i,u=n,p=e[1],f=e[2];break;case"t":i=d+e[1],n=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,f=u):"t"===c[0]?(p=2*d-r,f=2*u-s):"q"===c[0]&&(p=2*d-p,f=2*u-f),r=p,s=f,this.quadraticCurveTo(p+o,f+a,i+o,n+a),d=i,u=n,p=d+e[1],f=u+e[2];break;case"T":i=e[1],n=e[2],p=2*d-p,f=2*u-f,this.quadraticCurveTo(p+o,f+a,i+o,n+a),d=i,u=n;break;case"a":Ge(this,d+o,u+a,[e[1],e[2],e[3],e[4],e[5],e[6]+d+o,e[7]+u+a]),d+=e[6],u+=e[7];break;case"A":Ge(this,d+o,u+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),d=e[6],u=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Te.L:this.lineToTransform(o,e,i,n,r);break;case Te.M:this.moveToTransform(o,e,i,n,r);break;case Te.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Te.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Te.A:this.arcToTransform(o,e,i,n,r);break;case Te.E:this.ellipseTransform(o,e,i,n,r);break;case Te.R:this.rectTransform(o,e,i,n,r);break;case Te.AT:this.arcToTransform(o,e,i,n,r);break;case Te.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ve(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return xt(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return xt(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const Mi=["l",0,0,0,0,0,0,0];function ki(t,e,i){const n=Mi[0]=t[0];if("a"===n||"A"===n)Mi[1]=e*t[1],Mi[2]=i*t[2],Mi[3]=t[3],Mi[4]=t[4],Mi[5]=t[5],Mi[6]=e*t[6],Mi[7]=i*t[7];else if("h"===n||"H"===n)Mi[1]=e*t[1];else if("v"===n||"V"===n)Mi[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Mi[n]=(n%2==1?e:i)*t[n];return Mi}const Ei={alignSelf:"auto"},Oi={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 Nt},Li={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Ii={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Di={outerBorder:{...Ii,distance:0},innerBorder:{...Ii,distance:0},...Ii},Wi={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},ji={pickStrokeBuffer:0},Ui={forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null,...Li,...Di,...Ei,...ji},Ni={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Fi={_debug_bounds:!1},Gi={strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",...Fi,...Ui,...Oi};const zi={...Gi,startAngle:0,endAngle:bt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1},Hi={...Gi,...Ni,points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1},Vi={...Gi,radius:1,startAngle:0,endAngle:bt},Yi={...Gi,width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1},Xi={...Gi,path:"",width:0,height:0,cornerRadius:0,clip:!1},$i={...Gi,...Ni,points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1},Ki={...Gi,path:new Ri,customPath:()=>{ve.getInstance().warn("空函数")}},qi={...Gi,points:[],cornerRadius:0,closePath:!0},Zi={...Gi,width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0},Ji={...Gi,width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0},Qi={...Gi,symbolType:"circle",size:10,keepDirIn3d:!0},tn={...Gi,...Wi,strokeBoundsBuffer:0,keepDirIn3d:!0},en={...Gi,...Wi,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1},nn={repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,...Gi,fill:!0,cornerRadius:0},rn={...nn,backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1};class sn{constructor(){i(this,"global",void 0),i(this,"graphicUtil",void 0),i(this,"graphicService",void 0),i(this,"transformUtil",void 0),i(this,"layerService",void 0)}}const on=new sn,an={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"}},hn=!0,ln=!1,cn=/\w|\(|\)|-/,dn=/[.?!,;:/,。?!、;:]/,un=/\S/;function pn(t,e,i,n,r){if(!e||e<=0)return 0;const s=on.graphicUtil.textMeasure;let o=n,a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),h=Math.floor(s.measureText(a,i).width),l=t.slice(0,o+1),c=Math.floor(s.measureText(l,i).width)}return r&&(o=fn(t,o)),o}function fn(t,e){let i=e;for(;cn.test(t[i-1])&&cn.test(t[i])||dn.test(t[i]);)if(i--,i<=0)return e;return i}function gn(t,e){const i=on.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 vn=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let mn=class{constructor(){i(this,"release",void 0),i(this,"canvas",void 0),i(this,"context",void 0)}configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:i=tn.fontSize}=e,n=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:r++;return{width:~~(.8*n*i+r*i),height:i}}measureTextPixelHeight(t,e){if(!this.context)return e.fontSize??Wi.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){if(!this.context)return e.fontSize??Wi.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1,"end",!1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=fn(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push({...t[a],text:r.str,width:r.width}),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&s.str!==t){const i=fn(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r,s,o){let a;if("start"===s)a=this._clipTextStart(t,e,i,n,r),o&&(a.result=o+a.str);else if("middle"===s){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);a={str:"none",width:n.width,result:n.left+o+n.right}}else a=this._clipTextEnd(t,e,i,n,r),o&&(a.result=a.str+o);return a}_clipTextEnd(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipTextEnd(t,e,i,n,s)}if(a<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipTextEnd(t,e,i,s,r)}return{str:o,width:a}}_clipTextStart(t,e,i,n,r){const s=Math.ceil((n+r)/2),o=t.substring(s-1,t.length-1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const n=t.substring(s,t.length-1);return h=this.measureTextWidth(n,e),h<=i?{str:n,width:h}:this._clipTextStart(t,e,i,s,t.length-1)}if(a<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};const r=t.substring(s-2,t.length-1);return h=this.measureTextWidth(r,e),h>=i?{str:o,width:a}:this._clipTextStart(t,e,i,n,s)}return{str:o,width:a}}_clipTextMiddle(t,e,i,n,r,s,o,a){const h=t.substring(0,a),l=this.measureTextWidth(h,e);if(l+o>i)return{left:n,right:r,width:s+o};const c=t.substring(t.length-a,t.length),d=this.measureTextWidth(c,e);return l+d>i?{left:h,right:r,width:l+o}:this._clipTextMiddle(t,e,i,h,c,l,d,a+1)}clipTextWithSuffixVertical(t,e,i,n,r,s){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const o=this.clipTextVertical(t,e,i,r);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;const a=this.measureTextWidth(n,e);if(a>i)return o;let h;if(i-=a,"start"===s){const s=this.revertVerticalList(t);h=this.clipTextVertical(s,e,i,r);const o=this.revertVerticalList(h.verticalList);o.unshift({text:n,direction:1,width:a}),h.verticalList=o}else if("middle"===s){const s=this.clipTextVertical(t,e,i/2,r),o=this.revertVerticalList(t),l=this.clipTextVertical(o,e,i/2,r);s.verticalList.push({text:n,direction:1,width:a}),this.revertVerticalList(l.verticalList).forEach((t=>s.verticalList.push(t))),h={verticalList:s.verticalList,width:s.width+l.width}}else h=this.clipTextVertical(t,e,i,r),h.verticalList.push({text:n,direction:1,width:a});return h.width+=a,h}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return{...t,text:e}}))}clipTextWithSuffix(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const a=this.measureTextWidth(t,e);if(!o&&a<=i)return{str:t,width:a};const h=this.measureTextWidth(n,e);if(h>i)return{str:"",width:0};if(o&&a+h<=i)return{str:t+n,width:a+h};i-=h;const l=this._clipText(t,e,i,0,t.length-1,s,n);if(r&&l.str!==t){const i=fn(t,l.str.length);i!==l.str.length&&(l.result=t.substring(0,i),l.width=this.measureTextWidth(l.str,e))}else o&&l.str===t&&(l.result=t+n);return l.str=l.result,l.width+=h,l}};mn=vn([m()],mn);var yn=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const bn=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends mn{},t.DefaultTextMeasureContribution=yn([m()],t.DefaultTextMeasureContribution);const xn=new O,wn=Symbol.for("CanvasFactory"),An=Symbol.for("Context2dFactory");function Sn(t){return xn.getNamed(wn,on.global.env)(t)}const Tn=1e-4,Bn=Math.sqrt(3),Cn=1/3;function _n(t){return t>-Fn&&t<Fn}function Pn(t){return t>Fn||t<-Fn}const Rn=[0,0],Mn=[0,0],kn=[0,0];function En(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function On(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Ln(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function In(t){return(t%=bt)<0&&(t+=bt),t}function Dn(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const o=(s-e)/(n-e);let a=n<e?1:-1;1!==o&&0!==o||(a=n<e?.5:-.5);const h=o*(i-t)+t;return h===r?1/0:h>r?a:0}function Wn(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;return!(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)&&function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,d=1/0;Rn[0]=o,Rn[1]=a;for(let o=0;o<1;o+=.05){Mn[0]=On(t,i,r,o),Mn[1]=On(e,n,s,o);const a=En(Rn,Mn);a<d&&(l=o,d=a)}d=1/0;for(let o=0;o<32&&!(c<Tn);o++){const o=l-c,a=l+c;Mn[0]=On(t,i,r,o),Mn[1]=On(e,n,s,o);const h=En(Mn,Rn);if(o>=0&&h<d)l=o,d=h;else{kn[0]=On(t,i,r,a),kn[1]=On(e,n,s,a);const o=En(kn,Rn);a<=1&&o<d?(l=a,d=o):c*=.5}}return h&&(h[0]=On(t,i,r,l),h[1]=On(e,n,s,l)),Math.sqrt(d)}(t,e,i,n,r,s,a,h,null)<=l/2}function jn(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const d=h;return!(c>e+d&&c>n+d&&c>s+d&&c>a+d||c<e-d&&c<n-d&&c<s-d&&c<a-d||l>t+d&&l>i+d&&l>r+d&&l>o+d||l<t-d&&l<i-d&&l<r-d&&l<o-d)&&function(t,e,i,n,r,s,o,a,h,l,c){let d,u,p,f,g=0,v=.005,m=1/0;Rn[0]=h,Rn[1]=l;for(let h=0;h<1;h+=.05)Mn[0]=Ln(t,i,r,o,h),Mn[1]=Ln(e,n,s,a,h),p=En(Rn,Mn),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(v<Tn);h++)d=g-v,u=g+v,Mn[0]=Ln(t,i,r,o,d),Mn[1]=Ln(e,n,s,a,d),p=En(Mn,Rn),d>=0&&p<m?(g=d,m=p):(kn[0]=Ln(t,i,r,o,u),kn[1]=Ln(e,n,s,a,u),f=En(kn,Rn),u<=1&&f<m?(g=u,m=f):v*=.5);return c&&(c[0]=Ln(t,i,r,o,g),c[1]=Ln(e,n,s,a,g)),Math.sqrt(m)}(t,e,i,n,r,s,o,a,l,c,null)<=d/2}function Un(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;a-=t,h-=e;const c=Math.sqrt(a*a+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%bt<1e-4)return!0;if(s){const t=n;n=In(r),r=In(t)}else n=In(n),r=In(r);n>r&&(r+=bt);let d=Math.atan2(h,a);return d<0&&(d+=bt),d>=n&&d<=r||d+bt>=n&&d+bt<=r}function Nn(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const d=l*s-o+c;return d*d/(l*l+1)<=a/2*a/2}const Fn=1e-4;function Gn(t,e,i,n,r){const s=6*i-12*e+6*t,o=9*e+3*n-3*t-9*i,a=3*e-3*t;let h=0;if(_n(o)){if(Pn(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(_n(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*o),n=(-s-e)/(2*o);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const zn=[-1,-1,-1],Hn=[-1,-1];function Vn(){const t=Hn[0];Hn[0]=Hn[1],Hn[1]=t}function Yn(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),h=3*(e-t),l=t-r,c=a*a-3*o*h,d=a*h-9*o*l,u=h*h-3*a*l;let p=0;if(_n(c)&&_n(d))if(_n(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=d*d-4*c*u;if(_n(t)){const t=d/c,e=-a/o+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*a+1.5*o*(-d+e),n=c*a+1.5*o*(-d-e);i=i<0?-Math.pow(-i,Cn):Math.pow(i,Cn),n=n<0?-Math.pow(-n,Cn):Math.pow(n,Cn);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*d)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),h=(-a+i*(n+Bn*Math.sin(e)))/(3*o),l=(-a+i*(n-Bn*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,a,l,zn);if(0===c)return 0;let d=0,u=-1,p=0,f=0;for(let l=0;l<c;l++){const c=zn[l],g=0===c||1===c?.5:1;Ln(t,i,r,o,c)<h||(u<0&&(u=Gn(e,n,s,a,Hn),Hn[1]<Hn[0]&&u>1&&Vn(),p=Ln(e,n,s,a,Hn[0]),u>1&&(f=Ln(e,n,s,a,Hn[1]))),2===u?c<Hn[0]?d+=p<e?g:-g:c<Hn[1]?d+=f<p?g:-g:d+=a<f?g:-g:c<Hn[0]?d+=p<e?g:-g:d+=a<p?g:-g)}return d}function Xn(t,e,i,n,r,s,o,a){if(a>e&&a>n&&a>s||a<e&&a<n&&a<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,o=2*(e-t),a=t-n;let h=0;if(_n(s)){if(Pn(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(_n(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-o+e)/(2*s),n=(-o-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,a,zn);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let a=0;const c=On(e,n,s,l);for(let n=0;n<h;n++){const h=0===zn[n]||1===zn[n]?.5:1;On(t,i,r,zn[n])<o||(zn[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===zn[0]||1===zn[0]?.5:1;return On(t,i,r,zn[0])<o?0:s<e?c:-c}function $n(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);zn[0]=-h,zn[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=bt-1e-4){n=0,r=bt;const e=s?1:-1;return o>=zn[0]+t&&o<=zn[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=bt,r+=bt);let c=0;for(let e=0;e<2;e++){const i=zn[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=bt+t),(t>=n&&t<=r||t+bt>=n&&t+bt<=r)&&(t>vt/2&&t<1.5*vt&&(e=-e),c+=e)}}return c}function Kn(t){return Math.round(t/vt*1e8)/1e8%2*vt}function qn(t,e){let i=Kn(t[0]);i<0&&(i+=bt);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=bt?r=i+bt:e&&i-r>=bt?r=i-bt:!e&&i>r?r=i+(bt-Kn(i-r)):e&&i<r&&(r=i-(bt-Kn(r-i))),t[0]=i,t[1]=r}const Zn=[0,0];function Jn(t,e,i,n,r){const s=t,o=t.length;let a,h,l=0,c=0,d=0,u=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Te.M&&t>1&&(i||(l+=Dn(c,d,u,p,n,r))),f&&(c=o[1],d=o[2],u=c,p=d);const g=o[0],v=o[1],m=o[2],y=o[3],b=o[4],x=o[5],w=o[6];let A=b,S=x;Zn[0]=A,Zn[1]=S,qn(Zn,Boolean(o[6])),A=Zn[0],S=Zn[1];const T=A,B=S-A,C=!!(1-(o[6]?0:1)),_=(n-v)*y/y+v;switch(g){case Te.M:u=v,p=m,c=u,d=p;break;case Te.L:if(i){if(Nn(c,d,v,m,e,n,r))return!0}else l+=Dn(c,d,v,m,n,r)||0;c=v,d=m;break;case Te.C:if(i){if(jn(c,d,v,m,y,b,x,w,e,n,r))return!0}else l+=Yn(c,d,v,m,y,b,x,w,n,r)||0;c=x,d=w;break;case Te.Q:if(i){if(Wn(c,d,v,m,y,b,e,n,r))return!0}else l+=Xn(c,d,v,m,y,b,n,r)||0;c=y,d=b;break;case Te.A:if(a=Math.cos(T)*y+v,h=Math.sin(T)*y+m,f?(u=a,p=h):l+=Dn(c,d,a,h,n,r),i){if(Un(v,m,y,T,T+B,C,e,_,r))return!0}else l+=$n(v,m,y,T,T+B,C,_,r);c=Math.cos(T+B)*y+v,d=Math.sin(T+B)*y+m;break;case Te.R:if(u=c=v,p=d=m,a=u+y,h=p+b,i){if(Nn(u,p,a,p,e,n,r)||Nn(a,p,a,h,e,n,r)||Nn(a,h,u,h,e,n,r)||Nn(u,h,u,p,e,n,r))return!0}else l+=Dn(a,p,a,h,n,r),l+=Dn(u,h,u,p,n,r);break;case Te.Z:if(i){if(Nn(c,d,u,p,e,n,r))return!0}else l+=Dn(c,d,u,p,n,r);c=u,d=p}}return i||function(t,e){return Math.abs(t-e)<Fn}(d,p)||(l+=Dn(c,d,u,p,n,r)||0),0!==l}class Qn{constructor(){i(this,"pools",[]),i(this,"_commonCanvas",void 0),i(this,"allocatedCanvas",[])}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Sn({nativeCanvas:on.global.createCanvas(t),...t});return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Sn({nativeCanvas:on.global.createCanvas(e),...e});return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const tr=new Qn;var er=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ir=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const nr=Symbol.for("VWindow"),rr=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){i(this,"_width",void 0),i(this,"_height",void 0),i(this,"_handler",void 0),i(this,"hooks",{onChange:new U(["x","y","width","height"])}),i(this,"active",(()=>{const t=this.global;t.env&&!this.actived&&(xn.getNamed(rr,t.env).configure(this,t),this.actived=!0)})),this._uid=n.GenAutoIncrementId(),this.global=on.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){return this._handler.getStyle()??{}}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:t.width??this._width,y2:t.height??this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,n,r,s){this._handler.setViewBoxTransform(t,e,i,n,r,s)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),n={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},n),n.x-=i.x1,n.y-=i.y1,n}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},t.DefaultWindow=er([m(),ir("design:paramtypes",[])],t.DefaultWindow);var sr,or=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ar=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hr=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultGraphicUtil=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){i(this,"contributions",void 0),i(this,"_canvas",void 0),i(this,"_context",void 0),i(this,"_textMeasure",void 0),i(this,"configured",void 0),i(this,"global",void 0),this.contributions=t,this.configured=!1,this.global=on.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=tr.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:e.fontSize??Wi.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new ue({defaultFontParams:{fontFamily:Wi.fontFamily,fontSize:Wi.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ue.ALPHABET_CHAR_SET+ue.ALPHABET_CHAR_SET.toUpperCase(),...e??{}},t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=xn.get(nr),r=t.AABBBounds,s=r.width(),o=r.height(),a=-r.x1,h=-r.y1;n.create({viewBox:{x1:a,y1:h,x2:r.x2,y2:r.y2},width:s,height:o,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;const c=n.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}},t.DefaultGraphicUtil=or([m(),hr(0,g(L)),hr(0,y(bn)),ar("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(sr||(sr={}));const lr=new Nt;t.DefaultTransformUtil=class{constructor(){i(this,"matrix",void 0),i(this,"originTransform",void 0),i(this,"outSourceMatrix",void 0),i(this,"outTargetMatrix",void 0),i(this,"mode",void 0),this.matrix=new Nt}init(t){return this.mode=sr.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=sr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(lr.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(lr.a,lr.b,lr.c,lr.d,lr.e,lr.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(lr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(lr.a,lr.b,lr.c,lr.d,lr.e,lr.f),this}scale(t,e,i){return this.mode===sr.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===sr.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return lr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(lr.a,lr.b,lr.c,lr.d,lr.e,lr.f),this}translate(t,e){return this.mode===sr.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===sr.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=or([m(),ar("design:paramtypes",[])],t.DefaultTransformUtil);const cr={arc:zi,area:Hi,circle:Vi,line:$i,path:Ki,symbol:Qi,text:tn,rect:Zi,polygon:qi,richtext:en,richtextIcon:rn,image:nn,group:Yi,glyph:Xi},dr=Object.keys(cr);function ur(){return{arc:Object.assign({},cr.arc),area:Object.assign({},cr.area),circle:Object.assign({},cr.circle),line:Object.assign({},cr.line),path:Object.assign({},cr.path),symbol:Object.assign({},cr.symbol),text:Object.assign({},cr.text),rect:Object.assign({},cr.rect),polygon:Object.assign({},cr.polygon),richtext:Object.assign({},cr.richtext),richtextIcon:Object.assign({},cr.richtextIcon),image:Object.assign({},cr.image),group:Object.assign({},cr.group),glyph:Object.assign({},cr.glyph)}}function pr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const fr=ur();class gr{constructor(){i(this,"combinedTheme",void 0),i(this,"userTheme",void 0),i(this,"_defaultTheme",void 0),i(this,"dirty",void 0),this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},dr.forEach((t=>{this._defaultTheme[t]=Object.create(fr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,ve.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;dr.forEach((n=>{const r=Object.create(fr[n]);t&&t[n]&&pr(r,t[n]),i[n]&&pr(r,i[n]),e[n]&&pr(r,e[n]),this.combinedTheme[n]=r})),e.common&&dr.forEach((t=>{pr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const vr=new gr;function mr(t,e){return t.glyphHost?mr(t.glyphHost):e?(t.isContainer,e):yr(t)||t.attachedThemeGraphic&&mr(t.attachedThemeGraphic)||vr.getTheme()}function yr(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):vr.getTheme()}return null}class br extends X{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),i(this,"parent",void 0),i(this,"_prev",void 0),i(this,"_next",void 0),i(this,"_firstChild",void 0),i(this,"_lastChild",void 0),i(this,"_idMap",void 0),i(this,"_count",void 0),i(this,"_structEdit",void 0),i(this,"_nodeList",void 0),this._uid=n.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}async forEachChildrenAsync(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=await n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=await n),n)return;e=e._next}}}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&ve.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;t?.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=K(i,!0)&&i||Q(i)&&i.capture,r=Q(i)&&i.once,s=q(e)?void 0:e;return t=n?`${t}capture`:t,e=q(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=K(i,!0)&&i||Q(i)&&i.capture,r=q(e)?void 0:e;t=n?`${t}capture`:t,e=q(e)?e:e.handleEvent;const s=Q(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return Q(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class xr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){i(this,"bubbles",!0),i(this,"cancelBubble",!0),i(this,"cancelable",!1),i(this,"composed",!1),i(this,"currentTarget",void 0),i(this,"defaultPrevented",!1),i(this,"eventPhase",xr.prototype.NONE),i(this,"isTrusted",void 0),i(this,"returnValue",void 0),i(this,"srcElement",void 0),i(this,"target",void 0),i(this,"timeStamp",void 0),i(this,"type",void 0),i(this,"nativeEvent",void 0),i(this,"originalEvent",void 0),i(this,"propagationStopped",!1),i(this,"propagationImmediatelyStopped",!1),i(this,"path",void 0),i(this,"detailPath",void 0),i(this,"manager",void 0),i(this,"detail",void 0),i(this,"view",void 0),i(this,"layer",{x:0,y:0}),i(this,"page",{x:0,y:0}),i(this,"canvas",{x:0,y:0}),i(this,"viewport",{x:0,y:0}),i(this,"which",void 0),i(this,"NONE",0),i(this,"CAPTURING_PHASE",1),i(this,"AT_TARGET",2),i(this,"BUBBLING_PHASE",3),this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){this.pickParams&&this.pickParams.graphic&&(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams))}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class wr extends xr{constructor(){super(...arguments),i(this,"altKey",void 0),i(this,"button",void 0),i(this,"buttons",void 0),i(this,"ctrlKey",void 0),i(this,"metaKey",void 0),i(this,"relatedTarget",void 0),i(this,"shiftKey",void 0),i(this,"client",{x:0,y:0}),i(this,"movement",{x:0,y:0}),i(this,"offset",{x:0,y:0}),i(this,"global",{x:0,y:0}),i(this,"screen",{x:0,y:0})}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f){throw new Error("Method not implemented.")}}class Ar extends wr{constructor(){super(...arguments),i(this,"pointerId",void 0),i(this,"width",0),i(this,"height",0),i(this,"isPrimary",!1),i(this,"pointerType",void 0),i(this,"pressure",void 0),i(this,"tangentialPressure",void 0),i(this,"tiltX",void 0),i(this,"tiltY",void 0),i(this,"twist",void 0)}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){const t=new Ar(this.manager);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t.nativeEvent=this.nativeEvent,t.originalEvent=this.originalEvent,this.manager?.copyPointerData(this,t),this.manager?.copyMouseData(this,t),this.manager?.copyData(this,t),t.target=this.target,t.path=this.composedPath().slice(),t.type=this.type,t}}class Sr extends wr{constructor(){super(...arguments),i(this,"deltaMode",void 0),i(this,"deltaX",void 0),i(this,"deltaY",void 0),i(this,"deltaZ",void 0),i(this,"DOM_DELTA_PIXEL",0),i(this,"DOM_DELTA_LINE",1),i(this,"DOM_DELTA_PAGE",2)}clone(){const t=new Sr(this.manager);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t.nativeEvent=this.nativeEvent,t.originalEvent=this.originalEvent,this.manager?.copyWheelData(this,t),this.manager?.copyMouseData(this,t),this.manager?.copyData(this,t),t.target=this.target,t.path=this.composedPath().slice(),t.type=this.type,t}}i(Sr,"DOM_DELTA_PIXEL",0),i(Sr,"DOM_DELTA_LINE",1),i(Sr,"DOM_DELTA_PAGE",2);class Tr extends xr{constructor(t,e){super(),this.type=t,this.detail=e}}const Br="object"==typeof performance&&performance.now?performance:Date;function Cr(t){return"mouse"===t||"pen"===t}class _r{constructor(t,e){i(this,"rootTarget",void 0),i(this,"dispatch",new X),i(this,"cursor",void 0),i(this,"cursorTarget",null),i(this,"pauseNotify",!1),i(this,"mappingTable",void 0),i(this,"mappingState",{trackingData:{}}),i(this,"eventPool",new Map),i(this,"_prePointTargetCache",void 0),i(this,"_config",void 0),i(this,"onPointerDown",((t,e)=>{if(!(t instanceof Ar))return void ve.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(Cr(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)})),i(this,"onPointerMove",((t,e)=>{if(!(t instanceof Ar))return void ve.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e),n=Cr(i.pointerType),r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.overTargets);if(r.overTargets&&s&&s!==this.rootTarget&&s!==i.target){const e="mousemove"===t.type?"mouseout":"pointerout",r=this.createPointerEvent(t,e,s||void 0);if(this.dispatchEvent(r,"pointerout"),n&&this.dispatchEvent(r,"mouseout"),!i.composedPath().includes(s)){const e=this.createPointerEvent(t,"pointerleave",s||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!i.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(r)}if(s!==i.target){const e="mousemove"===t.type?"mouseover":"pointerover",r=this.clonePointerEvent(i,e);this.dispatchEvent(r,"pointerover"),n&&this.dispatchEvent(r,"mouseover");let o=s?.parent;for(;o&&o!==this.rootTarget.parent&&o!==i.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(i,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const r=new Set;let o=s;for(;o&&o!==this.rootTarget;)r.add(o),o=o.parent;for(;e&&e!==s&&e!==this.rootTarget.parent;)r.has(e)||(t.currentTarget=e,this.notifyTarget(t),n&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(r)}this.dispatchEvent(i,"pointermove"),"touch"===i.pointerType&&this.dispatchEvent(i,"touchmove"),n&&(this.dispatchEvent(i,"mousemove"),this.cursorTarget=i.target,this.cursor=i.target?.attribute?.cursor||this.rootTarget.getCursor()),r.overTargets=i.composedPath(),this.freeEvent(i)})),i(this,"onPointerOver",((t,e)=>{if(!(t instanceof Ar))return void ve.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.createPointerEvent(t,t.type,e),r=Cr(n.pointerType);this.dispatchEvent(n,"pointerover"),r&&this.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(this.cursorTarget=n.target,this.cursor=n.target?.attribute?.cursor||this.rootTarget.getCursor());const s=this.clonePointerEvent(n,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;i.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(s)})),i(this,"onPointerOut",((t,e)=>{if(!(t instanceof Ar))return void ve.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Cr(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""})),i(this,"onPointerUp",((t,e)=>{if(!(t instanceof Ar))return void ve.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=Br.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Cr(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(Cr(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<(this._config.clickInterval??200)?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,Cr(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===s.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)})),i(this,"onPointerUpOutside",((t,e)=>{if(!(t instanceof Ar))return void ve.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):Cr(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)})),i(this,"onWheel",((t,e)=>{if(!(t instanceof Sr))return void ve.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)})),this.rootTarget=t,this.mappingTable={},this._config={clickInterval:200,...e},this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];let i;const n=`${t.canvasX}-${t.canvasY}`;if(this._prePointTargetCache?.[n]&&this._prePointTargetCache?.[n]?.stage&&this._prePointTargetCache?.[n]?.stage.renderCount===this._prePointTargetCache?.stageRenderCount?i=this._prePointTargetCache[n]:(i=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[n]:i,stageRenderCount:i?.stage.renderCount??-1})),e)for(let n=0,r=e.length;n<r;n++)e[n].fn(t,i);else ve.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=e??t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(Ar);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.viewX??n.global.x,n.viewY??n.global.y,n),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(Sr);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.viewX??i.global.x,i.viewY??i.global.y,i),i}clonePointerEvent(t,e){const i=this.allocateEvent(Ar);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Ar&&e instanceof Ar&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof wr&&e instanceof wr&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Br.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t)?.pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e)?.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}const Pr={dispatchEvent(t){if(!(t instanceof xr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,t?.manager?.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Tr(t,e))}},Rr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Mr{constructor(t){i(this,"globalObj",void 0),i(this,"manager",void 0),i(this,"supportsTouchEvents",void 0),i(this,"supportsPointerEvents",void 0),i(this,"supportsMouseEvents",void 0),i(this,"applyStyles",void 0),i(this,"autoPreventDefault",void 0),i(this,"cursorStyles",void 0),i(this,"domElement",void 0),i(this,"resolution",1),i(this,"currentCursor",void 0),i(this,"rootPointerEvent",void 0),i(this,"rootWheelEvent",void 0),i(this,"eventsAdded",void 0),i(this,"onPointerDown",(t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)})),i(this,"onPointerMove",(t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)})),i(this,"onPointerUp",(t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)})),i(this,"onPointerOverOut",(t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget)})),i(this,"onWheel",(t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)}));const{targetElement:e,resolution:n,rootNode:r,global:s,autoPreventDefault:o=!1,clickInterval:a,supportsTouchEvents:h=s.supportsTouchEvents,supportsPointerEvents:l=s.supportsPointerEvents}=t;this.manager=new _r(r,{clickInterval:a}),this.globalObj=s,this.supportsPointerEvents=l,this.supportsTouchEvents=h,this.supportsMouseEvents=s.supportsMouseEvents,this.applyStyles=s.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.rootPointerEvent=new Ar,this.rootWheelEvent=new Sr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=n,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:n}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?"string"==typeof r&&i?n.style.cursor=r:"function"==typeof r?r(t):"object"==typeof r&&i&&Object.assign(n.style,r):i&&it(t)&&!lt(this.cursorStyles,t)&&(n.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){const e=this.globalObj?.mapToCanvasPoint(t,this.domElement);if(e)return e;let i=0,n=0;if(t.changedTouches){const e=t.changedTouches[0]??{};i=e.clientX||0,n=e.clientY||0}else i=t.clientX||0,n=t.clientY||0;const r=this.domElement.getBoundingClientRect();return{x:i-r.left,y:n-r.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];et(n.button)&&(n.button=0),et(n.buttons)&&(n.buttons=1),et(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),et(n.width)&&(n.width=n.radiusX||1),et(n.height)&&(n.height=n.radiusY||1),et(n.tiltX)&&(n.tiltX=0),et(n.tiltY)&&(n.tiltY=0),et(n.pointerType)&&(n.pointerType="touch"),et(n.pointerId)&&(n.pointerId=n.identifier||0),et(n.pressure)&&(n.pressure=n.force||.5),et(n.twist)&&(n.twist=0),et(n.tangentialPressure)&&(n.tangentialPressure=0),et(n.layerX)&&(n.layerX=n.offsetX=n.clientX),et(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;et(i.isPrimary)&&(i.isPrimary=!0),et(i.width)&&(i.width=1),et(i.height)&&(i.height=1),et(i.tiltX)&&(i.tiltX=0),et(i.tiltY)&&(i.tiltY=0),et(i.pointerType)&&(i.pointerType="mouse"),et(i.pointerId)&&(i.pointerId=1),et(i.pressure)&&(i.pressure=.5),et(i.twist)&&(i.twist=0),et(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Rr[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Br.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),n=i.width(),r=i.height();return!(e.x<n&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class kr{constructor(){i(this,"timerId",void 0),i(this,"time",0)}static Avaliable(){return!0}avaliable(){return kr.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Er{constructor(){i(this,"timerId",void 0)}static Avaliable(){return!0}avaliable(){return Er.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Or{constructor(){i(this,"released",void 0)}static Avaliable(){return!!on.global.getRequestAnimationFrame()}avaliable(){return Or.Avaliable()}tick(t,e){on.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Lr,Ir;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Lr||(Lr={}));class Dr{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i(this,"interval",void 0),i(this,"tickerHandler",void 0),i(this,"_mode",void 0),i(this,"status",void 0),i(this,"lastFrameTime",void 0),i(this,"tickCounts",void 0),i(this,"timelines",void 0),i(this,"autoStop",void 0),i(this,"handleTick",((t,e)=>{const{once:i=!1}=e??{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))})),i(this,"_handlerTick",(t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Lr.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))})),this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Lr.INITIAL,on.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),on.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Or},{mode:"timeout",cons:Er},{mode:"manual",cons:kr}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new Or;break;case"timeout":t=new Er;break;case"manual":t=new kr;break;default:ve.getInstance().warn("非法的计时器模式"),t=new Or}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==Lr.INITIAL&&(this.status=Lr.PAUSE,!0)}resume(){return this.status!==Lr.INITIAL&&(this.status=Lr.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Lr.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Lr.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=Lr.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Lr.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Wr{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Wr.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Wr.bounceIn(2*t):.5*Wr.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/bt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*bt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/bt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*bt/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/bt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*bt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*bt/e)*.5+1}}}i(Wr,"quadIn",(Ir=Wr).getPowIn(2)),i(Wr,"quadOut",Ir.getPowOut(2)),i(Wr,"quadInOut",Ir.getPowInOut(2)),i(Wr,"cubicIn",Ir.getPowIn(3)),i(Wr,"cubicOut",Ir.getPowOut(3)),i(Wr,"cubicInOut",Ir.getPowInOut(3)),i(Wr,"quartIn",Ir.getPowIn(4)),i(Wr,"quartOut",Ir.getPowOut(4)),i(Wr,"quartInOut",Ir.getPowInOut(4)),i(Wr,"quintIn",Ir.getPowIn(5)),i(Wr,"quintOut",Ir.getPowOut(5)),i(Wr,"quintInOut",Ir.getPowInOut(5)),i(Wr,"backIn",Ir.getBackIn(1.7)),i(Wr,"backOut",Ir.getBackOut(1.7)),i(Wr,"backInOut",Ir.getBackInOut(1.7)),i(Wr,"elasticIn",Ir.getElasticIn(1,.3)),i(Wr,"elasticOut",Ir.getElasticOut(1,.3)),i(Wr,"elasticInOut",Ir.getElasticInOut(1,.3*1.5));class jr{constructor(){this.id=n.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const Ur=new jr;class Nr{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){const t=this.getEndProps();return t?this._endProps===t?this._mergedEndProps:(this._endProps=t,void(this._mergedEndProps=Object.assign({},this.step.prev.getLastProps()??{},t))):this.step.prev?this.step.prev.getLastProps():t}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class Fr extends Nr{constructor(t){super(null,null,0,"linear"),i(this,"cb",void 0),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Gr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ur;this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new zr(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=St(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Gr.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gr.mode;e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new Fr((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=Gr.interpolateMap.get(t)||Gr.interpolateMap.get("");return!!o&&o(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new zr(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}i(Gr,"mode",t.AnimateMode.NORMAL),i(Gr,"interpolateMap",new Map);class zr{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new Hr(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Wr[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Wr[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){return this.stepHead?.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new Hr(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){const e=this.duration,i=this.loop,n=this.rawPosition;let r,s,o=!1;const a=this._startAt??0;if(t<0&&(t=0),t<a)return this.rawPosition=t,!1;if(t-=a,e<=0)return o=!0,o;if(r=Math.floor(t/e),s=t-r*e,o=t>=i*e+e,o&&(s=e,r=i,t=s*r+e),t===n)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(s=e-s),this._deltaPosition=s-this.position,this.position=s,this.rawPosition=t+a,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return ve.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Hr{constructor(t,e,n,r){i(this,"type",void 0),this.duration=e,this.position=t,this.props=n,this.easing=r}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Vr={duration:200,easing:"cubicOut"},Yr={duration:1e3,easing:"quadInOut"};var Xr;t.Edge=void 0,(Xr=t.Edge||(t.Edge={}))[Xr.Top=1]="Top",Xr[Xr.Right=2]="Right",Xr[Xr.Bottom=4]="Bottom",Xr[Xr.Left=8]="Left",Xr[Xr.ALL=15]="ALL";const $r=[!1,!1,!1,!1],Kr=t=>{let e=!0;if(K(t,!0)){for(let i=0;i<4;i++)$r[i]=t,e&&=!!($r[i]??1);e=t}else if(Array.isArray(t))for(let i=0;i<4;i++)$r[i]=!!t[i],e&&=!!$r[i];else $r[0]=!1,$r[1]=!1,$r[2]=!1,$r[3]=!1;return{isFullStroke:e,stroke:$r}},qr=[0,0,0,0],Zr=t=>t?nt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(qr[0]=t[0],qr[2]=t[0],qr[1]=t[1],qr[3]=t[1],qr):t:t:0,Jr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qr=[1,2,3,0,1,2,3,0];function ts(t,e,i,n){for(;t>=bt;)t-=bt;for(;t<0;)t+=bt;for(;t>e;)e+=bt;Jr[0].x=i,Jr[1].y=i,Jr[2].x=-i,Jr[3].y=-i;const r=Math.ceil(t/mt)%4,s=Math.ceil(e/mt)%4;if(n.add(At(t)*i,Bt(t)*i),n.add(At(e)*i,Bt(e)*i),r!==s||e-t>vt){let t=!1;for(let e=0;e<Qr.length;e++)if(t||r!==Qr[e]){if(t&&s===Qr[e])break;if(t){const t=Jr[Qr[e]];n.add(t.x,t.y)}}else{t=!0;const e=Jr[r];n.add(e.x,e.y)}}}function es(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function is(t,e,i){const{x:n,y:r}=Mt(t.x,t.y,e.x,e.y,i),{x:s,y:o}=Mt(t.x1,t.y1,e.x1,e.y1,i),a=new Ot(n,r,s,o);return a.defined=e.defined,a}function ns(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new Ot(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=is(t[r],e[r],i)}else{n=e.map((t=>{const e=new Ot(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=is(t[r],e[r],i)}return n}const rs=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],ss=t=>rs.includes(t);function os(t,e){if(nt(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class as{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:as.TimeOut;i(this,"durations",void 0),i(this,"timeout",void 0),i(this,"lastDate",void 0),i(this,"durationsListThreshold",void 0),this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}i(as,"TimeOut",1e3/60);const hs=new as,ls=(t,e)=>it(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;var cs;!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"}(cs||(cs={}));class ds extends Nr{constructor(t,e,n,r,s){super(null,null,n,r,s),i(this,"_group",void 0),i(this,"_clipGraphic",void 0),i(this,"clipFromAttribute",void 0),i(this,"clipToAttribute",void 0),i(this,"_lastClip",void 0),i(this,"_lastPath",void 0),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=s?.group,this._clipGraphic=s?.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function us(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,d=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=d,s[4]=d,s[5]=c,s[6]=h,s[7]=n}function ps(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),d=[o[0],o[1]];let u=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(u<=0){d.push(n,a,h,l,p,f);continue}const g=Math.min(u,c)+1;for(let t=1;t<=g;t++){const o=t/g;us(e,n,h,p,o,r),us(i,a,l,f,o,s),e=r[3],i=s[3],d.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],h=r[6],l=s[6]}u-=g-1}return o===t?[d,e]:[t,d]}function fs(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],o=[];for(let t=0;t<e.length;t+=2)o[t]=r,o[t+1]=s;return o}function gs(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function vs(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,o=r-2;s<r;o=s,s+=2){const r=t[o],a=t[o+1],h=t[s],l=t[s+1],c=r*l-h*a;e+=c,i+=(r+h)*c,n+=(a+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function ms(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],d=e[s]-n[0]-a,u=e[s+1]-n[1]-l;c+=d*d+u*u}c<s&&(s=c,o=l)}return o}function ys(t,e,i,n){const r=[];let s;for(let o=0;o<t.length;o++){let a=t[o];const h=e[o],l=vs(a),c=vs(h);null==s&&(s=l[2]<0!=c[2]<0);const d=[],u=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=gs(a));const m=6*ms(a,h,l,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;d[t+2]=a[e]-l[0],d[t+3]=a[e+1]-l[1]}if(d[0]=a[m]-l[0],d[1]=a[m+1]-l[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<a.length;e+=2){const r=d[e],s=d[e+1],o=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,u=o*t+a*i;g[e]=l,g[e+1]=u;const p=l-r,f=u-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)u[t]=g[t]}}}else for(let t=0;t<v;t+=2)u[t]=h[t]-c[0],u[t+1]=h[t+1]-c[1];r.push({from:d,to:u,fromCp:l,toCp:c,rotation:-p})}return r}function bs(t,e){let i,n;const r=[],s=[];for(let o=0;o<Math.max(t.length,e.length);o++){const a=t[o],h=e[o];let l,c;a?h?([l,c]=ps(a,h),i=l,n=c):(c=fs(n,a),l=a):(l=fs(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const xs=(t,e,i,n,r)=>{pt(e,n)&&pt(i,r)||t.push(e,i,n,r,n,r)};function ws(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,d,u;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Te.L,Te.C,Te.Q].includes(i[0])&&(n=[o,a])),i[0]){case Te.M:r=o=i[1],s=a=i[2],h(o,a);break;case Te.L:l=i[1],c=i[2],xs(n,r,s,l,c),r=l,s=c;break;case Te.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Te.Q:l=i[1],c=i[2],d=i[3],u=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),d+2/3*(l-d),u+2/3*(c-u),d,u),r=d,s=u;break;case Te.A:{const t=i[1],e=i[2],d=i[3],u=d,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*d+t,c=Math.sin(f)*d+e,p?(o=l,a=c,h(o,a)):xs(n,r,s,l,c),r=Math.cos(g)*d+t,s=Math.sin(g)*d+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);ze(n,i,r,t,e,d,u)}break}case Te.E:{const t=i[1],e=i[2],d=i[3],u=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!pt(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*d,A=Math.sin(g)*u;y?(l=w*b-A*x+t,c=w*x+A*b+e):(l=w+t,c=A+e),p?(o=l,a=c,h(o,a)):xs(n,r,s,l,c),w=Math.cos(v)*d,A=Math.sin(v)*u,y?(r=w*b-A*x+t,s=w*x+A*b+e):(r=w+t,s=A+e);const S=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=S){const r=m?Math.max(i+S,v):Math.min(i+S,v);if(ze(n,i,r,t,e,d,u),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],A=n[r+1],n[r]=(w-t)*b-(A-e)*x+t,n[r+1]=(w-t)*x+(A-e)*b+e}}break}case Te.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),xs(n,l,a,l,c),xs(n,l,c,o,c),xs(n,o,c,o,a),xs(n,o,a,l,a);break;case Te.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],d=Lt.distancePP({x:r,y:s},{x:t,y:e}),u=Lt.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(d*u),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,m=Lt.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=h+f*v/m,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/d,a=e+x*(s-e)/d,xs(n,r,s,o,a),r=t+x*(h-t)/u,s=e+x*(l-e)/u;const w=Ut({x:y,y:b},{x:o,y:a}),A=Ut({x:y,y:b},{x:r,y:s});ze(n,w,A,y,b,c,c);break}case Te.Z:n&&xs(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function As(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function Ss(t){const e=new Ri;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}const Ts=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=Z(t.width)?t.x1-t.x:t.width,i=Z(t.height)?t.y1-t.y:t.height,n=0,r=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:r,width:e,height:i}};function Bs(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const o=[];for(let t=0;t<r;t++)o.push(s);const a=i-r*s;if(a>0)for(let t=0;t<a;t+=s)t+s<a?o.push(s):o.push(a-t);return o}const Cs=(t,e)=>{const{width:i,height:n}=Ts(t.attribute),r=Bs(i,n,e),s=[],o=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*o,width:n,height:o})}return s},_s=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),a=Math.abs(n-r),h=Math.abs(o-s),l=Bs(a*(s+o)/2,h,e),c=[],d=h/l.length,u=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-d*t*u,outerRadius:o-d*(t+1)*u,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Ps=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=Bs(s*r,r,e),a=[],h=s/o[0],l=r/o.length,c=n>=i?1:-1;for(let t=0,e=o.length;t<e;t++)for(let e=0,n=o[t];e<n;e++)a.push({innerRadius:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return a},Rs=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&rt(t.x)&&rt(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let o=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const a=t[e].x,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&o<r;)n.push({x:a+(l-a)*i,y:h+(c-h)*i}),i+=s,o+=1}return n},Ms=(t,e)=>{const i=t.attribute;let n=i.points;const r=i.segments;n||(n=r.reduce(((t,e)=>t.concat(e.points??[])),[]));const s=n.filter((t=>!1!==t.defined&&rt(t.x)&&rt(t.y)));if(!s.length)return[];const o=[];s.forEach((t=>{o.push({x:t.x,y:t.y})}));for(let t=s.length-1;t>=0;t--){const e=s[t];o.push({x:e.x1??e.x,y:e.y1??e.y})}const a=[];return Is(n,e,a),a},ks=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Rs(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>t.concat(e.points??[])),[]);return Rs(t,e)}return[]};const Es=t=>t.map((t=>({x:t.x,y:t.y}))),Os=(t,e,i)=>{const n=t.length,r=[];for(let a=0;a<n;a++){const h=t[a],l=a===n-1?t[0]:t[a+1],c=he([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],o=[i.x-e.x,i.y-e.x],s[0]*o[1]-s[1]*o[0]),point:{x:c[0],y:c[1]},edgeIndex:a})}var s,o;if(r.length<2)return[Es(t),Es(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,d=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.edgeIndex;e++)d.push({x:t[e].x,y:t[e].y});d.push({x:c.x,y:c.y});const u=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];u.push({x:i.x,y:i.y})}return u.push({x:l.x,y:l.y}),[d,u]},Ls=t=>{const e=new Dt;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return Os(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Os(t,{x:e.x1,y:r},{x:e.x2,y:r})},Is=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Ls(t);Is(r[0],n,i),Is(r[1],e-n,i)}},Ds=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Es(i)}];const n=[];return Is(i,e,n),n},Ws=(t,e)=>{const i=ws(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const o=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:Ss(o)})}return t}const r=[],s=Math.floor(e/n);let o=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});Is(e,t===n-1?o:s,r),o-=s}return r};var js;t.ColorType=void 0,(js=t.ColorType||(t.ColorType={}))[js.Color255=0]="Color255",js[js.Color1=1]="Color1";class Us{static Get(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){const t=Us.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=Zt.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];Us.store1[e]=t,Us.store255[e]=[i.r,i.g,i.b,i.opacity],n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]}return n}const r=Us.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=Zt.parseColorString(e);return s&&(Us.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],Us.store255[e]=[s.r,s.g,s.b,s.opacity],n[0]=s.r,n[1]=s.g,n[2]=s.b,n[3]=s.opacity),n}static Set(e,i,n){if(i===t.ColorType.Color1){if(Us.store1[e])return;Us.store1[e]=n,Us.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Us.store255[e])return;Us.store255[e]=n,Us.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Ns(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Fs(e,i,n,r,s){if(!e||!i)return e&&Ns(e)||i&&Ns(i)||!1;let o,a,h=!1,l=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=Us.Get(e,t.ColorType.Color255):h=!0,Array.isArray(i)?a=i:"string"==typeof i?a=Us.Get(i,t.ColorType.Color255):l=!0,h!==l){const t=h?e:i,o=h?i:e,a={...t,stops:t.stops.map((t=>({...t,color:Ns(o)})))};return h?Fs(t,a,n,r,s):Fs(a,t,n,r,s)}if(h){if(e.gradient===i.gradient){const t=e,r=i,s=t.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===t.gradient)return Gs(t,r,n);if("radial"===t.gradient)return zs(t,r,n);if("conical"===t.gradient)return Hs(t,r,n)}return!1}return s&&s(o,a),Ns(Vs(o,a,n),r)}function Gs(t,e,i){const n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:$s(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function zs(t,e,i){const n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:$s(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Hs(t,e,i){const n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:$s(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function Vs(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]}i(Us,"store255",{}),i(Us,"store1",{});const Ys=[0,0,0,0],Xs=[0,0,0,0];function $s(e,i,n){return Us.Get(e,t.ColorType.Color255,Ys),Us.Get(i,t.ColorType.Color255,Xs),`rgba(${Math.round(Ys[0]+(Xs[0]-Ys[0])*n)},${Math.round(Ys[1]+(Xs[1]-Ys[1])*n)},${Math.round(Ys[2]+(Xs[2]-Ys[2])*n)},${Ys[3]+(Xs[3]-Ys[3])*n})`}const Ks=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=Fs(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},qs=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,d=o.toCp,u=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(d[0]-c[0])*i,r[1]=c[1]+(d[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*u+r[0],n[t+1]=o*u+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},Zs=(t,e,i)=>{const n=t?ws(t):[],r=ws(e);i&&n&&(i.fromTransform&&As(n,i.fromTransform.clone().getInverse()),As(n,i.toTransfrom));const[s,o]=bs(n,r);return t?ys(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},Js=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],Qs=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!Js.includes(s))return;const o=i[s];Z(o)||Z(e[s])||o===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?Us.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof o?Us.Get(o,t.ColorType.Color255):o,key:s}):n.push({from:e[s],to:o,key:s}),r=!0)})),r?n:null};class to extends Nr{constructor(t,e,n){super(0,1,e,n),i(this,"saveOnEnd",void 0),i(this,"otherAttrs",void 0),i(this,"morphingData",void 0),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;qs(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Ks(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const eo=(t,e,i,n)=>{if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let r=t?.globalTransMatrix;n&&r&&(r=n.clone().multiply(r.a,r.b,r.c,r.d,r.e,r.f));const s=Zs(t?.toCustomPath?.(),e.toCustomPath(),{fromTransform:r,toTransfrom:e.globalTransMatrix}),o=Qs(t?.attribute,e.attribute),a=e.animate(i);return i?.delay&&a.wait(i.delay),a.play(new to({morphingData:s,otherAttrs:o},i?.duration??Yr.duration,i?.easing??Yr.easing)),a};class io extends Nr{constructor(t,e,n){super(0,1,e,n),i(this,"otherAttrs",void 0),i(this,"morphingData",void 0),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{qs(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),this.otherAttrs?.[i]&&this.otherAttrs[i].length&&Ks(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const no=t=>{const e={};return Object.keys(t).forEach((i=>{ss(i)||(e[i]=t[i])})),e},ro=(t,e,i)=>{const n=no(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{r.appendChild(t)}));else{const s=t.AABBBounds,o=s.width(),a=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=on.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},so=(t,e,i)=>{const n=[],r=i?null:no(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Ri).fromCustomPath2D(s)};n.push(on.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&ro(t,n,e),n},oo=(t,e,i)=>{const n=[],r=i?null:no(t.attribute);if("rect"===t.type)Cs(t,e).forEach((t=>{n.push(on.graphicService.creator.rect(i?t:Object.assign({},r,t)))}));else if("arc"===t.type)_s(t,e).forEach((t=>{n.push(on.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("circle"===t.type)Ps(t,e).forEach((t=>{n.push(on.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("line"===t.type){const s=ks(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(on.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else"polygon"===t.type?Ds(t,e).forEach((t=>{n.push(on.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"area"===t.type?Ms(t,e).forEach((t=>{n.push(on.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"path"===t.type&&Ws(t,e).forEach((t=>{"path"in t?n.push(on.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(on.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}));return i&&ro(t,n,e),n};class ao{static GetImage(t,e){const i=ao.cache.get(t);i?"fail"===i.loadState?on.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?i.waitingMark?.push(e):e&&e.imageLoadSuccess(t,i.data):ao.loadImage(t,e)}static GetSvg(t,e){let i=ao.cache.get(t);i?"fail"===i.loadState?on.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?i.waitingMark?.push(e):e&&e.imageLoadSuccess(t,i.data):(i={type:"image",loadState:"init"},ao.cache.set(t,i),i.dataPromise=on.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{i.loadState=e?.data?"success":"fail",i.data=e?.data,i.waitingMark?.map(((n,r)=>{e?.data?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=ao.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},ao.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=on.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=on.global.loadBlob(t):"json"===e&&(i.dataPromise=on.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!ao.isLoading&&ao.toLoadAueue.length){ao.isLoading=!0;const t=ao.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,r={type:"image",loadState:"init"};if(ao.cache.set(i,r),r.dataPromise=on.global.loadImage(i),r.dataPromise){r.waitingMark=n;const t=r.dataPromise.then((t=>{r.loadState=t?.data?"success":"fail",r.data=t?.data,r.waitingMark?.map(((e,n)=>{t?.data?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))}))}));e.push(t)}else r.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{ao.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),ao.loading()})).catch((t=>{console.error(t),ao.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),ao.loading()}))}}),0)}static loadImage(t,e){const i=ho(t,ao.toLoadAueue);if(-1!==i)return ao.toLoadAueue[i].marks.push(e),void ao.loading();ao.toLoadAueue.push({url:t,marks:[e]}),ao.loading()}static improveImageLoading(t){const e=ho(t,ao.toLoadAueue);if(-1!==e){const t=ao.toLoadAueue.splice(e,1);ao.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function ho(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}i(ao,"cache",new Map),i(ao,"isLoading",!1),i(ao,"toLoadAueue",[]),i(ao,"onLoadSuccessCb",[]);const lo=new Nt,co=new Wt,uo=["lineWidth","scaleX","scaleY","angle","anchor","visible"],po=["x","y"],fo=["scaleX","scaleY"],go=["angle"],vo=new Ot,mo={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class yo extends br{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(yo.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._AABBBounds=new Wt,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background?this.loadImage(e.background.background??e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;vo.x=i+(t.scrollX??0),vo.y=n+(t.scrollY??0)}else vo.x=i,vo.y=n;return vo}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;on.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return on.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Nt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){const t=this.attribute;return Number.isFinite((t.x??0)+(t.y??0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new Ot(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):Z(this.normalAttrs?.[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:uo;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:uo;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background?this.loadImage(e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(i)}translate(e,i){if(0===e&&0===i)return this;const n={type:t.AttributeUpdateType.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,po,n);r&&(e=r.x,i=r.y,delete r.x,delete r.y,this._setAttributes(r));const s=this.attribute,o=s.postMatrix;return o?on.transformUtil.fromMatrix(o,o).translate(e,i):(s.x=(s.x??Oi.x)+e,s.y=(s.y??Oi.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,po,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){if(1===e&&1===i)return this;const r={type:t.AttributeUpdateType.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,fo,r);s&&(e=s.scaleX,i=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));const o=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new Nt,o.postMatrix=t),on.transformUtil.fromMatrix(t,t).scale(e,i,n)}else o.scaleX=(o.scaleX??Oi.scaleX)*e,o.scaleY=(o.scaleY??Oi.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,fo,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){if(0===e)return this;const n={type:t.AttributeUpdateType.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,go,n);r&&(delete r.angle,this._setAttributes(r,!1,n));const s=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new Nt,s.postMatrix=t),on.transformUtil.fromMatrix(t,t).rotate(e,i)}else s.angle=(s.angle??Oi.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,go,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Gr(t?.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(on.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Z(t)||this.currentStates.includes(t))}getState(t){return this.states?.[t]}applyStateAttrs(e,i,n,r){if(n){const n=Object.keys(e),s=this.getNoWorkAnimateAttr(),o={};let a;n.forEach((t=>{s[t]?(a||(a={}),a[t]=e[t]):o[t]=r&&void 0===e[t]?this.getDefaultAttribute(t):e[t]}));const h=this.animate();h.stateNames=i,h.to(o,this.stateAnimateConfig?.duration??Vr.duration,this.stateAnimateConfig?.easing??Vr.easing),a&&this.setAttributes(a,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&e.stop(t)}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();lt(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&this.currentStates?.length?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){if(!t.length)return void this.clearStates(e);if(this.currentStates?.length===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{const n=this.stateProxy?this.stateProxy(e,t):this.states?.[e];n&&Object.assign(i,n)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return co.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(co),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Oi.x,y:e=Oi.y,scaleX:i=Oi.scaleX,scaleY:n=Oi.scaleY,angle:r=Oi.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(o&&(h=this.getAnchor(o,l)),!s||1===i&&1===n)!function(t,e,i,n,r,s,o,a){const h=e.a,l=e.b,c=e.c,d=e.d,u=e.e,p=e.f,f=At(o),g=Bt(o);let v,m;a?(v=a[0],m=a[1]):(v=i,m=n);const y=v-i,b=m-n,x=h*f+c*g,w=l*f+d*g,A=c*f-h*g,S=d*f-l*g;t.a=r*x,t.b=r*w,t.c=s*A,t.d=s*S,t.e=u+h*v+c*m-x*y-A*b,t.f=p+l*v+d*m-w*y-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(r),o.translate(-h[0],-h[1]),o.translate(t,e),h=this.getAnchor(s,l),on.transformUtil.fromMatrix(o,o).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Oi);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=lo.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),on.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{if(!e.validAttr(s))return;const l=o[s],c=(a&&a[s])??t.getLastPropByName(s,n);if(null==l||null==c)return void(i[s]=l);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,c,l,i),d||(d=e.customInterpolate(s,r,c,l,this,i),d||this.defaultInterpolate(l,c,s,i,h,r)||this._interpolate(s,r,c,l,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const o=Fs(e,r.fillColorArray??t,s,!1,((t,e)=>{r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});const o=Fs(e,r.strokeColorArray??t,s,!1,((t,e)=>{r.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){r||(r={});const o=Fs(e,r.shadowColorArray??t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(n[i]=o),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return mr(this)[this.type][t]}getComputedAttribute(t){return this.attribute[t]??this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=t??on.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return it(t,!0)?this.pathProxy=(new Ri).fromString(t):this.pathProxy=new Ri,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(ao.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(ot(t)||t.includes("/")||at(t))&&(ao.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):Q(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",on.graphicService.onRelease(this)}_emitCustomEvent(t,e){if(this._events&&t in this._events){const i=new Tr(t,e);i.bubbles=!1,i.manager=this.stage?.eventSystem?.manager,this.dispatchEvent(i)}}}yo.mixin(Pr);class bo{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function xo(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function wo(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let r=n.data;const s=n.index,o=r.search(/\s/);let a=r,h=!0;-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const l=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==n.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:h,rawTagName:l}}const Ao=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class So{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i}(t,Ao),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new bo("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=xo(t,">",s,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",s=e}else if("?"===t[s+1])s=wo(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=xo(t,"--\x3e",s+4,"Comment is not closed.");else{const o=wo(t,s,!1);let a=o.tagName,h=o.tagExp;const l=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),h=a):h=h.substr(0,h.length-1);const t=new bo(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new bo(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s];return e.child}}function To(t,e){return Bo(t)}function Bo(t,e){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=Co(r);if(void 0!==s&&r[s]){const t=Bo(r[s]);n=t,Object.keys(n).length,r[":@"]&&_o(t,r[":@"]),void 0!==i[s]&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(t)):i[s]=t}}var n;return i}function Co(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function _o(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++){const n=i[r];t[n]=e[n]}}}class Po{constructor(t){i(this,"options",void 0),this.options=Object.assign({},Po.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return To(new So(this.options).parseXml(t),this.options)}}function Ro(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function Mo(t){return t.startsWith("<")}function ko(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}i(Po,"defaultOptions",{});let Eo=0;function Oo(){return Eo++}var Lo;function Io(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)jo(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Lo=t.TextDirection||(t.TextDirection={}))[Lo.HORIZONTAL=0]="HORIZONTAL",Lo[Lo.VERTICAL=1]="VERTICAL";const Do=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Do.set(t,!0)));const Wo=new Map;function jo(t){if(Do.has(t))return!0;if(Wo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function Uo(t,e){const i=t.attribute;i&&i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}[""].forEach((t=>Wo.set(t,!0)));const No=Oo(),Fo=Oo(),Go=Oo(),zo=Oo(),Ho=Oo(),Vo=Oo(),Yo=Oo(),Xo=Oo(),$o=Oo(),Ko=Oo(),qo=Oo(),Zo=Oo(),Jo=Oo(),Qo=Oo(),ta=Oo(),ea=Oo(),ia=Symbol.for("GraphicService"),na=Symbol.for("GraphicCreator"),ra={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},sa=Object.keys(ra),oa={"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"},aa=Object.keys(oa);var ha;t.GroupUpdateAABBBoundsMode=void 0,(ha=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[ha.LESS_GROUP=0]="LESS_GROUP",ha[ha.MORE_GROUP=1]="MORE_GROUP";class la extends yo{constructor(e){super(e),i(this,"type","group"),i(this,"parent",null),i(this,"isContainer",!0),this.numberType=Vo,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new gr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new gr)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new Ot(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;on.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),on.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Oi.x,y:e=Oi.y,dx:i=Oi.dx,dy:n=Oi.dy,scaleX:r=Oi.scaleX,scaleY:s=Oi.scaleY,angle:o=Oi.angle,postMatrix:a}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==r||1!==s||0!==o||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}doUpdateAABBBounds(){const t=this.attribute,e=mr(this).group;this._AABBBounds.clear();const i=on.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=Zr(n);return r&&i.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),on.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),on.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,on.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{on.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),on.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=on.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new la({...this.attribute})}getNoWorkAnimateAttr(){return la.NOWORK_ANIMATE_ATTR}}function ca(t){return new la(t)}i(la,"NOWORK_ANIMATE_ATTR",mo);class da extends la{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:n.zIndex??0}),this.layer=this,this.subLayers=new Map,this.theme=new gr,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{on.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:t.background??this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{on.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){this.layerHandler.drawTo(t,[this],{background:e.background??this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this)))}}const ua=Symbol.for("TransformUtil"),pa=Symbol.for("GraphicUtil"),fa=Symbol.for("LayerService"),ga=Symbol.for("StaticLayerHandlerContribution"),va=Symbol.for("DynamicLayerHandlerContribution"),ma=Symbol.for("VirtualLayerHandlerContribution");var ya,ba,xa=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},wa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=(ya=class{static GenerateLayerId(){return`${ba.idprefix}_${ba.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=on.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?xn.get(ga):"dynamic"===t?xn.get(va):xn.get(ma),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();let i=this.getRecommendedLayerType(e.layerMode);i=e.main||e.canvasId?"static":i;const n=this.getLayerHandler(i),r=new da(t,this.global,t.window,{main:!1,...e,layerMode:i,canvasId:e.canvasId??ba.GenerateLayerId(),layerHandler:n}),s=this.layerMap.get(t)||[];return s.push(r),this.layerMap.set(t,s),this.staticLayerCountInEnv--,r}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}},i(ya,"idprefix","visactor_layer"),i(ya,"prefix_count",0),ba=ya),t.DefaultLayerService=ba=xa([m(),wa("design:paramtypes",[])],t.DefaultLayerService);var Aa=new r((e=>{e(F).to(t.DefaultGlobal).inSingletonScope(),e(nr).to(t.DefaultWindow),e(pa).to(t.DefaultGraphicUtil).inSingletonScope(),e(ua).to(t.DefaultTransformUtil).inSingletonScope(),e(fa).to(t.DefaultLayerService).inSingletonScope()}));function Sa(t,e){return!(!t&&!e)}function Ta(t,e){let i;return i=nt(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Ba(t,e,i){return i&&t*e>0}function Ca(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function _a(t,e){return t*e>0}function Pa(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Ra(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=mr(t,s?.theme)[t.type.replace("3d","")],{fill:l=h.fill,stroke:c=h.stroke,opacity:d=h.opacity,fillOpacity:u=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible,x:v=h.x,y:m=h.y}=t.attribute,y=Ba(d,u,l),b=_a(d,f),x=Sa(l),w=Ta(c,p);if(!g)return!0;if(!x&&!w)return!0;if(!(y||b||o||a))return!0;e.beginPath();return Ve(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),w&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,i-v,n-m,h),e.stroke())),x&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i-v,n-m,h),e.fill())),!0}function Ma(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,d=a-s;let u=d*h-c*l;return u*u<gt?[]:(u=(c*(e-s)-d*(t-r))/u,[t+u*h,e+u*l])}function ka(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,d=-l*a,u=t+c,p=e+d,f=i+c,g=n+d,v=(u+f)/2,m=(p+g)/2,y=f-u,b=g-p,x=y*y+b*b,w=r-s,A=u*g-f*p,S=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-A*A));let T=(A*b-y*S)/x,B=(-A*y-b*S)/x;const C=(A*b+y*S)/x,_=(-A*y+b*S)/x,P=T-v,R=B-m,M=C-v,k=_-m;return P*P+R*R>M*M+k*k&&(T=C,B=_),{cx:T,cy:B,x01:-c,y01:-d,x11:T*(r/w-1),y11:B*(r/w-1)}}function Ea(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=xt(h-a),c=h>a;let d=!1;if(r<s){const t=r;r=s,s=t}if(r<=gt)e.moveTo(i,n);else if(l>=bt-gt)e.moveTo(i+r*At(a),n+r*Bt(a)),e.arc(i,n,r,a,h,!c),s>gt&&(e.moveTo(i+s*At(h),n+s*Bt(h)),e.arc(i,n,s,h,a,c));else{const u=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:v,innerEndAngle:m,innerStartAngle:y}=t.getParsePadAngle(a,h),b=u,x=u,w=u,A=u,S=Math.max(x,b),T=Math.max(w,A);let B=S,C=T;const _=r*At(g),P=r*Bt(g),R=s*At(m),M=s*Bt(m);let k,E,O,L;if((T>gt||S>gt)&&(k=r*At(v),E=r*Bt(v),O=s*At(y),L=s*Bt(y),l<vt)){const t=Ma(_,P,O,L,k,E,R,M);if(t){const e=_-t[0],i=P-t[1],n=k-t[0],o=E-t[1],a=1/Bt(Pt((e*n+i*o)/(Ct(e*e+i*i)*Ct(n*n+o*o)))/2),h=Ct(t[0]*t[0]+t[1]*t[1]);C=Tt(T,(s-h)/(a-1)),B=Tt(S,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+_,n+P),d=!0;else if(B>gt){const t=Tt(b,B),s=Tt(x,B),a=ka(O,L,_,P,r,t,Number(c)),h=ka(k,E,R,M,r,s,Number(c));B<S&&t===s?!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,B,wt(a.y01,a.x01),wt(h.y01,h.x01),!c)):e.moveTo(i+a.cx+B*At(wt(h.y01,h.x01)),n+a.cy+B*Bt(wt(h.y01,h.x01))):!o||o[0]?(e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),t>0&&e.arc(i+a.cx,n+a.cy,t,wt(a.y01,a.x01),wt(a.y11,a.x11),!c),e.arc(i,n,r,wt(a.cy+a.y11,a.cx+a.x11),wt(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,wt(h.y11,h.x11),wt(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*At(wt(h.y01,h.x01)),n+h.cy+s*Bt(wt(h.y01,h.x01))):e.moveTo(i+k,n+r*Bt(v))}else!o||o[0]?(e.moveTo(i+_,n+P),e.arc(i,n,r,g,v,!c)):e.moveTo(i+r*At(v),n+r*Bt(v));if(!(s>gt)||f<.001)!o||o[1]?e.lineTo(i+R,n+M):e.moveTo(i+R,n+M),d=!0;else if(C>gt){const t=Tt(A,C),r=Tt(w,C),a=ka(R,M,k,E,s,-r,Number(c)),h=ka(_,P,O,L,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),C<T&&t===r){const t=wt(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,C,wt(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+At(t),n+a.cy+Bt(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,wt(a.y01,a.x01),wt(a.y11,a.x11),!c),e.arc(i,n,s,wt(a.cy+a.y11,a.cx+a.x11),wt(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,wt(h.y11,h.x11),wt(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*At(wt(h.y01,h.x01)),n+h.cy+t*Bt(wt(h.y01,h.x01))):e.moveTo(i+O,n+L)}else!o||o[1]?e.lineTo(i+R,n+M):e.moveTo(i+R,n+M),!o||o[2]?e.arc(i,n,s,m,y,c):e.moveTo(i+s*At(y),n+s*Bt(y))}return o?o[3]&&e.lineTo(i+r*At(a),n+r*Bt(a)):e.closePath(),d}class Oa{static GetCanvas(){try{return Oa.canvas||(Oa.canvas=on.global.createCanvas({})),Oa.canvas}catch(t){return null}}static GetCtx(){if(!Oa.ctx){const t=Oa.GetCanvas();Oa.ctx=t.getContext("2d")}return Oa.ctx}}i(Oa,"canvas",void 0),i(Oa,"ctx",void 0);class La extends Ft{static getInstance(){return La._instance||(La._instance=new La),La._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),i(this,"rgbaSet",void 0),i(this,"cacheParams",{CLEAN_THRESHOLD:100,L_TIME:1e3}),i(this,"dataMap",new Map);const n=Oa.GetCanvas(),r=Oa.GetCtx();if(n.width=e,n.height=1,!r)return;if(r.translate(0,0),!r)throw new Error("获取ctx发生错误");const s=r.createLinearGradient(0,0,e,0);t.forEach((t=>{s.addColorStop(t[0],t[1])})),r.fillStyle=s,r.fillRect(0,0,e,1),this.rgbaSet=r.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,o=`${t}${e}${i}${n}`;r.forEach((t=>o+=t.join())),o+=s;let a=this.dataMap.get(o);return a||(a={data:new La(r,s),timestamp:[]},this.addLimitedTimestamp(a,Date.now(),{}),this.dataMap.set(o,a)),this.clearCache(this.dataMap,this.cacheParams),a.data}}i(La,"_instance",void 0);class Ia{static GetSize(t){for(let e=0;e<Ia.ImageSize.length;e++)if(Ia.ImageSize[e]>=t)return Ia.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=Ia.GenKey(t,e,i,n,r),h=Ia.cache[a];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=o)return h[t].pattern;return null}static Set(t,e,i,n,r,s,o,a){const h=Ia.GenKey(t,e,i,n,r);Ia.cache[h]?Ia.cache[h].push({width:o,height:a,pattern:s}):Ia.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function Da(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=bt;for(;i>bt;)i-=bt;if(i<s)return r[0].color;if(i>o)return r[0].color;let a,h,l=(i-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){a=r[t-1],h=r[t];break}return l=(l-a.offset)/(h.offset-a.offset),Fs(a.color,h.color,l,!1)}function Wa(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=Oa.GetCanvas(),d=Oa.GetCtx();if(!d)return null;const u=Ia.GetSize(a),p=Ia.GetSize(h);let f=Ia.Get(e,i,n,s,o,u,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(u-i,2)+Math.pow(n,2)),Math.max(Math.pow(u-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=l+1,m=r/Math.max(1,v-1),y=La.getInstance().GetOrCreate(i,n,u,p,e,v),b=2*Math.PI*g/360;c.width=u,c.height=p,d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,u,p),d.translate(i,n),d.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*m>o);t++){const e=y.getColor(t);d.beginPath(),d.rotate(m),d.moveTo(0,0),d.lineTo(g,-2*b),d.lineTo(g,0),d.fillStyle=e,d.closePath(),d.fill()}const x=d.getImageData(0,0,u,p);return c.width=x.width,c.height=x.height,d.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&Ia.Set(e,i,n,s,o,f,u,p),f}i(Ia,"cache",{}),i(Ia,"ImageSize",[20,40,80,160,320,640,1280,2560]);const ja=Symbol.for("ArcRenderContribution"),Ua=Symbol.for("AreaRenderContribution"),Na=Symbol.for("CircleRenderContribution"),Fa=Symbol.for("GroupRenderContribution"),Ga=Symbol.for("ImageRenderContribution"),za=Symbol.for("PathRenderContribution"),Ha=Symbol.for("PolygonRenderContribution"),Va=Symbol.for("RectRenderContribution"),Ya=Symbol.for("SymbolRenderContribution"),Xa=Symbol.for("TextRenderContribution"),$a=Symbol.for("CommonRenderContribution"),Ka=Symbol.for("InteractiveSubRenderContribution"),qa=["radius","startAngle","endAngle",...uo];class Za extends yo{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),i(this,"type","circle"),this.numberType=zo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}doUpdateAABBBounds(t){const e=mr(this).circle;this._AABBBounds.clear();const i=this.attribute,n=on.graphicService.updateCircleAABBBounds(i,mr(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Zr(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return mr(this).circle[t]}needUpdateTags(t){return super.needUpdateTags(t,qa)}needUpdateTag(t){return super.needUpdateTag(t,qa)}toCustomPath(){const t=this.attribute,e=t.radius??this.getDefaultAttribute("radius"),i=t.startAngle??this.getDefaultAttribute("startAngle"),n=t.endAngle??this.getDefaultAttribute("endAngle"),r=new Ri;return r.arc(0,0,e,i,n),r}clone(){return new Za({...this.attribute})}getNoWorkAnimateAttr(){return Za.NOWORK_ANIMATE_ATTR}}function Ja(t){return new Za(t)}function Qa(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function th(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0}function eh(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function ih(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function nh(t){const e={};return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[ye(i)]=t[i])})),["fontSize","lineHeight"].forEach((i=>{const n=ye(i);Z(t[i])||(e[n]=/^[0-9]*$/.test(`${t[i]}`)?`${t[i]}px`:`${t[i]}`)})),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&it(t.fill)&&(e.color=t.fill),e}i(Za,"NOWORK_ANIMATE_ATTR",mo);class rh{constructor(t,e,n){i(this,"fontFamily",void 0),i(this,"textOptions",void 0),i(this,"textMeasure",void 0),this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,o,a,h){const l=[],c=[e,i],d=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a,h);l.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?d[0]=c[0]/-2:"right"!==n&&"end"!==n||(d[0]=-c[0])),"top"===r||("middle"===r?d[1]=c[1]/-2:"bottom"===r&&(d[1]=-c[1]));const u={xOffset:d[0],yOffset:d[1],width:c[0],height:c[1]};return this.layoutWithBBox(u,l,n,r,s)}GetLayoutByLines(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((t=>t.toString()));const h=[],l=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),h.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s,a).str,width:e});l[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),h.push({str:i,width:e});l[0]=o}l[1]=h.length*n,l[0]=h.reduce(((t,e)=>Math.max(t,e.width)),0);const c={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(c,e,i),this.layoutWithBBox(c,h,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const sh=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...uo];class oh extends yo{get font(){const t=mr(this).text;return this._font||(this._font=Qa(this.attribute,t)),this._font}get clipedText(){const t=this.attribute,e=mr(this).text;if(!this.isSimplify())return;const{maxLineWidth:i=e.maxLineWidth}=t;return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(t.text??e.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=mr(this).text,e=this.attribute;if(this.isMultiLine)return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==e.text.toString():null!=this.clipedText&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),i(this,"type","text"),i(this,"cache",void 0),i(this,"_font",void 0),this.numberType=ea,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return nt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}doUpdateAABBBounds(){const t=mr(this).text;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateWrapAABBBounds(t){const e=mr(this).text,{fontFamily:i=e.fontFamily,textAlign:n=e.textAlign,textBaseline:r=e.textBaseline,fontSize:s=e.fontSize,ellipsis:o=e.ellipsis,maxLineWidth:a,stroke:h=e.stroke,lineWidth:l=e.lineWidth,wordBreak:c=e.wordBreak,fontWeight:d=e.fontWeight,ignoreBuf:u=e.ignoreBuf,suffixPosition:p=e.suffixPosition,heightLimit:f=0,lineClamp:g}=this.attribute,v=ls(this.attribute.lineHeight,this.attribute.fontSize||e.fontSize)??(this.attribute.fontSize||e.fontSize),m=u?0:2;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),h&&this._AABBBounds.expand(l/2),this._AABBBounds}const y=on.graphicUtil.textMeasure,b=new rh(i,{fontSize:s,fontWeight:d,fontFamily:i},y),x=nt(t)?t.map((t=>t.toString())):[t.toString()],w=[],A=[0,0];let S=1/0;if(f>0&&(S=Math.max(Math.floor(f/v),1)),g&&(S=Math.min(S,g)),"number"==typeof a&&a!==1/0){if(a>0)for(let t=0;t<x.length;t++){const e=x[t];let i=!0;if(t===S-1){const i=b.textMeasure.clipTextWithSuffix(e,b.textOptions,a,o,!1,p,t!==x.length-1);w.push({str:i.str,width:i.width});break}const n=b.textMeasure.clipText(e,b.textOptions,a,"break-word"===c);if(""!==e&&""===n.str){if(o){const t=b.textMeasure.clipTextWithSuffix(e,b.textOptions,a,o,!1,p);n.str=t.str??"",n.width=t.width??0}else n.str="",n.width=0;i=!1}if(w.push({str:n.str,width:n.width}),n.str.length===e.length);else if(i){const i=e.substring(n.str.length);x.splice(t+1,0,i)}}let t=0;w.forEach((e=>{t=Math.max(t,e.width)})),A[0]=t}else{let t,e,i=0;for(let n=0,r=x.length;n<r;n++){if(n===S-1){const t=b.textMeasure.clipTextWithSuffix(x[n],b.textOptions,a,o,!1,p);w.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=x[n],t=b.textMeasure.measureTextWidth(e,b.textOptions,"break-word"===c),i=Math.max(i,t),w.push({str:e,width:t})}A[0]=i}A[1]=w.length*(v+m);const T={xOffset:0,yOffset:0,width:A[0],height:A[1]};b.LayoutBBox(T,n,r);const B=b.layoutWithBBox(T,w,n,r,v);return this.cache.layoutData=B,this.clearUpdateShapeTag(),this._AABBBounds.set(T.xOffset,T.yOffset,T.xOffset+T.width,T.yOffset+T.height),h&&this._AABBBounds.expand(l/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=mr(this).text,{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}updateMultilineAABBBounds(t){const e=mr(this).text,{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}updateHorizontalSinglelineAABBBounds(t){const e=mr(this).text,{wrap:i=e.wrap}=this.attribute;if(i)return this.updateWrapAABBBounds([t]);const n=on.graphicUtil.textMeasure;let r,s;const o=this.attribute,{maxLineWidth:a=e.maxLineWidth,ellipsis:h=e.ellipsis,textAlign:l=e.textAlign,textBaseline:c=e.textBaseline,fontFamily:d=e.fontFamily,fontSize:u=e.fontSize,fontWeight:p=e.fontWeight,stroke:f=e.stroke,lineWidth:g=e.lineWidth,ignoreBuf:v=e.ignoreBuf,whiteSpace:m=e.whiteSpace,suffixPosition:y=e.suffixPosition}=o;if("normal"===m)return this.updateWrapAABBBounds(t);const b=v?0:Math.max(2,.075*u),x=o.fontSize||e.fontSize,w=ls(o.lineHeight,x)??x+b;if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth??0;const t=eh(l,r),e=ih(c,w,u);return this._AABBBounds.set(t,e,t+r,e+w),f&&this._AABBBounds.expand(g/2),this._AABBBounds}if(Number.isFinite(a)){if(h){const i=!0===h?e.ellipsis:h,o=n.clipTextWithSuffix(t.toString(),{fontSize:u,fontWeight:p,fontFamily:d},a,i,!1,y);s=o.str,r=o.width}else{const e=n.clipText(t.toString(),{fontSize:u,fontWeight:p,fontFamily:d},a,!1);s=e.str,r=e.width}this.cache.clipedText=s,this.cache.clipedWidth=r}else r=n.measureTextWidth(t.toString(),{fontSize:u,fontWeight:p,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=r;this.clearUpdateShapeTag();const A=eh(l,r);let S=w;on.global&&on.global.isSafari()&&(S+=.2*u);const T=ih(c,S,u,b);return this._AABBBounds.set(A,T,A+r,T+S),f&&this._AABBBounds.expand(g/2),this._AABBBounds}getBaselineMapAlign(){return oh.baselineMapAlign}getAlignMapBaseline(){return oh.alignMapBaseline}updateVerticalSinglelineAABBBounds(e){const i=mr(this).text,n=on.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=i.ignoreBuf}=s,a=o?0:2,{maxLineWidth:h=i.maxLineWidth,ellipsis:l=i.ellipsis,fontSize:c=i.fontSize,fontWeight:d=i.fontWeight,fontFamily:u=i.fontFamily,stroke:p=i.stroke,lineWidth:f=i.lineWidth,verticalMode:g=i.verticalMode,suffixPosition:v=i.suffixPosition}=s,m=ls(s.lineHeight,s.fontSize||i.fontSize)??(s.fontSize||i.fontSize)+a;let{textAlign:y=i.textAlign,textBaseline:b=i.textBaseline}=s;if(!g){const t=y;y=oh.baselineMapAlign[b]??"left",b=oh.alignMapBaseline[t]??"top"}if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth;const t=eh(y,r),e=ih(b,m,c);return this._AABBBounds.set(e,t,e+m,t+r),p&&this._AABBBounds.expand(f/2),this._AABBBounds}let x=[Io(e.toString())];if(Number.isFinite(h)){if(l){const t=!0===l?i.ellipsis:l,e=n.clipTextWithSuffixVertical(x[0],{fontSize:c,fontWeight:d,fontFamily:u},h,t,!1,v);x=[e.verticalList],r=e.width}else{const t=n.clipTextVertical(x[0],{fontSize:c,fontWeight:d,fontFamily:u},h,!1);x=[t.verticalList],r=t.width}this.cache.verticalList=x,this.cache.clipedWidth=r}else r=0,x[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?c:n.measureTextWidth(e.text,{fontSize:c,fontWeight:d,fontFamily:u});r+=i,e.width=i})),this.cache.verticalList=x,this.cache.clipedWidth=r;this.clearUpdateShapeTag();const w=eh(y,r),A=ih(b,m,c);return this._AABBBounds.set(A,w,A+m,w+r),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){const e=mr(this).text,{wrap:i=e.wrap}=this.attribute;if(i)return this.updateWrapAABBBounds(t);const n=this.attribute,{fontFamily:r=e.fontFamily,textAlign:s=e.textAlign,textBaseline:o=e.textBaseline,fontSize:a=e.fontSize,fontWeight:h=e.fontWeight,ellipsis:l=e.ellipsis,maxLineWidth:c,stroke:d=e.stroke,lineWidth:u=e.lineWidth,whiteSpace:p=e.whiteSpace,suffixPosition:f=e.suffixPosition}=n,g=ls(n.lineHeight,n.fontSize||e.fontSize)??(n.fontSize||e.fontSize);if("normal"===p)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(u/2),this._AABBBounds}const v=on.graphicUtil.textMeasure,m=new rh(r,{fontSize:a,fontWeight:h,fontFamily:r},v).GetLayoutByLines(t,s,o,g,!0===l?e.ellipsis:l||void 0,!1,c,f),{bbox:y}=m;return this.cache.layoutData=m,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),d&&this._AABBBounds.expand(u/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){const i=mr(this).text,n=on.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=i.ignoreBuf}=s,a=o?0:2,{maxLineWidth:h=i.maxLineWidth,ellipsis:l=i.ellipsis,fontFamily:c=i.fontFamily,fontSize:d=i.fontSize,fontWeight:u=i.fontWeight,stroke:p=i.stroke,lineWidth:f=i.lineWidth,verticalMode:g=i.verticalMode,suffixPosition:v=i.suffixPosition}=s,m=ls(s.lineHeight,s.fontSize||i.fontSize)??(s.fontSize||i.fontSize)+a;let{textAlign:y=i.textAlign,textBaseline:b=i.textBaseline}=s;if(!g){const t=y;y=oh.baselineMapAlign[b]??"left",b=oh.alignMapBaseline[t]??"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=St(e,r)}));const t=eh(y,r),e=this.cache.verticalList.length*m,i=ih(b,e,d);return this._AABBBounds.set(i,t,i+e,t+r),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=e.map((t=>Io(t.toString())));x.forEach(((e,s)=>{if(Number.isFinite(h))if(l){const t=!0===l?i.ellipsis:l,o=n.clipTextWithSuffixVertical(e,{fontSize:d,fontWeight:u,fontFamily:c},h,t,!1,v);x[s]=o.verticalList,r=o.width}else{const t=n.clipTextVertical(e,{fontSize:d,fontWeight:u,fontFamily:c},h,!1);x[s]=t.verticalList,r=t.width}else r=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?d:n.measureTextWidth(e.text,{fontSize:d,fontWeight:u,fontFamily:c});r+=i,e.width=i}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=St(e,r)}));const w=eh(y,r),A=this.cache.verticalList.length*m,S=ih(b,A,d);return this._AABBBounds.set(S,w,S+A,w+r),p&&this._AABBBounds.expand(f/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return mr(this).text[t]}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sh;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sh;return super.needUpdateTag(t,e)}clone(){return new oh({...this.attribute})}getNoWorkAnimateAttr(){return oh.NOWORK_ANIMATE_ATTR}}function ah(t){return new oh(t)}i(oh,"NOWORK_ANIMATE_ATTR",{ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1,...mo}),i(oh,"baselineMapAlign",{top:"left",bottom:"right",middle:"center"}),i(oh,"alignMapBaseline",{left:"top",right:"bottom",center:"middle"});const hh=["heightLimit","lineClamp"];class lh extends oh{constructor(t){super({...t,wrap:!0})}_isValid(){const{text:t}=this.attribute;return nt(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){const e=mr(this).text,{fontFamily:i=e.fontFamily,textAlign:n=e.textAlign,textBaseline:r=e.textBaseline,fontSize:s=e.fontSize,ellipsis:o=e.ellipsis,maxLineWidth:a,stroke:h=e.stroke,lineWidth:l=e.lineWidth,wordBreak:c=e.wordBreak,fontWeight:d=e.fontWeight,ignoreBuf:u=e.ignoreBuf,heightLimit:p=0,suffixPosition:f=e.suffixPosition,lineClamp:g}=this.attribute,v=ls(this.attribute.lineHeight,this.attribute.fontSize||e.fontSize)??(this.attribute.fontSize||e.fontSize),m=u?0:2;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),h&&this._AABBBounds.expand(l/2),this._AABBBounds}const y=on.graphicUtil.textMeasure,b=new rh(i,{fontSize:s,fontWeight:d,fontFamily:i},y),x=t.map((t=>t.toString())),w=[],A=[0,0];let S=1/0;if(p>0&&(S=Math.max(Math.floor(p/v),1)),g&&(S=Math.min(S,g)),"number"==typeof a&&a!==1/0){if(a>0)for(let t=0;t<x.length;t++){const e=x[t];let i=!0;if(t===S-1){const t=b.textMeasure.clipTextWithSuffix(e,b.textOptions,a,o,!1,f);w.push({str:t.str,width:t.width});break}const n=b.textMeasure.clipText(e,b.textOptions,a,"break-word"===c);if(""!==e&&""===n.str){if(o){const t=b.textMeasure.clipTextWithSuffix(e,b.textOptions,a,o,!1,f);n.str=t.str??"",n.width=t.width??0}else n.str="",n.width=0;i=!1}if(w.push({str:n.str,width:n.width}),n.str.length===e.length);else if(i){const i=e.substring(n.str.length);x.splice(t+1,0,i)}}let t=0;w.forEach((e=>{t=Math.max(t,e.width)})),A[0]=t}else{let t,e,i=0;for(let n=0,r=x.length;n<r;n++){if(n===S-1){const t=b.textMeasure.clipTextWithSuffix(x[n],b.textOptions,a,o,!1,f);w.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=x[n],t=b.textMeasure.measureTextWidth(e,b.textOptions,"break-word"===c),i=Math.max(i,t),w.push({str:e,width:t})}A[0]=i}A[1]=w.length*(v+m);const T={xOffset:0,yOffset:0,width:A[0],height:A[1]};b.LayoutBBox(T,n,r);const B=b.layoutWithBBox(T,w,n,r,v);return this.cache.layoutData=B,this.clearUpdateShapeTag(),this._AABBBounds.set(T.xOffset,T.yOffset,T.xOffset+T.width,T.yOffset+T.height),h&&this._AABBBounds.expand(l/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<hh.length;e++){const i=hh[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<hh.length;e++)if(t===hh[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return lh.NOWORK_ANIMATE_ATTR}}function ch(t){return new lh(t)}class dh{bounds(t,e){if(rt(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function uh(t,e,i,n,r){return r?t.arc(i,n,e,0,yt,!1,r):t.arc(i,n,e,0,yt),!1}var ph=new class extends dh{constructor(){super(...arguments),i(this,"type","circle"),i(this,"pathStr","M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0")}draw(t,e,i,n,r){return uh(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return uh(t,e/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var fh=new class extends dh{constructor(){super(...arguments),i(this,"type","cross"),i(this,"pathStr","M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z")}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}};function gh(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 vh=new class extends dh{constructor(){super(...arguments),i(this,"type","diamond"),i(this,"pathStr","M-0.5,0L0,-0.5L0.5,0L0,0.5Z")}draw(t,e,i,n,r){return gh(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return gh(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return gh(t,e/2+r,i,n,s)}};function mh(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var yh=new class extends dh{constructor(){super(...arguments),i(this,"type","square"),i(this,"pathStr","M-0.5,-0.5h1v1h-1Z")}draw(t,e,i,n){return mh(t,e/2,i,n)}drawOffset(t,e,i,n,r){return mh(t,e/2+r,i,n)}};class bh extends dh{constructor(){super(...arguments),i(this,"type","triangleUp"),i(this,"pathStr","M0.5,0.5 L-0.5,0.5 L0,-0.5 Z")}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}var xh=new bh;var wh=new class extends bh{constructor(){super(...arguments),i(this,"type","triangle")}};const Ah=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Sh=Math.sin(yt/10)*Ah,Th=-Math.cos(yt/10)*Ah;function Bh(t,e,i,n){const r=Sh*e,s=Th*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=yt*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var Ch=new class extends dh{constructor(){super(...arguments),i(this,"type","star"),i(this,"pathStr","M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z")}draw(t,e,i,n){return Bh(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Bh(t,e/2+r,i,n)}};const _h=Ct(3);function Ph(t,e,i,n){const r=e,s=r/_h,o=s/5,a=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var Rh=new class extends dh{constructor(){super(...arguments),i(this,"type","arrow"),i(this,"pathStr","M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z")}draw(t,e,i,n){return Ph(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ph(t,e/2+r,i,n)}};function Mh(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var kh=new class extends dh{constructor(){super(...arguments),i(this,"type","wedge"),i(this,"pathStr","M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z")}draw(t,e,i,n){return Mh(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Mh(t,e/2+r,i,n)}};function Eh(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Oh=new class extends dh{constructor(){super(...arguments),i(this,"type","stroke"),i(this,"pathStr","")}draw(t,e,i,n){return Eh(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Eh(t,e/2+r,i,n)}};const Lh=-.5,Ih=Ct(3)/2,Dh=1/Ct(12);function Wh(t,e,i,n){const r=e/2,s=e*Dh,o=r,a=e*Dh+e,h=-o,l=a;return t.moveTo(r+i,s+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(Lh*r-Ih*s+i,Ih*r+Lh*s+n),t.lineTo(Lh*o-Ih*a+i,Ih*o+Lh*a+n),t.lineTo(Lh*h-Ih*l+i,Ih*h+Lh*l+n),t.lineTo(Lh*r+Ih*s+i,Lh*s-Ih*r+n),t.lineTo(Lh*o+Ih*a+i,Lh*a-Ih*o+n),t.lineTo(Lh*h+Ih*l+i,Lh*l-Ih*h+n),t.closePath(),!1}var jh=new class extends dh{constructor(){super(...arguments),i(this,"type","wye"),i(this,"pathStr","M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z")}draw(t,e,i,n){return Wh(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Wh(t,e/2+r,i,n)}};var Uh=new class extends dh{constructor(){super(...arguments),i(this,"type","triangleLeft"),i(this,"pathStr","M-0.5,0 L0.5,0.5 L0.5,-0.5 Z")}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var Nh=new class extends dh{constructor(){super(...arguments),i(this,"type","triangleRight"),i(this,"pathStr","M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z")}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}};var Fh=new class extends dh{constructor(){super(...arguments),i(this,"type","triangleDown"),i(this,"pathStr","M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z")}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}};const Gh=Ct(3);function zh(t,e,i,n){const r=e*Gh;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Hh=new class extends bh{constructor(){super(...arguments),i(this,"type","thinTriangle"),i(this,"pathStr","M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z")}draw(t,e,i,n){return zh(t,e/2/Gh,i,n)}drawOffset(t,e,i,n,r){return zh(t,e/2/Gh+r,i,n)}};function Vh(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var Yh=new class extends dh{constructor(){super(...arguments),i(this,"type","arrow2Left"),i(this,"pathStr","M 0.25 -0.5 L -0.25 0 l 0.25 0.5")}draw(t,e,i,n){return Vh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Vh(t,e/4+r,i,n)}};function Xh(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var $h=new class extends dh{constructor(){super(...arguments),i(this,"type","arrow2Right"),i(this,"pathStr","M -0.25 -0.5 l 0.25 0 l -0.25 0.5")}draw(t,e,i,n){return Xh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Xh(t,e/4+r,i,n)}};function Kh(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var qh=new class extends dh{constructor(){super(...arguments),i(this,"type","arrow2Up"),i(this,"pathStr","M -0.5 0.25 L 0 -0.25 l 0.5 0.25")}draw(t,e,i,n){return Kh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Kh(t,e/4+r,i,n)}};function Zh(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var Jh=new class extends dh{constructor(){super(...arguments),i(this,"type","arrow2Down"),i(this,"pathStr","M -0.5 -0.25 L 0 0.25 l 0.5 -0.25")}draw(t,e,i,n){return Zh(t,e/4,i,n)}drawOffset(t,e,i,n,r){return Zh(t,e/4+r,i,n)}};function Qh(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var tl=new class extends dh{constructor(){super(...arguments),i(this,"type","lineV"),i(this,"pathStr","M0,-0.5L0,0.5")}draw(t,e,i,n,r){return Qh(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return Qh(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function el(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var il=new class extends dh{constructor(){super(...arguments),i(this,"type","lineH"),i(this,"pathStr","M-0.5,0L0.5,0")}draw(t,e,i,n,r){return el(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return el(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function nl(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 rl=new class extends dh{constructor(){super(...arguments),i(this,"type","close"),i(this,"pathStr","M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5")}draw(t,e,i,n,r){return nl(t,e/2,i,n)}drawOffset(t,e,i,n,r,s){return nl(t,e/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function sl(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function ol(t,e,i,n){const r=e,s=e/2;return t.rect(i-r/2,n-s/2,r,s),!1}var al=new class extends dh{constructor(){super(...arguments),i(this,"type","rect"),i(this,"pathStr","M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z")}draw(t,e,i,n){return rt(e)?ol(t,e,i,n):sl(t,e,i,n)}drawOffset(t,e,i,n,r){return rt(e)?ol(t,e+2*r,i,n):sl(t,[e[0]+2*r,e[1]+2*r],i,n)}};const hl=new Wt;class ll{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i(this,"type",void 0),i(this,"path",void 0),i(this,"pathStr",""),i(this,"isSvg",void 0),i(this,"svgCache",void 0),this.type=t,nt(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,i,n,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Ve(r.path.commandList,t,i,n,e,e),o&&o(r.path,r.attribute)})),!1):(Ve(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Ve(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(Ve(this.path.commandList,t,i,n,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;hl.x1=n.bounds.x1*t,hl.y1=n.bounds.y1*t,hl.x2=n.bounds.x2*t,hl.y2=n.bounds.y2*t,e.union(hl)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const cl=[ph,fh,vh,yh,Hh,wh,Ch,Rh,kh,Oh,jh,Uh,Nh,xh,Fh,Yh,$h,qh,Jh,al,tl,il,rl],dl={};cl.forEach((t=>{dl[t.type]=t}));const ul={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"},pl=new Wt,fl=["symbolType","size",...uo];let gl=class t extends yo{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),i(this,"type","symbol"),i(this,"_parsedPath",void 0),this.numberType=ta}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return nt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=mr(this).symbol;let{symbolType:i=e.symbolType}=this.attribute,n=dl[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(i=ul[i]||i,!0===Ro(i)){const e=new Po,{svg:n}=e.parse(i);if(!n)return null;const r=nt(n.path)?n.path:[n.path];pl.clear();const s=[];r.forEach((t=>{const e=(new Ri).fromString(t.d),i={};aa.forEach((e=>{t[e]&&(i[oa[e]]=t[e])})),s.push({path:e,attribute:i}),pl.union(e.bounds)}));const o=pl.width(),a=pl.height(),h=1/St(o,a);return s.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new ll(i,s,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Ri).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/St(s,o);return r.transform(0,0,a,a),this._parsedPath=new ll(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=mr(this).symbol;this._AABBBounds.clear();const i=this.attribute,n=on.graphicService.updateSymbolAABBBounds(i,mr(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Zr(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return mr(this).symbol[t]}needUpdateTags(t){return super.needUpdateTags(t,fl)}needUpdateTag(t){return super.needUpdateTag(t,fl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=nt(e)?e:[e,e];return t.path?(new Ri).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ri).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t({...this.attribute})}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function vl(t){return new gl(t)}i(gl,"userSymbolMap",{}),i(gl,"NOWORK_ANIMATE_ATTR",{symbolType:1,...mo});const ml=["segments","points","curveType",...uo];let yl=class t extends yo{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),i(this,"type","line"),this.numberType=Xo}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=ns(i,n,e))}doUpdateAABBBounds(){const t=mr(this).line;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateLineAABBBounds(e,mr(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return mr(this).line[t]}needUpdateTags(t){return super.needUpdateTags(t,ml)}needUpdateTag(t){return super.needUpdateTag(t,ml)}toCustomPath(){const t=this.attribute,e=new Ri,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t({...this.attribute})}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function bl(t){return new yl(t)}i(yl,"NOWORK_ANIMATE_ATTR",{segments:1,curveType:1,...mo});const xl=["width","x1","y1","height","cornerRadius",...uo];class wl extends yo{constructor(t){super(t),i(this,"type","rect"),this.numberType=Zo}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}doUpdateAABBBounds(){const t=mr(this).rect;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateRectAABBBounds(e,mr(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return mr(this).rect[t]}needUpdateTags(t){return super.needUpdateTags(t,xl)}needUpdateTag(t){return super.needUpdateTag(t,xl)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:r}=Ts(t),s=new Ri;return s.moveTo(e,i),s.rect(e,i,n,r),s}clone(){return new wl({...this.attribute})}getNoWorkAnimateAttr(){return wl.NOWORK_ANIMATE_ATTR}}function Al(t){return new wl(t)}i(wl,"NOWORK_ANIMATE_ATTR",mo);const Sl=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class Tl extends wl{constructor(t){super(t),i(this,"type","rect3d"),this.numberType=Jo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=mr(this).rect,{x1:i,y1:n,x:r,y:s,length:o=Tt(e.width,e.height)}=this.attribute;let{width:a,height:h}=this.attribute;a=a??i-r,h=h??n-s;for(let e=0;e<Sl.length;e++){const i=Sl[e];t.vertices.push([i[0]*a,i[1]*h,i[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return Tl.NOWORK_ANIMATE_ATTR}}function Bl(t){return new Tl(t)}i(Tl,"NOWORK_ANIMATE_ATTR",mo);class Cl extends yo{constructor(t){super(t),i(this,"type","glyph"),this.numberType=Ho,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.clear();const t=on.graphicService.updateGlyphAABBBounds(this.attribute,mr(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){if(!t.length)return void this.clearStates(e);if(this.currentStates?.length===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(i,r.attributes),r.subAttributes?.length&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,r)=>{i.updateNormalAttrs(n[r]),i.applyStateAttrs(n[r],t,e)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new Cl({...this.attribute});return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Cl.NOWORK_ANIMATE_ATTR}}function _l(t){return new Cl(t)}i(Cl,"NOWORK_ANIMATE_ATTR",mo);class Pl{constructor(t,e,n,r,s,o,a,h,l,c,d,u,p,f){i(this,"left",void 0),i(this,"top",void 0),i(this,"bottom",void 0),i(this,"right",void 0),i(this,"width",void 0),i(this,"height",void 0),i(this,"actualHeight",void 0),i(this,"ellipsis",void 0),i(this,"wordBreak",void 0),i(this,"verticalDirection",void 0),i(this,"lines",void 0),i(this,"globalAlign",void 0),i(this,"globalBaseline",void 0),i(this,"layoutDirection",void 0),i(this,"directionKey",void 0),i(this,"isWidthMax",void 0),i(this,"isHeightMax",void 0),i(this,"singleLine",void 0),i(this,"icons",void 0),this.left=t,this.top=e,this.width=n,this.height=r,this.actualHeight=0,this.bottom=e+r,this.right=t+n,this.ellipsis=s,this.wordBreak=o,this.verticalDirection=a,this.lines=[],this.globalAlign=h,this.globalBaseline=l,this.layoutDirection=c,this.directionKey=an[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=u,this.singleLine=p,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;"right"===this.globalAlign||"end"===this.globalAlign?a=-r:"center"===this.globalAlign&&(a=-r/2);let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,a,s+o,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,this.ellipsis,e)}}}}return l}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],o=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class Rl{constructor(t,e,n){i(this,"text",void 0),i(this,"ascent",void 0),i(this,"descent",void 0),i(this,"width",void 0),i(this,"height",void 0),i(this,"lineHeight",void 0),i(this,"fontSize",void 0),i(this,"length",void 0),i(this,"newLine",void 0),i(this,"character",void 0),i(this,"left",void 0),i(this,"top",void 0),i(this,"direction",void 0),i(this,"widthOrigin",void 0),i(this,"heightOrigin",void 0),i(this,"textBaseline",void 0),i(this,"ellipsis",void 0),i(this,"ellipsisStr",void 0),i(this,"ellipsisWidth",void 0),i(this,"ellipsisOtherParagraphWidth",void 0),i(this,"verticalEllipsis",void 0),i(this,"overflow",void 0),this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";const r=ls(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;const{ascent:s,height:o,descent:a,width:h}=gn(t,n);let l=0,c=0,d=0;this.height>o&&(l=(this.height-o)/2,c=Math.ceil(l),d=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=o-l):"bottom"===this.textBaseline?(this.ascent=o-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=s+c,this.descent=a+d),this.length=t.length,this.width=h||0,this.text=t||"",this.newLine=e||!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),this.ellipsisStr="..."}updateWidth(){const{width:t}=gn(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=pn(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=gn(this.text.slice(t),this.character);"vertical"===a||(o-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===a&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||ln;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i;let s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||hn;if(!i)return void(t.globalAlpha=0);const{fillOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.fillStyle=i;let s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=pn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=gn(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Ml=["width","height","image",...uo];class kl extends yo{constructor(t){super(t),i(this,"type","image"),i(this,"successCallback",void 0),i(this,"failCallback",void 0),this.numberType=Yo,this.loadImage(this.attribute.image)}get width(){return this.attribute.width??0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){return this.attribute.height??0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){return this.attribute.repeatX??"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){return this.attribute.repeatY??"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}doUpdateAABBBounds(){const t=mr(this).image;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateImageAABBBounds(e,mr(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return nn[t]}needUpdateTags(t){return super.needUpdateTags(t,Ml)}needUpdateTag(t){return super.needUpdateTag(t,Ml)}clone(){return new kl({...this.attribute})}getNoWorkAnimateAttr(){return kl.NOWORK_ANIMATE_ATTR}}function El(t){return new kl(t)}i(kl,"NOWORK_ANIMATE_ATTR",{image:1,repeatX:1,repeatY:1,...mo});class Ol extends kl{constructor(t){if(super(t),i(this,"richtextId",void 0),i(this,"globalX",void 0),i(this,"globalY",void 0),i(this,"_x",0),i(this,"_y",0),i(this,"_hovered",!1),i(this,"_marginArray",[0,0,0,0]),i(this,"animationBackUps",void 0),i(this,"incrementalAt",void 0),i(this,"toCustomPath",void 0),"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Zr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(nt(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zr(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){return(this.attribute.width??0)+this._marginArray[1]+this._marginArray[3]}get height(){return(this.attribute.height??0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=nn.width,height:e=nn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Ll{constructor(t,e,n,r,s,o,a,h){i(this,"left",void 0),i(this,"top",void 0),i(this,"width",void 0),i(this,"height",void 0),i(this,"baseline",void 0),i(this,"ascent",void 0),i(this,"descent",void 0),i(this,"paragraphs",void 0),i(this,"actualWidth",void 0),i(this,"blankWidth",void 0),i(this,"textAlign",void 0),i(this,"direction",void 0),i(this,"directionKey",void 0),this.left=t,this.width=e,this.baseline=n,this.ascent=r,this.descent=s,this.top=n-r,this.paragraphs=o.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Ol?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=an[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Rl){const e=un.exec(t.text);0!==e?.index&&(t.text=t.text.slice(e?.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=h?0:this.width-this.actualWidth,this.calcOffset(e,h)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Ol?(t["_"+i.x]=r,r+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+s)}))}draw(t,e,i,n,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n.overflow)continue;if(n instanceof Ol)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:o}=gn(s,n.character),a=o||0;if(a<=this.blankWidth+t){e&&(n.ellipsis="add");break}if(a<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=a,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}}this.paragraphs.map(((e,r)=>{if(e instanceof Ol)return e.setAttributes({x:i+e._x,y:n+e._y}),void s(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof Ol)break;const{width:r}=gn(t,n.character),s=r||0;if(s<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=s;break}if(s<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=s,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof Ol?t.width:t.getWidthWithEllips(this.direction)})),i}}class Il{constructor(t){i(this,"frame",void 0),i(this,"lineWidth",void 0),i(this,"width",void 0),i(this,"height",void 0),i(this,"y",void 0),i(this,"maxAscent",void 0),i(this,"maxDescent",void 0),i(this,"maxAscentForBlank",void 0),i(this,"maxDescentForBlank",void 0),i(this,"lineBuffer",void 0),i(this,"direction",void 0),i(this,"directionKey",void 0),this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=an[this.direction]}store(t){if(t instanceof Ol){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Ll(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof Ol?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=pn(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){const[e,i]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new Rl(i,t.newLine,t.character),new Rl(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Dl=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...uo];class Wl extends yo{constructor(t){super(t),i(this,"type","richtext"),i(this,"_frameCache",void 0),i(this,"_currentHoverIcon",null),this.numberType=Qo}get width(){return this.attribute.width??en.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){return this.attribute.height??en.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){return this.attribute.ellipsis??en.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){return this.attribute.wordBreak??en.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){return this.attribute.verticalDirection??en.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){return this.attribute.textAlign??en.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){return this.attribute.textBaseline??en.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){return this.attribute.textConfig??en.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=mr(this).richtext;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateRichTextAABBBounds(e,mr(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return en[t]}needUpdateTags(t){return super.needUpdateTags(t,Dl)}needUpdateTag(t){return super.needUpdateTag(t,Dl)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:o,lineWidth:a,opacity:h,fillOpacity:l,strokeOpacity:c}=this.attribute;return{fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:o,lineWidth:a,opacity:h,fillOpacity:l,strokeOpacity:c,...t}}doUpdateFrameCache(){const{textConfig:t=[],maxWidth:e,maxHeight:i,width:n,height:r,ellipsis:s,wordBreak:o,verticalDirection:a,textAlign:h,textBaseline:l,layoutDirection:c,singleLine:d,disableAutoWrapLine:u}=this.attribute,p=[];for(let e=0;e<t.length;e++)if("image"in t[e]){const i=this.combinedStyleToCharacter(t[e]),n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new Ol(i);t.successCallback=()=>{this.addUpdateBoundTag(),this.stage?.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else{const i=this.combinedStyleToCharacter(t[e]);if(rt(i.text)&&(i.text=`${i.text}`),i.text&&i.text.includes("\n")){const t=i.text.split("\n");for(let e=0;e<t.length;e++)p.push(new Rl(t[e],0!==e,i))}else i.text&&p.push(new Rl(i.text,!1,i))}const f="number"==typeof e&&Number.isFinite(e)&&e>0,g="number"==typeof i&&Number.isFinite(i)&&i>0,v="number"==typeof n&&Number.isFinite(n)&&n>0&&(!f||n<=e),m="number"==typeof r&&Number.isFinite(r)&&r>0&&(!g||r<=i),y=new Pl(0,0,(v?n:f?e:0)||0,(m?r:g?i:0)||0,s,o,a,h,l,c||"horizontal",!v&&f,!m&&g,d||!1,this._frameCache?.icons),b=new Il(y);if(u){let t=0,e=!1;for(let i=0;i<p.length;i++){const n=p[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&y.lines[y.lines.length-1].paragraphs.push(n)):b.deal(n),y.lines.length!==t&&(t=y.lines.length,b.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,y.lines[y.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,b.lineWidth=0)}}else for(let t=0;t<p.length;t++)b.deal(p[t]);if(b.send(),!("horizontal"===y.layoutDirection?v:m)){const t=y.getActualSizeWidthEllipsis();let n="horizontal"===y.layoutDirection?t.width:t.height;("horizontal"===y.layoutDirection?f:g)&&(n=Math.min(n,"horizontal"===y.layoutDirection?e:i)),y.lines.forEach((function(t){t.calcOffset(n,!1)}))}this._frameCache=y}clone(){return new Wl({...this.attribute})}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?(this._currentHoverIcon?.setHoverState(!1),this._currentHoverIcon=e,this._currentHoverIcon.setHoverState(!0),this.stage?.setCursor(e.attribute.cursor),this.stage?.renderNextFrame()):!e&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,this.stage?.setCursor(),this.stage?.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,this.stage?.setCursor(),this.stage?.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(r.attribute.x??0)+i,r.globalY=(r.attribute.y??0)+n)})),r}getNoWorkAnimateAttr(){return Wl.NOWORK_ANIMATE_ATTR}}function jl(t){return new Wl(t)}i(Wl,"NOWORK_ANIMATE_ATTR",{ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1,...mo});const Ul=["path","customPath",...uo];class Nl extends yo{constructor(t){super(t),i(this,"type","path"),i(this,"cache",void 0),this.numberType=$o}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=mr(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Ri?e.path:(Z(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ri?this.cache:t.path)}doUpdateAABBBounds(){const t=mr(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updatePathAABBBounds(e,mr(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;it(t.path,!0)?this.cache=(new Ri).fromString(t.path):t.customPath&&(this.cache=new Ri,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return mr(this).path[t]}needUpdateTags(t){return super.needUpdateTags(t,Ul)}needUpdateTag(t){return super.needUpdateTag(t,Ul)}toCustomPath(){return(new Ri).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Nl({...this.attribute})}getNoWorkAnimateAttr(){return Nl.NOWORK_ANIMATE_ATTR}}function Fl(t){return new Nl(t)}i(Nl,"NOWORK_ANIMATE_ATTR",{path:1,customPath:1,...mo});const Gl=["segments","points","curveType",...uo];class zl extends yo{constructor(t){super(t),i(this,"type","area"),i(this,"cache",void 0),this.numberType=Go}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=mr(this).area;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateAreaAABBBounds(e,mr(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=ns(i,n,e))}getDefaultAttribute(t){return mr(this).area[t]}needUpdateTags(t){return super.needUpdateTags(t,Gl)}needUpdateTag(t){return super.needUpdateTag(t,Gl)}toCustomPath(){const t=new Ri,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:e.x1??e.x,y:e.y1??e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new zl({...this.attribute})}getNoWorkAnimateAttr(){return zl.NOWORK_ANIMATE_ATTR}}function Hl(t){return new zl(t)}i(zl,"NOWORK_ANIMATE_ATTR",{segments:1,curveType:1,...mo});const Vl=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...uo];class Yl extends yo{constructor(t){super(t),i(this,"type","arc"),this.numberType=No}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=mr(this).arc,{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=n,s-=i,0===e||"0%"===e)return 0;const o=Math.abs(r-s);return Math.min(rt(e,!0)?e:o*parseFloat(e)/100,o/2)}getParsedAngle(){const t=mr(this).arc;let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=jt(e),i=e+s,n&&xt(s)<bt-gt){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));let{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute;const{outerPadding:l=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;a+=l,h-=c;const d=Math.abs(a-h)/2,u=d/a;if(d>gt&&a>gt)return{startAngle:e-r*u*s,endAngle:i+r*u*o,sc:r*u*s,ec:r*u*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=mr(this).arc,{innerPadding:n=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:s=i.padAngle}=this.attribute;let{outerRadius:o=i.outerRadius,innerRadius:a=i.innerRadius}=this.attribute;o+=r,a-=n;const{padRadius:h=Ct(o*o+a*a)}=this.attribute,l=xt(e-t);let c=t,d=e,u=t,p=e;const f=s/2;let g=l,v=l;if(f>gt&&h>gt){const i=e>t?1:-1;let n=Rt(Number(h)/a*Bt(f)),r=Rt(Number(h)/o*Bt(f));return(g-=2*n)>gt?(n*=i,u+=n,p-=n):(g=0,u=p=(t+e)/2),(v-=2*r)>gt?(r*=i,c+=r,d-=r):(v=0,c=d=(t+e)/2),{outerStartAngle:c,outerEndAngle:d,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}return{outerStartAngle:c,outerEndAngle:d,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}doUpdateAABBBounds(t){const e=mr(this).arc;this._AABBBounds.clear();const i=this.attribute,n=on.graphicService.updateArcAABBBounds(i,mr(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Zr(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return super.needUpdateTags(t,Vl)}needUpdateTag(t){return super.needUpdateTag(t,Vl)}getDefaultAttribute(t){return mr(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius-(t.innerPadding||0),r=t.outerRadius-(t.outerPadding||0);const s=xt(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new Ri;if(r<=gt)a.moveTo(0,0);else if(s>=bt-gt)a.moveTo(0+r*At(e),0+r*Bt(e)),a.arc(0,0,r,e,i,!o),n>gt&&(a.moveTo(0+n*At(i),0+n*Bt(i)),a.arc(0,0,n,i,e,o));else{const t=r*At(e),s=r*Bt(e),h=n*At(i),l=n*Bt(i);a.moveTo(0+t,0+s),a.arc(0,0,r,e,i,!o),a.lineTo(0+h,0+l),a.arc(0,0,n,i,e,o),a.closePath()}return a}clone(){return new Yl({...this.attribute})}getNoWorkAnimateAttr(){return Yl.NOWORK_ANIMATE_ATTR}}function Xl(t){return new Yl(t)}i(Yl,"NOWORK_ANIMATE_ATTR",{cap:1,...mo});class $l extends Yl{constructor(t){super(t),i(this,"type","arc3d"),this.numberType=Fo}doUpdateAABBBounds(){const t=mr(this).arc;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updateArc3dAABBBounds(e,mr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return $l.NOWORK_ANIMATE_ATTR}}function Kl(t){return new $l(t)}i($l,"NOWORK_ANIMATE_ATTR",{cap:1,...mo});const ql=["points","cornerRadius",...uo];class Zl extends yo{constructor(t){super(t),i(this,"type","polygon"),this.numberType=Ko}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=mr(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updatePolygonAABBBounds(e,mr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=ns(i,n,e))}getDefaultAttribute(t){return mr(this).polygon[t]}needUpdateTags(t){return super.needUpdateTags(t,ql)}needUpdateTag(t){return super.needUpdateTag(t,ql)}toCustomPath(){const t=this.attribute.points,e=new Ri;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Zl({...this.attribute})}getNoWorkAnimateAttr(){return Zl.NOWORK_ANIMATE_ATTR}}function Jl(t){return new Zl(t)}i(Zl,"NOWORK_ANIMATE_ATTR",mo);class Ql extends Zl{constructor(t){super(t),i(this,"type","pyramid3d"),this.numberType=qo}doUpdateAABBBounds(){const t=mr(this).polygon;this._AABBBounds.clear();const e=this.attribute,i=on.graphicService.updatePyramid3dAABBBounds(e,mr(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zr(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=Lt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=St(r,e);const o=Lt.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=St(r,o)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return Ql.NOWORK_ANIMATE_ATTR}}function tc(t){return new Ql(t)}i(Ql,"NOWORK_ANIMATE_ATTR",mo);class ec extends la{constructor(t){super({x:0,y:0}),i(this,"type","shadowroot"),this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function ic(t){return new ec(t)}class nc{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;i.expand(n+(s+o)/2)}return i}}class rc extends nc{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:a=t.lineWidth}=r;ko(i,n+(s+a)/2,!0,o)}return i}}const sc=Symbol.for("MatrixAllocate"),oc=Symbol.for("Mat4Allocate");function ac(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class hc{constructor(){i(this,"pools",[])}allocate(t,e,i,n,r,s){if(!this.pools.length)return new Nt(t,e,i,n,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new Nt(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class lc{constructor(){i(this,"pools",[])}static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return lc.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const cc=new hc,dc=new lc;var uc=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(i,n){e(i,n,t)}};function gc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=e[9],d=e[10],u=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+l*n,t[5]=o*r+c*n,t[6]=a*r+d*n,t[7]=h*r+u*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=d*r-a*n,t[11]=u*r-h*n,t}function vc(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=e[9],d=e[10],u=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-l*n,t[1]=o*r-c*n,t[2]=a*r-d*n,t[3]=h*r-u*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+d*r,t[11]=h*n+u*r,t}function mc(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,d,u,p,f,g,v,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],d=e[5],u=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+d*r+g*s+e[13],t[14]=h*n+u*r+v*s+e[14],t[15]=l*n+p*r+m*s+e[15]),t}function yc(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function bc(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],d=e[8],u=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*d+A*g,t[1]=b*r+x*h+w*u+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*d+A*g,t[5]=b*r+x*h+w*u+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*d+A*g,t[9]=b*r+x*h+w*u+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*d+A*g,t[13]=b*r+x*h+w*u+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function xc(t,e,i){const{x:n=i.x,y:r=i.y,z:s=i.z,dx:o=i.dx,dy:a=i.dy,dz:h=i.dz,scaleX:l=i.scaleX,scaleY:c=i.scaleY,scaleZ:d=i.scaleZ,alpha:u=i.alpha,beta:p=i.beta,angle:f=i.angle,anchor3d:g=e.attribute.anchor,anchor:v}=e.attribute,m=[0,0,0];if(g){if("string"==typeof g[0]){const t=parseFloat(g[0])/100,i=e.AABBBounds;m[0]=i.x1+(i.x2-i.x1)*t}else m[0]=g[0];if("string"==typeof g[1]){const t=parseFloat(g[1])/100,i=e.AABBBounds;m[1]=i.x1+(i.x2-i.x1)*t}else m[1]=g[1];m[2]=g[2]??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),mc(t,t,[n+o,r+a,s+h]),mc(t,t,[m[0],m[1],m[2]]),gc(t,t,p),vc(t,t,u),mc(t,t,[-m[0],-m[1],m[2]]),function(t,e,i){const n=i[0],r=i[1],s=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[l,c,d]),f){const i=dc.allocate(),n=[0,0];if(v){if("string"==typeof g[0]){const t=parseFloat(g[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=g[0];if("string"==typeof g[1]){const t=parseFloat(g[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=g[1]}mc(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=e[5],d=e[6],u=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+l*n,t[1]=o*r+c*n,t[2]=a*r+d*n,t[3]=h*r+u*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=d*r-a*n,t[7]=u*r-h*n}(i,i,f),mc(i,i,[-n[0],-n[1],0]),bc(t,t,i)}}function wc(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t){i(this,"creator",void 0),i(this,"_rectBoundsContribitions",void 0),i(this,"_symbolBoundsContribitions",void 0),i(this,"_circleBoundsContribitions",void 0),i(this,"_arcBoundsContribitions",void 0),i(this,"_pathBoundsContribitions",void 0),i(this,"tempAABBBounds1",void 0),i(this,"tempAABBBounds2",void 0),this.creator=t,this.hooks={onAttributeUpdate:new U(["graphic"]),onSetStage:new U(["graphic","stage"]),onRemove:new U(["graphic"]),onRelease:new U(["graphic"]),onAddIncremental:new U(["graphic","group","stage"]),onClearIncremental:new U(["graphic","group","stage"]),beforeUpdateAABBBounds:new U(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new U(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Wt,this.tempAABBBounds2=new Wt,this._rectBoundsContribitions=[new nc],this._symbolBoundsContribitions=[new rc],this._circleBoundsContribitions=[new nc],this._arcBoundsContribitions=[new nc],this._pathBoundsContribitions=[new nc]}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new xe(t);return Ve(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){let{width:e,height:n}=t;const{x1:r,y1:s,x:o,y:a}=t;e=e??r-o,n=n??s-a,i.set(0,0,e||0,n||0)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const r=i;i=i.clone();const{width:s,height:o,path:a,clip:h=e.clip}=t;a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=o&&i.set(0,0,Math.max(0,s),Math.max(0,o)),h||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const l=this.tempAABBBounds1,c=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),c.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),r.copy(i),r}updateGlyphAABBBounds(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i):i}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=rt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=ih(s,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=rt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=eh(r,e);i.set(n,i.y1,n+e,i.y2)}}updateRichTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let d=0;switch(h){case"left":d=0;break;case"center":d=-i.width()/2;break;case"right":d=-i.width()}i.translate(d,c);const u=this.tempAABBBounds1,p=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){ko(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,i),It(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y),s.add(t.x1??t.x,t.y1??t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y),s.add(t.x1??t.x,t.y1??t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>bt-gt?i.set(-o,-o,o,o):ts(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateArcAABBBoundsImprecise(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:o=e.outerPadding,innerPadding:a=e.innerPadding}=t;return r+=o,s-=a,r<s&&(r=s),i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:o=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(r+=o,s-=a,r<s){const t=r;r=s,s=t}let{endAngle:h=e.endAngle,startAngle:l=e.startAngle}=t;if(l>h){const t=l;l=h,h=t}return r<=gt?i.set(0,0,0,0):Math.abs(h-l)>bt-gt?i.set(-r,-r,r,r):(ts(l,h,r,i),ts(l,h,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(nt(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){if(!e.empty()){const{scaleX:r=i.scaleX,scaleY:s=i.scaleY,stroke:o=i.stroke,shadowBlur:a=i.shadowBlur,lineWidth:h=i.lineWidth,pickStrokeBuffer:l=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(o&&h){ko(d,(h+l)/Math.abs(r+s),n,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(a){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:o=i.shadowOffsetY}=t;ko(d,a/Math.abs(r+s)*2,!1,c+1),d.translate(n,o),e.union(d)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const o=r.transMatrix;r&&r.isContainer&&(s=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),s&&It(e,e,o)}_validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!n.valid)return i.clear(),!1;const{visible:r=e.visible}=t;return!!r||(i.clear(),!1)}},t.DefaultGraphicService=uc([m(),fc(0,g(na)),pc("design:paramtypes",[Object])],t.DefaultGraphicService);const Ac=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Sc,Tc;function Bc(t){return Sc||(Sc=Ac.CreateGraphic("text",{})),Sc.initAttributes(t),Sc.AABBBounds}const Cc={x:0,y:0,z:0,lastModelMatrix:null};class _c{constructor(){i(this,"camera",void 0),i(this,"builtinContributions",void 0),i(this,"_beforeRenderContribitions",void 0),i(this,"_afterRenderContribitions",void 0),i(this,"_renderContribitions",void 0)}init(e){e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.afterFillStroke)))}beforeRenderStep(t,e,i,n,r,s,o,a,h,l,c,d,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u)}))}afterRenderStep(t,e,i,n,r,s,o,a,h,l,c,d,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:d=e.visible}=t.attribute,u=Ba(a,h,r),p=_a(a,c),f=Sa(r,s),g=Ta(o,l);return!(!t.valid||!d)&&!(!f&&!g)&&!!(u||p||i||n||s)&&{fVisible:u,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:o=e.z,scaleX:a=e.scaleX,scaleY:h=e.scaleY,angle:l=e.angle,postMatrix:c}=t.attribute,d=i.modelMatrix,u=i.camera;Cc.x=r,Cc.y=s,Cc.z=o,Cc.lastModelMatrix=d;const p=u&&(n||wc(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===a&&1===h&&0===l&&!c;if(p){const n=dc.allocate(),r=dc.allocate();xc(r,t,e),bc(n,d||n,r),Cc.x=0,Cc.y=0,Cc.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),dc.free(r)}if(f&&!d){const n=t.getOffsetXY(e);Cc.x+=n.x,Cc.y+=n.y,Cc.z=o,i.setTransformForCurrent()}else if(p)Cc.x=0,Cc.y=0,Cc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const n=t.getOffsetXY(e);Cc.x+=n.x,Cc.y+=n.y,this.transformWithoutTranslate(i,Cc.x,Cc.y,Cc.z,a,h,l)}else i.transformFromMatrix(t.transMatrix,!0),Cc.x=0,Cc.y=0,Cc.z=0;return Cc}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=n.project(0,0,i),a=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},d={x:r,y:s};n.camera=null;const u=1/(l.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+d.y*a.x+(c.y-d.y)*o.x)*u,f=(c.y*h.y+l.y*(a.y-h.y)-d.y*a.y+(d.y-c.y)*o.y)*u,g=(l.x*(h.x-a.x)-c.x*h.x+d.x*a.x+(c.x-d.x)*o.x)*u,v=-(c.x*h.y+l.x*(a.y-h.y)-d.x*a.y+(d.x-c.x)*o.y)*u,m=(l.x*(d.y*a.x-c.y*h.x)+l.y*(c.x*h.x-d.x*a.x)+(d.x*c.y-c.x*d.y)*o.x)*u,y=(l.x*(d.y*a.y-c.y*h.y)+l.y*(c.x*h.y-d.x*a.y)+(d.x*c.y-c.x*d.y)*o.y)*u;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:s}=n;if(!s)return;const{renderable:o}=t.attribute;if(!1===o)return;s.highPerformanceSave();const a=this.transform(t,e,s,i),{x:h,y:l,z:c,lastModelMatrix:d}=a;this.z=c,Ra(t,s,h,l,0,r)||(this.drawShape(t,s,h,l,n,r),this.z=0,s.modelMatrix!==d&&dc.free(s.modelMatrix),s.modelMatrix=d),s.highPerformanceRestore()}}const Pc=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,a)||r("conic",t.conicGradient,o)}function r(e,n,r){return function(n,s){const o=m(n);if(o){m(t.startCall)||i("Missing (");const n=function(n){const s=r();return s&&(m(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:u(p)}}();return m(t.endCall)||i("Missing )"),n}}(n)}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function o(){return v("angular",t.fromAngleValue,1)}function a(){let i,n,r=h();return r&&(i=[],i.push(r),n=e,m(t.comma)&&(r=h(),r?i.push(r):e=n)),i}function h(){let t=function(){const t=v("shape",/^(circle)/i,0);return t&&(t.style=g()||l()),t}()||function(){const t=v("shape",/^(ellipse)/i,0);return t&&(t.style=f()||l()),t}();if(t)t.at=c();else{const e=l();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=d();e&&(t={type:"default-radial",at:e})}}return t}function l(){return v("extent-keyword",t.extentKeywords,1)}function c(){if(v("position",/^at/,0)){const t=d();return t||i("Missing positioning value"),t}}function d(){const t={x:f(),y:f()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let n=e();const r=[];if(n)for(r.push(n);m(t.comma);)n=e(),n?r.push(n):i("One extra comma");return r}function p(){const e=v("hex",t.hexColor,1)||v("rgba",t.rgbaColor,1)||v("rgb",t.rgbColor,1)||v("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=f(),e}function f(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||g()}function g(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,i){const n=m(e);if(n)return{type:t,value:n[i]}}function m(t){const i=/^[\n\r\t\s]+/.exec(e);i&&y(i[0].length);const n=t.exec(e);return n&&y(n[0].length),n}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Rc{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Rc.IsGradientStr(t))try{const e=Pc(t)[0];if(e){if("linear"===e.type)return Rc.ParseLinear(e);if("radial"===e.type)return Rc.ParseRadial(e);if("conic"===e.type)return Rc.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=vt/2,r=parseFloat(e.value)/180*vt-n;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+bt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=vt/2;let r="angular"===e.type?parseFloat(e.value)/180*vt:0;for(;r<0;)r+=bt;for(;r>bt;)r-=bt;let s=0,o=0,a=0,h=0;return r<n?(s=0,o=1,a=Math.sin(r),h=Math.cos(r)):r<vt?(s=0,o=0,a=Math.cos(r-n),h=Math.sin(r-n)):r<vt+n?(s=1,o=0,a=s-Math.sin(r-vt),h=Math.cos(r-vt)):(s=1,a=s-Math.cos(r-n-vt),h-=Math.sin(r-n-vt)),{gradient:"linear",x0:s,y0:o,x1:a,y1:h,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Mc(t,e,i){let n=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(a)*Math.sqrt(o*o+a*a);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function kc(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(nt(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return o=Rc.Parse(o),"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const s=i.AABBBounds;if(!s)return;let o=s.x2-s.x1,a=s.y2-s.y1,h=s.x1-n,l=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;o/=t,a/=e,h/=t,l/=e}const c=t.createLinearGradient(h+(e.x0??0)*o,l+(e.y0??0)*a,h+(e.x1??1)*o,l+(e.y1??0)*a);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const s=i.AABBBounds;if(!s)return;let o=s.x2-s.x1,a=s.y2-s.y1,h=s.x1-n,l=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;o/=t,a/=e,h/=t,l/=e}const c=t.createConicGradient(h+(e.x??0)*o,l+(e.y??0)*a,e.startAngle,e.endAngle);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c.GetPattern(o+h,a+l,void 0)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;const s=i.AABBBounds;if(!s)return;let o=s.x2-s.x1,a=s.y2-s.y1,h=s.x1-n,l=s.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,l/=e,o/=t,a/=e}const c=t.createRadialGradient(h+(e.x0??.5)*o,l+(e.y0??.5)*a,Math.max(o,a)*(e.r0??0),h+(e.x1??.5)*o,l+(e.y1??.5)*a,Math.max(o,a)*(e.r1??.5));return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,o,i,n,r)),s||"orange")}var Ec=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Oc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lc=function(t,e){return function(i,n){e(i,n,t)}};class Ic{constructor(){i(this,"time",t.BaseRenderContributionTime.beforeFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u){const{background:p,backgroundOpacity:f=t.attribute.fillOpacity??h.backgroundOpacity,opacity:g=h.opacity,backgroundMode:v=h.backgroundMode,backgroundFit:m=h.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=mr(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=f*g,this.doDrawImage(e,r.data,s,v,m),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=f*g,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,r){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=i.width(),o=i.height();let a=s,h=o;if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,r=e.height;"repeat-x"===n?(a=i*(o/r),h=o):"repeat-y"===n&&(h=r*(s/i),a=s);const l=t.dpr,c=tr.allocate({width:a,height:h,dpr:l}),d=c.getContext("2d");d&&(d.inuse=!0,d.clearMatrix(),d.setTransformForCurrent(!0),d.clearRect(0,0,a,h),d.drawImage(e,0,0,a,h),e=c.nativeCanvas),tr.free(c)}const l=t.dpr,c=t.createPattern(e,n);c.setTransform&&c.setTransform(new DOMMatrix([1/l,0,0,1/l,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,s,o),t.translate(-i.x1,-i.y1)}}}const Dc=new Ic;t.DefaultBaseInteractiveRenderContribution=class{constructor(e){i(this,"subRenderContribitions",void 0),i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"order",0),i(this,"_subRenderContribitions",void 0),this.subRenderContribitions=e}drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,d,u)}))}},t.DefaultBaseInteractiveRenderContribution=Ec([m(),Lc(0,g(L)),Lc(0,y(Ka)),Oc("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);class Wc{constructor(){i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"textureMap",void 0),i(this,"order",10)}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=n.dpr,a=tr.allocate({width:t,height:t,dpr:o}),h=a.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(s,h);const l=n.createPattern(a.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),tr.free(a),l}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,bt),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,h,f,g,v)}drawTexture(t,e,i,n,r,s,o,a,h){let l=this.textureMap.get(t);if(!l)switch(t){case"circle":l=this.createCirclePattern(a,h,o,i);break;case"diamond":l=this.createDiamondPattern(a,h,o,i);break;case"rect":l=this.createRectPattern(a,h,o,i);break;case"vertical-line":l=this.createVerticalLinePattern(a,h,o,i);break;case"horizontal-line":l=this.createHorizontalLinePattern(a,h,o,i);break;case"bias-lr":l=this.createBiasLRLinePattern(a,h,o,i);break;case"bias-rl":l=this.createBiasRLLinePattern(a,h,o,i);break;case"grid":l=this.createGridPattern(a,h,o,i)}l&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,s),i.fillStyle=l,i.fill(),i.highPerformanceRestore())}}const jc=new Wc;class Uc{constructor(){i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,f=u&&!1!==u.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerPadding:v=h.innerPadding,outerPadding:m=h.outerPadding,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:w=h.x,y:A=h.y,scaleX:S=h.scaleX,scaleY:T=h.scaleY}=t.attribute;let{innerRadius:B=h.innerRadius,outerRadius:C=h.outerRadius}=t.attribute;C+=m,B-=v;const _=!(!u||!u.stroke),P=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=u,s=Mc(e,r,e.dpr),o=r/C;if(t.setAttributes({outerRadius:C+s,innerRadius:B-s,startAngle:y-o,endAngle:b+o}),e.beginPath(),Ea(t,e,i,n,C+s,B-s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,u,h.outerBorder);else if(_){const r=h.outerBorder.opacity;h.outerBorder.opacity=x,e.setStrokeStyle(t,u,(w-i)/S,(A-n)/T,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Mc(e,r,e.dpr),o=r/C;if(t.setAttributes({outerRadius:C-s,innerRadius:B+s,startAngle:y+o,endAngle:b-o}),e.beginPath(),Ea(t,e,i,n,C-s,B+s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,p,h.innerBorder);else if(P){const r=h.innerBorder.opacity;h.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-i)/S,(A-n)/T,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:C,innerRadius:B,startAngle:y,endAngle:b})}}const Nc=new Uc,Fc=jc,Gc=Dc;class zc{constructor(){i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,f=u&&!1!==u.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=h.radius,startAngle:m=h.startAngle,endAngle:y=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY}=t.attribute,T=!(!u||!u.stroke),B=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=u,s=Mc(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v+s,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,u,h.outerBorder);else if(T){const r=h.outerBorder.opacity;h.outerBorder.opacity=b,e.setStrokeStyle(t,u,(x-i)/A,(w-n)/S,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Mc(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,v-s,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,p,h.innerBorder);else if(B){const r=h.innerBorder.opacity;h.innerBorder.opacity=b,e.setStrokeStyle(t,p,(x-i)/A,(w-n)/S,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}const Hc=new zc,Vc=jc,Yc=Dc;class Xc extends Ic{constructor(){super(...arguments),i(this,"time",t.BaseRenderContributionTime.beforeFillStroke)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{background:u,backgroundMode:p=h.backgroundMode,backgroundFit:f=h.backgroundFit}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}}const $c=new Xc,Kc=vt/2;function qc(t,e,i,n,r,s){let o;if(n<0&&(e+=n,n=-n),r<0&&(i+=r,r=-r),rt(s,!0))o=[s=xt(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,i;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=xt(t[0]),o=[e,e,e,e];break;case 2:case 3:e=xt(t[0]),i=xt(t[1]),o=[e,i,e,i];break;default:o=t,o[0]=xt(o[0]),o[1]=xt(o[1]),o[2]=xt(o[2]),o[3]=xt(o[3])}}else o=[0,0,0,0];if(n<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],d=Math.min(n/2,r/2),u=[Math.min(d,o[0]),Math.min(d,o[1]),Math.min(d,o[2]),Math.min(d,o[3])],p=[a[0]+u[0],a[1]],f=[a[0],a[1]+u[0]],g=[h[0]-u[1],h[1]],v=[h[0],h[1]+u[1]],m=[l[0]-u[2],l[1]],y=[l[0],l[1]-u[2]],b=[c[0]+u[3],c[1]],x=[c[0],c[1]-u[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!ct(g,v)){const e=g[0],i=g[1]+u[1];t.arc(e,i,u[1],-Kc,0,!1)}if(t.lineTo(y[0],y[1]),!ct(m,y)){const e=y[0]-u[2],i=y[1];t.arc(e,i,u[2],0,Kc,!1)}if(t.lineTo(b[0],b[1]),!ct(b,x)){const e=b[0],i=b[1]-u[3];t.arc(e,i,u[3],Kc,vt,!1)}if(t.lineTo(f[0],f[1]),!ct(p,f)){const e=p[0],i=p[1]+u[0];t.arc(e,i,u[0],vt,vt+Kc,!1)}return t.closePath(),t}class Zc extends Ic{constructor(){super(...arguments),i(this,"time",t.BaseRenderContributionTime.beforeFillStroke)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{background:u,backgroundMode:p=h.backgroundMode,backgroundFit:f=h.backgroundFit}=t.attribute;if(u)if(t.backgroundImg){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=mr(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(Q(u)){const{stroke:i,fill:n,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=u;if(!i&&!n)return;e.beginPath();const{x:h,y:l,width:c,height:d}=function(t){const e=Zr(t.attribute.boundsPadding),i=t.AABBBounds;let n=i.x1,r=i.y1,s=i.width(),o=i.height();return rt(e)?(n+=e,r+=e,s-=2*e,o-=2*e):(n+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]),{x:n,y:r,width:s,height:o}}(t);s?qc(e,h-o,l-a,c+2*o,d+2*a,s):e.rect(h-o,l-a,c+2*o,d+2*a),e.globalAlpha=1,n&&(e.fillStyle=n,e.fill()),i&&r>0&&(e.lineWidth=r,e.strokeStyle=i,e.stroke())}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=u,e.globalAlpha=1,e.fill()}}}const Jc=new Zc;var Qc=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};class td{constructor(){i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,f=u&&!1!==u.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{cornerRadius:v=h.cornerRadius,opacity:m=h.opacity,x:y=h.x,y:b=h.y,scaleX:x=h.scaleX,scaleY:w=h.scaleY,x1:A,y1:S}=t.attribute;let{width:T,height:B}=t.attribute;T=(T??A-i)||0,B=(B??S-n)||0;const C=!(!u||!u.stroke),_=!(!p||!p.stroke);if(f){const{distance:r=h.outerBorder.distance}=u,s=Mc(e,r,e.dpr),o=i-s,a=n-s,l=2*s;if(0===v||nt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,T+l,B+l)):(e.beginPath(),qc(e,o,a,T+l,B+l,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,u,h.outerBorder);else if(C){const r=h.outerBorder.opacity;h.outerBorder.opacity=m,e.setStrokeStyle(t,u,(y-i)/x,(b-n)/w,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=p,s=Mc(e,r,e.dpr),o=i+s,a=n+s,l=2*s;if(0===v||nt(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(o,a,T-l,B-l)):(e.beginPath(),qc(e,o,a,T-l,B-l,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,p,h.innerBorder);else if(_){const r=h.innerBorder.opacity;h.innerBorder.opacity=m,e.setStrokeStyle(t,p,(y-i)/x,(b-n)/w,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}t.SplitRectBeforeRenderContribution=class{constructor(){i(this,"time",t.BaseRenderContributionTime.beforeFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}},t.SplitRectBeforeRenderContribution=Qc([m()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{x1:u,y1:p,x:f=h.x,y:g=h.y,stroke:v=h.stroke}=t.attribute;let{width:m,height:y}=t.attribute;if(m=(m??u-f)||0,y=(y??p-g)||0,Array.isArray(v)&&v.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),v[0]?e.lineTo(i+m,n):e.moveTo(i+m,n),v[1]?e.lineTo(i+m,n+y):e.moveTo(i+m,n+y),v[2]?e.lineTo(i,n+y):e.moveTo(i,n+y),v[3]){const t=v[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=Qc([m()],t.SplitRectAfterRenderContribution);const ed=new td,id=jc,nd=Dc;class rd{constructor(){i(this,"time",t.BaseRenderContributionTime.afterFillStroke),i(this,"useStyle",!0),i(this,"order",0)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=h.size,opacity:y=h.opacity,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:A=h.scaleY}=t.attribute,S=!(!p||!p.stroke),T=!(!f||!f.stroke);if(g){const{distance:r=h.outerBorder.distance}=p,s=Mc(e,r,e.dpr);if(e.beginPath(),!1===u.drawOffset(e,m,i,n,s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,p,h.outerBorder);else if(S){const r=h.outerBorder.opacity;h.outerBorder.opacity=y,e.setStrokeStyle(t,p,(b-i)/w,(x-n)/A,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(v){const{distance:r=h.innerBorder.distance}=f,s=Mc(e,r,e.dpr);if(e.beginPath(),!1===u.drawOffset(e,m,i,n,-s)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),d)d(e,f,h.innerBorder);else if(T){const r=h.innerBorder.opacity;h.innerBorder.opacity=y,e.setStrokeStyle(t,f,(b-i)/w,(x-n)/A,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}const sd=new rd,od=jc,ad=Dc;class hd extends Wc{constructor(){super(...arguments),i(this,"time",t.BaseRenderContributionTime.afterFillStroke)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{attribute:p=t.attribute}=u||{},{texture:f=t.attribute.texture??os(h,"texture"),textureColor:g=t.attribute.textureColor??os(h,"textureColor"),textureSize:v=t.attribute.textureSize??os(h,"textureSize"),texturePadding:m=t.attribute.texturePadding??os(h,"texturePadding")}=p;f&&this.drawTexture(f,t,e,i,n,h,g,v,m)}}var ld=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},cd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasArcRender=class extends _c{constructor(t){super(),i(this,"arcRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",No),this.arcRenderContribitions=t,this.builtinContributions=[Nc,Gc,Fc],this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let d=l.endAngle;d=a;const u=xt(d-c),p=d>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:v,innerDeltaAngle:m,outerStartAngle:y,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,d),A=g,S=g,T=g,B=g,C=Math.max(S,A),_=Math.max(T,B);let P=C,R=_;const M=r*At(y),k=r*Bt(y),E=s*At(x),O=s*Bt(x);let L,I,D,W;if((_>gt||C>gt)&&(L=r*At(b),I=r*Bt(b),D=s*At(w),W=s*Bt(w),u<vt)){const t=Ma(M,k,D,W,L,I,E,O);if(t){const e=M-t[0],i=k-t[1],n=L-t[0],o=I-t[1],a=1/Bt(Pt((e*n+i*o)/(Ct(e*e+i*i)*Ct(n*n+o*o)))/2),h=Ct(t[0]*t[0]+t[1]*t[1]);R=Tt(_,(s-h)/(a-1)),P=Tt(C,(r-h)/(a+1))}}if(P>gt){const t=Tt(A,P),s=Tt(S,P),o=ka(D,W,M,k,r,t,Number(p)),a=ka(L,I,E,O,r,s,Number(p));if(P<C&&t===s)e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,P,wt(o.y01,o.x01),wt(a.y01,a.x01),!p);else{const t=d-h-.03,o=wt(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,wt(a.y11,a.x11),wt(a.y01,a.x01),!p)}}else e.moveTo(i+M,n+k);if(!(s>gt)||m<.001)e.lineTo(i+E,n+O),f=!0;else if(R>gt){const t=Tt(B,R),r=Tt(T,R),o=ka(E,O,L,I,s,-r,Number(p)),a=ka(M,k,D,W,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),R<_&&t===r){const t=wt(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,R,wt(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,wt(o.y01,o.x01),wt(o.y11,o.x11),!p);const t=wt(o.cy+o.y11,o.cx+o.x11),a=d-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*At(w),n+s*Bt(w));return f}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).arc,{fill:l=h.fill,stroke:c=h.stroke,x:d=h.x,y:u=h.y}=t.attribute,p=this.valid(t,h,o,a);if(!p)return;const{fVisible:f,sVisible:g,doFill:v,doStroke:m}=p,{outerPadding:y=h.outerPadding,innerPadding:b=h.innerPadding,cap:x=h.cap,forceShowCap:w=h.forceShowCap}=t.attribute;let{outerRadius:A=h.outerRadius,innerRadius:S=h.innerRadius}=t.attribute;A+=y,S-=b;let T=0;const B=(K(x)&&x||x[0])&&"conical"===l.gradient;if(B){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();xt(n-i)<bt-gt&&(T=e||0,l.startAngle-=T,l.endAngle-=T)}let C=!1;const{isFullStroke:_,stroke:P}=Kr(c);if((v||_)&&(e.beginPath(),Ea(t,e,i,n,A,S),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,v,m,f,g,h,r,o,a),v&&(o?o(e,t.attribute,h):f&&(e.setCommonStyle(t,t.attribute,d-i,u-n,h),e.fill())),m&&_&&(a?a(e,t.attribute,h):g&&(e.setStrokeStyle(t,t.attribute,d-i,u-n,h),e.stroke()))),!_&&m&&(e.beginPath(),Ea(t,e,i,n,A,S,P),C||this.beforeRenderStep(t,e,i,n,v,m,f,g,h,r,o,a),a?a(e,t.attribute,h):g&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(K(x)&&x||x[1])&&w){const{startAngle:s,endAngle:l}=t.getParsedAngle();if(xt(l-s)>=bt-gt){e.beginPath();const s=Math.abs(A-S)/2/A,{endAngle:l=h.endAngle,fill:c=h.fill}=t.attribute,d=l;if(this.drawArcTailCapPath(t,e,i,n,A,S,d,d+s),C||this.beforeRenderStep(t,e,i,n,v,m,f,g,h,r,o,a),v){const r=c;if("conical"===r.gradient){const s=Da(0,0,l,r);o||Ba&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=s,e.fill())}}m&&(a||g&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))}}this.afterRenderStep(t,e,i,n,v,m,f,g,h,r,o,a),B&&(l.startAngle+=T,l.endAngle+=T)}draw(t,e,i,n){const r=mr(t,n?.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=ld([m(),dd(0,g(L)),dd(0,y(ja)),cd("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var ud=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},pd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fd=function(t,e){return function(i,n){e(i,n,t)}};function gd(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[n]=Ze(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,o)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,o)}}function vd(e,i,n,r,s){const{offsetX:o=0,offsetY:a=0,offsetZ:h=0,mode:l="none",drawConnect:c=!1,zeroX:d=0,zeroY:u=0}=s||{};if(c&&"none"===l)return;if(!i)return;let p=!0;const{curves:f}=i;if(n>=1){if(c){let t,i=!0;f.forEach(((n,r)=>{let s=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(s=t.p0),n.defined)i||(e.lineTo(s.x+o,s.y+a,h),i=!i);else{const{originP1:t,originP2:r}=n;let l;if(t&&!1!==t.defined?l=s:t&&!1!==r.defined&&(l=n.p3??n.p1),i){i=!i;const t=l?l.x:n.p0.x,r=l?l.y:n.p0.y;e.moveTo(t+o,r+a,h)}else l&&(i=!i,e.lineTo(l.x+o,l.y+a,h))}t=n}else t=n}))}else f.forEach((t=>{t.defined?(p&&e.moveTo(t.p0.x+o,t.p0.y+a,h),gd(e,t,1,s),p=!1):p=!0}));return}if(n<=0)return;let g;"x"===r?g=t.Direction.ROW:"y"===r?g=t.Direction.COLUMN:"auto"===r&&(g=i.direction);const v=n*i.tryUpdateLength(g);let m=0,y=!0,b=null;for(let t=0,i=f.length;t<i;t++){const i=f[t],n=i.getLength(g),r=(v-m)/n;if(m+=n,r<0)break;if(c){let t=i.p0;if(i.originP1===i.originP2){b=i;continue}if(b&&b.originP1===b.originP2&&(t=b.p0),i.defined)y||(e.lineTo(t.x+o,t.y+a,h),y=!y);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=i.p3??i.p1),y){y=!y;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+o,n+a,h)}else s&&(y=!y,e.lineTo(s.x+o,s.y+a,h))}b=i}else{if(!i.defined){p=!0;continue}p&&e.moveTo(i.p0.x+o,i.p0.y+a,h),gd(e,i,Tt(r,1),s),p=!1}}}function md(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+r,o.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function yd(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{const o=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(o.x+r,o.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(n.x1??n.x,n.y1??n.y)}t.lineTo(o.x1??o.x,o.y1??o.y),t.closePath()}))}t.DefaultCanvasCircleRender=class extends _c{constructor(t){super(),i(this,"circleRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",zo),this.circleRenderContribitions=t,this.builtinContributions=[Hc,Yc,Vc],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).circle,{radius:l=h.radius,startAngle:c=h.startAngle,endAngle:d=h.endAngle,x:u=h.x,y:p=h.y}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;e.beginPath(),e.arc(i,n,l,c,d),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,o,a),m&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,u-i,p-n,h),e.fill())),y&&(a?a(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,u-i,p-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,h,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=ud([m(),fd(0,g(L)),fd(0,y(Na)),pd("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var bd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};function xd(e,i,n,r){const{drawConnect:s=!1,mode:o="none"}=r||{};if(s&&"none"===o)return;const{top:a,bottom:h}=i;if(a.curves.length!==h.curves.length)return;if(n>=1){const t=[],i=[];let n=!0;if(s){let n,s,o=!0;const l=a.curves.length;a.curves.forEach(((a,c)=>{const d=h.curves[l-c-1];let u=a,p=d;if(a.originP1===a.originP2)return n=a,void(s=d);if(n&&n.originP1===n.originP2&&(u=n,p=s),a.defined)o||(t.push(u),i.push(p),wd(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=a;let h,l;n&&!1!==n.defined?(h=u,l=p):n&&!1!==s.defined&&(h=a,l=d),o?(o=!o,t.push(h||a),i.push(l||d)):h&&(o=!o,t.push(h||a),i.push(l||d),wd(e,t,i,r),t.length=0,i.length=0)}n=a})),wd(e,t,i,r)}else{for(let s=0,o=a.curves.length;s<o;s++){const l=a.curves[s];n!==l.defined?(n?(Ad(e,t,i,r),t.length=0,i.length=0):(t.push(l),i.push(h.curves[o-s-1])),n=!n):n&&(t.push(l),i.push(h.curves[o-s-1]))}Ad(e,t,i,r)}return}if(n<=0)return;let{direction:l}=r||{};const{curves:c}=a,d=c[c.length-1].p3??c[c.length-1].p1,u=xt(d.x-c[0].p0.x),p=xt(d.y-c[0].p0.y);l=l??(u>p?t.Direction.ROW:t.Direction.COLUMN),Number.isFinite(u)||(l=t.Direction.COLUMN),Number.isFinite(p)||(l=t.Direction.ROW);const f=n*(l===t.Direction.ROW?u:p);let g=0,v=!0;const m=[],y=[];let b,x,w=!0;for(let t=0,i=a.curves.length;t<i;t++){const n=a.curves[t],o=n.getLength(l),c=(f-g)/o;if(c<0)break;if(g+=o,s){const s=h.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){b=n,x=s;continue}if(b&&b.originP1===b.originP2&&(o=b,a=x),n.defined)w||(m.push(o),y.push(a),wd(e,m,y,r),m.length=0,y.length=0,w=!w);else{const{originP1:t,originP2:i}=n;let h,l;t&&!1!==t.defined?(h=o,l=a):t&&!1!==i.defined&&(h=n,l=s),w?(w=!w,m.push(h||n),y.push(l||s)):h&&(w=!w,m.push(h||n),y.push(l||s),wd(e,m,y,r),m.length=0,y.length=0)}b=n}else{let s=null,o=null;v!==n.defined?(v?(Ad(e,m,y,r),m.length=0,y.length=0):(s=n,o=h.curves[i-t-1]),v=!v):v&&(s=n,o=h.curves[i-t-1]),s&&o&&(c<1&&(s=s.p2&&s.p3?Ze(s,c)[0]:Qe(s,c)[0],o=o.p2&&o.p3?Ze(o,1-c)[1]:Qe(o,1-c)[1]),s.defined=v,o.defined=v,m.push(s),y.push(o)),s=null,o=null}}s?wd(e,m,y,r):Ad(e,m,y,r)}function wd(t,e,i,n){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=n||{};let h=e[0];t.moveTo(h.p0.x+r,h.p0.y+s,o),h=e[e.length-1];let l=h.p3||h.p1;t.lineTo(l.x+r,l.y+s,o),h=i[i.length-1],t.lineTo(h.p0.x+r,h.p0.y+s,o),h=i[0],l=h.p3||h.p1,t.lineTo(l.x+r,l.y+s,o),t.closePath()}function Ad(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),gd(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+r,h.p0.y+s,o),gd(t,h,1,n),a=!1):a=!0}t.closePath()}t.DefaultCanvasLineRender=class extends _c{constructor(){super(...arguments),i(this,"type",void 0),i(this,"numberType",Xo)}draw(t,e,i,n){const r=mr(t,n?.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f){if(!e)return;t.beginPath();const g=this.z??0;vd(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:d,offsetZ:g}),u.cache&&!nt(u.cache)&&u.cache.curves.every((t=>t.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,o,a);const{x:v=0,x:m=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(u,o,v-c,m-d,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(u,o,v-c,m-d,a),t.stroke()));let{connectedType:y,connectedX:b,connectedY:x,connectedStyle:w}=o;if(nt(a)?(y=y??a[0].connectedType??a[1].connectedType,b=b??a[0].connectedX??a[1].connectedX,x=x??a[0].connectedY??a[1].connectedY,w=w??a[0].connectedStyle??a[1].connectedStyle):(y=y??a.connectedType,b=b??a.connectedX,x=x??a.connectedY,w=w??a.connectedStyle),"connect"!==y&&"zero"!==y&&(y="none"),"none"!==y){t.beginPath(),vd(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:d,offsetZ:g,drawConnect:!0,mode:y,zeroX:b,zeroY:x});const A=[];nt(a)?a.forEach((t=>A.push(t))):A.push(a),A.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(u,w,v-c,m-d,A),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(u,w,v-c,m-d,A),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,n,r,s,o,a,h,l,c,d,u){e.beginPath();const p=this.z??0,{points:f}=t.attribute,g=f[0];e.moveTo(g.x+o,g.y+a,p);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+o,i.y+a,p)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const{x:v=0,x:m=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,v-o,m-a,h),e.fill())),!1!==n&&(u?u(e,t.attribute,h):s&&(e.setStrokeStyle(t,t.attribute,v-o,m-a,h),e.stroke()))}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:d=h.fillOpacity,strokeOpacity:u=h.strokeOpacity,segments:p,points:f,closePath:g}=t.attribute;if(!this.valid(t,h,o,a))return;let{curveType:v=h.curveType}=t.attribute;g&&"linear"===v&&(v="linearClosed");const{clipRange:m=h.clipRange,clipRangeByDimension:y=h.clipRangeByDimension}=t.attribute;if(1===m&&!p&&!f.some((t=>!1===t.defined))&&"linear"===v)return this.drawLinearLineHighPerformance(t,e,!!l,!!c,d,u,i,n,h,r,s,o,a);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const r=Pi(t.points,v,{startPoint:e});return n=r,r})).filter((t=>!!t)),"linearClosed"===v){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Pi(n,v)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===m){let s=!1;t.cache.forEach(((p,f)=>{s||(s=this.drawSegmentItem(e,p,!!l,!!c,d,u,r[f],[h,t.attribute],m,y,i,n,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=m*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),b=(p-f)/m;f+=m,b>0&&(g=this.drawSegmentItem(e,s,!!l,!!c,d,u,r[v],[h,t.attribute],Tt(b,1),y,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,u,t.attribute,h,m,y,i,n,t,o,a)}},t.DefaultCanvasLineRender=bd([m()],t.DefaultCanvasLineRender);const Sd=new hd,Td=Dc;var Bd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_d=function(t,e){return function(i,n){e(i,n,t)}};function Pd(t,e,i){switch(e){case"linear":default:return oi(t,i);case"basis":return di(t,i);case"monotoneX":return bi(t,i);case"monotoneY":return wi(t,i);case"step":return Si(t,.5,i);case"stepBefore":return Si(t,0,i);case"stepAfter":return Si(t,1,i);case"linearClosed":return Ci(t,i)}}t.DefaultCanvasAreaRender=class extends _c{constructor(t){super(),i(this,"areaRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",Go),this.areaRenderContribitions=t,this.builtinContributions=[Sd,Td],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,r,s,o,a,h,l,c,d,u){const{points:p}=t.attribute;if(p.length<2)return;e.beginPath();const f=this.z??0,g=p[0];e.moveTo(g.x+o,g.y+a,f);for(let t=1;t<p.length;t++){const i=p[t];e.lineTo(i.x+o,i.y+a,f)}for(let t=p.length-1;t>=0;t--){const i=p[t];e.lineTo((i.x1??i.x)+o,(i.y1??i.y)+a,f)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,o,a,!!r,!1,i,!1,h,l,d,null,{attribute:t.attribute});const{x:v=0,x:m=0}=t.attribute;if(!1!==i&&(d?d(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,v-o,m-a,h),e.fill())),this.afterRenderStep(t,e,o,a,!!r,!1,i,!1,h,l,d,null,{attribute:t.attribute}),n){const{stroke:i=h&&h.stroke}=t.attribute;if(nt(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(g.x+o,g.y+a,f);for(let t=1;t<p.length;t++){const i=p[t];e.lineTo(i.x+o,i.y+a,f)}}else if(i[2]){const t=p[p.length-1];e.moveTo(t.x+o,t.y+a,f);for(let t=p.length-2;t>=0;t--){const i=p[t];e.lineTo((i.x1??i.x)+o,(i.y1??i.y)+a,f)}}u?u(e,t.attribute,h):(e.setStrokeStyle(t,t.attribute,v-o,m-a,h),e.stroke())}}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).area,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:d=h.fillOpacity,z:u=h.z,strokeOpacity:p=h.strokeOpacity}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{doFill:g,doStroke:v}=f,{clipRange:m=h.clipRange,closePath:y,points:b,segments:x}=t.attribute;let{curveType:w=h.curveType}=t.attribute;if(y&&"linear"===w&&(w="linearClosed"),1===m&&!x&&!b.some((t=>!1===t.defined))&&"linear"===w)return this.drawLinearAreaHighPerformance(t,e,!!l,v,d,p,i,n,h,r,s,o,a);if(t.shouldUpdateShape()){if(x&&x.length){let e,i;const n=x.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const r=Pd(t.points,w,{startPoint:e});return i=r,r})).filter((t=>!!t));let r;const s=[];for(let t=x.length-1;t>=0;t--){const e=x[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:e[t].x1??e[t].x,y:e[t].y1??e[t].y});if(0!==t){const e=x[t-1].points,n=e[e.length-1];n&&i.push({x:n.x1??n.x,y:n.y1??n.y})}i.length>1&&(r=Pd(i,"stepBefore"===w?"stepAfter":"stepAfter"===w?"stepBefore":w),s.unshift(r))}t.cacheArea=s.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!b||!b.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=b,i=[];for(let t=b.length-1;t>=0;t--)i.push({x:b[t].x1??b[t].x,y:b[t].y1??b[t].y});const n=Pd(e,w),r=Pd(i,"stepBefore"===w?"stepAfter":"stepAfter"===w?"stepBefore":w);t.cacheArea={top:n,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===m){let l=!1;t.cacheArea.forEach(((c,f)=>{l||(l=this.drawSegmentItem(e,c,g,d,v,p,s[f],[h,t.attribute],m,i,n,u,t,r,o,a))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),c=m*l;let f=0,y=!1;t.cacheArea.forEach(((l,m)=>{if(y)return;const b=l.top.getLength(),x=(c-f)/b;f+=b,x>0&&(y=this.drawSegmentItem(e,l,g,d,v,p,s[m],[h,t.attribute],Tt(x,1),i,n,u,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,g,d,v,p,t.attribute,h,m,i,n,u,t,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,d,u,p,f,g,v,m){if(!(i&&i.top&&i.bottom&&i.top.curves&&i.top.curves.length&&i.bottom.curves&&i.bottom.curves.length))return;let{connectedType:y,connectedX:b,connectedY:x,connectedStyle:w}=a;const A=[];if(g&&(nt(h)?(y=y??h[0].connectedType??h[1].connectedType,b=b??h[0].connectedX??h[1].connectedX,x=x??h[0].connectedY??h[1].connectedY,w=w??h[0].connectedStyle??h[1].connectedStyle):(y=y??h.connectedType,b=b??h.connectedX,x=x??h.connectedY,w=w??h.connectedStyle),"connect"!==y&&"zero"!==y&&(y="none"),nt(h)?h.forEach((t=>A.push(t))):A.push(h),A.push(a)),g&&"none"===y)return!1;e.beginPath();const{points:S,segments:T}=p.attribute;let B,C,_=t.Direction.ROW;if(T){const t=T[T.length-1];C=T[0].points[0],B=t.points[t.points.length-1]}else C=S[0],B=S[S.length-1];const P=xt(B.x-C.x),R=xt(B.y-C.y);_=Number.isFinite(P+R)?P>R?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,xd(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:d,offsetZ:u,direction:_,drawConnect:g,mode:y,zeroX:b,zeroY:x}),this.beforeRenderStep(p,e,c,d,!!r,!1,n,!1,h,f,v,null,{attribute:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(p,a,h);const{x:M=0,x:k=0}=a;if(!1!==n&&(v?v(e,a,h):r&&(e.setCommonStyle(p,g?w:a,M-c,k-d,g?A:h),e.fill())),this.afterRenderStep(p,e,c,d,!!r,!1,n,!1,h,f,v,null,{attribute:a}),!1!==s)if(m)m(e,a,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=a;nt(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),vd(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,_===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:d,offsetZ:u,drawConnect:g,mode:y,zeroX:b,zeroY:x})),e.setStrokeStyle(p,g?w:a,M-c,k-d,g?A:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=Bd([m(),_d(0,g(L)),_d(0,y(Ua)),Cd("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);const Rd=jc,Md=Dc;var kd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ed=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Od=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPathRender=class extends _c{constructor(t){super(),i(this,"pathRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",$o),i(this,"tempTheme",void 0),this.pathRenderContribitions=t,this.builtinContributions=[Md,Rd],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=this.tempTheme??mr(t,s?.theme).path,{x:l=h.x,y:c=h.y}=t.attribute,d=this.z??0,u=this.valid(t,h,o,a);if(!u)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=u;if(e.beginPath(),t.pathShape)Ve(t.pathShape.commandList,e,i,n,1,1,d);else{Ve((t.attribute.path??h.path).commandList,e,i,n,1,1,d)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,g,v,p,f,h,r,o,a),v&&(a?a(e,t.attribute,h):f&&(e.setStrokeStyle(t,t.attribute,l-i,c-n,h),e.stroke())),g&&(o?o(e,t.attribute,h):p&&(e.setCommonStyle(t,t.attribute,l-i,c-n,h),e.fill())),this.afterRenderStep(t,e,i,n,g,v,p,f,h,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasPathRender=kd([m(),Od(0,g(L)),Od(0,y(za)),Ed("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var Ld=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Id=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasRectRender=class extends _c{constructor(t){super(),i(this,"rectRenderContribitions",void 0),i(this,"type","rect"),i(this,"numberType",Zo),i(this,"tempTheme",void 0),this.rectRenderContribitions=t,this.builtinContributions=[ed,nd,id],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=this.tempTheme??mr(t,s?.theme).rect,{fill:l=h.fill,background:c,stroke:d=h.stroke,cornerRadius:u=h.cornerRadius,opacity:p=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:m=h.visible,x1:y,y1:b,x:x=h.x,y:w=h.y}=t.attribute;let{width:A,height:S}=t.attribute;A=(A??y-x)||0,S=(S??b-w)||0;const T=Ca(p,f,A,S,l),B=Pa(p,v,A,S),C=Sa(l,c),_=Ta(d,g);if(!t.valid||!m)return;if(!C&&!_)return;if(!(T||B||o||a||c))return;0===u||nt(u)&&u.every((t=>0===t))?(e.beginPath(),e.rect(i,n,A,S)):(e.beginPath(),qc(e,i,n,A,S,u));const P={doFill:C,doStroke:_};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,C,_,T,B,h,r,o,a,P),P.doFill&&(o?o(e,t.attribute,h):T&&(e.setCommonStyle(t,t.attribute,x-i,w-n,h),e.fill())),P.doStroke&&(a?a(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,x-i,w-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,C,_,T,B,h,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasRectRender=Ld([m(),Dd(0,g(L)),Dd(0,y(Va)),Id("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var Wd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},jd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ud=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasSymbolRender=class extends _c{constructor(t){super(),i(this,"symbolRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",ta),this.symbolRenderContribitions=t,this.builtinContributions=[sd,ad,od],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).symbol,{size:l=h.size,x:c=h.x,y:d=h.y,scaleX:u=h.scaleX,scaleY:p=h.scaleY}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f,b=t.getParsedPath();if(!b)return;const{keepDirIn3d:x=h.keepDirIn3d}=t.attribute,w=this.z??0;if(e.beginPath(),x&&e.camera&&e.project){const r=e.project(i,n,w),s=e.camera;e.camera=null,!1===b.draw(e,nt(l)?[l[0]*u,l[1]*p]:l*u,r.x,r.y,void 0,((r,s)=>{if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=s.fill??t.attribute.fill,e.opacity=s.fill??t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=s.stroke??t.attribute.stroke,s=e}s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,c-i,d-n,h),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(c-i)/u,(d-n)/p,h),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===b.draw(e,l,i,n,w,((r,s)=>{if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=s.fill??t.attribute.fill,e.opacity=s.opacity??t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=s.stroke??t.attribute.stroke,s=e}s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,c-i,d-n,h),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(c-i)/u,(d-n)/p,h),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,o,a),m&&!b.isSvg&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,c-i,d-n,h),e.fill())),y&&!b.isSvg&&(a?a(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,(c-i)/u,(d-n)/p,h),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,h,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=Wd([m(),Ud(0,g(L)),Ud(0,y(Ya)),jd("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);const Nd=new class{constructor(){i(this,"pools",[]);for(let t=0;t<10;t++)this.pools.push(new Wt)}allocate(t,e,i,n){if(!this.pools.length)return(new Wt).setValue(t,e,i,n);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}allocateByObj(t){if(!this.pools.length)return new Wt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Fd=new class extends Ic{constructor(){super(...arguments),i(this,"time",t.BaseRenderContributionTime.beforeFillStroke)}drawShape(t,e,i,n,r,s,o,a,h,l,c,d){const{backgroundMode:u=h.backgroundMode,backgroundFit:p=h.backgroundFit}=t.attribute;let f,{background:g}=t.attribute;if(!g)return;const v=()=>{"richtext"===t.type&&(e.restore(),e.save(),f&&e.setTransformFromMatrix(f,!0,1))};let m;"richtext"===t.type&&(f=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const y=Q(g)&&g.background,b=t.transMatrix.onlyTranslate();if(y){const e=t.AABBBounds,i=(g.x??e.x1)+(g.dx??0),n=(g.y??e.y1)+(g.dy??0),r=g.width??e.width(),s=g.height??e.height();if(m=Nd.allocate(i,n,i+r,n+s),g=g.background,!b){const t=m.width(),e=m.height();m.set((g.x??0)+(g.dx??0),(g.y??0)+(g.dy??0),t,e)}}else m=t.AABBBounds,b||(m=Bc({...t.attribute,angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0}).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(g);if("success"!==r.state||!r.data)return void v();e.highPerformanceSave(),b&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,h),this.doDrawImage(e,r.data,m,u,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=g,r?(qc(e,m.x1,m.y1,m.width(),m.height(),r),e.fill()):e.fillRect(m.x1,m.y1,m.width(),m.height()),e.highPerformanceRestore()}y&&Nd.free(m),v()}};var Gd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasTextRender=class extends _c{constructor(t){super(),i(this,"textRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",ea),this.textRenderContribitions=t,this.builtinContributions=[Fd],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).text,{text:l,underline:c=h.underline,lineThrough:d=h.lineThrough,keepDirIn3d:u=h.keepDirIn3d,direction:p=h.direction,whiteSpace:f=h.whiteSpace,fontSize:g=h.fontSize,verticalMode:v=h.verticalMode,x:m=h.x,y:y=h.y}=t.attribute;let{textAlign:b=h.textAlign,textBaseline:x=h.textBaseline}=t.attribute;if(!v&&"vertical"===p){const e=b;b=t.getBaselineMapAlign()[x]??"left",x=t.getAlignMapBaseline()[e]??"top"}const w=ls(t.attribute.lineHeight,g)??g,A=this.valid(t,h,o,a);if(!A)return;const{fVisible:S,sVisible:T,doFill:B,doStroke:C}=A,_=!u,P=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,B,C,S,T,h,r,o,a),_&&this.transformUseContext2d(t,h,P,e);const R=(r,s,l,u)=>{let p=i+s;const f=n+l;if(u){e.highPerformanceSave(),p+=g;const t=cc.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,p,f),e.transformFromMatrix(t,!0),cc.free(t)}C&&(a?a(e,t.attribute,h):T&&(e.setStrokeStyle(t,t.attribute,m-i,y-n,h),e.strokeText(r,p,f,P))),B&&(o?o(e,t.attribute,h):S&&(e.setCommonStyle(t,t.attribute,m-i,y-n,h),e.fillText(r,p,f,P),this.drawUnderLine(c,d,t,p,f,P,h,e))),u&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,h,P),"horizontal"===p){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;C&&(a?a(e,t.attribute,h):T&&(e.setStrokeStyle(t,t.attribute,m-i,y-n,h),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+l+n,P)})))),B&&(o?o(e,t.attribute,h):S&&(e.setCommonStyle(t,t.attribute,m-i,y-n,h),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+l+n,P),this.drawMultiUnderLine(c,d,t,(r.leftOffset||0)+s+i,(r.topOffset||0)+l+n-th("bottom",g)-.05*g,P,r.width,h,e)}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:n}=i;e.textAlign="left",e.textBaseline="top";const r=w*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=St(e,s)}));let o=0,a=0;"bottom"===x?a=-r:"middle"===x&&(a=-r/2),"center"===b?o-=s/2:"right"===b&&(o-=s),n.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),n=s-i;let h=o;"center"===b?h+=n/2:"right"===b&&(h+=n),t.forEach((t=>{const{text:i,width:n,direction:s}=t;R(i,r-(e+1)*w+a,h,s),h+=n}))}))}else if("horizontal"===p){e.setTextStyle(t.attribute,h,P);const i=t.clipedText;let n=0;w!==g&&("top"===x?n=(w-g)/2:"middle"===x||"bottom"===x&&(n=-(w-g)/2)),R(i,0,n,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,h,P);const{verticalList:n}=i;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===x?o=-w:"middle"===x&&(o=-w/2),"center"===b?r-=s/2:"right"===b&&(r-=s),e.textAlign="left",e.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;R(e,o,r,n),r+=i}))}}_&&this.restoreTransformUseContext2d(t,h,P,e),this.afterRenderStep(t,e,i,n,B,C,S,T,h,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,o=!s;this._draw(t,r,o,i,n)}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:d=o.fill,opacity:u=o.opacity,underlineOffset:p=o.underlineOffset,underlineDash:f=o.underlineDash,fillOpacity:g=o.fillOpacity}=i.attribute,v=i.clipedWidth,m=eh(h,v),y=ih(l,c,c),b={lineWidth:0,stroke:d,opacity:u,strokeOpacity:g};if(t){b.lineWidth=t,a.setStrokeStyle(i,b,n,r,o),f&&a.setLineDash(f),a.beginPath();const e=r+y+c+p;a.moveTo(n+m,e,s),a.lineTo(n+m+v,e,s),a.stroke()}if(e){b.lineWidth=e,a.setStrokeStyle(i,b,n,r,o),a.beginPath();const t=r+y+c/2;a.moveTo(n+m,t,s),a.lineTo(n+m+v,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{fontSize:l=a.fontSize,fill:c=a.fill,opacity:d=a.opacity,underlineOffset:u=a.underlineOffset,underlineDash:p=a.underlineDash,fillOpacity:f=a.fillOpacity}=i.attribute,g=ih("alphabetic",l,l),v={lineWidth:0,stroke:c,opacity:d,strokeOpacity:f};let m=-3;if(t){v.lineWidth=t,h.setStrokeStyle(i,v,n,r,a),p&&h.setLineDash(p),h.beginPath();const e=r+g+l+m+u;h.moveTo(n+0,e,s),h.lineTo(n+0+o,e,s),h.stroke()}if(m=-1,e){v.lineWidth=e,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const t=r+g+l/2+m;h.moveTo(n+0,t,s),h.lineTo(n+0+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=Gd([m(),Hd(0,g(L)),Hd(0,y(Xa)),zd("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var Vd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};function Yd(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function Xd(t,e){return Math.sqrt(t*t+e*e)}function $d(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.AbstractGraphicRender=class{constructor(){i(this,"type",void 0),i(this,"numberType",void 0)}},t.AbstractGraphicRender=Vd([m()],t.AbstractGraphicRender);const Kd=jc,qd=Dc;var Zd=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Jd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qd=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPolygonRender=class extends _c{constructor(t){super(),i(this,"polygonRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",Ko),this.polygonRenderContribitions=t,this.builtinContributions=[qd,Kd],this.init(t)}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).polygon,{points:l=h.points,cornerRadius:c=h.cornerRadius,x:d=h.x,y:u=h.y,closePath:p=h.closePath}=t.attribute,f=this.valid(t,h,o,a);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;e.beginPath(),c<=0||nt(c)&&c.every((t=>0===t))?Yd(e.camera?e:e.nativeContext,l,i,n):function(t,e,i,n,r){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)return void Yd(t,e,i,n);let o=0,a=e.length-1;s||(o+=1,a-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=o;s<=a;s++){const o=e[0===s?a:(s-1)%e.length],h=e[s%e.length],l=e[(s+1)%e.length],c=h.x-o.x,d=h.y-o.y,u=h.x-l.x,p=h.y-l.y,f=(Math.atan2(d,c)-Math.atan2(p,u))/2,g=Math.abs(Math.tan(f));let v=Array.isArray(r)?r[s%e.length]??0:r,m=v/g;const y=Xd(c,d),b=Xd(u,p),x=Math.min(y,b);m>x&&(m=x,v=x*g);const w=$d(h,m,y,c,d),A=$d(h,m,b,u,p),S=2*h.x-w.x-A.x,T=2*h.y-w.y-A.y,B=Xd(S,T),C=$d(h,Xd(m,v),B,S,T);let _=Math.atan2(w.y-C.y,w.x-C.x);const P=Math.atan2(A.y-C.y,A.x-C.x);let R=P-_;R<0&&(_=P,R=-R),R>Math.PI&&(R-=Math.PI),0===s?t.moveTo(w.x+i,w.y+n):t.lineTo(w.x+i,w.y+n),R&&t.arcTo(h.x+i,h.y+n,A.x+i,A.y+n,v),t.lineTo(A.x+i,A.y+n)}s||t.lineTo(e[a+1].x+i,e[a+1].y+n)}(e.camera?e:e.nativeContext,l,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,o,a),m&&(o?o(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,d-i,u-n,h),e.fill())),y&&(a?a(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,d-i,u-n,h),e.stroke())),this.afterRenderStep(t,e,i,n,m,y,g,v,h,r,o,a)}draw(t,e,i,n){const r=mr(t,n?.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=Zd([m(),Qd(0,g(L)),Qd(0,y(Ha)),Jd("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var tu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},eu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iu=function(t,e){return function(i,n){e(i,n,t)}};const nu=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends _c{constructor(t){super(),i(this,"imageRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",Yo),this.imageRenderContribitions=t,this.builtinContributions=[Jc],this.init(t)}drawShape(t,e,i,n,r,s,o){const a=mr(t).image,{width:h=a.width,height:l=a.height,repeatX:c=a.repeatX,repeatY:d=a.repeatY,cornerRadius:u=a.cornerRadius,image:p}=t.attribute,f=this.valid(t,a,o);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,a),this.beforeRenderStep(t,e,i,n,m,!1,g,!1,a,r,o),m)if(o)o(e,t.attribute,a);else if(g){if(!p||!t.resources)return;const r=t.resources.get(p);if("success"!==r.state)return;let s=!1;0===u||nt(u)&&u.every((t=>0===t))||(e.beginPath(),qc(e,i,n,h,l,u),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,i,n,a);let o=0;if("repeat"===c&&(o|=1),"repeat"===d&&(o|=2),o){const t=e.createPattern(r.data,nu[o]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,h,l),e.translate(-i,-n,!0)}else e.drawImage(r.data,i,n,h,l);s&&e.restore()}this.afterRenderStep(t,e,i,n,m,!1,g,!1,a,r,o)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const r=t.resources.get(n);if("loading"===r.state&&it(n))return void ao.improveImageLoading(n);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const o=mr(t).image;this._draw(t,o,!1,i)}},t.DefaultCanvasImageRender=tu([m(),iu(0,g(L)),iu(0,y(Ga)),eu("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const ru=Symbol.for("IncrementalDrawContribution"),su=Symbol.for("ArcRender"),ou=Symbol.for("Arc3dRender"),au=Symbol.for("AreaRender"),hu=Symbol.for("CircleRender"),lu=Symbol.for("GraphicRender"),cu=Symbol.for("GroupRender"),du=Symbol.for("LineRender"),uu=Symbol.for("PathRender"),pu=Symbol.for("PolygonRender"),fu=Symbol.for("RectRender"),gu=Symbol.for("Rect3DRender"),vu=Symbol.for("SymbolRender"),mu=Symbol.for("TextRender"),yu=Symbol.for("RichTextRender"),bu=Symbol.for("Pyramid3dRender"),xu=Symbol.for("GlyphRender"),wu=Symbol.for("ImageRender"),Au=Symbol.for("RenderSelector"),Su=Symbol.for("DrawContribution");var Tu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Cu=Symbol.for("DrawItemInterceptor"),_u=new Wt;class Pu{constructor(){i(this,"order",1)}afterDrawItem(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){_u.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(_u),!0}}class Ru{constructor(){i(this,"order",1)}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(o.x1,o.y1,o.width(),o.height()),s.highPerformanceRestore(),!0}}t.CommonDrawItemInterceptorContribution=class{constructor(){i(this,"order",1),i(this,"interceptors",void 0),this.interceptors=[new Pu,new ku,new Mu,new Ru]}afterDrawItem(t,e,i,n,r){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,n,r))return!0;return!1}beforeDrawItem(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,n,r))return!0;return!1}},t.CommonDrawItemInterceptorContribution=Tu([m(),Bu("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);class Mu{constructor(){i(this,"order",1),i(this,"processing",void 0)}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const s=t.baseGraphic;if(!s.stage){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(s){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?n.renderGroup(s,i,s.parent.globalTransMatrix):n.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){let e=t.getElementById("_interactive_group");return e||(e=Ac.CreateGraphic("group",{}),e.id="_interactive_group",t.add(e)),e.shadowRoot??e.attachShadow()}}class ku{constructor(){i(this,"order",1)}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=dc.allocate();yc(h,a);const l=s.modelMatrix;if(l){if(h){const t=dc.allocate();s.modelMatrix=bc(t,l,h)}}else s.modelMatrix=h;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===Fo,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{let i=((t.attribute.startAngle??0)+(t.attribute.endAngle??0))/2,n=((e.attribute.startAngle??0)+(e.attribute.endAngle??0))/2;for(;i<0;)i+=bt;for(;n<0;)n+=bt;return n-i})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)}));const s=t.parent.globalTransMatrix;i.hack_pieFace="outside",n.renderGroup(t,i,s),i.hack_pieFace="inside",n.renderGroup(t,i,s),i.hack_pieFace="top",n.renderGroup(t,i,s),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>s.view(e[0],e[1],e[2]+t.attribute.z??0)[2])).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,t.parent.globalTransMatrix,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i,t.parent.globalTransMatrix)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==l&&dc.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Eu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ou=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lu=function(t,e){return function(i,n){e(i,n,t)}};const Iu=Symbol.for("RenderService"),Du=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){i(this,"drawContribution",void 0),i(this,"dirtyBounds",void 0),i(this,"renderTreeRoots",void 0),i(this,"renderLists",void 0),i(this,"drawParams",void 0),this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,{...this.drawParams})}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,{...this.drawParams})}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}},t.DefaultRenderService=Eu([m(),Lu(0,g(Su)),Ou("design:paramtypes",[Object])],t.DefaultRenderService);var Wu=new r((e=>{e(Iu).to(t.DefaultRenderService)}));const ju=Symbol.for("GraphicPicker"),Uu=Symbol.for("PickerService"),Nu=Symbol.for("BoundsPicker"),Fu=Symbol.for("GlobalPickerService");var Gu=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};const zu=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=class{constructor(){i(this,"order",1)}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){if(!t.shadowRoot)return null;const{parentMatrix:s}=r||{};if(!s)return null;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,h=cc.allocateByObj(s),l=new Ot(h.a*i.x+h.c*i.y+h.e,h.b*i.x+h.d*i.y+h.f),c=e.pickGroup(a,l,h,n);return o.highPerformanceRestore(),c}},t.ShadowRootPickItemInterceptorContribution=Gu([m()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=class{constructor(){i(this,"order",1)}beforePickItem(t,e,i,n,r){const s=t.baseGraphic;if(s&&s.parent){const t=new Ot(i.x,i.y),r=e.pickContext;r.highPerformanceSave();const o=s.parent.globalTransMatrix;o.transformPoint(t,t);const a=s.isContainer?e.pickGroup(s,t.clone(),o,n):e.pickItem(s,t.clone(),o,n);return r.highPerformanceRestore(),a}return null}},t.InteractivePickItemInterceptorContribution=Gu([m()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=class{constructor(){i(this,"order",1)}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,h=!1;if(t.forEachChildren((t=>(a=t.numberType===Fo,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{let i=(t.attribute.startAngle??0+t.attribute.endAngle??0)/2,n=(e.attribute.startAngle??0+e.attribute.endAngle??0)/2;for(;i<0;)i+=bt;for(;n<0;)n+=bt;return n-i})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(h){const a=t.getChildren(),h=a.map((t=>({ave_z:t.findFace().vertices.map((e=>s.view(e[0],e[1],e[2]+t.attribute.z??0)[2])).reduce(((t,e)=>t+e),0),g:t})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,n.in3dInterceptor=!1,s.restore(),o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=Gu([m()],t.Canvas3DPickItemInterceptor);var Hu=new r(((e,i,n)=>{n(Uu)||(e(Fu).toSelf(),e(Uu).toService(Fu)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(zu).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(zu).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(zu).toService(t.InteractivePickItemInterceptorContribution),D(e,zu)})),Vu=new r((e=>{e(ia).to(t.DefaultGraphicService).inSingletonScope(),e(na).toConstantValue(Ac)}));const Yu=Symbol.for("AutoEnablePlugins"),Xu=Symbol.for("PluginService");var $u=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ku=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qu=function(t,e){return function(i,n){e(i,n,t)}};let Zu=class{constructor(t){i(this,"autoEnablePlugins",void 0),this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&xn.isBound(Yu)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};Zu=$u([m(),qu(0,g(L)),qu(0,y(Yu)),Ku("design:paramtypes",[Object])],Zu);var Ju=new r((t=>{t(Xu).to(Zu),W(t,Yu)})),Qu=new r((t=>{D(t,N)})),tp=new r((e=>{e(bn).to(t.DefaultTextMeasureContribution).inSingletonScope(),D(e,bn)})),ep=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ip=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let np=class{constructor(){i(this,"layer",void 0),i(this,"canvas",void 0),i(this,"context",void 0),i(this,"offscreen",void 0),i(this,"main",void 0),i(this,"window",void 0),i(this,"type","static"),i(this,"global",void 0),i(this,"secondaryHandlers",void 0),this.offscreen=!1,this.global=on.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Sn({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,{context:this.context,clear:e.background??"#ffffff",...e,...i})}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){const n=t.getContext();i.renderService.render(e,{context:n,...i,clear:i.clear?i.background??"#fff":void 0})}getContext(){return this.context}release(){this.canvas.release()}};np=ep([m(),ip("design:paramtypes",[])],np);var rp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let op=class{constructor(){this.offscreen=!1,this.type="virtual",this.global=on.global}setDpr(t){}init(t,e,i){if(this.layer=t,this.window=e,i.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}resize(t,e){}resizeView(t,e){}render(t,e,i){this.mainHandler.render(t,e,{...i,clear:!1})}merge(t){}prepare(t,e){}drawTo(t,e,i){const n=t.getContext();i.renderService.render(e,{context:n,...i,clear:i.clear?i.background??"#fff":void 0})}getContext(){return null}release(){}};op=rp([m(),sp("design:paramtypes",[])],op);var ap=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let lp=class{constructor(){this.offscreen=!0,this.type="dynamic",this.global=on.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){this.layer=t;const n=Sn({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){e.renderService.render(t,{context:this.context,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform(),...e,clear:e.background??"#ffffff"})}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{viewBox:s}=i,o=s.x1,a=s.y1,h=s.width(),l=s.height();n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(o,a,h,l),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,o,a,h,l),n.nativeContext.restore()}merge(t){}};lp=ap([m(),hp("design:paramtypes",[])],lp);var cp=new r((t=>{t(np).toSelf(),t(lp).toSelf(),t(op).toSelf(),t(ga).toService(np),t(va).toService(lp),t(ma).toService(op)}));function dp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],h=s[e];r&&h.sort(((t,e)=>(n?-1:1)*((e.attribute.z??0)-(t.attribute.z??0))));for(let t=0;t<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}async function up(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];await t.forEachChildrenAsync(i,n)}function pp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return o=!0,!0;return!1}),n);let a=null,h=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}var fp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vp=function(t,e){return function(i,n){e(i,n,t)}};let mp=class{constructor(t,e){i(this,"contributions",void 0),i(this,"drawItemInterceptorContributions",void 0),this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Dt,this.backupDirtyBounds=new Dt,this.global=on.global,this.layerService=on.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,viewBox:r,transMatrix:s}=e;if(!i)return;const o=this.dirtyBounds.setValue(0,0,r.width(),r.height());if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(a=o,h=n.dirtyBounds,l=!1,null===a?h:null===h?a:(te=a.x1,ee=a.x2,ie=a.y1,ne=a.y2,re=h.x1,se=h.x2,oe=h.y1,ae=h.y2,l&&(te>ee&&([te,ee]=[ee,te]),ie>ne&&([ie,ne]=[ne,ie]),re>se&&([re,se]=[se,re]),oe>ae&&([oe,ae]=[ae,oe])),te>=se||ee<=re||ie>=ae||ne<=oe?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(te,re),y1:Math.max(ie,oe),x2:Math.min(ee,se),y2:Math.min(ne,ae)}));o.x1=Math.floor(t.x1),o.y1=Math.floor(t.y1),o.x2=Math.ceil(t.x2),o.y2=Math.ceil(t.y2)}var a,h,l;const c=i.dpr%1;(c||.5!==c)&&(o.x1=Math.floor(o.x1*i.dpr)/i.dpr,o.y1=Math.floor(o.y1*i.dpr)/i.dpr,o.x2=Math.ceil(o.x2*i.dpr)/i.dpr,o.y2=Math.ceil(o.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(o),i.inuse=!0,i.setClearMatrix(s.a,s.b,s.c,s.d,s.e,s.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(r.x1,r.y1,!0),i.beginPath(),i.rect(o.x1,o.y1,o.width(),o.height()),i.clip(),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Gi.zIndex)-(e.attribute.zIndex??Gi.zIndex))).forEach((t=>{t.isContainer?this.renderGroup(t,e,cc.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=pp(e,i,Gi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!ce(t.AABBBounds,this.dirtyBounds,!1))return;let r,s=i;if(this.useDirtyBounds){r=Nd.allocateByObj(this.dirtyBounds);const e=t.transMatrix;s=cc.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(s.getInverse())}this.renderItem(t,e,{drawingCb:()=>{n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))})):dp(t,Gi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))}),!1,!!e.context?.camera)}}),this.useDirtyBounds&&(this.dirtyBounds.copy(r),Nd.free(r),cc.free(s))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||xn.get(ru);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,{...e,drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1}),s.drawContribution=a;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,{...e,drawContribution:a,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1})}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let r,s=!1;if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(s=!(!e&&!i),s){r=this.dirtyBounds.clone();const n=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(n),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!ce(t.AABBBounds,this.dirtyBounds,!1))return void(s&&this.dirtyBounds.copy(r));const o=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=o),o?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),s&&this.dirtyBounds.copy(r),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return ve.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const n=this.styleRenderMap.get(e.attribute.renderStyle);i=n&&n.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n,viewBox:r}=i,s=r.width(),o=r.height();if(n){e.clearRect(0,0,s,o);const i=t.drawParams?.stage;if(i&&(e.globalAlpha=i.attribute.opacity??1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(n);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,s,o)}else e.fillStyle=kc(e,n,{AABBBounds:{x1:0,y1:0,x2:0+s,y2:0+o}},0,0),e.fillRect(0,0,s,o)}}afterDraw(t,e){}};mp=fp([m(),vp(0,v(lu)),vp(1,g(L)),vp(1,y(Cu)),gp("design:paramtypes",[Array,Object])],mp);var yp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xp=function(t,e){return function(i,n){e(i,n,t)}};let wp=class{constructor(t){i(this,"groupRenderContribitions",void 0),i(this,"type",void 0),i(this,"numberType",Vo),i(this,"_groupRenderContribitions",void 0),this.groupRenderContribitions=t}drawShape(e,i,n,r,s,o,a,h){const l=mr(e,o?.theme).group,{fill:c=l.fill,background:d,stroke:u=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:m=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:A=l.visible}=e.attribute,S=Ca(p,m,f,g,c),T=Pa(p,y,f,g),B=Sa(c,d),C=Ta(u,w);if(!e.valid||!A)return;if(!v){if(!B&&!C)return;if(!(S||T||a||h||d))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||nt(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),qc(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push($c));const _={doFill:B,doStroke:C};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,S,T,l,s,a,h,_)})),v&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):S&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())),this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,S,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s,baseOpacity:o=1}=t.attribute;s?r.save():r.highPerformanceSave(),r.baseGlobalAlpha*=o;const a=mr(t,n?.theme).group,h=r.modelMatrix;if(r.camera){const e=dc.allocate(),i=dc.allocate();xc(i,t,a),bc(e,h||e,i),r.modelMatrix=e,dc.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:l=a.scrollX,scrollY:c=a.scrollY}=t.attribute;let d;(l||c)&&r.translate(l,c),n&&n.drawingCb&&(d=n.drawingCb()),r.modelMatrix!==h&&dc.free(r.modelMatrix),r.modelMatrix=h,r.baseGlobalAlpha/=o,d&&d.then?d.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};wp=yp([m(),xp(0,g(L)),xp(0,y(Fa)),bp("design:paramtypes",[Object])],wp);var Ap=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Sp=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),i(this,"numberType",Xo)}drawShape(t,e,i,n,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=mr(t).line,{fill:c=l.fill,stroke:d=l.stroke,opacity:u=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,m=Ba(u,p,c),y=_a(u,f),b=Sa(c),x=Ta(d,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||o||a))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o,a)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),md(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};Sp=Ap([m()],Sp);var Tp=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Bp=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),i(this,"numberType",Go)}drawShape(t,e,i,n,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=mr(t).area,{fill:c=l.fill,fillOpacity:d=l.fillOpacity,opacity:u=l.opacity,visible:p=l.visible}=t.attribute,f=Ba(u,d,c),g=Sa(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,o)}drawIncreaseSegment(t,e,i,n,r,s,o,a){n&&(e.beginPath(),yd(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};Bp=Tp([m()],Bp);var Cp,_p=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Pp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rp=function(t,e){return function(i,n){e(i,n,t)}};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Cp||(Cp={}));let Mp=class extends mp{constructor(t,e,n,r){super(t,r),i(this,"contributions",void 0),i(this,"lineRender",void 0),i(this,"areaRender",void 0),i(this,"drawItemInterceptorContributions",void 0),i(this,"rendering",!1),i(this,"currFrameStartAt",0),i(this,"currentIdx",0),i(this,"status",Cp.NORMAL),i(this,"checkingForDrawPromise",null),i(this,"hooks",{completeDraw:new U([])}),i(this,"lastRenderService",void 0),i(this,"lastDrawContext",void 0),i(this,"count",void 0),this.contributions=t,this.lineRender=e,this.areaRender=n,this.drawItemInterceptorContributions=r,this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}async draw(t,e){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=await this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,viewBox:r}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r.x1,r.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Gi.zIndex)-(e.attribute.zIndex??Gi.zIndex))).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}async _increaseRender(t,e){this.rendering=!0,await this._renderIncrementalGroup(t,e)}async _renderIncrementalGroup(t,e){this.count=t.count,await new Promise((i=>{this.renderItem(t,e,{drawingCb:async()=>{if(2!==t.count)await up(t,Gi.zIndex,((i,n)=>{if(this.status===Cp.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,await this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}})})),this.hooks.completeDraw.call()}async waitToNextFrame(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}async checkForDraw(t){let e=this.rendering;return t.restartIncremental&&(e=!1,await this.forceStop(),this.resetToInit()),e}async forceStop(){this.rendering&&(this.status=Cp.STOP,await new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Cp.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}async renderGroup(t,e){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(await this._increaseRender(t,e),void(e.break=!0)):void await new Promise((i=>{this.renderItem(t,e,{drawingCb:async()=>{await up(t,Gi.zIndex,(async t=>{e.break||t.isContainer&&await this.renderGroup(t,e)})),i(!1)}})}))}};Mp=_p([m(),Rp(0,v(lu)),Rp(1,g(Sp)),Rp(2,g(Bp)),Rp(3,g(L)),Rp(3,y(Cu)),Pp("design:paramtypes",[Array,Object,Object,Object])],Mp);var kp=new r((e=>{e(Ic).toSelf().inSingletonScope(),e(Wc).toSelf().inSingletonScope(),e(Su).to(mp),e(ru).to(Mp),e(cu).to(wp).inSingletonScope(),e(lu).toService(cu),D(e,Fa),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),D(e,Ka),D(e,lu),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Cu).toService(t.CommonDrawItemInterceptorContribution),D(e,Cu)}));function Ep(){Ep.__loaded||(Ep.__loaded=!0,xn.load(Aa),xn.load(Vu),xn.load(Wu),xn.load(Hu),xn.load(Ju),function(t){t.load(Qu),t.load(tp),t.load(cp)}(xn),function(t){t.load(kp)}(xn))}Ep.__loaded=!1,Ep();const Op=xn.get(F);on.global=Op;const Lp=xn.get(pa);on.graphicUtil=Lp;const Ip=xn.get(ua);on.transformUtil=Ip;const Dp=xn.get(ia);on.graphicService=Dp;const Wp=xn.get(fa);on.layerService=Wp;class jp{constructor(){i(this,"name","AutoRenderPlugin"),i(this,"activeEvent","onRegister"),i(this,"pluginService",void 0),i(this,"_uid",n.GenAutoIncrementId()),i(this,"key",this.name+this._uid)}activate(t){this.pluginService=t,on.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),on.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){on.graphicService.hooks.onAttributeUpdate.taps=on.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.onSetStage.taps=on.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class Up{constructor(){i(this,"name","ViewTransform3dPlugin"),i(this,"activeEvent","onRegister"),i(this,"pluginService",void 0),i(this,"_uid",n.GenAutoIncrementId()),i(this,"key",this.name+this._uid),i(this,"mousedown",void 0),i(this,"pageX",void 0),i(this,"pageY",void 0),i(this,"option3d",void 0),i(this,"onMouseDown",(t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)})),i(this,"onMouseUp",(t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)})),i(this,"onMouseMove",(t=>{const e=this.pluginService.stage;if(this.option3d||(this.option3d=e.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const i=t.page.x-this.pageX,n=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const r=i/100,s=n/100;this.option3d.alpha=(this.option3d.alpha??0)+r,this.option3d.beta=(this.option3d.beta??0)+s,e.set3dOptions(this.option3d),e.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}))}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class Np{constructor(){i(this,"name","IncrementalAutoRenderPlugin"),i(this,"activeEvent","onRegister"),i(this,"pluginService",void 0),i(this,"nextFrameRenderGroupSet",new Set),i(this,"willNextFrameRender",!1),i(this,"nextUserParams",{}),i(this,"_uid",n.GenAutoIncrementId()),i(this,"key",this.name+this._uid)}activate(t){this.pluginService=t,on.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),on.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){on.graphicService.hooks.onAddIncremental.taps=on.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.onClearIncremental.taps=on.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,on.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,{stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext(),...this.nextUserParams})})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}class Fp{constructor(){i(this,"name","HtmlAttributePlugin"),i(this,"activeEvent","onRegister"),i(this,"pluginService",void 0),i(this,"_uid",n.GenAutoIncrementId()),i(this,"key",this.name+this._uid),i(this,"htmlMap",{}),i(this,"renderId",0)}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.onRemove.unTap(this.key),on.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let n;return n=e?"string"==typeof e?on.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:on.global.createDom({tagName:"div",parent:n,...i}),nativeContainer:n}}parseDefaultStyleFromGraphic(t){return nh("text"===t.type&&t.attribute?t.attribute:mr(t).text)}getTransformOfText(t){const e=mr(t).text,{textAlign:i=e.textAlign,textBaseline:n=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:o,scaleY:a}=r,h={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},l={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${h[i]},${h[n]}) rotate(${s}deg) scaleX(${o}) scaleY(${a})`,transformOrigin:`${l[i]} ${l[n]}`}}updateStyleOfWrapContainer(t,e,i,n,r){const{pointerEvents:s}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none",i.style.position||(i.style.position="absolute",n.style.position="relative");let a=0,h=0;const l=t.globalAABBBounds;let c=r.anchorType;if(Z(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||l.empty()){const e=t.globalTransMatrix;a=e.e,h=e.f}else{const t=((t,e)=>{const{x1:i,x2:n,y1:r,y2:s}=t,o=Math.abs(n-i),a=Math.abs(s-r);let h=(i+n)/2,l=(r+s)/2,c=0,d=0;switch(e){case"top":case"inside-top":d=-.5;break;case"bottom":case"inside-bottom":d=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,d=-.5;break;case"top-left":c=-.5,d=-.5;break;case"bottom-right":c=.5,d=.5;break;case"bottom-left":c=-.5,d=.5}return h+=c*o,l+=d*a,{x:h,y:l}})(l,c);a=t.x,h=t.y}const d=on.global.getElementTopLeft(n,!1),u=e.window.getTopLeft(!1),p=a+u.left-d.left,f=h+u.top-d.top;if(o.left=`${p}px`,o.top=`${f}px`,"text"===t.type&&"position"===c&&(o={...o,...this.getTransformOfText(t)}),q(r.style)){const e=r.style({top:f,left:p,width:l.width(),height:l.height()},t,i);e&&(o={...o,...e})}else Q(r.style)?o={...o,...r.style}:it(r.style)&&r.style&&(o={...o,...me(r.style)});on.global.updateDom(i,{width:r.width,height:r.width,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===on.global.env&&(t.renderTreeRoots.sort(((t,e)=>(t.attribute.zIndex??Gi.zIndex)-(e.attribute.zIndex??Gi.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&on.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){const{html:e}=t.attribute;if(!e)return;const i=t.stage;if(!i)return;const{dom:n,container:r}=e;if(!n)return;const s=Z(e.id)?`${t.id??t._uid}_react`:e.id;if(this.htmlMap&&this.htmlMap[s]&&r&&r!==this.htmlMap[s].container&&this.removeElement(s),this.htmlMap&&this.htmlMap[s])"string"==typeof n?this.htmlMap[s].wrapContainer.innerHTML=n:n!==this.htmlMap[s].wrapContainer.firstChild&&(this.htmlMap[s].wrapContainer.removeChild(this.htmlMap[s].wrapContainer.firstChild),this.htmlMap[s].wrapContainer.appendChild(n));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,r);t&&("string"==typeof n?t.innerHTML=n:t.appendChild(n),this.htmlMap||(this.htmlMap={}),this.htmlMap[s]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[s])return;const{wrapContainer:o,nativeContainer:a}=this.htmlMap[s];this.updateStyleOfWrapContainer(t,i,o,a,e),this.htmlMap[s].renderId=this.renderId}release(){"browser"===on.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}const Gp=new Wt;class zp{constructor(){i(this,"name","DirtyBoundsPlugin"),i(this,"activeEvent","onRegister"),i(this,"pluginService",void 0),i(this,"_uid",n.GenAutoIncrementId()),i(this,"key",this.name+this._uid)}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),on.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Gp.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(Gp,t.parent&&t.parent.globalTransMatrix)))})),on.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),on.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){on.graphicService.hooks.beforeUpdateAABBBounds.taps=on.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.afterUpdateAABBBounds.taps=on.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.onRemove.taps=on.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const Hp=new Wt;class Vp{constructor(){i(this,"name","FlexLayoutPlugin"),i(this,"activeEvent","onRegister"),i(this,"pluginService",void 0),i(this,"id",n.GenAutoIncrementId()),i(this,"key",this.name+this.id),i(this,"tempBounds",new Wt),i(this,"pause",void 0),i(this,"skipBoundsTrigger",void 0)}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const n=mr(i).group,{display:r=n.display}=i.attribute;if("flex"!==r)return;const{flexDirection:s=n.flexDirection,flexWrap:o=n.flexWrap,alignItems:a=n.alignItems,clip:h=n.clip}=i.attribute,{alignContent:l=a??n.alignContent}=i.attribute;let{width:c,height:d,justifyContent:u=n.justifyContent}=i.attribute;const p=i.getChildren();if(null==c||null==d){let t=0,e=0,i=0;if(p.forEach((n=>{const r=this.getAABBBounds(n);r.empty()||("column"===s||"column-reverse"===s?(e+=r.height(),t=Math.max(t,r.width())):(t+=r.width(),e=Math.max(e,r.height())),i+=r.x1,i+=r.y1,i+=r.x2,i+=r.y2)})),!isFinite(i))return;c=t,d=e}null==i.attribute.width?i.attribute.width=c:c=i.attribute.width,null==i.attribute.height?i.attribute.height=d:d=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const f={main:{len:c,field:"x"},cross:{len:d,field:"y"}},g=f.main,v=f.cross;"column"!==s&&"column-reverse"!==s||(g.len=d,v.len=c,g.field="y",v.field="x"),"row-reverse"!==s&&"column-reverse"!==s||("flex-start"===u?u="flex-end":"flex-end"===u?u="flex-start":p.reverse());let m=0,y=0;const b=[];p.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===g.field?e.width():e.height(),n="x"===v.field?e.width():e.height();b.push({mainLen:i,crossLen:n}),m+=i,y=Math.max(y,n)}));const x=[];if(m>g.len&&"wrap"===o){let t=0,e=0;b.forEach(((i,n)=>{let{mainLen:r,crossLen:s}=i;t+r>g.len?0===t?(x.push({idx:n,mainLen:t+r,crossLen:s}),t=0,e=0):(x.push({idx:n-1,mainLen:t,crossLen:e}),t=r,e=s):(t+=r,e=Math.max(e,s))})),x.push({idx:b.length-1,mainLen:t,crossLen:e})}else x.push({idx:b.length-1,mainLen:m,crossLen:y});let w=0;if(x.forEach((t=>{this.layoutMain(i,p,u,g,b,w,t),w=t.idx+1})),y=x.reduce(((t,e)=>t+e.crossLen),0),1===x.length){const t={"flex-start":0,"flex-end":v.len,center:v.len/2};this.layoutCross(p,a,v,t,b,x[0],0)}else if("flex-start"===l){w=0;let t=0;x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"flex-start",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===l){w=0;let t=Math.max(0,(v.len-y)/2);x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"center",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===l){w=0;const t=Math.max(0,(v.len-y)/x.length/2);let e=t;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===l){w=0;const t=Math.max(0,(v.len-y)/(2*x.length-2));let e=0;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}p.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const A=this.getAABBBounds(i);h||this.tempBounds.equals(A)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(e??0)-i}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else if("flex-end"===i){let t=n.len;for(let i=o.idx;i>=s;i--){t-=r[i].mainLen;const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`]))}}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++){const s=a+(e[t],n.field,0),o=this.getAABBBounds(e[t]);!o.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],o[`${n.field}1`])),a+=r[t].mainLen+2*i}}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++){const s=a+(e[t],n.field,0),o=this.getAABBBounds(e[t]);!o.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],o[`${n.field}1`])),a+=r[t].mainLen+2*i}}else if("center"===i){let t=(n.len-o.mainLen)/2;for(let i=s;i<=o.idx;i++){const s=t+(e[i],n.field,0),o=this.getAABBBounds(e[i]);!o.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],o[`${n.field}1`])),t+=r[i].mainLen}}}layoutCross(t,e,i,n,r,s,o){for(let a=o;a<=s.idx;a++){const s=t[a];let{alignSelf:o}=s.attribute;o&&"auto"!==o||(o=e);const h=this.getAABBBounds(s),l=n[o]??n["flex-start"];"flex-end"===o?!h.empty()&&(s.attribute[i.field]=this.updateChildPos(l-r[a].crossLen+(i.field,0),s.attribute[i.field],h[`${i.field}1`])):"center"===o?!h.empty()&&(s.attribute[i.field]=this.updateChildPos(l-r[a].crossLen/2+(i.field,0),s.attribute[i.field],h[`${i.field}1`])):!h.empty()&&(s.attribute[i.field]=this.updateChildPos(l+(i.field,0),s.attribute[i.field],h[`${i.field}1`]))}}activate(t){this.pluginService=t,on.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),on.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&Hp.copy(n)})),on.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(Hp.equals(i)||this.tryLayout(t,!1))})),on.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){on.graphicService.hooks.onAttributeUpdate.taps=on.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.beforeUpdateAABBBounds.taps=on.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.afterUpdateAABBBounds.taps=on.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),on.graphicService.hooks.onSetStage.taps=on.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const Yp=new Dr;Yp.addTimeline(Ur),Yp.setFPS(60);class Xp{constructor(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=e,this.color=i,this.colorRgb=Us.Get(i,t.ColorType.Color1),this.ambient=n;const r=Ct(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}computeColor(e,i){const n=this.formatedDir,r=Tt(St((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=it(i)?Us.Get(i,t.ColorType.Color1):i;const o=this.colorRgb;return`rgb(${o[0]*s[0]*r}, ${o[1]*s[1]*r}, ${o[2]*s[2]*r})`}}function $p(t,e,i,n){let r,s,o,a,h,l,c,d,u,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],A=i[2];return Math.abs(f-x)<gt&&Math.abs(g-w)<gt&&Math.abs(v-A)<gt?lc.identity(t):(c=f-x,d=g-w,u=v-A,p=1/Math.hypot(c,d,u),c*=p,d*=p,u*=p,r=y*u-b*d,s=b*c-m*u,o=m*d-y*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=d*o-u*s,h=u*r-c*o,l=c*s-d*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=d,t[7]=0,t[8]=o,t[9]=l,t[10]=u,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+h*g+l*v),t[14]=-(c*f+d*g+u*v),t[15]=1,t)}function Kp(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*h,t[14]=(o+s)*l,t[15]=1,t}function qp(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],d=e[8],u=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],A=i[3];return t[0]=b*n+x*a+w*d+A*g,t[1]=b*r+x*h+w*u+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i[4],x=i[5],w=i[6],A=i[7],t[4]=b*n+x*a+w*d+A*g,t[5]=b*r+x*h+w*u+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=i[8],x=i[9],w=i[10],A=i[11],t[8]=b*n+x*a+w*d+A*g,t[9]=b*r+x*h+w*u+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i[12],x=i[13],w=i[14],A=i[15],t[12]=b*n+x*a+w*d+A*g,t[13]=b*r+x*h+w*u+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t}function Zp(t,e,i){const n=e[0],r=e[1],s=e[2];let o=i[3]*n+i[7]*r+i[11]*s+i[15];return o=o||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/o,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/o,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/o,t}class Jp{set params(t){this._params={...t},this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return{...this._params}}constructor(t){i(this,"_params",void 0),i(this,"_projectionMatrixCached",void 0),i(this,"_viewMatrixCached",void 0),i(this,"_vp",void 0),this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=dc.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=dc.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return $p(this._viewMatrixCached,t,e,i),this._vp||(this._vp=dc.allocate()),this._vp=qp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=dc.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=dc.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return Kp(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=dc.allocate()),this._vp=qp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(e??n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Zp(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;Zp(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}let Qp;function tf(){if(null==Qp)try{Qp=globalThis===window,Qp&&(Qp=!!document.createElement)}catch(t){Qp=!1}}function ef(){tf();const t=on.global&&on.global.env;return t?"browser"===t:Qp}function nf(){tf();const t=on.global&&on.global.env;return t?"node"===t:!Qp}class rf extends Fp{constructor(){super(...arguments),i(this,"name","ReactAttributePlugin"),i(this,"activeEvent","onRegister"),i(this,"_uid",n.GenAutoIncrementId()),i(this,"key",this.name+this._uid),i(this,"htmlMap",{})}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i}=this.htmlMap[t];e&&on.global.getRequestAnimationFrame()((()=>{e.unmount()})),i&&on.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){const{react:e}=t.attribute;if(!e)return;const i=t.stage;if(!i)return;const n=i.params.ReactDOM,{element:r,container:s}=e;if(!(r&&n&&n.createRoot))return;const o=Z(e.id)?`${t.id??t._uid}_react`:e.id;if(this.htmlMap&&this.htmlMap[o]&&s&&s!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])this.htmlMap[o].root.render(r);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,s);if(t){const i=n.createRoot(t);i.render(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:a,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,a,h,e),this.htmlMap[o].renderId=this.renderId}}const sf="white";class of extends la{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){return this._background??sf}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({}),i(this,"_background",void 0),i(this,"nextFrameRenderLayerSet",void 0),i(this,"willNextFrameRender",void 0),i(this,"_cursor",void 0),i(this,"renderCount",void 0),i(this,"dirtyBounds",void 0),i(this,"option3d",void 0),i(this,"ticker",void 0),i(this,"autoRender",void 0),i(this,"_enableLayout",void 0),i(this,"htmlAttribute",void 0),i(this,"reactAttribute",void 0),i(this,"increaseAutoRender",void 0),i(this,"view3dTranform",void 0),i(this,"window",void 0),i(this,"global",void 0),i(this,"renderService",void 0),i(this,"pickerService",void 0),i(this,"pluginService",void 0),i(this,"layerService",void 0),i(this,"_eventSystem",void 0),i(this,"_beforeRender",void 0),i(this,"_afterRender",void 0),i(this,"_skipRender",void 0),i(this,"_afterNextRenderCbs",void 0),i(this,"lastRenderparams",void 0),i(this,"interactiveLayer",void 0),i(this,"supportInteractiveLayer",void 0),i(this,"timeline",void 0),i(this,"_onVisibleChange",(t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1})),i(this,"beforeRender",(t=>{this._beforeRender&&this._beforeRender(t)})),i(this,"afterRender",(t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null})),this.params=t,this.theme=new gr,this.hooks={beforeRender:new U(["stage"]),afterRender:new U(["stage"])},this.global=on.global,!this.global.env&&ef()&&this.global.setEnv("browser"),this.window=xn.get(nr),this.renderService=xn.get(Iu),this.pluginService=xn.get(Xu),this.layerService=xn.get(fa),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=t.background??sf,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||Yp,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new jr,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&it(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){this._skipRender=-1}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Mr({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents,...this.params.event}))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:o=1,fieldDepth:a}=t;return{...t,center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:o,fieldDepth:a}}set3dOptions(t){this.option3d=t;const e=this.get3dOptions(t),{light:i,center:n,camera:r,alpha:s,beta:o,fieldRatio:a,fieldDepth:h}=e,{dir:l=[1,1,-1],color:c="white",ambient:d}=i,u=(n.x??this.width/2)+(n.dx??0),p=(n.y??this.height/2)+(n.dy??0),f=[u,p,(n.z??0)+(n.dz??0)];let g=0,v=0,m=0;r||(g=Math.sin(s)+u,v=Math.sin(o)+p,m=Math.cos(s)*Math.cos(o)*1),this.light=new Xp(l,c,d);const y={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:a,fieldDepth:h,viewParams:{pos:[g,v,m],center:f,up:[0,1,0]}};this.camera?this.camera.params=y:this.camera=new Jp(y),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new Up))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new jp))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Np))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Dt;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new zp,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new Vp))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new Fp))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new rf))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let n=t[e];"virtual"===n.layerMode&&(n=n.getNativeHandler().mainHandler.layer),i.includes(n)||i.push(n)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},{renderStyle:this.renderStyle,...e}))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},{renderStyle:this.renderStyle,...e})}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params={...this.camera.params,right:this.width,bottom:this.height}),i&&this.render()}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){this.pickerService||(this.pickerService=xn.get(Uu));const i=this.pickerService.pick(this.children,new Ot(t,e),{bounds:this.AABBBounds});return!(!i?.graphic&&!i?.group)&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;const e=xn.get(nr),i=t?-t.x1:0,n=t?-t.y1:0,r=t?t.x2:this.viewWidth,s=t?t.y2:this.viewHeight,o=t?t.width():this.viewWidth,a=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:n,x2:r,y2:s},width:o,height:a,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}var af=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const lf=new Nt(1,0,0,1,0,0),cf={x:0,y:0};var df;t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Nt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Nt(1,0,0,1,0,0),this.path=new Ri,this._clearMatrix=new Nt(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return cc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(cc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(cc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},cf),function(t,e,i){return Jn(t,0,!1,e,i)}(this.path.commandList,cf.x,cf.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},cf);const i=Mc(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Jn(t,e,!0,i,n)}(this.path.commandList,i,cf.x,cf.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(lf,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>cc.free(t))),this.stack.length=0}},t.EmptyContext2d=af([m(),hf("design:paramtypes",[Object,Number])],t.EmptyContext2d);var uf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},pf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ff={WIDTH:500,HEIGHT:500,DPR:1};t.BaseCanvas=(df=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){i(this,"_displayWidth",void 0),i(this,"_displayHeight",void 0),i(this,"_id",void 0),i(this,"_pixelWidth",void 0),i(this,"_pixelHeight",void 0),i(this,"_x",void 0),i(this,"_y",void 0),i(this,"_dpr",void 0),i(this,"_container",void 0),i(this,"_nativeCanvas",void 0),i(this,"_context",void 0),i(this,"_visiable",void 0),i(this,"controled",void 0);const{nativeCanvas:e,width:n=ff.WIDTH,height:r=ff.HEIGHT,dpr:s=ff.DPR,x:o,y:a,id:h,canvasControled:l=!0}=t;this._x=o??0,this._y=a??0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==t.visiable,this.controled=l,this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=e,this._id=e.id??h,h&&(e.id=h),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},i(df,"env","browser"),df),t.BaseCanvas=uf([m(),pf("design:paramtypes",[Object])],t.BaseCanvas);var gf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};t.BaseEnvContribution=class{constructor(){i(this,"type",void 0),i(this,"supportsTouchEvents",void 0),i(this,"supportsPointerEvents",void 0),i(this,"supportsMouseEvents",void 0),i(this,"applyStyles",void 0),i(this,"supportEvent",void 0)}configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Wt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}},t.BaseEnvContribution=gf([m()],t.BaseEnvContribution);var vf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},mf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=class{constructor(){i(this,"viewBox",void 0),i(this,"modelMatrix",void 0),this._uid=n.GenAutoIncrementId(),this.viewBox=new Wt,this.modelMatrix=new Nt(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,n,r,s){this.modelMatrix.setValue(t,e,i,n,r,s)}getViewBoxTransform(){return this.modelMatrix}},t.BaseWindowHandlerContribution=vf([m(),mf("design:paramtypes",[])],t.BaseWindowHandlerContribution);var yf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xf=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultPickService=class{constructor(t){i(this,"pickItemInterceptorContributions",void 0),i(this,"type","default"),this.pickItemInterceptorContributions=t,this.global=on.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;const r=i.bounds.width(),s=i.bounds.height();if(!(new Wt).setValue(0,0,r,s).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new Nt(1,0,0,1,0,0);let a;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,o,i):this.pickItem(t[r],e,o,i),!n.graphic);r--)a||(a=n.group);if(n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i??{pickContext:this.pickContext,pickerService:this})?.graphic}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=dc.allocate();if(yc(i,e),o){if(i){const t=dc.allocate();s.modelMatrix=bc(t,o,i),dc.free(i)}}else yc(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const a=this.InterceptorContributions[r];if(a.beforePickItem){const r=a.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==o&&dc.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=cc.allocateByObj(i),l=new Ot(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const d=this.pickItem(t,l.clone(),i,n);d&&d.graphic&&(r.graphic=d.graphic,r.params=d.params);const u=!1!==t.attribute.pickable&&c;return h.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||d&&d.graphic||dp(t,Gi.zIndex,(s=>{if(s.isContainer){const i=new Ot(e.x,e.y),o=mr(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;i.x-=a,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const o=new Ot(e.x,e.y);h.transformPoint(o,o);const a=mr(t).group,{scrollX:l=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=l,o.y-=c;const d=this.pickItem(s,o,i,n);d&&d.graphic&&(r.graphic=d.graphic,r.params=d.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&dc.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!u||t.stage.camera||(r.group=t),cc.free(h),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}},t.DefaultPickService=yf([m(),xf(0,g(L)),xf(0,y(zu)),bf("design:paramtypes",[Object])],t.DefaultPickService);var wf=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Af=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function Sf(t,e,i,n,r){let s=n,o=e;const a=t[e].x,h=t[e].y,l=t[i].x-a,c=t[i].y-h,d=l*l+c*c;let u,p,f,g,v;for(let n=e+1,r=i-1;n<r;n++)g=t[n].x-a,v=t[n].y-h,u=g*c-l*v,p=u*u,f=p/d,f>s&&(s=f,o=n);s>n&&(o-e>2&&Sf(t,e,o,n,r),r.push(t[o],t[o+1]),i-o>2&&Sf(t,o,i,n,r))}function Tf(t,e){const i=t.length-1,n=[t[0]];return Sf(t,0,i,e,n),n.push(t[i]),n}t.DefaultGlobalPickerService=class{constructor(){i(this,"type",void 0),this.global=on.global,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new Nt(1,0,0,1,0,0);let s;for(let o=0;o<t.length;o++){if(t[o].isContainer)n=this.pickGroup(t[o],e,r,i);else{const s=this.pickItem(t[o],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new Ot(e.x,e.y);i.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const h=!1!==t.attribute.pickable&&a;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new Ot(e.x,e.y);i.transformPoint(s,s);const o=this.pickItem(t,s,i,n);o&&(r.graphic=o.graphic,r.params=o.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=wf([m(),Af("design:paramtypes",[])],t.DefaultGlobalPickerService);class Bf{constructor(){i(this,"pools",[])}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Cf extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.rect(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.rect(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const _f=new Cf;class Pf extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.arc(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.arc(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Rf=new Pf;class Mf extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.area(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.area(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const kf=new Mf;class Ef extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.circle(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.circle(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Of=new Ef;class Lf extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.line(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.line(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const If=new Lf;class Df extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.path(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.path(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Wf=new Df;class jf extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.symbol(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.symbol(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Uf=new jf;class Nf extends Bf{allocate(t){if(!this.pools.length)return on.graphicService.creator.text(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return on.graphicService.creator.text(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Ff=new Nf;class Gf{constructor(){i(this,"map",{text:Ff,symbol:Uf})}gc(t){t.isContainer?t.forEachChildren((t=>this.gc(t))):this.gcItem(t)}gcItem(t){const e=this.map[t.type];e&&e.free(t)}}const zf=new Gf;let Hf=!1;const Vf=new r((e=>{Hf||(Hf=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(su).to(t.DefaultCanvasArcRender).inSingletonScope(),e(lu).toService(su),e(ja).toService(t.DefaultBaseInteractiveRenderContribution),D(e,ja))}));let Yf=!1;const Xf=new r((e=>{Yf||(Yf=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(fu).to(t.DefaultCanvasRectRender).inSingletonScope(),e(lu).toService(fu),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(Va).toService(t.SplitRectAfterRenderContribution),e(Va).toService(t.SplitRectBeforeRenderContribution),e(Va).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Va))}));let $f=!1;const Kf=new r((e=>{$f||($f=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Sp).toSelf().inSingletonScope(),e(du).to(t.DefaultCanvasLineRender).inSingletonScope(),e(lu).toService(du))}));let qf=!1;const Zf=new r((e=>{qf||(qf=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(au).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(lu).toService(au),e(Ua).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Ua),e(Bp).toSelf().inSingletonScope())}));let Jf=!1;const Qf=new r((e=>{Jf||(Jf=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(vu).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(lu).toService(vu),e(Ya).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Ya))}));let tg=!1;const eg=new r((e=>{tg||(tg=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(hu).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(lu).toService(hu),e(Na).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Na))}));let ig=!1;const ng=new r((e=>{ig||(ig=!0,e(mu).to(t.DefaultCanvasTextRender).inSingletonScope(),e(lu).toService(mu),e(Xa).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Xa))}));let rg=!1;const sg=new r((e=>{rg||(rg=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(uu).to(t.DefaultCanvasPathRender).inSingletonScope(),e(lu).toService(uu),e(za).toService(t.DefaultBaseInteractiveRenderContribution),D(e,za))}));let og=!1;const ag=new r((e=>{og||(og=!0,e(pu).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(lu).toService(pu),e(Ha).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Ha))}));var hg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let lg=class{constructor(){i(this,"type",void 0),i(this,"numberType",Ho)}drawShape(t,e,i,n,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,o,a)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=mr(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};lg=hg([m()],lg);let cg=!1;const dg=new r((t=>{cg||(cg=!0,t(xu).to(lg).inSingletonScope(),t(lu).toService(xu))}));var ug=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},pg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let fg=class extends _c{constructor(){super(),i(this,"type",void 0),i(this,"numberType",Qo),this.builtinContributions=[Fd],this.init()}drawShape(t,e,i,n,r){const s=mr(t).richtext,{strokeOpacity:o=s.strokeOpacity,opacity:a=s.opacity,fillOpacity:h=s.fillOpacity,visible:l=s.visible}=t.attribute;if(!t.valid||!l)return;const c=Ba(a,h,!0),d=Ba(a,o,!0);c&&(e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,d,c,d,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,d,c,d,s,r))}drawIcon(t,e,i,n,r){const s=mr(t).richtextIcon,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,image:l,backgroundFill:c=s.backgroundFill,backgroundFillOpacity:d=s.backgroundFillOpacity,backgroundStroke:u=s.backgroundStroke,backgroundStrokeOpacity:p=s.backgroundStrokeOpacity,backgroundRadius:f=s.backgroundRadius,margin:g}=t.attribute,{backgroundWidth:v=o,backgroundHeight:m=a}=t.attribute;if(g&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(v-o)/2,r=(m-a)/2;0===f?(e.beginPath(),e.rect(i-t,n-r,v,m)):(e.beginPath(),qc(e,i-t,n-r,v,m,f)),c&&(e.globalAlpha=d,e.fillStyle=c,e.fill()),u&&(e.globalAlpha=p,e.strokeStyle=u,e.stroke())}const y=l&&t?.resources?.get(l);y&&"success"===y.state&&(e.globalAlpha=h,e.drawImage(y.data,i,n,o,a))}draw(t,e,i){const n=mr(t).richtext;this._draw(t,n,!1,i)}};fg=ug([m(),pg("design:paramtypes",[])],fg);let gg=!1;const vg=new r((t=>{gg||(gg=!0,t(yu).to(fg).inSingletonScope(),t(lu).toService(yu))}));let mg=!1;const yg=new r((e=>{mg||(mg=!0,e(wu).to(t.DefaultCanvasImageRender).inSingletonScope(),e(lu).toService(wu),e(Ga).toService(t.DefaultBaseInteractiveRenderContribution),D(e,Ga))}));var bg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let xg=class extends _c{constructor(){super(...arguments),i(this,"type","rect3d"),i(this,"numberType",Jo)}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).rect,{fill:l=h.fill,stroke:c=h.stroke,x1:d,y1:u,x:p,y:f,opacity:g=h.opacity,fillOpacity:v=h.fillOpacity,lineWidth:m=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:b=h.visible}=t.attribute;let{width:x,height:w}=t.attribute;x=(x??d-p)||0,w=(w??u-f)||0;const A=this.z??0,S=Ca(g,v,x,w,l),T=Pa(g,y,x,w),B=Sa(l),C=Ta(c,m);if(!t.valid||!b)return;if(!B&&!C)return;if(!(S||T||o||a))return;const{light:_,camera:P}=r.stage||{},R=t.findFace();if(!1!==l){e.setCommonStyle(t,t.attribute,i,n,h);let r=l;"string"!=typeof r&&(r="black"),this.fill(i,n,A,R,r,e,_,o)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,A,R,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a={x:t+o[0],y:e+o[1],z:i+o[2]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,o,a,h){const l=Us.Get(s,t.ColorType.Color255),c=r.vertices,d=c.map((t=>o.view(t[0],t[1],t[2])[2])),u=[];r.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=d[i[0]],s=d[i[1]],o=d[i[2]],a=d[i[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((t=>{const{polygon:r,normal:d}=t.polygon,u=c[r[0]],p=c[r[1]],f=c[r[2]],g=c[r[3]],v={x:e+u[0],y:i+u[1],z:n+u[2]},m={x:e+p[0],y:i+p[1],z:n+p[2]},y={x:e+f[0],y:i+f[1],z:n+f[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]};o.beginPath(),o.moveTo(v.x,v.y,v.z),o.lineTo(m.x,m.y,m.z),o.lineTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.closePath(),h?h(o,null,null):(o.fillStyle=a?a.computeColor(d,l):s,o.fill())}))}draw(t,e,i){const n=mr(t).rect;this._draw(t,n,!1,i)}};xg=bg([m()],xg);let wg=!1;const Ag=new r((t=>{wg||(wg=!0,t(gu).to(xg).inSingletonScope(),t(lu).toService(gu))}));var Sg=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Tg=class extends _c{constructor(){super(...arguments),i(this,"type",void 0),i(this,"numberType",Fo)}drawShape(e,i,n,r,s,o,a,h){const l=mr(e,o?.theme).arc,{fill:c=l.fill}=e.attribute,d=this.valid(e,l,a,h);if(!d)return;const{fVisible:u,sVisible:p,doFill:f,doStroke:g}=d,v=this.z??0,{outerPadding:m=l.outerPadding,innerPadding:y=l.innerPadding,height:b=10}=e.attribute;let{outerRadius:x=l.outerRadius,innerRadius:w=l.innerRadius}=e.attribute;x+=m,w-=y;const A=Us.Get(c,t.ColorType.Color255),{light:S}=s.stage||{},T=s.hack_pieFace,B={top:v,bottom:v+b},C={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===T||"top"===T?(i.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=xt(h-a),c=h>a;let d=!1;if(s<o){const t=s;s=o,o=t}if(s<=gt)e.moveTo(i,n,r);else if(l>=bt-gt)e.moveTo(i+s*At(a),n+s*Bt(a),r),e.arc(i,n,s,a,h,!c,r),o>gt&&(e.moveTo(i+o*At(h),n+o*Bt(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:u,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,h),m=s*At(p),y=s*Bt(p),b=o*At(g),x=o*Bt(g);l<.001?d=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(o>gt)||u<.001?(e.lineTo(i+b,n+x,r),d=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(e,i,n,r,B[T],x,w),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,l),f&&(a?a(i,e.attribute,l):u&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fillStyle=S?S.computeColor(C[T],A):c,i.fill())),g&&(h?h(i,e.attribute,l):p&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke()))):"outside"!==T&&"inside"!==T||("inside"===T&&(i.save(),i.beginPath(),i.arc(n,r,w,0,bt,!0,B.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=xt(l-h),d=l>h;let u=!1;if(o<=gt)e.moveTo(i,n,r);else if(c>=bt-gt)e.moveTo(i+o*At(h),n+o*Bt(h),r),e.arc(i,n,o,h,l,!d,r),e.lineTo(i+o*At(l),n+o*Bt(l),s),e.arc(i,n,o,l,h,d,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*At(c),g=o*Bt(c),v=o*At(p),m=o*Bt(p);t<.001?u=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!d,r),e.lineTo(i+v,n+m,s),e.arc(i,n,o,p,c,d,s))}e.closePath()}(e,i,n,r,B.top,B.bottom,"outside"===T?x:w,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=e.getParsePadAngle(t,i);return"outside"===T?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,l),f&&(a?a(i,e.attribute,l):u&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fillStyle=S?S.computeColor(C[T],A):c,i.fill())),g&&(h?h(i,e.attribute,l):p&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())),"inside"===T&&i.restore())}draw(t,e,i,n){const r=mr(t,n?.theme).arc;this._draw(t,r,!1,i,n)}};Tg=Sg([m()],Tg);let Bg=!1;const Cg=new r((t=>{Bg||(Bg=!0,t(ou).to(Tg).inSingletonScope(),t(lu).toService(ou))}));var _g=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Pg=class extends _c{constructor(){super(...arguments),i(this,"type","pyramid3d"),i(this,"numberType",qo)}drawShape(t,e,i,n,r,s,o,a){const h=mr(t,s?.theme).polygon,{fill:l=h.fill,stroke:c=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,u=this.z??0;if(!this.valid(t,h,o,a))return;const{light:p,camera:f}=r.stage||{},g=t.findFace();if(!1!==l){e.setCommonStyle(t,t.attribute,i,n,h);let r=l;"string"!=typeof r&&(r="black"),this.fill(i,n,u,g,d,r,e,p,f,t,h,o)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,u,g,e))}stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const o=s[n[0]],a=s[n[1]],h={x:t+o[0],y:e+o[1],z:i+o[2]},l={x:t+a[0],y:e+a[1],z:i+a[2]};r.beginPath(),r.moveTo(h.x,h.y,h.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,o,a,h,l,c,d,u){const p=Us.Get(o,t.ColorType.Color255),f=r.vertices,g=f.map((t=>a.view(t[0],t[1],t[2])[2])),v=[];r.polygons.forEach(((t,e)=>{if(!s[e])return;v.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=g[i[0]],o=g[i[1]],a=g[i[2]],h=g[i[3]];t.ave_z=r+o+a+h})),v.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),v.forEach((t=>{const{polygon:r,normal:s}=t.polygon,l=f[r[0]],g=f[r[1]],v=f[r[2]],m=f[r[3]],y={x:e+l[0],y:i+l[1],z:n+l[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+v[0],y:i+v[1],z:n+v[2]},w={x:e+m[0],y:i+m[1],z:n+m[2]};a.beginPath(),a.moveTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.lineTo(w.x,w.y,w.z),a.closePath(),u?u(a,c.attribute,d):(a.fillStyle=h?h.computeColor(s,p):o,a.fill())}))}draw(t,e,i){const n=mr(t).polygon;this._draw(t,n,!1,i)}};Pg=_g([m()],Pg);let Rg=!1;const Mg=new r((t=>{Rg||(Rg=!0,t(bu).to(Pg).inSingletonScope(),t(lu).toService(bu))}));function kg(){Ac.RegisterGraphicCreator("arc",Xl)}function Eg(){Ac.RegisterGraphicCreator("arc3d",Kl)}function Og(){Ac.RegisterGraphicCreator("area",Hl)}function Lg(){Ac.RegisterGraphicCreator("circle",Ja)}function Ig(){Ac.RegisterGraphicCreator("glyph",_l)}function Dg(){Ac.RegisterGraphicCreator("group",ca)}function Wg(){Ac.RegisterGraphicCreator("image",El)}function jg(){Ac.RegisterGraphicCreator("line",bl)}function Ug(){Ac.RegisterGraphicCreator("path",Fl)}function Ng(){Ac.RegisterGraphicCreator("polygon",Jl)}function Fg(){Ac.RegisterGraphicCreator("pyramid3d",tc)}function Gg(){Ac.RegisterGraphicCreator("rect",Al)}function zg(){Ac.RegisterGraphicCreator("rect3d",Bl)}function Hg(){Ac.RegisterGraphicCreator("richtext",jl)}function Vg(){Ac.RegisterGraphicCreator("symbol",vl)}function Yg(){Ac.RegisterGraphicCreator("text",ah)}function Xg(){Ac.RegisterGraphicCreator("shadowRoot",ic)}function $g(){Ac.RegisterGraphicCreator("wrapText",ch)}function Kg(t,e,i){if(t&&t.length){const[n,r]=e,s=Math.PI/180*i,o=Math.cos(s),a=Math.sin(s);t.forEach((t=>{const[e,i]=t;t[0]=(e-n)*o-(i-r)*a+n,t[1]=(e-n)*a+(i-r)*o+r}))}}function qg(t){const e=t[0],i=t[1];return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}function Zg(t,e){const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=[0,0];if(i)for(const e of t)Kg(e,r,i);const s=function(t,e){const i=[];for(const e of t){const t=[...e];t[0].join(",")!==t[t.length-1].join(",")&&t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}const n=[];e=Math.max(e,.1);const r=[];for(const t of i)for(let e=0;e<t.length-1;e++){const i=t[e],n=t[e+1];if(i[1]!==n[1]){const t=Math.min(i[1],n[1]);r.push({ymin:t,ymax:Math.max(i[1],n[1]),x:t===i[1]?i[0]:n[0],islope:(n[0]-i[0])/(n[1]-i[1])})}}if(r.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!r.length)return n;let s=[],o=r[0].ymin;for(;s.length||r.length;){if(r.length){let t=-1;for(let e=0;e<r.length&&!(r[e].ymin>o);e++)t=e;r.splice(0,t+1).forEach((t=>{s.push({s:o,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=o))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const i=s[t].edge,r=s[e].edge;n.push([[Math.round(i.x),o],[Math.round(r.x),o]])}o+=e,s.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}return n}(t,n);if(i){for(const e of t)Kg(e,r,-i);!function(t,e,i){const n=[];t.forEach((t=>n.push(...t))),Kg(n,e,i)}(s,r,-i)}return s}class Jg{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const i=Zg(t,e);return{type:"fillSketch",ops:this.renderLines(i,e)}}renderLines(t,e){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return i}}class Qg extends Jg{fillPolygons(t,e){let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);const n=Zg(t,Object.assign({},e,{hachureGap:i})),r=Math.PI/180*e.hachureAngle,s=[],o=.5*i*Math.cos(r),a=.5*i*Math.sin(r);for(const[t,e]of n)qg([t,e])&&s.push([[t[0]-o,t[1]+a],[...e]],[[t[0]+o,t[1]-a],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class tv extends Jg{fillPolygons(t,e){const i=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,n);return i.ops=i.ops.concat(r.ops),i}}class ev{constructor(t){this.helper=t}fillPolygons(t,e){const i=Zg(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(i,e)}dotsOnLines(t,e){const i=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let r=e.fillWeight;r<0&&(r=e.strokeWidth/2);const s=n/4;for(const o of t){const t=qg(o),a=t/n,h=Math.ceil(a)-1,l=t-h*n,c=(o[0][0]+o[1][0])/2-n/4,d=Math.min(o[0][1],o[1][1]);for(let t=0;t<h;t++){const o=d+l+t*n,a=c-s+2*Math.random()*s,h=o-s+2*Math.random()*s,u=this.helper.ellipse(a,h,r,r,e);i.push(...u.ops)}}return{type:"fillSketch",ops:i}}}class iv{constructor(t){this.helper=t}fillPolygons(t,e){const i=Zg(t,e);return{type:"fillSketch",ops:this.dashedLine(i,e)}}dashedLine(t,e){const i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,r=[];return t.forEach((t=>{const s=qg(t),o=Math.floor(s/(i+n)),a=(s+n-o*(i+n))/2;let h=t[0],l=t[1];h[0]>l[0]&&(h=t[1],l=t[0]);const c=Math.atan((l[1]-h[1])/(l[0]-h[0]));for(let t=0;t<o;t++){const s=t*(i+n),o=s+i,l=[h[0]+s*Math.cos(c)+a*Math.cos(c),h[1]+s*Math.sin(c)+a*Math.sin(c)],d=[h[0]+o*Math.cos(c)+a*Math.cos(c),h[1]+o*Math.sin(c)+a*Math.sin(c)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],e))}})),r}}class nv{constructor(t){this.helper=t}fillPolygons(t,e){const i=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?i:e.zigzagOffset,r=Zg(t,e=Object.assign({},e,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(r,n,e)}}zigzagLines(t,e,i){const n=[];return t.forEach((t=>{const r=qg(t),s=Math.round(r/(2*e));let o=t[0],a=t[1];o[0]>a[0]&&(o=t[1],a=t[0]);const h=Math.atan((a[1]-o[1])/(a[0]-o[0]));for(let t=0;t<s;t++){const r=2*t*e,s=2*(t+1)*e,a=Math.sqrt(2*Math.pow(e,2)),l=[o[0]+r*Math.cos(h),o[1]+r*Math.sin(h)],c=[o[0]+s*Math.cos(h),o[1]+s*Math.sin(h)],d=[l[0]+a*Math.cos(h+Math.PI/4),l[1]+a*Math.sin(h+Math.PI/4)];n.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],i),...this.helper.doubleLineOps(d[0],d[1],c[0],c[1],i))}})),n}}const rv={};class sv{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const ov={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function av(t,e){return t.type===e}function hv(t){const e=[],i=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",r=0,s=i[r];for(;!av(s,2);){let o=0;const a=[];if("BOD"===n){if("M"!==s.text&&"m"!==s.text)return hv("M0,0"+t);r++,o=ov[s.text],n=s.text}else av(s,1)?o=ov[n]:(r++,o=ov[s.text],n=s.text);if(!(r+o<i.length))throw new Error("Path data ended short");for(let t=r;t<r+o;t++){const e=i[t];if(!av(e,1))throw new Error("Param not a number: "+n+","+e.text);a[a.length]=+e.text}if("number"!=typeof ov[n])throw new Error("Bad segment: "+n);{const t={key:n,data:a};e.push(t),r+=o,s=i[r],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function lv(t){let e=0,i=0,n=0,r=0;const s=[];for(const{key:o,data:a}of t)switch(o){case"M":s.push({key:"M",data:[...a]}),[e,i]=a,[n,r]=a;break;case"m":e+=a[0],i+=a[1],s.push({key:"M",data:[e,i]}),n=e,r=i;break;case"L":s.push({key:"L",data:[...a]}),[e,i]=a;break;case"l":e+=a[0],i+=a[1],s.push({key:"L",data:[e,i]});break;case"C":s.push({key:"C",data:[...a]}),e=a[4],i=a[5];break;case"c":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"C",data:t}),e=t[4],i=t[5];break}case"Q":s.push({key:"Q",data:[...a]}),e=a[2],i=a[3];break;case"q":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"Q",data:t}),e=t[2],i=t[3];break}case"A":s.push({key:"A",data:[...a]}),e=a[5],i=a[6];break;case"a":e+=a[5],i+=a[6],s.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,i]});break;case"H":s.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...a]}),i=a[0];break;case"v":i+=a[0],s.push({key:"V",data:[i]});break;case"S":s.push({key:"S",data:[...a]}),e=a[2],i=a[3];break;case"s":{const t=a.map(((t,n)=>n%2?t+i:t+e));s.push({key:"S",data:t}),e=t[2],i=t[3];break}case"T":s.push({key:"T",data:[...a]}),e=a[0],i=a[1];break;case"t":e+=a[0],i+=a[1],s.push({key:"T",data:[e,i]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,i=r}return s}function cv(t){const e=[];let i="",n=0,r=0,s=0,o=0,a=0,h=0;for(const{key:l,data:c}of t){switch(l){case"M":e.push({key:"M",data:[...c]}),[n,r]=c,[s,o]=c;break;case"C":e.push({key:"C",data:[...c]}),n=c[4],r=c[5],a=c[2],h=c[3];break;case"L":e.push({key:"L",data:[...c]}),[n,r]=c;break;case"H":n=c[0],e.push({key:"L",data:[n,r]});break;case"V":r=c[0],e.push({key:"L",data:[n,r]});break;case"S":{let t=0,s=0;"C"===i||"S"===i?(t=n+(n-a),s=r+(r-h)):(t=n,s=r),e.push({key:"C",data:[t,s,...c]}),a=c[0],h=c[1],n=c[2],r=c[3];break}case"T":{const[t,s]=c;let o=0,l=0;"Q"===i||"T"===i?(o=n+(n-a),l=r+(r-h)):(o=n,l=r);const d=n+2*(o-n)/3,u=r+2*(l-r)/3,p=t+2*(o-t)/3,f=s+2*(l-s)/3;e.push({key:"C",data:[d,u,p,f,t,s]}),a=o,h=l,n=t,r=s;break}case"Q":{const[t,i,s,o]=c,l=n+2*(t-n)/3,d=r+2*(i-r)/3,u=s+2*(t-s)/3,p=o+2*(i-o)/3;e.push({key:"C",data:[l,d,u,p,s,o]}),a=t,h=i,n=s,r=o;break}case"A":{const t=Math.abs(c[0]),i=Math.abs(c[1]),s=c[2],o=c[3],a=c[4],h=c[5],l=c[6];0===t||0===i?(e.push({key:"C",data:[n,r,h,l,h,l]}),n=h,r=l):n===h&&r===l||(uv(n,r,h,l,t,i,s,o,a).forEach((function(t){e.push({key:"C",data:t})})),n=h,r=l);break}case"Z":e.push({key:"Z",data:[]}),n=s,r=o}i=l}return e}function dv(t,e,i){return[t*Math.cos(i)-e*Math.sin(i),t*Math.sin(i)+e*Math.cos(i)]}function uv(t,e,i,n,r,s,o,a,h,l){const c=(d=o,Math.PI*d/180);var d;let u=[],p=0,f=0,g=0,v=0;if(l)[p,f,g,v]=l;else{[t,e]=dv(t,e,-c),[i,n]=dv(i,n,-c);const o=(t-i)/2,l=(e-n)/2;let d=o*o/(r*r)+l*l/(s*s);d>1&&(d=Math.sqrt(d),r*=d,s*=d);const u=r*r,m=s*s,y=u*m-u*l*l-m*o*o,b=u*l*l+m*o*o,x=(a===h?-1:1)*Math.sqrt(Math.abs(y/b));g=x*r*l/s+(t+i)/2,v=x*-s*o/r+(e+n)/2,p=Math.asin(parseFloat(((e-v)/s).toFixed(9))),f=Math.asin(parseFloat(((n-v)/s).toFixed(9))),t<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),h&&p>f&&(p-=2*Math.PI),!h&&f>p&&(f-=2*Math.PI)}let m=f-p;if(Math.abs(m)>120*Math.PI/180){const t=f,e=i,a=n;f=h&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=uv(i=g+r*Math.cos(f),n=v+s*Math.sin(f),e,a,r,s,o,0,h,[f,t,g,v])}m=f-p;const y=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),A=Math.tan(m/4),S=4/3*r*A,T=4/3*s*A,B=[t,e],C=[t+S*b,e-T*y],_=[i+S*w,n-T*x],P=[i,n];if(C[0]=2*B[0]-C[0],C[1]=2*B[1]-C[1],l)return[C,_,P].concat(u);{u=[C,_,P].concat(u);const t=[];for(let e=0;e<u.length;e+=3){const i=dv(u[e][0],u[e][1],c),n=dv(u[e+1][0],u[e+1][1],c),r=dv(u[e+2][0],u[e+2][1],c);t.push([i[0],i[1],n[0],n[1],r[0],r[1]])}return t}}const pv={randOffset:function(t,e){return Sv(t,e)},randOffsetWithRange:function(t,e,i){return Av(t,e,i)},ellipse:function(t,e,i,n,r){return mv(t,e,r,vv(i,n,r)).opset},doubleLineOps:function(t,e,i,n,r){return Tv(t,e,i,n,r,!0)}};function fv(t,e,i,n,r){return{type:"path",ops:Tv(t,e,i,n,r)}}function gv(t,e,i){const n=(t||[]).length;if(n>2){const r=[];for(let e=0;e<n-1;e++)r.push(...Tv(t[e][0],t[e][1],t[e+1][0],t[e+1][1],i));return e&&r.push(...Tv(t[n-1][0],t[n-1][1],t[0][0],t[0][1],i)),{type:"path",ops:r}}return 2===n?fv(t[0][0],t[0][1],t[1][0],t[1][1],i):{type:"path",ops:[]}}function vv(t,e,i){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/r;let o=Math.abs(t/2),a=Math.abs(e/2);const h=1-i.curveFitting;return o+=Sv(o*h,i),a+=Sv(a*h,i),{increment:s,rx:o,ry:a}}function mv(t,e,i,n){const[r,s]=Pv(n.increment,t,e,n.rx,n.ry,1,n.increment*Av(.1,Av(.4,1,i),i),i);let o=_v(r,null,i);if(!i.disableMultiStroke&&0!==i.roughness){const[r]=Pv(n.increment,t,e,n.rx,n.ry,1.5,0,i),s=_v(r,null,i);o=o.concat(s)}return{estimatedPoints:s,opset:{type:"path",ops:o}}}function yv(t,e,i,n,r,s,o,a,h){const l=t,c=e;let d=Math.abs(i/2),u=Math.abs(n/2);d+=Sv(.01*d,h),u+=Sv(.01*u,h);let p=r,f=s;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/h.curveStepCount,v=Math.min(g/2,(f-p)/2),m=Rv(v,l,c,d,u,p,f,1,h);if(!h.disableMultiStroke){const t=Rv(v,l,c,d,u,p,f,1.5,h);m.push(...t)}return o&&(a?m.push(...Tv(l,c,l+d*Math.cos(p),c+u*Math.sin(p),h),...Tv(l,c,l+d*Math.cos(f),c+u*Math.sin(f),h)):m.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+d*Math.cos(p),c+u*Math.sin(p)]})),{type:"path",ops:m}}function bv(t,e){const i=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,r=n.length;if(r>2){i.push({op:"move",data:[n[0][0]+Sv(t,e),n[0][1]+Sv(t,e)]});for(let s=1;s<r;s++)i.push({op:"lineTo",data:[n[s][0]+Sv(t,e),n[s][1]+Sv(t,e)]})}}return{type:"fillPath",ops:i}}function xv(t,e){return function(t,e){let i=t.fillStyle||"hachure";if(!rv[i])switch(i){case"zigzag":rv[i]||(rv[i]=new Qg(e));break;case"cross-hatch":rv[i]||(rv[i]=new tv(e));break;case"dots":rv[i]||(rv[i]=new ev(e));break;case"dashed":rv[i]||(rv[i]=new iv(e));break;case"zigzag-line":rv[i]||(rv[i]=new nv(e));break;default:i="hachure",rv[i]||(rv[i]=new Jg(e))}return rv[i]}(e,pv).fillPolygons(t,e)}function wv(t){return t.randomizer||(t.randomizer=new sv(t.seed||0)),t.randomizer.next()}function Av(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return i.roughness*n*(wv(i)*(e-t)+t)}function Sv(t,e){return Av(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Tv(t,e,i,n,r){const s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,o=Bv(t,e,i,n,r,!0,!1);if(s)return o;const a=Bv(t,e,i,n,r,!0,!0);return o.concat(a)}function Bv(t,e,i,n,r,s,o){const a=Math.pow(t-i,2)+Math.pow(e-n,2),h=Math.sqrt(a);let l=1;l=h<200?1:h>500?.4:-.0016668*h+1.233334;let c=r.maxRandomnessOffset||0;c*c*100>a&&(c=h/10);const d=c/2,u=.2+.2*wv(r);let p=r.bowing*r.maxRandomnessOffset*(n-e)/200,f=r.bowing*r.maxRandomnessOffset*(t-i)/200;p=Sv(p,r,l),f=Sv(f,r,l);const g=[],v=()=>Sv(d,r,l),m=()=>Sv(c,r,l),y=r.preserveVertices;return s&&(o?g.push({op:"move",data:[t+(y?0:v()),e+(y?0:v())]}):g.push({op:"move",data:[t+(y?0:Sv(c,r,l)),e+(y?0:Sv(c,r,l))]})),o?g.push({op:"bcurveTo",data:[p+t+(i-t)*u+v(),f+e+(n-e)*u+v(),p+t+2*(i-t)*u+v(),f+e+2*(n-e)*u+v(),i+(y?0:v()),n+(y?0:v())]}):g.push({op:"bcurveTo",data:[p+t+(i-t)*u+m(),f+e+(n-e)*u+m(),p+t+2*(i-t)*u+m(),f+e+2*(n-e)*u+m(),i+(y?0:m()),n+(y?0:m())]}),g}function Cv(t,e,i){const n=[];n.push([t[0][0]+Sv(e,i),t[0][1]+Sv(e,i)]),n.push([t[0][0]+Sv(e,i),t[0][1]+Sv(e,i)]);for(let r=1;r<t.length;r++)n.push([t[r][0]+Sv(e,i),t[r][1]+Sv(e,i)]),r===t.length-1&&n.push([t[r][0]+Sv(e,i),t[r][1]+Sv(e,i)]);return _v(n,null,i)}function _v(t,e,i){const n=t.length,r=[];if(n>3){const s=[],o=1-i.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const i=t[e];s[0]=[i[0],i[1]],s[1]=[i[0]+(o*t[e+1][0]-o*t[e-1][0])/6,i[1]+(o*t[e+1][1]-o*t[e-1][1])/6],s[2]=[t[e+1][0]+(o*t[e][0]-o*t[e+2][0])/6,t[e+1][1]+(o*t[e][1]-o*t[e+2][1])/6],s[3]=[t[e+1][0],t[e+1][1]],r.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}if(e&&2===e.length){const t=i.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+Sv(t,i),e[1]+Sv(t,i)]})}}else 3===n?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&r.push(...Tv(t[0][0],t[0][1],t[1][0],t[1][1],i));return r}function Pv(t,e,i,n,r,s,o,a){const h=[],l=[];if(0===a.roughness){t/=4,l.push([e+n*Math.cos(-t),i+r*Math.sin(-t)]);for(let s=0;s<=2*Math.PI;s+=t){const t=[e+n*Math.cos(s),i+r*Math.sin(s)];h.push(t),l.push(t)}l.push([e+n*Math.cos(0),i+r*Math.sin(0)]),l.push([e+n*Math.cos(t),i+r*Math.sin(t)])}else{const c=Sv(.5,a)-Math.PI/2;l.push([Sv(s,a)+e+.9*n*Math.cos(c-t),Sv(s,a)+i+.9*r*Math.sin(c-t)]);const d=2*Math.PI+c-.01;for(let o=c;o<d;o+=t){const t=[Sv(s,a)+e+n*Math.cos(o),Sv(s,a)+i+r*Math.sin(o)];h.push(t),l.push(t)}l.push([Sv(s,a)+e+n*Math.cos(c+2*Math.PI+.5*o),Sv(s,a)+i+r*Math.sin(c+2*Math.PI+.5*o)]),l.push([Sv(s,a)+e+.98*n*Math.cos(c+o),Sv(s,a)+i+.98*r*Math.sin(c+o)]),l.push([Sv(s,a)+e+.9*n*Math.cos(c+.5*o),Sv(s,a)+i+.9*r*Math.sin(c+.5*o)])}return[l,h]}function Rv(t,e,i,n,r,s,o,a,h){const l=s+Sv(.1,h),c=[];c.push([Sv(a,h)+e+.9*n*Math.cos(l-t),Sv(a,h)+i+.9*r*Math.sin(l-t)]);for(let s=l;s<=o;s+=t)c.push([Sv(a,h)+e+n*Math.cos(s),Sv(a,h)+i+r*Math.sin(s)]);return c.push([e+n*Math.cos(o),i+r*Math.sin(o)]),c.push([e+n*Math.cos(o),i+r*Math.sin(o)]),_v(c,null,h)}function Mv(t,e,i,n,r,s,o,a){const h=[],l=[a.maxRandomnessOffset||1,(a.maxRandomnessOffset||1)+.3];let c=[0,0];const d=a.disableMultiStroke?1:2,u=a.preserveVertices;for(let p=0;p<d;p++)0===p?h.push({op:"move",data:[o[0],o[1]]}):h.push({op:"move",data:[o[0]+(u?0:Sv(l[0],a)),o[1]+(u?0:Sv(l[0],a))]}),c=u?[r,s]:[r+Sv(l[p],a),s+Sv(l[p],a)],h.push({op:"bcurveTo",data:[t+Sv(l[p],a),e+Sv(l[p],a),i+Sv(l[p],a),n+Sv(l[p],a),c[0],c[1]]});return h}function kv(t){return[...t]}function Ev(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function Ov(t,e,i){const n=Ev(e,i);if(0===n)return Ev(t,e);let r=((t[0]-e[0])*(i[0]-e[0])+(t[1]-e[1])*(i[1]-e[1]))/n;return r=Math.max(0,Math.min(1,r)),Ev(t,Lv(e,i,r))}function Lv(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function Iv(t,e,i,n){const r=n||[];if(function(t,e){const i=t[e+0],n=t[e+1],r=t[e+2],s=t[e+3];let o=3*n[0]-2*i[0]-s[0];o*=o;let a=3*n[1]-2*i[1]-s[1];a*=a;let h=3*r[0]-2*s[0]-i[0];h*=h;let l=3*r[1]-2*s[1]-i[1];return l*=l,o<h&&(o=h),a<l&&(a=l),o+a}(t,e)<i){const i=t[e+0];r.length?(s=r[r.length-1],o=i,Math.sqrt(Ev(s,o))>1&&r.push(i)):r.push(i),r.push(t[e+3])}else{const n=.5,s=t[e+0],o=t[e+1],a=t[e+2],h=t[e+3],l=Lv(s,o,n),c=Lv(o,a,n),d=Lv(a,h,n),u=Lv(l,c,n),p=Lv(c,d,n),f=Lv(u,p,n);Iv([s,l,u,f],0,i,r),Iv([f,p,d,h],0,i,r)}var s,o;return r}function Dv(t,e){return Wv(t,0,t.length,e)}function Wv(t,e,i,n,r){const s=r||[],o=t[e],a=t[i-1];let h=0,l=1;for(let n=e+1;n<i-1;++n){const e=Ov(t[n],o,a);e>h&&(h=e,l=n)}return Math.sqrt(h)>n?(Wv(t,e,l+1,n,s),Wv(t,l,i,n,s)):(s.length||s.push(o),s.push(a)),s}function jv(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,i=arguments.length>2?arguments[2]:void 0;const n=[],r=(t.length-1)/3;for(let i=0;i<r;i++)Iv(t,3*i,e,n);return i&&i>0?Wv(n,0,n.length,i):n}const Uv="none";class Nv{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,i){return{shape:t,sets:e||[],options:i||this.defaultOptions}}line(t,e,i,n,r){const s=this._o(r);return this._d("line",[fv(t,e,i,n,s)],s)}rectangle(t,e,i,n,r){const s=this._o(r),o=[],a=function(t,e,i,n,r){return function(t,e){return gv(t,!0,e)}([[t,e],[t+i,e],[t+i,e+n],[t,e+n]],r)}(t,e,i,n,s);if(s.fill){const r=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]];"solid"===s.fillStyle?o.push(bv([r],s)):o.push(xv([r],s))}return s.stroke!==Uv&&o.push(a),this._d("rectangle",o,s)}ellipse(t,e,i,n,r){const s=this._o(r),o=[],a=vv(i,n,s),h=mv(t,e,s,a);if(s.fill)if("solid"===s.fillStyle){const i=mv(t,e,s,a).opset;i.type="fillPath",o.push(i)}else o.push(xv([h.estimatedPoints],s));return s.stroke!==Uv&&o.push(h.opset),this._d("ellipse",o,s)}circle(t,e,i,n){const r=this.ellipse(t,e,i,i,n);return r.shape="circle",r}linearPath(t,e){const i=this._o(e);return this._d("linearPath",[gv(t,!1,i)],i)}arc(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7?arguments[7]:void 0;const h=this._o(a),l=[],c=yv(t,e,i,n,r,s,o,!0,h);if(o&&h.fill)if("solid"===h.fillStyle){const o=Object.assign({},h);o.disableMultiStroke=!0;const a=yv(t,e,i,n,r,s,!0,!1,o);a.type="fillPath",l.push(a)}else l.push(function(t,e,i,n,r,s,o){const a=t,h=e;let l=Math.abs(i/2),c=Math.abs(n/2);l+=Sv(.01*l,o),c+=Sv(.01*c,o);let d=r,u=s;for(;d<0;)d+=2*Math.PI,u+=2*Math.PI;u-d>2*Math.PI&&(d=0,u=2*Math.PI);const p=(u-d)/o.curveStepCount,f=[];for(let t=d;t<=u;t+=p)f.push([a+l*Math.cos(t),h+c*Math.sin(t)]);return f.push([a+l*Math.cos(u),h+c*Math.sin(u)]),f.push([a,h]),xv([f],o)}(t,e,i,n,r,s,h));return h.stroke!==Uv&&l.push(c),this._d("arc",l,h)}curve(t,e){const i=this._o(e),n=[],r=function(t,e){let i=Cv(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){const n=Cv(t,1.5*(1+.22*e.roughness),function(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));i=i.concat(n)}return{type:"path",ops:i}}(t,i);if(i.fill&&i.fill!==Uv&&t.length>=3){const e=jv(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=t.length;if(i<3)throw new Error("A curve must have at least three points.");const n=[];if(3===i)n.push(kv(t[0]),kv(t[1]),kv(t[2]),kv(t[2]));else{const i=[];i.push(t[0],t[0]);for(let e=1;e<t.length;e++)i.push(t[e]),e===t.length-1&&i.push(t[e]);const r=[],s=1-e;n.push(kv(i[0]));for(let t=1;t+2<i.length;t++){const e=i[t];r[0]=[e[0],e[1]],r[1]=[e[0]+(s*i[t+1][0]-s*i[t-1][0])/6,e[1]+(s*i[t+1][1]-s*i[t-1][1])/6],r[2]=[i[t+1][0]+(s*i[t][0]-s*i[t+2][0])/6,i[t+1][1]+(s*i[t][1]-s*i[t+2][1])/6],r[3]=[i[t+1][0],i[t+1][1]],n.push(r[1],r[2],r[3])}}return n}(t),10,(1+i.roughness)/2);"solid"===i.fillStyle?n.push(bv([e],i)):n.push(xv([e],i))}return i.stroke!==Uv&&n.push(r),this._d("curve",n,i)}polygon(t,e){const i=this._o(e),n=[],r=gv(t,!0,i);return i.fill&&("solid"===i.fillStyle?n.push(bv([t],i)):n.push(xv([t],i))),i.stroke!==Uv&&n.push(r),this._d("polygon",n,i)}path(t,e){const i=this._o(e),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=i.fill&&"transparent"!==i.fill&&i.fill!==Uv,s=i.stroke!==Uv,o=!!(i.simplification&&i.simplification<1),a=function(t,e,i){const n=cv(lv(hv(t))),r=[];let s=[],o=[0,0],a=[];const h=()=>{a.length>=4&&s.push(...jv(a,1)),a=[]},l=()=>{h(),s.length&&(r.push(s),s=[])};for(const{key:t,data:e}of n)switch(t){case"M":l(),o=[e[0],e[1]],s.push(o);break;case"L":h(),s.push([e[0],e[1]]);break;case"C":if(!a.length){const t=s.length?s[s.length-1]:o;a.push([t[0],t[1]])}a.push([e[0],e[1]]),a.push([e[2],e[3]]),a.push([e[4],e[5]]);break;case"Z":h(),s.push([o[0],o[1]])}if(l(),!i)return r;const c=[];for(const t of r){const e=Dv(t,i);e.length&&c.push(e)}return c}(t,0,o?4-4*i.simplification:(1+i.roughness)/2);return r&&("solid"===i.fillStyle?n.push(bv(a,i)):n.push(xv(a,i))),s&&(o?a.forEach((t=>{n.push(gv(t,!1,i))})):n.push(function(t,e){const i=cv(lv(hv(t))),n=[];let r=[0,0],s=[0,0];for(const{key:t,data:o}of i)switch(t){case"M":{const t=1*(e.maxRandomnessOffset||0),i=e.preserveVertices;n.push({op:"move",data:o.map((n=>n+(i?0:Sv(t,e))))}),s=[o[0],o[1]],r=[o[0],o[1]];break}case"L":n.push(...Tv(s[0],s[1],o[0],o[1],e)),s=[o[0],o[1]];break;case"C":{const[t,i,r,a,h,l]=o;n.push(...Mv(t,i,r,a,h,l,s,e)),s=[h,l];break}case"Z":n.push(...Tv(s[0],s[1],r[0],r[1],e)),s=[r[0],r[1]]}return{type:"path",ops:n}}(t,i))),this._d("path",n,i)}opsToPath(t,e){let i="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":i+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":i+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":i+=`L${t[0]} ${t[1]} `}}return i.trim()}toPaths(t){const e=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:Uv};break;case"fillPath":e={d:this.opsToPath(t),stroke:Uv,strokeWidth:0,fill:i.fill||Uv};break;case"fillSketch":e=this.fillSketch(t,i)}e&&n.push(e)}return n}fillSketch(t,e){let i=e.fillWeight;return i<0&&(i=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||Uv,strokeWidth:i,fill:Uv}}}class Fv{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Nv(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of e)switch(s.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,s,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,s,r,e),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,e,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();for(const n of e.ops){const e="number"==typeof i&&i>=0?n.data.map((t=>+t.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,i,n,r){const s=this.gen.line(t,e,i,n,r);return this.draw(s),s}rectangle(t,e,i,n,r){const s=this.gen.rectangle(t,e,i,n,r);return this.draw(s),s}ellipse(t,e,i,n,r){const s=this.gen.ellipse(t,e,i,n,r);return this.draw(s),s}circle(t,e,i,n){const r=this.gen.circle(t,e,i,n);return this.draw(r),r}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i),i}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i),i}arc(t,e,i,n,r,s){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7?arguments[7]:void 0;const h=this.gen.arc(t,e,i,n,r,s,o,a);return this.draw(h),h}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i),i}path(t,e){const i=this.gen.path(t,e);return this.draw(i),i}}var Gv=(t,e)=>new Fv(t,e);const zv={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};var Hv=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Vv=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yv=function(t,e){return function(i,n){e(i,n,t)}};let Xv=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type",void 0),i(this,"numberType",void 0),i(this,"style","rough"),this.canvasRenderer=t,this.type="arc",this.numberType=No}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=Gv(s);r.highPerformanceSave();const a=mr(t).arc;let{x:h=a.x,y:l=a.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=a.dx,dy:i=a.dy}=t.attribute;h+=e,l+=i,r.setTransformForCurrent()}else h=0,l=0,r.transformFromMatrix(t.transMatrix,!0);const c=new Ri,{fill:d=a.fill,stroke:u=a.stroke,lineWidth:p=a.lineWidth,outerRadius:f=a.outerRadius,innerRadius:g=a.innerRadius,maxRandomnessOffset:v=zv.maxRandomnessOffset,roughness:m=zv.roughness,bowing:y=zv.bowing,curveFitting:b=zv.curveFitting,curveTightness:x=zv.curveTightness,curveStepCount:w=zv.curveStepCount,fillStyle:A=zv.fillStyle,fillWeight:S=zv.fillWeight,hachureAngle:T=zv.hachureAngle,hachureGap:B=zv.hachureGap,simplification:C=zv.simplification,dashOffset:_=zv.dashOffset,dashGap:P=zv.dashGap,zigzagOffset:R=zv.zigzagOffset,seed:M=zv.seed,fillLineDash:k=zv.fillLineDash,fillLineDashOffset:E=zv.fillLineDashOffset,disableMultiStroke:O=zv.disableMultiStroke,disableMultiStrokeFill:L=zv.disableMultiStrokeFill,preserveVertices:I=zv.preserveVertices,fixedDecimalPlaceDigits:D=zv.fixedDecimalPlaceDigits}=t.attribute;Ea(t,c,h,l,f,g),o.path(c.toString(),{fill:d||void 0,stroke:u||void 0,strokeWidth:p,maxRandomnessOffset:v,roughness:m,bowing:y,curveFitting:b,curveTightness:x,curveStepCount:w,fillStyle:A,fillWeight:S,hachureAngle:T,hachureGap:B,simplification:C,dashOffset:_,dashGap:P,zigzagOffset:R,seed:M,fillLineDash:k,fillLineDashOffset:E,disableMultiStroke:O,disableMultiStrokeFill:L,preserveVertices:I,fixedDecimalPlaceDigits:D}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};Xv=Hv([m(),Yv(0,g(t.DefaultCanvasArcRender)),Vv("design:paramtypes",[Object])],Xv);var $v=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Kv=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),i(this,"style","rough")}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f){if(f)return super.drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=Gv(g,{}),m=new Ri;xd(m,e,h,{offsetX:l,offsetY:c});const{maxRandomnessOffset:y=zv.maxRandomnessOffset,roughness:b=zv.roughness,bowing:x=zv.bowing,curveFitting:w=zv.curveFitting,curveTightness:A=zv.curveTightness,curveStepCount:S=zv.curveStepCount,fillStyle:T=zv.fillStyle,fillWeight:B=zv.fillWeight,hachureAngle:C=zv.hachureAngle,hachureGap:_=zv.hachureGap,simplification:P=zv.simplification,dashOffset:R=zv.dashOffset,dashGap:M=zv.dashGap,zigzagOffset:k=zv.zigzagOffset,seed:E=zv.seed,fillLineDash:O=zv.fillLineDash,fillLineDashOffset:L=zv.fillLineDashOffset,disableMultiStroke:I=zv.disableMultiStroke,disableMultiStrokeFill:D=zv.disableMultiStrokeFill,preserveVertices:W=zv.preserveVertices,fixedDecimalPlaceDigits:j=zv.fixedDecimalPlaceDigits}=o;let{fill:U,stroke:N,lineWidth:F}=o;return Array.isArray(a)?a.forEach((t=>{U=U??t.fill,N=N??t.stroke,F=F??t.lineWidth})):(U=U??a.fill,N=N??a.stroke,F=F??a.lineWidth),v.path(m.toString(),{fill:i?U:void 0,strokeWidth:F,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:A,curveStepCount:S,fillStyle:T,fillWeight:B,hachureAngle:C,hachureGap:_,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:k,seed:E,fillLineDash:O,fillLineDashOffset:L,disableMultiStroke:I,disableMultiStrokeFill:D,preserveVertices:W,fixedDecimalPlaceDigits:j}),t.highPerformanceRestore(),!1}};Kv=$v([m()],Kv);var qv=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zv=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jv=function(t,e){return function(i,n){e(i,n,t)}};let Qv=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"style","rough"),this.canvasRenderer=t,this.type="circle",this.numberType=zo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=Gv(s,{}),a=mr(t).circle;let{x:h=a.x,y:l=a.y}=t.attribute;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(h=0,l=0,r.transformFromMatrix(t.transMatrix,!0));const{radius:c=a.radius,fill:d=a.fill,stroke:u=a.stroke,lineWidth:p=a.lineWidth}=t.attribute;o.circle(h,l,c,{fill:d||void 0,stroke:u||void 0,strokeWidth:p,fillStyle:"zigzag",roughness:.5})}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};Qv=qv([m(),Jv(0,g(t.DefaultCanvasCircleRender)),Zv("design:paramtypes",[Object])],Qv);var tm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let em=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),i(this,"style","rough")}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f){if(p||f)return super.drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,d,u,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=Gv(g,{}),m=new Ri;vd(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:d});const{maxRandomnessOffset:y=zv.maxRandomnessOffset,roughness:b=zv.roughness,bowing:x=zv.bowing,curveFitting:w=zv.curveFitting,curveTightness:A=zv.curveTightness,curveStepCount:S=zv.curveStepCount,fillStyle:T=zv.fillStyle,fillWeight:B=zv.fillWeight,hachureAngle:C=zv.hachureAngle,hachureGap:_=zv.hachureGap,simplification:P=zv.simplification,dashOffset:R=zv.dashOffset,dashGap:M=zv.dashGap,zigzagOffset:k=zv.zigzagOffset,seed:E=zv.seed,fillLineDash:O=zv.fillLineDash,fillLineDashOffset:L=zv.fillLineDashOffset,disableMultiStroke:I=zv.disableMultiStroke,disableMultiStrokeFill:D=zv.disableMultiStrokeFill,preserveVertices:W=zv.preserveVertices,fixedDecimalPlaceDigits:j=zv.fixedDecimalPlaceDigits}=o;let{fill:U,stroke:N,lineWidth:F}=o;return Array.isArray(a)?a.forEach((t=>{U=U??t.fill,N=N??t.stroke,F=F??t.lineWidth})):(U=U??a.fill,N=N??a.stroke,F=F??a.lineWidth),v.path(m.toString(),{fill:i?U:void 0,stroke:n?N:void 0,strokeWidth:F,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:A,curveStepCount:S,fillStyle:T,fillWeight:B,hachureAngle:C,hachureGap:_,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:k,seed:E,fillLineDash:O,fillLineDashOffset:L,disableMultiStroke:I,disableMultiStrokeFill:D,preserveVertices:W,fixedDecimalPlaceDigits:j}),t.highPerformanceRestore(),!1}};em=tm([m()],em);var im=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},nm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rm=function(t,e){return function(i,n){e(i,n,t)}};let sm=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type",void 0),i(this,"numberType",void 0),i(this,"style","rough"),this.canvasRenderer=t,this.type="path",this.numberType=$o}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=Gv(s,{});r.highPerformanceSave();const a=mr(t).path;r.transformFromMatrix(t.transMatrix,!0);const{fill:h=a.fill,stroke:l=a.stroke,lineWidth:c=a.lineWidth,path:d=a.path,maxRandomnessOffset:u=zv.maxRandomnessOffset,roughness:p=zv.roughness,bowing:f=zv.bowing,curveFitting:g=zv.curveFitting,curveTightness:v=zv.curveTightness,curveStepCount:m=zv.curveStepCount,fillStyle:y=zv.fillStyle,fillWeight:b=zv.fillWeight,hachureAngle:x=zv.hachureAngle,hachureGap:w=zv.hachureGap,simplification:A=zv.simplification,dashOffset:S=zv.dashOffset,dashGap:T=zv.dashGap,zigzagOffset:B=zv.zigzagOffset,seed:C=zv.seed,fillLineDash:_=zv.fillLineDash,fillLineDashOffset:P=zv.fillLineDashOffset,disableMultiStroke:R=zv.disableMultiStroke,disableMultiStrokeFill:M=zv.disableMultiStrokeFill,preserveVertices:k=zv.preserveVertices,fixedDecimalPlaceDigits:E=zv.fixedDecimalPlaceDigits}=t.attribute;"string"==typeof d&&o.path(d,{fill:h||void 0,stroke:l||void 0,strokeWidth:c,maxRandomnessOffset:u,roughness:p,bowing:f,curveFitting:g,curveTightness:v,curveStepCount:m,fillStyle:y,fillWeight:b,hachureAngle:x,hachureGap:w,simplification:A,dashOffset:S,dashGap:T,zigzagOffset:B,seed:C,fillLineDash:_,fillLineDashOffset:P,disableMultiStroke:R,disableMultiStrokeFill:M,preserveVertices:k,fixedDecimalPlaceDigits:E}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};sm=im([m(),rm(0,g(t.DefaultCanvasPathRender)),nm("design:paramtypes",[Object])],sm);var om=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},am=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hm=function(t,e){return function(i,n){e(i,n,t)}};let lm=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type",void 0),i(this,"numberType",void 0),i(this,"style","rough"),this.canvasRenderer=t,this.type="rect",this.numberType=Zo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=Gv(s);r.highPerformanceSave();const a=mr(t).rect;let{x:h=a.x,y:l=a.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=a.dx,dy:i=a.dy}=t.attribute;h+=e,l+=i,r.setTransformForCurrent()}else h=0,l=0,r.transformFromMatrix(t.transMatrix,!0);const{fill:c=a.fill,stroke:d=a.stroke,fillColor:u=a.fill,strokeColor:p=a.stroke,x1:f,y1:g,lineWidth:v=a.lineWidth,maxRandomnessOffset:m=zv.maxRandomnessOffset,roughness:y=zv.roughness,bowing:b=zv.bowing,curveFitting:x=zv.curveFitting,curveTightness:w=zv.curveTightness,curveStepCount:A=zv.curveStepCount,fillStyle:S=zv.fillStyle,fillWeight:T=zv.fillWeight,hachureAngle:B=zv.hachureAngle,hachureGap:C=zv.hachureGap,simplification:_=zv.simplification,dashOffset:P=zv.dashOffset,dashGap:R=zv.dashGap,zigzagOffset:M=zv.zigzagOffset,seed:k=zv.seed,fillLineDash:E=zv.fillLineDash,fillLineDashOffset:O=zv.fillLineDashOffset,disableMultiStroke:L=zv.disableMultiStroke,disableMultiStrokeFill:I=zv.disableMultiStrokeFill,preserveVertices:D=zv.preserveVertices,fixedDecimalPlaceDigits:W=zv.fixedDecimalPlaceDigits}=t.attribute;let{width:j=a.width,height:U=a.height}=t.attribute;j=(j??f-h)||0,U=(U??g-l)||0,o.rectangle(h,l,j,U,{fill:c?u:void 0,stroke:d?p:void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:y,bowing:b,curveFitting:x,curveTightness:w,curveStepCount:A,fillStyle:S,fillWeight:T,hachureAngle:B,hachureGap:C,simplification:_,dashOffset:P,dashGap:R,zigzagOffset:M,seed:k,fillLineDash:E,fillLineDashOffset:O,disableMultiStroke:L,disableMultiStrokeFill:I,preserveVertices:D,fixedDecimalPlaceDigits:W}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};lm=om([m(),hm(0,g(t.DefaultCanvasRectRender)),am("design:paramtypes",[Object])],lm);var cm=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},um=function(t,e){return function(i,n){e(i,n,t)}};let pm=class extends _c{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type",void 0),i(this,"numberType",void 0),i(this,"style",void 0),this.canvasRenderer=t,this.type="symbol",this.numberType=ta,this.style="rough"}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,o=Gv(s);r.highPerformanceSave();const a=mr(t).symbol,h=this.transform(t,a,r),{x:l,y:c,z:d,lastModelMatrix:u}=h,p=t.getParsedPath();if(!p)return;const{fill:f=a.fill,stroke:g=a.stroke,fillColor:v=a.fill,strokeColor:m=a.stroke,size:y=a.size,lineWidth:b=a.lineWidth,maxRandomnessOffset:x=zv.maxRandomnessOffset,roughness:w=zv.roughness,bowing:A=zv.bowing,curveFitting:S=zv.curveFitting,curveTightness:T=zv.curveTightness,curveStepCount:B=zv.curveStepCount,fillStyle:C=zv.fillStyle,fillWeight:_=zv.fillWeight,hachureAngle:P=zv.hachureAngle,hachureGap:R=zv.hachureGap,simplification:M=zv.simplification,dashOffset:k=zv.dashOffset,dashGap:E=zv.dashGap,zigzagOffset:O=zv.zigzagOffset,seed:L=zv.seed,fillLineDash:I=zv.fillLineDash,fillLineDashOffset:D=zv.fillLineDashOffset,disableMultiStroke:W=zv.disableMultiStroke,disableMultiStrokeFill:j=zv.disableMultiStrokeFill,preserveVertices:U=zv.preserveVertices,fixedDecimalPlaceDigits:N=zv.fixedDecimalPlaceDigits}=t.attribute;let F="";if(p.drawToSvgPath)F=p.drawToSvgPath(y,l,c);else{const t=new Ri;p.draw(t,y,l,c)&&t.closePath(),F=t.toString()}o.path(F,{fill:f?v:void 0,stroke:g?m:void 0,strokeWidth:b,maxRandomnessOffset:x,roughness:w,bowing:A,curveFitting:S,curveTightness:T,curveStepCount:B,fillStyle:C,fillWeight:_,hachureAngle:P,hachureGap:R,simplification:M,dashOffset:k,dashGap:E,zigzagOffset:O,seed:L,fillLineDash:I,fillLineDashOffset:D,disableMultiStroke:W,disableMultiStrokeFill:j,preserveVertices:U,fixedDecimalPlaceDigits:N}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,o,a){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,o,a)}};pm=cm([m(),um(0,g(t.DefaultCanvasSymbolRender)),dm("design:paramtypes",[Object])],pm);var fm=new r((t=>{t(Qv).toSelf().inSingletonScope(),t(lu).to(Qv),t(lm).toSelf().inSingletonScope(),t(lu).to(lm),t(sm).toSelf().inSingletonScope(),t(lu).to(sm),t(pm).toSelf().inSingletonScope(),t(lu).to(pm),t(em).toSelf().inSingletonScope(),t(lu).to(em),t(Kv).toSelf().inSingletonScope(),t(lu).to(Kv),t(Xv).toSelf().inSingletonScope(),t(lu).to(Xv)}));const gm=Symbol.for("MathPickerContribution"),vm=Symbol.for("MathArcPicker"),mm=Symbol.for("MathAreaPicker"),ym=Symbol.for("MathCirclePicker"),bm=Symbol.for("MathImagePicker"),xm=Symbol.for("MathLinePicker"),wm=Symbol.for("MathPathPicker"),Am=Symbol.for("MathRectPicker"),Sm=Symbol.for("MathSymbolPicker"),Tm=Symbol.for("MathTextPicker"),Bm=Symbol.for("MathPolygonPicker"),Cm=Symbol.for("MathGlyphPicker"),_m=Symbol.for("CanvasArcPicker"),Pm=Symbol.for("CanvasArc3dPicker"),Rm=Symbol.for("CanvasAreaPicker"),Mm=Symbol.for("CanvasCirclePicker"),km=Symbol.for("CanvasImagePicker"),Em=Symbol.for("CanvasLinePicker"),Om=Symbol.for("CanvasPathPicker"),Lm=Symbol.for("CanvasRectPicker"),Im=Symbol.for("CanvasRect3dPicker"),Dm=Symbol.for("CanvasSymbolPicker"),Wm=Symbol.for("CanvasTextPicker"),jm=Symbol.for("CanvasPolygonPicker"),Um=Symbol.for("CanvasPyramid3dPicker"),Nm=Symbol.for("CanvasRichTextPicker"),Fm=Symbol.for("CanvasGlyphPicker"),Gm=Symbol.for("CanvasGroupPicker"),zm=Symbol.for("CanvasPickerContribution"),Hm={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},Vm=Object.keys(Hm);function Ym(t){return Ac.richtext(t?t.attribute:{})}function Xm(t,e){if(nt(t))return t.forEach((t=>Xm(t,e)));e.push(t)}Ym.Text=function(t){return{type:"rich/text",...t}},Ym.Image=function(t){return{type:"rich/image",...t}};const $m=la;function Km(t){if(!t||!t.$$typeof)return t;const e=t.type,{attribute:i,children:n,stateProxy:r,id:s,name:o}=t.props,a=e({attribute:i}),h=function(t,e,i){let n,r=!1;switch(t.type){case"richtext":break;case"rich/text":n=t.attribute||{},i&&(n.text=i),t.attribute=n;break;case"rich/image":n=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((i=>{const n=Hm[i];n&&t.on(n,e[i])})):"richtext"===t.type&&(t.attribute.textConfig=i.map((t=>Km(t))).filter((t=>t))),n}(a,t.props,n);return h||(r&&(a.stateProxy=r),a.id=s,a.name=o,qm(n,a),a)}function qm(t,e){nt(t)?t.forEach((t=>{if(nt(t))qm(t,e);else{const i=Km(t);i&&i.type&&e.add(i)}})):t&&e.add(Km(t))}const Zm=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},Jm=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};var Qm,ty=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ey=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const iy=[0,0,0];let ny=(Qm=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){i(this,"baseGlobalAlpha",void 0),i(this,"drawPromise",void 0),i(this,"modelMatrix",void 0),i(this,"matrix",void 0),i(this,"applyedMatrix",void 0),i(this,"dpr",void 0),i(this,"fillAttributes",{...Li,opacity:1}),i(this,"strokeAttributes",{...Di,opacity:1}),i(this,"textAttributes",{...Wi,opacity:1}),i(this,"_clearShadowStyle",!1),i(this,"_clearFilterStyle",!1),i(this,"_clearGlobalCompositeOperationStyle",!1);const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new Nt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Nt(1,0,0,1,0,0),this._clearMatrix=new Nt(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&ve.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Nt(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return cc.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(cc.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(cc.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,o){if(o=o||0,this.camera){const a=[];((t,e,i,n,r,s,o,a)=>{if(a)for(;i>e;)i-=bt;else for(;i<e;)i+=bt;const h=vt/3*(i>e?1:-1);let l=e,c=l;for(;c!==i;){c=h>0?Math.min(c+h,i):Math.max(c+h,i);const e=Math.abs(c-l),a=4*Math.tan(e/4)/3,d=c<l?-1:1,u=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=u*s+n,m=p*o+r,y=f*s+n,b=g*o+r,x=s*a*d,w=o*a*d;t.push([v-x*p,m+w*u,y+x*g,b-w*f,y,b]),l=c}})(a,n,r,t,e,i,i,s);for(let t=0;t<a.length;++t){const e=a[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],o)}}else this.nativeContext.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,o){if(o=o||0,this.camera){let a=o,h=o;this.modelMatrix&&(Zp(iy,[t,e,o],this.modelMatrix),t=iy[0],e=iy[1],a=iy[2],Zp(iy,[i,n,o],this.modelMatrix),i=iy[0],n=iy[1],h=iy[2],Zp(iy,[r,s,o],this.modelMatrix),r=iy[0],s=iy[1],o=iy[2]);let l=this.camera.vp(r,s,o);r=l.x,s=l.y,l=this.camera.vp(t,e,a),t=l.x,e=l.y,l=this.camera.vp(i,n,h),i=l.x,n=l.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,i,n,r,s,o):this.nativeContext.ellipse(t,e,i,n,r,s,o,a)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Zp(iy,[t,e,i],this.modelMatrix),t=iy[0],e=iy[1],i=iy[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Zp(iy,[t,e,i],this.modelMatrix),t=iy[0],e=iy[1],i=iy[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(Zp(iy,[t,e,r],this.modelMatrix),t=iy[0],e=iy[1],s=iy[2],Zp(iy,[i,n,r],this.modelMatrix),i=iy[0],n=iy[1],r=iy[2]);let o=this.camera.vp(i,n,r);i=o.x,n=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,h,l){return s&&(l||(l=n-i),r=Wa(o,this.stops,t,e,l,i,n,a,h),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Zp(iy,[t,e,i],this.modelMatrix),t=iy[0],e=iy[1],i=iy[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Zp(iy,[t,e,i],this.modelMatrix),t=iy[0],e=iy[1],i=iy[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(Zp(iy,[e,i,n],this.modelMatrix),e=iy[0],i=iy[1],n=iy[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on.global.measureTextMethod;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=on.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const i=this.fontFamily??Wi.fontFamily,n=this.fontSize??Wi.fontSize;return this.mathTextMeasure.textSpec.fontFamily===i&&this.mathTextMeasure.textSpec.fontSize===n||(this.mathTextMeasure.textSpec.fontFamily=i,this.mathTextMeasure.textSpec.fontSize=n,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(Zp(iy,[e,i,n],this.modelMatrix),e=iy[0],i=iy[1],n=iy[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:h=r.fill}=e;o>1e-12&&a>1e-12?(s.globalAlpha=o*a*this.baseGlobalAlpha,s.fillStyle=kc(this,h,t,i,n)):s.globalAlpha=o*a*this.baseGlobalAlpha}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const n=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(n,t)})),this._setShadowBlendStyle(t,e,n)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:o=i.shadowColor,shadowOffsetX:a=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:l=i.blur,globalCompositeOperation:c=i.globalCompositeOperation}=e;r<=1e-12||(s||a||h?(n.shadowBlur=s*this.dpr,n.shadowColor=o,n.shadowOffsetX=a*this.dpr,n.shadowOffsetY=h*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),l?(n.filter=`blur(${l}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1),c?(n.globalCompositeOperation=c,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(n.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:d=r.lineDash,lineCap:u=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Mc(this,h,this.dpr),s.strokeStyle=kc(this,l,t,i,n),s.lineJoin=c,d&&s.setLineDash(d),s.lineCap=u,s.miterLimit=p}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=Qa(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=Qa(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:s=e.fontSize}=t;this.fontFamily=r,this.fontSize=s,n.textAlign=t.textAlign??e.textAlign,n.textBaseline=t.textBaseline??e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>cc.free(t))),this.stack.length=0}},i(Qm,"env","browser"),Qm);var ry;ny=ty([m(),ey("design:paramtypes",[Object,Number])],ny);var sy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},oy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ay=(ry=class extends t.BaseCanvas{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=on.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new ny(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:o}=this;o.width=e*n,o.height=i*n,!o.style||this.setCanvasStyle(o,r,s,e,i),t.id&&(o.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.width=`${n}px`,t.style.height=`${r}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}},i(ry,"env","browser"),ry);function hy(t,e){return new r((i=>{i(wn).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(An).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}ay=sy([m(),oy("design:paramtypes",[Object])],ay);const ly=hy(ay,ny);var cy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uy=function(t,e){return function(i,n){e(i,n,t)}};let py=class extends t.DefaultPickService{constructor(t,e,n){super(n),i(this,"contributions",void 0),i(this,"drawContribution",void 0),i(this,"pickItemInterceptorContributions",void 0),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=n,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=tr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),o=s?t:null,a={graphic:o,params:s};if(o)return a;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return a}};py=cy([m(),uy(0,g(L)),uy(0,y(zm)),uy(1,g(Su)),uy(2,g(L)),uy(2,y(zu)),dy("design:paramtypes",[Object,Object,Object])],py);var fy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let gy=class{constructor(){i(this,"type","group"),i(this,"numberType",Vo)}contains(t,e,i){return!1}};gy=fy([m()],gy);const vy=new r(((t,e,i,n)=>{vy.__vloaded||(vy.__vloaded=!0,t(Gm).to(gy).inSingletonScope(),t(zm).toService(Gm),D(t,zm))}));vy.__vloaded=!1;var my=vy;const yy=new r(((t,e,i,n)=>{i(py)||t(py).toSelf().inSingletonScope(),i(Uu)?n(Uu).toService(py):t(Uu).toService(py)}));function by(t){t.load(my),t.load(yy)}var xy,wy,Ay=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Sy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ty=(xy=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${wy.idprefix}_${wy.prefix_count++}`}constructor(){super(),i(this,"type","browser"),i(this,"_canvasIsIntersecting",void 0),i(this,"_onVisibleChangeCb",void 0),i(this,"global",void 0),this._canvasIsIntersecting=!0,this.global=on.global,this.viewBox=new Wt,this.modelMatrix=new Nt(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:wy.GenerateCanvasId(),canvasControled:!0};this.canvas=new ay(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;if(!e)throw new Error("发生错误,传入的canvas不正确");let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.getContext("2d").pixelRatio??e.width/i),this.canvas=new ay({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){return this.canvas.nativeCanvas.style??{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}},i(xy,"env","browser"),i(xy,"idprefix","visactor_window"),i(xy,"prefix_count",0),wy=xy);Ty=wy=Ay([m(),Sy("design:paramtypes",[])],Ty);const By=new r((t=>{t(Ty).toSelf(),t(rr).toDynamicValue((t=>t.container.get(Ty))).whenTargetNamed(Ty.env)}));var Cy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},_y=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class Py{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){i(this,"dom",void 0),this.dom=t}}function Ry(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let My=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","browser"),i(this,"supportEvent",!0);try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){let i=0,n=0,r=0,s=0;if(t.changedTouches){const e=t.changedTouches[0]??{};i=e.clientX||0,n=e.clientY||0,r=i,s=n}else i=t.clientX||0,n=t.clientY||0,r=t.offsetX||0,s=t.offsetY||0;if(e){const t=i,r=n,s=e.getBoundingClientRect(),o=e.getNativeHandler?.().nativeCanvas;let a,h;return o&&(a=s.width/o.offsetWidth,h=s.height/o.offsetHeight),{x:(t-s.left)/(st(a)?a:1),y:(r-s.top)/(st(h)?h:1)}}return{x:r,y:s}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Py(t)}return new Wt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:n,style:r}=e;return r&&(it(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=i&&(t.style.width=`${i}px`),null!=n&&(t.style.height=`${n}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,n=document.createElement(e);if(this.updateDom(n,t),i){const t=it(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(n)}return n}loadImage(t){return Ry(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Ry(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){const e=document.createElement("canvas");t.id&&(e.id=t.id??n.GenAutoIncrementId().toString());const i=t.dpr??window.devicePixelRatio;return t.width&&t.height&&(e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,e.width=t.width*i,e.height=t.height*i),e}createOffscreenCanvas(t){const e=t.dpr??window.devicePixelRatio;return new OffscreenCanvas(t.width*e,t.height*e)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}};My=Cy([m(),_y("design:paramtypes",[])],My);const ky=new r((t=>{ky.isBrowserBound||(ky.isBrowserBound=!0,t(My).toSelf().inSingletonScope(),t(N).toService(My))}));function Ey(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Ey.__loaded||(Ey.__loaded=!0,t.load(ky),t.load(ly),t.load(By),e&&by(t))}var Oy;ky.isBrowserBound=!1,Ey.__loaded=!1;var Ly=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Iy=(Oy=class extends ny{constructor(){super(...arguments),i(this,"_globalAlpha",void 0)}get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}getImageData(t,e,i,n){return new Promise(((r,s)=>{try{tt.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id??this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}createPattern(t,e){return null}},i(Oy,"env","feishu"),Oy);var Dy;Iy=Ly([m()],Iy);var Wy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},jy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Uy=(i(Dy=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Iy(this,this._dpr)}release(){}},"env","feishu"),Dy);Uy=Wy([m(),jy("design:paramtypes",[Object])],Uy);const Ny=hy(Uy,Iy);var Fy,Gy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hy=function(t,e){return function(i,n){e(i,n,t)}};let Vy=(Fy=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","feishu"),i(this,"eventManager",new class{constructor(){i(this,"cache",{})}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}),i(this,"canvas",void 0),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Uy(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Uy({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},i(Fy,"env","feishu"),Fy);Vy=Gy([m(),Hy(0,g(F)),zy("design:paramtypes",[Object])],Vy);const Yy=new r((t=>{t(Vy).toSelf(),t(rr).toDynamicValue((t=>t.container.get(Vy))).whenTargetNamed(Vy.env)}));var Xy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$y=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ky=function(t,e){return function(i,n){e(i,n,t)}};let qy=class extends t.DefaultPickService{constructor(t,e){super(e),i(this,"contributions",void 0),i(this,"pickItemInterceptorContributions",void 0),this.contributions=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),o=s?t:null;return o?{graphic:o,params:s}:null}};qy=Xy([m(),Ky(0,g(L)),Ky(0,y(gm)),Ky(1,g(L)),Ky(1,y(zu)),$y("design:paramtypes",[Object,Object])],qy);const Zy=new r((t=>{Zy.__vloaded||(Zy.__vloaded=!0,D(t,gm))}));Zy.__vloaded=!1;var Jy=Zy,Qy=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},tb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eb=function(t,e){return function(i,n){e(i,n,t)}};let ib=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","arc"),i(this,"numberType",No),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};ib=Qy([m(),eb(0,g(su)),tb("design:paramtypes",[Object])],ib);let nb=!1;const rb=new r(((t,e,i,n)=>{nb||(nb=!0,t(vm).to(ib).inSingletonScope(),t(gm).toService(vm))}));var sb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ob=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ab=function(t,e){return function(i,n){e(i,n,t)}};let hb=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","area"),i(this,"numberType",Go),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),n.highPerformanceRestore(),a}};hb=sb([m(),ab(0,g(au)),ob("design:paramtypes",[Object])],hb);let lb=!1;const cb=new r(((t,e,i,n)=>{lb||(lb=!0,t(mm).to(hb).inSingletonScope(),t(gm).toService(mm))}));var db=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ub=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pb=function(t,e){return function(i,n){e(i,n,t)}};let fb=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","circle"),i(this,"numberType",zo),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};fb=db([m(),pb(0,g(hu)),ub("design:paramtypes",[Object])],fb);let gb=!1;const vb=new r(((t,e,i,n)=>{gb||(gb=!0,t(ym).to(fb).inSingletonScope(),t(gm).toService(ym))}));var mb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},yb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bb=function(t,e){return function(i,n){e(i,n,t)}};let xb=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","glyph"),i(this,"numberType",Ho),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=i?.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,null,i))})),n}return!1}};xb=mb([m(),bb(0,g(xu)),yb("design:paramtypes",[Object])],xb);let wb=!1;const Ab=new r(((t,e,i,n)=>{wb||(wb=!0,t(Cm).to(xb).inSingletonScope(),t(xb).toService(Cm))}));var Sb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Tb=class{constructor(){i(this,"type","image"),i(this,"numberType",Yo)}contains(t,e,i){const{pickContext:n}=i??{};return!!n&&!!t.AABBBounds.containsPoint(e)}};Tb=Sb([m()],Tb);let Bb=!1;const Cb=new r(((t,e,i,n)=>{Bb||(Bb=!0,t(bm).to(Tb).inSingletonScope(),t(Tb).toService(bm))}));var _b=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Pb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rb=function(t,e){return function(i,n){e(i,n,t)}};let Mb=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","line"),i(this,"numberType",Xo),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Mb=_b([m(),Rb(0,g(du)),Pb("design:paramtypes",[Object])],Mb);let kb=!1;const Eb=new r(((t,e,i,n)=>{kb||(kb=!0,t(xm).to(Mb).inSingletonScope(),t(gm).toService(xm))}));var Ob=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Lb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ib=function(t,e){return function(i,n){e(i,n,t)}};let Db=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","polygon"),i(this,"numberType",Ko),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Db=Ob([m(),Ib(0,g(pu)),Lb("design:paramtypes",[Object])],Db);let Wb=!1;const jb=new r(((t,e,i,n)=>{Wb||(Wb=!0,t(Bm).to(Db).inSingletonScope(),t(gm).toService(Bm))}));var Ub=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Nb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fb=function(t,e){return function(i,n){e(i,n,t)}};let Gb=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","path"),i(this,"numberType",$o),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};Gb=Ub([m(),Fb(0,g(uu)),Nb("design:paramtypes",[Object])],Gb);let zb=!1;const Hb=new r(((t,e,i,n)=>{zb||(zb=!0,t(wm).to(Gb).inSingletonScope(),t(gm).toService(wm))}));var Vb=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Yb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xb=function(t,e){return function(i,n){e(i,n,t)}};const $b=new Wt;let Kb=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","rect"),i(this,"numberType",Zo),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||rt(s,!0)&&0!==s||nt(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,l=t.isPointInStroke(e.x,e.y),l}));else if(l){const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;$b.setValue(i.x1,i.y1,i.x2,i.y2),$b.expand(-s/2),l=!$b.containsPoint(e)}}return n.highPerformanceRestore(),l}};Kb=Vb([m(),Xb(0,g(fu)),Yb("design:paramtypes",[Object])],Kb);let qb=!1;const Zb=new r(((t,e,i,n)=>{qb||(qb=!0,t(Am).to(Kb).inSingletonScope(),t(gm).toService(Am))}));let Jb=!1;const Qb=new r(((t,e,i,n)=>{Jb||(Jb=!0,t(bm).to(Tb).inSingletonScope(),t(Tb).toService(bm))}));var tx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ex=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ix=function(t,e){return function(i,n){e(i,n,t)}};let nx=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","symbol"),i(this,"numberType",ta),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=s+o,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};nx=tx([m(),ix(0,g(vu)),ex("design:paramtypes",[Object])],nx);let rx=!1;const sx=new r(((t,e,i,n)=>{rx||(rx=!0,t(Sm).to(nx).inSingletonScope(),t(gm).toService(Sm))}));var ox=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let ax=class{constructor(){i(this,"type","text"),i(this,"numberType",ea)}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};ax=ox([m()],ax);let hx=!1;const lx=new r(((t,e,i,n)=>{hx||(hx=!0,t(Tm).to(ax).inSingletonScope(),t(gm).toService(Tm))})),cx=new r(((t,e,i,n)=>{i(qy)||t(qy).toSelf().inSingletonScope(),i(Uu)?n(Uu).toService(qy):t(Uu).toService(qy)}));function dx(t){t.load(Jy),t.load(cx),t.load(rb),t.load(cb),t.load(vb),t.load(Ab),t.load(Cb),t.load(Eb),t.load(jb),t.load(Hb),t.load(Zb),t.load(Qb),t.load(sx),t.load(lx)}class ux{get width(){return this._w*this.dpr}set width(t){}get height(){return this._h*this.dpr}set height(t){}get offsetWidth(){return this._w}set offsetWidth(t){}get offsetHeight(){return this._h}set offsetHeight(t){}constructor(t,e,n,r,s,o){i(this,"_w",void 0),i(this,"_h",void 0),i(this,"ctx",void 0),i(this,"nativeCanvas",void 0),i(this,"id",void 0),i(this,"dpr",void 0),this.nativeCanvas=t,this.ctx=e,this._w=r,this._h=s,this.id=o,t.id=o,this.dpr=n}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}class px{get width(){return this._w*this.dpr}set width(t){this._w=t/this.dpr,this.nativeCanvas.width=t}get height(){return this._h*this.dpr}set height(t){this._h=t/this.dpr,this.nativeCanvas.height=t}get offsetWidth(){return this._w}set offsetWidth(t){this._w=t,this.nativeCanvas.width=t*this.dpr}get offsetHeight(){return this._h}set offsetHeight(t){this._h=t,this.nativeCanvas.height=t*this.dpr}constructor(t,e,n,r,s,o){i(this,"_w",void 0),i(this,"_h",void 0),i(this,"ctx",void 0),i(this,"nativeCanvas",void 0),i(this,"id",void 0),i(this,"dpr",void 0),this.nativeCanvas=t,this.ctx=e,this._w=r,this._h=s,this.id=o,t.id=o,this.dpr=n}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}var fx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let vx=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","feishu"),i(this,"supportEvent",!0),i(this,"canvasMap",new Map),i(this,"freeCanvasList",[]),i(this,"canvasIdx",0),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s){const o=s??tt.getSystemInfoSync().pixelRatio;e.forEach(((e,s)=>{const a=tt.createCanvasContext(e),h=new ux(a.canvas||{},a,o,t.width,t.height,e);a.canvas=h,i.set(e,h),s>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.pixelRatio))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return hs.call(t)}}getCancelAnimationFrame(){return t=>{hs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse"),t}};vx=fx([m(),gx("design:paramtypes",[])],vx);const mx=new r((t=>{mx.isFeishuBound||(mx.isFeishuBound=!0,t(vx).toSelf().inSingletonScope(),t(N).toService(vx))}));function yx(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];yx.__loaded||(yx.__loaded=!0,t.load(mx),t.load(Ny),t.load(Yy),e&&dx(t))}var bx;mx.isFeishuBound=!1,yx.__loaded=!1;var xx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Ax=(bx=class extends ny{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:d=r.lineDash,lineCap:u=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Mc(this,h,this.dpr),s.strokeStyle=kc(this,l,t,i,n),s.lineJoin=c,0===d[0]&&0===d[1]||d&&s.setLineDash(d),s.lineCap=u,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,on.global.devicePixelRatio),super.measureText(t,e)}createPattern(t,e){return null}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}},i(bx,"env","lynx"),bx);var Sx;Ax=xx([m()],Ax);var Tx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Cx=(i(Sx=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Ax(this,this._dpr)}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}release(){}},"env","lynx"),Sx);var _x;Cx=Tx([m(),Bx("design:paramtypes",[Object])],Cx);var Px=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Rx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mx=function(t,e){return function(i,n){e(i,n,t)}};let kx=(_x=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","lynx"),i(this,"eventManager",new class{constructor(){i(this,"cache",{})}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}),i(this,"canvas",void 0),this.global=t}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Cx(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Cx({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},i(_x,"env","lynx"),_x);kx=Px([m(),Mx(0,g(F)),Rx("design:paramtypes",[Object])],kx);const Ex=new r((t=>{t(kx).toSelf(),t(rr).toDynamicValue((t=>t.container.get(kx))).whenTargetNamed(kx.env)})),Ox=hy(Cx,Ax);var Lx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ix=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Dx=!1;try{Dx=!!lynx.createCanvasNG}catch(t){}let Wx=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","lynx"),i(this,"supportEvent",!0),i(this,"canvasMap",new Map),i(this,"freeCanvasList",[]),i(this,"canvasIdx",0),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s,o){const a=o??SystemInfo.pixelRatio;e.forEach(((e,o)=>{let h;s?h=lynx.createOffscreenCanvas():(h=Dx?lynx.createCanvasNG(e):lynx.createCanvas(e),Dx&&h.attachToCanvasView(e)),h.width=t.width*a,h.height=t.height*a;const l=h.getContext("2d"),c=new px(h,l,a,t.width,t.height,e);i.set(e,c),o>=n&&r.push(c)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,!!e.offscreen,e.pixelRatio))}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,i)=>{e.onload=()=>{t(e)},e.onerror=()=>{i(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return hs.call(t)}}getCancelAnimationFrame(){return t=>{hs.clear(t)}}mapToCanvasPoint(t){return t?.type?.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};Wx=Lx([m(),Ix("design:paramtypes",[])],Wx);const jx=new r((t=>{jx.isLynxBound||(jx.isLynxBound=!0,t(Wx).toSelf().inSingletonScope(),t(N).toService(Wx))}));function Ux(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Ux.__loaded||(Ux.__loaded=!0,t.load(jx),t.load(Ox),t.load(Ex),e&&dx(t))}var Nx;jx.isLynxBound=!1,Ux.__loaded=!1;var Fx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Gx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zx=(i(Nx=class extends ny{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Nt(1,0,0,1,0,0),this.stack=[],this.dpr=e??1}release(){}},"env","node"),Nx);var Hx;zx=Fx([m(),Gx("design:paramtypes",[Object,Number])],zx);var Vx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Yx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Xx=(i(Hx=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new zx(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&q(this._nativeCanvas.release)&&this._nativeCanvas.release()}},"env","node"),Hx);Xx=Vx([m(),Yx("design:paramtypes",[Object])],Xx);const $x=hy(Xx,zx);var Kx,qx=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jx=function(t,e){return function(i,n){e(i,n,t)}};let Qx=(Kx=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","node"),i(this,"canvas",void 0),this.global=t}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Xx(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new Xx({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}},i(Kx,"env","node"),Kx);Qx=qx([m(),Jx(0,g(F)),Zx("design:paramtypes",[Object])],Qx);const tw=new r((t=>{t(Qx).toSelf(),t(rr).toDynamicValue((t=>t.container.get(Qx))).whenTargetNamed(Qx.env)}));var ew=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let iw=class extends t.BaseEnvContribution{constructor(){super(...arguments),i(this,"type","node"),i(this,"pkg",void 0),i(this,"_lastTime",0),i(this,"supportEvent",!1)}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return hs.call(t)}}getCancelAnimationFrame(){return t=>{hs.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};iw=ew([m()],iw);const nw=new r((t=>{nw.isNodeBound||(nw.isNodeBound=!0,t(iw).toSelf().inSingletonScope(),t(N).toService(iw))}));function rw(t){rw.__loaded||(rw.__loaded=!0,t.load(nw),t.load($x),t.load(tw))}var sw;nw.isNodeBound=!1,rw.__loaded=!1;var ow=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let aw=(sw=class extends ny{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:h=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(kc(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:d=r.lineDash,lineCap:u=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(Mc(this,h,this.dpr)),s.setStrokeStyle(kc(this,l,t,i,n)),s.setLineJoin(c),d&&s.setLineDash(d),s.setLineCap(u),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Qa(t,e),i.setFontSize(t.fontSize??e.fontSize)}setTextStyle(t,e){const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Qa(t,e),i.setTextAlign(t.textAlign??e.textAlign),i.setTextBaseline(t.textBaseline??e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}getImageData(t,e,i,n){const r=this.nativeContext,s=r.taro;if(r&&s)return!r.getImageData&&s.canvasGetImageData?new Promise(((r,o)=>{try{s.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id,sx:t,sy:e,sw:i,sh:n,success(t){r(t)}})}catch(t){o(t)}})):void 0}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,i,n,r,s)}},i(sw,"env","taro"),sw);var hw;aw=ow([m()],aw);var lw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},cw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let dw=(i(hw=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new aw(this,this._dpr)}release(){}},"env","taro"),hw);dw=lw([m(),cw("design:paramtypes",[Object])],dw);const uw=hy(dw,aw);var pw,fw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vw=function(t,e){return function(i,n){e(i,n,t)}};let mw=(pw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","taro"),i(this,"eventManager",new class{constructor(){i(this,"cache",{})}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}),i(this,"canvas",void 0),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new dw(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new dw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]={...t.changedTouches[i],offsetX:e.x,offsetY:e.y}})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]={...t.touches[i],offsetX:e.x,offsetY:e.y}})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},i(pw,"env","taro"),pw);mw=fw([m(),vw(0,g(F)),gw("design:paramtypes",[Object])],mw);const yw=new r((t=>{t(mw).toSelf(),t(rr).toDynamicValue((t=>t.container.get(mw))).whenTargetNamed(mw.env)}));var bw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},xw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ww=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","taro"),i(this,"supportEvent",!0),i(this,"canvasMap",new Map),i(this,"freeCanvasList",[]),i(this,"canvasIdx",0),i(this,"taro",void 0),i(this,"pixelRatio",void 0),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}mapToCanvasPoint(t){return t?.type?.startsWith("mouse"),t}configure(t,e){var i,n,r,s,o,a,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=a.createCanvasContext(t),l=new ux(n.canvas||{},n,h,i.width,i.height,t);return n.canvas=l,r.set(t,l),e>=s&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};ww=bw([m(),xw("design:paramtypes",[])],ww);const Aw=new r((t=>{Aw.isTaroBound||(Aw.isTaroBound=!0,t(ww).toSelf().inSingletonScope(),t(N).toService(ww))}));function Sw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Sw.__loaded||(Sw.__loaded=!0,t.load(Aw),t.load(uw),t.load(yw),e&&dx(t))}var Tw;Aw.isTaroBound=!1,Sw.__loaded=!1;var Bw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Cw=(i(Tw=class extends ny{draw(){}createPattern(t,e){return null}},"env","wx"),Tw);var _w;Cw=Bw([m()],Cw);var Pw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Rw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Mw=(i(_w=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Cw(this,this._dpr)}release(){}},"env","wx"),_w);Mw=Pw([m(),Rw("design:paramtypes",[Object])],Mw);const kw=hy(Mw,Cw);var Ew,Ow=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Lw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Iw=function(t,e){return function(i,n){e(i,n,t)}};let Dw=(Ew=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","wx"),i(this,"eventManager",new class{constructor(){i(this,"cache",{})}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}),i(this,"canvas",void 0),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Mw(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Mw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x??t.changedTouches[0].pageX,t.changedTouches[0].clientX=t.changedTouches[0].x??t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y??t.changedTouches[0].pageY,t.changedTouches[0].clientY=t.changedTouches[0].y??t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},i(Ew,"env","wx"),Ew);Dw=Ow([m(),Iw(0,g(F)),Lw("design:paramtypes",[Object])],Dw);const Ww=new r((t=>{t(Dw).toSelf(),t(rr).toDynamicValue((t=>t.container.get(Dw))).whenTargetNamed(Dw.env)}));var jw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Uw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Nw=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","wx"),i(this,"supportEvent",!0),i(this,"canvasMap",new Map),i(this,"freeCanvasList",[]),i(this,"canvasIdx",0),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),async function(t,e,i,n,r,s){const o=wx.getSystemInfoSync().pixelRatio;for(let t=0;t<e.length;t++){const a=e[t];await new Promise((e=>{let h=wx.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const h=s[0].node,l=s[0].width,c=s[0].height;h.width=l*o,h.height=c*o,i.set(a,h),t>=n&&r.push(h),e(null)}))}))}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return hs.call(t)}}getCancelAnimationFrame(){return t=>{hs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse"),t}};Nw=jw([m(),Uw("design:paramtypes",[])],Nw);const Fw=new r((t=>{Fw._isWxBound||(Fw._isWxBound=!0,t(Nw).toSelf().inSingletonScope(),t(N).toService(Nw))}));function Gw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Gw.__loaded||(Gw.__loaded=!0,t.load(Fw),t.load(kw),t.load(Ww),e&&dx(t))}function zw(t){Hw(t)}function Hw(t){Hw.__loaded||(Hw.__loaded=!0,Ey(t,!1),yx(t,!1),Ux(t,!1),rw(t),Sw(t,!1),Gw(t,!1),by(t),Op.hooks.onSetEnv.tap("loadMathPicker",((e,i)=>{"browser"!==i&&dx(t)})))}var Vw;Fw._isWxBound=!1,Gw.__loaded=!1,Hw.__loaded=!1;var Yw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let Xw=(i(Vw=class extends Iy{},"env","tt"),Vw);var $w;Xw=Yw([m()],Xw);var Kw=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Zw=(i($w=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new Xw(this,this._dpr)}release(){}},"env","tt"),$w);Zw=Kw([m(),qw("design:paramtypes",[Object])],Zw);const Jw=hy(Zw,Xw);var Qw,tA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},eA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iA=function(t,e){return function(i,n){e(i,n,t)}};let nA=(Qw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","tt"),i(this,"eventManager",new class{constructor(){i(this,"cache",{})}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}),i(this,"canvas",void 0),this.global=t}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Zw(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Zw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},i(Qw,"env","tt"),Qw);nA=tA([m(),iA(0,g(F)),eA("design:paramtypes",[Object])],nA);const rA=new r((t=>{t(nA).toSelf(),t(rr).toDynamicValue((t=>t.container.get(nA))).whenTargetNamed(nA.env)}));var sA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},oA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let aA=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","tt"),i(this,"supportEvent",!0),i(this,"canvasMap",new Map),i(this,"freeCanvasList",[]),i(this,"canvasIdx",0),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),async function(t,e,i,n,r,s){const o=tt.getSystemInfoSync().pixelRatio;for(let t=0;t<e.length;t++){const a=e[t];await new Promise((e=>{let h=tt.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${a}`).node().exec((s=>{const h=s[0].node,l=h.width,c=h.height;h.width=l*o,h.height=c*o,i.set(a,h),t>=n&&r.push(h),e(null)}))}))}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return hs.call(t)}}getCancelAnimationFrame(){return t=>{hs.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){return t?.type?.startsWith("mouse"),t}};aA=sA([m(),oA("design:paramtypes",[])],aA);const hA=new r((t=>{hA.isTTBound||(hA.isTTBound=!0,t(aA).toSelf().inSingletonScope(),t(N).toService(aA))}));function lA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];lA.__loaded||(lA.__loaded=!0,t.load(hA),t.load(Jw),t.load(rA),e&&dx(t))}var cA;hA.isTTBound=!1,lA.__loaded=!1;var dA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let uA=(cA=class extends ny{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:d=r.lineDash,lineCap:u=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a*this.baseGlobalAlpha,s.lineWidth=Mc(this,h,this.dpr),s.strokeStyle=kc(this,l,t,i,n),s.lineJoin=c,0===d[0]&&0===d[1]||d&&s.setLineDash(d),s.lineCap=u,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,on.global.devicePixelRatio),super.measureText(t,e)}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;let s="";s=t.font?t.font:Qa(t,e,r&&this.camera&&this.camera.getProjectionScale(i)),n.font=(s||"").replace("px","vp");const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);let r="";r=t.font?t.font:Qa(t,e,this.camera&&this.camera.getProjectionScale(i)),n.font=(r||"").replace("px","vp");const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign=t.textAlign??e.textAlign,n.textBaseline=t.textBaseline??e.textBaseline}createPattern(t,e){return null}drawImage(){const t=this.nativeContext,e=arguments;e[0].drawImage&&(e[0]=e[0].transferToImageBitmap()),3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}draw(){}},i(cA,"env","harmony"),cA);var pA;uA=dA([m()],uA);var fA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let vA=(i(pA=class extends t.BaseCanvas{constructor(t){super(t)}init(){this._context=new uA(this,this._dpr)}resize(t,e){}release(){}},"env","harmony"),pA);var mA;vA=fA([m(),gA("design:paramtypes",[Object])],vA);var yA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xA=function(t,e){return function(i,n){e(i,n,t)}};class wA{constructor(){i(this,"cache",{})}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let AA=(mA=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),i(this,"global",void 0),i(this,"type","harmony"),i(this,"eventManager",new wA),i(this,"canvas",void 0),this.global=t}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:n.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new vA(i)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}this.canvas=new vA({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}},i(mA,"env","harmony"),mA);AA=yA([m(),xA(0,g(F)),bA("design:paramtypes",[Object])],AA);const SA=new r((t=>{t(AA).toSelf(),t(rr).toDynamicValue((t=>t.container.get(AA))).whenTargetNamed(AA.env)})),TA=hy(vA,uA);var BA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},CA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _A=class extends t.BaseEnvContribution{constructor(){super(),i(this,"type","harmony"),i(this,"supportEvent",!0),i(this,"rafSTO",void 0),this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0,this.rafSTO=new as(0)}configure(t,e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 9999}getStaticCanvasCount(){return 9999}loadImage(t){}loadSvg(t){return Promise.reject()}createCanvas(t){return function(t,e,i){const n=new OffscreenCanvas(t,e),r=n.getContext("2d");return new ux({width:t,height:e,context:r,_c:n,getBoundingClientRect:()=>({width:t,height:e}),getContext:()=>r},r,1,t,e,i)}(t.width,t.height,t.id)}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return t=>this.rafSTO.call(t)}getCancelAnimationFrame(){return t=>{this.rafSTO.clear(t)}}mapToCanvasPoint(t){return t?.type?.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return null}getRootElement(){return null}getDocument(){return null}release(){}};_A=BA([m(),CA("design:paramtypes",[])],_A);const PA=new r((t=>{PA.isHarmonyBound||(PA.isHarmonyBound=!0,t(_A).toSelf().inSingletonScope(),t(N).toService(_A))}));function RA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];RA.__loaded||(RA.__loaded=!0,t.load(PA),t.load(TA),t.load(SA),e&&dx(t))}PA.isHarmonyBound=!1,RA.__loaded=!1;var MA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},kA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},EA=function(t,e){return function(i,n){e(i,n,t)}};let OA=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","arc"),i(this,"numberType",No),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).arc;n.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Mc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};OA=MA([m(),EA(0,g(su)),kA("design:paramtypes",[Object])],OA);let LA=!1;const IA=new r(((t,e,i,n)=>{LA||(LA=!0,t(_m).to(OA).inSingletonScope(),t(zm).toService(_m))}));var DA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},WA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jA=function(t,e){return function(i,n){e(i,n,t)}};const UA=new Wt;let NA=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","rect"),i(this,"numberType",Zo),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,n.setTransformForCurrent()}else o=0,a=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||t.shadowRoot||rt(s,!0)&&0!==s||nt(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Mc(n,s+o,n.dpr),l=t.isPointInStroke(e.x,e.y),l}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;UA.setValue(i.x1,i.y1,i.x2,i.y2),UA.expand(-s/2),l=!UA.containsPoint(e)}}return n.highPerformanceRestore(),l}};NA=DA([m(),jA(0,g(fu)),WA("design:paramtypes",[Object])],NA);let FA=!1;const GA=new r(((t,e,i,n)=>{FA||(FA=!0,t(Lm).to(NA).inSingletonScope(),t(zm).toService(Lm))}));var zA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let HA=class extends _c{};HA=zA([m()],HA);var VA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},YA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XA=function(t,e){return function(i,n){e(i,n,t)}};let $A=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","line"),i(this,"numberType",Xo),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;n.highPerformanceSave();const r=mr(t).line,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Mc(n,r+s,n.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==l&&dc.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}};$A=VA([m(),XA(0,g(du)),YA("design:paramtypes",[Object])],$A);let KA=!1;const qA=new r(((t,e,i,n)=>{KA||(KA=!0,t(Em).to($A).inSingletonScope(),t(zm).toService(Em))}));var ZA=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},JA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},QA=function(t,e){return function(i,n){e(i,n,t)}};let tS=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","area"),i(this,"numberType",Go),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;const{fillPickable:a=r.fillPickable,strokePickable:h=r.strokePickable}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(t=>!!l||!!a&&(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;if(!h)return!1;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Mc(n,s+o,n.dpr),l=t.isPointInStroke(e.x,e.y),l})),n.highPerformanceRestore(),l}};tS=ZA([m(),QA(0,g(au)),JA("design:paramtypes",[Object])],tS);let eS=!1;const iS=new r(((t,e,i,n)=>{eS||(eS=!0,t(Rm).to(tS).inSingletonScope(),t(zm).toService(Rm))}));var nS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},rS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sS=function(t,e){return function(i,n){e(i,n,t)}};let oS=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","symbol"),i(this,"numberType",ta),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=mr(t).symbol,o=this.transform(t,s,n),{x:a,y:h,z:l,lastModelMatrix:c}=o;let d=e;if(n.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,h,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Mc(n,r+s,n.dpr),u=t.isPointInStroke(d.x,d.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&dc.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};oS=nS([m(),sS(0,g(vu)),rS("design:paramtypes",[Object])],oS);let aS=!1;const hS=new r(((t,e,i,n)=>{aS||(aS=!0,t(Dm).to(oS).inSingletonScope(),t(zm).toService(Dm))}));var lS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},cS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dS=function(t,e){return function(i,n){e(i,n,t)}};let uS=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","circle"),i(this,"numberType",zo),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Mc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};uS=lS([m(),dS(0,g(hu)),cS("design:paramtypes",[Object])],uS);let pS=!1;const fS=new r(((t,e,i,n)=>{pS||(pS=!0,t(Mm).to(uS).inSingletonScope(),t(zm).toService(Mm))}));var gS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mS=function(t,e){return function(i,n){e(i,n,t)}};let yS=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","text"),i(this,"numberType",ea),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=mr(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,n,a),{x:l,y:c,z:d,lastModelMatrix:u}=h;this.canvasRenderer.z=d;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,l,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,h=t.AABBBounds,u=h.height(),g=h.width(),v=ih(o,u,r),m=eh(a,g);return e.rect(m+l,v+c,g,u,d),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==u&&dc.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),f}};yS=gS([m(),mS(0,g(mu)),vS("design:paramtypes",[Object])],yS);let bS=!1;const xS=new r(((t,e,i,n)=>{bS||(bS=!0,t(Wm).to(yS).inSingletonScope(),t(zm).toService(Wm))}));var wS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},AS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},SS=function(t,e){return function(i,n){e(i,n,t)}};let TS=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","path"),i(this,"numberType",$o),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).path;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=Mc(n,r+s,n.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==l&&dc.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}};TS=wS([m(),SS(0,g(uu)),AS("design:paramtypes",[Object])],TS);let BS=!1;const CS=new r(((t,e,i,n)=>{BS||(BS=!0,t(Om).to(TS).inSingletonScope(),t(zm).toService(Om))}));var _S=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},PS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},RS=function(t,e){return function(i,n){e(i,n,t)}};let MS=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","polygon"),i(this,"numberType",Ko),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,n.setTransformForCurrent()}else s=0,o=0,n.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,((t,i,n)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,i,r)=>{if(a)return!0;const s=i.lineWidth||r.lineWidth,o=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=Mc(n,s+o,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};MS=_S([m(),RS(0,g(pu)),PS("design:paramtypes",[Object])],MS);let kS=!1;const ES=new r(((t,e,i,n)=>{kS||(kS=!0,t(jm).to(MS).inSingletonScope(),t(zm).toService(jm))}));var OS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},LS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IS=function(t,e){return function(i,n){e(i,n,t)}};let DS=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","glyph"),i(this,"numberType",Ho),this.canvasRenderer=t}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=i??{};if(!n)return!1;const r=i?.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}};DS=OS([m(),IS(0,g(xu)),LS("design:paramtypes",[Object])],DS);let WS=!1;const jS=new r(((t,e,i,n)=>{WS||(WS=!0,t(Fm).to(DS).inSingletonScope(),t(zm).toService(Fm))}));var US=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},NS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},FS=function(t,e){return function(i,n){e(i,n,t)}};let GS=class{constructor(t){i(this,"canvasRenderer",void 0),i(this,"type","richtext"),i(this,"numberType",Qo),this.canvasRenderer=t}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};GS=US([m(),FS(0,g(yu)),NS("design:paramtypes",[Object])],GS);let zS=!1;const HS=new r(((t,e,i,n)=>{zS||(zS=!0,t(Nm).to(GS).inSingletonScope(),t(zm).toService(Nm))}));var VS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};let YS=class{constructor(){i(this,"type","image"),i(this,"numberType",Yo)}contains(t,e,i){const{pickContext:n}=i??{};return!!n&&!!t.AABBBounds.containsPoint(e)}};YS=VS([m()],YS);let XS=!1;const $S=new r(((t,e,i,n)=>{XS||(XS=!0,t(km).to(YS).inSingletonScope(),t(zm).toService(km))}));var KS=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ZS=function(t,e){return function(i,n){e(i,n,t)}};new Wt;let JS=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","rect3d"),i(this,"numberType",Jo),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).rect;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d))),this.canvasRenderer.z=0,n.modelMatrix!==l&&dc.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}};JS=KS([m(),ZS(0,g(gu)),qS("design:paramtypes",[Object])],JS);let QS=!1;const tT=new r(((t,e,i,n)=>{QS||(QS=!0,t(Im).to(JS).inSingletonScope(),t(zm).toService(Im))}));var eT=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},iT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nT=function(t,e){return function(i,n){e(i,n,t)}};let rT=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","arc3d"),i(this,"numberType",Fo),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).arc;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d))),this.canvasRenderer.z=0,n.modelMatrix!==l&&dc.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}};rT=eT([m(),nT(0,g(ou)),iT("design:paramtypes",[Object])],rT);let sT=!1;const oT=new r(((t,e,i,n)=>{sT||(sT=!0,t(Pm).to(rT).inSingletonScope(),t(zm).toService(Pm))}));var aT=function(t,e,i,n){var r,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,i,o):r(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},hT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lT=function(t,e){return function(i,n){e(i,n,t)}};let cT=class extends HA{constructor(t){super(),i(this,"canvasRenderer",void 0),i(this,"type","pyramid3d"),i(this,"numberType",qo),this.canvasRenderer=t}contains(t,e,i){const{pickContext:n}=i??{};if(!n)return!1;const r=mr(t).polygon;n.highPerformanceSave();const s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==l&&dc.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),d}};cT=aT([m(),lT(0,g(bu)),hT("design:paramtypes",[Object])],cT);let dT=!1;const uT=new r(((t,e,i,n)=>{dT||(dT=!0,t(Um).to(cT).inSingletonScope(),t(zm).toService(Um))})),pT=ef();function fT(){fT.__loaded||(fT.__loaded=!0,kg(),xn.load(Vf),xn.load(pT?IA:rb))}fT.__loaded=!1;const gT=fT;function vT(){vT.__loaded||(vT.__loaded=!0,Eg(),xn.load(Cg),xn.load(oT))}vT.__loaded=!1;const mT=vT;function yT(){yT.__loaded||(yT.__loaded=!0,Og(),xn.load(Zf),xn.load(pT?iS:cb))}yT.__loaded=!1;const bT=yT;function xT(){xT.__loaded||(xT.__loaded=!0,Lg(),xn.load(eg),xn.load(pT?fS:vb))}xT.__loaded=!1;const wT=xT;function AT(){AT.__loaded||(AT.__loaded=!0,Ig(),xn.load(dg),xn.load(pT?jS:Ab))}AT.__loaded=!1;const ST=AT;function TT(){TT.__loaded||(TT.__loaded=!0,Dg())}TT.__loaded=!1;const BT=TT;function CT(){CT.__loaded||(CT.__loaded=!0,Wg(),xn.load(yg),xn.load(pT?$S:Cb))}CT.__loaded=!1;const _T=CT;function PT(){PT.__loaded||(PT.__loaded=!0,jg(),xn.load(Kf),xn.load(pT?qA:Eb))}PT.__loaded=!1;const RT=PT;function MT(){MT.__loaded||(MT.__loaded=!0,Ug(),xn.load(sg),xn.load(pT?CS:Hb))}MT.__loaded=!1;const kT=MT;function ET(){ET.__loaded||(ET.__loaded=!0,Ng(),xn.load(ag),xn.load(pT?ES:jb))}ET.__loaded=!1;const OT=ET;function LT(){LT.__loaded||(LT.__loaded=!0,Fg(),xn.load(Mg),xn.load(uT))}LT.__loaded=!1;const IT=LT;function DT(){DT.__loaded||(DT.__loaded=!0,Gg(),xn.load(Xf),xn.load(pT?GA:Zb))}DT.__loaded=!1;const WT=DT;function jT(){jT.__loaded||(jT.__loaded=!0,zg(),xn.load(Ag),xn.load(tT))}jT.__loaded=!1;const UT=jT;function NT(){NT.__loaded||(NT.__loaded=!0,Hg(),xn.load(vg),xn.load(pT?HS:Qb))}NT.__loaded=!1;const FT=NT;function GT(){GT.__loaded||(GT.__loaded=!0,Xg())}GT.__loaded=!1;const zT=GT;function HT(){HT.__loaded||(HT.__loaded=!0,Vg(),xn.load(Qf),xn.load(pT?hS:sx))}HT.__loaded=!1;const VT=HT;function YT(){YT.__loaded||(YT.__loaded=!0,Yg(),xn.load(ng),xn.load(pT?xS:lx))}YT.__loaded=!1;const XT=YT;function $T(){$T.__loaded||($T.__loaded=!0,$g())}$T.__loaded=!1;const KT=$T,qT=fm;Ep(),ef()?Ey(xn):nf()&&rw(xn),gT(),mT(),bT(),wT(),ST(),BT(),_T(),RT(),kT(),OT(),IT(),WT(),UT(),FT(),zT(),VT(),XT(),KT(),t.ACustomAnimate=Nr,t.ARC3D_NUMBER_TYPE=Fo,t.ARC_NUMBER_TYPE=No,t.AREA_NUMBER_TYPE=Go,t.Animate=Gr,t.AnimateGroup=class extends Nr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Wr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Nr{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Wr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=sn,t.Arc=Yl,t.Arc3d=$l,t.Arc3dRender=ou,t.ArcRender=su,t.ArcRenderContribution=ja,t.Area=zl,t.AreaRender=au,t.AreaRenderContribution=Ua,t.AttributeAnimate=class extends Nr{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=Yu,t.BaseRender=_c,t.Basis=li,t.BeforeRenderConstribution=Du,t.BoundsContext=xe,t.BoundsPicker=Nu,t.CIRCLE_NUMBER_TYPE=zo,t.Canvas3DDrawItemInterceptor=ku,t.CanvasArc3dPicker=Pm,t.CanvasArcPicker=_m,t.CanvasAreaPicker=Rm,t.CanvasCirclePicker=Mm,t.CanvasFactory=wn,t.CanvasGlyphPicker=Fm,t.CanvasGroupPicker=Gm,t.CanvasImagePicker=km,t.CanvasLinePicker=Em,t.CanvasPathPicker=Om,t.CanvasPickerContribution=zm,t.CanvasPolygonPicker=jm,t.CanvasPyramid3dPicker=Um,t.CanvasRect3dPicker=Im,t.CanvasRectPicker=Lm,t.CanvasRichTextPicker=Nm,t.CanvasSymbolPicker=Dm,t.CanvasTextLayout=rh,t.CanvasTextPicker=Wm,t.CbAnimate=Fr,t.Circle=Za,t.CircleRender=hu,t.CircleRenderContribution=Na,t.ClipAngleAnimate=class extends ds{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},o=s.width??0,a=s.height??0,h=r?.animationType??"in",l=r?.startAngle??0,c=r?.orient??"clockwise";let d=0,u=0;"anticlockwise"===c?(u="in"===h?l+2*Math.PI:l,u=l+2*Math.PI):(d=l,u="out"===h?l+2*Math.PI:l);const p=on.graphicService.creator.arc({x:r?.center?.x??o/2,y:r?.center?.y??a/2,outerRadius:r?.radius??(o+a)/2,innerRadius:0,startAngle:d,endAngle:u,fill:!0});let f,g;"anticlockwise"===c?(f={startAngle:l+2*Math.PI},g={startAngle:l}):(f={endAngle:l},g={endAngle:l+2*Math.PI}),super("in"===h?f:g,"in"===h?g:f,i,n,{group:r?.group,clipGraphic:p})}},t.ClipDirectionAnimate=class extends ds{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},o=r?.width??s.width??0,a=r?.height??s.height??0,h=r?.animationType??"in",l=r?.direction??"x",c=r?.orient??"positive",d=on.graphicService.creator.rect({x:0,y:0,width:"in"===h&&"x"===l?0:o,height:"in"===h&&"y"===l?0:a,fill:!0});let u={},p={};"y"===l?"negative"===c?(u={y:a,height:0},p={y:0,height:a}):(u={height:0},p={height:a}):"negative"===c?(u={x:o,width:0},p={x:0,width:o}):(u={width:0},p={width:o}),super("in"===h?u:p,"in"===h?p:u,i,n,{group:r?.group,clipGraphic:d})}},t.ClipGraphicAnimate=ds,t.ClipRadiusAnimate=class extends ds{constructor(t,e,i,n,r){const s=r?.group?.attribute??{},o=s.width??0,a=s.height??0,h=r?.animationType??"in",l=r?.startRadius??0,c=r?.endRadius??Math.sqrt((o/2)**2+(a/2)**2),d=on.graphicService.creator.arc({x:r?.center?.x??o/2,y:r?.center?.y??a/2,outerRadius:"out"===h?c:l,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),u={outerRadius:l},p={outerRadius:c};super("in"===h?u:p,"in"===h?p:u,i,n,{group:r?.group,clipGraphic:d})}},t.ColorInterpolate=La,t.ColorStore=Us,t.CommonRenderContribution=$a,t.Container=O,t.ContainerModule=r,t.Context2dFactory=An,t.ContributionProvider=L,t.CurveContext=class{constructor(t){i(this,"_lastX",void 0),i(this,"_lastY",void 0),i(this,"_startX",void 0),i(this,"_startY",void 0),this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new ti(new Ot(this._lastX,this._lastY),new Ot(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new Je(new Ot(this._lastX,this._lastY),new Ot(t,e),new Ot(i,n),new Ot(r,s));this.path.curves.push(o),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,o,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=Tr,t.CustomPath2D=Ri,t.CustomSymbolClass=ll,t.DebugDrawItemInterceptorContribution=Ru,t.DefaultArcAllocate=Pf,t.DefaultArcAttribute=zi,t.DefaultArcRenderContribution=Uc,t.DefaultAreaAllocate=Mf,t.DefaultAreaAttribute=Hi,t.DefaultAreaTextureRenderContribution=hd,t.DefaultAttribute=Gi,t.DefaultBaseBackgroundRenderContribution=Ic,t.DefaultBaseTextureRenderContribution=Wc,t.DefaultCanvasAllocate=Qn,t.DefaultCircleAllocate=Ef,t.DefaultCircleAttribute=Vi,t.DefaultCircleRenderContribution=zc,t.DefaultConnectAttribute=Ni,t.DefaultDebugAttribute=Fi,t.DefaultFillStyle=Li,t.DefaultGlyphAttribute=Xi,t.DefaultGraphicAllocate=Bf,t.DefaultGraphicMemoryManager=Gf,t.DefaultGroupAttribute=Yi,t.DefaultGroupBackgroundRenderContribution=Xc,t.DefaultImageAttribute=nn,t.DefaultImageBackgroundRenderContribution=Zc,t.DefaultLayout=Ei,t.DefaultLineAllocate=Lf,t.DefaultLineAttribute=$i,t.DefaultMat4Allocate=lc,t.DefaultMatrixAllocate=hc,t.DefaultMorphingAnimateConfig=Yr,t.DefaultPathAllocate=Df,t.DefaultPathAttribute=Ki,t.DefaultPickStyle=ji,t.DefaultPolygonAttribute=qi,t.DefaultRect3dAttribute=Ji,t.DefaultRectAllocate=Cf,t.DefaultRectAttribute=Zi,t.DefaultRectRenderContribution=td,t.DefaultRichTextAttribute=en,t.DefaultRichTextIconAttribute=rn,t.DefaultStateAnimateConfig=Vr,t.DefaultStrokeStyle=Di,t.DefaultStyle=Ui,t.DefaultSymbolAllocate=jf,t.DefaultSymbolAttribute=Qi,t.DefaultSymbolRenderContribution=rd,t.DefaultTextAllocate=Nf,t.DefaultTextAttribute=tn,t.DefaultTextStyle=Wi,t.DefaultTicker=Dr,t.DefaultTimeline=jr,t.DefaultTransform=Oi,t.DragNDrop=class{constructor(t){i(this,"rootNode",void 0),i(this,"onPointerDown",(t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",e?.dispatchEvent(t),s=!0),t.type="drag",e?.dispatchEvent(t),!n){e.attribute.pickable=!1;const n=i?.pick(t.global.x,t.global.y),s=n.graphic;e.attribute.pickable=!0,r!==s&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),s&&(t.type="dragenter",t.target=s,s.dispatchEvent(t)),r=s,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}i?.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),i?.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}})),this.rootNode=t,this.initEvents()}initEvents(){this.rootNode?.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){this.rootNode?.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=Su,t.DrawItemInterceptor=Cu,t.DynamicLayerHandlerContribution=va,t.EnvContribution=N,t.EventManager=_r,t.EventSystem=Mr,t.EventTarget=Pr,t.FadeInPlus=class extends Nr{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=cs.LEFT_TO_RIGHT,fill:o=!0,stroke:a=!0}=r||{};this.direction=s,this.fill=o,this.stroke=a,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case cs.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case cs.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case cs.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case cs.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=xr,t.FederatedMouseEvent=wr,t.FederatedPointerEvent=Ar,t.FederatedWheelEvent=Sr,t.Fragment=$m,t.GLYPH_NUMBER_TYPE=Ho,t.GRAPHIC_UPDATE_TAG_KEY=uo,t.GROUP_NUMBER_TYPE=Vo,t.Generator=n,t.Gesture=class extends X{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),i(this,"element",void 0),i(this,"cachedEvents",[]),i(this,"startTime",void 0),i(this,"pressTimeout",void 0),i(this,"startPoints",[]),i(this,"processEvent",{}),i(this,"startDistance",void 0),i(this,"center",void 0),i(this,"eventType",void 0),i(this,"direction",void 0),i(this,"lastMoveTime",void 0),i(this,"prevMoveTime",void 0),i(this,"prevMovePoint",void 0),i(this,"lastMovePoint",void 0),i(this,"throttleTimer",0),i(this,"emitThrottles",[]),i(this,"config",void 0),i(this,"tapCount",void 0),i(this,"lastTapTime",void 0),i(this,"lastTapTarget",null),i(this,"onStart",(t=>{this.reset(),this.startTime=Br.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=Jm(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}})),i(this,"onMove",(t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Br.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=l,this.lastMovePoint=a,1===e.length){const t=e[0],i=r-t.x,o=s-t.y,l=this.direction||Zm(t,a);this.direction=l;const c=this.getEventType(a);return n.direction=l,n.deltaX=i,n.deltaY=o,n.points=h,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,d=Jm(h[0],h[1]);n.scale=d/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)})),i(this,"onEnd",(t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const i=Br.now(),r=this.lastMoveTime;if(i-r<100){const t=r-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=Jm(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=Zm(i,r),this.triggerEvent("swipe",e))}}i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0)}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()})),this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:e?.press?.time??251,threshold:e?.press?.threshold??9},swipe:{threshold:e?.swipe?.threshold??10,velocity:e?.swipe?.velocity??.3},tap:{interval:e?.tap?.interval??300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if(e)return e;let r;return r=Br.now()-i>this.config.press.time&&Jm(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=on.global.getRequestAnimationFrame()((()=>{for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.throttleTimer=0,this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GlobalPickerService=Fu,t.Glyph=Cl,t.GlyphRender=xu,t.Graphic=yo,t.GraphicAnimate=class extends Nr{constructor(t,e,n,r,s){super(t,e,n,r,s),i(this,"graphic",void 0),this.graphic=s?.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=na,t.GraphicPicker=ju,t.GraphicRender=lu,t.GraphicService=ia,t.GraphicUtil=pa,t.Group=la,t.GroupFadeIn=class extends Nr{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 Nr{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=cu,t.GroupRenderContribution=Fa,t.IMAGE_NUMBER_TYPE=Yo,t.Image=kl,t.ImageRender=wu,t.ImageRenderContribution=Ga,t.IncreaseCount=class extends Nr{constructor(t,e,n,r,s){super(t,e,n,r,s),i(this,"fromNumber",void 0),i(this,"toNumber",void 0),i(this,"decimalLength",void 0)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){this.fromNumber=rt(this.from?.text)?this.from?.text:Number.parseFloat(this.from?.text),this.toNumber=rt(this.to?.text)?this.to?.text:Number.parseFloat(this.to?.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=this.params?.fixed??Math.max(Et(this.fromNumber),Et(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}},t.IncrementalDrawContribution=ru,t.InputText=class extends Nr{constructor(){super(...arguments),i(this,"fromText",""),i(this,"toText","")}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){if(this.fromText=this.from?.text??"",this.toText=this.to?.text??"",!this.toText||nt(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=on.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){if(!1===this.valid)return;const n=this.fromText.length,r=this.toText.length,s=Math.ceil(n+(r-n)*e);i.text=this.toText.substr(0,s);const o=this.target.shadowRoot?.at(0),a=this.target.clipedWidth+2;o.setAttribute("x",a)}},t.InteractiveDrawItemInterceptorContribution=Mu,t.InteractiveSubRenderContribution=Ka,t.LINE_NUMBER_TYPE=Xo,t.Layer=da,t.LayerService=fa,t.Line=yl,t.LineRender=du,t.Linear=si,t.LinearClosed=Bi,t.ManualTickHandler=kr,t.ManualTicker=class extends Dr{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new kr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-this.lastFrameTime,(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Mat4Allocate=oc,t.MathArcPicker=vm,t.MathAreaPicker=mm,t.MathCirclePicker=ym,t.MathGlyphPicker=Cm,t.MathImagePicker=bm,t.MathLinePicker=xm,t.MathPathPicker=wm,t.MathPickerContribution=gm,t.MathPolygonPicker=Bm,t.MathRectPicker=Am,t.MathSymbolPicker=Sm,t.MathTextPicker=Tm,t.MatrixAllocate=sc,t.Meteor=class extends Nr{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new Ot(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=vi,t.MonotoneY=mi,t.MorphingPath=to,t.MotionPath=class extends Nr{constructor(t,e,i,n,r){super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=r.initAngle??0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=io,t.NOWORK_ANIMATE_ATTR=mo,t.Node=br,t.PATH_NUMBER_TYPE=$o,t.POLYGON_NUMBER_TYPE=Ko,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=qo,t.Path=Nl,t.PathRender=uu,t.PathRenderContribution=za,t.PickItemInterceptor=zu,t.PickerService=Uu,t.PluginService=Xu,t.Polygon=Zl,t.PolygonRender=pu,t.PolygonRenderContribution=Ha,t.Pyramid3d=Ql,t.Pyramid3dRender=bu,t.RAFTickHandler=Or,t.REACT_TO_CANOPUS_EVENTS=Hm,t.REACT_TO_CANOPUS_EVENTS_LIST=Vm,t.RECT3D_NUMBER_TYPE=Jo,t.RECT_NUMBER_TYPE=Zo,t.RICHTEXT_NUMBER_TYPE=Qo,t.RafBasedSTO=as,t.Rect=wl,t.Rect3DRender=gu,t.Rect3d=Tl,t.RectRender=fu,t.RectRenderContribution=Va,t.ReflectSegContext=ii,t.RenderSelector=Au,t.RenderService=Iu,t.ResourceLoader=ao,t.RichText=Wl,t.RichTextRender=yu,t.RotateBySphereAnimate=class extends Nr{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let o=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(o=bt-o),this.theta=o,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r,cb:s}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,a=this.theta+o,h=this.phi,l=r*Math.sin(h)*Math.cos(a)+n.x,c=r*Math.cos(h)+n.y,d=r*Math.sin(h)*Math.sin(a)+n.z;for(i.x=l,i.y=c,i.z=d,i.alpha=a+vt/2;i.alpha>bt;)i.alpha-=bt;i.alpha=bt-i.alpha,i.zIndex=-1e4*i.z,s&&s(i)}},t.SVG_ATTRIBUTE_MAP=ra,t.SVG_ATTRIBUTE_MAP_KEYS=sa,t.SVG_PARSE_ATTRIBUTE_MAP=oa,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=aa,t.SYMBOL_NUMBER_TYPE=ta,t.SegContext=ei,t.ShadowRoot=ec,t.ShadowRootDrawItemInterceptorContribution=Pu,t.Stage=of,t.StaticLayerHandlerContribution=ga,t.Step=Ai,t.StreamLight=class extends Nr{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}onStartLineOrArea(t){const e=this.target.attachShadow(),i=on.graphicService.creator[t]({...this.params?.attribute});this[t]=i,i.pathProxy=new Ri,e.add(i)}onStartRect(){const t=this.target.attachShadow(),e=this.target.AABBBounds.height(),i=on.graphicService.creator.rect({height:e,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff",...this.params?.attribute,x:0,y:0,width:0});this.rect=i,t.add(i)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}onUpdateRect(e,i,n){const r=this.target.attribute.width??250,s=this.params?.streamLength??r,o=this.params?.attribute?.width??60,a=-o,h=a+(s-a)*i,l=Math.max(h,0),c=Math.min(Math.min(h+o,o),s-h),d=c+l>r?Math.max(r-l,0):c;this.rect.setAttributes({x:l,width:d},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}onUpdateLineOrArea(t,e,i){const n=this.line||this.area;if(!n)return;const r=n.pathProxy,s=this.target;s.cache||s.cacheArea?this._onUpdateLineOrAreaWithCache(r,s,t,e,i):this._onUpdateLineWithoutCache(r,s,t,e,i);const o=s.attribute;n.setAttributes({stroke:o.stroke,...n.attribute}),n.addUpdateBoundTag()}_onUpdateLineOrAreaWithCache(t,e,i,n,r){if(t.clear(),"line"===e.type){let i=e.cache;Array.isArray(i)||(i=[i]);const r=i.reduce(((t,e)=>t+e.getLength()),0),s=[];return i.forEach((t=>{t.curves.forEach((t=>s.push(t)))})),this._updateCurves(t,s,r,n)}if("area"===e.type){const i=e.cacheArea,r=i.top.curves.reduce(((t,e)=>t+e.getLength()),0);return this._updateCurves(t,i.top.curves,r,n)}}_updateCurves(t,e,i,n){const r=i*n,s=Math.min(r+this.params?.streamLength??10,i);let o=0,a=!1;for(let i=0;i<e.length;i++){const n=e[i],h=n.getLength(),l=1-(o+h-r)/h;let c,d=1-(o+h-s)/h;if(o<r&&o+h>r)if(a=!0,n.p2&&n.p3){const[e,i]=Ze(n,l);t.moveTo(i.p0.x,i.p0.y),c=i}else{const e=n.getPointAt(l);t.moveTo(e.x,e.y)}if(o<s&&o+h>s){if(n.p2&&n.p3){c&&(d=(s-r)/c.getLength());const[e]=Ze(c||n,d);t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else{const e=n.getPointAt(d);t.lineTo(e.x,e.y)}break}if(a)if(n.p2&&n.p3){const e=c||n;t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else t.lineTo(n.p1.x,n.p1.y);o+=h}}_onUpdateLineWithoutCache(t,e,i,n,r){const{points:s,curveType:o}=e.attribute;if(!s||s.length<2||"linear"!==o)return;let a=0;for(let t=1;t<s.length;t++)a+=Lt.distancePP(s[t],s[t-1]);const h=a*n,l=Math.min(h+this.params?.streamLength??10,a),c=[];let d=0;for(let t=1;t<s.length;t++){const e=Lt.distancePP(s[t],s[t-1]);if(d<h&&d+e>h&&c.push(Lt.pointAtPP(s[t-1],s[t],1-(d+e-h)/e)),d<l&&d+e>l){c.push(Lt.pointAtPP(s[t-1],s[t],1-(d+e-l)/e));break}c.length&&c.push(s[t]),d+=e}if(c.length&&!(c.length<2)){t.clear(),t.moveTo(c[0].x,c[0].y);for(let e=1;e<c.length;e++)t.lineTo(c[e].x,c[e].y)}}},t.SubAnimate=zr,t.Symbol=gl,t.SymbolRender=vu,t.SymbolRenderContribution=Ya,t.TEXT_NUMBER_TYPE=ea,t.TagPointsUpdate=class extends Nr{constructor(t,e,n,r,s){super(t,e,n,r,s),i(this,"fromPoints",void 0),i(this,"toPoints",void 0),i(this,"points",void 0),i(this,"interpolatePoints",void 0),i(this,"newPointAnimateType",void 0),this.newPointAnimateType="appear"===s?.newPointAnimateType?"appear":"grow"}onBind(){const t=this.from?.points,e=this.to?.points;this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let n,r,s=1/0,o=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(i.has(this.toPoints[t].context)){s=t,n=i.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(i.has(this.toPoints[t].context)){o=t,r=i.get(this.toPoints[t].context);break}let a=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const h=i.get(t.context);return h?(a=h,[h,t]):"appear"===this.newPointAnimateType?[t,t]:e<s&&n?[n,t]:e>o&&r?[r,t]:[a,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new Ot(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const n=is(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=oh,t.TextMeasureContribution=bn,t.TextRender=mu,t.TextRenderContribution=Xa,t.Theme=gr,t.TimeOutTickHandler=Er,t.TransformUtil=ua,t.VArc=function(t){return Ac.arc(t?t.attribute:{})},t.VArc3d=function(t){return Ac.arc3d(t?t.attribute:{})},t.VArea=function(t){return Ac.area(t?t.attribute:{})},t.VCircle=function(t){return Ac.circle(t?t.attribute:{})},t.VGlobal=F,t.VGlyph=function(t){return Ac.glyph(t?t.attribute:{})},t.VGroup=function(t){return Ac.group(t?t.attribute:{})},t.VImage=function(t){return Ac.image(t?t.attribute:{})},t.VLine=function(t){return Ac.line(t?t.attribute:{})},t.VPath=function(t){return Ac.path(t?t.attribute:{})},t.VPolygon=function(t){return Ac.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Ac.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Ac.rect(t?t.attribute:{})},t.VRect3d=function(t){return Ac.rect3d(t?t.attribute:{})},t.VRichText=Ym,t.VSymbol=function(t){return Ac.symbol(t?t.attribute:{})},t.VText=function(t){return Ac.text(t?t.attribute:{})},t.VWindow=nr,t.VirtualLayerHandlerContribution=ma,t.WILDCARD="*",t.WindowHandlerContribution=rr,t.WrapText=lh,t.XMLParser=Po,t._registerArc=fT,t.addArcToBezierPath=ze,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=bs,t.alignSubpath=ps,t.application=on,t.applyTransformOnBezierCurves=As,t.arc3dCanvasPickModule=oT,t.arc3dModule=Cg,t.arcCanvasPickModule=IA,t.arcMathPickModule=rb,t.arcModule=Vf,t.areaCanvasPickModule=iS,t.areaMathPickModule=cb,t.areaModule=Zf,t.bezier=Fe,t.bezierCurversToPath=Ss,t.binarySplitPolygon=Ls,t.bindContributionProvider=D,t.bindContributionProviderNoSingletonScope=W,t.boundStroke=ko,t.browserEnvModule=ky,t.builtInSymbolStrMap=ul,t.builtinSymbols=cl,t.builtinSymbolsMap=dl,t.calcLineCache=Pi,t.calculateLineHeight=ls,t.canvasAllocate=tr,t.centroidOfSubpath=vs,t.circleBounds=ts,t.circleCanvasPickModule=fS,t.circleMathPickModule=vb,t.circleModule=eg,t.clock=Br,t.cloneGraphic=so,t.colorEqual=function(t,e){const i=Zt.parseColorString(t),n=Zt.parseColorString(e);return!(!i||!n)&&i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity},t.colorStringInterpolationToStr=$s,t.container=xn,t.cornerTangents=ka,t.createArc=Xl,t.createArc3d=Kl,t.createArea=Hl,t.createCircle=Ja,t.createColor=kc,t.createConicalGradient=Wa,t.createGlyph=_l,t.createGroup=ca,t.createImage=El,t.createLine=bl,t.createMat4=ac,t.createPath=Fl,t.createPolygon=Jl,t.createPyramid3d=tc,t.createRect=Al,t.createRect3d=Bl,t.createRectPath=qc,t.createRichText=jl,t.createShadowRoot=ic,t.createStage=function(t){return new of(t)},t.createSymbol=vl,t.createText=ah,t.createWrapText=ch,t.cubicCalc=Ke,t.cubicLength=$e,t.cubicPointAt=qe,t.cubicSubdivide=us,t.decodeReactDom=Km,t.defaultArcAllocate=Rf,t.defaultArcBackgroundRenderContribution=Gc,t.defaultArcRenderContribution=Nc,t.defaultArcTextureRenderContribution=Fc,t.defaultAreaAllocate=kf,t.defaultBaseBackgroundRenderContribution=Dc,t.defaultBaseTextureRenderContribution=jc,t.defaultCircleAllocate=Of,t.defaultCircleBackgroundRenderContribution=Yc,t.defaultCircleRenderContribution=Hc,t.defaultCircleTextureRenderContribution=Vc,t.defaultGraphicMemoryManager=zf,t.defaultGroupBackgroundRenderContribution=$c,t.defaultImageBackgroundRenderContribution=Jc,t.defaultLineAllocate=If,t.defaultPathAllocate=Wf,t.defaultRectAllocate=_f,t.defaultRectBackgroundRenderContribution=nd,t.defaultRectRenderContribution=ed,t.defaultRectTextureRenderContribution=id,t.defaultSymbolAllocate=Uf,t.defaultSymbolBackgroundRenderContribution=ad,t.defaultSymbolRenderContribution=sd,t.defaultSymbolTextureRenderContribution=od,t.defaultTextAllocate=Ff,t.defaultTicker=Yp,t.defaultTimeline=Ur,t.drawArc=Ge,t.drawArcPath=Ea,t.drawAreaSegments=xd,t.drawIncrementalAreaSegments=yd,t.drawIncrementalSegments=md,t.drawPathProxy=Ra,t.drawSegments=vd,t.enumCommandMap=Te,t.feishuEnvModule=mx,t.fillVisible=Ba,t.findBestMorphingRotation=ys,t.findNextGraphic=pp,t.flatten_simplify=function(t,e,i){if(t.length<=10)return t;const n=void 0!==e?e*e:1;return Tf(t=i?t:function(t,e){let i,n,r=t[0].x,s=t[0].y;const o=[t[0]];for(let a=1,h=t.length;a<h;a++)i=t[a].x-r,n=t[a].y-s,i*i+n*n>e&&(r=t[a].x,s=t[a].y,o.push(t[a]));return t[t.length-1].x===r&&t[t.length-1].y===s||o.push(t[t.length-1]),o}(t,n),n)},t.foreach=dp,t.foreachAsync=up,t.genBasisSegments=di,t.genBasisTypeSegments=ci,t.genLinearClosedSegments=Ci,t.genLinearClosedTypeSegments=_i,t.genLinearSegments=oi,t.genLinearTypeSegments=ai,t.genMonotoneXSegments=bi,t.genMonotoneXTypeSegments=yi,t.genMonotoneYSegments=wi,t.genMonotoneYTypeSegments=xi,t.genNumberType=Oo,t.genStepSegments=Si,t.genStepTypeSegments=Ti,t.getAttributeFromDefaultAttrList=os,t.getConicGradientAt=Da,t.getContextFont=Qa,t.getCurrentEnv=function(){return ef()?"browser":"node"},t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,o=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;o[0]=e.x1+(e.x2-e.x1)*t}else o[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;o[1]=e.x1+(e.x2-e.x1)*t}else o[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;o[0]+=eh(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=dc.allocate();return mc(a,a,[o[0],o[1],0]),r&&gc(a,a,r),n&&vc(a,a,n),mc(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=xc,t.getRichTextBounds=function(t){return Tc||(Tc=Ac.CreateGraphic("richtext",{})),Tc.setAttributes(t),Tc.AABBBounds},t.getScaledStroke=Mc,t.getTextBounds=Bc,t.getTheme=mr,t.getThemeFromGroup=yr,t.globalTheme=vr,t.glyphCanvasPickModule=jS,t.glyphMathPickModule=Ab,t.glyphModule=dg,t.graphicCreator=Ac,t.graphicService=Dp,t.graphicUtil=Lp,t.harmonyEnvModule=PA,t.imageCanvasPickModule=$S,t.imageMathPickModule=Cb,t.imageModule=yg,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){zw(xn)},t.initBrowserEnv=function(){Ey(xn)},t.initFeishuEnv=function(){yx(xn)},t.initHarmonyEnv=function(){RA(xn)},t.initLynxEnv=function(){Ux(xn)},t.initNodeEnv=function(){rw(xn)},t.initTTEnv=function(){lA(xn)},t.initTaroEnv=function(){Sw(xn)},t.initWxEnv=function(){Gw(xn)},t.inject=g,t.injectable=m,t.interpolateColor=Fs,t.interpolateGradientConicalColor=Hs,t.interpolateGradientLinearColor=Gs,t.interpolateGradientRadialColor=zs,t.interpolatePureColorArray=Vs,t.intersect=Ma,t.isBrowserEnv=ef,t.isNodeEnv=nf,t.isSvg=Ro,t.isTransformKey=ss,t.isXML=Mo,t.jsx=function(t,e){const{key:i,name:n,id:r,attribute:s,stateProxy:o,...a}=e||{};let h=t;it(t)&&(h=Ac[t]);const l=[];for(var c=arguments.length,d=new Array(c>2?c-2:0),u=2;u<c;u++)d[u-2]=arguments[u];d.length&&Xm(1===d.length?d[0]:d,l);const p="Group"===h.name?new h(s):h(e);return function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=Hm[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(p,l,a),o&&(p.stateProxy=o),p},t.layerService=Wp,t.lineCanvasPickModule=qA,t.lineMathPickModule=Eb,t.lineModule=Kf,t.loadAllEnv=zw,t.loadAllModule=Hw,t.loadBrowserEnv=Ey,t.loadFeishuEnv=yx,t.loadHarmonyEnv=RA,t.loadLynxEnv=Ux,t.loadNodeEnv=rw,t.loadTTEnv=lA,t.loadTaroEnv=Sw,t.loadWxEnv=Gw,t.lookAt=$p,t.lynxEnvModule=jx,t.mat3Tomat4=yc,t.mat4Allocate=dc,t.matrixAllocate=cc,t.morphPath=eo,t.multiInject=v,t.multiToOneMorph=(e,i,n)=>{const r=e.filter((t=>t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const s=("clone"===n?.splitPath?so:n?.splitPath??oo)(i,r.length,!0),o=i.attribute;i.setAttribute("visible",!1);const a=r.map(((t,e)=>Zs(t.toCustomPath(),s[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:s[e].globalTransMatrix}))),h=r.map(((t,e)=>Qs(t.attribute,o)));if(n?.individualDelay){const o=n.onEnd;let l=r.length;const c=()=>{l--,0===l&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),o&&o())};s.forEach(((t,i)=>{const s=(n.delay??0)+n.individualDelay(i,r.length,e[i],t),o=t.animate(Object.assign({},n,{onEnd:c}));o.wait(s),o.play(new to({morphingData:a[i],saveOnEnd:!0,otherAttrs:h[i]},n.duration??Yr.duration,n.easing??Yr.easing))}))}else{const e=n?.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const s=i.animate(r);n?.delay&&s.wait(n.delay),s.play(new io({morphingData:a,otherAttrs:h},n?.duration??Yr.duration,n?.easing??Yr.easing))}},t.multiply=qp,t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],d=e[8],u=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,A=0;return t[0]=b*n+x*a+w*d+A*g,t[1]=b*r+x*h+w*u+A*v,t[2]=b*s+x*l+w*p+A*m,t[3]=b*o+x*c+w*f+A*y,b=i.c,x=i.d,w=0,A=0,t[4]=b*n+x*a+w*d+A*g,t[5]=b*r+x*h+w*u+A*v,t[6]=b*s+x*l+w*p+A*m,t[7]=b*o+x*c+w*f+A*y,b=0,x=0,w=1,A=0,t[8]=b*n+x*a+w*d+A*g,t[9]=b*r+x*h+w*u+A*v,t[10]=b*s+x*l+w*p+A*m,t[11]=b*o+x*c+w*f+A*y,b=i.e,x=i.f,w=0,A=1,t[12]=b*n+x*a+w*d+A*g,t[13]=b*r+x*h+w*u+A*v,t[14]=b*s+x*l+w*p+A*m,t[15]=b*o+x*c+w*f+A*y,t},t.multiplyMat4Mat4=bc,t.named=y,t.newThemeObj=ur,t.nodeEnvModule=nw,t.oneToMultiMorph=(t,e,i)=>{const n=e.filter((t=>t&&t.toCustomPath&&t.valid));n.length||__DEV__&&console.error(n," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const r=("clone"===i?.splitPath?so:i?.splitPath??oo)(t,n.length,!1),s=i?.onEnd;let o=n.length;const a=()=>{o--,0===o&&s&&s()};n.forEach(((e,s)=>{const o=r[s],h=(i?.delay??0)+(i?.individualDelay?i.individualDelay(s,n.length,o,e):0);eo(o,e,Object.assign({},i,{onEnd:a,delay:h}),t.globalTransMatrix)}))},t.ortho=Kp,t.parsePadding=Zr,t.parseStroke=Kr,t.parseSvgPath=ke,t.pathCanvasPickModule=CS,t.pathMathPickModule=Hb,t.pathModule=sg,t.pathToBezierCurves=ws,t.point=hi,t.pointEqual=es,t.pointInterpolation=is,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Mt(t.x,t.y,e.x,e.y,i),{x:o,y:a}=Mt(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=o,n.y1=a,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>es(t,e[i]))):!Number.isNaN(t.x+t.y)&&es(t,e))},t.pointsInterpolation=ns,t.polygonCanvasPickModule=ES,t.polygonMathPickModule=jb,t.polygonModule=ag,t.preLoadAllModule=Ep,t.pyramid3dCanvasPickModule=uT,t.pyramid3dModule=Mg,t.rafBasedSto=hs,t.rect3dCanvasPickModule=tT,t.rect3dModule=Ag,t.rectCanvasPickModule=GA,t.rectFillVisible=Ca,t.rectMathPickModule=Zb,t.rectModule=Xf,t.rectStrokeVisible=Pa,t.recursiveCallBinarySplit=Is,t.registerArc=gT,t.registerArc3d=mT,t.registerArc3dGraphic=Eg,t.registerArcGraphic=kg,t.registerArea=bT,t.registerAreaGraphic=Og,t.registerCircle=wT,t.registerCircleGraphic=Lg,t.registerGlyph=ST,t.registerGlyphGraphic=Ig,t.registerGroup=BT,t.registerGroupGraphic=Dg,t.registerImage=_T,t.registerImageGraphic=Wg,t.registerLine=RT,t.registerLineGraphic=jg,t.registerPath=kT,t.registerPathGraphic=Ug,t.registerPolygon=OT,t.registerPolygonGraphic=Ng,t.registerPyramid3d=IT,t.registerPyramid3dGraphic=Fg,t.registerRect=WT,t.registerRect3d=UT,t.registerRect3dGraphic=zg,t.registerRectGraphic=Gg,t.registerRichtext=FT,t.registerRichtextGraphic=Hg,t.registerShadowRoot=zT,t.registerShadowRootGraphic=Xg,t.registerSymbol=VT,t.registerSymbolGraphic=Vg,t.registerText=XT,t.registerTextGraphic=Yg,t.registerWrapText=KT,t.registerWrapTextGraphic=$g,t.renderCommandList=Ve,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=Qb,t.richtextCanvasPickModule=HS,t.richtextModule=vg,t.rotateX=gc,t.rotateY=vc,t.roughModule=qT,t.runFill=Sa,t.runStroke=Ta,t.segments=Ne,t.shouldUseMat4=wc,t.snapLength=Xe,t.splitArc=_s,t.splitArea=Ms,t.splitCircle=Ps,t.splitGraphic=oo,t.splitLine=ks,t.splitPath=Ws,t.splitPolygon=Ds,t.splitRect=Cs,t.splitToGrids=Bs,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=_a,t.symbolCanvasPickModule=hS,t.symbolMathPickModule=sx,t.symbolModule=Qf,t.taroEnvModule=Aw,t.textAttributesToStyle=nh,t.textCanvasPickModule=xS,t.textDrawOffsetX=eh,t.textDrawOffsetY=th,t.textLayoutOffsetY=ih,t.textMathPickModule=lx,t.textModule=ng,t.transformKeys=rs,t.transformMat4=Zp,t.transformUtil=Ip,t.translate=mc,t.ttEnvModule=hA,t.version="0.19.4",t.verticalLayout=Io,t.vglobal=Op,t.waitForAllSubLayers=async function(t){const e=[],i=t.getChildren();await new Promise((t=>{on.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),await Promise.all(e)},t.wrapCanvas=Sn,t.wrapContext=function(t,e){return xn.getNamed(An,on.global.env)(t,e)},t.wxEnvModule=Fw,t.xul=function(t){const e=nt(t)?t[0]:t,i=[];if(!e)return i;if(!0===Mo(e)){const t=(new Po).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};Uo(t,e);const i=t["#text"];return i&&(e.text=i),e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};Uo(t,e);const i=e.image;return i&&(e.image=i.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">")),e}(t.tc[e]))}))}return i}}));