@visactor/vrender 0.14.1 → 0.14.2
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/cjs/animate/default-ticker.js +1 -1
- package/cjs/animate/default-ticker.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.js +341 -552
- package/dist/index.min.js +1 -1
- package/es/animate/default-ticker.js +1 -1
- package/es/animate/default-ticker.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VRender={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t){return n="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},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function l(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=a(t);if(e){var r=a(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return l(this,i)}}var u=function(t){return t&&t.Math==Math&&t},d=u("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||u("object"==("undefined"==typeof window?"undefined":n(window))&&window)||u("object"==("undefined"==typeof self?"undefined":n(self))&&self)||u("object"==n(e)&&e)||function(){return this}()||e||Function("return this")(),p={},f=function(t){try{return!!t()}catch(t){return!0}},g=!f((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),v=!f((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),y=v,m=Function.prototype.call,b=y?m.bind(m):function(){return m.apply(m,arguments)},x={},w={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,A=S&&!w.call({1:2},1);x.f=A?function(t){var e=S(this,t);return!!e&&e.enumerable}:w;var T,B,C=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},_=v,P=Function.prototype,E=P.call,M=_&&P.bind.bind(E,E),k=_?M:function(t){return function(){return E.apply(t,arguments)}},R=k,D=R({}.toString),I=R("".slice),O=function(t){return I(D(t),8,-1)},L=f,U=O,W=Object,N=k("".split),F=L((function(){return!W("z").propertyIsEnumerable(0)}))?function(t){return"String"==U(t)?N(t,""):W(t)}:W,z=function(t){return null==t},j=z,H=TypeError,G=function(t){if(j(t))throw H("Can't call method on "+t);return t},V=F,X=G,Y=function(t){return V(X(t))},q="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,K={all:q,IS_HTMLDDA:void 0===q&&void 0!==q},$=K.all,Z=K.IS_HTMLDDA?function(t){return"function"==typeof t||t===$}:function(t){return"function"==typeof t},J=Z,Q=K.all,et=K.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:J(t)||t===Q}:function(t){return"object"==n(t)?null!==t:J(t)},it=d,nt=Z,rt=function(t,e){return arguments.length<2?(i=it[t],nt(i)?i:void 0):it[t]&&it[t][e];var i},st=k({}.isPrototypeOf),ot=d,at="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ht=ot.process,lt=ot.Deno,ct=ht&&ht.versions||lt&<.version,ut=ct&&ct.v8;ut&&(B=(T=ut.split("."))[0]>0&&T[0]<4?1:+(T[0]+T[1])),!B&&at&&(!(T=at.match(/Edge\/(\d+)/))||T[1]>=74)&&(T=at.match(/Chrome\/(\d+)/))&&(B=+T[1]);var dt=B,pt=f,ft=d.String,gt=!!Object.getOwnPropertySymbols&&!pt((function(){var t=Symbol();return!ft(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&dt&&dt<41})),vt=gt&&!Symbol.sham&&"symbol"==n(Symbol.iterator),yt=rt,mt=Z,bt=st,xt=Object,wt=vt?function(t){return"symbol"==n(t)}:function(t){var e=yt("Symbol");return mt(e)&&bt(e.prototype,xt(t))},St=String,At=function(t){try{return St(t)}catch(t){return"Object"}},Tt=Z,Bt=At,Ct=TypeError,_t=function(t){if(Tt(t))return t;throw Ct(Bt(t)+" is not a function")},Pt=_t,Et=z,Mt=function(t,e){var i=t[e];return Et(i)?void 0:Pt(i)},kt=b,Rt=Z,Dt=et,It=TypeError,Ot={exports:{}},Lt=d,Ut=Object.defineProperty,Wt=function(t,e){try{Ut(Lt,t,{value:e,configurable:!0,writable:!0})}catch(i){Lt[t]=e}return e},Nt=Wt,Ft="__core-js_shared__",zt=d[Ft]||Nt(Ft,{}),jt=zt;(Ot.exports=function(t,e){return jt[t]||(jt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=Ot.exports,Gt=G,Vt=Object,Xt=function(t){return Vt(Gt(t))},Yt=Xt,qt=k({}.hasOwnProperty),Kt=Object.hasOwn||function(t,e){return qt(Yt(t),e)},$t=k,Zt=0,Jt=Math.random(),Qt=$t(1..toString),te=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Qt(++Zt+Jt,36)},ee=Ht,ie=Kt,ne=te,re=gt,se=vt,oe=d.Symbol,ae=ee("wks"),he=se?oe.for||oe:oe&&oe.withoutSetter||ne,le=function(t){return ie(ae,t)||(ae[t]=re&&ie(oe,t)?oe[t]:he("Symbol."+t)),ae[t]},ce=b,ue=et,de=wt,pe=Mt,fe=function(t,e){var i,n;if("string"===e&&Rt(i=t.toString)&&!Dt(n=kt(i,t)))return n;if(Rt(i=t.valueOf)&&!Dt(n=kt(i,t)))return n;if("string"!==e&&Rt(i=t.toString)&&!Dt(n=kt(i,t)))return n;throw It("Can't convert object to primitive value")},ge=TypeError,ve=le("toPrimitive"),ye=function(t,e){if(!ue(t)||de(t))return t;var i,n=pe(t,ve);if(n){if(void 0===e&&(e="default"),i=ce(n,t,e),!ue(i)||de(i))return i;throw ge("Can't convert object to primitive value")}return void 0===e&&(e="number"),fe(t,e)},me=wt,be=function(t){var e=ye(t,"string");return me(e)?e:e+""},xe=et,we=d.document,Se=xe(we)&&xe(we.createElement),Ae=function(t){return Se?we.createElement(t):{}},Te=Ae,Be=!g&&!f((function(){return 7!=Object.defineProperty(Te("div"),"a",{get:function(){return 7}}).a})),Ce=g,_e=b,Pe=x,Ee=C,Me=Y,ke=be,Re=Kt,De=Be,Ie=Object.getOwnPropertyDescriptor;p.f=Ce?Ie:function(t,e){if(t=Me(t),e=ke(e),De)try{return Ie(t,e)}catch(t){}if(Re(t,e))return Ee(!_e(Pe.f,t,e),t[e])};var Oe={},Le=g&&f((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=et,We=String,Ne=TypeError,Fe=function(t){if(Ue(t))return t;throw Ne(We(t)+" is not an object")},ze=g,je=Be,He=Le,Ge=Fe,Ve=be,Xe=TypeError,Ye=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,Ke="enumerable",$e="configurable",Ze="writable";Oe.f=ze?He?function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),"function"==typeof t&&"prototype"===e&&"value"in i&&Ze in i&&!i[Ze]){var n=qe(t,e);n&&n[Ze]&&(t[e]=i.value,i={configurable:$e in i?i[$e]:n[$e],enumerable:Ke in i?i[Ke]:n[Ke],writable:!1})}return Ye(t,e,i)}:Ye:function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),je)try{return Ye(t,e,i)}catch(t){}if("get"in i||"set"in i)throw Xe("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var Je=Oe,Qe=C,ti=g?function(t,e,i){return Je.f(t,e,Qe(1,i))}:function(t,e,i){return t[e]=i,t},ei={exports:{}},ii=g,ni=Kt,ri=Function.prototype,si=ii&&Object.getOwnPropertyDescriptor,oi=ni(ri,"name"),ai={EXISTS:oi,PROPER:oi&&"something"===function(){}.name,CONFIGURABLE:oi&&(!ii||ii&&si(ri,"name").configurable)},hi=Z,li=zt,ci=k(Function.toString);hi(li.inspectSource)||(li.inspectSource=function(t){return ci(t)});var ui,di,pi,fi=li.inspectSource,gi=Z,vi=d.WeakMap,yi=gi(vi)&&/native code/.test(String(vi)),mi=te,bi=Ht("keys"),xi=function(t){return bi[t]||(bi[t]=mi(t))},wi={},Si=yi,Ai=d,Ti=et,Bi=ti,Ci=Kt,_i=zt,Pi=xi,Ei=wi,Mi="Object already initialized",ki=Ai.TypeError,Ri=Ai.WeakMap;if(Si||_i.state){var Di=_i.state||(_i.state=new Ri);Di.get=Di.get,Di.has=Di.has,Di.set=Di.set,ui=function(t,e){if(Di.has(t))throw ki(Mi);return e.facade=t,Di.set(t,e),e},di=function(t){return Di.get(t)||{}},pi=function(t){return Di.has(t)}}else{var Ii=Pi("state");Ei[Ii]=!0,ui=function(t,e){if(Ci(t,Ii))throw ki(Mi);return e.facade=t,Bi(t,Ii,e),e},di=function(t){return Ci(t,Ii)?t[Ii]:{}},pi=function(t){return Ci(t,Ii)}}var Oi={set:ui,get:di,has:pi,enforce:function(t){return pi(t)?di(t):ui(t,{})},getterFor:function(t){return function(e){var i;if(!Ti(e)||(i=di(e)).type!==t)throw ki("Incompatible receiver, "+t+" required");return i}}},Li=k,Ui=f,Wi=Z,Ni=Kt,Fi=g,zi=ai.CONFIGURABLE,ji=fi,Hi=Oi.enforce,Gi=Oi.get,Vi=String,Xi=Object.defineProperty,Yi=Li("".slice),qi=Li("".replace),Ki=Li([].join),$i=Fi&&!Ui((function(){return 8!==Xi((function(){}),"length",{value:8}).length})),Zi=String(String).split("String"),Ji=ei.exports=function(t,e,i){"Symbol("===Yi(Vi(e),0,7)&&(e="["+qi(Vi(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Ni(t,"name")||zi&&t.name!==e)&&(Fi?Xi(t,"name",{value:e,configurable:!0}):t.name=e),$i&&i&&Ni(i,"arity")&&t.length!==i.arity&&Xi(t,"length",{value:i.arity});try{i&&Ni(i,"constructor")&&i.constructor?Fi&&Xi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Hi(t);return Ni(n,"source")||(n.source=Ki(Zi,"string"==typeof e?e:"")),t};Function.prototype.toString=Ji((function(){return Wi(this)&&Gi(this).source||ji(this)}),"toString");var Qi=ei.exports,tn=Z,en=Oe,nn=Qi,rn=Wt,sn=function(t,e,i,n){n||(n={});var r=n.enumerable,s=void 0!==n.name?n.name:e;if(tn(i)&&nn(i,s,n),n.global)r?t[e]=i:rn(e,i);else{try{n.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=i:en.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},on={},an=Math.ceil,hn=Math.floor,ln=Math.trunc||function(t){var e=+t;return(e>0?hn:an)(e)},cn=function(t){var e=+t;return e!=e||0===e?0:ln(e)},un=cn,dn=Math.max,pn=Math.min,fn=function(t,e){var i=un(t);return i<0?dn(i+e,0):pn(i,e)},gn=cn,vn=Math.min,yn=function(t){return t>0?vn(gn(t),9007199254740991):0},mn=function(t){return yn(t.length)},bn=Y,xn=fn,wn=mn,Sn=function(t){return function(e,i,n){var r,s=bn(e),o=wn(s),a=xn(n,o);if(t&&i!=i){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},An={includes:Sn(!0),indexOf:Sn(!1)},Tn=Kt,Bn=Y,Cn=An.indexOf,_n=wi,Pn=k([].push),En=function(t,e){var i,n=Bn(t),r=0,s=[];for(i in n)!Tn(_n,i)&&Tn(n,i)&&Pn(s,i);for(;e.length>r;)Tn(n,i=e[r++])&&(~Cn(s,i)||Pn(s,i));return s},Mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kn=En,Rn=Mn.concat("length","prototype");on.f=Object.getOwnPropertyNames||function(t){return kn(t,Rn)};var Dn={};Dn.f=Object.getOwnPropertySymbols;var In=rt,On=on,Ln=Dn,Un=Fe,Wn=k([].concat),Nn=In("Reflect","ownKeys")||function(t){var e=On.f(Un(t)),i=Ln.f;return i?Wn(e,i(t)):e},Fn=Kt,zn=Nn,jn=p,Hn=Oe,Gn=f,Vn=Z,Xn=/#|\.prototype\./,Yn=function(t,e){var i=Kn[qn(t)];return i==Zn||i!=$n&&(Vn(e)?Gn(e):!!e)},qn=Yn.normalize=function(t){return String(t).replace(Xn,".").toLowerCase()},Kn=Yn.data={},$n=Yn.NATIVE="N",Zn=Yn.POLYFILL="P",Jn=Yn,Qn=d,tr=p.f,er=ti,ir=sn,nr=Wt,rr=function(t,e,i){for(var n=zn(e),r=Hn.f,s=jn.f,o=0;o<n.length;o++){var a=n[o];Fn(t,a)||i&&Fn(i,a)||r(t,a,s(e,a))}},sr=Jn,or=function(t,e){var i,r,s,o,a,h=t.target,l=t.global,c=t.stat;if(i=l?Qn:c?Qn[h]||nr(h,{}):(Qn[h]||{}).prototype)for(r in e){if(o=e[r],s=t.dontCallGetSet?(a=tr(i,r))&&a.value:i[r],!sr(l?r:h+(c?".":"#")+r,t.forced)&&void 0!==s){if(n(o)==n(s))continue;rr(o,s)}(t.sham||s&&s.sham)&&er(o,"sham",!0),ir(i,r,o,t)}},ar={exports:{}},hr={},lr=be,cr=Oe,ur=C,dr=fn,pr=mn,fr=function(t,e,i){var n=lr(e);n in t?cr.f(t,n,ur(0,i)):t[n]=i},gr=Array,vr=Math.max,yr=O,mr=Y,br=on.f,xr=function(t,e,i){for(var n=pr(t),r=dr(e,n),s=dr(void 0===i?n:i,n),o=gr(vr(s-r,0)),a=0;r<s;r++,a++)fr(o,a,t[r]);return o.length=a,o},wr="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];hr.f=function(t){return wr&&"Window"==yr(t)?function(t){try{return br(t)}catch(t){return xr(wr)}}(t):br(mr(t))};var Sr=f((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ar=f,Tr=et,Br=O,Cr=Sr,_r=Object.isExtensible,Pr=Ar((function(){_r(1)}))||Cr?function(t){return!!Tr(t)&&((!Cr||"ArrayBuffer"!=Br(t))&&(!_r||_r(t)))}:_r,Er=!f((function(){return Object.isExtensible(Object.preventExtensions({}))})),Mr=or,kr=k,Rr=wi,Dr=et,Ir=Kt,Or=Oe.f,Lr=on,Ur=hr,Wr=Pr,Nr=Er,Fr=!1,zr=te("meta"),jr=0,Hr=function(t){Or(t,zr,{value:{objectID:"O"+jr++,weakData:{}}})},Gr=ar.exports={enable:function(){Gr.enable=function(){},Fr=!0;var t=Lr.f,e=kr([].splice),i={};i[zr]=1,t(i).length&&(Lr.f=function(i){for(var n=t(i),r=0,s=n.length;r<s;r++)if(n[r]===zr){e(n,r,1);break}return n},Mr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ur.f}))},fastKey:function(t,e){if(!Dr(t))return"symbol"==n(t)?t:("string"==typeof t?"S":"P")+t;if(!Ir(t,zr)){if(!Wr(t))return"F";if(!e)return"E";Hr(t)}return t[zr].objectID},getWeakData:function(t,e){if(!Ir(t,zr)){if(!Wr(t))return!0;if(!e)return!1;Hr(t)}return t[zr].weakData},onFreeze:function(t){return Nr&&Fr&&Wr(t)&&!Ir(t,zr)&&Hr(t),t}};Rr[zr]=!0;var Vr=ar.exports,Xr=O,Yr=k,qr=function(t){if("Function"===Xr(t))return Yr(t)},Kr=_t,$r=v,Zr=qr(qr.bind),Jr=function(t,e){return Kr(t),void 0===e?t:$r?Zr(t,e):function(){return t.apply(e,arguments)}},Qr={},ts=Qr,es=le("iterator"),is=Array.prototype,ns={};ns[le("toStringTag")]="z";var rs="[object z]"===String(ns),ss=Z,os=O,as=le("toStringTag"),hs=Object,ls="Arguments"==os(function(){return arguments}()),cs=rs?os:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=hs(t),as))?i:ls?os(e):"Object"==(n=os(e))&&ss(e.callee)?"Arguments":n},us=cs,ds=Mt,ps=z,fs=Qr,gs=le("iterator"),vs=function(t){if(!ps(t))return ds(t,gs)||ds(t,"@@iterator")||fs[us(t)]},ys=b,ms=_t,bs=Fe,xs=At,ws=vs,Ss=TypeError,As=b,Ts=Fe,Bs=Mt,Cs=Jr,_s=b,Ps=Fe,Es=At,Ms=function(t){return void 0!==t&&(ts.Array===t||is[es]===t)},ks=mn,Rs=st,Ds=function(t,e){var i=arguments.length<2?ws(t):e;if(ms(i))return bs(ys(i,t));throw Ss(xs(t)+" is not iterable")},Is=vs,Os=function(t,e,i){var n,r;Ts(t);try{if(!(n=Bs(t,"return"))){if("throw"===e)throw i;return i}n=As(n,t)}catch(t){r=!0,n=t}if("throw"===e)throw i;if(r)throw n;return Ts(n),i},Ls=TypeError,Us=function(t,e){this.stopped=t,this.result=e},Ws=Us.prototype,Ns=function(t,e,i){var r,s,o,a,h,l,c,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),v=Cs(e,u),y=function(t){return r&&Os(r,"normal",t),new Us(!0,t)},m=function(t){return d?(Ps(t),g?v(t[0],t[1],y):v(t[0],t[1])):g?v(t,y):v(t)};if(p)r=t.iterator;else if(f)r=t;else{if(!(s=Is(t)))throw Ls(Es(t)+" is not iterable");if(Ms(s)){for(o=0,a=ks(t);a>o;o++)if((h=m(t[o]))&&Rs(Ws,h))return h;return new Us(!1)}r=Ds(t,s)}for(l=p?t.next:r.next;!(c=_s(l,r)).done;){try{h=m(c.value)}catch(t){Os(r,"throw",t)}if("object"==n(h)&&h&&Rs(Ws,h))return h}return new Us(!1)},Fs=st,zs=TypeError,js=function(t,e){if(Fs(e,t))return t;throw zs("Incorrect invocation")},Hs=le("iterator"),Gs=!1;try{var Vs=0,Xs={next:function(){return{done:!!Vs++}},return:function(){Gs=!0}};Xs[Hs]=function(){return this},Array.from(Xs,(function(){throw 2}))}catch(t){}var Ys=Oe.f,qs=Kt,Ks=le("toStringTag"),$s=function(t,e,i){t&&!i&&(t=t.prototype),t&&!qs(t,Ks)&&Ys(t,Ks,{configurable:!0,value:e})},Zs=k,Js=_t,Qs=Z,to=String,eo=TypeError,io=function(t,e,i){try{return Zs(Js(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},no=Fe,ro=function(t){if("object"==n(t)||Qs(t))return t;throw eo("Can't set "+to(t)+" as a prototype")},so=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=io(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return no(i),ro(n),e?t(i,n):i.__proto__=n,i}}():void 0),oo=Z,ao=et,ho=so,lo=or,co=d,uo=k,po=Jn,fo=sn,go=Vr,vo=Ns,yo=js,mo=Z,bo=z,xo=et,wo=f,So=function(t,e){if(!e&&!Gs)return!1;var i=!1;try{var n={};n[Hs]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},Ao=$s,To=function(t,e,i){var n,r;return ho&&oo(n=e.constructor)&&n!==i&&ao(r=n.prototype)&&r!==i.prototype&&ho(t,r),t},Bo=function(t,e,i){var n=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=n?"set":"add",o=co[t],a=o&&o.prototype,h=o,l={},c=function(t){var e=uo(a[t]);fo(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!xo(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!xo(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!xo(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})};if(po(t,!mo(o)||!(r||a.forEach&&!wo((function(){(new o).entries().next()})))))h=i.getConstructor(e,t,n,s),go.enable();else if(po(t,!0)){var u=new h,d=u[s](r?{}:-0,1)!=u,p=wo((function(){u.has(1)})),f=So((function(t){new o(t)})),g=!r&&wo((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));f||((h=e((function(t,e){yo(t,a);var i=To(new o,t,h);return bo(e)||vo(e,i[s],{that:i,AS_ENTRIES:n}),i}))).prototype=a,a.constructor=h),(p||g)&&(c("delete"),c("has"),n&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return l[t]=h,lo({global:!0,constructor:!0,forced:h!=o},l),Ao(h,t),r||i.setStrong(h,t,n),h},Co={},_o=En,Po=Mn,Eo=Object.keys||function(t){return _o(t,Po)},Mo=g,ko=Le,Ro=Oe,Do=Fe,Io=Y,Oo=Eo;Co.f=Mo&&!ko?Object.defineProperties:function(t,e){Do(t);for(var i,n=Io(e),r=Oo(e),s=r.length,o=0;s>o;)Ro.f(t,i=r[o++],n[i]);return t};var Lo,Uo=rt("document","documentElement"),Wo=Fe,No=Co,Fo=Mn,zo=wi,jo=Uo,Ho=Ae,Go="prototype",Vo="script",Xo=xi("IE_PROTO"),Yo=function(){},qo=function(t){return"<"+Vo+">"+t+"</"+Vo+">"},Ko=function(t){t.write(qo("")),t.close();var e=t.parentWindow.Object;return t=null,e},$o=function(){try{Lo=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;$o="undefined"!=typeof document?document.domain&&Lo?Ko(Lo):(e=Ho("iframe"),i="java"+Vo+":",e.style.display="none",jo.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(qo("document.F=Object")),t.close(),t.F):Ko(Lo);for(var n=Fo.length;n--;)delete $o[Go][Fo[n]];return $o()};zo[Xo]=!0;var Zo,Jo,Qo,ta=Object.create||function(t,e){var i;return null!==t?(Yo[Go]=Wo(t),i=new Yo,Yo[Go]=null,i[Xo]=t):i=$o(),void 0===e?i:No.f(i,e)},ea=Qi,ia=Oe,na=function(t,e,i){return i.get&&ea(i.get,e,{getter:!0}),i.set&&ea(i.set,e,{setter:!0}),ia.f(t,e,i)},ra=sn,sa=function(t,e,i){for(var n in e)ra(t,n,e[n],i);return t},oa=!f((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),aa=Kt,ha=Z,la=Xt,ca=oa,ua=xi("IE_PROTO"),da=Object,pa=da.prototype,fa=ca?da.getPrototypeOf:function(t){var e=la(t);if(aa(e,ua))return e[ua];var i=e.constructor;return ha(i)&&e instanceof i?i.prototype:e instanceof da?pa:null},ga=f,va=Z,ya=et,ma=fa,ba=sn,xa=le("iterator"),wa=!1;[].keys&&("next"in(Qo=[].keys())?(Jo=ma(ma(Qo)))!==Object.prototype&&(Zo=Jo):wa=!0);var Sa=!ya(Zo)||ga((function(){var t={};return Zo[xa].call(t)!==t}));Sa&&(Zo={}),va(Zo[xa])||ba(Zo,xa,(function(){return this}));var Aa={IteratorPrototype:Zo,BUGGY_SAFARI_ITERATORS:wa},Ta=Aa.IteratorPrototype,Ba=ta,Ca=C,_a=$s,Pa=Qr,Ea=function(){return this},Ma=or,ka=b,Ra=Z,Da=function(t,e,i,n){var r=e+" Iterator";return t.prototype=Ba(Ta,{next:Ca(+!n,i)}),_a(t,r,!1),Pa[r]=Ea,t},Ia=fa,Oa=so,La=$s,Ua=ti,Wa=sn,Na=Qr,Fa=ai.PROPER,za=ai.CONFIGURABLE,ja=Aa.IteratorPrototype,Ha=Aa.BUGGY_SAFARI_ITERATORS,Ga=le("iterator"),Va="keys",Xa="values",Ya="entries",qa=function(){return this},Ka=rt,$a=na,Za=g,Ja=le("species"),Qa=ta,th=na,eh=sa,ih=Jr,nh=js,rh=z,sh=Ns,oh=function(t,e,i,n,r,s,o){Da(i,e,n);var a,h,l,c=function(t){if(t===r&&g)return g;if(!Ha&&t in p)return p[t];switch(t){case Va:case Xa:case Ya:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,p=t.prototype,f=p[Ga]||p["@@iterator"]||r&&p[r],g=!Ha&&f||c(r),v="Array"==e&&p.entries||f;if(v&&(a=Ia(v.call(new t)))!==Object.prototype&&a.next&&(Ia(a)!==ja&&(Oa?Oa(a,ja):Ra(a[Ga])||Wa(a,Ga,qa)),La(a,u,!0)),Fa&&r==Xa&&f&&f.name!==Xa&&(za?Ua(p,"name",Xa):(d=!0,g=function(){return ka(f,this)})),r)if(h={values:c(Xa),keys:s?g:c(Va),entries:c(Ya)},o)for(l in h)(Ha||d||!(l in p))&&Wa(p,l,h[l]);else Ma({target:e,proto:!0,forced:Ha||d},h);return p[Ga]!==g&&Wa(p,Ga,g,{name:r}),Na[e]=g,h},ah=function(t,e){return{value:t,done:e}},hh=function(t){var e=Ka(t);Za&&e&&!e[Ja]&&$a(e,Ja,{configurable:!0,get:function(){return this}})},lh=g,ch=Vr.fastKey,uh=Oi.set,dh=Oi.getterFor,ph={getConstructor:function(t,e,i,n){var r=t((function(t,r){nh(t,s),uh(t,{type:e,index:Qa(null),first:void 0,last:void 0,size:0}),lh||(t.size=0),rh(r)||sh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=dh(e),a=function(t,e,i){var n,r,s=o(t),a=h(t,e);return a?a.value=i:(s.last=a={index:r=ch(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=a),n&&(n.next=a),lh?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},h=function(t,e){var i,n=o(t),r=ch(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return eh(s,{clear:function(){for(var t=o(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,lh?t.size=0:this.size=0},delete:function(t){var e=this,i=o(e),n=h(e,t);if(n){var r=n.next,s=n.previous;delete i.index[n.index],n.removed=!0,s&&(s.next=r),r&&(r.previous=s),i.first==n&&(i.first=r),i.last==n&&(i.last=s),lh?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=o(this),n=ih(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!h(this,t)}}),eh(s,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),lh&&th(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,i){var n=e+" Iterator",r=dh(e),s=dh(n);oh(t,e,(function(t,e){uh(this,{type:n,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?ah("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,ah(void 0,!0))}),i?"entries":"values",!i,!0),hh(e)}};Bo("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ph);var fh=O,gh=Array.isArray||function(t){return"Array"==fh(t)},vh=k,yh=f,mh=Z,bh=cs,xh=fi,wh=function(){},Sh=[],Ah=rt("Reflect","construct"),Th=/^\s*(?:class|function)\b/,Bh=vh(Th.exec),Ch=!Th.exec(wh),_h=function(t){if(!mh(t))return!1;try{return Ah(wh,Sh,t),!0}catch(t){return!1}},Ph=function(t){if(!mh(t))return!1;switch(bh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ch||!!Bh(Th,xh(t))}catch(t){return!0}};Ph.sham=!0;var Eh=!Ah||yh((function(){var t;return _h(_h.call)||!_h(Object)||!_h((function(){t=!0}))||t}))?Ph:_h,Mh=gh,kh=Eh,Rh=et,Dh=le("species"),Ih=Array,Oh=function(t){var e;return Mh(t)&&(e=t.constructor,(kh(e)&&(e===Ih||Mh(e.prototype))||Rh(e)&&null===(e=e[Dh]))&&(e=void 0)),void 0===e?Ih:e},Lh=Jr,Uh=F,Wh=Xt,Nh=mn,Fh=function(t,e){return new(Oh(t))(0===e?0:e)},zh=k([].push),jh=function(t){var e=1==t,i=2==t,n=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(h,l,c,u){for(var d,p,f=Wh(h),g=Uh(f),v=Lh(l,c),y=Nh(g),m=0,b=u||Fh,x=e?b(h,y):i||o?b(h,0):void 0;y>m;m++)if((a||m in g)&&(p=v(d=g[m],m,f),t))if(e)x[m]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:zh(x,d)}else switch(t){case 4:return!1;case 7:zh(x,d)}return s?-1:n||r?r:x}},Hh={forEach:jh(0),map:jh(1),filter:jh(2),some:jh(3),every:jh(4),find:jh(5),findIndex:jh(6),filterReject:jh(7)},Gh=k,Vh=sa,Xh=Vr.getWeakData,Yh=js,qh=Fe,Kh=z,$h=et,Zh=Ns,Jh=Kt,Qh=Oi.set,tl=Oi.getterFor,el=Hh.find,il=Hh.findIndex,nl=Gh([].splice),rl=0,sl=function(t){return t.frozen||(t.frozen=new ol)},ol=function(){this.entries=[]},al=function(t,e){return el(t.entries,(function(t){return t[0]===e}))};ol.prototype={get:function(t){var e=al(this,t);if(e)return e[1]},has:function(t){return!!al(this,t)},set:function(t,e){var i=al(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=il(this.entries,(function(e){return e[0]===t}));return~e&&nl(this.entries,e,1),!!~e}};var hl,ll={getConstructor:function(t,e,i,n){var r=t((function(t,r){Yh(t,s),Qh(t,{type:e,id:rl++,frozen:void 0}),Kh(r)||Zh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=tl(e),a=function(t,e,i){var n=o(t),r=Xh(qh(e),!0);return!0===r?sl(n).set(e,i):r[n.id]=i,t};return Vh(s,{delete:function(t){var e=o(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sl(e).delete(t):i&&Jh(i,e.id)&&delete i[e.id]},has:function(t){var e=o(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sl(e).has(t):i&&Jh(i,e.id)}}),Vh(s,i?{get:function(t){var e=o(this);if($h(t)){var i=Xh(t);return!0===i?sl(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},cl=Er,ul=d,dl=k,pl=sa,fl=Vr,gl=Bo,vl=ll,yl=et,ml=Oi.enforce,bl=f,xl=yi,wl=Object,Sl=Array.isArray,Al=wl.isExtensible,Tl=wl.isFrozen,Bl=wl.isSealed,Cl=wl.freeze,_l=wl.seal,Pl={},El={},Ml=!ul.ActiveXObject&&"ActiveXObject"in ul,kl=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Rl=gl("WeakMap",kl,vl),Dl=Rl.prototype,Il=dl(Dl.set);if(xl)if(Ml){hl=vl.getConstructor(kl,"WeakMap",!0),fl.enable();var Ol=dl(Dl.delete),Ll=dl(Dl.has),Ul=dl(Dl.get);pl(Dl,{delete:function(t){if(yl(t)&&!Al(t)){var e=ml(this);return e.frozen||(e.frozen=new hl),Ol(this,t)||e.frozen.delete(t)}return Ol(this,t)},has:function(t){if(yl(t)&&!Al(t)){var e=ml(this);return e.frozen||(e.frozen=new hl),Ll(this,t)||e.frozen.has(t)}return Ll(this,t)},get:function(t){if(yl(t)&&!Al(t)){var e=ml(this);return e.frozen||(e.frozen=new hl),Ll(this,t)?Ul(this,t):e.frozen.get(t)}return Ul(this,t)},set:function(t,e){if(yl(t)&&!Al(t)){var i=ml(this);i.frozen||(i.frozen=new hl),Ll(this,t)?Il(this,t,e):i.frozen.set(t,e)}else Il(this,t,e);return this}})}else cl&&bl((function(){var t=Cl([]);return Il(new Rl,t,1),!Tl(t)}))&&pl(Dl,{set:function(t,e){var i;return Sl(t)&&(Tl(t)?i=Pl:Bl(t)&&(i=El)),Il(this,t,e),i==Pl&&Cl(t),i==El&&_l(t),this}});var Wl=rt,Nl=k,Fl=Ht,zl=Wl("Map"),jl=Wl("WeakMap"),Hl=Nl([].push),Gl=Fl("metadata"),Vl=Gl.store||(Gl.store=new jl),Xl=function(t,e,i){var n=Vl.get(t);if(!n){if(!i)return;Vl.set(t,n=new zl)}var r=n.get(e);if(!r){if(!i)return;n.set(e,r=new zl)}return r},Yl={store:Vl,getMap:Xl,has:function(t,e,i){var n=Xl(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=Xl(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){Xl(i,n,!0).set(t,e)},keys:function(t,e){var i=Xl(t,e,!1),n=[];return i&&i.forEach((function(t,e){Hl(n,e)})),n},toKey:function(t){return void 0===t||"symbol"==n(t)?t:String(t)}},ql=Fe,Kl=Yl.toKey,$l=Yl.set;or({target:"Reflect",stat:!0},{defineMetadata:function(t,e,i){var n=arguments.length<4?void 0:Kl(arguments[3]);$l(t,e,ql(i),n)}});var Zl=Fe,Jl=Yl.toKey,Ql=Yl.getMap,tc=Yl.store;or({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:Jl(arguments[2]),n=Ql(Zl(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var r=tc.get(e);return r.delete(i),!!r.size||tc.delete(e)}});var ec=Fe,ic=fa,nc=Yl.has,rc=Yl.get,sc=Yl.toKey,oc=function t(e,i,n){if(nc(e,i,n))return rc(e,i,n);var r=ic(i);return null!==r?t(e,r,n):void 0};or({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:sc(arguments[2]);return oc(t,ec(e),i)}});var ac=k,hc=Map.prototype,lc={Map:Map,set:ac(hc.set),get:ac(hc.get),has:ac(hc.has),remove:ac(hc.delete),proto:hc},cc=b,uc=k,dc=function(t,e,i){for(var n,r,s=i||t.next;!(n=cc(s,t)).done;)if(void 0!==(r=e(n.value)))return r},pc=lc.Map,fc=lc.proto,gc=uc(fc.forEach),vc=uc(fc.entries),yc=vc(new pc).next,mc=_t,bc=z,xc=mn,wc=Xt,Sc=function(t,e,i){return i?dc(vc(t),(function(t){return e(t[1],t[0])}),yc):gc(t,e)},Ac=lc.Map,Tc=lc.has,Bc=lc.set,Cc=k([].push),_c=or,Pc=k,Ec=Yl,Mc=Fe,kc=fa,Rc=Pc((function(t){var e,i,n,r=wc(this),s=xc(r),o=[],a=new Ac,h=bc(t)?function(t){return t}:mc(t);for(e=0;e<s;e++)n=h(i=r[e]),Tc(a,n)||Bc(a,n,i);return Sc(a,(function(t){Cc(o,t)})),o})),Dc=Pc([].concat),Ic=Ec.keys,Oc=Ec.toKey,Lc=function t(e,i){var n=Ic(e,i),r=kc(e);if(null===r)return n;var s=t(r,i);return s.length?n.length?Rc(Dc(n,s)):s:n};_c({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Oc(arguments[1]);return Lc(Mc(t),e)}});var Uc=Fe,Wc=Yl.get,Nc=Yl.toKey;or({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:Nc(arguments[2]);return Wc(t,Uc(e),i)}});var Fc=Fe,zc=Yl.keys,jc=Yl.toKey;or({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:jc(arguments[1]);return zc(Fc(t),e)}});var Hc=Fe,Gc=fa,Vc=Yl.has,Xc=Yl.toKey,Yc=function t(e,i,n){if(Vc(e,i,n))return!0;var r=Gc(i);return null!==r&&t(e,r,n)};or({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var i=arguments.length<3?void 0:Xc(arguments[2]);return Yc(t,Hc(e),i)}});var qc=Fe,Kc=Yl.has,$c=Yl.toKey;or({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var i=arguments.length<3?void 0:$c(arguments[2]);return Kc(t,qc(e),i)}});var Zc=Fe,Jc=Yl.toKey,Qc=Yl.set;or({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,n){Qc(t,e,Zc(i),Jc(n))}}});var tu="named",eu="name",iu="unmanaged",nu="optional",ru="inject",su="multi_inject",ou="inversify:tagged",au="inversify:tagged_props",hu="inversify:paramtypes",lu="post_construct",cu="pre_destroy";var uu=[ru,su,eu,iu,tu,nu],du={Request:"Request",Singleton:"Singleton",Transient:"Transient"},pu={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},fu={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},gu=0;function vu(){return gu++}var yu=function(){function t(t,e){this.id=vu(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=pu.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===du.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),mu="Metadata key was used more than once in a parameter:",bu="NULL argument",xu="Key Not Found",wu="Ambiguous match found for serviceIdentifier:",Su="No matching bindings found for serviceIdentifier:",Au="Missing required @injectable annotation in:",Tu="Missing required @inject or @multiInject annotation in:",Bu="Circular dependency found:",Cu="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",_u=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Pu=function(t,e){return"@postConstruct error in class "+t+": "+e},Eu=function(t,e){return"@preDestroy error in class "+t+": "+e},Mu=function(t,e){return"onDeactivation() error in class "+t+": "+e},ku="Maximum call stack size exceeded",Ru=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(hu,t),userGeneratedMetadata:Reflect.getMetadata(ou,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(au,t)||[]},t}(),Du={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Iu(t){return t instanceof RangeError||t.message===ku}function Ou(t){return"function"==typeof t?t.name:"symbol"===n(t)?t.toString():t}function Lu(t,e,i){var n="",r=i(t,e);return 0!==r.length&&(n="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Nu(t.implementationType)),n=n+"\n "+e,t.constraint.metaData&&(n=n+" - "+t.constraint.metaData)}))),n}function Uu(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Uu(t.parentRequest,e))}function Wu(t){t.childRequests.forEach((function(t){if(Uu(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,i){void 0===i&&(i=[]);var n=Ou(e.serviceIdentifier);return i.push(n),null!==e.parentRequest?t(e.parentRequest,i):i}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Bu+" "+e)}Wu(t)}))}function Nu(t){if(t.name)return t.name;var e=t.toString(),i=e.match(/^function\s*([^\s(]+)/);return i?i[1]:"Anonymous function: "+e}var Fu=function(){function t(t){this.id=vu(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),zu=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===tu?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),ju=function(t,e){this.parentContext=t,this.rootRequest=e},Hu=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Gu=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,i=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},i)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),Vu=function(){function t(t,e,i,r){this.id=vu(),this.type=t,this.serviceIdentifier=i;var s="symbol"===n(e)?e.toString().slice(7,-1):e;this.name=new Gu(s||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof r?o=new zu(tu,r):r instanceof zu&&(o=r),null!==o&&this.metadata.push(o)}return t.prototype.hasTag=function(t){for(var e=0,i=this.metadata;e<i.length;e++){if(i[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(su)},t.prototype.matchesArray=function(t){return this.matchesTag(su)(t)},t.prototype.isNamed=function(){return this.hasTag(tu)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return uu.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(nu)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===tu}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return uu.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(tu)(t)},t.prototype.matchesTag=function(t){var e=this;return function(i){for(var n=0,r=e.metadata;n<r.length;n++){var s=r[n];if(s.key===t&&s.value===i)return!0}return!1}},t}(),Xu=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function Yu(t,e,i,n){var r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(Au+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),h=0===i.length&&a.length>0,l=a.length>i.length,c=function(t,e,i,n,r){for(var s=[],o=0;o<r;o++){var a=qu(o,t,e,i,n);null!==a&&s.push(a)}return s}(n,e,s,o,h||l?a.length:i.length),u=$u(t,i,e);return Xu(Xu([],c,!0),u,!0)}function qu(t,e,i,n,r){var s=r[t.toString()]||[],o=Ju(s),a=!0!==o.unmanaged,h=n[t],l=o.inject||o.multiInject;if((h=l||h)instanceof Hu&&(h=h.unwrap()),a){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(Tu+" argument "+t+" in class "+i+".");var c=new Vu(fu.ConstructorArgument,o.targetName,h);return c.metadata=s,c}return null}function Ku(t,e,i,n){var r=t||e;if(void 0===r){var s=Au+" for property "+String(i)+" in class "+n+".";throw new Error(s)}return r}function $u(t,e,i){for(var n=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(n),o=0,a=Object.keys(n).concat(s);o<a.length;o++){var h=a[o],l=n[h],c=Ju(l),u=c.targetName||h,d=Ku(c.inject,c.multiInject,h,i),p=new Vu(fu.ClassProperty,u,d);p.metadata=l,r.push(p)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var g=$u(t,f,i);r=Xu(Xu([],r,!0),g,!0)}return r}function Zu(t,e){var i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){var n=Yu(t,Nu(i),i,!0),r=n.map((function(t){return t.metadata.filter((function(t){return t.key===iu}))})),s=[].concat.apply([],r).length,o=n.length-s;return o>0?o:Zu(t,i)}return 0}function Ju(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[ru],multiInject:e[su],targetName:e[eu],unmanaged:e[iu]}}var Qu=function(){function t(t,e,i,n,r){this.id=vu(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=i,this.target=r,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===i?new Map:null}return t.prototype.addChildRequest=function(e,i,n){var r=new t(e,this.parentContext,this,i,n);return this.childRequests.push(r),r},t}();function td(t){return t._bindingDictionary}function ed(t,e,i,n,r){var s=nd(i.container,r.serviceIdentifier),o=[];return s.length===Du.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=nd(i.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new Qu(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case Du.NoBindingsAvailable:if(i.isOptional())return e;var r=Ou(t),s=Su;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var i="",n=e.getNamedTag(),r=e.getCustomTags();return null!==n&&(i+=n.toString()+"\n"),null!==r&&r.forEach((function(t){i+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+i}return" "+t}(r,i),s+=Lu(n,r,nd),new Error(s);case Du.OnlyOneBindingAvailable:return e;case Du.MultipleBindingsAvailable:default:if(i.isArray())return e;r=Ou(t),s=wu+" "+r;throw s+=Lu(n,r,nd),new Error(s)}}(r.serviceIdentifier,o,r,i.container),o}function id(t,e,i,n,r,s){var o,a;if(null===r){o=ed(t,e,n,null,s),a=new Qu(i,n,null,o,s);var h=new ju(n,a);n.addPlan(h)}else o=ed(t,e,n,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var i=null;if(s.isArray())i=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=a}if(e.type===pu.Instance&&null!==e.implementationType){var r=function(t,e){return Yu(t,Nu(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){var o=Zu(t,e.implementationType);if(r.length<o){var h=_u(Nu(e.implementationType));throw new Error(h)}}r.forEach((function(e){id(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function nd(t,e){var i=[],n=td(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=nd(t.parent,e)),i}function rd(t,e,i,n,r,s,o,a){void 0===a&&(a=!1);var h=new Fu(e),l=function(t,e,i,n,r,s){var o=new zu(t?su:ru,i),a=new Vu(e,n,i,o);if(void 0!==r){var h=new zu(r,s);a.metadata.push(h)}return a}(i,n,r,"",s,o);try{return id(t,a,r,h,null,l),h}catch(t){throw Iu(t)&&Wu(h.plan.rootRequest),t}}function sd(t){return("object"===n(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function od(t){return!!sd(t)||Array.isArray(t)&&t.some(sd)}var ad,hd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},ld=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},cd=function(t,e,i){t.has(e.id)||t.set(e.id,i)},ud=function(t,e){t.cache=e,t.activated=!0,sd(e)&&dd(t,e)},dd=function(t,e){return hd(void 0,void 0,void 0,(function(){var i,n;return ld(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return i=r.sent(),t.cache=i,[3,3];case 2:throw n=r.sent(),t.cache=null,t.activated=!1,n;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(ad||(ad={}));var pd=function(){return pd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pd.apply(this,arguments)},fd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},gd=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},vd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function yd(t,e,i){var n;if(e.length>0){var r=function(t,e){return t.reduce((function(t,i){var n=e(i);return i.target.type===fu.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=od(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=pd(pd({},r),{constr:t});n=r.isAsync?function(t){return fd(this,void 0,void 0,(function(){var e,i;return gd(this,(function(n){switch(n.label){case 0:return[4,bd(t.constructorInjections)];case 1:return e=n.sent(),[4,bd(t.propertyInjections)];case 2:return i=n.sent(),[2,md(pd(pd({},t),{constructorInjections:e,propertyInjections:i}))]}}))}))}(s):md(s)}else n=new t;return n}function md(t){var e,i=new((e=t.constr).bind.apply(e,vd([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,n){var r=e.target.identifier,s=t.propertyInjections[n];i[r]=s})),i}function bd(t){return fd(this,void 0,void 0,(function(){var e,i,n,r;return gd(this,(function(s){for(e=[],i=0,n=t;i<n.length;i++)r=n[i],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function xd(t,e){var i=function(t,e){var i,n;if(Reflect.hasMetadata(lu,t)){var r=Reflect.getMetadata(lu,t);try{return null===(n=(i=e)[r.value])||void 0===n?void 0:n.call(i)}catch(e){throw new Error(Pu(t.name,e.message))}}}(t,e);return sd(i)?i.then((function(){return e})):e}function wd(t,e){t.scope!==du.Singleton&&function(t,e){var i="Class cannot be instantiated in "+(t.scope===du.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Mu(e.name,i));if(Reflect.hasMetadata(cu,e))throw new Error(Eu(e.name,i))}(t,e)}var Sd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},Ad=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Td=function t(e){return function(i){i.parentContext.setCurrentRequest(i);var n=i.bindings,r=i.childRequests,s=i.target&&i.target.isArray(),o=!(i.parentRequest&&i.parentRequest.target&&i.target&&i.parentRequest.target.matchesArray(i.target.serviceIdentifier));if(s&&o)return r.map((function(i){return t(e)(i)}));if(!i.target.isOptional()||0!==n.length){var a=n[0];return Pd(e,i,a)}}},Bd=function(t,e){var i=function(t){switch(t.type){case pu.Factory:return{factory:t.factory,factoryType:ad.Factory};case pu.Provider:return{factory:t.provider,factoryType:ad.Provider};case pu.DynamicValue:return{factory:t.dynamicValue,factoryType:ad.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Iu(t)&&(t=e()),t}}((function(){return i.factory.bind(t)(e)}),(function(){return new Error((t=i.factoryType,n=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+n+"'."));var t,n}))},Cd=function(t,e,i){var n,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case pu.ConstantValue:case pu.Function:e=t.cache;break;case pu.Constructor:case pu.Instance:e=t.implementationType;break;case pu.DynamicValue:e=t.dynamicValue;break;case pu.Provider:e=t.provider;break;case pu.Factory:e=t.factory}if(null===e){var i=Ou(t.serviceIdentifier);throw new Error("Invalid binding type: "+i)}}(i),i.type){case pu.ConstantValue:case pu.Function:n=i.cache;break;case pu.Constructor:n=i.implementationType;break;case pu.Instance:n=function(t,e,i,n){wd(t,e);var r=yd(e,i,n);return sd(r)?r.then((function(t){return xd(e,t)})):xd(e,r)}(i,i.implementationType,r,Td(t));break;default:n=Bd(i,e.parentContext)}return n},_d=function(t,e,i){var n=function(t,e){return e.scope===du.Singleton&&e.activated?e.cache:e.scope===du.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==n||function(t,e,i){e.scope===du.Singleton&&ud(e,i),e.scope===du.Request&&cd(t,e,i)}(t,e,n=i()),n},Pd=function(t,e,i){return _d(t,i,(function(){var n=Cd(t,e,i);return n=sd(n)?n.then((function(t){return Ed(e,i,t)})):Ed(e,i,n)}))};function Ed(t,e,i){var n,r=Md(t.parentContext,e,i),s=Id(t.parentContext.container),o=s.next();do{n=o.value;var a=t.parentContext,h=t.serviceIdentifier,l=Dd(n,h);r=sd(r)?Rd(l,a,r):kd(l,a,r),o=s.next()}while(!0!==o.done&&!td(n).hasKey(t.serviceIdentifier));return r}var Md=function(t,e,i){return"function"==typeof e.onActivation?e.onActivation(t,i):i},kd=function(t,e,i){for(var n=t.next();!n.done;){if(sd(i=n.value(e,i)))return Rd(t,e,i);n=t.next()}return i},Rd=function(t,e,i){return Sd(void 0,void 0,void 0,(function(){var n,r;return Ad(this,(function(s){switch(s.label){case 0:return[4,i];case 1:n=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,n)];case 3:return n=s.sent(),r=t.next(),[3,2];case 4:return[2,n]}}))}))},Dd=function(t,e){var i=t._activations;return i.hasKey(e)?i.get(e).values():[].values()},Id=function(t){for(var e=[t],i=t.parent;null!==i;)e.push(i),i=i.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Od=function t(e,i){var n=e.parentRequest;return null!==n&&(!!i(n)||t(n,i))},Ld=function(t){return function(e){var i=function(i){return null!==i&&null!==i.target&&i.target.matchesTag(t)(e)};return i.metaData=new zu(t,e),i}},Ud=Ld(tu),Wd=function(t){return function(e){var i=null;if(null!==e){if(i=e.bindings[0],"string"==typeof t)return i.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}},Nd=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Fd(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=Ud(t),new Fd(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new Fd(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Ld(t)(e),new Fd(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(t)(e.parentRequest)},new Fd(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Ud(t)(e.parentRequest)},new Fd(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Ld(t)(e)(i.parentRequest)},new Fd(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,Wd(t))},new Fd(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,Wd(t))},new Fd(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,Ud(t))},new Fd(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,Ud(t))},new Fd(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Od(i,Ld(t)(e))},new Fd(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&!Od(i,Ld(t)(e))},new Fd(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Od(e,t)},new Fd(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Od(e,t)},new Fd(this._binding)},t}(),Fd=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Nd(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Nd(this._binding)},t}(),zd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Nd(this._binding),this._bindingOnSyntax=new Fd(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),jd=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=du.Request,new zd(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=du.Transient,new zd(this._binding)},t}(),Hd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Nd(this._binding),this._bindingOnSyntax=new Fd(this._binding),this._bindingInSyntax=new jd(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Gd=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=pu.Instance,this._binding.implementationType=t,new Hd(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=pu.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=pu.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Hd(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=pu.Constructor,this._binding.implementationType=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=pu.Function,this._binding.scope=du.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(i){return e.container.getNamed(t,i)}},new zd(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=pu.Provider,this._binding.provider=t,this._binding.scope=du.Singleton,new zd(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Vd=function(){function t(){}return t.of=function(e,i,n,r,s){var o=new t;return o.bindings=e,o.middleware=i,o.deactivations=r,o.activations=n,o.moduleActivationStore=s,o},t}();var Xd=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(bu);if(null==e)throw new Error(bu);var i=this._map.get(t);void 0!==i?i.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(bu);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(xu)},t.prototype.remove=function(t){if(null==t)throw new Error(bu);if(!this._map.delete(t))throw new Error(xu)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(i,n){var r=t.hasKey(i)?t.get(i):void 0;if(void 0!==r){var s=n.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(i,s)}}))},t.prototype.removeByCondition=function(t){var e=this,i=[];return this._map.forEach((function(n,r){for(var s=[],o=0,a=n;o<a.length;o++){var h=a[o];t(h)?i.push(h):s.push(h)}e._setValue(r,s)})),i},t.prototype.hasKey=function(t){if(null==t)throw new Error(bu);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){t.forEach((function(t){return e.add(i,"object"===n(r=t)&&null!==r&&"clone"in r&&"function"==typeof r.clone?t.clone():t);var r}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,i){t(i,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Yd=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,i){this._getModuleActivationHandlers(t).onDeactivations.add(e,i)},t.prototype.addActivation=function(t,e,i){this._getModuleActivationHandlers(t).onActivations.add(e,i)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){e._map.set(i,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new Xd,onDeactivations:new Xd}},t}(),qd=function(){return qd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qd.apply(this,arguments)},Kd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},$d=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Zd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))},Jd=function(){function t(t){var e=t||{};if("object"!==n(e))throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=du.Transient;else if(e.defaultScope!==du.Singleton&&e.defaultScope!==du.Transient&&e.defaultScope!==du.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=vu(),this._bindingDictionary=new Xd,this._snapshots=[],this._middleware=null,this._activations=new Xd,this._deactivations=new Xd,this.parent=null,this._metadataReader=new Ru,this._moduleActivationStore=new Yd}return t.merge=function(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=new t,o=Zd([e,i],n,!0).map((function(t){return td(t)})),a=td(s);return o.forEach((function(t){var e;e=a,t.traverse((function(t,i){i.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),s},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=this._getContainerModuleHelpersFactory(),n=0,r=t;n<r.length;n++){var s=r[n],o=i(s.id);s.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r,s;return $d(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),i=0,n=t,o.label=1;case 1:return i<n.length?(r=n[i],s=e(r.id),[4,r.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)]):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e.forEach((function(e){var i=t._removeModuleBindings(e.id);t._deactivateSingletons(i),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r;return $d(this,(function(s){switch(s.label){case 0:e=0,i=t,s.label=1;case 1:return e<i.length?(n=i[e],r=this._removeModuleBindings(n.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(n.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||du.Transient,i=new yu(t,e);return this._bindingDictionary.add(t,i),new Gd(i)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Kd(this,void 0,void 0,(function(){return $d(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){switch(i.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:i.sent(),i.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,i){t._deactivateSingletons(i)})),this._bindingDictionary=new Xd},t.prototype.unbindAllAsync=function(){return Kd(this,void 0,void 0,(function(){var t,e=this;return $d(this,(function(i){switch(i.label){case 0:return t=[],this._bindingDictionary.traverse((function(i,n){t.push(e._deactivateSingletonsAsync(n))})),[4,Promise.all(t)];case 1:return i.sent(),this._bindingDictionary=new Xd,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,tu,e)},t.prototype.isBoundTagged=function(t,e,i){var n=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,i,n){var r=new Vu(fu.Variable,"",e,new zu(i,n)),s=new Fu(t);return new Qu(e,s,null,[],r)}(this,t,e,i);n=r.some((function(t){return t.constraint(s)}))}return!n&&this.parent&&(n=this.parent.isBoundTagged(t,e,i)),n},t.prototype.snapshot=function(){this._snapshots.push(Vd.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var i=new t(e||this.options);return i.parent=this,i},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),i)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._getButThrowIfAsync(n)},t.prototype.getTaggedAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){var n;return $d(this,(function(r){return n=this._getNotAllArgs(t,!1,e,i),[2,this._get(n)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,tu,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,tu,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getButThrowIfAsync(n)},t.prototype.getAllTaggedAsync=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getAll(n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,tu,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,tu,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var i=this.get(t);return e||this.unbind(t),i},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(cu,t))return e[Reflect.getMetadata(cu,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var i=this,n=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(sd(r))return this._handleDeactivationError(r.then((function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,n)})),n)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,n);if(sd(s))return this._handleDeactivationError(s,n)}catch(t){throw new Error(Mu(n.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t];case 1:return n.sent(),[3,3];case 2:throw i=n.sent(),new Error(Mu(e.name,i.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var i=this,n=e.next();n.value;){var r=n.value(t);if(sd(r))return r.then((function(){return i._deactivateContainerAsync(t,e)}));n=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:i=e.next(),n.label=1;case 1:return i.value?[4,i.value(t)]:[3,3];case 2:return n.sent(),i=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}},n=function(e){return function(i,n){t._moduleActivationStore.addActivation(e,i,n),t.onActivation(i,n)}},r=function(e){return function(i,n){t._moduleActivationStore.addDeactivation(e,i,n),t.onDeactivation(i,n)}};return function(s){return{bindFunction:(o=s,function(i){var n=t.bind(i);return e(n,o),n}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:n(s),onDeactivationFunction:r(s),rebindFunction:i(s),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var o}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=qd(qd({},t),{contextInterceptor:function(t){return t},targetType:fu.Variable});if(this._middleware){var i=this._middleware(e);if(null==i)throw new Error("Invalid return type in middleware. Middleware must return!");return i}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(od(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}},t.prototype._planAndResolve=function(){var t=this;return function(e){var i=rd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Td(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(i=e.contextInterceptor(i))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return sd(t.cache)?t.cache.then((function(i){return e._deactivate(t,i)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];if(sd(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Kd(this,void 0,void 0,(function(){var e=this;return $d(this,(function(i){switch(i.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return i.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,i){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,i)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,i)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Ou(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,i){var n=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(sd(r))return r.then((function(){return n._preDestroy(i,e)}))}return this._preDestroy(i,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:n.sent(),n.label=2;case 2:return[4,this._preDestroy(i,e)];case 3:return n.sent(),[2]}}))}))},t}(),Qd=function(t){this.id=vu(),this.registry=t};function tp(t,e,i,n){!function(t){if(void 0!==t)throw new Error(Cu)}(e),ip(ou,t,i.toString(),n)}function ep(t){var e=[];if(Array.isArray(t)){var i=function(t){for(var e=new Set,i=0,n=t;i<n.length;i++){var r=n[i];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==i)throw new Error(mu+" "+i.toString())}else e=[t];return e}function ip(t,e,i,n){var r=ep(n),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[i];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(mu+" "+t.key.toString())},h=0,l=o;h<l.length;h++){a(l[h])}o.push.apply(o,r),s[i]=o,Reflect.defineMetadata(t,s,e)}function np(t){return function(e,i,n){"number"==typeof n?tp(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(Cu);ip(au,t.constructor,e,i)}(e,i,t)}}function rp(){return function(t){if(Reflect.hasOwnMetadata(hu,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(hu,e,t),t}}function sp(t){return np(new zu(tu,t))}function op(t){return function(e){return function(i,n,r){if(void 0===e){var s="function"==typeof i?i.name:i.constructor.name;throw new Error("@inject called with undefined this could mean that the class "+s+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.")}return np(new zu(t,e))(i,n,r)}}}var ap=op(ru),hp=op(su);var lp,cp,up=(lp=lu,cp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var i=new zu(lp,e);if(Reflect.hasOwnMetadata(lp,t.constructor))throw new Error(cp);Reflect.defineMetadata(lp,i,t.constructor)}});function dp(t,e,i,r){var s,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(a=(o<3?s(a):o>3?s(e,i,a):s(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a}function pp(t,e){return function(i,n){e(i,n,t)}}function fp(t,e){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;const gp=Symbol("ContributionProvider");class vp{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function yp(t,e){t(gp).toDynamicValue((({container:t})=>new vp(e,t))).inSingletonScope().whenTargetNamed(e)}class mp{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>t.name!==i&&(!e||t.fn===e))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class bp extends mp{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const xp=Symbol.for("EnvContribution"),wp=Symbol.for("VGlobal"),Sp="browser";t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv(Sp),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Sp),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(Sp),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(Sp),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new bp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv(Sp),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Sp),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(Sp),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Sp),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Sp),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Sp),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Sp),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Sp),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Sp),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Sp),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Sp),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Sp),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Sp),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}},t.DefaultGlobal=dp([rp(),pp(0,ap(gp)),pp(0,sp(xp)),fp("design:paramtypes",[Object])],t.DefaultGlobal);var Ap={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Ap);var Tp=i(Ap.exports),Bp=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},Cp=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Bp(t,"Boolean")},_p=function(t){return"function"==typeof t},Pp=function(t){return null==t},Ep=function(t){return null!=t},Mp=function(t){var e=n(t);return null!==t&&"object"===e||"function"===e},kp=function(t){return void 0===t},Rp=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"string"===i:"string"===i||Bp(t,"String")},Dp=function(t){return Array.isArray?Array.isArray(t):Bp(t,"Array")},Ip=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"number"===i:"number"===i||Bp(t,"Number")},Op=function(t){return Ip(t)&&Number.isFinite(t)},Lp=function(t,e,i){for(var n=Rp(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Up=Object.prototype.hasOwnProperty,Wp=function(t,e){return null!=t&&Up.call(t,e)};function Np(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=[],o=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,a){if(null===i)return null;if(0===a)return i;var h,l,c;if("object"!=n(i))return i;if(Dp(i)?h=[]:Bp(i,"RegExp")?(h=new RegExp(i.source,(c="",(l=i).global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c)),i.lastIndex&&(h.lastIndex=i.lastIndex)):h=function(t){return Bp(t,"Date")}(i)?new Date(i.getTime()):void 0===r?Object.create(Object.getPrototypeOf(i)):Object.create(r),e){var u=s.indexOf(i);if(-1!==u)return o[u];s.push(i),o.push(h)}for(var d in i)h[d]=t(i[d],a-1);return h}(t,i)}function Fp(t,e){if(!Dp(t)||!Dp(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var zp=1e-10,jp=1e-10;function Hp(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zp,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:jp)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}var Gp=1e-12,Vp=Math.PI,Xp=Vp/2,Yp=2*Vp,qp=2*Math.PI,Kp=Math.abs,$p=Math.atan2,Zp=Math.cos,Jp=Math.max,Qp=Math.min,tf=Math.sin,ef=Math.sqrt,nf=Math.pow;function rf(t){return t>1?0:t<-1?Vp:Math.acos(t)}function sf(t){return t>=1?Xp:t<=-1?-Xp:Math.asin(t)}function of(t,e,i,n,r){var s,o;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function af(t,e){return t[0]*e[1]-t[1]*e[0]}var hf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;r(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=s}return o(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 Ip(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return Ip(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),lf=function(){function t(){r(this,t)}return o(t,null,[{key:"distancePP",value:function(t,e){return ef(nf(t.x-e.x,2)+nf(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return ef(nf(t-i,2)+nf(e-n,2))}},{key:"distancePN",value:function(t,e,i){return ef(nf(e-t.x,2)+nf(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new hf((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function cf(t,e,i){var n=e.x1,r=e.y1,s=e.x2,o=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}var uf=function(){function t(e){r(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return o(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Dp(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return cf(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,s=this.x2,o=this.y2,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}]),t}(),df=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(i,t);var e=c(i);function i(){return r(this,i),e.apply(this,arguments)}return o(i)}(uf);var pf=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Yp;)t+=Yp;else if(t>0)for(;t>Yp;)t-=Yp;return t};function ff(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var gf,vf,yf,mf,bf,xf,wf,Sf,Af,Tf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;r(this,t),this.a=e,this.b=i,this.c=n,this.d=s,this.e=o,this.f=a}return o(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}},{key:"setValue",value:function(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.e,o=this.f,a=new t,h=e*r-i*n;return a.a=r/h,a.b=-i/h,a.c=-n/h,a.d=e/h,a.e=(n*o-r*s)/h,a.f=-(e*o-i*s)/h,a}},{key:"rotate",value:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,this.e=u,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,s){var o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,u=a*t+l*e,d=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,s=this.d,o=this.e,a=this.f,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,g=t.x,v=t.y;e.x=g*l+v*u+p,e.y=g*c+v*d+f}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){var a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function Bf(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Cf(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;var r,s,o=[0,0],a=[0,0],h=[0,0];if(Bf(o,e,t),Bf(a,n,i),Kp((r=o)[0]-(s=a)[0])+Kp(r[1]-s[1])<1e-12)return!0;Bf(h,i,t);var l=af(h,a)/af(o,a);return l>=0&&l<=1&&[t[0]+o[0]*l,t[1]+o[1]*l]}function _f(t,e,i){var n,r,s,o;return!(t&&e&&(i?(gf=t.x1,vf=t.x2,yf=t.y1,mf=t.y2,bf=e.x1,xf=e.x2,wf=e.y1,Sf=e.y2,gf>vf&&(n=[vf,gf],gf=n[0],vf=n[1]),yf>mf&&(r=[mf,yf],yf=r[0],mf=r[1]),bf>xf&&(s=[xf,bf],bf=s[0],xf=s[1]),wf>Sf&&(o=[Sf,wf],wf=o[0],Sf=o[1]),gf>xf||vf<bf||yf>Sf||mf<wf):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"}(Af||(Af={}));var Pf=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};var Ef,Mf=function(){function t(e,i){r(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),Ep(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Ep(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return o(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Pp(this._canvas)&&(Ep(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Pp(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&Ep(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Pp(this._context)&&Ep(this._canvas)){var t=this._canvas.getContext("2d");Ep(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.fontStyle,n=void 0===i?e.fontStyle:i,r=t.fontVariant,s=void 0===r?e.fontVariant:r,o=t.fontWeight,a=void 0===o?e.fontWeight:o,h=t.fontSize,l=void 0===h?e.fontSize:h,c=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(a?a+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Pp(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,s=this._userSpec,o=s.fontStyle,a=void 0===o?r.fontStyle:o,h=s.fontVariant,l=void 0===h?r.fontVariant:h,c=s.fontWeight,u=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=s.fontSize,p=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=s.fontFamily,g=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,v=s.align,y=s.textAlign,m=void 0===y?null!=v?v:"center":y,b=s.baseline,x=s.textBaseline,w=void 0===x?null!=b?b:"middle":x,S=s.ellipsis,A=s.limit,T=s.lineHeight;return{fontStyle:a,fontVariant:l,fontFamily:g,fontSize:p,fontWeight:u,textAlign:m,textBaseline:w,ellipsis:S,limit:A,lineHeight:void 0===T?p: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(Pp(t))return{width:0,height:0};if(Pp(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,o=i.textAlign,a=i.textBaseline,h=i.ellipsis,l=i.limit,c=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:o,textBaseline:a,ellipsis:!!h,maxLineWidth:l||1/0,lineHeight:c});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),i=this.textSpec,n=i.fontSize,r=i.lineHeight;return{width:e.width,height:null!=r?r:n}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],s=this._measureSpecialChar(r);Pp(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),Pp(s)&&["F","W"].includes(Pf(r))&&(s=this._measureFullSizeChar()),Pp(s)&&(s=this._measureLetterChar()),i.width+=s.width,i.height=Math.max(i.height,s.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},i=this.textSpec,n=i.fontSize,r=i.lineHeight,s=0;s<t.length;s++){var o=t[s],a=["F","W"].includes(Pf(o))?1:.53;e.width+=a*n}return e.height=null!=r?r:n,e}},{key:"_measureReduce",value:function(t,e){var i=this.textSpec,n=i.fontSize,r=i.lineHeight,s={width:0,height:0};if(Pp(t))return s;if(Dp(t)){var o=t.filter(Ep).map((function(t){return t.toString()}));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:o.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Pp(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 Pp(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Pp(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 Ep(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Ep(this._canvas)&&(this._canvas=null),Ep(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Mf.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Mf.NUMBERS_CHAR_SET="0123456789",Mf.FULL_SIZE_CHAR="字",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"}(Ef||(Ef={}));const kf=Yp-1e-8;class Rf{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>kf)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=Yp)<0&&(n+=Yp),(r%=Yp)<0&&(r+=Yp),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=Yp,o=n-n%Xp,a=0;a<4&&o>r;++a,o-=Xp)f(o);else for(o=n-n%Xp+Xp,a=0;a<4&&o<r;++a,o+=Xp)f(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class Df{constructor(){this.curves=[],this.bounds=new df}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const If=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Of={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},Lf={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Uf,Wf,Nf,Ff,zf,jf;function Hf(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(Uf=e[t],Wf=Uf.slice(1),Nf=Uf[0],i=[Nf],n=Wf.match(If),null!==n){for(let t=0,e=n.length;t<e;t++)Ff=n[t],zf=parseFloat(Ff),Number.isNaN(zf)||i.push(zf);if(jf=Of[Nf],i.length-1>jf){let t;for(let e=1,n=i.length;e<n;e+=jf){t=[Nf];for(let n=e,r=e+jf;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Gf,Vf,Xf,Yf,qf,Kf,$f,Zf;function Jf(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180);const c=Math.sin(l),u=Math.cos(l),d=u*(a-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(a-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,v=c/i,y=-c/n,m=u/n,b=g*a+v*h,x=y*a+m*h,w=g*t+v*e,S=y*t+m*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let T=Math.sqrt(A);s===r&&(T=-T);const B=.5*(b+w)-T*(S-x),C=.5*(x+S)+T*(w-b),_=Math.atan2(x-C,b-B);let P=Math.atan2(S-C,w-B)-_;P<0&&1===s?P+=Yp:P>0&&0===s&&(P-=Yp);const E=Math.ceil(Math.abs(P/(Xp+.001))),M=[];for(let t=0;t<E;++t){const e=_+t*P/E,r=_+(t+1)*P/E;M[t]=[B,C,e,r,i,n,c,u]}return M}function Qf(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,u=a*s,d=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),y=.5*(r-n),m=Math.sin(.5*y),b=8/3*m*m/Math.sin(y),x=e+p-b*f,w=i+f+b*p,S=e+g,A=i+v,T=S+b*v,B=A-b*g;return[l*x+c*w,u*x+d*w,l*T+c*B,u*T+d*B,l*S+c*A,u*S+d*A]}function tg(t,e,i,n){const r=Jf(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=Qf(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Gf=t.UpdateTag||(t.UpdateTag={}))[Gf.NONE=0]="NONE",Gf[Gf.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Gf[Gf.UPDATE_SHAPE=2]="UPDATE_SHAPE",Gf[Gf.CLEAR_SHAPE=253]="CLEAR_SHAPE",Gf[Gf.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Gf[Gf.INIT=51]="INIT",Gf[Gf.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Gf[Gf.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Gf[Gf.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Gf[Gf.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Gf[Gf.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Gf[Gf.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t.IContainPointMode=void 0,(Vf=t.IContainPointMode||(t.IContainPointMode={}))[Vf.GLOBAL=1]="GLOBAL",Vf[Vf.LOCAL=16]="LOCAL",Vf[Vf.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Vf[Vf.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Xf=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Xf.INIT=0]="INIT",Xf[Xf.DEFAULT=1]="DEFAULT",Xf[Xf.STATE=2]="STATE",Xf[Xf.ANIMATE_BIND=10]="ANIMATE_BIND",Xf[Xf.ANIMATE_PLAY=11]="ANIMATE_PLAY",Xf[Xf.ANIMATE_START=12]="ANIMATE_START",Xf[Xf.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Xf[Xf.ANIMATE_END=14]="ANIMATE_END",Xf[Xf.TRANSLATE=20]="TRANSLATE",Xf[Xf.TRANSLATE_TO=21]="TRANSLATE_TO",Xf[Xf.SCALE=22]="SCALE",Xf[Xf.SCALE_TO=23]="SCALE_TO",Xf[Xf.ROTATE=24]="ROTATE",Xf[Xf.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Yf=t.AnimateStatus||(t.AnimateStatus={}))[Yf.INITIAL=0]="INITIAL",Yf[Yf.RUNNING=1]="RUNNING",Yf[Yf.PAUSED=2]="PAUSED",Yf[Yf.END=3]="END",t.AnimateMode=void 0,(qf=t.AnimateMode||(t.AnimateMode={}))[qf.NORMAL=0]="NORMAL",qf[qf.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Kf=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Kf.from="from",Kf.to="to",Kf.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,($f=t.CurveTypeEnum||(t.CurveTypeEnum={}))[$f.CubicBezierCurve=0]="CubicBezierCurve",$f[$f.QuadraticBezierCurve=1]="QuadraticBezierCurve",$f[$f.ArcCurve=2]="ArcCurve",$f[$f.LineCurve=3]="LineCurve",$f[$f.EllipseCurve=4]="EllipseCurve",$f[$f.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Zf=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Zf.beforeFillStroke=0]="beforeFillStroke",Zf[Zf.afterFillStroke=1]="afterFillStroke";const eg=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=c*s+n,g=u*o+r,v=d*s+n,y=p*o+r,m=s*h*l,b=o*h*l;t.push(f-m*u,g+b*c,v+m*p,y-b*d,v,y)},ig=[(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 ng(t,e,i=0,n=0,r=1,s=1,o){for(let a=0;a<t.length;a++){const h=t[a];ig[h[0]](h,e,i,n,r,s,o)}}class rg{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function sg(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+=lf.distanceNN(s,o,a,h)}return i/2}function og(t,e,i,n,r){return sg([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function ag(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 hg(t,e,i,n,r){const s=ag(t.x,e.x,i.x,n.x,r),o=ag(t.y,e.y,i.y,n.y,r);return new hf(s,o)}function lg(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=hg(i,n,r,s,e),a=lf.pointAtPP(i,n,e),h=lf.pointAtPP(n,r,e),l=lf.pointAtPP(r,s,e),c=lf.pointAtPP(a,h,e),u=lf.pointAtPP(h,l,e);return[new cg(i,a,c,o),new cg(o,u,l,s)]}class cg extends rg{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return hg(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?og(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Kp(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Kp(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Jp(t-.01,0),i=Qp(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return $p(r.y-n.y,r.x-n.x)}}function ug(t,e){const{p0:i,p1:n}=t,r=lf.pointAtPP(i,n,e);return[new dg(i,r),new dg(r,n)]}class dg extends rg{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return lf.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=$p(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()?lf.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Kp(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Kp(this.p0.y-this.p1.y):0}}class pg{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,o,a){const h=new cg(new hf(this._lastX,this._lastY),new hf(t,e),new hf(i,n),new hf(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 dg(new hf(this._lastX,this._lastY),new hf(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return Kp(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return Kp(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class fg extends pg{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 gg(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class vg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function yg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new pg("linear",null!=n?n:Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return mg(new vg(s,r),e),s}function mg(t,e){return gg(t,e,1)}function bg(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 xg{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){if(2===this._point)bg(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:bg(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 wg(t,e){return gg(t,e,2)}function Sg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return yg(e,i);const s=new pg("basis",null!=n?n:Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return wg(new xg(s,r),e),s}function Ag(t){return t<0?-1:1}function Tg(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(Ag(s)+Ag(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Bg(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Cg(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 _g{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined2,this.lastPoint1);break;case 3:Cg(this,this._t0,Bg(this,this._t0),!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;if(i!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Cg(this,Bg(this,e=Tg(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Cg(this,this._t0,e=Tg(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 Pg extends _g{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Eg(t,e){return gg(t,e,2)}function Mg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return yg(e,i);const s=new pg("monotoneX",null!=n?n:Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Eg(new _g(s,r),e),s}function kg(t,e){return gg(t,e,2)}function Rg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return yg(e,i);const s=new fg("monotoneY",null!=n?n:Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return kg(new Pg(s,r),e),s}let Dg=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Ig(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new pg("step",null!=r?r:Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Og(new Dg(o,i,s),e),o}function Og(t,e){return gg(t,e,1)}class Lg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){this.context.closePath()}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ug(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new pg("linear",null!=n?n:Kp(e[e.length-1].x-e[0].x)>Kp(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Wg(new Lg(s,r),e),s}function Wg(t,e){return gg(t,e,1)}function Ng(t,e,i){switch(e){case"linear":default:return yg(t,i);case"basis":return Sg(t,i);case"monotoneX":return Mg(t,i);case"monotoneY":return Rg(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Ug(t,i)}}class Fg extends Df{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Rf(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Lf.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Lf.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Lf.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([Lf.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([Lf.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([Lf.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([Lf.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([Lf.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Lf.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const t=[];t[Lf.M]=t=>`M${t[1]} ${t[2]}`,t[Lf.L]=t=>`L${t[1]} ${t[2]}`,t[Lf.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Lf.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Lf.A]=t=>{const e=[];eg(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[Lf.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=Hf(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=Ng(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[Lf.M]=this.moveToTransform,t[Lf.L]=this.lineToTransform,t[Lf.Q]=this.quadraticCurveToTransform,t[Lf.C]=this.bezierCurveToTransform,t[Lf.AT]=this.arcToTransform,t[Lf.E]=this.ellipseTransform,t[Lf.R]=this.rectTransform,t[Lf.A]=this.arcTransform,t[Lf.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,r=1){let s,o,a,h,l,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(s=t[g],1===n&&1===r||(s=jg(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":o=u+s[5],a=d+s[6],p=u+s[3],f=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,f+i,o+e,a+i),u=o,d=a;break;case"C":u=s[5],d=s[6],p=s[3],f=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,f+i,u+e,d+i);break;case"s":o=u+s[3],a=d+s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,u+s[1]+e,d+s[2]+i,o+e,a+i),p=u+s[1],f=d+s[2],u=o,d=a;break;case"S":o=s[3],a=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"q":o=u+s[3],a=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"Q":o=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"t":o=u+s[1],a=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-h,f=2*d-l):"q"===c[0]&&(p=2*u-p,f=2*d-f),h=p,l=f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a,p=u+s[1],f=d+s[2];break;case"T":o=s[1],a=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"a":tg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":tg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Lf.L:this.lineToTransform(o,e,i,n,r);break;case Lf.M:this.moveToTransform(o,e,i,n,r);break;case Lf.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Lf.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Lf.A:this.arcToTransform(o,e,i,n,r);break;case Lf.E:this.ellipseTransform(o,e,i,n,r);break;case Lf.R:this.rectTransform(o,e,i,n,r);break;case Lf.AT:this.arcToTransform(o,e,i,n,r);break;case Lf.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),ng(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 Kp(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 Kp(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 zg=["l",0,0,0,0,0,0,0];function jg(t,e,i){const n=zg[0]=t[0];if("a"===n||"A"===n)zg[1]=e*t[1],zg[2]=i*t[2],zg[3]=t[3],zg[4]=t[4],zg[5]=t[5],zg[6]=e*t[6],zg[7]=i*t[7];else if("h"===n||"H"===n)zg[1]=e*t[1];else if("v"===n||"V"===n)zg[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)zg[n]=(n%2==1?e:i)*t[n];return zg}const Hg={alignSelf:"auto"},Gg={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,anchor:[0,0],anchor3d:[0,0],postMatrix:new Tf},Vg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Xg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Yg={outerBorder:{...Xg,distance:0},innerBorder:{...Xg,distance:0},...Xg},qg={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"},Kg={opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,...Vg,...Yg,...Hg},$g={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Zg={strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,...Kg,...Gg};const Jg={...Zg,startAngle:0,endAngle:qp,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1},Qg={...Zg,...$g,points:[],segments:[],curveType:"linear",clipRange:1},tv={...Zg,radius:1,startAngle:0,endAngle:qp},ev={...Zg,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"},iv={...Zg,path:"",width:0,height:0,cornerRadius:0,clip:!1},nv={...Zg,...$g,points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"},rv={...Zg,path:new Fg,customPath:()=>{console.warn("空函数")}},sv={...Zg,points:[],cornerRadius:0},ov={...Zg,width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0},av={...Zg,width:0,height:0,cornerRadius:0,length:0},hv={...Zg,symbolType:"circle",size:10,keepDirIn3d:!0},lv={...Zg,...qg,strokeBoundsBuffer:0,keepDirIn3d:!0},cv={...Zg,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1},uv={repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,...Zg,fill:!0},dv={...uv,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};const pv=new class{},fv={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"}},gv=!0,vv=!1,yv=/\w|\(|\)/,mv=/[.?!,;:/,。?!、;:]/,bv=/\S/;function xv(t,e,i,n,r){if(!e||e<=0)return 0;const s=pv.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=wv(t,o)),o}function wv(t,e){let i=e;for(;yv.test(t[i-1])&&yv.test(t[i])||mv.test(t[i]);)if(i--,i<=0)return e;return i}function Sv(t,e){const i=pv.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}let Av=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=lv.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:qg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:qg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=wv(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);if(n&&s.str!==t){const i=wv(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipText(t,e,i,n,s)}if(a<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipText(t,e,i,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,i,n,r){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(n,e);if(o>i)return s;i-=o;const a=this.clipTextVertical(t,e,i,r);return a.width+=o,a.verticalList.push({text:n,direction:1,width:o}),a}clipTextWithSuffix(t,e,i,n,r){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const a=this._clipText(t,e,i,0,t.length-1);if(r&&a.str!==t){const i=wv(t,a.str.length);i!==a.str.length&&(a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a.str+=n,a.width+=o,a}};Av=dp([rp()],Av);const Tv=Symbol.for("TextMeasureContribution");let Bv=class extends Av{};Bv=dp([rp()],Bv);const Cv=new Jd,_v=Symbol.for("CanvasFactory"),Pv=Symbol.for("Context2dFactory");function Ev(t){return Cv.getNamed(_v,pv.global.env)(t)}const Mv=1e-4,kv=Math.sqrt(3),Rv=1/3;function Dv(t){return t>-Yv&&t<Yv}function Iv(t){return t>Yv||t<-Yv}const Ov=[0,0],Lv=[0,0],Uv=[0,0];function Wv(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Nv(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Fv(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 zv(t){return(t%=qp)<0&&(t+=qp),t}function jv(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 Hv(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)return!1;const c=function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,u=1/0;Ov[0]=o,Ov[1]=a;for(let o=0;o<1;o+=.05){Lv[0]=Nv(t,i,r,o),Lv[1]=Nv(e,n,s,o);const a=Wv(Ov,Lv);a<u&&(l=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<Mv);o++){const o=l-c,a=l+c;Lv[0]=Nv(t,i,r,o),Lv[1]=Nv(e,n,s,o);const h=Wv(Lv,Ov);if(o>=0&&h<u)l=o,u=h;else{Uv[0]=Nv(t,i,r,a),Uv[1]=Nv(e,n,s,a);const o=Wv(Uv,Ov);a<=1&&o<u?(l=a,u=o):c*=.5}}return h&&(h[0]=Nv(t,i,r,l),h[1]=Nv(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,a,h,null);return c<=l/2}function Gv(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||l>t+u&&l>i+u&&l>r+u&&l>o+u||l<t-u&&l<i-u&&l<r-u&&l<o-u)return!1;const d=function(t,e,i,n,r,s,o,a,h,l,c){let u,d,p,f,g=0,v=.005,y=1/0;Ov[0]=h,Ov[1]=l;for(let h=0;h<1;h+=.05)Lv[0]=Fv(t,i,r,o,h),Lv[1]=Fv(e,n,s,a,h),p=Wv(Ov,Lv),p<y&&(g=h,y=p);y=1/0;for(let h=0;h<32&&!(v<Mv);h++)u=g-v,d=g+v,Lv[0]=Fv(t,i,r,o,u),Lv[1]=Fv(e,n,s,a,u),p=Wv(Lv,Ov),u>=0&&p<y?(g=u,y=p):(Uv[0]=Fv(t,i,r,o,d),Uv[1]=Fv(e,n,s,a,d),f=Wv(Uv,Ov),d<=1&&f<y?(g=d,y=f):v*=.5);return c&&(c[0]=Fv(t,i,r,o,g),c[1]=Fv(e,n,s,a,g)),Math.sqrt(y)}(t,e,i,n,r,s,o,a,l,c,null);return d<=u/2}function Vv(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)%qp<1e-4)return!0;if(s){const t=n;n=zv(r),r=zv(t)}else n=zv(n),r=zv(r);n>r&&(r+=qp);let u=Math.atan2(h,a);return u<0&&(u+=qp),u>=n&&u<=r||u+qp>=n&&u+qp<=r}function Xv(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-o+c;return u*u/(l*l+1)<=a/2*a/2}const Yv=1e-4;function qv(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(Dv(o)){if(Iv(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(Dv(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 Kv=[-1,-1,-1],$v=[-1,-1];function Zv(){const t=$v[0];$v[0]=$v[1],$v[1]=t}function Jv(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),h=3*(e-t),l=t-r,c=a*a-3*o*h,u=a*h-9*o*l,d=h*h-3*a*l;let p=0;if(Dv(c)&&Dv(u))if(Dv(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Dv(t)){const t=u/c,e=-a/o+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*a+1.5*o*(-u+e),n=c*a+1.5*o*(-u-e);i=i<0?-Math.pow(-i,Rv):Math.pow(i,Rv),n=n<0?-Math.pow(-n,Rv):Math.pow(n,Rv);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),h=(-a+i*(n+kv*Math.sin(e)))/(3*o),l=(-a+i*(n-kv*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,Kv);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=Kv[l],g=0===c||1===c?.5:1;Fv(t,i,r,o,c)<h||(d<0&&(d=qv(e,n,s,a,$v),$v[1]<$v[0]&&d>1&&Zv(),p=Fv(e,n,s,a,$v[0]),d>1&&(f=Fv(e,n,s,a,$v[1]))),2===d?c<$v[0]?u+=p<e?g:-g:c<$v[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<$v[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function Qv(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(Dv(s)){if(Iv(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(Dv(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,Kv);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=Nv(e,n,s,l);for(let n=0;n<h;n++){const h=0===Kv[n]||1===Kv[n]?.5:1;Nv(t,i,r,Kv[n])<o||(Kv[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===Kv[0]||1===Kv[0]?.5:1;return Nv(t,i,r,Kv[0])<o?0:s<e?c:-c}function ty(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);Kv[0]=-h,Kv[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=qp-1e-4){n=0,r=qp;const e=s?1:-1;return o>=Kv[0]+t&&o<=Kv[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=qp,r+=qp);let c=0;for(let e=0;e<2;e++){const i=Kv[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=qp+t),(t>=n&&t<=r||t+qp>=n&&t+qp<=r)&&(t>Vp/2&&t<1.5*Vp&&(e=-e),c+=e)}}return c}function ey(t){return Math.round(t/Vp*1e8)/1e8%2*Vp}function iy(t,e){let i=ey(t[0]);i<0&&(i+=qp);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=qp?r=i+qp:e&&i-r>=qp?r=i-qp:!e&&i>r?r=i+(qp-ey(i-r)):e&&i<r&&(r=i-(qp-ey(r-i))),t[0]=i,t[1]=r}const ny=[0,0];function ry(t,e,i,n,r){const s=t,o=t.length;let a,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Lf.M&&t>1&&(i||(l+=jv(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],v=o[1],y=o[2],m=o[3],b=o[4],x=o[5],w=o[6];let S=b,A=x;ny[0]=S,ny[1]=A,iy(ny,Boolean(o[6])),S=ny[0],A=ny[1];const T=S,B=A-S,C=!!(1-(o[6]?0:1)),_=(n-v)*m/m+v;switch(g){case Lf.M:d=v,p=y,c=d,u=p;break;case Lf.L:if(i){if(Xv(c,u,v,y,e,n,r))return!0}else l+=jv(c,u,v,y,n,r)||0;c=v,u=y;break;case Lf.C:if(i){if(Gv(c,u,v,y,m,b,x,w,e,n,r))return!0}else l+=Jv(c,u,v,y,m,b,x,w,n,r)||0;c=x,u=w;break;case Lf.Q:if(i){if(Hv(c,u,v,y,m,b,e,n,r))return!0}else l+=Qv(c,u,v,y,m,b,n,r)||0;c=m,u=b;break;case Lf.A:if(a=Math.cos(T)*m+v,h=Math.sin(T)*m+y,f?(d=a,p=h):l+=jv(c,u,a,h,n,r),i){if(Vv(v,y,m,T,T+B,C,e,_,r))return!0}else l+=ty(v,y,m,T,T+B,C,_,r);c=Math.cos(T+B)*m+v,u=Math.sin(T+B)*m+y;break;case Lf.R:if(d=c=v,p=u=y,a=d+m,h=p+b,i){if(Xv(d,p,a,p,e,n,r)||Xv(a,p,a,h,e,n,r)||Xv(a,h,d,h,e,n,r)||Xv(d,h,d,p,e,n,r))return!0}else l+=jv(a,p,a,h,n,r),l+=jv(d,h,d,p,n,r);break;case Lf.Z:if(i){if(Xv(c,u,d,p,e,n,r))return!0}else l+=jv(c,u,d,p,n,r);c=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<Yv)||(l+=jv(c,u,d,p,n,r)||0),0!==l}var sy;t.DefaultGraphicUtil=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const i=Ev({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:qg.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Mf({defaultFontParams:{fontFamily:qg.fontFamily,fontSize:qg.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Mf.ALPHABET_CHAR_SET+Mf.ALPHABET_CHAR_SET.toUpperCase(),...null!=e?e:{}},t)}},t.DefaultGraphicUtil=dp([rp(),pp(0,ap(gp)),pp(0,sp(Tv)),pp(1,ap(wp)),fp("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(sy||(sy={}));const oy=new Tf;t.DefaultTransformUtil=class{constructor(){this.matrix=new Tf}init(t){return this.mode=sy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=sy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(oy.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(oy.a,oy.b,oy.c,oy.d,oy.e,oy.f),this}scale(t,e,i){return this.mode===sy.matrix?this.scaleMatrix(t,e,i):this}translateMatrix(t,e){const i=this.outSourceMatrix;return oy.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(oy.a,oy.b,oy.c,oy.d,oy.e,oy.f),this}translate(t,e){return this.mode===sy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===sy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=dp([rp(),fp("design:paramtypes",[])],t.DefaultTransformUtil);const ay={arc:Jg,area:Qg,circle:tv,line:nv,path:rv,symbol:hv,text:lv,rect:ov,rect3d:av,polygon:sv,richtext:cv,richtextIcon:dv,image:uv,group:ev,glyph:iv},hy=Object.keys(ay);function ly(){return{arc:Object.assign({},ay.arc),area:Object.assign({},ay.area),circle:Object.assign({},ay.circle),line:Object.assign({},ay.line),path:Object.assign({},ay.path),symbol:Object.assign({},ay.symbol),text:Object.assign({},ay.text),rect:Object.assign({},ay.rect),rect3d:Object.assign({},ay.rect3d),polygon:Object.assign({},ay.polygon),richtext:Object.assign({},ay.richtext),richtextIcon:Object.assign({},ay.richtextIcon),image:Object.assign({},ay.image),group:Object.assign({},ay.group),glyph:Object.assign({},ay.glyph)}}function cy(t,e,i=!0){e&&(i?Object.keys(e).forEach((i=>{t[i]?Object.assign(t[i],e[i]):t[i]=e[i]})):Object.keys(e).forEach((i=>{if(t[i]){const n=t[i],r=e[i];Object.keys(e[i]).forEach((t=>{void 0===n[t]&&(n[t]=r[t])}))}else t[i]=e[i]})))}const uy=new Array(60).fill(0).map((()=>ly()));class dy{constructor(){this._defaultTheme=uy.pop()||ly(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0),this.userTheme?cy(this.userTheme,t.userTheme,!1):this.userTheme=Np(t.userTheme),cy(e,t.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this._defaultTheme,n=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);hy.forEach((r=>{var o,a;e[r]||s||t[r]?n[r]=Object.assign({},i[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):n[r]=i[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const py=new dy;function fy(t,e){return t.glyphHost?fy(t.glyphHost):e?(t.isContainer,e):gy(t)||py.getTheme()}function gy(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)):py.getTheme()}return null}class vy{static GenAutoIncrementId(){return vy.auto_increment_id++}}vy.auto_increment_id=0;class yy extends Tp{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=vy.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}async forEachChildrenAsync(t,e=!1){if(e){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){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&console.warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n))&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=Cp(i,!0)&&i||Mp(i)&&i.capture,r=Mp(i)&&i.once,s=_p(e)?void 0:e;return t=n?`${t}capture`:t,e=_p(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=Cp(i,!0)&&i||Mp(i)&&i.capture,r=_p(e)?void 0:e;t=n?`${t}capture`:t,e=_p(e)?e:e.handleEvent;const s=Mp(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 Mp(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class my{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=my.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new hf,this.page=new hf,this.canvas=new hf,this.viewport=new hf,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class by extends my{constructor(){super(...arguments),this.client=new hf,this.movement=new hf,this.offset=new hf,this.global=new hf,this.screen=new hf}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class xy extends by{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new xy(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}class wy extends by{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new wy(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}wy.DOM_DELTA_PIXEL=0,wy.DOM_DELTA_LINE=1,wy.DOM_DELTA_PAGE=2;class Sy extends my{constructor(t,e){super(),this.type=t,this.detail=e}}const Ay="object"==typeof performance&&performance.now?performance:Date;function Ty(t){return"mouse"===t||"pen"===t}class By{constructor(t){this.dispatch=new Tp,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof xy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(Ty(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof xy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=Ty(r.pointerType),o=this.trackingData(t.pointerId),a=this.findMountedTarget(o.overTargets);if(o.overTargets&&a&&a!==this.rootTarget&&a!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,a||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(a)){const e=this.createPointerEvent(t,"pointerleave",a||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(a!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==a?void 0:a.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==a&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const h="dispatchEvent";this[h](r,"pointermove"),"touch"===r.pointerType&&this[h](r,"touchmove"),s&&(this[h](r,"mousemove"),this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),o.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof xy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),o=Ty(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const a=this.clonePointerEvent(s,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),o&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(a)},this.onPointerOut=(t,e)=>{if(!(t instanceof xy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Ty(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursor=""},this.onPointerUp=(t,e)=>{if(!(t instanceof xy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=Ay.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Ty(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(Ty(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,Ty(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this.dispatchEvent(e,"tap"),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof xy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):Ty(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e;if(!this.rootTarget)return;const i=this.mappingTable[t.type];let n;const r=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[r])?n=this._prePointTargetCache[r]:(n=this.pickTarget(t.canvasX,t.canvasY),this._prePointTargetCache={[r]:n}),i)for(let e=0,r=i.length;e<r;e++)i[e].fn(t,n);else console.warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(xy);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(wy);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y),i}clonePointerEvent(t,e){const i=this.allocateEvent(xy);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof xy&&e instanceof xy&&(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 by&&e instanceof by&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Ay.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);else 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){let i;const n=this.rootTarget.pick(t,e);return i=n&&n.graphic?n.graphic:n&&n.group?n.group:t>=0&&t<=Lp(this.rootTarget,"width")&&e>=0&&e<=Lp(this.rootTarget,"height")?this.rootTarget:null,i}}const Cy={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof my))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Sy(t,e))}},_y={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Py{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:o=!1}=t;this.manager=new By(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new xy,this.rootWheelEvent=new wy,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t="default"){const{applyStyles:e,domElement:i}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&e?i.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&e&&Object.assign(i.style,n):e&&Rp(t)&&!Wp(this.cursorStyles,t)&&(i.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];kp(n.button)&&(n.button=0),kp(n.buttons)&&(n.buttons=1),kp(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),kp(n.width)&&(n.width=n.radiusX||1),kp(n.height)&&(n.height=n.radiusY||1),kp(n.tiltX)&&(n.tiltX=0),kp(n.tiltY)&&(n.tiltY=0),kp(n.pointerType)&&(n.pointerType="touch"),kp(n.pointerId)&&(n.pointerId=n.identifier||0),kp(n.pressure)&&(n.pressure=n.force||.5),kp(n.twist)&&(n.twist=0),kp(n.tangentialPressure)&&(n.tangentialPressure=0),kp(n.layerX)&&(n.layerX=n.offsetX=n.clientX),kp(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const i=t;kp(i.isPrimary)&&(i.isPrimary=!0),kp(i.width)&&(i.width=1),kp(i.height)&&(i.height=1),kp(i.tiltX)&&(i.tiltX=0),kp(i.tiltY)&&(i.tiltY=0),kp(i.pointerType)&&(i.pointerType="mouse"),kp(i.pointerId)&&(i.pointerId=1),kp(i.pressure)&&(i.pressure=.5),kp(i.twist)&&(i.twist=0),kp(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=_y[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Ay.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}const Ey=(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"},My=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};class ky{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return ky.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 Ry{static Avaliable(){return!0}avaliable(){return Ry.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 Dy{static Avaliable(){return!!pv.global.getRequestAnimationFrame()}avaliable(){return Dy.Avaliable()}tick(t,e){pv.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Iy;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Iy||(Iy={}));class Oy{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Iy.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=Iy.INITIAL,pv.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),pv.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:Dy},{mode:"timeout",cons:Ry},{mode:"manual",cons:ky}];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 Dy;break;case"timeout":t=new Ry;break;case"manual":t=new ky;break;default:console.warn("非法的计时器模式"),t=new Dy}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!==Iy.INITIAL&&(this.status=Iy.PAUSE,!0)}resume(){return this.status!==Iy.INITIAL&&(this.status=Iy.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Iy.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Iy.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=Iy.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Iy.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Ly{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-Ly.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Ly.bounceIn(2*t):.5*Ly.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/qp*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*qp/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/qp*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*qp/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/qp*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*qp/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*qp/e)*.5+1}}}Ly.quadIn=Ly.getPowIn(2),Ly.quadOut=Ly.getPowOut(2),Ly.quadInOut=Ly.getPowInOut(2),Ly.cubicIn=Ly.getPowIn(3),Ly.cubicOut=Ly.getPowOut(3),Ly.cubicInOut=Ly.getPowInOut(3),Ly.quartIn=Ly.getPowIn(4),Ly.quartOut=Ly.getPowOut(4),Ly.quartInOut=Ly.getPowInOut(4),Ly.quintIn=Ly.getPowIn(5),Ly.quintOut=Ly.getPowOut(5),Ly.quintInOut=Ly.getPowInOut(5),Ly.backIn=Ly.getBackIn(1.7),Ly.backOut=Ly.getBackOut(1.7),Ly.backInOut=Ly.getBackInOut(1.7),Ly.elasticIn=Ly.getElasticIn(1,.3),Ly.elasticOut=Ly.getElasticOut(1,.3),Ly.elasticInOut=Ly.getElasticInOut(1,.3*1.5);class Uy{constructor(){this.id=vy.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){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),t.release()}}const Wy=new Uy;class Ny{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(i,this.step.getLastProps()),this.onUpdate(t,e,i),t&&this.onEnd()}}class Fy extends Ny{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class zy{constructor(e=vy.GenAutoIncrementId(),i=Wy){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new jy(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.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=Jp(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){zy.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=zy.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 Fy((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=zy.interpolateMap.get(t)||zy.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 jy(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()}}zy.mode=t.AnimateMode.NORMAL,zy.interpolateMap=new Map;class jy{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 Hy(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?Ly[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?Ly[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new Hy(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,o,a=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0)return a=!0,a;if(s=Math.floor(t/i),o=t-s*i,a=t>=n*i+i,a&&(o=i,s=n,t=o*s+i),t===r)return a;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Hy{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Gy={duration:200,easing:"cubicOut"},Vy={duration:1e3,easing:"quadInOut"};var Xy;t.Edge=void 0,(Xy=t.Edge||(t.Edge={}))[Xy.Top=1]="Top",Xy[Xy.Right=2]="Right",Xy[Xy.Bottom=4]="Bottom",Xy[Xy.Left=8]="Left",Xy[Xy.ALL=15]="ALL";const Yy=[!1,!1,!1,!1],qy=t=>{var e;let i=!0;if(Cp(t,!0)){for(let n=0;n<4;n++)Yy[n]=t,i&&(i=!(null!==(e=Yy[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Yy[e]=!!t[e],i&&(i=!!Yy[e]);else Yy[0]=!1,Yy[1]=!1,Yy[2]=!1,Yy[3]=!1;return{isFullStroke:i,stroke:Yy}},Ky=[0,0,0,0],$y=t=>t?Dp(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Ky[0]=t[0],Ky[2]=t[0],Ky[1]=t[1],Ky[3]=t[1],Ky):t:t:0,Zy=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Jy=[1,2,3,0,1,2,3,0];function Qy(t,e,i,n){for(;t>=qp;)t-=qp;for(;t<0;)t+=qp;for(;t>e;)e+=qp;Zy[0].x=i,Zy[1].y=i,Zy[2].x=-i,Zy[3].y=-i;const r=Math.ceil(t/Xp)%4,s=Math.ceil(e/Xp)%4;if(n.add(Zp(t)*i,tf(t)*i),n.add(Zp(e)*i,tf(e)*i),r!==s||e-t>Vp){let t=!1;for(let e=0;e<Jy.length;e++)if(t||r!==Jy[e]){if(t&&s===Jy[e])break;if(t){const t=Zy[Jy[e]];n.add(t.x,t.y)}}else{t=!0;const e=Zy[r];n.add(e.x,e.y)}}}function tm(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function em(t,e,i){const{x:n,y:r}=of(t.x,t.y,e.x,e.y,i),{x:s,y:o}=of(t.x1,t.y1,e.x1,e.y1,i),a=new hf(n,r,s,o);return a.defined=e.defined,a}function im(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 hf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=em(t[r],e[r],i)}else{n=e.map((t=>{const e=new hf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=em(t[r],e[r],i)}return n}const nm=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],rm=t=>nm.includes(t);function sm(t,e){if(Dp(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class om{constructor(){this.durations=[],this.timeout=om.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}om.TimeOut=1e3/60;const am=new om;var hm;!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"}(hm||(hm={}));class lm extends Ny{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function cm(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,u=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function um(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),u=[o[0],o[1]];let d=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;cm(e,n,h,p,o,r),cm(i,a,l,f,o,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],h=r[6],l=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function dm(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 pm(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 fm(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 gm(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,o=l)}return o}function vm(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=fm(a),c=fm(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=pm(a));const y=6*gm(a,h,l,c),m=v-2;for(let t=0;t<m;t+=2){const e=(y+t)%m+2;u[t+2]=a[e]-l[0],u[t+3]=a[e+1]-l[1]}if(u[0]=a[y]-l[0],u[1]=a[y+1]-l[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<a.length;e+=2){const r=u[e],s=u[e+1],o=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,d=o*t+a*i;g[e]=l,g[e+1]=d;const p=l-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<v;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function ym(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]=um(a,h),i=l,n=c):(c=dm(n,a),l=a):(l=dm(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const mm=(t,e,i,n,r)=>{Hp(e,n)&&Hp(i,r)||t.push(e,i,n,r,n,r)};function bm(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Lf.L,Lf.C,Lf.Q].includes(i[0])&&(n=[o,a])),i[0]){case Lf.M:r=o=i[1],s=a=i[2],h(o,a);break;case Lf.L:l=i[1],c=i[2],mm(n,r,s,l,c),r=l,s=c;break;case Lf.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Lf.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Lf.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=l,a=c,h(o,a)):mm(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const y=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=y){const r=v?Math.max(i+y,g):Math.min(i+y,g);eg(n,i,r,t,e,u,d)}break}case Lf.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,y=!!i[8],m=!Hp(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,S=Math.sin(g)*d;m?(l=w*b-S*x+t,c=w*x+S*b+e):(l=w+t,c=S+e),p?(o=l,a=c,h(o,a)):mm(n,r,s,l,c),w=Math.cos(v)*u,S=Math.sin(v)*d,m?(r=w*b-S*x+t,s=w*x+S*b+e):(r=w+t,s=S+e);const A=(y?-1:1)*Math.PI/2;for(let i=g;y?i>v:i<v;i+=A){const r=y?Math.max(i+A,v):Math.min(i+A,v);if(eg(n,i,r,t,e,u,d),m){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],S=n[r+1],n[r]=(w-t)*b-(S-e)*x+t,n[r+1]=(w-t)*x+(S-e)*b+e}}break}case Lf.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),mm(n,l,a,l,c),mm(n,l,c,o,c),mm(n,o,c,o,a),mm(n,o,a,l,a);break;case Lf.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=lf.distancePP({x:r,y:s},{x:t,y:e}),d=lf.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,y=lf.distancePP({x:g,y:v},{x:0,y:0}),m=t+f*g/y,b=h+f*v/y,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,mm(n,r,s,o,a),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const w=ff({x:m,y:b},{x:o,y:a}),S=ff({x:m,y:b},{x:r,y:s});eg(n,w,S,m,b,c,c);break}case Lf.Z:n&&mm(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function xm(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 wm(t){const e=new Fg;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}function Sm(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 Am=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=Sm(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},Tm=(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=Sm(a*(s+o)/2,h,e),c=[],u=h/l.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-u*t*d,outerRadius:o-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Bm=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=Sm(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},Cm=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(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},_m=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const o=r.segments;s||(s=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const a=s.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(t.y)));if(!a.length)return[];const h=[];a.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return Rm(s,e,l),l},Pm=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Cm(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Cm(t,e)}return[]};const Em=t=>t.map((t=>({x:t.x,y:t.y}))),Mm=(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=Cf([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[Em(t),Em(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:l.x,y:l.y}),[u,d]},km=t=>{const e=new uf;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 Mm(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Mm(t,{x:e.x1,y:r},{x:e.x2,y:r})},Rm=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=km(t);Rm(r[0],n,i),Rm(r[1],e-n,i)}},Dm=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Em(i)}];const n=[];return Rm(i,e,n),n},Im=(t,e)=>{const i=bm(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:wm(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]});Rm(e,t===n-1?o:s,r),o-=s}return r};var Om={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const Lm={};for(const t in Om)Wp(Om,t)&&(Lm[Om[t]]=t);const Um={to:{},get:{}};function Wm(t,e,i){return Math.min(Math.max(e,t),i)}function Nm(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Um.get=function(t,e=[0,0,0,1]){let i,n;switch(t.substring(0,3).toLowerCase()){case"hsl":i=Um.get.hsl(t,e),n="hsl";break;case"hwb":i=Um.get.hwb(t,e),n="hwb";break;default:i=Um.get.rgb(t,e),n="rgb"}return i?{model:n,value:i}:null},Um.get.rgb=function(t,e=[0,0,0,1]){if(!t)return null;const i=e;let n,r,s;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(s=n[2],n=n[1],r=0;r<3;r++){const t=2*r;i[r]=parseInt(n.slice(t,t+2),16)}s&&(i[3]=Math.round(parseInt(s,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],s=n[3],r=0;r<3;r++)i[r]=parseInt(n[r]+n[r],16);s&&(i[3]=Math.round(parseInt(s+s,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(n[r+1],10);n[4]&&(i[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(n=t.match(/(\D+)/)){if("transparent"===n[1])return[0,0,0,0];const t=Om[n[1]];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i?(i[3]=1,i):null}return null}for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(n[r+1]));n[4]&&(i[3]=parseFloat(n[4]))}for(r=0;r<3;r++)i[r]=Wm(i[r],0,255);return i[3]=Wm(i[3],0,1),i},Um.get.hsl=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])+360)%360,e[1]=Wm(parseFloat(i[2]),0,100),e[2]=Wm(parseFloat(i[3]),0,100),e[3]=Wm(isNaN(t)?1:t,0,1),e}return null},Um.get.hwb=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])%360+360)%360,e[1]=Wm(parseFloat(i[2]),0,100),e[2]=Wm(parseFloat(i[3]),0,100),e[3]=Wm(isNaN(t)?1:t,0,1),e}return null},Um.to.hex=function(...t){const e=t;return"#"+Nm(e[0])+Nm(e[1])+Nm(e[2])+(e[3]<1?Nm(Math.round(255*e[3])):"")},Um.to.rgb=function(...t){const e=t;return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Um.to.rgb.percent=function(...t){const e=t,i=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+i+"%, "+n+"%, "+r+"%)":"rgba("+i+"%, "+n+"%, "+r+"%, "+e[3]+")"},Um.to.hsl=function(...t){const e=t;return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Um.to.hwb=function(...t){const e=t;let i="";return e.length>=4&&1!==e[3]&&(i=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+i+")"},Um.to.keyword=function(t){return Lm[t.slice(0,3)]};const Fm=Um;var zm;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(zm||(zm={}));class jm{static Get(t,e=zm.Color1,i=[0,0,0,1]){if(e===zm.Color1){let e=jm.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;if(e=Um.get(t),e&&e.value){const n=e.value,r=[n[0]/255,n[1]/255,n[2]/255,n[3]];jm.store1[t]=r,jm.store255[t]=n,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]}return i}let n=jm.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;if(n=Um.get(t),n&&n.value){const e=n.value;jm.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],jm.store255[t]=e,i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}static Set(t,e,i){if(e===zm.Color1){if(jm.store1[t])return;jm.store1[t]=i,jm.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(jm.store255[t])return;jm.store255[t]=i,jm.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Hm(t,e=!1){return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Gm(t,e,i,n,r){if(!t||!e)return t&&Hm(t)||e&&Hm(e)||!1;let s,o,a=!1,h=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=jm.Get(t,zm.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=jm.Get(e,zm.Color255):h=!0,a!==h){const s=a?t:e,o=a?e:t,h={...s,stops:s.stops.map((t=>({...t,color:Hm(o)})))};return a?Gm(s,h,i,n,r):Gm(h,s,i,n,r)}if(a){if(t.gradient===e.gradient){const n=t,r=e,s=n.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={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:Ym(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={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:Ym(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={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:Ym(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i)}return!1}r&&r(s,o);const l=function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(s,o,i);return Hm(l,n)}jm.store255={},jm.store1={};const Vm=[0,0,0,0],Xm=[0,0,0,0];function Ym(t,e,i){return jm.Get(t,zm.Color255,Vm),jm.Get(e,zm.Color255,Xm),`rgba(${Math.round(Vm[0]+(Xm[0]-Vm[0])*i)},${Math.round(Vm[1]+(Xm[1]-Vm[1])*i)},${Math.round(Vm[2]+(Xm[2]-Vm[2])*i)},${Vm[3]+(Xm[3]-Vm[3])*i})`}const qm=(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=Gm(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},Km=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*d+r[0],n[t+1]=o*d+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},$m=(t,e,i)=>{const n=t?bm(t):[],r=bm(e);i&&n&&(i.fromTransform&&xm(n,i.fromTransform.clone().getInverse()),xm(n,i.toTransfrom));const[s,o]=ym(n,r);return t?vm(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},Zm=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],Jm=(t,e)=>{if(!t||!e)return null;const i=[];let n=!1;return Object.keys(t).forEach((r=>{if(!Zm.includes(r))return;const s=e[r];Pp(s)||Pp(t[r])||s===t[r]||("fill"===r||"stroke"===r?i.push({from:"string"==typeof t[r]?jm.Get(t[r],zm.Color255):t[r],to:"string"==typeof s?jm.Get(s,zm.Color255):s,key:r}):i.push({from:t[r],to:s,key:r}),n=!0)})),n?i:null};class Qm extends Ny{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;Km(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&qm(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const tb=(t,e,i,n)=>{var r,s,o;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let a=null==t?void 0:t.globalTransMatrix;n&&a&&(a=n.clone().multiply(a.a,a.b,a.c,a.d,a.e,a.f));const h=$m(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),l=Jm(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new Qm({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:Vy.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:Vy.easing)),c};class eb extends Ny{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;Km(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&qm(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const ib=t=>{const e={};return Object.keys(t).forEach((i=>{rm(i)||(e[i]=t[i])})),e},nb=(t,e,i)=>{const n=ib(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=pv.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},rb=(t,e,i)=>{const n=[],r=i?null:ib(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Fg).fromCustomPath2D(s)};n.push(pv.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&nb(t,n,e),n},sb=(t,e,i)=>{const n=[],r=i?null:ib(t.attribute);if("rect"===t.type){Am(t,e).forEach((t=>{n.push(pv.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){Tm(t,e).forEach((t=>{n.push(pv.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){Bm(t,e).forEach((t=>{n.push(pv.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=Pm(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(pv.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else if("polygon"===t.type){Dm(t,e).forEach((t=>{n.push(pv.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){_m(t,e).forEach((t=>{n.push(pv.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Im(t,e).forEach((t=>{"path"in t?n.push(pv.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(pv.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&nb(t,n,e),n};class ob{static GetImage(t,e){var i;let n=ob.cache.get(t);n?"fail"===n.loadState?pv.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&pv.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},ob.cache.set(t,n),n.dataPromise=pv.global.loadImage(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var i;let n=ob.cache.get(t);n?"fail"===n.loadState?pv.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&pv.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},ob.cache.set(t,n),n.dataPromise=pv.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=ob.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"},ob.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=pv.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=pv.global.loadBlob(t):"json"===e&&(i.dataPromise=pv.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}ob.cache=new Map;const ab=new Tf,hb=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],lb=["x","y"],cb=["scaleX","scaleY"],ub=["angle"],db=new hf;class pb extends yy{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(pb.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(e={}){super(),this._AABBBounds=new df,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background&&this.loadImage(e.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=fy(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;db.x=i+e,db.y=n+r}else db.x=i,db.y=n;return db}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;pv.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return pv.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Tf),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new hf(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):Pp(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<hb.length;e++){const i=hb[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<hb.length;e++){if(t===hb[e])return!0}return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background&&this.loadImage(e.background,!0),this._updateTag=t.UpdateTag.INIT,this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,lb,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,h=a.postMatrix;return h?pv.transformUtil.fromMatrix(h,h).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Gg.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Gg.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,lb,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const o={type:t.AttributeUpdateType.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,cb,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new Tf,h.postMatrix=t),pv.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Gg.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Gg.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(o),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,cb,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}rotate(e){var i;if(0===e)return this;const n={type:t.AttributeUpdateType.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,ub,n);if(r)return this._setAttributes(r,!1,n),this;const s=this.attribute;return s.angle=(null!==(i=s.angle)&&void 0!==i?i:Gg.angle)+e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),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,ub,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new zy(null==t?void 0:t.id).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){pv.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)&&(!!Pp(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,o,a,h;if(n){const t=Object.keys(e),n=r?t.reduce(((t,i)=>(t[i]=void 0===e[i]?this.getDefaultAttribute(i):e[i],t)),{}):e,l=this.animate();l.stateNames=i,l.to(n,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:Gy.duration,null!==(h=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==h?h:Gy.easing)}else this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();Wp(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else{if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}doUpdateLocalMatrix(){const{x:t=Gg.x,y:e=Gg.y,scaleX:i=Gg.scaleX,scaleY:n=Gg.scaleY,angle:r=Gg.angle,anchor:s,postMatrix:o}=this.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=this.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=this.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}!function(t,e,i,n,r,s,o,a){var h,l,c=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,v=Zp(o),y=tf(o);a?(h=a[0],l=a[1]):(h=i,l=n);var m=h-i,b=l-n,x=c*v+d*y,w=u*v+p*y,S=d*v-c*y,A=p*v-u*y;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=f+c*h+d*l-x*m-S*b,t.f=g+u*h+p*l-w*m-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,s&&a);const h=this.getOffsetXY(Gg);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,o){const t=ab.setValue(o.a,o.b,o.c,o.d,o.e,o.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){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),pv.graphicService.onSetStage(this,t))}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=o[s],u=null!==(l=a&&a[s])&&void 0!==l?l:t.getLastPropByName(s,n);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const o=r.fillColorArray,a=Gm(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const o=r.strokeColorArray,a=Gm(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const o=r.shadowColorArray,a=Gm(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(n[i]=a),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return fy(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:pv.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 Rp(t,!0)?this.pathProxy=(new Fg).fromString(t):this.pathProxy=new Fg,this.pathProxy}loadImage(t,e=!1){if(!t)return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};var r;this.resources.set(i,n),"string"==typeof t?(n.state="loading",r=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(r)||function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)}(t)?(ob.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(ob.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Sy(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}function fb(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}pb.mixin(Cy);let gb=0;function vb(){return gb++}var yb;function mb(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)wb(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,(yb=t.TextDirection||(t.TextDirection={}))[yb.HORIZONTAL=0]="HORIZONTAL",yb[yb.VERTICAL=1]="VERTICAL";const bb=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>bb.set(t,!0)));const xb=new Map;function wb(t){if(bb.has(t))return!0;if(xb.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>xb.set(t,!0)));const Sb=vb(),Ab=vb(),Tb=vb(),Bb=vb(),Cb=vb(),_b=vb(),Pb=vb(),Eb=vb(),Mb=vb(),kb=vb(),Rb=vb(),Db=vb(),Ib=vb(),Ob=vb(),Lb=vb(),Ub=vb(),Wb=Symbol.for("GraphicService"),Nb=Symbol.for("GraphicCreator");var Fb;t.GroupUpdateAABBBoundsMode=void 0,(Fb=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[Fb.LESS_GROUP=0]="LESS_GROUP",Fb[Fb.MORE_GROUP=1]="MORE_GROUP";class zb extends pb{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=_b,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 dy),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new dy)}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 hf(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;pv.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return pv.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=fy(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=pv.graphicService.updateGroupAABBBounds(t,fy(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=$y(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(),pv.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),pv.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,pv.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{pv.graphicService.onRemove(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),pv.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=pv.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new zb({...this.attribute})}}const jb=Symbol.for("LayerHandlerContribution");class Hb extends zb{get offscreen(){return this.layerHandler.offscreen}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=Cv.get(jb),this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new dy,this.background="rgba(0, 0, 0, 0)",this.virtual=!!n.virtual,this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{pv.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}render(t,e){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){throw new Error("暂不支持")}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var i;this.offscreen&&(this.layerHandler.drawTo(t,[this],{background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{pv.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],{background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,...e}),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{constructor(t){this.global=t,this.layerMap=new Map}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}createLayer(t,e={main:!1}){this.tryInit();const i=new Hb(t,this.global,t.window,{...e,virtual:0===this.staticLayerCountInEnv}),n=this.layerMap.get(t)||[];return n.push(i),this.layerMap.set(t,n),this.staticLayerCountInEnv--,i}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}},t.DefaultLayerService=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],t.DefaultLayerService);const Gb=Symbol.for("VWindow"),Vb=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(t){this.global=t,this.hooks={onChange:new bp(["x","y","width","height"])},this._uid=vy.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;Cv.getNamed(Vb,t.env).configure(this,t),this.actived=!0}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],t.DefaultWindow);const Xb=Symbol.for("TransformUtil"),Yb=Symbol.for("GraphicUtil"),qb=Symbol.for("LayerService");var Kb=new Qd((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(wp).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(Gb).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(Yb).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(Xb).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(qb).toService(t.DefaultLayerService)}));function $b(t,e){return!(!t&&!e)}function Zb(t,e){let i;return i=Dp(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Jb(t,e,i){return i&&t*e>0}function Qb(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function tx(t,e){return t*e>0}function ex(t,e,i,n){return t*e>0&&i>0&&n>0}function ix(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=fy(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,v=Jb(u,d,l),y=tx(u,f),m=$b(l),b=Zb(c,p);if(!g)return!0;if(!m&&!b)return!0;if(!(v||y||o||a))return!0;e.beginPath();return ng(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),m&&(o?o(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function nx(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,u=a-s;let d=u*h-c*l;return d*d<Gp?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function rx(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,u=-l*a,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,y=(p+g)/2,m=f-d,b=g-p,x=m*m+b*b,w=r-s,S=d*g-f*p,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let T=(S*b-m*A)/x,B=(-S*m-b*A)/x;const C=(S*b+m*A)/x,_=(-S*m+b*A)/x,P=T-v,E=B-y,M=C-v,k=_-y;return P*P+E*E>M*M+k*k&&(T=C,B=_),{cx:T,cy:B,x01:-c,y01:-u,x11:T*(r/w-1),y11:B*(r/w-1)}}function sx(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=Kp(h-a),c=h>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Gp)e.moveTo(i,n);else if(l>=qp-Gp)e.moveTo(i+r*Zp(a),n+r*tf(a)),e.arc(i,n,r,a,h,!c),s>Gp&&(e.moveTo(i+s*Zp(h),n+s*tf(h)),e.arc(i,n,s,h,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:v,innerEndAngle:y,innerStartAngle:m}=t.getParsePadAngle(a,h),b=d,x=d,w=d,S=d,A=Math.max(x,b),T=Math.max(w,S);let B=A,C=T;const _=r*Zp(g),P=r*tf(g),E=s*Zp(y),M=s*tf(y);let k,R,D,I;if((T>Gp||A>Gp)&&(k=r*Zp(v),R=r*tf(v),D=s*Zp(m),I=s*tf(m),l<Vp)){const t=nx(_,P,D,I,k,R,E,M);if(t){const e=_-t[0],i=P-t[1],n=k-t[0],o=R-t[1],a=1/tf(rf((e*n+i*o)/(ef(e*e+i*i)*ef(n*n+o*o)))/2),h=ef(t[0]*t[0]+t[1]*t[1]);C=Qp(T,(s-h)/(a-1)),B=Qp(A,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+_,n+P),u=!0;else if(B>Gp){const t=Qp(b,B),s=Qp(x,B),a=rx(D,I,_,P,r,t,Number(c)),h=rx(k,R,E,M,r,s,Number(c));B<A&&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,$p(a.y01,a.x01),$p(h.y01,h.x01),!c)):e.moveTo(i+a.cx+B*Zp($p(h.y01,h.x01)),n+a.cy+B*tf($p(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,$p(a.y01,a.x01),$p(a.y11,a.x11),!c),e.arc(i,n,r,$p(a.cy+a.y11,a.cx+a.x11),$p(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,$p(h.y11,h.x11),$p(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*Zp($p(h.y01,h.x01)),n+h.cy+s*tf($p(h.y01,h.x01))):e.moveTo(i+k,n+r*tf(v))}else o&&!o[0]||(e.moveTo(i+_,n+P),e.arc(i,n,r,g,v,!c));if(!(s>Gp)||f<.001)!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(C>Gp){const t=Qp(S,C),r=Qp(w,C),a=rx(E,M,k,R,s,-r,Number(c)),h=rx(_,P,D,I,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),C<T&&t===r){const t=$p(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,C,$p(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+Zp(t),n+a.cy+tf(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,$p(a.y01,a.x01),$p(a.y11,a.x11),!c),e.arc(i,n,s,$p(a.cy+a.y11,a.cx+a.x11),$p(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,$p(h.y11,h.x11),$p(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*Zp($p(h.y01,h.x01)),n+h.cy+t*tf($p(h.y01,h.x01))):e.moveTo(i+D,n+I)}else!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!o||o[2]?e.arc(i,n,s,y,m,c):e.moveTo(i+s*Zp(m),n+s*tf(m))}return o?o[3]&&e.lineTo(i+r*Zp(h),n+r*Zp(h)):e.closePath(),u}class ox{static GetCanvas(){try{return ox.canvas||(ox.canvas=pv.global.createCanvas({})),ox.canvas}catch(t){return null}}static GetCtx(){if(!ox.ctx){const t=ox.GetCanvas();ox.ctx=t.getContext("2d")}return ox.ctx}}class ax{constructor(t=[],e=100){const i=ox.GetCanvas(),n=ox.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}static GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=ax.dataMap.get(i);return n||(n=new ax(t,e),ax.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){ax.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return ax.dataMap.get(t)}}ax.dataMap=new Map;class hx{static GetSize(t){for(let e=0;e<hx.ImageSize.length;e++)if(hx.ImageSize[e]>=t)return hx.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=hx.GenKey(t,e,i,n,r),h=hx.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=hx.GenKey(t,e,i,n,r);hx.cache[h]?hx.cache[h].push({width:o,height:a,pattern:s}):hx.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function lx(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=qp;for(;i>qp;)i-=qp;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),Gm(a.color,h.color,l,!1)}function cx(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=ox.GetCanvas(),u=ox.GetCtx();if(!u)return null;const d=hx.GetSize(a),p=hx.GetSize(h);let f=hx.Get(e,i,n,s,o,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=l+1,y=r/Math.max(1,v-1),m=ax.GetOrCreate(e,v),b=2*Math.PI*g/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*y>o);t++){const e=m.getColor(t);u.beginPath(),u.rotate(y),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&hx.Set(e,i,n,s,o,f,d,p),f}hx.cache={},hx.ImageSize=[20,40,80,160,320,640,1280,2560];const ux=Symbol.for("ArcRenderContribution"),dx=Symbol.for("AreaRenderContribution"),px=Symbol.for("CircleRenderContribution"),fx=Symbol.for("GroupRenderContribution"),gx=Symbol.for("ImageRenderContribution"),vx=Symbol.for("PathRenderContribution"),yx=Symbol.for("PolygonRenderContribution"),mx=Symbol.for("RectRenderContribution"),bx=Symbol.for("SymbolRenderContribution"),xx=Symbol.for("TextRenderContribution"),Sx=Symbol.for("InteractiveSubRenderContribution");t.DefaultCanvasArcRender=class{constructor(t){this.arcRenderContribitions=t,this.numberType=Sb}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=a;const d=Kp(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:v,innerDeltaAngle:y,outerStartAngle:m,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,u),S=g,A=g,T=g,B=g,C=Math.max(A,S),_=Math.max(T,B);let P=C,E=_;const M=r*Zp(m),k=r*tf(m),R=s*Zp(x),D=s*tf(x);let I,O,L,U;if((_>Gp||C>Gp)&&(I=r*Zp(b),O=r*tf(b),L=s*Zp(w),U=s*tf(w),d<Vp)){const t=nx(M,k,L,U,I,O,R,D);if(t){const e=M-t[0],i=k-t[1],n=I-t[0],o=O-t[1],a=1/tf(rf((e*n+i*o)/(ef(e*e+i*i)*ef(n*n+o*o)))/2),h=ef(t[0]*t[0]+t[1]*t[1]);E=Qp(_,(s-h)/(a-1)),P=Qp(C,(r-h)/(a+1))}}if(P>Gp){const t=Qp(S,P),s=Qp(A,P),o=rx(L,U,M,k,r,t,Number(p)),a=rx(I,O,R,D,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,$p(o.y01,o.x01),$p(a.y01,a.x01),!p);else{const t=u-h-.03,o=$p(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,$p(a.y11,a.x11),$p(a.y01,a.x01),!p)}}else e.moveTo(i+M,n+k);if(!(s>Gp)||y<.001)e.lineTo(i+R,n+D),f=!0;else if(E>Gp){const t=Qp(B,E),r=Qp(T,E),o=rx(R,D,I,O,s,-r,Number(p)),a=rx(M,k,L,U,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),E<_&&t===r){const t=$p(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,E,$p(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,$p(o.y01,o.x01),$p(o.y11,o.x11),!p);const t=$p(o.cy+o.y11,o.cx+o.x11),a=u-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*Zp(w),n+s*tf(w));return f}drawShape(e,i,n,r,s,o,a,h){const l=fy(e,null==o?void 0:o.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:y=l.visible,x:m=l.x,y:b=l.y}=e.attribute,x=Jb(p,f,c),w=tx(p,v),S=$b(c,u),A=Zb(d,g);if(!e.valid||!y)return;if(!S&&!A)return;if(!(x||w||a||h||u))return;const{outerRadius:T=l.outerRadius,innerRadius:B=l.innerRadius,cap:C=l.cap,forceShowCap:_=l.forceShowCap}=e.attribute;let P=!1;const{isFullStroke:E,stroke:M}=qy(d);if(S||E){if(i.beginPath(),sx(e,i,n,r,T,B),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),S&&(a?a(i,e.attribute,l):x&&(i.setCommonStyle(e,e.attribute,m-n,b-r,l),i.fill())),A&&E&&(h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,m-n,b-r,l),i.stroke()))}if(!E&&A){if(i.beginPath(),sx(e,i,n,r,T,B,M),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)}))}h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())}if(C&&_){const{startAngle:o,endAngle:c}=e.getParsedAngle();if(Kp(c-o)>=qp-Gp){i.beginPath();const o=Math.abs(T-B)/2/T,{endAngle:c=l.endAngle,fill:u=l.fill}=e.attribute,d=c;if(this.drawArcTailCapPath(e,i,n,r,T,B,d,d+o),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)}))}if(S){const t=u;if("conical"===t.gradient){const s=lx(0,0,c,t);a||Jb&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fillStyle=s,i.fill())}}A&&(h||w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke()))}}this._arcAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=fy(t,null==n?void 0:n.theme).arc;r.highPerformanceSave();let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);ix(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasArcRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(ux)),fp("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class{constructor(t){this.circleRenderContribitions=t,this.numberType=Bb}drawShape(e,i,n,r,s,o,a,h){const l=fy(e,null==o?void 0:o.theme).circle,{fill:c=l.fill,background:u,stroke:d=l.stroke,radius:p=l.radius,startAngle:f=l.startAngle,endAngle:g=l.endAngle,fillOpacity:v=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,opacity:m=l.opacity,lineWidth:b=l.lineWidth,visible:x=l.visible,x:w=l.x,y:S=l.y}=e.attribute,A=Jb(m,v,c),T=tx(m,y),B=$b(c,u),C=Zb(d,b);e.valid&&x&&(B||C)&&(A||T||a||h||u)&&(i.beginPath(),i.arc(n,r,p,f,g),i.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),B&&(a?a(i,e.attribute,l):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,l),i.fill())),C&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,l),i.stroke())),this._circleRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).circle;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);ix(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasCircleRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(px)),fp("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);const Ax=["radius","startAngle","endAngle",...hb];class Tx extends pb{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Bb}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=fy(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=pv.graphicService.updateCircleAABBBounds(i,fy(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=$y(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fy(this).circle[t]}needUpdateTags(t){for(let e=0;e<Ax.length;e++){const i=Ax[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Ax.length;e++){if(t===Ax[e])return!0}return!1}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),a=new Fg;return a.arc(0,0,r,s,o),a}clone(){return new Tx({...this.attribute})}}function Bx(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function Cx(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function _x(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}class Px{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,o,a,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);l.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,o){t=t.map((t=>t.toString()));const a=[],h=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s).str,width:e});h[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),a.push({str:i,width:e});h[0]=o}h[1]=a.length*n;const l={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(l,e,i),this.layoutWithBBox(l,a,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const Ex=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight",...hb];class Mx extends pb{get font(){const t=fy(this).text;return this._font||(this._font=Bx(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=fy(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=fy(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text)}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Ub,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=fy(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=fy(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=fy(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e;const i=fy(this).text,n=pv.graphicUtil.textMeasure;let r,s;const o=this.attribute,{maxLineWidth:a=i.maxLineWidth,ellipsis:h=i.ellipsis,textAlign:l=i.textAlign,textBaseline:c=i.textBaseline,fontSize:u=i.fontSize,fontWeight:d=i.fontWeight,stroke:p=i.stroke,lineWidth:f=i.lineWidth,wordBreak:g=i.wordBreak}=o,v=Math.max(2,.075*u),{lineHeight:y=(null!==(e=o.lineHeight)&&void 0!==e?e:(o.fontSize||i.fontSize)+v)}=o;if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth;const t=Cx(l,r),e=_x(c,y,u);return this._AABBBounds.set(t,e,t+r,e+y),p&&this._AABBBounds.expand(f/2),this._AABBBounds}if(Number.isFinite(a)){if(h){const e=!0===h?i.ellipsis:h,o=n.clipTextWithSuffix(t.toString(),{fontSize:u,fontWeight:d},a,e,"break-word"===g);s=o.str,r=o.width}else{const e=n.clipText(t.toString(),{fontSize:u,fontWeight:d},a,"break-word"===g);s=e.str,r=e.width}this.cache.clipedText=s,this.cache.clipedWidth=r}else r=n.measureTextWidth(t.toString(),{fontSize:u,fontWeight:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=r;this.clearUpdateShapeTag();const m=Cx(l,r);let b=y;lC.isSafari()&&(b+=.2*u);const x=_x(c,b,u,v);return this._AABBBounds.set(m,x,m+r,x+b),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalSinglelineAABBBounds(e){var i;const n=fy(this).text,r=pv.graphicUtil.textMeasure;let s;const o=2,a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:p=n.fontWeight,stroke:f=n.stroke,lineHeight:g=(null!==(i=a.lineHeight)&&void 0!==i?i:(a.fontSize||n.fontSize)+o),lineWidth:v=n.lineWidth,wordBreak:y=n.wordBreak}=a;if(!this.shouldUpdateShape()&&this.cache){s=this.cache.clipedWidth;const t=Cx(c,s),e=_x(u,g,d);return this._AABBBounds.set(e,t,e+g,t+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}let m=[mb(e.toString())];if(Number.isFinite(h)){if(l){const t=!0===l?n.ellipsis:l,e=r.clipTextWithSuffixVertical(m[0],{fontSize:d,fontWeight:p},h,t,"break-word"===y);m=[e.verticalList],s=e.width}else{const t=r.clipTextVertical(m[0],{fontSize:d,fontWeight:p},h,"break-word"===y);m=[t.verticalList],s=t.width}this.cache.verticalList=m,this.cache.clipedWidth=s}else s=0,m[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?d:r.measureTextWidth(e.text,{fontSize:d,fontWeight:p});s+=i,e.width=i})),this.cache.verticalList=m,this.cache.clipedWidth=s;this.clearUpdateShapeTag();const b=Cx(c,s),x=_x(u,g,d);return this._AABBBounds.set(x,b,x+g,b+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const i=fy(this).text,n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:o=i.textBaseline,fontSize:a=i.fontSize,fontWeight:h=i.fontWeight,lineHeight:l=n.lineHeight||n.fontSize||i.fontSize,ellipsis:c=i.ellipsis,maxLineWidth:u,stroke:d=i.stroke,lineWidth:p=i.lineWidth,wordBreak:f=i.wordBreak}=n;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const g=pv.graphicUtil.textMeasure,v=new Px(r,{fontSize:a,fontWeight:h},g).GetLayoutByLines(t,s,o,l,!0===c?i.ellipsis:c||void 0,"break-word"===f,u),{bbox:y}=v;return this.cache.layoutData=v,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i;const n=fy(this).text,r=pv.graphicUtil.textMeasure;let s;const o=2,a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:p=n.fontWeight,stroke:f=n.stroke,lineHeight:g=(null!==(i=a.lineHeight)&&void 0!==i?i:(a.fontSize||n.fontSize)+o),lineWidth:v=n.lineWidth,wordBreak:y=n.wordBreak}=a;if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=Jp(e,s)}));const t=Cx(c,s),e=this.cache.verticalList.length*g,i=_x(u,e,d);return this._AABBBounds.set(i,t,i+e,t+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}const m=e.map((t=>mb(t.toString())));m.forEach(((e,i)=>{if(Number.isFinite(h))if(l){const t=!0===l?n.ellipsis:l,o=r.clipTextWithSuffixVertical(e,{fontSize:d,fontWeight:p},h,t,"break-word"===y);m[i]=o.verticalList,s=o.width}else{const t=r.clipTextVertical(e,{fontSize:d,fontWeight:p},h,"break-word"===y);m[i]=t.verticalList,s=t.width}else s=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?d:r.measureTextWidth(e.text,{fontSize:d,fontWeight:p});s+=i,e.width=i}))})),this.cache.verticalList=m,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=Jp(e,s)}));const b=Cx(c,s),x=this.cache.verticalList.length*g,w=_x(u,x,d);return this._AABBBounds.set(w,b,w+x,b+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fy(this).text[t]}needUpdateTags(t){for(let e=0;e<Ex.length;e++){const i=Ex[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Ex.length;e++){if(t===Ex[e])return!0}return!1}clone(){return new Mx({...this.attribute})}}function kx(t,e,i,n,r){return r?t.arc(i,n,e,0,Yp,!1,r):t.arc(i,n,e,0,Yp),!1}var Rx=new class{constructor(){this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return kx(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return kx(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`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var Dx=new class{constructor(){this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Ix(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 Ox=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Ix(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return Ix(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Ix(t,e/2+r,i,n,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Lx(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var Ux=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Lx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Lx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};class Wx{constructor(){this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}}var Nx=new Wx;var Fx=new class extends Wx{constructor(){super(...arguments),this.type="triangle"}};const zx=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),jx=Math.sin(Yp/10)*zx,Hx=-Math.cos(Yp/10)*zx;function Gx(t,e,i,n){const r=jx*e,s=Hx*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=Yp*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 Vx=new class{constructor(){this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return Gx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Gx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Xx=ef(3);function Yx(t,e,i,n){const r=e,s=r/Xx,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 qx=new class{constructor(){this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Yx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Yx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Kx(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 $x=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Kx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Kx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Zx(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Jx=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Zx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Zx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Qx=-.5,tw=ef(3)/2,ew=1/ef(12);function iw(t,e,i,n){const r=e/2,s=e*ew,o=r,a=e*ew+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(Qx*r-tw*s+i,tw*r+Qx*s+n),t.lineTo(Qx*o-tw*a+i,tw*o+Qx*a+n),t.lineTo(Qx*h-tw*l+i,tw*h+Qx*l+n),t.lineTo(Qx*r+tw*s+i,Qx*s-tw*r+n),t.lineTo(Qx*o+tw*a+i,Qx*a-tw*o+n),t.lineTo(Qx*h+tw*l+i,Qx*l-tw*h+n),t.closePath(),!1}var nw=new class{constructor(){this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return iw(t,e/2,i,n)}drawOffset(t,e,i,n,r){return iw(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var rw=new class{constructor(){this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var sw=new class{constructor(){this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var ow=new class{constructor(){this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const aw=ef(3);function hw(t,e,i,n){const r=e*aw;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var lw=new class extends Wx{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return hw(t,e/2/aw,i,n)}drawOffset(t,e,i,n,r){return hw(t,e/2/aw+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function cw(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 uw=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.5 0.5"}draw(t,e,i,n){return cw(t,e/4,i,n)}drawOffset(t,e,i,n,r){return cw(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function dw(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 pw=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5"}draw(t,e,i,n){return dw(t,e/4,i,n)}drawOffset(t,e,i,n,r){return dw(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function fw(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var gw=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return fw(t,Ip(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return fw(t,Ip(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}bounds(t,e){const i=Ip(t)?[t,t]:t;e.x1=-i[0]/2,e.x2=i[0]/2,e.y1=-i[1]/2,e.y2=i[1]/2}};class vw{constructor(t,e){this.pathStr="",this.type=t,this.path=e}drawOffset(t,e,i,n,r){return ng(this.path.commandList,t,i,n,e+r,e+r),!1}draw(t,e,i,n){return ng(this.path.commandList,t,i,n,e,e),!1}bounds(t,e){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 yw=[Rx,Dx,Ox,Ux,lw,Fx,Vx,qx,$x,Jx,nw,rw,sw,Nx,ow,uw,pw,gw],mw={};yw.forEach((t=>{mw[t.type]=t}));const bw=["symbolType","size",...hb];let xw=class t extends pb{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Lb}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Dp(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=fy(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=mw[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;const r=(new Fg).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/Jp(s,o);return r.transform(0,0,a,a),this._parsedPath=new vw(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=fy(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=pv.graphicService.updateSymbolAABBBounds(i,fy(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=$y(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fy(this).symbol[t]}needUpdateTags(t){for(let e=0;e<bw.length;e++){const i=bw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<bw.length;e++){if(t===bw[e])return!0}return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=Dp(e)?e:[e,e];return t.path?(new Fg).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Fg).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t({...this.attribute})}};xw.userSymbolMap={};const ww=["segments","points","curveType",...hb];let Sw=class t extends pb{constructor(t={}){super(t),this.type="line",this.numberType=Eb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=im(i,n,e))}doUpdateAABBBounds(){const t=fy(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateLineAABBBounds(e,fy(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fy(this).line[t]}needUpdateTags(t){for(let e=0;e<ww.length;e++){const i=ww[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<ww.length;e++){if(t===ww[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=new Fg,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})}};const Aw=["width","height","cornerRadius",...hb];class Tw extends pb{constructor(t){super(t),this.type="rect",this.numberType=Db}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=fy(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateRectAABBBounds(e,fy(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fy(this).rect[t]}needUpdateTags(t){for(let e=0;e<Aw.length;e++){const i=Aw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Aw.length;e++){if(t===Aw[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new Fg;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new Tw({...this.attribute})}}const Bw=[[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 Cw extends Tw{constructor(t){super(t),this.type="rect3d",this.numberType=Ib}findFace(){const t={polygons:[],vertices:[],edges:[]},e=fy(this).rect3d,{width:i=e.width,height:n=e.width,length:r=Qp(e.width,e.height)}=this.attribute;for(let e=0;e<Bw.length;e++){const s=Bw[e];t.vertices.push([s[0]*i,s[1]*n,s[2]*r])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}class _w extends pb{constructor(t){super(t),this.type="glyph",this.numberType=Cb,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const t=pv.graphicService.updateGlyphAABBBounds(this.attribute,fy(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new _w({...this.attribute});return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}}class Pw{constructor(t,e,i,n,r,s,o,a,h,l,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=fv[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}}}}return l}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],o=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-this.lines[i+1].height<this[this.directionKey.top]){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class Ew{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:o}=Sv(t,i);let a=0,h=0,l=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),l=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+l),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=Sv(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=xv(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=Sv(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||vv;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||gv;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=xv(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=Sv(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Mw=["width","height","image",...hb];class kw extends pb{constructor(t){super(t),this.type="image",this.numberType=Pb,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=fy(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateImageAABBBounds(e,fy(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return uv[t]}needUpdateTags(t){for(let e=0;e<Mw.length;e++){const i=Mw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Mw.length;e++){if(t===Mw[e])return!0}return!1}clone(){return new kw({...this.attribute})}}class Rw extends kw{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=$y(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(Dp(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=$y(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=uv.width,height:e=uv.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 Dw{constructor(t,e,i,n,r,s,o,a){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Rw?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=fv[this.direction];const h=this.directionKey;this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Ew){const e=bv.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=a?0:this.width-this.actualWidth;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof Rw?(t["_"+h.x]=c,c+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?l-t.height:(l-t.height)/2):(t[h.left]=c,c+=t[h.width]+u)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof Rw)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=Sv("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof Rw)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof Rw)break;const{width:n}=Sv("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof Rw?t.width:t.getWidthWithEllips(this.direction)})),e}}class Iw{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=fv[this.direction]}store(t){if(t instanceof Rw){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 Dw(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 Rw?"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=xv(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 Ew(i,t.newLine,t.character),new Ew(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Ow=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...hb];class Lw extends pb{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Ob}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:cv.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:cv.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:cv.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:cv.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:cv.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:cv.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:cv.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:cv.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=fy(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateRichTextAABBBounds(e,fy(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return cv[t]}needUpdateTags(t){for(let e=0;e<Ow.length;e++){const i=Ow[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Ow.length;e++){if(t===Ow[e])return!0}return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new Rw(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new Ew(i[n],0!==n,e[t]))}else p.push(new Ew(e[t].text,!1,e[t]));const f=new Pw(0,0,("number"==typeof i&&(!r||r>i)?i:r)||0,("number"==typeof n&&(!s||s>n)?n:s)||0,o,a,h,l,c,u||"horizontal","number"==typeof i&&(!r||r>i),"number"==typeof n&&(!s||s>n),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new Iw(f);for(let t=0;t<p.length;t++)g.deal(p[t]);g.send(),this._frameCache=f}clone(){return new Lw({...this.attribute})}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(o.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n)})),r}}const Uw=["path","customPath",...hb];class Ww extends pb{constructor(t){super(t),this.type="path",this.numberType=Mb}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=fy(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Fg?e.path:(Pp(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Fg?this.cache:t.path)}doUpdateAABBBounds(){const t=fy(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updatePathAABBBounds(e,fy(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;Rp(t.path,!0)?this.cache=(new Fg).fromString(t.path):t.customPath&&(this.cache=new Fg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return fy(this).path[t]}needUpdateTags(t){for(let e=0;e<Uw.length;e++){const i=Uw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Uw.length;e++){if(t===Uw[e])return!0}return!1}toCustomPath(){return(new Fg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Ww({...this.attribute})}}const Nw=["segments","points","curveType",...hb];class Fw extends pb{constructor(t){super(t),this.type="area",this.numberType=Tb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=fy(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateAreaAABBBounds(e,fy(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=im(i,n,e))}getDefaultAttribute(t){return fy(this).area[t]}needUpdateTags(t){for(let e=0;e<Nw.length;e++){const i=Nw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Nw.length;e++){if(t===Nw[e])return!0}return!1}toCustomPath(){const t=new Fg,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Fw({...this.attribute})}}const zw=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...hb];class jw extends pb{constructor(t){super(t),this.type="arc",this.numberType=Sb}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=fy(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(i-n);return Math.min(Ip(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=fy(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=pf(e),i=e+s,n&&Kp(s)<qp-Gp){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));const{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,l=Math.abs(a-h)/2,c=l/a;if(l>Gp&&a>Gp)return{startAngle:e-r*c*s,endAngle:i+r*c*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=fy(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:o=ef(n*n+r*r)}=this.attribute,a=Kp(e-t);let h=t,l=e,c=t,u=e;const d=s/2;let p=a,f=a;if(d>Gp&&o>Gp){const i=e>t?1:-1;let s=sf(Number(o)/r*tf(d)),a=sf(Number(o)/n*tf(d));return(p-=2*s)>Gp?(s*=i,c+=s,u-=s):(p=0,c=u=(t+e)/2),(f-=2*a)>Gp?(a*=i,h+=a,l-=a):(f=0,h=l=(t+e)/2),{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=fy(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=pv.graphicService.updateArcAABBBounds(i,fy(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=$y(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<zw.length;e++){const i=zw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<zw.length;e++){if(t===zw[e])return!0}return!1}getDefaultAttribute(t){return fy(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=Kp(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new Fg;if(r<=Gp)a.moveTo(0,0);else if(s>=qp-Gp)a.moveTo(0+r*Zp(e),0+r*tf(e)),a.arc(0,0,r,e,i,!o),n>Gp&&(a.moveTo(0+n*Zp(i),0+n*tf(i)),a.arc(0,0,n,i,e,o));else{const t=r*Zp(e),s=r*tf(e),h=n*Zp(i),l=n*tf(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 jw({...this.attribute})}}class Hw extends jw{constructor(t){super(t),this.type="arc3d",this.numberType=Ab}doUpdateAABBBounds(){const t=fy(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updateArc3dAABBBounds(e,fy(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}}const Gw=["points","cornerRadius",...hb];class Vw extends pb{constructor(t){super(t),this.type="polygon",this.numberType=kb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=fy(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updatePolygonAABBBounds(e,fy(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=im(i,n,e))}getDefaultAttribute(t){return fy(this).polygon[t]}needUpdateTags(t){for(let e=0;e<Gw.length;e++){const i=Gw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Gw.length;e++){if(t===Gw[e])return!0}return!1}toCustomPath(){const t=this.attribute.points,e=new Fg;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 Vw({...this.attribute})}}class Xw extends Vw{constructor(t){super(t),this.type="pyramid3d",this.numberType=Rb}doUpdateAABBBounds(){const t=fy(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=pv.graphicService.updatePyramid3dAABBBounds(e,fy(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=$y(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=lf.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=Jp(r,e);const o=lf.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=Jp(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}}let Yw=class{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;i.expand(n+s+o/2)}return i}};Yw=dp([rp()],Yw);const qw=Symbol.for("RectBoundsContribution");let Kw=class extends Yw{};Kw=dp([rp()],Kw);const $w=Symbol.for("SymbolBoundsContribution");let Zw=class extends Yw{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;fb(i,n+s+a/2,!0,o)}return i}};Zw=dp([rp()],Zw);const Jw=Symbol.for("CircleBoundsContribution");let Qw=class extends Yw{};Qw=dp([rp()],Qw);const tS=Symbol.for("ArcBoundsContribution");let eS=class extends Yw{};eS=dp([rp()],eS);const iS=Symbol.for("PathBoundsContribution");let nS=class extends Yw{};nS=dp([rp()],nS);class rS{constructor(){this.pools=[]}static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return rS.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const sS=new class{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new Tf(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 Tf(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},oS=new rS;function aS(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+l*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-h*n,t}function hS(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-l*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=h*n+d*r,t}function lS(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,u,d,p,f,g,v,y;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],y=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=y,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=h*n+d*r+v*s+e[14],t[15]=l*n+p*r+y*s+e[15]),t}function cS(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 uS(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],y=e[14],m=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*a+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*y,t[3]=b*o+x*c+w*f+S*m,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*a+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*y,t[7]=b*o+x*c+w*f+S*m,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*a+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*y,t[11]=b*o+x*c+w*f+S*m,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*a+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*y,t[15]=b*o+x*c+w*f+S*m,t}function dS(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:y}=e.attribute,m=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;m[0]=i.x1+(i.x2-i.x1)*t}else m[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;m[1]=i.x1+(i.x2-i.x1)*t}else m[1]=v[1];m[2]=null!==(n=v[2])&&void 0!==n?n:0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),lS(t,t,[r+a,s+h,o+l]),lS(t,t,[m[0],m[1],m[2]]),aS(t,t,f),hS(t,t,p),lS(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,[c,u,d]),g){const i=oS.allocate(),n=[0,0];if(y){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}lS(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+l*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-h*n}(i,i,g),lS(i,i,[-n[0],-n[1],0]),uS(t,t,i)}}function pS(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t,e,i,n,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=n,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new bp(["graphic"]),onSetStage:new bp(["graphic","stage"]),onRemove:new bp(["graphic"]),onAddIncremental:new bp(["graphic","group","stage"]),onClearIncremental:new bp(["graphic","group","stage"]),beforeUpdateAABBBounds:new bp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new bp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new df,this.tempAABBBounds2=new df}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Rf(t);return ng(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),a||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}updateRichTextAABBBounds(t,e,i,n){if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(h){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,c);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){fb(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),cf(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>qp-Gp?i.set(-o,-o,o,o):Qy(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateArcAABBBoundsImprecise(t,e,i,n){const{outerRadius:r=e.outerRadius}=t;return i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=Gp?i.set(0,0,0,0):Math.abs(o-a)>qp-Gp?i.set(-r,-r,r,r):(Qy(a,o,r,i),Qy(a,o,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(Dp(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){const{scaleX:s=i.scaleX,scaleY:o=i.scaleY,stroke:a=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:l=i.lineWidth,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){fb(u,l/Math.abs(s+o),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){fb(u,h/Math.abs(s+o),n,c),e.union(u)}this.combindShadowAABBBounds(e,r),cf(e,e,r.transMatrix)}},t.DefaultGraphicService=dp([rp(),pp(0,ap(Nb)),pp(1,ap(gp)),pp(1,sp(qw)),pp(2,ap(gp)),pp(2,sp($w)),pp(3,ap(gp)),pp(3,sp(Jw)),pp(4,ap(gp)),pp(4,sp(tS)),pp(5,ap(gp)),pp(5,sp(iS)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class fS extends zb{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}const gS=["heightLimit","lineClamp"];class vS extends Mx{_isValid(){const{text:t}=this.attribute;return Dp(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n;const r=fy(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,lineHeight:l=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:p=r.lineWidth,heightLimit:f=0,lineClamp:g}=this.attribute;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=pv.graphicUtil.textMeasure,y=new Px(s,{fontSize:h},v),m=t.map((t=>t.toString())),b=[],x=[0,0];let w=1/0;if(f>0&&(w=Math.max(Math.floor(f/l),1)),g&&(w=Math.min(w,g)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<m.length;t++){const e=m[t];if(t===w-1){const t=y.textMeasure.clipTextWithSuffix(e,y.textOptions,u,c);b.push({str:t.str,width:t.width});break}const r=y.textMeasure.clipText(e,y.textOptions,u);if(""!==e&&""===r.str)if(c){const t=y.textMeasure.clipTextWithSuffix(e,y.textOptions,u,c);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;if(b.push({str:r.str,width:r.width}),r.str.length===e.length);else{const i=e.substring(r.str.length);m.splice(t+1,0,i)}}let t=0;b.forEach((e=>{t=Math.max(t,e.width)})),x[0]=t}else{let t,e,i=0;for(let n=0,r=m.length;n<r;n++){if(n===w-1){const t=y.textMeasure.clipTextWithSuffix(m[n],y.textOptions,u,c);b.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=m[n],t=y.textMeasure.measureTextWidth(e,y.textOptions),i=Math.max(i,t),b.push({str:e,width:t})}x[0]=i}x[1]=b.length*(l+2);const S={xOffset:0,yOffset:0,width:x[0],height:x[1]};y.LayoutBBox(S,o,a);const A=y.layoutWithBBox(S,b,o,a,l);return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<gS.length;e++){const i=gS[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<gS.length;e++){if(t===gS[e])return!0}return super.needUpdateTag(t)}}function yS(t){return new jw(t)}function mS(t){return new Fw(t)}function bS(t){return new Tx(t)}function xS(t){return new zb(t)}function wS(t){return new Sw(t)}function SS(t){return new Ww(t)}function AS(t){return new Tw(t)}function TS(t){return new Cw(t)}function BS(t){return new Mx(t)}function CS(t){return new vS(t)}function _S(t){return new xw(t)}function PS(t){return new kw(t)}function ES(t){return new Vw(t)}function MS(t){return new fS(t)}function kS(t){return new Lw(t)}const RS={arc:yS,area:mS,circle:bS,group:xS,image:PS,line:wS,path:SS,rect:AS,rect3d:TS,symbol:_S,text:BS,richtext:kS,polygon:ES,shadowRoot:MS,wrapText:CS},DS=BS({text:""});const IS=kS({});function OS(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:h=0,offsetZ:l=0,mode:c="none",drawConnect:u=!1,zeroX:d=0,zeroY:p=0}=s||{};if(u&&"none"===c)return;if(!i)return;let f=!0;const{curves:g}=i;if(n>=1){if(u){let t,i=!0;g.forEach(((n,r)=>{var s;let o=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(o=t.p0),n.defined)i||(e.lineTo(o.x+a,o.y+h,l),i=!i);else{const{originP1:t,originP2:r}=n;let c;if(t&&!1!==t.defined?c=o:t&&!1!==r.defined&&(c=null!==(s=n.p3)&&void 0!==s?s:n.p1),i){i=!i;const t=c?c.x:n.p0.x,r=c?c.y:n.p0.y;e.moveTo(t+a,r+h,l)}else c&&(i=!i,e.lineTo(c.x+a,c.y+h,l))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+h,l),WS(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let v;"x"===r?v=t.Direction.ROW:"y"===r?v=t.Direction.COLUMN:"auto"===r&&(v=i.direction);const y=n*i.tryUpdateLength(v);let m=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(v),r=(y-m)/n;if(m+=n,r<0)break;if(u){let t=i.p0;if(i.originP1===i.originP2){x=i;continue}if(x&&x.originP1===x.originP2&&(t=x.p0),i.defined)b||(e.lineTo(t.x+a,t.y+h,l),b=!b);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=null!==(o=i.p3)&&void 0!==o?o:i.p1),b){b=!b;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+a,n+h,l)}else s&&(b=!b,e.lineTo(s.x+a,s.y+h,l))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+h,l),WS(e,i,Qp(r,1),s),f=!1}}}function LS(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 US(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function WS(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]=lg(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 NS(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:h,bottom:l}=i;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=h.curves.length;h.curves.forEach(((h,c)=>{const u=l.curves[a-c-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),h.defined)o||(t.push(d),i.push(p),FS(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=h;let a,l;n&&!1!==n.defined?(a=d,l=p):n&&!1!==s.defined&&(a=h,l=u),o?(o=!o,t.push(a||h),i.push(l||u)):a&&(o=!o,t.push(a||h),i.push(l||u),FS(e,t,i,r),t.length=0,i.length=0)}n=h})),FS(e,t,i,r)}else{for(let s=0,o=h.curves.length;s<o;s++){const a=h.curves[s];n!==a.defined?(n?(zS(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(l.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(l.curves[o-s-1]))}zS(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=h,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=Kp(d.x-u[0].p0.x),f=Kp(d.y-u[0].p0.y);c=null!=c?c:p>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(p)||(c=t.Direction.COLUMN),Number.isFinite(f)||(c=t.Direction.ROW);const g=n*(c===t.Direction.ROW?p:f);let v=0,y=!0;const m=[],b=[];let x,w,S=!0;for(let t=0,i=h.curves.length;t<i;t++){const n=h.curves[t],s=n.getLength(c),a=(g-v)/s;if(a<0)break;if(v+=s,o){const s=l.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,w=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=w),n.defined)S||(m.push(o),b.push(a),FS(e,m,b,r),m.length=0,b.length=0,S=!S);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),S?(S=!S,m.push(h||n),b.push(l||s)):h&&(S=!S,m.push(h||n),b.push(l||s),FS(e,m,b,r),m.length=0,b.length=0)}x=n}else{let s=null,o=null;y!==n.defined?(y?(zS(e,m,b,r),m.length=0,b.length=0):(s=n,o=l.curves[i-t-1]),y=!y):y&&(s=n,o=l.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?lg(s,a)[0]:ug(s,a)[0],o=o.p2&&o.p3?lg(o,1-a)[1]:ug(o,1-a)[1]),s.defined=y,o.defined=y,m.push(s),b.push(o)),s=null,o=null}}o?FS(e,m,b,r):zS(e,m,b,r)}function FS(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 zS(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),jS(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),jS(t,h,1,n),a=!1):a=!0}t.closePath()}function jS(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]=lg(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 HS(t,e,i){switch(e){case"linear":default:return yg(t,i);case"basis":return Sg(t,i);case"monotoneX":return Mg(t,i);case"monotoneY":return Rg(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Ug(t,i)}}t.BaseRender=class{transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:h=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:o,z:a,lastModelMatrix:p},v=f&&(n||pS(t));if(v){const n=oS.allocate(),r=oS.allocate();dS(r,t,e),uS(n,p||n,r),g.x=0,g.y=0,g.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),oS.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=a,i.setTransformForCurrent()}else if(v)g.x=0,g.y=0,g.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(f&&i.project){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,this.transformWithoutTranslate(i,g.x,g.y,g.z,h,l,c)}else i.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=n.project(0,0,i),a=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*h.y+l.y*(a.y-h.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(l.x*(h.x-a.x)-c.x*h.x+u.x*a.x+(c.x-u.x)*o.x)*d,v=-(c.x*h.y+l.x*(a.y-h.y)-u.x*a.y+(u.x-c.x)*o.y)*d,y=(l.x*(u.y*a.x-c.y*h.x)+l.y*(c.x*h.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,m=(l.x*(u.y*a.y-c.y*h.y)+l.y*(c.x*h.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,v,y,m,!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()}},t.BaseRender=dp([rp()],t.BaseRender),t.DefaultCanvasLineRender=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Eb}draw(t,e,i,n){const{context:r}=i;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).line,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,ix(t,r,a,h)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&oS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var g,v,y,m,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;OS(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!Dp(d.cache)&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,o,a);const{x:w=0,x:S=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,w-c,S-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,w-c,S-u,a),t.stroke()));let{connectedType:A,connectedX:T,connectedY:B,connectedStyle:C}=o;if(Dp(a)?(A=null!==(v=null!=A?A:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(y=null!=T?T:a[0].connectedX)&&void 0!==y?y:a[1].connectedX,B=null!==(m=null!=B?B:a[0].connectedY)&&void 0!==m?m:a[1].connectedY,C=null!==(b=null!=C?C:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(A=null!=A?A:a.connectedType,T=null!=T?T:a.connectedX,B=null!=B?B:a.connectedY,C=null!=C?C:a.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),"none"!==A){t.beginPath(),OS(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:A,zeroX:T,zeroY:B});const g=[];Dp(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,C,w-c,S-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,C,w-c,S-u,g),t.stroke()))}return!1}drawShape(t,e,i,n,r,s,o,a){const h=fy(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:g=h.visible}=t.attribute,v=Jb(u,d,l),y=tx(u,p),m=$b(l),b=Zb(c,f);if(!t.valid||!g)return;if(!m&&!b)return;if(!(v||y||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=h.curveType}=t.attribute,r=e;if(i&&i.length){let e,r;t.cache=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY,defined:r.curves[r.curves.length-1].defined}:i>1&&(e.x=r.endX,e.y=r.endY,e.defined=r.curves[r.curves.length-1].defined),r=Ng(t.points,n,{startPoint:e}),r)))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Ng(r,n)}t.clearUpdateShapeTag()}const{clipRange:x=h.clipRange,clipRangeByDimension:w=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache))if(1===x){let r=!1;t.cache.forEach(((s,u)=>{r||(r=this.drawSegmentItem(e,s,!!l,!!c,d,p,t.attribute.segments[u],[h,t.attribute],x,w,i,n,t,o,a))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),s=x*r;let u=0,f=!1;t.cache.forEach(((r,g)=>{if(f)return;const v=r.getLength(),y=(s-u)/v;u+=v,y>0&&(f=this.drawSegmentItem(e,r,!!l,!!c,d,p,t.attribute.segments[g],[h,t.attribute],Qp(y,1),w,i,n,t,o,a))}))}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,p,t.attribute,h,x,w,i,n,t,o,a)}},t.DefaultCanvasLineRender=dp([rp()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class{constructor(t){this.areaRenderContribitions=t,this.numberType=Tb}drawShape(t,e,i,n,r,s,o,a){var h,l,c,u,d,p;const f=fy(t,null==s?void 0:s.theme).area,{fill:g=f.fill,fillOpacity:v=f.fillOpacity,opacity:y=f.opacity,visible:m=f.visible,z:b=f.z,background:x,stroke:w=t.attribute.stroke,lineWidth:S=f.lineWidth,strokeOpacity:A=f.strokeOpacity}=t.attribute,T=Jb(y,v,g),B=$b(g,x),C=Zb(w,S),_=tx(y,A);if(!t.valid||!m)return;if(!B&&!C)return;if(!(T||o||_||a))return;const{clipRange:P=f.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=f.curveType}=t.attribute;if(i&&i.length){let e,r;const s=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY}:i>1&&(e.x=r.endX,e.y=r.endY),r=HS(t.points,n,{startPoint:e}),r)));let o;const a=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=i[t-1].points,n=e[e.length-1];n&&r.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(u=n.y1)&&void 0!==u?u:n.y})}o=HS(r,"stepBefore"===n?"stepAfter":"stepAfter"===n?"stepBefore":n),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const i=e,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=HS(i,n),o=HS(r,"stepBefore"===n?"stepAfter":"stepAfter"===n?"stepBefore":n);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===P){let s=!1;t.cacheArea.forEach(((h,l)=>{s||(s=this.drawSegmentItem(e,h,B,v,C,A,t.attribute.segments[l],[f,t.attribute],P,i,n,b,t,r,o,a))}))}else{const s=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=P*s;let l=0,c=!1;t.cacheArea.forEach(((s,u)=>{if(c)return;const d=s.top.getLength(),p=(h-l)/d;l+=d,p>0&&(c=this.drawSegmentItem(e,s,B,v,C,A,t.attribute.segments[u],[f,t.attribute],Qp(p,1),i,n,b,t,r,o,a))}))}else this.drawSegmentItem(e,t.cacheArea,B,v,C,A,t.attribute,f,P,i,n,b,t,r,o,a)}draw(t,e,i,n){const{context:r}=i,s=fy(t,null==n?void 0:n.theme).area;let{x:o=s.x,y:a=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);ix(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,u,d,p,f,g,v,y){var m,b,x,w;let{connectedType:S,connectedX:A,connectedY:T,connectedStyle:B}=a;const C=[];if(g&&(Dp(h)?(S=null!==(m=null!=S?S:h[0].connectedType)&&void 0!==m?m:h[1].connectedType,A=null!==(b=null!=A?A:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,T=null!==(x=null!=T?T:h[0].connectedY)&&void 0!==x?x:h[1].connectedY,B=null!==(w=null!=B?B:h[0].connectedStyle)&&void 0!==w?w:h[1].connectedStyle):(S=null!=S?S:h.connectedType,A=null!=A?A:h.connectedX,T=null!=T?T:h.connectedY,B=null!=B?B:h.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),Dp(h)?h.forEach((t=>C.push(t))):C.push(h),C.push(a)),g&&"none"===S)return!1;if(!i)return;e.beginPath();const{points:_,segments:P}=p.attribute;let E,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],E=t.points[t.points.length-1]}else M=_[0],E=_[_.length-1];k=Kp(E.x-M.x)>Kp(E.y-M.y)?t.Direction.ROW:t.Direction.COLUMN,NS(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:S,zeroX:A,zeroY:T}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.beforeFillStroke&&i.drawShape(p,e,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),e.setShadowStyle&&e.setShadowStyle(p,a,h);const{x:R=0,x:D=0}=a;if(!1!==n&&(v?v(e,a,h):r&&(e.setCommonStyle(p,g?B:a,R-c,D-u,g?C:h),e.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.afterFillStroke&&i.drawShape(p,e,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),!1!==s)if(y)y(e,a,h);else{const{stroke:n}=a;Dp(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),OS(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:S,zeroX:A,zeroY:T})),e.setStrokeStyle(p,g?B:a,R-c,D-u,g?C:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(dx)),fp("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Mb}drawShape(e,i,n,r,s,o,a,h){var l,c;const u=fy(e,null==o?void 0:o.theme).path,{fill:d=u.fill,stroke:p=u.stroke,fillOpacity:f=u.fillOpacity,strokeOpacity:g=u.strokeOpacity,opacity:v=u.opacity,background:y,lineWidth:m=u.lineWidth,visible:b=u.visible,x:x=u.x,y:w=u.y}=e.attribute,S=null!==(l=this.z)&&void 0!==l?l:0,A=Jb(v,f,d),T=tx(v,g),B=$b(d,y),C=Zb(p,m);if(e.valid&&b&&(B||C)&&(A||T||a||h||y)){if(i.beginPath(),e.pathShape)ng(e.pathShape.commandList,i,n,r,1,1,S);else{ng((null!==(c=e.attribute.path)&&void 0!==c?c:u.path).commandList,i,n,r,1,1,S)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,u,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,u),C&&(h?h(i,e.attribute,u):T&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,u),i.stroke())),B&&(a?a(i,e.attribute,u):A&&(i.setCommonStyle(e,e.attribute,x-n,w-r,u),i.fill())),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,u,s,a,h)}))}}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).path,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,ix(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&oS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasPathRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(vx)),fp("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const GS=Vp/2;function VS(t,e,i,n,r,s){let o;if(Ip(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(n<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],f=[a[0],a[1]+d[0]],g=[h[0]-d[1],h[1]],v=[h[0],h[1]+d[1]],y=[l[0]-d[2],l[1]],m=[l[0],l[1]-d[2]],b=[c[0]+d[3],c[1]],x=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!Fp(g,v)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-GS,0,!1)}if(t.lineTo(m[0],m[1]),!Fp(y,m)){const e=m[0]-d[2],i=m[1];t.arc(e,i,d[2],0,GS,!1)}if(t.lineTo(b[0],b[1]),!Fp(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],GS,Vp,!1)}if(t.lineTo(f[0],f[1]),!Fp(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],Vp,Vp+GS,!1)}return t.closePath(),t}function XS(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 YS(t,e){return Math.sqrt(t*t+e*e)}function qS(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=Db}drawShape(e,i,n,r,s,o,a,h){const l=fy(e,null==o?void 0:o.theme).rect,{fill:c=l.fill,background:u,stroke:d=l.stroke,width:p=l.width,height:f=l.height,cornerRadius:g=l.cornerRadius,opacity:v=l.opacity,fillOpacity:y=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:S=l.y}=e.attribute,A=Qb(v,y,p,f,c),T=ex(v,b,p,f),B=$b(c,u),C=Zb(d,m);if(!e.valid||!x)return;if(!B&&!C)return;if(!(A||T||a||h||u))return;0===g||Dp(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,p,f)):(i.beginPath(),VS(i,n,r,p,f,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const _={doFill:B,doStroke:C};this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h,_)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,l),i.stroke())),this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).rect;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);ix(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasRectRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(mx)),fp("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Lb}drawShape(e,i,n,r,s,o,a,h){var l;const c=fy(e,null==o?void 0:o.theme).symbol,{size:u=c.size,fill:d=c.fill,background:p,fillOpacity:f=c.fillOpacity,strokeOpacity:g=c.strokeOpacity,opacity:v=c.opacity,lineWidth:y=c.lineWidth,stroke:m=c.stroke,visible:b=c.visible,x:x=c.x,y:w=c.y,scaleX:S=c.scaleX,scaleY:A=c.scaleY}=e.attribute,T=Jb(v,f,d),B=tx(v,g),C=$b(d,p),_=Zb(m,y);if(!e.valid||!b)return;if(!C&&!_)return;if(!(T||B||a||h||p))return;const P=e.getParsedPath();if(!P)return;const{keepDirIn3d:E=c.keepDirIn3d}=e.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;if(i.beginPath(),E&&i.camera&&i.project){const t=i.project(n,r,M),e=i.camera;i.camera=null,!1===P.draw(i,u,t.x,t.y)&&i.closePath(),i.camera=e}else!1===P.draw(i,u,n,r,M)&&i.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,_,T,B,c,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),C&&(a?a(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,x-n,w-r,c),i.fill())),_&&(h?h(i,e.attribute,c):B&&(i.setStrokeStyle(e,e.attribute,(x-n)/S,(w-r)/A,c),i.stroke())),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,_,T,B,c,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).symbol,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,ix(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&oS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasSymbolRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(bx)),fp("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Ub}drawShape(e,i,n,r,s,o,a,h){var l;const c=fy(e,null==o?void 0:o.theme).text,{text:u,fill:d=c.fill,stroke:p=c.stroke,fillOpacity:f=c.fillOpacity,strokeOpacity:g=c.strokeOpacity,opacity:v=c.opacity,lineWidth:y=c.lineWidth,visible:m=c.visible,underline:b=c.underline,lineThrough:x=c.lineThrough,keepDirIn3d:w=c.keepDirIn3d,direction:S=c.direction,fontSize:A=c.fontSize,textBaseline:T=c.textBaseline,textAlign:B=c.textAlign,x:C=c.x,y:_=c.y}=e.attribute,P=null!==(l=e.attribute.lineHeight)&&void 0!==l?l:A,E=Jb(v,f,d),M=tx(v,g),k=$b(d),R=Zb(p,y);if(!e.valid||!m)return;if(!(k||R||E||M))return;const D=!w,I=this.z||0;if(i.beginPath(),!this._textBeforeRenderContribitions){const e=this.textRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._textBeforeRenderContribitions.push(e):this._textAfterRenderContribitions.push(e)}))}this._textBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,k,R,E,M,c,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),D&&this.transformUseContext2d(e,c,I,i);const O=(t,s,o,l)=>{let u=n+s;const d=r+o;if(l){i.highPerformanceSave(),u+=A;const t=sS.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),i.transformFromMatrix(t,!0),sS.free(t)}R&&(h?h(i,e.attribute,c):M&&(i.setStrokeStyle(e,e.attribute,C-n,_-r,c),i.strokeText(t,u,d,I))),k&&(a?a(i,e.attribute,c):E&&(i.setCommonStyle(e,e.attribute,C-n,_-r,c),i.fillText(t,u,d,I),this.drawUnderLine(b,x,e,u,d,I,c,i))),l&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(Array.isArray(u))if(i.setTextStyleWithoutAlignBaseline(e.attribute,c,I),"horizontal"===S){const{multilineLayout:t}=e;if(!t)return void i.highPerformanceRestore();const{xOffset:s,yOffset:o}=t.bbox;R&&(h?h(i,e.attribute,c):M&&(i.setStrokeStyle(e,e.attribute,C-n,_-r,c),t.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,I)})))),k&&(a?a(i,e.attribute,c):E&&(i.setCommonStyle(e,e.attribute,C-n,_-r,c),t.lines.forEach((t=>{i.fillText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,I),this.drawMultiUnderLine(b,x,e,(t.leftOffset||0)+n,(t.topOffset||0)+o+r,I,t.width,c,i)}))))}else{const t=e.cache,{verticalList:n}=t;i.textAlign="left",i.textBaseline="top";const r=P*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=Jp(e,s)}));let o=0,a=0;"bottom"===T?a=-r:"middle"===T&&(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;O(i,r-(e+1)*P+a,h,s),h+=n}))}))}else{const t=e.cache;if("horizontal"===S){i.setTextStyle(e.attribute,c,I);const t=e.clipedText;let n=0;P!==A&&("top"===T?n=(P-A)/2:"middle"===T||"bottom"===T&&(n=-(P-A)/2)),O(t,0,n,0)}else if(t){i.setTextStyleWithoutAlignBaseline(e.attribute,c,I);const{verticalList:n}=t;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===T?o=-P:"middle"===T&&(o=-P/2),"center"===B?r-=s/2:"right"===B&&(r-=s),i.textAlign="left",i.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;O(e,o,r,n),r+=i}))}}D&&this.restoreTransformUseContext2d(e,c,I,i),this._textAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,k,R,E,M,c,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,r,a),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.z=u,this.drawShape(t,r,l,c,i,n),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=i.clipedWidth,g=Cx(h,f),v=_x(l,c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){y.lineWidth=t,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const e=r+v+c;a.moveTo(n+g,e,s),a.lineTo(n+g+f,e,s),a.stroke()}if(e){y.lineWidth=e,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const t=r+v+c/2;a.moveTo(n+g,t,s),a.lineTo(n+g+f,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{textAlign:l=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=Cx(l,o),g=_x("alphabetic",c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let y=-3;if(t){v.lineWidth=t,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const e=r+g+c+y;h.moveTo(n+f,e,s),h.lineTo(n+f+o,e,s),h.stroke()}if(y=-1,e){v.lineWidth=e,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const t=r+g+c/2+y;h.moveTo(n+f,t,s),h.lineTo(n+f+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(xx)),fp("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=dp([rp()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=kb}drawShape(e,i,n,r,s,o,a,h){const l=fy(e,null==o?void 0:o.theme).polygon,{points:c=l.points,fill:u=l.fill,stroke:d=l.stroke,cornerRadius:p=l.cornerRadius,fillOpacity:f=l.fillOpacity,background:g,strokeOpacity:v=l.strokeOpacity,lineWidth:y=l.lineWidth,opacity:m=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y}=e.attribute,S=Jb(m,f,u),A=tx(m,v),T=$b(u,g),B=Zb(d,y);e.valid&&b&&(T||B)&&(S||A||a||h||g)&&(i.beginPath(),p<=0||Dp(p)&&p.every((t=>0===t))?XS(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r){var s;if(e.length<3)XS(t,e,i,n);else for(let o=0;o<e.length;o++){const a=e[o],h=e[(o+1)%e.length],l=e[(o+2)%e.length],c=h.x-a.x,u=h.y-a.y,d=h.x-l.x,p=h.y-l.y,f=(Math.atan2(u,c)-Math.atan2(p,d))/2,g=Math.abs(Math.tan(f));let v=Array.isArray(r)?null!==(s=r[(o+1)%e.length])&&void 0!==s?s:0:r,y=v/g;const m=YS(c,u),b=YS(d,p),x=Math.min(m,b);y>x&&(y=x,v=x*g);const w=qS(h,y,m,c,u),S=qS(h,y,b,d,p),A=2*h.x-w.x-S.x,T=2*h.y-w.y-S.y,B=YS(A,T),C=qS(h,YS(y,v),B,A,T);let _=Math.atan2(w.y-C.y,w.x-C.x);const P=Math.atan2(S.y-C.y,S.x-C.x);let E=P-_;E<0&&(_=P,E=-E),E>Math.PI&&(E-=Math.PI),0===o?t.moveTo(w.x+i,w.y+n):t.lineTo(w.x+i,w.y+n),E&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,v),t.lineTo(S.x+i,S.y+n)}}(i.camera?i:i.nativeContext,c,n,r,p),i.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,T,B,S,A,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),T&&(a?a(i,e.attribute,l):f&&(i.setCommonStyle(e,e.attribute,x-n,w-r,l),i.fill())),B&&(h?h(i,e.attribute,l):v&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,l),i.stroke())),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,T,B,S,A,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=fy(t,null==n?void 0:n.theme).polygon;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);ix(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasPolygonRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(yx)),fp("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const KS=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class{constructor(t){this.imageRenderContribitions=t,this.numberType=Pb}drawShape(e,i,n,r,s,o,a){const h=fy(e).image,{fill:l=h.fill,width:c=h.width,height:u=h.height,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,visible:f=h.visible,repeatX:g=h.repeatX,repeatY:v=h.repeatY,image:y}=e.attribute,m=Jb(d,p,l),b=$b(l);if(e.valid&&f&&b&&(m||a)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,b,!1,m,!1,h,s,a)})),i.setShadowStyle&&i.setShadowStyle(e,h),b)if(a)a(i,e.attribute,h);else if(m){if(!y||!e.resources)return;const t=e.resources.get(y);if("success"!==t.state)return;i.setCommonStyle(e,e.attribute,n,r,h);let s=0;if("repeat"===g&&(s|=1),"repeat"===v&&(s|=2),s){const e=i.createPattern(t.data,KS[s]);i.fillStyle=e,i.fillRect(n,r,c,u)}else i.drawImage(t.data,n,r,c,u)}this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,b,!1,m,!1,h,s,a)}))}}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=fy(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(!a||!t.resources)return;if("success"===t.resources.get(a).state){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);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}}},t.DefaultCanvasImageRender=dp([rp(),pp(0,ap(gp)),pp(0,sp(gx)),fp("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const $S=Symbol.for("IncrementalDrawContribution"),ZS=Symbol.for("ArcRender"),JS=Symbol.for("Arc3dRender"),QS=Symbol.for("AreaRender"),tA=Symbol.for("CircleRender"),eA=Symbol.for("GraphicRender"),iA=Symbol.for("GroupRender"),nA=Symbol.for("LineRender"),rA=Symbol.for("PathRender"),sA=Symbol.for("PolygonRender"),oA=Symbol.for("RectRender"),aA=Symbol.for("Rect3DRender"),hA=Symbol.for("SymbolRender"),lA=Symbol.for("TextRender"),cA=Symbol.for("RichTextRender"),uA=Symbol.for("Pyramid3dRender"),dA=Symbol.for("GlyphRender"),pA=Symbol.for("ImageRender"),fA=Symbol.for("RenderSelector"),gA=Symbol.for("DrawContribution");function vA(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 yA(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(Dp(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o,a,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const f=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,p+(null!==(h=e.y1)&&void 0!==h?h:0)*u);return e.stops.forEach((t=>{f.addColorStop(t.offset,t.color)})),f}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o;const a=i.AABBBounds;if(!a)return;let h=a.x2-a.x1,l=a.y2-a.y1,c=a.x1-n,u=a.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(o=e.y)&&void 0!==o?o:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i,n=0,r=0){var s,o,a,h,l,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,f=u.x1-n,g=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;f/=t,g/=e,d/=t,p/=e}const v=t.createRadialGradient(f+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*p,Math.max(d,p)*(null!==(a=e.r0)&&void 0!==a?a:0),f+(null!==(h=e.x1)&&void 0!==h?h:.5)*d,g+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{v.addColorStop(t.offset,t.color)})),v}(t,o,i,n,r)),s||"orange")}const mA=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return Ev({nativeCanvas:pv.global.createCanvas(t),...t});const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr};return Ev({nativeCanvas:pv.global.createCanvas(e),...e})}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};t.DefaultBaseBackgroundRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{background:p}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=fy(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},t.DefaultBaseBackgroundRenderContribution=dp([rp()],t.DefaultBaseBackgroundRenderContribution),t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=dp([rp(),pp(0,ap(gp)),pp(0,sp(Sx)),fp("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=mA.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const h=n.createPattern(o.nativeCanvas,"repeat");return mA.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,qp),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;if(!p)return;let y=this.textureMap.get(p);if(!y)switch(p){case"circle":y=this.createCirclePattern(g,v,f,e);break;case"diamond":y=this.createDiamondPattern(g,v,f,e);break;case"rect":y=this.createRectPattern(g,v,f,e);break;case"vertical-line":y=this.createVerticalLinePattern(g,v,f,e);break;case"horizontal-line":y=this.createHorizontalLinePattern(g,v,f,e);break;case"bias-lr":y=this.createBiasLRLinePattern(g,v,f,e);break;case"bias-rl":y=this.createBiasRLLinePattern(g,v,f,e);break;case"grid":y=this.createGridPattern(g,v,f,e)}y&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=y,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=dp([rp()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{innerRadius:d=h.innerRadius,outerRadius:p=h.outerRadius,startAngle:f=h.startAngle,endAngle:g=h.endAngle,opacity:v=h.opacity,outerBorder:y,innerBorder:m}=t.attribute;if(y){const{distance:r=h.outerBorder.distance}=y,s=vA(e,r,e.dpr),o=r/p;if(t.setAttributes({outerRadius:p+s,innerRadius:d-s,startAngle:f-o,endAngle:g+o}),e.beginPath(),sx(t,e,i,n,p+s,d-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=v,e.setStrokeStyle(t,y,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=m,s=vA(e,r,e.dpr),o=r/p;if(t.setAttributes({outerRadius:p-s,innerRadius:d+s,startAngle:f+o,endAngle:g-o}),e.beginPath(),sx(t,e,i,n,p-s,d+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=v,e.setStrokeStyle(t,m,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:p,innerRadius:d,startAngle:f,endAngle:g})}},t.DefaultArcRenderContribution=dp([rp()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultArcBackgroundRenderContribution=dp([rp()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultArcTextureRenderContribution=dp([rp()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{radius:d=h.radius,startAngle:p=h.startAngle,endAngle:f=h.endAngle,opacity:g=h.opacity,outerBorder:v,innerBorder:y}=t.attribute;if(v){const{distance:r=h.outerBorder.distance}=v,s=vA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d+s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,v,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,v,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=h.innerBorder.distance}=y,s=vA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d-s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=dp([rp()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultCircleBackgroundRenderContribution=dp([rp()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultCircleTextureRenderContribution=dp([rp()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}},t.DefaultGroupBackgroundRenderContribution=dp([rp()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d,width:p,height:f}=t.attribute;if(d)if(t.backgroundImg){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=fy(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}},t.DefaultImageBackgroundRenderContribution=dp([rp()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{width:d=h.width,height:p=h.height,cornerRadius:f=h.cornerRadius,opacity:g=h.opacity,outerBorder:v,innerBorder:y}=t.attribute;if(v){const{distance:r=h.outerBorder.distance}=v,s=vA(e,r,e.dpr),o=i-s,l=n-s,c=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(o,l,d+c,p+c)):(e.beginPath(),VS(e,o,l,d+c,p+c,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,v,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,v,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=h.innerBorder.distance}=y,s=vA(e,r,e.dpr),o=i+s,l=n+s,c=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(o,l,d-c,p-c)):(e.beginPath(),VS(e,o,l,d-c,p-c,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=dp([rp()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultRectBackgroundRenderContribution=dp([rp()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultRectTextureRenderContribution=dp([rp()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=dp([rp()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{width:d=h.width,height:p=h.height,stroke:f=h.stroke}=t.attribute;if(Array.isArray(f)&&f.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),f[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),f[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),f[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),f[3]){const t=f[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=dp([rp()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{size:d=h.size,opacity:p=h.opacity,outerBorder:f,innerBorder:g}=t.attribute,v=t.getParsedPath();if(v){if(f){const{distance:r=h.outerBorder.distance}=f,s=vA(e,r,e.dpr);if(e.beginPath(),!1===v.drawOffset(e,d,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=p,e.setStrokeStyle(t,f,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=g,s=vA(e,r,e.dpr);if(e.beginPath(),!1===v.drawOffset(e,d,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,g,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=p,e.setStrokeStyle(t,g,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}},t.DefaultSymbolRenderContribution=dp([rp()],t.DefaultSymbolRenderContribution);class bA extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}}class xA extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}}const wA=Symbol.for("RenderService"),SA=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,{...this.drawParams})}afterDraw(t){}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}},t.DefaultRenderService=dp([rp(),pp(0,ap(gA)),fp("design:paramtypes",[Object])],t.DefaultRenderService);var AA=new Qd((e=>{e(t.DefaultRenderService).toSelf(),e(wA).toService(t.DefaultRenderService)}));function TA(t,e,i,n=!1,r=!1){const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],h=s[e];r&&h.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}async function BA(t,e,i,n=!1){await t.forEachChildrenAsync(i,n)}function CA(t,e,i,n=!1){const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return o=!0,!0;return!1}),n);let a=null,h=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}const _A=Symbol.for("PickItemInterceptor");let PA=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,h=!1;if(t.forEachChildren((t=>(a=t.numberType===Ab,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var i,n,r,s;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=qp;for(;a<0;)a+=qp;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(h){const a=t.getChildren(),h=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,s.restore(),n.in3dInterceptor=!1,o}return null}initCanvasCtx(t){t.setTransformForCurrent()}};PA=dp([rp()],PA);const EA=Symbol.for("GraphicPicker"),MA=Symbol.for("PickerService");t.DefaultPickService=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;let r=0,s=0;if(i&&i.bounds){if(!i.bounds.contains(e.x,e.y))return n;r=i.bounds.x1,s=i.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new Tf(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(t[r].isContainer?n=this.pickGroup(t[r],e,o,i):n.graphic=this.pickItem(t[r],e,i),!n.graphic);r--)a||(a=n.group);return n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n}containsPoint(t,e,i){return!!this.pickItem(t,e,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=oS.allocate();if(cS(i,e),o){if(i){const t=oS.allocate();s.modelMatrix=uS(t,o,i),oS.free(i)}}else cS(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&&oS.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=sS.allocateByObj(i),l=new hf(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;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&&TA(t,Zg.zIndex,(i=>{if(i.isContainer){const s=new hf(e.x,e.y),o=fy(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;s.x-=a,s.y-=l,r=this.pickGroup(i,s,h,n)}else{const s=new hf(e.x,e.y);h.transformPoint(s,s);const o=fy(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;s.x-=a,s.y-=l;const c=this.pickItem(i,s,n);r.graphic=c}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&oS.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!u||t.stage.camera||(r.group=t),sS.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=dp([rp(),pp(0,ap(wp)),pp(1,ap(gp)),pp(1,sp(_A)),fp("design:paramtypes",[Object,Object])],t.DefaultPickService);const kA=Symbol.for("BoundsPicker"),RA=Symbol.for("GlobalPickerService");function DA(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],y=e[14],m=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*a+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*y,t[3]=b*o+x*c+w*f+S*m,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*a+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*y,t[7]=b*o+x*c+w*f+S*m,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*a+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*y,t[11]=b*o+x*c+w*f+S*m,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*a+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*y,t[15]=b*o+x*c+w*f+S*m,t}function IA(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}t.DefaultGlobalPickerService=class{constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new Tf(1,0,0,1,0,0);let s;for(let o=0;o<t.length&&(t[o].isContainer?n=this.pickGroup(t[o],e,r,i):n.graphic=this.pickItem(t[o],e,i),!n.graphic);o++)s||(s=n.group);return n.graphic||(n.group=s),n}containsPoint(t,e,i){return!!this.pickItem(t,e,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 hf(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 hf(e.x,e.y);i.transformPoint(s,s),r.graphic=this.pickItem(t,s,n)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}},t.DefaultGlobalPickerService=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],t.DefaultGlobalPickerService);class OA{set params(t){this._params={...t},this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return{...this._params}}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=oS.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=oS.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let r,s,o,a,h,l,c,u,d,p;const f=e[0],g=e[1],v=e[2],y=n[0],m=n[1],b=n[2],x=i[0],w=i[1],S=i[2];Math.abs(f-x)<Gp&&Math.abs(g-w)<Gp&&Math.abs(v-S)<Gp?rS.identity(t):(c=f-x,u=g-w,d=v-S,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=m*d-b*u,s=b*c-y*d,o=y*u-m*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,h=d*r-c*o,l=c*s-u*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+h*g+l*v),t[14]=-(c*f+u*g+d*v),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=oS.allocate()),this._vp=DA(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=oS.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=oS.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);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}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=oS.allocate()),this._vp=DA(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return IA(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;IA(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}const LA=[0,0,0],UA=new Tf(1,0,0,1,0,0);t.BrowserContext2d=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}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes={...Vg,opacity:1},this.strokeAttributes={...Yg,opacity:1},this.textAttributes={...qg,opacity:1},this._clearShadowStyle=!1,this._clearFilterStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Tf(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Tf(1,0,0,1,0,0)}reset(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Tf(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(t=!1){!t&&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 sS.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&&(sS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(sS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.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-=qp;else for(;i<e;)i+=qp;const h=Vp/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,u=c<l?-1:1,d=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=d*s+n,y=p*o+r,m=f*s+n,b=g*o+r,x=s*a*u,w=o*a*u;t.push([v-x*p,y+w*d,m+x*g,b-w*f,m,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&&(IA(LA,[t,e,o],this.modelMatrix),t=LA[0],e=LA[1],a=LA[2],IA(LA,[i,n,o],this.modelMatrix),i=LA[0],n=LA[1],h=LA[2],IA(LA,[r,s,o],this.modelMatrix),r=LA[0],s=LA[1],o=LA[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&&(IA(LA,[t,e,i],this.modelMatrix),t=LA[0],e=LA[1],i=LA[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&&(IA(LA,[t,e,i],this.modelMatrix),t=LA[0],e=LA[1],i=LA[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&&(IA(LA,[t,e,r],this.modelMatrix),t=LA[0],e=LA[1],s=LA[2],IA(LA,[i,n,r],this.modelMatrix),i=LA[0],n=LA[1],r=LA[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=cx(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&&(IA(LA,[t,e,i],this.modelMatrix),t=LA[0],e=LA[1],i=LA[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&&(IA(LA,[t,e,i],this.modelMatrix),t=LA[0],e=LA[1],i=LA[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(IA(LA,[e,i,n],this.modelMatrix),e=LA[0],i=LA[1],n=LA[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,e=pv.global.measureTextMethod){var i,n;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=pv.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(i=this.fontFamily)&&void 0!==i?i:qg.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(n=this.fontSize)&&void 0!==n?n:qg.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,e)):this.nativeContext.measureText(t)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?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&&(IA(LA,[e,i,n],this.modelMatrix),e=LA[0],i=LA[1],n=LA[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={};return r.forEach((t=>{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,s.fillStyle=yA(this,h,t,i,n)):s.globalAlpha=o*a}setShadowStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowStyle(t,i[0]);const n={};return i.forEach((t=>{Object.assign(n,t)})),this._setShadowStyle(t,e,n)}return this._setShadowStyle(t,e,i)}_setShadowStyle(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}=e;r<=1e-12||(s||a||h?(n.shadowBlur=s,n.shadowColor=o,n.shadowOffsetX=a,n.shadowOffsetY=h,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))}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={};return r.forEach((t=>{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:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=vA(this,h,this.dpr),s.strokeStyle=yA(this,l,t,i,n),s.lineJoin=c,s.setLineDash(u),s.lineCap=d,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=Bx(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=Bx(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(UA,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>sS.free(t))),this.stack.length=0}},t.BrowserContext2d.env="browser",t.BrowserContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.BrowserContext2d);const WA={WIDTH:500,HEIGHT:500,DPR:1};t.BrowserCanvas=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.width,this.height)}constructor(e){const{nativeCanvas:i,width:n=WA.WIDTH,height:r=WA.HEIGHT,dpr:s=WA.DPR,container:o,x:a,y:h,canvasControled:l=!0}=e;if(this._x=null!=a?a:0,this._y=null!=h?h:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==e.visiable,this.controled=l,"string"==typeof o){const t=pv.global.getElementById(o);t&&(this._container=t)}else this._container=o;this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._context=new t.BrowserContext2d(this,this._dpr),this._id=i.id,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),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}getNativeCanvas(){return this._nativeCanvas}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.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${n}px`,t.style.height=`${r}px`)}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}resize(t,e){if(!this.controled)return;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}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BrowserCanvas.env="browser",t.BrowserCanvas=dp([rp(),fp("design:paramtypes",[Object])],t.BrowserCanvas);const NA=Symbol.for("CanvasArcPicker"),FA=Symbol.for("CanvasArc3dPicker"),zA=Symbol.for("CanvasAreaPicker"),jA=Symbol.for("CanvasCirclePicker"),HA=Symbol.for("CanvasImagePicker"),GA=Symbol.for("CanvasLinePicker"),VA=Symbol.for("CanvasPathPicker"),XA=Symbol.for("CanvasRectPicker"),YA=Symbol.for("CanvasRect3dPicker"),qA=Symbol.for("CanvasSymbolPicker"),KA=Symbol.for("CanvasTextPicker"),$A=Symbol.for("CanvasPolygonPicker"),ZA=Symbol.for("CanvasPyramid3dPicker"),JA=Symbol.for("CanvasRichTextPicker"),QA=Symbol.for("CanvasGlyphPicker"),tT=Symbol.for("CanvasPickerContribution"),eT=Symbol.for("MathArcPicker"),iT=Symbol.for("MathAreaPicker"),nT=Symbol.for("MathCirclePicker"),rT=Symbol.for("MathLinePicker"),sT=Symbol.for("MathPathPicker"),oT=Symbol.for("MathRectPicker"),aT=Symbol.for("MathSymbolPicker"),hT=Symbol.for("MathTextPicker"),lT=Symbol.for("MathPolygonPicker"),cT=Symbol.for("MathGlyphPicker"),uT=Symbol.for("MathPickerContribution");t.DefaultCanvasPickerService=class extends t.DefaultPickService{constructor(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){super(p,f),this.contributions=t,this.circlePicker=e,this.rectPicker=i,this.arcPicker=n,this.areaPicker=r,this.imagePicker=s,this.linePicker=o,this.pathPicker=a,this.symbolPicker=h,this.textPicker=l,this.polygonPicker=c,this.richtextPicker=u,this.drawContribution=d,this.global=p,this.pickItemInterceptorContributions=f,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}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){const n={width:100,height:100,nativeCanvas:e.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new t.BrowserCanvas(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforePickItem&&r.beforePickItem(t,this,e,i))return t}const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultCanvasPickerService.prototype,"init",null),t.DefaultCanvasPickerService=dp([rp(),pp(0,ap(gp)),pp(0,sp(tT)),pp(1,ap(jA)),pp(2,ap(XA)),pp(3,ap(NA)),pp(4,ap(zA)),pp(5,ap(HA)),pp(6,ap(GA)),pp(7,ap(VA)),pp(8,ap(qA)),pp(9,ap(KA)),pp(10,ap($A)),pp(11,ap(JA)),pp(12,ap(gA)),pp(13,ap(wp)),pp(14,ap(gp)),pp(14,sp(_A)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],t.DefaultCanvasPickerService);const dT=new Tf(1,0,0,1,0,0),pT={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Tf(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Tf(1,0,0,1,0,0),this.path=new Fg}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return sS.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(sS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(sS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},pT),function(t,e,i){return ry(t,0,!1,e,i)}(this.path.commandList,pT.x,pT.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},pT);const i=vA(this,this.lineWidth,this.dpr);return function(t,e,i,n){return ry(t,e,!0,i,n)}(this.path.commandList,i,pT.x,pT.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(dT,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>sS.free(t))),this.stack.length=0}},t.EmptyContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.EmptyContext2d),t.DefaultMathPickerService=class extends t.DefaultPickService{constructor(t,e,i){super(e,i),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=i,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}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){if(!1===t.attribute.pickable)return null;const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultMathPickerService.prototype,"init",null),t.DefaultMathPickerService=dp([rp(),pp(0,ap(gp)),pp(0,sp(uT)),pp(1,ap(wp)),pp(2,ap(gp)),pp(2,sp(_A)),fp("design:paramtypes",[Object,Object,Object])],t.DefaultMathPickerService);var fT=new Qd((e=>{e(t.DefaultCanvasPickerService).toSelf().inSingletonScope(),e(t.DefaultMathPickerService).toSelf().inSingletonScope(),e(MA).toService(t.DefaultCanvasPickerService),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(RA).toService(t.DefaultGlobalPickerService),e(PA).toSelf().inSingletonScope(),e(_A).toService(PA),yp(e,_A)})),gT=new Qd((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(Wb).toService(t.DefaultGraphicService),e(Kw).toSelf().inSingletonScope(),e(qw).toService(Kw),yp(e,qw),e(Zw).toSelf().inSingletonScope(),e($w).toService(Zw),yp(e,$w),e(Qw).toSelf().inSingletonScope(),e(Jw).toService(Qw),yp(e,Jw),e(eS).toSelf().inSingletonScope(),e(tS).toService(eS),yp(e,tS),e(nS).toSelf().inSingletonScope(),e(iS).toService(nS),yp(e,iS),e(Nb).toConstantValue(RS)}));const vT=Symbol.for("AutoEnablePlugins"),yT=Symbol.for("PluginService");let mT=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Cv.isBound(vT)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};mT=dp([rp(),pp(0,ap(gp)),pp(0,sp(vT)),fp("design:paramtypes",[Object])],mT);var bT=new Qd((t=>{t(mT).toSelf(),t(yT).toService(mT),yp(t,vT)}));function xT(t,e=!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)}if(i.src=t,i.complete)return Promise.resolve(i);const n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}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){const e=fetch(t).then((t=>t.arrayBuffer()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){const e=fetch(t).then((t=>t.blob()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}},t.BaseEnvContribution=dp([rp()],t.BaseEnvContribution);let wT=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i;if(e){const{clientX:n,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let a,h;return o&&(a=s.width/o.offsetWidth,h=s.height/o.offsetHeight),{x:(n-s.left)/(Op(a)?a:1),y:(r-s.top)/(Op(h)?a:1)}}return{x:t.offsetX,y:t.offsetY}}loadImage(t){return xT(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return xT(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const n=document.createElement("canvas");t.id&&(n.id=null!==(e=t.id)&&void 0!==e?e:vy.GenAutoIncrementId().toString());const r=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,n.width=t.width*r,n.height=t.height*r),n}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}};function ST(){Cv.rebind(MA).toService(t.DefaultMathPickerService)}function AT(){Cv.rebind(MA).toService(t.DefaultMathPickerService)}wT=dp([rp(),fp("design:paramtypes",[])],wT);let TT=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=tt.getSystemInfoSync().pixelRatio;e.forEach(((e,o)=>{const a=tt.createCanvasContext(e);a.canvas={width:t.width*s,height:t.height*s};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>a,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,h),o>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),ST())}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 am.call(t)}}getCancelAnimationFrame(){return t=>{am.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(...t){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};TT=dp([rp(),fp("design:paramtypes",[])],TT);let BT=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}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);n.canvas={width:i.width*h,height:i.height*h},n.createRadialGradient||(n.createRadialGradient=(...t)=>n.createCircularGradient(...t)),!n.getImageData&&a.canvasGetImageData&&(n.getImageData=(e,i,n,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:i,width:n,height:r,success(t){s(t)}})}catch(t){o(t)}})));const l={id:t,width:i.width*h,height:i.height*h,offsetWidth:i.width,offsetHeight:i.height,getContext:()=>n,getBoundingClientRect:()=>({height:i.height,width:i.width})};return r.set(t,l),e>=s&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,AT())}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(...t){}};BT=dp([rp(),fp("design:paramtypes",[])],BT);let CT=!1;try{CT=!!lynx.createCanvasNG}catch(t){}let _T=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=SystemInfo.pixelRatio;e.forEach(((e,o)=>{const a=CT?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,CT&&a.attachToCanvasView(e);const h=a.getContext("2d");h.draw=(t,e)=>{e()};const l={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>h,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,l),o>=n&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),ST())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){const e=function(t,e=!1){if(e)return Promise.reject();const i=lynx.createImage(t),n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}(t,!1);return e.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 am.call(t)}}getCancelAnimationFrame(){return t=>{am.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(...t){}};_T=dp([rp(),fp("design:paramtypes",[])],_T);let PT=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 1}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){const e=fetch(t).then((t=>t.arrayBuffer()));return e.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 am.call(t)}}getCancelAnimationFrame(){return t=>{am.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};PT=dp([rp()],PT);let ET=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),async function(t,e,i,n,r){const s=wx.getSystemInfoSync().pixelRatio;for(let t=0;t<e.length;t++){const o=e[t];await new Promise((e=>{wx.createSelectorQuery().select(`#${o}`).fields({node:!0,size:!0}).exec((a=>{const h=a[0].node,l=a[0].width,c=a[0].height;h.width=l*s,h.height=c*s,i.set(o,h),t>=n&&r.push(h),e(null)}))}))}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList).then((()=>{ST()}))}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 am.call(t)}}getCancelAnimationFrame(){return t=>{am.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(...t){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};ET=dp([rp(),fp("design:paramtypes",[])],ET);var MT=new Qd((t=>{t(wT).toSelf().inSingletonScope(),t(xp).toService(wT),t(TT).toSelf().inSingletonScope(),t(xp).toService(TT),t(BT).toSelf().inSingletonScope(),t(xp).toService(BT),t(_T).toSelf().inSingletonScope(),t(xp).toService(_T),t(ET).toSelf().inSingletonScope(),t(xp).toService(ET),t(PT).toSelf().inSingletonScope(),t(xp).toService(PT),yp(t,xp)}));t.BaseWindowHandlerContribution=class{constructor(){this._uid=vy.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}},t.BaseWindowHandlerContribution=dp([rp(),fp("design:paramtypes",[])],t.BaseWindowHandlerContribution);let kT=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser"}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 this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(e){const i=this.global.createCanvas({width:e.width,height:e.height});let n;if(n="string"==typeof e.container?this.global.getElementById(e.container):e.container?e.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");e.offscreen?n=null:n.appendChild(i);const r={width:e.width,height:e.height,dpr:e.dpr,nativeCanvas:i,container:n,id:vy.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new t.BrowserCanvas(r)}createWindowByCanvas(e){var i;let n;if("string"==typeof e.canvas){if(n=this.global.getElementById(e.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=e.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let r=e.width,s=e.height;if(null==r||null==s||!e.canvasControled){const t=n.getBoundingClientRect();r=t.width,s=t.height}let o=e.dpr;if(!1===e.canvasControled&&(o&&console.warn("canvasControled为false后,dpr参数将无效"),o=null),null==o){o=null!==(i=n.getContext("2d").pixelRatio)&&void 0!==i?i:n.width/r}this.canvas=new t.BrowserCanvas({width:r,height:s,dpr:o,nativeCanvas:n,canvasControled:e.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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};kT.env="browser",kT=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],kT);let RT=class extends t.BrowserContext2d{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,i,n){return new Promise(((r,s)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o:this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}createPattern(t,e){return null}};RT.env="feishu",RT=dp([rp()],RT);const DT={WIDTH:500,HEIGHT:500,DPR:1};let IT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=DT.WIDTH,height:n=DT.HEIGHT,dpr:r=DT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new RT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};IT.env="feishu",IT=dp([rp(),fp("design:paramtypes",[Object])],IT);let OT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:vy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new IT(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 IT({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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};OT.env="feishu",OT=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],OT);let LT=class extends t.BrowserContext2d{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(yA(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:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(vA(this,h,this.dpr)),s.setStrokeStyle(yA(this,l,t,i,n)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=Bx(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Bx(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}};LT.env="taro",LT=dp([rp()],LT);const UT={WIDTH:500,HEIGHT:500,DPR:1};let WT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=UT.WIDTH,height:n=UT.HEIGHT,dpr:r=UT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new LT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};WT.env="taro",WT=dp([rp(),fp("design:paramtypes",[Object])],WT);let NT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:vy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new WT(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 WT({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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};NT.env="taro",NT=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],NT);let FT=class extends t.BrowserContext2d{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;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:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=vA(this,h,this.dpr),s.strokeStyle=yA(this,l,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};FT.env="lynx",FT=dp([rp()],FT);const zT={WIDTH:500,HEIGHT:500,DPR:1};let jT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=zT.WIDTH,height:n=zT.HEIGHT,dpr:r=zT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new FT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};jT.env="lynx",jT=dp([rp(),fp("design:paramtypes",[Object])],jT);let HT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.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:vy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new jT(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 jT({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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};HT.env="lynx",HT=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],HT),new Tf(1,0,0,1,0,0);let GT=class extends t.BrowserContext2d{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 Tf(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};GT.env="node",GT=dp([rp(),fp("design:paramtypes",[Object,Number])],GT);const VT={WIDTH:500,HEIGHT:500,DPR:1};let XT=class{get id(){return this._id}get x(){return 0}set x(t){}get y(){return 0}set 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 displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}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.width,this.height)}constructor(t){const{nativeCanvas:e,width:i=VT.WIDTH,height:n=VT.HEIGHT,canvasControled:r=!0,dpr:s=VT.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=i*s,this._pixelHeight=n*s,this._displayWidth=i,this._displayHeight=n,this._nativeCanvas=e,this._context=new GT(this,t.dpr),this._id=e.id,this._dpr=s}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}hide(){}show(){}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this._nativeCanvas.release&&_p(this._nativeCanvas.release)&&this._nativeCanvas.release()}};XT.env="node",XT=dp([rp(),fp("design:paramtypes",[Object])],XT);let YT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:vy.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new XT(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 XT({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(t="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,e){}};YT.env="node",YT=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],YT);let qT=class extends t.BrowserContext2d{draw(){}createPattern(t,e){return null}};qT.env="wx",qT=dp([rp()],qT);const KT={WIDTH:500,HEIGHT:500,DPR:1};let $T=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=KT.WIDTH,height:n=KT.HEIGHT,dpr:r=KT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new qT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};$T.env="wx",$T=dp([rp(),fp("design:paramtypes",[Object])],$T);class ZT{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let JT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new ZT}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:vy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new $T(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 $T({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};JT.env="wx",JT=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],JT);var QT=new Qd((t=>{t(kT).toSelf(),t(Vb).toDynamicValue((t=>t.container.get(kT))).whenTargetNamed(kT.env),t(OT).toSelf(),t(Vb).toDynamicValue((t=>t.container.get(OT))).whenTargetNamed(OT.env),t(NT).toSelf(),t(Vb).toDynamicValue((t=>t.container.get(NT))).whenTargetNamed(NT.env),t(HT).toSelf(),t(Vb).toDynamicValue((t=>t.container.get(HT))).whenTargetNamed(HT.env),t(JT).toSelf(),t(Vb).toDynamicValue((t=>t.container.get(JT))).whenTargetNamed(JT.env),t(YT).toSelf(),t(Vb).toDynamicValue((t=>t.container.get(YT))).whenTargetNamed(YT.env)})),tB=new Qd((t=>{t(Bv).toSelf().inSingletonScope(),t(Tv).toService(Bv),yp(t,Tv)}));let eB=class{constructor(t){this.global=t,this.offscreen=!1}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Ev({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,{context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff",...e,...i})}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,{context:r,...i,clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0})}getContext(){return this.context}release(){this.canvas.release()}};eB=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],eB);let iB=class{constructor(t){this.global=t,this.offscreen=!0}init(t,e,i){this.layer=t;const n=Ev({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var i;e.renderService.render(t,{context:this.context,...e,x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"})}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,o,a,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,h),n.nativeContext.restore()}merge(t){}};iB=dp([rp(),pp(0,ap(wp)),fp("design:paramtypes",[Object])],iB);var nB=new Qd((t=>{t(eB).toSelf(),t(iB).toSelf(),t(jb).toService(eB)}));const rB=Symbol.for("DrawItemInterceptor"),sB=new df;let oB=class{constructor(){this.order=1}afterDrawItem(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){sB.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(sB),!0}};oB=dp([rp()],oB);let aB=class{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=oS.allocate();cS(h,a);const l=s.modelMatrix;if(l){if(h){const t=oS.allocate();s.modelMatrix=uS(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===Ab,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var i,n,r,s;let o=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(n=t.attribute.endAngle)&&void 0!==n?n:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=qp;for(;a<0;)a+=qp;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",n.renderGroup(t,i),i.hack_pieFace="inside",n.renderGroup(t,i),i.hack_pieFace="top",n.renderGroup(t,i),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==l&&oS.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};aB=dp([rp()],aB);let hB=class{constructor(t,e,i,n){this.contributions=t,this.renderSelector=e,this.layerService=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new uf,this.backupDirtyBounds=new uf}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,x:r=0,y:s=0,width:o,height:a}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,o,a);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(l=h,c=n.dirtyBounds,u=!1,null===l?c:null===c?l:(gf=l.x1,vf=l.x2,yf=l.y1,mf=l.y2,bf=c.x1,xf=c.x2,wf=c.y1,Sf=c.y2,u&&(gf>vf&&(gf=(d=[vf,gf])[0],vf=d[1]),yf>mf&&(yf=(p=[mf,yf])[0],mf=p[1]),bf>xf&&(bf=(f=[xf,bf])[0],xf=f[1]),wf>Sf&&(wf=(g=[Sf,wf])[0],Sf=g[1])),gf>=xf||vf<=bf||yf>=Sf||mf<=wf?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(gf,bf),y1:Math.max(yf,wf),x2:Math.min(vf,xf),y2:Math.min(mf,Sf)}));h.x1=Math.floor(t.x1),h.y1=Math.floor(t.y1),h.x2=Math.ceil(t.x2),h.y2=Math.ceil(t.y2)}var l,c,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const v=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),v&&(i.beginPath(),i.rect(h.x1,h.y1,h.width(),h.height()),i.clip()),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Zg.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Zg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=CA(e,i,Zg.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!_f(t.AABBBounds,this.dirtyBounds,!1))return;const n=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var n;i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):TA(t,Zg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.camera))}}),this.dirtyBounds.copy(n)}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||Cv.get($S);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=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;if(!t.isContainer&&!_f(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=r),r?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n}=i;if(n){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=i,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=yA(e,n,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}};dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],hB.prototype,"init",null),hB=dp([rp(),pp(0,hp(eA)),pp(1,ap(fA)),pp(2,ap(qb)),pp(3,ap(gp)),pp(3,sp(rB)),fp("design:paramtypes",[Array,Object,Object,Object])],hB);let lB=class{selector(t){return null}};lB=dp([rp()],lB);let cB=class{constructor(t){this.groupRenderContribitions=t,this.numberType=_b}drawShape(e,i,n,r,s,o,a,h){const l=fy(e,null==o?void 0:o.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:y=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:S=l.visible}=e.attribute,A=Qb(p,y,f,g,c),T=ex(p,m,f,g),B=$b(c,u),C=Zb(d,w);if(!e.valid||!S)return;if(!v){if(!B&&!C)return;if(!(A||T||a||h||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||Dp(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),VS(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const _={doFill:B,doStroke:C};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h,_)})),v&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):A&&(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,A,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=fy(t,null==n?void 0:n.theme).group,a=r.modelMatrix;if(r.camera){const e=oS.allocate(),i=oS.allocate();dS(i,t,o),uS(e,a||e,i),r.modelMatrix=e,oS.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:h=o.scrollX,scrollY:l=o.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==a&&oS.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};cB=dp([rp(),pp(0,ap(gp)),pp(0,sp(fx)),fp("design:paramtypes",[Object])],cB);let uB=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=Eb}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=fy(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,y=Jb(d,p,c),m=tx(d,f),b=$b(c),x=Zb(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(y||m||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(),LS(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};uB=dp([rp()],uB);let dB=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=Tb}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=fy(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=Jb(d,u,c),g=$b(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(),US(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};var pB;dB=dp([rp()],dB),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(pB||(pB={}));let fB=class extends hB{constructor(t,e,i,n,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=i,this.areaRender=n,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=pB.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new bp([])}}init(){super.init(),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,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Zg.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Zg.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 BA(t,Zg.zIndex,((i,n)=>{if(this.status===pB.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=pB.STOP,await new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=pB.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 BA(t,Zg.zIndex,(async t=>{e.break||t.isContainer&&await this.renderGroup(t,e)})),i(!1)}})}))}};dp([ap(wp),fp("design:type",Object)],fB.prototype,"global",void 0),fB=dp([rp(),pp(0,hp(eA)),pp(1,ap(fA)),pp(2,ap(uB)),pp(3,ap(dB)),pp(4,ap(qb)),pp(5,ap(gp)),pp(5,sp(rB)),fp("design:paramtypes",[Array,Object,Object,Object,Object,Object])],fB);let gB=class extends t.BaseRender{constructor(){super(...arguments),this.type="rect3d",this.numberType=Ib}drawShape(t,e,i,n,r,s,o,a){var h;const l=fy(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,width:d=l.width,height:p=l.height,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:v=l.lineWidth,strokeOpacity:y=l.strokeOpacity,visible:m=l.visible}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Qb(f,g,d,p,c),w=ex(f,y,d,p),S=$b(c),A=Zb(u,v);if(!t.valid||!m)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:T,camera:B}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,C,r,e,T,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,C,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(t,e,i,n,r,s,o,a){const h=Fm.get(r).value,l=n.vertices,c=l.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];n.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=c[i[0]],s=c[i[1]],o=c[i[2]],a=c[i[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((n=>{const{polygon:c,normal:u}=n.polygon,d=l[c[0]],p=l[c[1]],f=l[c[2]],g=l[c[3]],v={x:t+d[0],y:e+d[1],z:i+d[2]},y={x:t+p[0],y:e+p[1],z:i+p[2]},m={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]};s.beginPath(),s.moveTo(v.x,v.y,v.z),s.lineTo(y.x,y.y,y.z),s.lineTo(m.x,m.y,m.z),s.lineTo(b.x,b.y,b.z),s.closePath(),a?a(s,null,null):(s.fillStyle=o?o.computeColor(u,h):r,s.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=fy(t).rect,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};gB=dp([rp()],gB);let vB=class{constructor(){this.numberType=Ob}drawShape(t,e,i,n,r){const s=fy(t).richtext,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;if(!Jb(h,l,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){var s;const o=fy(t).richtextIcon,{width:a=o.width,height:h=o.height,opacity:l=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:p=o.backgroundStroke,backgroundStrokeOpacity:f=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:y=a,backgroundHeight:m=h}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-a)/2,r=(m-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,y,m)):(e.beginPath(),VS(e,i-t,n-r,y,m,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=l,e.drawImage(b.data,i,n,a,h))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=fy(t).richtext;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);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}};vB=dp([rp()],vB);let yB=class{constructor(){this.numberType=Cb}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=fy(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};yB=dp([rp()],yB);let mB=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Ab}drawShape(t,e,i,n,r,s,o,a){var h;const l=fy(t,null==s?void 0:s.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:y=l.visible}=t.attribute,m=Jb(p,f,c),b=tx(p,v),x=$b(c,u),w=Zb(d,g),S=null!==(h=this.z)&&void 0!==h?h:0;if(!t.valid||!y)return;if(!x&&!w)return;if(!(m||b||o||a||u))return;const{outerRadius:A=l.outerRadius,innerRadius:T=l.innerRadius,height:B=10}=t.attribute,C=Fm.get(c).value,{light:_}=r.stage||{},P=r.hack_pieFace,E={top:S,bottom:S+B},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===P||"top"===P?(e.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=Kp(h-a),c=h>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=Gp)e.moveTo(i,n,r);else if(l>=qp-Gp)e.moveTo(i+s*Zp(a),n+s*tf(a),r),e.arc(i,n,s,a,h,!c,r),o>Gp&&(e.moveTo(i+o*Zp(h),n+o*tf(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,h),y=s*Zp(p),m=s*tf(p),b=o*Zp(g),x=o*tf(g);l<.001?u=!0:(e.moveTo(i+y,n+m,r),e.arc(i,n,s,p,f,!c,r)),!(o>Gp)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(t,e,i,n,E[P],A,T),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],C):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))):"outside"!==P&&"inside"!==P||("inside"===P&&(e.save(),e.beginPath(),e.arc(i,n,T,0,qp,!0,E.top),e.clip()),e.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=Kp(l-h),u=l>h;let d=!1;if(o<=Gp)e.moveTo(i,n,r);else if(c>=qp-Gp)e.moveTo(i+o*Zp(h),n+o*tf(h),r),e.arc(i,n,o,h,l,!u,r),e.lineTo(i+o*Zp(l),n+o*tf(l),s),e.arc(i,n,o,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*Zp(c),g=o*tf(c),v=o*Zp(p),y=o*tf(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+v,n+y,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(t,e,i,n,E.top,E.bottom,"outside"===P?A:T,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=t.getParsePadAngle(e,i);return"outside"===P?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],C):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),"inside"===P&&e.restore())}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=fy(t,null==n?void 0:n.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,ix(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&oS.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};mB=dp([rp()],mB);let bB=class extends t.BaseRender{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Rb}drawShape(t,e,i,n,r,s,o,a){var h;const l=fy(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:v=l.visible,points:y,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Jb(d,p,c),w=tx(d,g),S=$b(c),A=Zb(u,f);if(!t.valid||!v||4!==y.length)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:T,camera:B}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,C,m,r,e,T,B,t,l,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,C,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(t,e,i,n,r,s,o,a,h,l,c,u){const d=Fm.get(s).value,p=n.vertices,f=p.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,s=f[i[0]],o=f[i[1]],a=f[i[2]],h=f[i[3]];t.ave_z=s+o+a+h})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:r,normal:h}=n.polygon,f=p[r[0]],g=p[r[1]],v=p[r[2]],y=p[r[3]],m={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]},x={x:t+v[0],y:e+v[1],z:i+v[2]},w={x:t+y[0],y:e+y[1],z:i+y[2]};o.beginPath(),o.moveTo(m.x,m.y,m.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,l.attribute,c):(o.fillStyle=a?a.computeColor(h,d):s,o.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=fy(t).polygon,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};bB=dp([rp()],bB);let xB=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};xB=dp([rp()],xB);let wB=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};wB=dp([rp()],wB);let SB=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};SB=dp([rp()],SB);let AB=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};AB=dp([rp()],AB);let TB=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};TB=dp([rp()],TB);let BB=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:y=t.attribute}=d||{},{texture:m=(null!==(p=t.attribute.texture)&&void 0!==p?p:sm(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:sm(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:sm(h,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:sm(h,"texturePadding"))}=y;if(!m)return;let S=this.textureMap.get(m);if(!S)switch(m){case"circle":S=this.createCirclePattern(x,w,b,e);break;case"diamond":S=this.createDiamondPattern(x,w,b,e);break;case"rect":S=this.createRectPattern(x,w,b,e);break;case"vertical-line":S=this.createVerticalLinePattern(x,w,b,e);break;case"horizontal-line":S=this.createHorizontalLinePattern(x,w,b,e);break;case"bias-lr":S=this.createBiasLRLinePattern(x,w,b,e);break;case"bias-rl":S=this.createBiasRLLinePattern(x,w,b,e);break;case"grid":S=this.createGridPattern(x,w,b,e)}S&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S,e.fill(),e.highPerformanceRestore())}};BB=dp([rp()],BB);var CB=new Qd((e=>{e(hB).toSelf(),e(gA).toService(hB),e(fB).toSelf(),e($S).toService(fB),e(lB).toSelf(),e(fA).toService(lB),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(tA).to(t.DefaultCanvasCircleRender),e(eA).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(px).toService(t.DefaultCircleRenderContribution),e(px).toService(t.DefaultCircleBackgroundRenderContribution),e(px).toService(t.DefaultCircleTextureRenderContribution),yp(e,px),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(oA).to(t.DefaultCanvasRectRender),e(eA).to(t.DefaultCanvasRectRender),e(gB).toSelf().inSingletonScope(),e(aA).toService(gB),e(eA).toService(aA),e(t.DefaultRectRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectTextureRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectBeforeRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectAfterRenderContribution).toSelf().inSingletonScope(),e(mx).toService(t.DefaultRectRenderContribution),e(mx).toService(t.DefaultRectBackgroundRenderContribution),e(mx).toService(t.DefaultRectTextureRenderContribution),e(mx).toService(t.SplitRectBeforeRenderContribution),e(mx).toService(t.SplitRectAfterRenderContribution),yp(e,mx),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(lA).to(t.DefaultCanvasTextRender),e(eA).to(t.DefaultCanvasTextRender),yp(e,xx),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(rA).to(t.DefaultCanvasPathRender),e(eA).to(t.DefaultCanvasPathRender),e(SB).toSelf().inSingletonScope(),e(AB).toSelf().inSingletonScope(),e(vx).toService(SB),e(vx).toService(AB),yp(e,vx),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(hA).to(t.DefaultCanvasSymbolRender),e(eA).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(bA).toSelf().inSingletonScope(),e(xA).toSelf().inSingletonScope(),e(bx).toService(t.DefaultSymbolRenderContribution),e(bx).toService(bA),e(bx).toService(xA),yp(e,bx),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(ZS).to(t.DefaultCanvasArcRender),e(eA).to(t.DefaultCanvasArcRender),e(mB).toSelf().inSingletonScope(),e(JS).toService(mB),e(eA).toService(JS),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e(ux).toService(t.DefaultArcRenderContribution),e(ux).toService(t.DefaultArcBackgroundRenderContribution),e(ux).toService(t.DefaultArcTextureRenderContribution),yp(e,ux),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(nA).to(t.DefaultCanvasLineRender),e(eA).to(t.DefaultCanvasLineRender),e(uB).toSelf().inSingletonScope(),e(dB).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(QS).to(t.DefaultCanvasAreaRender),e(eA).to(t.DefaultCanvasAreaRender),e(TB).toSelf().inSingletonScope(),e(BB).toSelf().inSingletonScope(),e(dx).toService(TB),e(dx).toService(BB),yp(e,dx),e(cB).toSelf().inSingletonScope(),e(iA).to(cB),e(eA).to(cB),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(fx).toService(t.DefaultGroupBackgroundRenderContribution),yp(e,fx),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e(sA).to(t.DefaultCanvasPolygonRender),e(eA).to(t.DefaultCanvasPolygonRender),e(xB).toSelf().inSingletonScope(),e(wB).toSelf().inSingletonScope(),e(yx).toService(xB),e(yx).toService(wB),yp(e,yx),e(yB).toSelf().inSingletonScope(),e(dA).toService(yB),e(eA).toService(dA),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(pA).toService(t.DefaultCanvasImageRender),e(eA).toService(pA),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(gx).toService(t.DefaultImageBackgroundRenderContribution),yp(e,gx),e(vB).toSelf().inSingletonScope(),e(cA).toService(vB),e(eA).toService(cA),e(bB).toSelf().inSingletonScope(),e(uA).toService(bB),e(eA).toService(uA),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(xx).toService(t.DefaultBaseInteractiveRenderContribution),e(ux).toService(t.DefaultBaseInteractiveRenderContribution),e(vx).toService(t.DefaultBaseInteractiveRenderContribution),e(bx).toService(t.DefaultBaseInteractiveRenderContribution),e(mx).toService(t.DefaultBaseInteractiveRenderContribution),e(gx).toService(t.DefaultBaseInteractiveRenderContribution),e(px).toService(t.DefaultBaseInteractiveRenderContribution),e(dx).toService(t.DefaultBaseInteractiveRenderContribution),e(yx).toService(t.DefaultBaseInteractiveRenderContribution),yp(e,Sx),yp(e,eA),e(oB).toSelf().inSingletonScope(),e(rB).toService(oB),e(aB).toSelf().inSingletonScope(),e(rB).toService(aB),yp(e,rB)}));let _B=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Bb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=vA(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};_B=dp([rp(),pp(0,ap(tA)),fp("design:paramtypes",[Object])],_B);const PB=new df;let EB=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Db}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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||Ip(s,!0)&&0!==s||Dp(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;return n.lineWidth=vA(n,s,n.dpr),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;PB.setValue(i.x1,i.y1,i.x2,i.y2),PB.expand(-s/2),l=!PB.containsPoint(e)}}return n.highPerformanceRestore(),l}};EB=dp([rp(),pp(0,ap(oA)),fp("design:paramtypes",[Object])],EB);let MB=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Sb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=vA(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};MB=dp([rp(),pp(0,ap(ZS)),fp("design:paramtypes",[Object])],MB);let kB=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Tb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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}};kB=dp([rp(),pp(0,ap(QS)),fp("design:paramtypes",[Object])],kB);let RB=class{constructor(){this.type="image",this.numberType=Pb}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};RB=dp([rp()],RB);let DB=class extends t.BaseRender{};DB=dp([rp()],DB);let IB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Eb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=fy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=vA(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};IB=dp([rp(),pp(0,ap(nA)),fp("design:paramtypes",[Object])],IB);let OB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Mb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=vA(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};OB=dp([rp(),pp(0,ap(rA)),fp("design:paramtypes",[Object])],OB);let LB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Lb}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=fy(t).symbol,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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=vA(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};LB=dp([rp(),pp(0,ap(hA)),fp("design:paramtypes",[Object])],LB);let UB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Ub}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=fy(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,n,a),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,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,d=h.height(),g=h.width(),v=_x(o,d,r),y=Cx(a,g);return e.rect(y+l,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&oS.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};UB=dp([rp(),pp(0,ap(lA)),fp("design:paramtypes",[Object])],UB);let WB=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=kb}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};WB=dp([rp(),pp(0,ap(sA)),fp("design:paramtypes",[Object])],WB),new df;let NB=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Ob}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};NB=dp([rp(),pp(0,ap(cA)),fp("design:paramtypes",[Object])],NB);let FB=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Cb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};FB=dp([rp(),pp(0,ap(dA)),fp("design:paramtypes",[Object])],FB),new df;let zB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Ib}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};zB=dp([rp(),pp(0,ap(aA)),fp("design:paramtypes",[Object])],zB),new df;let jB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Rb}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};jB=dp([rp(),pp(0,ap(uA)),fp("design:paramtypes",[Object])],jB),new df;let HB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Ab}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&oS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};HB=dp([rp(),pp(0,ap(JS)),fp("design:paramtypes",[Object])],HB);var GB=new Qd(((t,e,i,n)=>{t(_B).toSelf().inSingletonScope(),t(jA).toService(_B),t(tT).toService(jA),t(EB).toSelf().inSingletonScope(),t(XA).toService(EB),t(tT).toService(XA),t(zB).toSelf().inSingletonScope(),t(YA).toService(zB),t(tT).toService(YA),t(MB).toSelf().inSingletonScope(),t(NA).toService(MB),t(tT).toService(NA),t(kB).toSelf().inSingletonScope(),t(zA).toService(kB),t(tT).toService(zA),t(RB).toSelf().inSingletonScope(),t(HA).toService(RB),t(tT).toService(HA),t(IB).toSelf().inSingletonScope(),t(GA).toService(IB),t(tT).toService(GA),t(OB).toSelf().inSingletonScope(),t(VA).toService(OB),t(tT).toService(VA),t(LB).toSelf().inSingletonScope(),t(qA).toService(LB),t(tT).toService(qA),t(UB).toSelf().inSingletonScope(),t(KA).toService(UB),t(tT).toService(KA),t(WB).toSelf().inSingletonScope(),t($A).toService(WB),t(tT).toService($A),t(jB).toSelf().inSingletonScope(),t(ZA).toService(jB),t(tT).toService(ZA),t(HB).toSelf().inSingletonScope(),t(FA).toService(HB),t(tT).toService(FA),t(NB).toSelf().inSingletonScope(),t(JA).toService(NB),t(tT).toService(JA),t(FB).toSelf().inSingletonScope(),t(QA).toService(FB),t(tT).toService(QA),yp(t,tT)}));let VB=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=Mb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};VB=dp([rp(),pp(0,ap(rA)),fp("design:paramtypes",[Object])],VB);let XB=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Bb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};XB=dp([rp(),pp(0,ap(tA)),fp("design:paramtypes",[Object])],XB);const YB=new df;let qB=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Db}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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||Ip(s,!0)&&0!==s||Dp(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;return n.lineWidth=s,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;YB.setValue(i.x1,i.y1,i.x2,i.y2),YB.expand(-s/2),l=!YB.containsPoint(e)}}return n.highPerformanceRestore(),l}};qB=dp([rp(),pp(0,ap(oA)),fp("design:paramtypes",[Object])],qB);let KB=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Sb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};KB=dp([rp(),pp(0,ap(ZS)),fp("design:paramtypes",[Object])],KB);let $B=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Tb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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}};$B=dp([rp(),pp(0,ap(QS)),fp("design:paramtypes",[Object])],$B);let ZB=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=Eb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};ZB=dp([rp(),pp(0,ap(nA)),fp("design:paramtypes",[Object])],ZB);let JB=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=Lb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};JB=dp([rp(),pp(0,ap(hA)),fp("design:paramtypes",[Object])],JB);let QB=class{constructor(){this.type="text",this.numberType=Ub}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};QB=dp([rp()],QB);let tC=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=kb}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=fy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};tC=dp([rp(),pp(0,ap(sA)),fp("design:paramtypes",[Object])],tC);let eC=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Cb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};eC=dp([rp(),pp(0,ap(dA)),fp("design:paramtypes",[Object])],eC);var iC=new Qd((t=>{t(XB).toSelf().inSingletonScope(),t(nT).toService(XB),t(uT).toService(nT),t(qB).toSelf().inSingletonScope(),t(oT).toService(qB),t(uT).toService(oT),t(KB).toSelf().inSingletonScope(),t(eT).toService(KB),t(uT).toService(eT),t($B).toSelf().inSingletonScope(),t(iT).toService($B),t(uT).toService(iT),t(ZB).toSelf().inSingletonScope(),t(rT).toService(ZB),t(uT).toService(rT),t(VB).toSelf().inSingletonScope(),t(sT).toService(VB),t(uT).toService(sT),t(JB).toSelf().inSingletonScope(),t(aT).toService(JB),t(uT).toService(aT),t(QB).toSelf().inSingletonScope(),t(hT).toService(QB),t(uT).toService(hT),t(tC).toSelf().inSingletonScope(),t(lT).toService(tC),t(uT).toService(lT),t(eC).toSelf().inSingletonScope(),t(cT).toService(eC),t(eC).toService(cT),yp(t,uT)}));var nC=new Qd((e=>{e(_v).toDynamicValue((()=>e=>new t.BrowserCanvas(e))).whenTargetNamed(t.BrowserCanvas.env),e(Pv).toDynamicValue((()=>(e,i)=>new t.BrowserContext2d(e,i))).whenTargetNamed(t.BrowserContext2d.env)})),rC=new Qd((t=>{t(_v).toDynamicValue((()=>t=>new WT(t))).whenTargetNamed(WT.env),t(Pv).toDynamicValue((()=>(t,e)=>new LT(t,e))).whenTargetNamed(LT.env)})),sC=new Qd((t=>{t(_v).toDynamicValue((()=>t=>new IT(t))).whenTargetNamed(IT.env),t(Pv).toDynamicValue((()=>(t,e)=>new RT(t,e))).whenTargetNamed(RT.env)})),oC=new Qd((t=>{t(_v).toDynamicValue((()=>t=>new jT(t))).whenTargetNamed(jT.env),t(Pv).toDynamicValue((()=>(t,e)=>new FT(t,e))).whenTargetNamed(FT.env)})),aC=new Qd((t=>{t(_v).toDynamicValue((()=>t=>new $T(t))).whenTargetNamed($T.env),t(Pv).toDynamicValue((()=>(t,e)=>new qT(t,e))).whenTargetNamed(qT.env)})),hC=new Qd((t=>{t(_v).toDynamicValue((()=>t=>new XT(t))).whenTargetNamed(XT.env),t(Pv).toDynamicValue((()=>(t,e)=>new GT(t,e))).whenTargetNamed(GT.env)}));Cv.load(Kb),Cv.load(gT),Cv.load(AA),Cv.load(fT),Cv.load(bT),function(t){t.load(MT),t.load(QT),t.load(tB),t.load(nB)}(Cv),function(t){t.load(CB)}(Cv),function(t){t.load(GB),t.load(iC)}(Cv),function(t){t.load(nC),t.load(sC),t.load(rC),t.load(oC),t.load(aC),t.load(hC)}(Cv);const lC=Cv.get(wp);pv.global=lC;const cC=Cv.get(Yb);pv.graphicUtil=cC;const uC=Cv.get(Xb);pv.transformUtil=uC;const dC=Cv.get(Wb);pv.graphicService=dC;const pC=Cv.get(RA),fC=Cv.get(qb);pv.layerService=fC;class gC{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=vy.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pv.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),pv.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){pv.graphicService.hooks.onAttributeUpdate.taps=pv.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pv.graphicService.hooks.onSetStage.taps=pv.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class vC{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=vy.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,a=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+o,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+a,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class yC{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=vy.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,pv.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))})),pv.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){pv.graphicService.hooks.onAddIncremental.taps=pv.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),pv.graphicService.hooks.onClearIncremental.taps=pv.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,pv.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,{x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext(),...this.nextUserParams})})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const mC=new df;class bC{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=vy.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),pv.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&&(mC.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(mC,t.parent&&t.parent.globalTransMatrix)))})),pv.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))})),pv.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){pv.graphicService.hooks.beforeUpdateAABBBounds.taps=pv.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),pv.graphicService.hooks.afterUpdateAABBBounds.taps=pv.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)),pv.graphicService.hooks.onRemove.taps=pv.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}class xC{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=vy.GenAutoIncrementId(),this.key=this.name+this.id}tryLayout(t){const e=t.parent;if(!e)return;const i=fy(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{width:r,height:s,flexDirection:o=i.flexDirection,flexWrap:a=i.flexWrap,justifyContent:h=i.justifyContent,alignItems:l=i.alignItems,alignContent:c=i.alignContent}=e.attribute;if(!r||!s)return;const u={main:{len:r,field:"x"},cross:{len:s,field:"y"},dir:1},d=u.main,p=u.cross;"row-reverse"===o?u.dir=-1:"column"===o?(d.len=s,p.len=r,d.field="y",p.field="x"):"column-reverse"===o&&(d.len=s,p.len=r,d.field="y",p.field="x",u.dir=-1);let f=0,g=0;const v=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===d.field?e.width():e.height(),n="x"===p.field?e.width():e.height();v.push({mainLen:i,crossLen:n}),f+=i,g=Math.max(g,n)}));const y=[];if(f>d.len&&"wrap"===a){let t=0,e=0;v.forEach((({mainLen:i,crossLen:n},r)=>{t+i>d.len?0===t?(y.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(y.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),y.push({idx:v.length-1,mainLen:t,crossLen:e})}else y.push({idx:v.length-1,mainLen:f,crossLen:g});const m=e.getChildren();let b=0;if(y.forEach((t=>{this.layoutMain(e,m,h,d,v,b,t),b=t.idx+1})),g=y.reduce(((t,e)=>t+e.crossLen),0),1===y.length){if("flex-end"===l){const t=p.len;this.layoutCross(m,l,p,t,v,y[0],0)}else if("center"===l){const t=p.len/2;this.layoutCross(m,l,p,t,v,y[0],0)}}else if("flex-start"===c){b=0;let t=0;y.forEach(((e,i)=>{this.layoutCross(m,"flex-start",p,t,v,y[i],b),b=e.idx+1,t+=e.crossLen}))}else if("center"===c){b=0;let t=Math.max(0,(p.len-g)/2);y.forEach(((e,i)=>{this.layoutCross(m,"center",p,t+e.crossLen/2,v,y[i],b),b=e.idx+1,t+=e.crossLen}))}else if("space-around"===c){b=0;const t=Math.max(0,(p.len-g)/y.length/2);let e=t;y.forEach(((i,n)=>{this.layoutCross(m,"flex-start",p,e,v,y[n],b),b=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===c){b=0;const t=Math.max(0,(p.len-g)/(2*y.length-2));let e=0;y.forEach(((i,n)=>{this.layoutCross(m,"flex-start",p,e,v,y[n],b),b=i.idx+1,e+=i.crossLen+2*t}))}}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t,t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=o.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t,t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a,a+=r[t].mainLen+2*i}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t,t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a,a+=r[t].mainLen+2*i}}layoutCross(t,e,i,n,r,s,o){if("flex-end"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen;else if("center"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2;else for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n}activate(t){this.pluginService=t,dC.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)})),dC.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)}))}deactivate(t){dC.hooks.onAttributeUpdate.taps=dC.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),dC.hooks.onSetStage.taps=dC.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const wC=new Oy;wC.addTimeline(Wy);wC.setFPS(60);class SC{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Fm.get(e).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;const n=ef(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=Qp(Jp((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;if(Rp(e)){r=Fm.get(e).value}else r=e;const s=this.colorRgb;return Fm.to.rgb(s[0]*r[0]*n,s[1]*r[1]*n,s[2]*r[2]*n)}}const AC="white";class TC extends zb{set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:AC}set background(t){this._background=t}get defaultLayer(){return this.at(0)}constructor(t){var e;super({}),this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.theme=new dy,this.hooks={beforeRender:new bp(["stage"]),afterRender:new bp(["stage"])},this.global=Cv.get(wp),this.window=Cv.get(Gb),this.renderService=Cv.get(wA),this.pickerService=Cv.get(MA),this.pluginService=Cv.get(yT),this.layerService=Cv.get(qb),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new df,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.renderCount=0,this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=null!==(e=t.background)&&void 0!==e?e:AC,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,this.global.supportEvent&&(this.eventSystem=new Py({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.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||wC,this.supportInteractiveLayer=!1!==t.interactiveLayer}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){var e,i,n,r,s,o;this.option3d=t;const a=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:v="white",ambient:y}=h,m=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[m,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(o=l.dz)&&void 0!==o?o:0)];let w=0,S=0,A=0;c||(w=Math.sin(u)+m,S=Math.sin(d)+b,A=Math.cos(u)*Math.cos(d)*1),this.light=new SC(g,v,y);const T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,S,A],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new OA(T),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new vC))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new gC))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new yC))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new uf;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new bC,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new xC))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t){const e=this.layerService.createLayer(this,{main:!1,canvasId:t});return this.appendChild(e),e}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive")}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach(((t,i)=>{t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},{renderStyle:this.renderStyle,...e})})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)}combineLayersToWindow(){this.forEach(((t,e)=>{t.combineTo(this.window,{clear:0===e,x:this.x,y:this.y,width:this.viewWidth,height:this.viewHeight,renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds})}))}renderNextFrame(t){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){this.nextFrameRenderLayerSet.size&&(this.ticker.start(),this.hooks.beforeRender.call(this),this.forEach((t=>{this.nextFrameRenderLayerSet.has(t)&&t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},{renderStyle:this.renderStyle,...this.lastRenderparams||{}})})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear())}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params={...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){this.forEachChildren((e=>{e.setDpr(t)}))}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new hf(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t,e){this.forEachChildren(((i,n)=>{i.drawTo(t,{...e,renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds})}))}renderToNewWindow(t=!0){const e=Cv.get(Gb);return t?e.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}):e.create({width:Math.min(this.viewWidth,this.window.width-this.x),height:Math.min(this.viewHeight,this.window.height-this.y),dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e,{x:0,y:0,width:e.width,height:e.height}),e}toCanvas(t=!0){const e=this.renderToNewWindow(t).getNativeHandler();return e.nativeCanvas?e.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var BC;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(BC||(BC={}));t.ACustomAnimate=Ny,t.ARC3D_NUMBER_TYPE=Ab,t.ARC_NUMBER_TYPE=Sb,t.AREA_NUMBER_TYPE=Tb,t.Animate=zy,t.AnimateGroup=class extends Ny{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?Ly[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Ny{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?Ly[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Arc=jw,t.Arc3d=Hw,t.Arc3dRender=JS,t.ArcRender=ZS,t.ArcRenderContribution=ux,t.Area=Fw,t.AreaRender=QS,t.AreaRenderContribution=dx,t.AttributeAnimate=class extends Ny{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=vT,t.Basis=xg,t.BeforeRenderConstribution=SA,t.BoundsContext=Rf,t.BoundsPicker=kA,t.CIRCLE_NUMBER_TYPE=Bb,t.CanvasFactory=_v,t.CanvasTextLayout=Px,t.CbAnimate=Fy,t.Circle=Tx,t.CircleRender=tA,t.CircleRenderContribution=px,t.ClipAngleAnimate=class extends lm{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g,v;const y=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},m=null!==(a=y.width)&&void 0!==a?a:0,b=null!==(h=y.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,S=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let A=0,T=0;"anticlockwise"===S?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(A=w,T="out"===x?w+2*Math.PI:w);const B=pv.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(m+b)/2,innerRadius:0,startAngle:A,endAngle:T,fill:!0});let C,_;"anticlockwise"===S?(C={startAngle:w+2*Math.PI},_={startAngle:w}):(C={endAngle:w},_={endAngle:w+2*Math.PI}),super("in"===x?C:_,"in"===x?_:C,i,n,{group:null==r?void 0:r.group,clipGraphic:B})}},t.ClipDirectionAnimate=class extends lm{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p;const f=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},g=null!==(h=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==h?h:0,v=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,y=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",m=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=pv.graphicService.creator.rect({x:0,y:0,width:"in"===y&&"x"===m?0:g,height:"in"===y&&"y"===m?0:v,fill:!0});let w={},S={};"y"===m?"negative"===b?(w={y:v,height:0},S={y:0,height:v}):(w={height:0},S={height:v}):"negative"===b?(w={x:g,width:0},S={x:0,width:g}):(w={width:0},S={width:g}),super("in"===y?w:S,"in"===y?S:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=lm,t.ClipRadiusAnimate=class extends lm{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g;const v=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},y=null!==(a=v.width)&&void 0!==a?a:0,m=null!==(h=v.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((y/2)**2+(m/2)**2),S=pv.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:m/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),A={outerRadius:x},T={outerRadius:w};super("in"===b?A:T,"in"===b?T:A,i,n,{group:null==r?void 0:r.group,clipGraphic:S})}},t.ColorInterpolate=ax,t.Context2dFactory=Pv,t.ContributionProvider=gp,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new dg(new hf(this._lastX,this._lastY),new hf(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new cg(new hf(this._lastX,this._lastY),new hf(t,e),new hf(i,n),new hf(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=Sy,t.CustomPath2D=Fg,t.CustomSymbolClass=vw,t.DefaultArcAttribute=Jg,t.DefaultAreaAttribute=Qg,t.DefaultAttribute=Zg,t.DefaultCircleAttribute=tv,t.DefaultConnectAttribute=$g,t.DefaultFillStyle=Vg,t.DefaultGlyphAttribute=iv,t.DefaultGroupAttribute=ev,t.DefaultImageAttribute=uv,t.DefaultLayout=Hg,t.DefaultLineAttribute=nv,t.DefaultMorphingAnimateConfig=Vy,t.DefaultPathAttribute=rv,t.DefaultPolygonAttribute=sv,t.DefaultRect3dAttribute=av,t.DefaultRectAttribute=ov,t.DefaultRichTextAttribute=cv,t.DefaultRichTextIconAttribute=dv,t.DefaultStateAnimateConfig=Gy,t.DefaultStrokeStyle=Yg,t.DefaultStyle=Kg,t.DefaultSymbolAttribute=hv,t.DefaultSymbolBackgroundRenderContribution=bA,t.DefaultSymbolTextureRenderContribution=xA,t.DefaultTextAttribute=lv,t.DefaultTextStyle=qg,t.DefaultTicker=Oy,t.DefaultTimeline=Uy,t.DefaultTransform=Gg,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=gA,t.EventManager=By,t.EventSystem=Py,t.EventTarget=Cy,t.FadeInPlus=class extends Ny{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=hm.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 hm.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case hm.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case hm.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case hm.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=my,t.FederatedMouseEvent=by,t.FederatedPointerEvent=xy,t.FederatedWheelEvent=wy,t.GLYPH_NUMBER_TYPE=Cb,t.GRAPHIC_UPDATE_TAG_KEY=hb,t.GROUP_NUMBER_TYPE=_b,t.Generator=vy,t.Gesture=class extends Tp{constructor(t,e={}){var i,n,r,s,o,a,h,l;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.onStart=t=>{this.reset(),this.startTime=Ay.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=My(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((()=>{const e="press",n="none";t.direction=n,t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent(e,t),this.triggerEvent(e,t),this.eventType=e,this.direction=n}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Ay.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||Ey(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,u=My(h[0],h[1]);n.scale=u/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const t=Ay.now(),i=this.lastMoveTime;if(t-i<100){const t=i-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=My(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=Ey(i,r),this.triggerEvent("swipe",e))}}}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.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(a=null===(o=null==e?void 0:e.swipe)||void 0===o?void 0:o.threshold)&&void 0!==a?a:10,velocity:null!==(l=null===(h=null==e?void 0:e.swipe)||void 0===h?void 0:h.velocity)&&void 0!==l?l:.3}},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=Ay.now()-i>this.config.press.time&&My(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=pv.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=RA,t.Glyph=_w,t.GlyphRender=dA,t.Graphic=pb,t.GraphicAnimate=class extends Ny{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=Nb,t.GraphicPicker=EA,t.GraphicRender=eA,t.GraphicService=Wb,t.GraphicUtil=Yb,t.Group=zb,t.GroupFadeIn=class extends Ny{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 Ny{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=iA,t.GroupRenderContribution=fx,t.IMAGE_NUMBER_TYPE=Pb,t.Image=kw,t.ImageRender=pA,t.ImageRenderContribution=gx,t.IncreaseCount=class extends Ny{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s;this.fromNumber=Ip(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=Ip(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}onEnd(){}onUpdate(t,e,i){var n,r;!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(n=this.params)||void 0===n?void 0:n.fixed)&&void 0!==r?r:0))}},t.IncrementalDrawContribution=$S,t.InputText=class extends Ny{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||Dp(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=pv.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,o=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,o);const a=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;a.setAttribute("x",h)}},t.InteractiveSubRenderContribution=Sx,t.LINE_NUMBER_TYPE=Eb,t.Layer=Hb,t.LayerHandlerContribution=jb,t.LayerService=qb,t.Line=Sw,t.LineRender=nA,t.Linear=vg,t.LinearClosed=Lg,t.ManualTickHandler=ky,t.ManualTicker=class extends Oy{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new ky;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.Meteor=class extends Ny{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 hf(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=_g,t.MonotoneY=Pg,t.MorphingPath=Qm,t.MotionPath=class extends Ny{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=eb,t.Node=yy,t.PATH_NUMBER_TYPE=Mb,t.POLYGON_NUMBER_TYPE=kb,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=Rb,t.Path=Ww,t.PathRender=rA,t.PathRenderContribution=vx,t.PickerService=MA,t.PluginService=yT,t.Polygon=Vw,t.PolygonRender=sA,t.PolygonRenderContribution=yx,t.Pyramid3d=Xw,t.Pyramid3dRender=uA,t.RAFTickHandler=Dy,t.RECT3D_NUMBER_TYPE=Ib,t.RECT_NUMBER_TYPE=Db,t.RICHTEXT_NUMBER_TYPE=Ob,t.RafBasedSTO=om,t.Rect=Tw,t.Rect3DRender=aA,t.Rect3d=Cw,t.RectRender=oA,t.RectRenderContribution=mx,t.ReflectSegContext=fg,t.RenderSelector=fA,t.RenderService=wA,t.ResourceLoader=ob,t.RichText=Lw,t.RichTextRender=cA,t.RotateBySphereAnimate=class extends Ny{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=qp-o),this.theta=o,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r}="function"==typeof this.params?this.params():this.params,s=2*Math.PI*e,o=this.theta+s,a=this.phi,h=r*Math.sin(a)*Math.cos(o)+n.x,l=r*Math.cos(a)+n.y,c=r*Math.sin(a)*Math.sin(o)+n.z;for(i.x=h,i.y=l,i.z=c,i.alpha=o+Vp/2;i.alpha>qp;)i.alpha-=qp;i.alpha=qp-i.alpha,i.zIndex=-1e4*i.z}},t.SYMBOL_NUMBER_TYPE=Lb,t.SegContext=pg,t.Stage=TC,t.Step=Dg,t.StreamLight=class extends Ny{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=pv.graphicService.creator.rect({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff",...null===(t=this.params)||void 0===t?void 0:t.attribute,x:0,y:0,width:0});this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){var r,s,o,a,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(o=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(h=null===(a=this.params)||void 0===a?void 0:a.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,f=p+(u-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+d,d),u-f),y=v+g>c?Math.max(c-g,0):v;this.rect.setAttributes({x:g,width:y},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=jy,t.Symbol=xw,t.SymbolRender=hA,t.SymbolRenderContribution=bx,t.TEXT_NUMBER_TYPE=Ub,t.TagPointsUpdate=class extends Ny{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}onBind(){var t,e;const i=null===(t=this.from)||void 0===t?void 0:t.points,n=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach((t=>{t.context&&r.set(t.context,t)}));let s,o,a=1/0,h=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(r.has(this.toPoints[t].context)){a=t,s=r.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(r.has(this.toPoints[t].context)){h=t,o=r.get(this.toPoints[t].context);break}let l=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(l=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>h&&o?[o,t]:[l,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new hf(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=em(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=Mx,t.TextRender=lA,t.TextRenderContribution=xx,t.Theme=dy,t.TimeOutTickHandler=Ry,t.TransformUtil=Xb,t.VWindow=Gb,t.WindowHandlerContribution=Vb,t.addArcToBezierPath=eg,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=ym,t.alignSubpath=um,t.applyTransformOnBezierCurves=xm,t.bezier=Qf,t.bezierCurversToPath=wm,t.binarySplitPolygon=km,t.bindContributionProvider=yp,t.boundStroke=fb,t.builtinSymbols=yw,t.builtinSymbolsMap=mw,t.calcLineCache=Ng,t.centroidOfSubpath=fm,t.circleBounds=Qy,t.cloneGraphic=rb,t.container=Cv,t.cornerTangents=rx,t.createArc=yS,t.createArc3d=function(t){return new Hw(t)},t.createArea=mS,t.createCircle=bS,t.createColor=yA,t.createConicalGradient=cx,t.createGlyph=function(t){return new _w(t)},t.createGroup=xS,t.createImage=PS,t.createLine=wS,t.createPath=SS,t.createPolygon=ES,t.createPyramid3d=function(t){return new Xw(t)},t.createRect=AS,t.createRect3d=TS,t.createRectPath=VS,t.createRichText=kS,t.createShadowRoot=MS,t.createStage=function(t){return new TC(t)},t.createSymbol=_S,t.createText=BS,t.createWrapText=CS,t.cubicCalc=ag,t.cubicLength=og,t.cubicPointAt=hg,t.cubicSubdivide=cm,t.defaultTicker=wC,t.defaultTimeline=Wy,t.drawArc=tg,t.drawArcPath=sx,t.drawAreaSegments=NS,t.drawIncrementalAreaSegments=US,t.drawIncrementalSegments=LS,t.drawPathProxy=ix,t.drawSegments=OS,t.enumCommandMap=Lf,t.fillVisible=Jb,t.findBestMorphingRotation=vm,t.findNextGraphic=CA,t.foreach=TA,t.foreachAsync=BA,t.genBasisSegments=Sg,t.genBasisTypeSegments=wg,t.genLinearClosedSegments=Ug,t.genLinearClosedTypeSegments=Wg,t.genLinearSegments=yg,t.genLinearTypeSegments=mg,t.genMonotoneXSegments=Mg,t.genMonotoneYSegments=Rg,t.genMonotpneXTypeSegments=Eg,t.genMonotpneYTypeSegments=kg,t.genNumberType=vb,t.genStepSegments=Ig,t.genStepTypeSegments=Og,t.getAttributeFromDefaultAttrList=sm,t.getConicGradientAt=lx,t.getContextFont=Bx,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]+=Cx(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=oS.allocate();return lS(a,a,[o[0],o[1],0]),r&&aS(a,a,r),n&&hS(a,a,n),lS(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=dS,t.getRichTextBounds=function(t){return IS.setAttributes(t),IS.AABBBounds},t.getScaledStroke=vA,t.getTextBounds=function(t){return DS.setAttributes(t),DS.AABBBounds},t.getTheme=fy,t.getThemeFromGroup=gy,t.globalTheme=py,t.graphicCreator=RS,t.graphicService=dC,t.graphicUtil=cC,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.intersect=nx,t.isTransformKey=rm,t.layerService=fC,t.loadFeishuContributions=ST,t.loadTaroContributions=AT,t.mat3Tomat4=cS,t.morphPath=tb,t.multiToOneMorph=(e,i,n)=>{var r,s,o;const a=e.filter((t=>t.toCustomPath&&t.valid));a.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?rb:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:sb)(i,a.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>$m(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=a.map(((t,e)=>Jm(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=a.length;const o=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,a.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:o}));d.wait(l),d.play(new Qm({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:Vy.duration,null!==(h=n.easing)&&void 0!==h?h:Vy.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const a=i.animate(r);(null==n?void 0:n.delay)&&a.wait(n.delay),a.play(new eb({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:Vy.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:Vy.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],y=e[14],m=e[15];let b=i.a,x=i.b,w=0,S=0;return t[0]=b*n+x*a+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*y,t[3]=b*o+x*c+w*f+S*m,b=i.c,x=i.d,w=0,S=0,t[4]=b*n+x*a+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*y,t[7]=b*o+x*c+w*f+S*m,b=0,x=0,w=1,S=0,t[8]=b*n+x*a+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*y,t[11]=b*o+x*c+w*f+S*m,b=i.e,x=i.f,w=0,S=1,t[12]=b*n+x*a+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*y,t[15]=b*o+x*c+w*f+S*m,t},t.multiplyMat4Mat4=uS,t.newThemeObj=ly,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?rb:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:sb)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const h=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],l=(null!==(o=null==i?void 0:i.delay)&&void 0!==o?o:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,a,e):0);tb(a,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.parsePadding=$y,t.parseStroke=qy,t.parseSvgPath=Hf,t.pathToBezierCurves=bm,t.pickerService=pC,t.point=bg,t.pointEqual=tm,t.pointInterpolation=em,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=of(t.x,t.y,e.x,e.y,i),{x:o,y:a}=of(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)=>tm(t,e[i]))):!Number.isNaN(t.x+t.y)&&tm(t,e))},t.pointsInterpolation=im,t.rafBasedSto=am,t.rectFillVisible=Qb,t.rectStrokeVisible=ex,t.recursiveCallBinarySplit=Rm,t.renderCommandList=ng,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=aS,t.rotateY=hS,t.runFill=$b,t.runStroke=Zb,t.segments=Jf,t.shouldUseMat4=pS,t.snapLength=sg,t.splitArc=Tm,t.splitArea=_m,t.splitCircle=Bm,t.splitGraphic=sb,t.splitLine=Pm,t.splitPath=Im,t.splitPolygon=Dm,t.splitRect=Am,t.splitToGrids=Sm,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=tx,t.textDrawOffsetX=Cx,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=_x,t.transformKeys=nm,t.transformUtil=uC,t.translate=lS,t.version="0.14.1",t.verticalLayout=mb,t.vglobal=lC,t.waitForAllSubLayers=async function(t){const e=[],i=t.getChildren();await new Promise((t=>{pv.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=Ev,t.wrapContext=function(t,e){return Cv.getNamed(Pv,pv.global.env)(t,e)}}));
|
|
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";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t){return n="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},n(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function l(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=a(t);if(e){var r=a(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return l(this,i)}}var u=function(t){return t&&t.Math==Math&&t},d=u("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||u("object"==("undefined"==typeof window?"undefined":n(window))&&window)||u("object"==("undefined"==typeof self?"undefined":n(self))&&self)||u("object"==n(e)&&e)||function(){return this}()||e||Function("return this")(),p={},f=function(t){try{return!!t()}catch(t){return!0}},g=!f((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),v=!f((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),y=v,m=Function.prototype.call,b=y?m.bind(m):function(){return m.apply(m,arguments)},x={},w={}.propertyIsEnumerable,S=Object.getOwnPropertyDescriptor,A=S&&!w.call({1:2},1);x.f=A?function(t){var e=S(this,t);return!!e&&e.enumerable}:w;var T,B,C=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},_=v,P=Function.prototype,E=P.call,M=_&&P.bind.bind(E,E),k=_?M:function(t){return function(){return E.apply(t,arguments)}},R=k,O=R({}.toString),D=R("".slice),I=function(t){return D(O(t),8,-1)},L=f,U=I,W=Object,N=k("".split),F=L((function(){return!W("z").propertyIsEnumerable(0)}))?function(t){return"String"==U(t)?N(t,""):W(t)}:W,j=function(t){return null==t},z=j,H=TypeError,G=function(t){if(z(t))throw H("Can't call method on "+t);return t},V=F,X=G,Y=function(t){return V(X(t))},q="object"==("undefined"==typeof document?"undefined":n(document))&&document.all,K={all:q,IS_HTMLDDA:void 0===q&&void 0!==q},$=K.all,Z=K.IS_HTMLDDA?function(t){return"function"==typeof t||t===$}:function(t){return"function"==typeof t},J=Z,Q=K.all,et=K.IS_HTMLDDA?function(t){return"object"==n(t)?null!==t:J(t)||t===Q}:function(t){return"object"==n(t)?null!==t:J(t)},it=d,nt=Z,rt=function(t,e){return arguments.length<2?(i=it[t],nt(i)?i:void 0):it[t]&&it[t][e];var i},st=k({}.isPrototypeOf),ot=d,at="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ht=ot.process,lt=ot.Deno,ct=ht&&ht.versions||lt&<.version,ut=ct&&ct.v8;ut&&(B=(T=ut.split("."))[0]>0&&T[0]<4?1:+(T[0]+T[1])),!B&&at&&(!(T=at.match(/Edge\/(\d+)/))||T[1]>=74)&&(T=at.match(/Chrome\/(\d+)/))&&(B=+T[1]);var dt=B,pt=f,ft=d.String,gt=!!Object.getOwnPropertySymbols&&!pt((function(){var t=Symbol();return!ft(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&dt&&dt<41})),vt=gt&&!Symbol.sham&&"symbol"==n(Symbol.iterator),yt=rt,mt=Z,bt=st,xt=Object,wt=vt?function(t){return"symbol"==n(t)}:function(t){var e=yt("Symbol");return mt(e)&&bt(e.prototype,xt(t))},St=String,At=function(t){try{return St(t)}catch(t){return"Object"}},Tt=Z,Bt=At,Ct=TypeError,_t=function(t){if(Tt(t))return t;throw Ct(Bt(t)+" is not a function")},Pt=_t,Et=j,Mt=function(t,e){var i=t[e];return Et(i)?void 0:Pt(i)},kt=b,Rt=Z,Ot=et,Dt=TypeError,It={exports:{}},Lt=d,Ut=Object.defineProperty,Wt=function(t,e){try{Ut(Lt,t,{value:e,configurable:!0,writable:!0})}catch(i){Lt[t]=e}return e},Nt=Wt,Ft="__core-js_shared__",jt=d[Ft]||Nt(Ft,{}),zt=jt;(It.exports=function(t,e){return zt[t]||(zt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=It.exports,Gt=G,Vt=Object,Xt=function(t){return Vt(Gt(t))},Yt=Xt,qt=k({}.hasOwnProperty),Kt=Object.hasOwn||function(t,e){return qt(Yt(t),e)},$t=k,Zt=0,Jt=Math.random(),Qt=$t(1..toString),te=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Qt(++Zt+Jt,36)},ee=Ht,ie=Kt,ne=te,re=gt,se=vt,oe=d.Symbol,ae=ee("wks"),he=se?oe.for||oe:oe&&oe.withoutSetter||ne,le=function(t){return ie(ae,t)||(ae[t]=re&&ie(oe,t)?oe[t]:he("Symbol."+t)),ae[t]},ce=b,ue=et,de=wt,pe=Mt,fe=function(t,e){var i,n;if("string"===e&&Rt(i=t.toString)&&!Ot(n=kt(i,t)))return n;if(Rt(i=t.valueOf)&&!Ot(n=kt(i,t)))return n;if("string"!==e&&Rt(i=t.toString)&&!Ot(n=kt(i,t)))return n;throw Dt("Can't convert object to primitive value")},ge=TypeError,ve=le("toPrimitive"),ye=function(t,e){if(!ue(t)||de(t))return t;var i,n=pe(t,ve);if(n){if(void 0===e&&(e="default"),i=ce(n,t,e),!ue(i)||de(i))return i;throw ge("Can't convert object to primitive value")}return void 0===e&&(e="number"),fe(t,e)},me=wt,be=function(t){var e=ye(t,"string");return me(e)?e:e+""},xe=et,we=d.document,Se=xe(we)&&xe(we.createElement),Ae=function(t){return Se?we.createElement(t):{}},Te=Ae,Be=!g&&!f((function(){return 7!=Object.defineProperty(Te("div"),"a",{get:function(){return 7}}).a})),Ce=g,_e=b,Pe=x,Ee=C,Me=Y,ke=be,Re=Kt,Oe=Be,De=Object.getOwnPropertyDescriptor;p.f=Ce?De:function(t,e){if(t=Me(t),e=ke(e),Oe)try{return De(t,e)}catch(t){}if(Re(t,e))return Ee(!_e(Pe.f,t,e),t[e])};var Ie={},Le=g&&f((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=et,We=String,Ne=TypeError,Fe=function(t){if(Ue(t))return t;throw Ne(We(t)+" is not an object")},je=g,ze=Be,He=Le,Ge=Fe,Ve=be,Xe=TypeError,Ye=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,Ke="enumerable",$e="configurable",Ze="writable";Ie.f=je?He?function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),"function"==typeof t&&"prototype"===e&&"value"in i&&Ze in i&&!i[Ze]){var n=qe(t,e);n&&n[Ze]&&(t[e]=i.value,i={configurable:$e in i?i[$e]:n[$e],enumerable:Ke in i?i[Ke]:n[Ke],writable:!1})}return Ye(t,e,i)}:Ye:function(t,e,i){if(Ge(t),e=Ve(e),Ge(i),ze)try{return Ye(t,e,i)}catch(t){}if("get"in i||"set"in i)throw Xe("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var Je=Ie,Qe=C,ti=g?function(t,e,i){return Je.f(t,e,Qe(1,i))}:function(t,e,i){return t[e]=i,t},ei={exports:{}},ii=g,ni=Kt,ri=Function.prototype,si=ii&&Object.getOwnPropertyDescriptor,oi=ni(ri,"name"),ai={EXISTS:oi,PROPER:oi&&"something"===function(){}.name,CONFIGURABLE:oi&&(!ii||ii&&si(ri,"name").configurable)},hi=Z,li=jt,ci=k(Function.toString);hi(li.inspectSource)||(li.inspectSource=function(t){return ci(t)});var ui,di,pi,fi=li.inspectSource,gi=Z,vi=d.WeakMap,yi=gi(vi)&&/native code/.test(String(vi)),mi=te,bi=Ht("keys"),xi=function(t){return bi[t]||(bi[t]=mi(t))},wi={},Si=yi,Ai=d,Ti=et,Bi=ti,Ci=Kt,_i=jt,Pi=xi,Ei=wi,Mi="Object already initialized",ki=Ai.TypeError,Ri=Ai.WeakMap;if(Si||_i.state){var Oi=_i.state||(_i.state=new Ri);Oi.get=Oi.get,Oi.has=Oi.has,Oi.set=Oi.set,ui=function(t,e){if(Oi.has(t))throw ki(Mi);return e.facade=t,Oi.set(t,e),e},di=function(t){return Oi.get(t)||{}},pi=function(t){return Oi.has(t)}}else{var Di=Pi("state");Ei[Di]=!0,ui=function(t,e){if(Ci(t,Di))throw ki(Mi);return e.facade=t,Bi(t,Di,e),e},di=function(t){return Ci(t,Di)?t[Di]:{}},pi=function(t){return Ci(t,Di)}}var Ii={set:ui,get:di,has:pi,enforce:function(t){return pi(t)?di(t):ui(t,{})},getterFor:function(t){return function(e){var i;if(!Ti(e)||(i=di(e)).type!==t)throw ki("Incompatible receiver, "+t+" required");return i}}},Li=k,Ui=f,Wi=Z,Ni=Kt,Fi=g,ji=ai.CONFIGURABLE,zi=fi,Hi=Ii.enforce,Gi=Ii.get,Vi=String,Xi=Object.defineProperty,Yi=Li("".slice),qi=Li("".replace),Ki=Li([].join),$i=Fi&&!Ui((function(){return 8!==Xi((function(){}),"length",{value:8}).length})),Zi=String(String).split("String"),Ji=ei.exports=function(t,e,i){"Symbol("===Yi(Vi(e),0,7)&&(e="["+qi(Vi(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Ni(t,"name")||ji&&t.name!==e)&&(Fi?Xi(t,"name",{value:e,configurable:!0}):t.name=e),$i&&i&&Ni(i,"arity")&&t.length!==i.arity&&Xi(t,"length",{value:i.arity});try{i&&Ni(i,"constructor")&&i.constructor?Fi&&Xi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=Hi(t);return Ni(n,"source")||(n.source=Ki(Zi,"string"==typeof e?e:"")),t};Function.prototype.toString=Ji((function(){return Wi(this)&&Gi(this).source||zi(this)}),"toString");var Qi=ei.exports,tn=Z,en=Ie,nn=Qi,rn=Wt,sn=function(t,e,i,n){n||(n={});var r=n.enumerable,s=void 0!==n.name?n.name:e;if(tn(i)&&nn(i,s,n),n.global)r?t[e]=i:rn(e,i);else{try{n.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=i:en.f(t,e,{value:i,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},on={},an=Math.ceil,hn=Math.floor,ln=Math.trunc||function(t){var e=+t;return(e>0?hn:an)(e)},cn=function(t){var e=+t;return e!=e||0===e?0:ln(e)},un=cn,dn=Math.max,pn=Math.min,fn=function(t,e){var i=un(t);return i<0?dn(i+e,0):pn(i,e)},gn=cn,vn=Math.min,yn=function(t){return t>0?vn(gn(t),9007199254740991):0},mn=function(t){return yn(t.length)},bn=Y,xn=fn,wn=mn,Sn=function(t){return function(e,i,n){var r,s=bn(e),o=wn(s),a=xn(n,o);if(t&&i!=i){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},An={includes:Sn(!0),indexOf:Sn(!1)},Tn=Kt,Bn=Y,Cn=An.indexOf,_n=wi,Pn=k([].push),En=function(t,e){var i,n=Bn(t),r=0,s=[];for(i in n)!Tn(_n,i)&&Tn(n,i)&&Pn(s,i);for(;e.length>r;)Tn(n,i=e[r++])&&(~Cn(s,i)||Pn(s,i));return s},Mn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kn=En,Rn=Mn.concat("length","prototype");on.f=Object.getOwnPropertyNames||function(t){return kn(t,Rn)};var On={};On.f=Object.getOwnPropertySymbols;var Dn=rt,In=on,Ln=On,Un=Fe,Wn=k([].concat),Nn=Dn("Reflect","ownKeys")||function(t){var e=In.f(Un(t)),i=Ln.f;return i?Wn(e,i(t)):e},Fn=Kt,jn=Nn,zn=p,Hn=Ie,Gn=f,Vn=Z,Xn=/#|\.prototype\./,Yn=function(t,e){var i=Kn[qn(t)];return i==Zn||i!=$n&&(Vn(e)?Gn(e):!!e)},qn=Yn.normalize=function(t){return String(t).replace(Xn,".").toLowerCase()},Kn=Yn.data={},$n=Yn.NATIVE="N",Zn=Yn.POLYFILL="P",Jn=Yn,Qn=d,tr=p.f,er=ti,ir=sn,nr=Wt,rr=function(t,e,i){for(var n=jn(e),r=Hn.f,s=zn.f,o=0;o<n.length;o++){var a=n[o];Fn(t,a)||i&&Fn(i,a)||r(t,a,s(e,a))}},sr=Jn,or=function(t,e){var i,r,s,o,a,h=t.target,l=t.global,c=t.stat;if(i=l?Qn:c?Qn[h]||nr(h,{}):(Qn[h]||{}).prototype)for(r in e){if(o=e[r],s=t.dontCallGetSet?(a=tr(i,r))&&a.value:i[r],!sr(l?r:h+(c?".":"#")+r,t.forced)&&void 0!==s){if(n(o)==n(s))continue;rr(o,s)}(t.sham||s&&s.sham)&&er(o,"sham",!0),ir(i,r,o,t)}},ar={exports:{}},hr={},lr=be,cr=Ie,ur=C,dr=fn,pr=mn,fr=function(t,e,i){var n=lr(e);n in t?cr.f(t,n,ur(0,i)):t[n]=i},gr=Array,vr=Math.max,yr=I,mr=Y,br=on.f,xr=function(t,e,i){for(var n=pr(t),r=dr(e,n),s=dr(void 0===i?n:i,n),o=gr(vr(s-r,0)),a=0;r<s;r++,a++)fr(o,a,t[r]);return o.length=a,o},wr="object"==("undefined"==typeof window?"undefined":n(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];hr.f=function(t){return wr&&"Window"==yr(t)?function(t){try{return br(t)}catch(t){return xr(wr)}}(t):br(mr(t))};var Sr=f((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ar=f,Tr=et,Br=I,Cr=Sr,_r=Object.isExtensible,Pr=Ar((function(){_r(1)}))||Cr?function(t){return!!Tr(t)&&((!Cr||"ArrayBuffer"!=Br(t))&&(!_r||_r(t)))}:_r,Er=!f((function(){return Object.isExtensible(Object.preventExtensions({}))})),Mr=or,kr=k,Rr=wi,Or=et,Dr=Kt,Ir=Ie.f,Lr=on,Ur=hr,Wr=Pr,Nr=Er,Fr=!1,jr=te("meta"),zr=0,Hr=function(t){Ir(t,jr,{value:{objectID:"O"+zr++,weakData:{}}})},Gr=ar.exports={enable:function(){Gr.enable=function(){},Fr=!0;var t=Lr.f,e=kr([].splice),i={};i[jr]=1,t(i).length&&(Lr.f=function(i){for(var n=t(i),r=0,s=n.length;r<s;r++)if(n[r]===jr){e(n,r,1);break}return n},Mr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ur.f}))},fastKey:function(t,e){if(!Or(t))return"symbol"==n(t)?t:("string"==typeof t?"S":"P")+t;if(!Dr(t,jr)){if(!Wr(t))return"F";if(!e)return"E";Hr(t)}return t[jr].objectID},getWeakData:function(t,e){if(!Dr(t,jr)){if(!Wr(t))return!0;if(!e)return!1;Hr(t)}return t[jr].weakData},onFreeze:function(t){return Nr&&Fr&&Wr(t)&&!Dr(t,jr)&&Hr(t),t}};Rr[jr]=!0;var Vr=ar.exports,Xr=I,Yr=k,qr=function(t){if("Function"===Xr(t))return Yr(t)},Kr=_t,$r=v,Zr=qr(qr.bind),Jr=function(t,e){return Kr(t),void 0===e?t:$r?Zr(t,e):function(){return t.apply(e,arguments)}},Qr={},ts=Qr,es=le("iterator"),is=Array.prototype,ns={};ns[le("toStringTag")]="z";var rs="[object z]"===String(ns),ss=Z,os=I,as=le("toStringTag"),hs=Object,ls="Arguments"==os(function(){return arguments}()),cs=rs?os:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=hs(t),as))?i:ls?os(e):"Object"==(n=os(e))&&ss(e.callee)?"Arguments":n},us=cs,ds=Mt,ps=j,fs=Qr,gs=le("iterator"),vs=function(t){if(!ps(t))return ds(t,gs)||ds(t,"@@iterator")||fs[us(t)]},ys=b,ms=_t,bs=Fe,xs=At,ws=vs,Ss=TypeError,As=b,Ts=Fe,Bs=Mt,Cs=Jr,_s=b,Ps=Fe,Es=At,Ms=function(t){return void 0!==t&&(ts.Array===t||is[es]===t)},ks=mn,Rs=st,Os=function(t,e){var i=arguments.length<2?ws(t):e;if(ms(i))return bs(ys(i,t));throw Ss(xs(t)+" is not iterable")},Ds=vs,Is=function(t,e,i){var n,r;Ts(t);try{if(!(n=Bs(t,"return"))){if("throw"===e)throw i;return i}n=As(n,t)}catch(t){r=!0,n=t}if("throw"===e)throw i;if(r)throw n;return Ts(n),i},Ls=TypeError,Us=function(t,e){this.stopped=t,this.result=e},Ws=Us.prototype,Ns=function(t,e,i){var r,s,o,a,h,l,c,u=i&&i.that,d=!(!i||!i.AS_ENTRIES),p=!(!i||!i.IS_RECORD),f=!(!i||!i.IS_ITERATOR),g=!(!i||!i.INTERRUPTED),v=Cs(e,u),y=function(t){return r&&Is(r,"normal",t),new Us(!0,t)},m=function(t){return d?(Ps(t),g?v(t[0],t[1],y):v(t[0],t[1])):g?v(t,y):v(t)};if(p)r=t.iterator;else if(f)r=t;else{if(!(s=Ds(t)))throw Ls(Es(t)+" is not iterable");if(Ms(s)){for(o=0,a=ks(t);a>o;o++)if((h=m(t[o]))&&Rs(Ws,h))return h;return new Us(!1)}r=Os(t,s)}for(l=p?t.next:r.next;!(c=_s(l,r)).done;){try{h=m(c.value)}catch(t){Is(r,"throw",t)}if("object"==n(h)&&h&&Rs(Ws,h))return h}return new Us(!1)},Fs=st,js=TypeError,zs=function(t,e){if(Fs(e,t))return t;throw js("Incorrect invocation")},Hs=le("iterator"),Gs=!1;try{var Vs=0,Xs={next:function(){return{done:!!Vs++}},return:function(){Gs=!0}};Xs[Hs]=function(){return this},Array.from(Xs,(function(){throw 2}))}catch(t){}var Ys=Ie.f,qs=Kt,Ks=le("toStringTag"),$s=function(t,e,i){t&&!i&&(t=t.prototype),t&&!qs(t,Ks)&&Ys(t,Ks,{configurable:!0,value:e})},Zs=k,Js=_t,Qs=Z,to=String,eo=TypeError,io=function(t,e,i){try{return Zs(Js(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}},no=Fe,ro=function(t){if("object"==n(t)||Qs(t))return t;throw eo("Can't set "+to(t)+" as a prototype")},so=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=io(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return no(i),ro(n),e?t(i,n):i.__proto__=n,i}}():void 0),oo=Z,ao=et,ho=so,lo=or,co=d,uo=k,po=Jn,fo=sn,go=Vr,vo=Ns,yo=zs,mo=Z,bo=j,xo=et,wo=f,So=function(t,e){if(!e&&!Gs)return!1;var i=!1;try{var n={};n[Hs]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i},Ao=$s,To=function(t,e,i){var n,r;return ho&&oo(n=e.constructor)&&n!==i&&ao(r=n.prototype)&&r!==i.prototype&&ho(t,r),t},Bo=function(t,e,i){var n=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=n?"set":"add",o=co[t],a=o&&o.prototype,h=o,l={},c=function(t){var e=uo(a[t]);fo(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!xo(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!xo(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!xo(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})};if(po(t,!mo(o)||!(r||a.forEach&&!wo((function(){(new o).entries().next()})))))h=i.getConstructor(e,t,n,s),go.enable();else if(po(t,!0)){var u=new h,d=u[s](r?{}:-0,1)!=u,p=wo((function(){u.has(1)})),f=So((function(t){new o(t)})),g=!r&&wo((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));f||((h=e((function(t,e){yo(t,a);var i=To(new o,t,h);return bo(e)||vo(e,i[s],{that:i,AS_ENTRIES:n}),i}))).prototype=a,a.constructor=h),(p||g)&&(c("delete"),c("has"),n&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return l[t]=h,lo({global:!0,constructor:!0,forced:h!=o},l),Ao(h,t),r||i.setStrong(h,t,n),h},Co={},_o=En,Po=Mn,Eo=Object.keys||function(t){return _o(t,Po)},Mo=g,ko=Le,Ro=Ie,Oo=Fe,Do=Y,Io=Eo;Co.f=Mo&&!ko?Object.defineProperties:function(t,e){Oo(t);for(var i,n=Do(e),r=Io(e),s=r.length,o=0;s>o;)Ro.f(t,i=r[o++],n[i]);return t};var Lo,Uo=rt("document","documentElement"),Wo=Fe,No=Co,Fo=Mn,jo=wi,zo=Uo,Ho=Ae,Go="prototype",Vo="script",Xo=xi("IE_PROTO"),Yo=function(){},qo=function(t){return"<"+Vo+">"+t+"</"+Vo+">"},Ko=function(t){t.write(qo("")),t.close();var e=t.parentWindow.Object;return t=null,e},$o=function(){try{Lo=new ActiveXObject("htmlfile")}catch(t){}var t,e,i;$o="undefined"!=typeof document?document.domain&&Lo?Ko(Lo):(e=Ho("iframe"),i="java"+Vo+":",e.style.display="none",zo.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(qo("document.F=Object")),t.close(),t.F):Ko(Lo);for(var n=Fo.length;n--;)delete $o[Go][Fo[n]];return $o()};jo[Xo]=!0;var Zo,Jo,Qo,ta=Object.create||function(t,e){var i;return null!==t?(Yo[Go]=Wo(t),i=new Yo,Yo[Go]=null,i[Xo]=t):i=$o(),void 0===e?i:No.f(i,e)},ea=Qi,ia=Ie,na=function(t,e,i){return i.get&&ea(i.get,e,{getter:!0}),i.set&&ea(i.set,e,{setter:!0}),ia.f(t,e,i)},ra=sn,sa=function(t,e,i){for(var n in e)ra(t,n,e[n],i);return t},oa=!f((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),aa=Kt,ha=Z,la=Xt,ca=oa,ua=xi("IE_PROTO"),da=Object,pa=da.prototype,fa=ca?da.getPrototypeOf:function(t){var e=la(t);if(aa(e,ua))return e[ua];var i=e.constructor;return ha(i)&&e instanceof i?i.prototype:e instanceof da?pa:null},ga=f,va=Z,ya=et,ma=fa,ba=sn,xa=le("iterator"),wa=!1;[].keys&&("next"in(Qo=[].keys())?(Jo=ma(ma(Qo)))!==Object.prototype&&(Zo=Jo):wa=!0);var Sa=!ya(Zo)||ga((function(){var t={};return Zo[xa].call(t)!==t}));Sa&&(Zo={}),va(Zo[xa])||ba(Zo,xa,(function(){return this}));var Aa={IteratorPrototype:Zo,BUGGY_SAFARI_ITERATORS:wa},Ta=Aa.IteratorPrototype,Ba=ta,Ca=C,_a=$s,Pa=Qr,Ea=function(){return this},Ma=or,ka=b,Ra=Z,Oa=function(t,e,i,n){var r=e+" Iterator";return t.prototype=Ba(Ta,{next:Ca(+!n,i)}),_a(t,r,!1),Pa[r]=Ea,t},Da=fa,Ia=so,La=$s,Ua=ti,Wa=sn,Na=Qr,Fa=ai.PROPER,ja=ai.CONFIGURABLE,za=Aa.IteratorPrototype,Ha=Aa.BUGGY_SAFARI_ITERATORS,Ga=le("iterator"),Va="keys",Xa="values",Ya="entries",qa=function(){return this},Ka=rt,$a=na,Za=g,Ja=le("species"),Qa=ta,th=na,eh=sa,ih=Jr,nh=zs,rh=j,sh=Ns,oh=function(t,e,i,n,r,s,o){Oa(i,e,n);var a,h,l,c=function(t){if(t===r&&g)return g;if(!Ha&&t in p)return p[t];switch(t){case Va:case Xa:case Ya:return function(){return new i(this,t)}}return function(){return new i(this)}},u=e+" Iterator",d=!1,p=t.prototype,f=p[Ga]||p["@@iterator"]||r&&p[r],g=!Ha&&f||c(r),v="Array"==e&&p.entries||f;if(v&&(a=Da(v.call(new t)))!==Object.prototype&&a.next&&(Da(a)!==za&&(Ia?Ia(a,za):Ra(a[Ga])||Wa(a,Ga,qa)),La(a,u,!0)),Fa&&r==Xa&&f&&f.name!==Xa&&(ja?Ua(p,"name",Xa):(d=!0,g=function(){return ka(f,this)})),r)if(h={values:c(Xa),keys:s?g:c(Va),entries:c(Ya)},o)for(l in h)(Ha||d||!(l in p))&&Wa(p,l,h[l]);else Ma({target:e,proto:!0,forced:Ha||d},h);return p[Ga]!==g&&Wa(p,Ga,g,{name:r}),Na[e]=g,h},ah=function(t,e){return{value:t,done:e}},hh=function(t){var e=Ka(t);Za&&e&&!e[Ja]&&$a(e,Ja,{configurable:!0,get:function(){return this}})},lh=g,ch=Vr.fastKey,uh=Ii.set,dh=Ii.getterFor,ph={getConstructor:function(t,e,i,n){var r=t((function(t,r){nh(t,s),uh(t,{type:e,index:Qa(null),first:void 0,last:void 0,size:0}),lh||(t.size=0),rh(r)||sh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=dh(e),a=function(t,e,i){var n,r,s=o(t),a=h(t,e);return a?a.value=i:(s.last=a={index:r=ch(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=a),n&&(n.next=a),lh?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},h=function(t,e){var i,n=o(t),r=ch(e);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==e)return i};return eh(s,{clear:function(){for(var t=o(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,lh?t.size=0:this.size=0},delete:function(t){var e=this,i=o(e),n=h(e,t);if(n){var r=n.next,s=n.previous;delete i.index[n.index],n.removed=!0,s&&(s.next=r),r&&(r.previous=s),i.first==n&&(i.first=r),i.last==n&&(i.last=s),lh?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=o(this),n=ih(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!h(this,t)}}),eh(s,i?{get:function(t){var e=h(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),lh&&th(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,i){var n=e+" Iterator",r=dh(e),s=dh(n);oh(t,e,(function(t,e){uh(this,{type:n,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?ah("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1):(t.target=void 0,ah(void 0,!0))}),i?"entries":"values",!i,!0),hh(e)}};Bo("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ph);var fh=I,gh=Array.isArray||function(t){return"Array"==fh(t)},vh=k,yh=f,mh=Z,bh=cs,xh=fi,wh=function(){},Sh=[],Ah=rt("Reflect","construct"),Th=/^\s*(?:class|function)\b/,Bh=vh(Th.exec),Ch=!Th.exec(wh),_h=function(t){if(!mh(t))return!1;try{return Ah(wh,Sh,t),!0}catch(t){return!1}},Ph=function(t){if(!mh(t))return!1;switch(bh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ch||!!Bh(Th,xh(t))}catch(t){return!0}};Ph.sham=!0;var Eh=!Ah||yh((function(){var t;return _h(_h.call)||!_h(Object)||!_h((function(){t=!0}))||t}))?Ph:_h,Mh=gh,kh=Eh,Rh=et,Oh=le("species"),Dh=Array,Ih=function(t){var e;return Mh(t)&&(e=t.constructor,(kh(e)&&(e===Dh||Mh(e.prototype))||Rh(e)&&null===(e=e[Oh]))&&(e=void 0)),void 0===e?Dh:e},Lh=Jr,Uh=F,Wh=Xt,Nh=mn,Fh=function(t,e){return new(Ih(t))(0===e?0:e)},jh=k([].push),zh=function(t){var e=1==t,i=2==t,n=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(h,l,c,u){for(var d,p,f=Wh(h),g=Uh(f),v=Lh(l,c),y=Nh(g),m=0,b=u||Fh,x=e?b(h,y):i||o?b(h,0):void 0;y>m;m++)if((a||m in g)&&(p=v(d=g[m],m,f),t))if(e)x[m]=p;else if(p)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:jh(x,d)}else switch(t){case 4:return!1;case 7:jh(x,d)}return s?-1:n||r?r:x}},Hh={forEach:zh(0),map:zh(1),filter:zh(2),some:zh(3),every:zh(4),find:zh(5),findIndex:zh(6),filterReject:zh(7)},Gh=k,Vh=sa,Xh=Vr.getWeakData,Yh=zs,qh=Fe,Kh=j,$h=et,Zh=Ns,Jh=Kt,Qh=Ii.set,tl=Ii.getterFor,el=Hh.find,il=Hh.findIndex,nl=Gh([].splice),rl=0,sl=function(t){return t.frozen||(t.frozen=new ol)},ol=function(){this.entries=[]},al=function(t,e){return el(t.entries,(function(t){return t[0]===e}))};ol.prototype={get:function(t){var e=al(this,t);if(e)return e[1]},has:function(t){return!!al(this,t)},set:function(t,e){var i=al(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=il(this.entries,(function(e){return e[0]===t}));return~e&&nl(this.entries,e,1),!!~e}};var hl,ll={getConstructor:function(t,e,i,n){var r=t((function(t,r){Yh(t,s),Qh(t,{type:e,id:rl++,frozen:void 0}),Kh(r)||Zh(r,t[n],{that:t,AS_ENTRIES:i})})),s=r.prototype,o=tl(e),a=function(t,e,i){var n=o(t),r=Xh(qh(e),!0);return!0===r?sl(n).set(e,i):r[n.id]=i,t};return Vh(s,{delete:function(t){var e=o(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sl(e).delete(t):i&&Jh(i,e.id)&&delete i[e.id]},has:function(t){var e=o(this);if(!$h(t))return!1;var i=Xh(t);return!0===i?sl(e).has(t):i&&Jh(i,e.id)}}),Vh(s,i?{get:function(t){var e=o(this);if($h(t)){var i=Xh(t);return!0===i?sl(e).get(t):i?i[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},cl=Er,ul=d,dl=k,pl=sa,fl=Vr,gl=Bo,vl=ll,yl=et,ml=Ii.enforce,bl=f,xl=yi,wl=Object,Sl=Array.isArray,Al=wl.isExtensible,Tl=wl.isFrozen,Bl=wl.isSealed,Cl=wl.freeze,_l=wl.seal,Pl={},El={},Ml=!ul.ActiveXObject&&"ActiveXObject"in ul,kl=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Rl=gl("WeakMap",kl,vl),Ol=Rl.prototype,Dl=dl(Ol.set);if(xl)if(Ml){hl=vl.getConstructor(kl,"WeakMap",!0),fl.enable();var Il=dl(Ol.delete),Ll=dl(Ol.has),Ul=dl(Ol.get);pl(Ol,{delete:function(t){if(yl(t)&&!Al(t)){var e=ml(this);return e.frozen||(e.frozen=new hl),Il(this,t)||e.frozen.delete(t)}return Il(this,t)},has:function(t){if(yl(t)&&!Al(t)){var e=ml(this);return e.frozen||(e.frozen=new hl),Ll(this,t)||e.frozen.has(t)}return Ll(this,t)},get:function(t){if(yl(t)&&!Al(t)){var e=ml(this);return e.frozen||(e.frozen=new hl),Ll(this,t)?Ul(this,t):e.frozen.get(t)}return Ul(this,t)},set:function(t,e){if(yl(t)&&!Al(t)){var i=ml(this);i.frozen||(i.frozen=new hl),Ll(this,t)?Dl(this,t,e):i.frozen.set(t,e)}else Dl(this,t,e);return this}})}else cl&&bl((function(){var t=Cl([]);return Dl(new Rl,t,1),!Tl(t)}))&&pl(Ol,{set:function(t,e){var i;return Sl(t)&&(Tl(t)?i=Pl:Bl(t)&&(i=El)),Dl(this,t,e),i==Pl&&Cl(t),i==El&&_l(t),this}});var Wl=rt,Nl=k,Fl=Ht,jl=Wl("Map"),zl=Wl("WeakMap"),Hl=Nl([].push),Gl=Fl("metadata"),Vl=Gl.store||(Gl.store=new zl),Xl=function(t,e,i){var n=Vl.get(t);if(!n){if(!i)return;Vl.set(t,n=new jl)}var r=n.get(e);if(!r){if(!i)return;n.set(e,r=new jl)}return r},Yl={store:Vl,getMap:Xl,has:function(t,e,i){var n=Xl(e,i,!1);return void 0!==n&&n.has(t)},get:function(t,e,i){var n=Xl(e,i,!1);return void 0===n?void 0:n.get(t)},set:function(t,e,i,n){Xl(i,n,!0).set(t,e)},keys:function(t,e){var i=Xl(t,e,!1),n=[];return i&&i.forEach((function(t,e){Hl(n,e)})),n},toKey:function(t){return void 0===t||"symbol"==n(t)?t:String(t)}},ql=Fe,Kl=Yl.toKey,$l=Yl.set;or({target:"Reflect",stat:!0},{defineMetadata:function(t,e,i){var n=arguments.length<4?void 0:Kl(arguments[3]);$l(t,e,ql(i),n)}});var Zl=Fe,Jl=Yl.toKey,Ql=Yl.getMap,tc=Yl.store;or({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:Jl(arguments[2]),n=Ql(Zl(e),i,!1);if(void 0===n||!n.delete(t))return!1;if(n.size)return!0;var r=tc.get(e);return r.delete(i),!!r.size||tc.delete(e)}});var ec=Fe,ic=fa,nc=Yl.has,rc=Yl.get,sc=Yl.toKey,oc=function t(e,i,n){if(nc(e,i,n))return rc(e,i,n);var r=ic(i);return null!==r?t(e,r,n):void 0};or({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:sc(arguments[2]);return oc(t,ec(e),i)}});var ac=k,hc=Map.prototype,lc={Map:Map,set:ac(hc.set),get:ac(hc.get),has:ac(hc.has),remove:ac(hc.delete),proto:hc},cc=b,uc=k,dc=function(t,e,i){for(var n,r,s=i||t.next;!(n=cc(s,t)).done;)if(void 0!==(r=e(n.value)))return r},pc=lc.Map,fc=lc.proto,gc=uc(fc.forEach),vc=uc(fc.entries),yc=vc(new pc).next,mc=_t,bc=j,xc=mn,wc=Xt,Sc=function(t,e,i){return i?dc(vc(t),(function(t){return e(t[1],t[0])}),yc):gc(t,e)},Ac=lc.Map,Tc=lc.has,Bc=lc.set,Cc=k([].push),_c=or,Pc=k,Ec=Yl,Mc=Fe,kc=fa,Rc=Pc((function(t){var e,i,n,r=wc(this),s=xc(r),o=[],a=new Ac,h=bc(t)?function(t){return t}:mc(t);for(e=0;e<s;e++)n=h(i=r[e]),Tc(a,n)||Bc(a,n,i);return Sc(a,(function(t){Cc(o,t)})),o})),Oc=Pc([].concat),Dc=Ec.keys,Ic=Ec.toKey,Lc=function t(e,i){var n=Dc(e,i),r=kc(e);if(null===r)return n;var s=t(r,i);return s.length?n.length?Rc(Oc(n,s)):s:n};_c({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Ic(arguments[1]);return Lc(Mc(t),e)}});var Uc=Fe,Wc=Yl.get,Nc=Yl.toKey;or({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:Nc(arguments[2]);return Wc(t,Uc(e),i)}});var Fc=Fe,jc=Yl.keys,zc=Yl.toKey;or({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:zc(arguments[1]);return jc(Fc(t),e)}});var Hc=Fe,Gc=fa,Vc=Yl.has,Xc=Yl.toKey,Yc=function t(e,i,n){if(Vc(e,i,n))return!0;var r=Gc(i);return null!==r&&t(e,r,n)};or({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var i=arguments.length<3?void 0:Xc(arguments[2]);return Yc(t,Hc(e),i)}});var qc=Fe,Kc=Yl.has,$c=Yl.toKey;or({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var i=arguments.length<3?void 0:$c(arguments[2]);return Kc(t,qc(e),i)}});var Zc=Fe,Jc=Yl.toKey,Qc=Yl.set;or({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,n){Qc(t,e,Zc(i),Jc(n))}}});var tu="named",eu="name",iu="unmanaged",nu="optional",ru="inject",su="multi_inject",ou="inversify:tagged",au="inversify:tagged_props",hu="inversify:paramtypes",lu="post_construct",cu="pre_destroy";var uu=[ru,su,eu,iu,tu,nu],du={Request:"Request",Singleton:"Singleton",Transient:"Transient"},pu={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},fu={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},gu=0;function vu(){return gu++}var yu=function(){function t(t,e){this.id=vu(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=pu.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===du.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),mu="Metadata key was used more than once in a parameter:",bu="NULL argument",xu="Key Not Found",wu="Ambiguous match found for serviceIdentifier:",Su="No matching bindings found for serviceIdentifier:",Au="Missing required @injectable annotation in:",Tu="Missing required @inject or @multiInject annotation in:",Bu="Circular dependency found:",Cu="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",_u=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Pu=function(t,e){return"@postConstruct error in class "+t+": "+e},Eu=function(t,e){return"@preDestroy error in class "+t+": "+e},Mu=function(t,e){return"onDeactivation() error in class "+t+": "+e},ku="Maximum call stack size exceeded",Ru=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(hu,t),userGeneratedMetadata:Reflect.getMetadata(ou,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(au,t)||[]},t}(),Ou={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Du(t){return t instanceof RangeError||t.message===ku}function Iu(t){return"function"==typeof t?t.name:"symbol"===n(t)?t.toString():t}function Lu(t,e,i){var n="",r=i(t,e);return 0!==r.length&&(n="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Nu(t.implementationType)),n=n+"\n "+e,t.constraint.metaData&&(n=n+" - "+t.constraint.metaData)}))),n}function Uu(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Uu(t.parentRequest,e))}function Wu(t){t.childRequests.forEach((function(t){if(Uu(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,i){void 0===i&&(i=[]);var n=Iu(e.serviceIdentifier);return i.push(n),null!==e.parentRequest?t(e.parentRequest,i):i}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Bu+" "+e)}Wu(t)}))}function Nu(t){if(t.name)return t.name;var e=t.toString(),i=e.match(/^function\s*([^\s(]+)/);return i?i[1]:"Anonymous function: "+e}var Fu=function(){function t(t){this.id=vu(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),ju=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===tu?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),zu=function(t,e){this.parentContext=t,this.rootRequest=e},Hu=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Gu=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,i=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},i)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),Vu=function(){function t(t,e,i,r){this.id=vu(),this.type=t,this.serviceIdentifier=i;var s="symbol"===n(e)?e.toString().slice(7,-1):e;this.name=new Gu(s||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof r?o=new ju(tu,r):r instanceof ju&&(o=r),null!==o&&this.metadata.push(o)}return t.prototype.hasTag=function(t){for(var e=0,i=this.metadata;e<i.length;e++){if(i[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(su)},t.prototype.matchesArray=function(t){return this.matchesTag(su)(t)},t.prototype.isNamed=function(){return this.hasTag(tu)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return uu.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(nu)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===tu}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return uu.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(tu)(t)},t.prototype.matchesTag=function(t){var e=this;return function(i){for(var n=0,r=e.metadata;n<r.length;n++){var s=r[n];if(s.key===t&&s.value===i)return!0}return!1}},t}(),Xu=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function Yu(t,e,i,n){var r=t.getConstructorMetadata(i),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(Au+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),h=0===i.length&&a.length>0,l=a.length>i.length,c=function(t,e,i,n,r){for(var s=[],o=0;o<r;o++){var a=qu(o,t,e,i,n);null!==a&&s.push(a)}return s}(n,e,s,o,h||l?a.length:i.length),u=$u(t,i,e);return Xu(Xu([],c,!0),u,!0)}function qu(t,e,i,n,r){var s=r[t.toString()]||[],o=Ju(s),a=!0!==o.unmanaged,h=n[t],l=o.inject||o.multiInject;if((h=l||h)instanceof Hu&&(h=h.unwrap()),a){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(Tu+" argument "+t+" in class "+i+".");var c=new Vu(fu.ConstructorArgument,o.targetName,h);return c.metadata=s,c}return null}function Ku(t,e,i,n){var r=t||e;if(void 0===r){var s=Au+" for property "+String(i)+" in class "+n+".";throw new Error(s)}return r}function $u(t,e,i){for(var n=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(n),o=0,a=Object.keys(n).concat(s);o<a.length;o++){var h=a[o],l=n[h],c=Ju(l),u=c.targetName||h,d=Ku(c.inject,c.multiInject,h,i),p=new Vu(fu.ClassProperty,u,d);p.metadata=l,r.push(p)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var g=$u(t,f,i);r=Xu(Xu([],r,!0),g,!0)}return r}function Zu(t,e){var i=Object.getPrototypeOf(e.prototype).constructor;if(i!==Object){var n=Yu(t,Nu(i),i,!0),r=n.map((function(t){return t.metadata.filter((function(t){return t.key===iu}))})),s=[].concat.apply([],r).length,o=n.length-s;return o>0?o:Zu(t,i)}return 0}function Ju(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[ru],multiInject:e[su],targetName:e[eu],unmanaged:e[iu]}}var Qu=function(){function t(t,e,i,n,r){this.id=vu(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=i,this.target=r,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===i?new Map:null}return t.prototype.addChildRequest=function(e,i,n){var r=new t(e,this.parentContext,this,i,n);return this.childRequests.push(r),r},t}();function td(t){return t._bindingDictionary}function ed(t,e,i,n,r){var s=nd(i.container,r.serviceIdentifier),o=[];return s.length===Ou.NoBindingsAvailable&&i.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(i.container.bind(r.serviceIdentifier).toSelf(),s=nd(i.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new Qu(t.serviceIdentifier,i,n,t,r);return t.constraint(e)})),function(t,e,i,n){switch(e.length){case Ou.NoBindingsAvailable:if(i.isOptional())return e;var r=Iu(t),s=Su;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var i="",n=e.getNamedTag(),r=e.getCustomTags();return null!==n&&(i+=n.toString()+"\n"),null!==r&&r.forEach((function(t){i+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+i}return" "+t}(r,i),s+=Lu(n,r,nd),new Error(s);case Ou.OnlyOneBindingAvailable:return e;case Ou.MultipleBindingsAvailable:default:if(i.isArray())return e;r=Iu(t),s=wu+" "+r;throw s+=Lu(n,r,nd),new Error(s)}}(r.serviceIdentifier,o,r,i.container),o}function id(t,e,i,n,r,s){var o,a;if(null===r){o=ed(t,e,n,null,s),a=new Qu(i,n,null,o,s);var h=new zu(n,a);n.addPlan(h)}else o=ed(t,e,n,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var i=null;if(s.isArray())i=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;i=a}if(e.type===pu.Instance&&null!==e.implementationType){var r=function(t,e){return Yu(t,Nu(e),e,!1)}(t,e.implementationType);if(!n.container.options.skipBaseClassChecks){var o=Zu(t,e.implementationType);if(r.length<o){var h=_u(Nu(e.implementationType));throw new Error(h)}}r.forEach((function(e){id(t,!1,e.serviceIdentifier,n,i,e)}))}}))}function nd(t,e){var i=[],n=td(t);return n.hasKey(e)?i=n.get(e):null!==t.parent&&(i=nd(t.parent,e)),i}function rd(t,e,i,n,r,s,o,a){void 0===a&&(a=!1);var h=new Fu(e),l=function(t,e,i,n,r,s){var o=new ju(t?su:ru,i),a=new Vu(e,n,i,o);if(void 0!==r){var h=new ju(r,s);a.metadata.push(h)}return a}(i,n,r,"",s,o);try{return id(t,a,r,h,null,l),h}catch(t){throw Du(t)&&Wu(h.plan.rootRequest),t}}function sd(t){return("object"===n(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function od(t){return!!sd(t)||Array.isArray(t)&&t.some(sd)}var ad,hd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},ld=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},cd=function(t,e,i){t.has(e.id)||t.set(e.id,i)},ud=function(t,e){t.cache=e,t.activated=!0,sd(e)&&dd(t,e)},dd=function(t,e){return hd(void 0,void 0,void 0,(function(){var i,n;return ld(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return i=r.sent(),t.cache=i,[3,3];case 2:throw n=r.sent(),t.cache=null,t.activated=!1,n;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(ad||(ad={}));var pd=function(){return pd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pd.apply(this,arguments)},fd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},gd=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},vd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))};function yd(t,e,i){var n;if(e.length>0){var r=function(t,e){return t.reduce((function(t,i){var n=e(i);return i.target.type===fu.ConstructorArgument?t.constructorInjections.push(n):(t.propertyRequests.push(i),t.propertyInjections.push(n)),t.isAsync||(t.isAsync=od(n)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,i),s=pd(pd({},r),{constr:t});n=r.isAsync?function(t){return fd(this,void 0,void 0,(function(){var e,i;return gd(this,(function(n){switch(n.label){case 0:return[4,bd(t.constructorInjections)];case 1:return e=n.sent(),[4,bd(t.propertyInjections)];case 2:return i=n.sent(),[2,md(pd(pd({},t),{constructorInjections:e,propertyInjections:i}))]}}))}))}(s):md(s)}else n=new t;return n}function md(t){var e,i=new((e=t.constr).bind.apply(e,vd([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,n){var r=e.target.identifier,s=t.propertyInjections[n];i[r]=s})),i}function bd(t){return fd(this,void 0,void 0,(function(){var e,i,n,r;return gd(this,(function(s){for(e=[],i=0,n=t;i<n.length;i++)r=n[i],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function xd(t,e){var i=function(t,e){var i,n;if(Reflect.hasMetadata(lu,t)){var r=Reflect.getMetadata(lu,t);try{return null===(n=(i=e)[r.value])||void 0===n?void 0:n.call(i)}catch(e){throw new Error(Pu(t.name,e.message))}}}(t,e);return sd(i)?i.then((function(){return e})):e}function wd(t,e){t.scope!==du.Singleton&&function(t,e){var i="Class cannot be instantiated in "+(t.scope===du.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Mu(e.name,i));if(Reflect.hasMetadata(cu,e))throw new Error(Eu(e.name,i))}(t,e)}var Sd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},Ad=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Td=function t(e){return function(i){i.parentContext.setCurrentRequest(i);var n=i.bindings,r=i.childRequests,s=i.target&&i.target.isArray(),o=!(i.parentRequest&&i.parentRequest.target&&i.target&&i.parentRequest.target.matchesArray(i.target.serviceIdentifier));if(s&&o)return r.map((function(i){return t(e)(i)}));if(!i.target.isOptional()||0!==n.length){var a=n[0];return Pd(e,i,a)}}},Bd=function(t,e){var i=function(t){switch(t.type){case pu.Factory:return{factory:t.factory,factoryType:ad.Factory};case pu.Provider:return{factory:t.provider,factoryType:ad.Provider};case pu.DynamicValue:return{factory:t.dynamicValue,factoryType:ad.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Du(t)&&(t=e()),t}}((function(){return i.factory.bind(t)(e)}),(function(){return new Error((t=i.factoryType,n=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+n+"'."));var t,n}))},Cd=function(t,e,i){var n,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case pu.ConstantValue:case pu.Function:e=t.cache;break;case pu.Constructor:case pu.Instance:e=t.implementationType;break;case pu.DynamicValue:e=t.dynamicValue;break;case pu.Provider:e=t.provider;break;case pu.Factory:e=t.factory}if(null===e){var i=Iu(t.serviceIdentifier);throw new Error("Invalid binding type: "+i)}}(i),i.type){case pu.ConstantValue:case pu.Function:n=i.cache;break;case pu.Constructor:n=i.implementationType;break;case pu.Instance:n=function(t,e,i,n){wd(t,e);var r=yd(e,i,n);return sd(r)?r.then((function(t){return xd(e,t)})):xd(e,r)}(i,i.implementationType,r,Td(t));break;default:n=Bd(i,e.parentContext)}return n},_d=function(t,e,i){var n=function(t,e){return e.scope===du.Singleton&&e.activated?e.cache:e.scope===du.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==n||function(t,e,i){e.scope===du.Singleton&&ud(e,i),e.scope===du.Request&&cd(t,e,i)}(t,e,n=i()),n},Pd=function(t,e,i){return _d(t,i,(function(){var n=Cd(t,e,i);return n=sd(n)?n.then((function(t){return Ed(e,i,t)})):Ed(e,i,n)}))};function Ed(t,e,i){var n,r=Md(t.parentContext,e,i),s=Dd(t.parentContext.container),o=s.next();do{n=o.value;var a=t.parentContext,h=t.serviceIdentifier,l=Od(n,h);r=sd(r)?Rd(l,a,r):kd(l,a,r),o=s.next()}while(!0!==o.done&&!td(n).hasKey(t.serviceIdentifier));return r}var Md=function(t,e,i){return"function"==typeof e.onActivation?e.onActivation(t,i):i},kd=function(t,e,i){for(var n=t.next();!n.done;){if(sd(i=n.value(e,i)))return Rd(t,e,i);n=t.next()}return i},Rd=function(t,e,i){return Sd(void 0,void 0,void 0,(function(){var n,r;return Ad(this,(function(s){switch(s.label){case 0:return[4,i];case 1:n=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,n)];case 3:return n=s.sent(),r=t.next(),[3,2];case 4:return[2,n]}}))}))},Od=function(t,e){var i=t._activations;return i.hasKey(e)?i.get(e).values():[].values()},Dd=function(t){for(var e=[t],i=t.parent;null!==i;)e.push(i),i=i.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Id=function t(e,i){var n=e.parentRequest;return null!==n&&(!!i(n)||t(n,i))},Ld=function(t){return function(e){var i=function(i){return null!==i&&null!==i.target&&i.target.matchesTag(t)(e)};return i.metaData=new ju(t,e),i}},Ud=Ld(tu),Wd=function(t){return function(e){var i=null;if(null!==e){if(i=e.bindings[0],"string"==typeof t)return i.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}},Nd=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Fd(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=Ud(t),new Fd(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new Fd(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Ld(t)(e),new Fd(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Wd(t)(e.parentRequest)},new Fd(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Ud(t)(e.parentRequest)},new Fd(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Ld(t)(e)(i.parentRequest)},new Fd(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Id(e,Wd(t))},new Fd(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Id(e,Wd(t))},new Fd(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Id(e,Ud(t))},new Fd(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Id(e,Ud(t))},new Fd(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&Id(i,Ld(t)(e))},new Fd(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(i){return null!==i&&!Id(i,Ld(t)(e))},new Fd(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Id(e,t)},new Fd(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Id(e,t)},new Fd(this._binding)},t}(),Fd=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Nd(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Nd(this._binding)},t}(),jd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Nd(this._binding),this._bindingOnSyntax=new Fd(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),zd=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=du.Request,new jd(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=du.Singleton,new jd(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=du.Transient,new jd(this._binding)},t}(),Hd=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Nd(this._binding),this._bindingOnSyntax=new Fd(this._binding),this._bindingInSyntax=new zd(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Gd=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=pu.Instance,this._binding.implementationType=t,new Hd(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=pu.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=du.Singleton,new jd(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=pu.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Hd(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=pu.Constructor,this._binding.implementationType=t,this._binding.scope=du.Singleton,new jd(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=t,this._binding.scope=du.Singleton,new jd(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=pu.Function,this._binding.scope=du.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=du.Singleton,new jd(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=pu.Factory,this._binding.factory=function(e){return function(i){return e.container.getNamed(t,i)}},new jd(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=pu.Provider,this._binding.provider=t,this._binding.scope=du.Singleton,new jd(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Vd=function(){function t(){}return t.of=function(e,i,n,r,s){var o=new t;return o.bindings=e,o.middleware=i,o.deactivations=r,o.activations=n,o.moduleActivationStore=s,o},t}();var Xd=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(bu);if(null==e)throw new Error(bu);var i=this._map.get(t);void 0!==i?i.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(bu);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(xu)},t.prototype.remove=function(t){if(null==t)throw new Error(bu);if(!this._map.delete(t))throw new Error(xu)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(i,n){var r=t.hasKey(i)?t.get(i):void 0;if(void 0!==r){var s=n.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(i,s)}}))},t.prototype.removeByCondition=function(t){var e=this,i=[];return this._map.forEach((function(n,r){for(var s=[],o=0,a=n;o<a.length;o++){var h=a[o];t(h)?i.push(h):s.push(h)}e._setValue(r,s)})),i},t.prototype.hasKey=function(t){if(null==t)throw new Error(bu);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){t.forEach((function(t){return e.add(i,"object"===n(r=t)&&null!==r&&"clone"in r&&"function"==typeof r.clone?t.clone():t);var r}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,i){t(i,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Yd=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,i){this._getModuleActivationHandlers(t).onDeactivations.add(e,i)},t.prototype.addActivation=function(t,e,i){this._getModuleActivationHandlers(t).onActivations.add(e,i)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,i){e._map.set(i,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new Xd,onDeactivations:new Xd}},t}(),qd=function(){return qd=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qd.apply(this,arguments)},Kd=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))},$d=function(t,e){var i,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],n=0}finally{i=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Zd=function(t,e,i){if(i||2===arguments.length)for(var n,r=0,s=e.length;r<s;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))},Jd=function(){function t(t){var e=t||{};if("object"!==n(e))throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=du.Transient;else if(e.defaultScope!==du.Singleton&&e.defaultScope!==du.Transient&&e.defaultScope!==du.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=vu(),this._bindingDictionary=new Xd,this._snapshots=[],this._middleware=null,this._activations=new Xd,this._deactivations=new Xd,this.parent=null,this._metadataReader=new Ru,this._moduleActivationStore=new Yd}return t.merge=function(e,i){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var s=new t,o=Zd([e,i],n,!0).map((function(t){return td(t)})),a=td(s);return o.forEach((function(t){var e;e=a,t.traverse((function(t,i){i.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),s},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=this._getContainerModuleHelpersFactory(),n=0,r=t;n<r.length;n++){var s=r[n],o=i(s.id);s.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r,s;return $d(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),i=0,n=t,o.label=1;case 1:return i<n.length?(r=n[i],s=e(r.id),[4,r.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)]):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e.forEach((function(e){var i=t._removeModuleBindings(e.id);t._deactivateSingletons(i),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kd(this,void 0,void 0,(function(){var e,i,n,r;return $d(this,(function(s){switch(s.label){case 0:e=0,i=t,s.label=1;case 1:return e<i.length?(n=i[e],r=this._removeModuleBindings(n.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(n.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||du.Transient,i=new yu(t,e);return this._bindingDictionary.add(t,i),new Gd(i)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Kd(this,void 0,void 0,(function(){return $d(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){switch(i.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:i.sent(),i.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,i){t._deactivateSingletons(i)})),this._bindingDictionary=new Xd},t.prototype.unbindAllAsync=function(){return Kd(this,void 0,void 0,(function(){var t,e=this;return $d(this,(function(i){switch(i.label){case 0:return t=[],this._bindingDictionary.traverse((function(i,n){t.push(e._deactivateSingletonsAsync(n))})),[4,Promise.all(t)];case 1:return i.sent(),this._bindingDictionary=new Xd,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,tu,e)},t.prototype.isBoundTagged=function(t,e,i){var n=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,i,n){var r=new Vu(fu.Variable,"",e,new ju(i,n)),s=new Fu(t);return new Qu(e,s,null,[],r)}(this,t,e,i);n=r.some((function(t){return t.constraint(s)}))}return!n&&this.parent&&(n=this.parent.isBoundTagged(t,e,i)),n},t.prototype.snapshot=function(){this._snapshots.push(Vd.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var i=new t(e||this.options);return i.parent=this,i},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),i)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return Kd(this,void 0,void 0,(function(){var e;return $d(this,(function(i){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._getButThrowIfAsync(n)},t.prototype.getTaggedAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){var n;return $d(this,(function(r){return n=this._getNotAllArgs(t,!1,e,i),[2,this._get(n)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,tu,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,tu,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getButThrowIfAsync(n)},t.prototype.getAllTaggedAsync=function(t,e,i){var n=this._getNotAllArgs(t,!0,e,i);return this._getAll(n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,tu,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,tu,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var i=this.get(t);return e||this.unbind(t),i},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(cu,t))return e[Reflect.getMetadata(cu,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var i=this,n=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(sd(r))return this._handleDeactivationError(r.then((function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,n)})),n)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,n);if(sd(s))return this._handleDeactivationError(s,n)}catch(t){throw new Error(Mu(n.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t];case 1:return n.sent(),[3,3];case 2:throw i=n.sent(),new Error(Mu(e.name,i.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var i=this,n=e.next();n.value;){var r=n.value(t);if(sd(r))return r.then((function(){return i._deactivateContainerAsync(t,e)}));n=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Kd(this,void 0,void 0,(function(){var i;return $d(this,(function(n){switch(n.label){case 0:i=e.next(),n.label=1;case 1:return i.value?[4,i.value(t)]:[3,3];case 2:return n.sent(),i=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}},n=function(e){return function(i,n){t._moduleActivationStore.addActivation(e,i,n),t.onActivation(i,n)}},r=function(e){return function(i,n){t._moduleActivationStore.addDeactivation(e,i,n),t.onDeactivation(i,n)}};return function(s){return{bindFunction:(o=s,function(i){var n=t.bind(i);return e(n,o),n}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:n(s),onDeactivationFunction:r(s),rebindFunction:i(s),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var o}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=qd(qd({},t),{contextInterceptor:function(t){return t},targetType:fu.Variable});if(this._middleware){var i=this._middleware(e);if(null==i)throw new Error("Invalid return type in middleware. Middleware must return!");return i}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(od(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}},t.prototype._planAndResolve=function(){var t=this;return function(e){var i=rd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Td(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(i=e.contextInterceptor(i))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return sd(t.cache)?t.cache.then((function(i){return e._deactivate(t,i)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];if(sd(this._deactivateIfSingleton(n)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Kd(this,void 0,void 0,(function(){var e=this;return $d(this,(function(i){switch(i.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return i.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,i){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,i)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,i)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Iu(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,i){var n=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(sd(r))return r.then((function(){return n._preDestroy(i,e)}))}return this._preDestroy(i,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,i){return Kd(this,void 0,void 0,(function(){return $d(this,(function(n){switch(n.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:n.sent(),n.label=2;case 2:return[4,this._preDestroy(i,e)];case 3:return n.sent(),[2]}}))}))},t}(),Qd=function(t){this.id=vu(),this.registry=t};function tp(t,e,i,n){!function(t){if(void 0!==t)throw new Error(Cu)}(e),ip(ou,t,i.toString(),n)}function ep(t){var e=[];if(Array.isArray(t)){var i=function(t){for(var e=new Set,i=0,n=t;i<n.length;i++){var r=n[i];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==i)throw new Error(mu+" "+i.toString())}else e=[t];return e}function ip(t,e,i,n){var r=ep(n),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[i];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(mu+" "+t.key.toString())},h=0,l=o;h<l.length;h++){a(l[h])}o.push.apply(o,r),s[i]=o,Reflect.defineMetadata(t,s,e)}function np(t){return function(e,i,n){"number"==typeof n?tp(e,i,n,t):function(t,e,i){if(void 0!==t.prototype)throw new Error(Cu);ip(au,t.constructor,e,i)}(e,i,t)}}function rp(){return function(t){if(Reflect.hasOwnMetadata(hu,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(hu,e,t),t}}function sp(t){return np(new ju(tu,t))}function op(t){return function(e){return function(i,n,r){if(void 0===e){var s="function"==typeof i?i.name:i.constructor.name;throw new Error("@inject called with undefined this could mean that the class "+s+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.")}return np(new ju(t,e))(i,n,r)}}}var ap=op(ru),hp=op(su);var lp,cp,up=(lp=lu,cp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var i=new ju(lp,e);if(Reflect.hasOwnMetadata(lp,t.constructor))throw new Error(cp);Reflect.defineMetadata(lp,i,t.constructor)}});function dp(t,e,i,r){var s,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var h=t.length-1;h>=0;h--)(s=t[h])&&(a=(o<3?s(a):o>3?s(e,i,a):s(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a}function pp(t,e){return function(i,n){e(i,n,t)}}function fp(t,e){if("object"===("undefined"==typeof Reflect?"undefined":n(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function gp(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const vp=Symbol("ContributionProvider");class yp{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function mp(t,e){t(vp).toDynamicValue((({container:t})=>new yp(e,t))).inSingletonScope().whenTargetNamed(e)}class bp{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>t.name!==i&&(!e||t.fn===e))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class xp extends bp{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const wp=Symbol.for("EnvContribution"),Sp=Symbol.for("VGlobal"),Ap="browser";t.DefaultGlobal=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv(Ap),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv(Ap),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv(Ap),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv(Ap),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv(Ap),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv(Ap),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new xp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv(Ap),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv(Ap),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(Ap),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv(Ap),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv(Ap),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv(Ap),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv(Ap),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv(Ap),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv(Ap),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv(Ap),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv(Ap),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv(Ap),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv(Ap),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv(Ap),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}},t.DefaultGlobal=dp([rp(),pp(0,ap(vp)),pp(0,sp(wp)),fp("design:paramtypes",[Object])],t.DefaultGlobal);var Tp={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,r,s,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||r&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Tp);var Bp=i(Tp.exports),Cp=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},_p=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Cp(t,"Boolean")},Pp=function(t){return"function"==typeof t},Ep=function(t){return null==t},Mp=function(t){return null!=t},kp=function(t){var e=n(t);return null!==t&&"object"===e||"function"===e},Rp=function(t){return void 0===t},Op=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"string"===i:"string"===i||Cp(t,"String")},Dp=function(t){return Array.isArray?Array.isArray(t):Cp(t,"Array")},Ip=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n(t);return e?"number"===i:"number"===i||Cp(t,"Number")},Lp=function(t){return Ip(t)&&Number.isFinite(t)},Up=function(t,e,i){for(var n=Op(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},Wp=Object.prototype.hasOwnProperty,Np=function(t,e){return null!=t&&Wp.call(t,e)};function Fp(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=[],o=[];return void 0===e&&(e=!0),void 0===i&&(i=1/0),function t(i,a){if(null===i)return null;if(0===a)return i;var h,l,c;if("object"!=n(i))return i;if(Dp(i)?h=[]:Cp(i,"RegExp")?(h=new RegExp(i.source,(c="",(l=i).global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c)),i.lastIndex&&(h.lastIndex=i.lastIndex)):h=function(t){return Cp(t,"Date")}(i)?new Date(i.getTime()):void 0===r?Object.create(Object.getPrototypeOf(i)):Object.create(r),e){var u=s.indexOf(i);if(-1!==u)return o[u];s.push(i),o.push(h)}for(var d in i)h[d]=t(i[d],a-1);return h}(t,i)}function jp(t,e){if(!Dp(t)||!Dp(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}var zp=1e-10,Hp=1e-10;function Gp(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zp,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Hp)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}try{"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){!1}var Vp=1e-12,Xp=Math.PI,Yp=Xp/2,qp=2*Xp,Kp=2*Math.PI,$p=Math.abs,Zp=Math.atan2,Jp=Math.cos,Qp=Math.max,tf=Math.min,ef=Math.sin,nf=Math.sqrt,rf=Math.pow;function sf(t){return t>1?0:t<-1?Xp:Math.acos(t)}function of(t){return t>=1?Yp:t<=-1?-Yp:Math.asin(t)}function af(t,e,i,n,r){var s,o;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:s,y:o}}function hf(t,e){return t[0]*e[1]-t[1]*e[0]}var lf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;r(this,t),this.x=0,this.y=0,this.x=e,this.y=i,this.x1=n,this.y1=s}return o(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 Ip(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return Ip(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),cf=function(){function t(){r(this,t)}return o(t,null,[{key:"distancePP",value:function(t,e){return nf(rf(t.x-e.x,2)+rf(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return nf(rf(t-i,2)+rf(e-n,2))}},{key:"distancePN",value:function(t,e,i){return nf(rf(e-t.x,2)+rf(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new lf((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}]),t}();function uf(t,e,i){var n=e.x1,r=e.y1,s=e.x2,o=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*o+i.e,i.b*s+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}var df=function(){function t(e){r(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return o(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Dp(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return uf(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,i){var n=this.x1,r=this.y1,s=this.x2,o=this.y2,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*r+l,h*n+a*r+c,a*n-h*o+l,h*n+a*o+c,a*s-h*r+l,h*s+a*r+c,a*s-h*o+l,h*s+a*o+c]}},{key:"scalePoints",value:function(t,e,i,n){return[t*this.x1+(1-t)*i,e*this.y1+(1-e)*n,t*this.x2+(1-t)*i,e*this.y2+(1-e)*n]}}]),t}(),pf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(i,t);var e=c(i);function i(){return r(this,i),e.apply(this,arguments)}return o(i)}(df);var ff=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-qp;)t+=qp;else if(t>0)for(;t>qp;)t-=qp;return t};function gf(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var vf,yf,mf,bf,xf,wf,Sf,Af,Tf,Bf=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;r(this,t),this.a=e,this.b=i,this.c=n,this.d=s,this.e=o,this.f=a}return o(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}},{key:"setValue",value:function(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,i=this.b,n=this.c,r=this.d,s=this.e,o=this.f,a=new t,h=e*r-i*n;return a.a=r/h,a.b=-i/h,a.c=-n/h,a.d=e/h,a.e=(n*o-r*s)/h,a.f=-(e*o-i*s)/h,a}},{key:"rotate",value:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,i){var n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,o=(1-n)*i-r*e,a=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,this.e=u,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}},{key:"multiply",value:function(t,e,i,n,r,s){var o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,u=a*t+l*e,d=o*i+h*n,p=a*i+l*n,f=o*r+h*s+this.e,g=a*r+l*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}},{key:"interpolate",value:function(e,i){var n=new t;return n.a=this.a+(e.a-this.a)*i,n.b=this.b+(e.b-this.b)*i,n.c=this.c+(e.c-this.c)*i,n.d=this.d+(e.d-this.d)*i,n.e=this.e+(e.e-this.e)*i,n.f=this.f+(e.f-this.f)*i,n}},{key:"transformPoint",value:function(t,e){var i=this.a,n=this.b,r=this.c,s=this.d,o=this.e,a=this.f,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*a-s*o)/h,f=-(i*a-n*o)/h,g=t.x,v=t.y;e.x=g*l+v*u+p,e.y=g*c+v*d+f}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){var a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}]),t}();function Cf(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function _f(t,e,i,n){if(!function(t,e,i,n){var r,s=t[0],o=e[0],a=i[0],h=n[0];return o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),!(o<a||h<s||(s=t[1],o=e[1],a=i[1],h=n[1],o<s&&(r=o,o=s,s=r),h<a&&(r=h,h=a,a=r),o<a||h<s))}(t,e,i,n))return!1;var r,s,o=[0,0],a=[0,0],h=[0,0];if(Cf(o,e,t),Cf(a,n,i),$p((r=o)[0]-(s=a)[0])+$p(r[1]-s[1])<1e-12)return!0;Cf(h,i,t);var l=hf(h,a)/hf(o,a);return l>=0&&l<=1&&[t[0]+o[0]*l,t[1]+o[1]*l]}function Pf(t,e,i){var n,r,s,o;return!(t&&e&&(i?(vf=t.x1,yf=t.x2,mf=t.y1,bf=t.y2,xf=e.x1,wf=e.x2,Sf=e.y1,Af=e.y2,vf>yf&&(n=[yf,vf],vf=n[0],yf=n[1]),mf>bf&&(r=[bf,mf],mf=r[0],bf=r[1]),xf>wf&&(s=[wf,xf],xf=s[0],wf=s[1]),Sf>Af&&(o=[Af,Sf],Sf=o[0],Af=o[1]),vf>wf||yf<xf||mf>Af||bf<Sf):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"}(Tf||(Tf={}));var Ef=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};var Mf,kf=function(){function t(e,i){r(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=i?i:{},this.textSpec=this._initSpec(),Mp(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Mp(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return o(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Ep(this._canvas)&&(Mp(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Ep(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&Mp(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Ep(this._context)&&Mp(this._canvas)){var t=this._canvas.getContext("2d");Mp(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.fontStyle,n=void 0===i?e.fontStyle:i,r=t.fontVariant,s=void 0===r?e.fontVariant:r,o=t.fontWeight,a=void 0===o?e.fontWeight:o,h=t.fontSize,l=void 0===h?e.fontSize:h,c=t.fontFamily;return(n?n+" ":"")+(s?s+" ":"")+(a?a+" ":"")+l+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Ep(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,s=this._userSpec,o=s.fontStyle,a=void 0===o?r.fontStyle:o,h=s.fontVariant,l=void 0===h?r.fontVariant:h,c=s.fontWeight,u=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=s.fontSize,p=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=s.fontFamily,g=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,v=s.align,y=s.textAlign,m=void 0===y?null!=v?v:"center":y,b=s.baseline,x=s.textBaseline,w=void 0===x?null!=b?b:"middle":x,S=s.ellipsis,A=s.limit,T=s.lineHeight;return{fontStyle:a,fontVariant:l,fontFamily:g,fontSize:p,fontWeight:u,textAlign:m,textBaseline:w,ellipsis:S,limit:A,lineHeight:void 0===T?p: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(Ep(t))return{width:0,height:0};if(Ep(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,s=i.fontWeight,o=i.textAlign,a=i.textBaseline,h=i.ellipsis,l=i.limit,c=i.lineHeight;try{var u=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:s,textAlign:o,textBaseline:a,ellipsis:!!h,maxLineWidth:l||1/0,lineHeight:c});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),i=this.textSpec,n=i.fontSize,r=i.lineHeight;return{width:e.width,height:null!=r?r:n}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],s=this._measureSpecialChar(r);Ep(s)&&t.NUMBERS_CHAR_SET.includes(r)&&(s=this._measureNumberChar()),Ep(s)&&["F","W"].includes(Ef(r))&&(s=this._measureFullSizeChar()),Ep(s)&&(s=this._measureLetterChar()),i.width+=s.width,i.height=Math.max(i.height,s.height)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},i=this.textSpec,n=i.fontSize,r=i.lineHeight,s=0;s<t.length;s++){var o=t[s],a=["F","W"].includes(Ef(o))?1:.53;e.width+=a*n}return e.height=null!=r?r:n,e}},{key:"_measureReduce",value:function(t,e){var i=this.textSpec,n=i.fontSize,r=i.lineHeight,s={width:0,height:0};if(Ep(t))return s;if(Dp(t)){var o=t.filter(Mp).map((function(t){return t.toString()}));return 0===o.length?s:1===o.length?e(o[0]):{width:o.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:o.length*((null!=r?r:n)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Ep(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 Ep(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Ep(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 Mp(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Mp(this._canvas)&&(this._canvas=null),Mp(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();kf.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",kf.NUMBERS_CHAR_SET="0123456789",kf.FULL_SIZE_CHAR="字",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"}(Mf||(Mf={}));const Rf=qp-1e-8;class Of{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>Rf)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=qp)<0&&(n+=qp),(r%=qp)<0&&(r+=qp),r<n&&(s=!s,o=n,n=r,r=o),s)for(r-=qp,o=n-n%Yp,a=0;a<4&&o>r;++a,o-=Yp)f(o);else for(o=n-n%Yp+Yp,a=0;a<4&&o<r;++a,o+=Yp)f(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class Df{constructor(){this.curves=[],this.bounds=new pf}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const If=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Lf={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},Uf={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Wf,Nf,Ff,jf,zf,Hf;function Gf(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(Wf=e[t],Nf=Wf.slice(1),Ff=Wf[0],i=[Ff],n=Nf.match(If),null!==n){for(let t=0,e=n.length;t<e;t++)jf=n[t],zf=parseFloat(jf),Number.isNaN(zf)||i.push(zf);if(Hf=Lf[Ff],i.length-1>Hf){let t;for(let e=1,n=i.length;e<n;e+=Hf){t=[Ff];for(let n=e,r=e+Hf;n<r;n++)t.push(i[n]);r.push(t)}}else r.push(i)}else r.push(i);return r}var Vf,Xf,Yf,qf,Kf,$f,Zf,Jf;function Qf(t,e,i,n,r,s,o,a,h){const l=o*(Math.PI/180);const c=Math.sin(l),u=Math.cos(l),d=u*(a-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(a-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,v=c/i,y=-c/n,m=u/n,b=g*a+v*h,x=y*a+m*h,w=g*t+v*e,S=y*t+m*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let T=Math.sqrt(A);s===r&&(T=-T);const B=.5*(b+w)-T*(S-x),C=.5*(x+S)+T*(w-b),_=Math.atan2(x-C,b-B);let P=Math.atan2(S-C,w-B)-_;P<0&&1===s?P+=qp:P>0&&0===s&&(P-=qp);const E=Math.ceil(Math.abs(P/(Yp+.001))),M=[];for(let t=0;t<E;++t){const e=_+t*P/E,r=_+(t+1)*P/E;M[t]=[B,C,e,r,i,n,c,u]}return M}function tg(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=h*s,c=-a*o,u=a*s,d=h*o,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),y=.5*(r-n),m=Math.sin(.5*y),b=8/3*m*m/Math.sin(y),x=e+p-b*f,w=i+f+b*p,S=e+g,A=i+v,T=S+b*v,B=A-b*g;return[l*x+c*w,u*x+d*w,l*T+c*B,u*T+d*B,l*S+c*A,u*S+d*A]}function eg(t,e,i,n){const r=Qf(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=tg(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(Vf=t.UpdateTag||(t.UpdateTag={}))[Vf.NONE=0]="NONE",Vf[Vf.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Vf[Vf.UPDATE_SHAPE=2]="UPDATE_SHAPE",Vf[Vf.CLEAR_SHAPE=253]="CLEAR_SHAPE",Vf[Vf.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Vf[Vf.INIT=51]="INIT",Vf[Vf.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Vf[Vf.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Vf[Vf.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Vf[Vf.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Vf[Vf.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Vf[Vf.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t.IContainPointMode=void 0,(Xf=t.IContainPointMode||(t.IContainPointMode={}))[Xf.GLOBAL=1]="GLOBAL",Xf[Xf.LOCAL=16]="LOCAL",Xf[Xf.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Xf[Xf.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Yf=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Yf.INIT=0]="INIT",Yf[Yf.DEFAULT=1]="DEFAULT",Yf[Yf.STATE=2]="STATE",Yf[Yf.ANIMATE_BIND=10]="ANIMATE_BIND",Yf[Yf.ANIMATE_PLAY=11]="ANIMATE_PLAY",Yf[Yf.ANIMATE_START=12]="ANIMATE_START",Yf[Yf.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Yf[Yf.ANIMATE_END=14]="ANIMATE_END",Yf[Yf.TRANSLATE=20]="TRANSLATE",Yf[Yf.TRANSLATE_TO=21]="TRANSLATE_TO",Yf[Yf.SCALE=22]="SCALE",Yf[Yf.SCALE_TO=23]="SCALE_TO",Yf[Yf.ROTATE=24]="ROTATE",Yf[Yf.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(qf=t.AnimateStatus||(t.AnimateStatus={}))[qf.INITIAL=0]="INITIAL",qf[qf.RUNNING=1]="RUNNING",qf[qf.PAUSED=2]="PAUSED",qf[qf.END=3]="END",t.AnimateMode=void 0,(Kf=t.AnimateMode||(t.AnimateMode={}))[Kf.NORMAL=0]="NORMAL",Kf[Kf.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,($f=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",$f.from="from",$f.to="to",$f.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,(Zf=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Zf.CubicBezierCurve=0]="CubicBezierCurve",Zf[Zf.QuadraticBezierCurve=1]="QuadraticBezierCurve",Zf[Zf.ArcCurve=2]="ArcCurve",Zf[Zf.LineCurve=3]="LineCurve",Zf[Zf.EllipseCurve=4]="EllipseCurve",Zf[Zf.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Jf=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Jf.beforeFillStroke=0]="beforeFillStroke",Jf[Jf.afterFillStroke=1]="afterFillStroke";const ig=(t,e,i,n,r,s,o)=>{const a=Math.abs(i-e),h=4*Math.tan(a/4)/3,l=i<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(i),p=Math.sin(i),f=c*s+n,g=u*o+r,v=d*s+n,y=p*o+r,m=s*h*l,b=o*h*l;t.push(f-m*u,g+b*c,v+m*p,y-b*d,v,y)},ng=[(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 rg(t,e,i=0,n=0,r=1,s=1,o){for(let a=0;a<t.length;a++){const h=t[a];ng[h[0]](h,e,i,n,r,s,o)}}class sg{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function og(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+=cf.distanceNN(s,o,a,h)}return i/2}function ag(t,e,i,n,r){return og([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function hg(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 lg(t,e,i,n,r){const s=hg(t.x,e.x,i.x,n.x,r),o=hg(t.y,e.y,i.y,n.y,r);return new lf(s,o)}function cg(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,o=lg(i,n,r,s,e),a=cf.pointAtPP(i,n,e),h=cf.pointAtPP(n,r,e),l=cf.pointAtPP(r,s,e),c=cf.pointAtPP(a,h,e),u=cf.pointAtPP(h,l,e);return[new ug(i,a,c,o),new ug(o,u,l,s)]}class ug extends sg{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return lg(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?ag(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?$p(this.p0.x-this.p3.x):e===t.Direction.COLUMN?$p(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Qp(t-.01,0),i=tf(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return Zp(r.y-n.y,r.x-n.x)}}function dg(t,e){const{p0:i,p1:n}=t,r=cf.pointAtPP(i,n,e);return[new pg(i,r),new pg(r,n)]}class pg extends sg{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return cf.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Zp(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()?cf.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?$p(this.p0.x-this.p1.x):e===t.Direction.COLUMN?$p(this.p0.y-this.p1.y):0}}class fg{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,o,a){const h=new ug(new lf(this._lastX,this._lastY),new lf(t,e),new lf(i,n),new lf(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 pg(new lf(this._lastX,this._lastY),new lf(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return $p(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return $p(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class gg extends fg{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 vg(t,e,i=1){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class yg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function mg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new fg("linear",null!=n?n:$p(e[e.length-1].x-e[0].x)>$p(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return bg(new yg(s,r),e),s}function bg(t,e){return vg(t,e,1)}function xg(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 wg{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){if(2===this._point)xg(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:xg(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 Sg(t,e){return vg(t,e,2)}function Ag(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new fg("basis",null!=n?n:$p(e[e.length-1].x-e[0].x)>$p(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Sg(new wg(s,r),e),s}function Tg(t){return t<0?-1:1}function Bg(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(Tg(s)+Tg(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Cg(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function _g(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 Pg{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined2,this.lastPoint1);break;case 3:_g(this,this._t0,Cg(this,this._t0),!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;if(i!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,_g(this,Cg(this,e=Bg(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:_g(this,this._t0,e=Bg(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 Eg extends Pg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Mg(t,e){return vg(t,e,2)}function kg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new fg("monotoneX",null!=n?n:$p(e[e.length-1].x-e[0].x)>$p(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Mg(new Pg(s,r),e),s}function Rg(t,e){return vg(t,e,2)}function Og(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;if(e.length<3-Number(!!r))return mg(e,i);const s=new gg("monotoneY",null!=n?n:$p(e[e.length-1].x-e[0].x)>$p(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Rg(new Eg(s,r),e),s}let Dg=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Ig(e,i,n={}){const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const o=new fg("step",null!=r?r:$p(e[e.length-1].x-e[0].x)>$p(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Lg(new Dg(o,i,s),e),o}function Lg(t,e){return vg(t,e,1)}class Ug{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){this.context.closePath()}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Wg(e,i={}){const{direction:n,startPoint:r}=i;if(e.length<2-Number(!!r))return null;const s=new fg("linear",null!=n?n:$p(e[e.length-1].x-e[0].x)>$p(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Ng(new Ug(s,r),e),s}function Ng(t,e){return vg(t,e,1)}function Fg(t,e,i){switch(e){case"linear":default:return mg(t,i);case"basis":return Ag(t,i);case"monotoneX":return kg(t,i);case"monotoneY":return Og(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Wg(t,i)}}class jg extends Df{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Of(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Uf.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Uf.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Uf.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([Uf.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([Uf.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([Uf.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([Uf.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([Uf.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Uf.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const t=[];t[Uf.M]=t=>`M${t[1]} ${t[2]}`,t[Uf.L]=t=>`L${t[1]} ${t[2]}`,t[Uf.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Uf.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Uf.A]=t=>{const e=[];ig(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[Uf.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=Gf(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=Fg(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[Uf.M]=this.moveToTransform,t[Uf.L]=this.lineToTransform,t[Uf.Q]=this.quadraticCurveToTransform,t[Uf.C]=this.bezierCurveToTransform,t[Uf.AT]=this.arcToTransform,t[Uf.E]=this.ellipseTransform,t[Uf.R]=this.rectTransform,t[Uf.A]=this.arcTransform,t[Uf.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,r=1){let s,o,a,h,l,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(s=t[g],1===n&&1===r||(s=Hg(s,n,r)),s[0]){case"l":u+=s[1],d+=s[2],this.lineTo(u+e,d+i);break;case"L":u=s[1],d=s[2],this.lineTo(u+e,d+i);break;case"h":u+=s[1],this.lineTo(u+e,d+i);break;case"H":u=s[1],this.lineTo(u+e,d+i);break;case"v":d+=s[1],this.lineTo(u+e,d+i);break;case"V":d=s[1],this.lineTo(u+e,d+i);break;case"m":u+=s[1],d+=s[2],this.moveTo(u+e,d+i);break;case"M":u=s[1],d=s[2],this.moveTo(u+e,d+i);break;case"c":o=u+s[5],a=d+s[6],p=u+s[3],f=d+s[4],this.bezierCurveTo(u+s[1]+e,d+s[2]+i,p+e,f+i,o+e,a+i),u=o,d=a;break;case"C":u=s[5],d=s[6],p=s[3],f=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,p+e,f+i,u+e,d+i);break;case"s":o=u+s[3],a=d+s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,u+s[1]+e,d+s[2]+i,o+e,a+i),p=u+s[1],f=d+s[2],u=o,d=a;break;case"S":o=s[3],a=s[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+e,f+i,s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"q":o=u+s[3],a=d+s[4],p=u+s[1],f=d+s[2],this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"Q":o=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,o+e,a+i),u=o,d=a,p=s[1],f=s[2];break;case"t":o=u+s[1],a=d+s[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-h,f=2*d-l):"q"===c[0]&&(p=2*u-p,f=2*d-f),h=p,l=f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a,p=u+s[1],f=d+s[2];break;case"T":o=s[1],a=s[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,o+e,a+i),u=o,d=a;break;case"a":eg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+u+e,s[7]+d+i]),u+=s[6],d+=s[7];break;case"A":eg(this,u+e,d+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),u=s[6],d=s[7];break;case"z":case"Z":this.closePath()}c=s}}_runCommandList(t,e=0,i=0,n=1,r=1){if(0!==e||0!==i||1!==n||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Uf.L:this.lineToTransform(o,e,i,n,r);break;case Uf.M:this.moveToTransform(o,e,i,n,r);break;case Uf.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Uf.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Uf.A:this.arcToTransform(o,e,i,n,r);break;case Uf.E:this.ellipseTransform(o,e,i,n,r);break;case Uf.R:this.rectTransform(o,e,i,n,r);break;case Uf.AT:this.arcToTransform(o,e,i,n,r);break;case Uf.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),rg(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 $p(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 $p(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 zg=["l",0,0,0,0,0,0,0];function Hg(t,e,i){const n=zg[0]=t[0];if("a"===n||"A"===n)zg[1]=e*t[1],zg[2]=i*t[2],zg[3]=t[3],zg[4]=t[4],zg[5]=t[5],zg[6]=e*t[6],zg[7]=i*t[7];else if("h"===n||"H"===n)zg[1]=e*t[1];else if("v"===n||"V"===n)zg[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)zg[n]=(n%2==1?e:i)*t[n];return zg}const Gg={alignSelf:"auto"},Vg={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,anchor:[0,0],anchor3d:[0,0],postMatrix:new Bf},Xg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Yg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},qg=Object.assign({outerBorder:Object.assign(Object.assign({},Yg),{distance:0}),innerBorder:Object.assign(Object.assign({},Yg),{distance:0})},Yg),Kg={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"},$g=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null},Xg),qg),Gg),Zg={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Jg=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0},$g),Vg);const Qg=Object.assign(Object.assign({},Jg),{startAngle:0,endAngle:Kp,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),tv=Object.assign(Object.assign(Object.assign({},Jg),Zg),{points:[],segments:[],curveType:"linear",clipRange:1}),ev=Object.assign(Object.assign({},Jg),{radius:1,startAngle:0,endAngle:Kp}),iv=Object.assign(Object.assign({},Jg),{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"}),nv=Object.assign(Object.assign({},Jg),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),rv=Object.assign(Object.assign(Object.assign({},Jg),Zg),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"}),sv=Object.assign(Object.assign({},Jg),{path:new jg,customPath:()=>{console.warn("空函数")}}),ov=Object.assign(Object.assign({},Jg),{points:[],cornerRadius:0}),av=Object.assign(Object.assign({},Jg),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),hv=Object.assign(Object.assign({},Jg),{width:0,height:0,cornerRadius:0,length:0}),lv=Object.assign(Object.assign({},Jg),{symbolType:"circle",size:10,keepDirIn3d:!0}),cv=Object.assign(Object.assign(Object.assign({},Jg),Kg),{strokeBoundsBuffer:0,keepDirIn3d:!0}),uv=Object.assign(Object.assign({},Jg),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),dv=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Jg),{fill:!0}),pv=Object.assign(Object.assign({},dv),{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});const fv=new class{},gv={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"}},vv=!0,yv=!1,mv=/\w|\(|\)/,bv=/[.?!,;:/,。?!、;:]/,xv=/\S/;function wv(t,e,i,n,r){if(!e||e<=0)return 0;const s=fv.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=Sv(t,o)),o}function Sv(t,e){let i=e;for(;mv.test(t[i-1])&&mv.test(t[i])||bv.test(t[i]);)if(i--,i<=0)return e;return i}function Av(t,e){const i=fv.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}let Tv=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){if(!this.context)return this.estimate(t,e).width;this.context.setTextStyleWithoutAlignBaseline(e);return this.context.measureText(t).width}estimate(t,{fontSize:e=cv.fontSize}){let i=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:n++;return{width:~~(.8*i*e+n*e),height:e}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Kg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Kg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1);if(n&&r.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[a].text;let s=Sv(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[a]),{text:r.str,width:r.width})),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,i,n){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const s=this._clipText(t,e,i,0,t.length-1);if(n&&s.str!==t){const i=Sv(t,s.str.length);i!==s.str.length&&(s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,n,r){const s=Math.floor((n+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipText(t,e,i,n,s)}if(a<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipText(t,e,i,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,i,n,r){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(n,e);if(o>i)return s;i-=o;const a=this.clipTextVertical(t,e,i,r);return a.width+=o,a.verticalList.push({text:n,direction:1,width:o}),a}clipTextWithSuffix(t,e,i,n,r){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};const o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;const a=this._clipText(t,e,i,0,t.length-1);if(r&&a.str!==t){const i=Sv(t,a.str.length);i!==a.str.length&&(a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a.str+=n,a.width+=o,a}};Tv=dp([rp()],Tv);const Bv=Symbol.for("TextMeasureContribution");let Cv=class extends Tv{};Cv=dp([rp()],Cv);const _v=new Jd,Pv=Symbol.for("CanvasFactory"),Ev=Symbol.for("Context2dFactory");function Mv(t){return _v.getNamed(Pv,fv.global.env)(t)}const kv=1e-4,Rv=Math.sqrt(3),Ov=1/3;function Dv(t){return t>-qv&&t<qv}function Iv(t){return t>qv||t<-qv}const Lv=[0,0],Uv=[0,0],Wv=[0,0];function Nv(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Fv(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function jv(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 zv(t){return(t%=Kp)<0&&(t+=Kp),t}function Hv(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 Gv(t,e,i,n,r,s,o,a,h){if(0===o)return!1;const l=o;if(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||a>t+l&&a>i+l&&a>r+l||a<t-l&&a<i-l&&a<r-l)return!1;const c=function(t,e,i,n,r,s,o,a,h){let l=0,c=.005,u=1/0;Lv[0]=o,Lv[1]=a;for(let o=0;o<1;o+=.05){Uv[0]=Fv(t,i,r,o),Uv[1]=Fv(e,n,s,o);const a=Nv(Lv,Uv);a<u&&(l=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<kv);o++){const o=l-c,a=l+c;Uv[0]=Fv(t,i,r,o),Uv[1]=Fv(e,n,s,o);const h=Nv(Uv,Lv);if(o>=0&&h<u)l=o,u=h;else{Wv[0]=Fv(t,i,r,a),Wv[1]=Fv(e,n,s,a);const o=Nv(Wv,Lv);a<=1&&o<u?(l=a,u=o):c*=.5}}return h&&(h[0]=Fv(t,i,r,l),h[1]=Fv(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,a,h,null);return c<=l/2}function Vv(t,e,i,n,r,s,o,a,h,l,c){if(0===h)return!1;const u=h;if(c>e+u&&c>n+u&&c>s+u&&c>a+u||c<e-u&&c<n-u&&c<s-u&&c<a-u||l>t+u&&l>i+u&&l>r+u&&l>o+u||l<t-u&&l<i-u&&l<r-u&&l<o-u)return!1;const d=function(t,e,i,n,r,s,o,a,h,l,c){let u,d,p,f,g=0,v=.005,y=1/0;Lv[0]=h,Lv[1]=l;for(let h=0;h<1;h+=.05)Uv[0]=jv(t,i,r,o,h),Uv[1]=jv(e,n,s,a,h),p=Nv(Lv,Uv),p<y&&(g=h,y=p);y=1/0;for(let h=0;h<32&&!(v<kv);h++)u=g-v,d=g+v,Uv[0]=jv(t,i,r,o,u),Uv[1]=jv(e,n,s,a,u),p=Nv(Uv,Lv),u>=0&&p<y?(g=u,y=p):(Wv[0]=jv(t,i,r,o,d),Wv[1]=jv(e,n,s,a,d),f=Nv(Wv,Lv),d<=1&&f<y?(g=d,y=f):v*=.5);return c&&(c[0]=jv(t,i,r,o,g),c[1]=jv(e,n,s,a,g)),Math.sqrt(y)}(t,e,i,n,r,s,o,a,l,c,null);return d<=u/2}function Xv(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)%Kp<1e-4)return!0;if(s){const t=n;n=zv(r),r=zv(t)}else n=zv(n),r=zv(r);n>r&&(r+=Kp);let u=Math.atan2(h,a);return u<0&&(u+=Kp),u>=n&&u<=r||u+Kp>=n&&u+Kp<=r}function Yv(t,e,i,n,r,s,o){if(0===r)return!1;const a=r,h=r/2;let l=0,c=t;if(o>e+h&&o>n+h||o<e-h&&o<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=a/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-o+c;return u*u/(l*l+1)<=a/2*a/2}const qv=1e-4;function Kv(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(Dv(o)){if(Iv(s)){const t=-a/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*o*a;if(Dv(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 $v=[-1,-1,-1],Zv=[-1,-1];function Jv(){const t=Zv[0];Zv[0]=Zv[1],Zv[1]=t}function Qv(t,e,i,n,r,s,o,a,h,l){if(l>e&&l>n&&l>s&&l>a||l<e&&l<n&&l<s&&l<a)return 0;const c=function(t,e,i,n,r,s){const o=n+3*(e-i)-t,a=3*(i-2*e+t),h=3*(e-t),l=t-r,c=a*a-3*o*h,u=a*h-9*o*l,d=h*h-3*a*l;let p=0;if(Dv(c)&&Dv(u))if(Dv(a))s[0]=0;else{const t=-h/a;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Dv(t)){const t=u/c,e=-a/o+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*a+1.5*o*(-u+e),n=c*a+1.5*o*(-u-e);i=i<0?-Math.pow(-i,Ov):Math.pow(i,Ov),n=n<0?-Math.pow(-n,Ov):Math.pow(n,Ov);const r=(-a-(i+n))/(3*o);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-a-2*i*n)/(3*o),h=(-a+i*(n+Rv*Math.sin(e)))/(3*o),l=(-a+i*(n-Rv*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,$v);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=$v[l],g=0===c||1===c?.5:1;jv(t,i,r,o,c)<h||(d<0&&(d=Kv(e,n,s,a,Zv),Zv[1]<Zv[0]&&d>1&&Jv(),p=jv(e,n,s,a,Zv[0]),d>1&&(f=jv(e,n,s,a,Zv[1]))),2===d?c<Zv[0]?u+=p<e?g:-g:c<Zv[1]?u+=f<p?g:-g:u+=a<f?g:-g:c<Zv[0]?u+=p<e?g:-g:u+=a<p?g:-g)}return u}function ty(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(Dv(s)){if(Iv(o)){const t=-a/o;t>=0&&t<=1&&(r[h++]=t)}}else{const t=o*o-4*s*a;if(Dv(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,$v);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=Fv(e,n,s,l);for(let n=0;n<h;n++){const h=0===$v[n]||1===$v[n]?.5:1;Fv(t,i,r,$v[n])<o||($v[n]<l?a+=c<e?h:-h:a+=s<c?h:-h)}return a}const c=0===$v[0]||1===$v[0]?.5:1;return Fv(t,i,r,$v[0])<o?0:s<e?c:-c}function ey(t,e,i,n,r,s,o,a){if((a-=e)>i||a<-i)return 0;const h=Math.sqrt(i*i-a*a);$v[0]=-h,$v[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=Kp-1e-4){n=0,r=Kp;const e=s?1:-1;return o>=$v[0]+t&&o<=$v[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Kp,r+=Kp);let c=0;for(let e=0;e<2;e++){const i=$v[e];if(i+t>o){let t=Math.atan2(a,i),e=s?1:-1;t<0&&(t=Kp+t),(t>=n&&t<=r||t+Kp>=n&&t+Kp<=r)&&(t>Xp/2&&t<1.5*Xp&&(e=-e),c+=e)}}return c}function iy(t){return Math.round(t/Xp*1e8)/1e8%2*Xp}function ny(t,e){let i=iy(t[0]);i<0&&(i+=Kp);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Kp?r=i+Kp:e&&i-r>=Kp?r=i-Kp:!e&&i>r?r=i+(Kp-iy(i-r)):e&&i<r&&(r=i-(Kp-iy(r-i))),t[0]=i,t[1]=r}const ry=[0,0];function sy(t,e,i,n,r){const s=t,o=t.length;let a,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<o;t++){const o=s[t],f=0===t;o[0]===Uf.M&&t>1&&(i||(l+=Hv(c,u,d,p,n,r))),f&&(c=o[1],u=o[2],d=c,p=u);const g=o[0],v=o[1],y=o[2],m=o[3],b=o[4],x=o[5],w=o[6];let S=b,A=x;ry[0]=S,ry[1]=A,ny(ry,Boolean(o[6])),S=ry[0],A=ry[1];const T=S,B=A-S,C=!!(1-(o[6]?0:1)),_=(n-v)*m/m+v;switch(g){case Uf.M:d=v,p=y,c=d,u=p;break;case Uf.L:if(i){if(Yv(c,u,v,y,e,n,r))return!0}else l+=Hv(c,u,v,y,n,r)||0;c=v,u=y;break;case Uf.C:if(i){if(Vv(c,u,v,y,m,b,x,w,e,n,r))return!0}else l+=Qv(c,u,v,y,m,b,x,w,n,r)||0;c=x,u=w;break;case Uf.Q:if(i){if(Gv(c,u,v,y,m,b,e,n,r))return!0}else l+=ty(c,u,v,y,m,b,n,r)||0;c=m,u=b;break;case Uf.A:if(a=Math.cos(T)*m+v,h=Math.sin(T)*m+y,f?(d=a,p=h):l+=Hv(c,u,a,h,n,r),i){if(Xv(v,y,m,T,T+B,C,e,_,r))return!0}else l+=ey(v,y,m,T,T+B,C,_,r);c=Math.cos(T+B)*m+v,u=Math.sin(T+B)*m+y;break;case Uf.R:if(d=c=v,p=u=y,a=d+m,h=p+b,i){if(Yv(d,p,a,p,e,n,r)||Yv(a,p,a,h,e,n,r)||Yv(a,h,d,h,e,n,r)||Yv(d,h,d,p,e,n,r))return!0}else l+=Hv(a,p,a,h,n,r),l+=Hv(d,h,d,p,n,r);break;case Uf.Z:if(i){if(Yv(c,u,d,p,e,n,r))return!0}else l+=Hv(c,u,d,p,n,r);c=d,u=p}}var f,g;return i||(f=u,g=p,Math.abs(f-g)<qv)||(l+=Hv(c,u,d,p,n,r)||0),0!==l}var oy;t.DefaultGraphicUtil=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const i=Mv({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:Kg.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new kf(Object.assign({defaultFontParams:{fontFamily:Kg.fontFamily,fontSize:Kg.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+kf.ALPHABET_CHAR_SET+kf.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},t.DefaultGraphicUtil=dp([rp(),pp(0,ap(vp)),pp(0,sp(Bv)),pp(1,ap(Sp)),fp("design:paramtypes",[Object,Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(oy||(oy={}));const ay=new Bf;t.DefaultTransformUtil=class{constructor(){this.matrix=new Bf}init(t){return this.mode=oy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=oy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(ay.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(ay.a,ay.b,ay.c,ay.d,ay.e,ay.f),this}scale(t,e,i){return this.mode===oy.matrix?this.scaleMatrix(t,e,i):this}translateMatrix(t,e){const i=this.outSourceMatrix;return ay.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(ay.a,ay.b,ay.c,ay.d,ay.e,ay.f),this}translate(t,e){return this.mode===oy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===oy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=dp([rp(),fp("design:paramtypes",[])],t.DefaultTransformUtil);const hy={arc:Qg,area:tv,circle:ev,line:rv,path:sv,symbol:lv,text:cv,rect:av,rect3d:hv,polygon:ov,richtext:uv,richtextIcon:pv,image:dv,group:iv,glyph:nv},ly=Object.keys(hy);function cy(){return{arc:Object.assign({},hy.arc),area:Object.assign({},hy.area),circle:Object.assign({},hy.circle),line:Object.assign({},hy.line),path:Object.assign({},hy.path),symbol:Object.assign({},hy.symbol),text:Object.assign({},hy.text),rect:Object.assign({},hy.rect),rect3d:Object.assign({},hy.rect3d),polygon:Object.assign({},hy.polygon),richtext:Object.assign({},hy.richtext),richtextIcon:Object.assign({},hy.richtextIcon),image:Object.assign({},hy.image),group:Object.assign({},hy.group),glyph:Object.assign({},hy.glyph)}}function uy(t,e,i=!0){e&&(i?Object.keys(e).forEach((i=>{t[i]?Object.assign(t[i],e[i]):t[i]=e[i]})):Object.keys(e).forEach((i=>{if(t[i]){const n=t[i],r=e[i];Object.keys(e[i]).forEach((t=>{void 0===n[t]&&(n[t]=r[t])}))}else t[i]=e[i]})))}const dy=new Array(60).fill(0).map((()=>cy()));class py{constructor(){this._defaultTheme=dy.pop()||cy(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0),this.userTheme?uy(this.userTheme,t.userTheme,!1):this.userTheme=Fp(t.userTheme),uy(e,t.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this._defaultTheme,n=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);ly.forEach((r=>{var o,a;e[r]||s||t[r]?n[r]=Object.assign({},i[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):n[r]=i[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const fy=new py;function gy(t,e){return t.glyphHost?gy(t.glyphHost):e?(t.isContainer,e):vy(t)||fy.getTheme()}function vy(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)):fy.getTheme()}return null}class yy{static GenAutoIncrementId(){return yy.auto_increment_id++}}yy.auto_increment_id=0;class my extends Bp{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=yy.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return gp(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&console.warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n))&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=_p(i,!0)&&i||kp(i)&&i.capture,r=kp(i)&&i.once,s=Pp(e)?void 0:e;return t=n?`${t}capture`:t,e=Pp(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=_p(i,!0)&&i||kp(i)&&i.capture,r=Pp(e)?void 0:e;t=n?`${t}capture`:t,e=Pp(e)?e:e.handleEvent;const s=kp(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 kp(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class by{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=by.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new lf,this.page=new lf,this.canvas=new lf,this.viewport=new lf,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class xy extends by{constructor(){super(...arguments),this.client=new lf,this.movement=new lf,this.offset=new lf,this.global=new lf,this.screen=new lf}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class wy extends xy{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new wy(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}class Sy extends xy{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new Sy(this.manager);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice(),n.type=this.type,n}}Sy.DOM_DELTA_PIXEL=0,Sy.DOM_DELTA_LINE=1,Sy.DOM_DELTA_PAGE=2;class Ay extends by{constructor(t,e){super(),this.type=t,this.detail=e}}const Ty="object"==typeof performance&&performance.now?performance:Date;function By(t){return"mouse"===t||"pen"===t}class Cy{constructor(t){this.dispatch=new Bp,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(By(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=By(r.pointerType),o=this.trackingData(t.pointerId),a=this.findMountedTarget(o.overTargets);if(o.overTargets&&a&&a!==this.rootTarget&&a!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,a||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(a)){const e=this.createPointerEvent(t,"pointerleave",a||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(a!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==a?void 0:a.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==a&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(i)}const h="dispatchEvent";this[h](r,"pointermove"),"touch"===r.pointerType&&this[h](r,"touchmove"),s&&(this[h](r,"mousemove"),this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),o.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),o=By(s.pointerType);this.dispatchEvent(s,"pointerover"),o&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const a=this.clonePointerEvent(s,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),o&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(a)},this.onPointerOut=(t,e)=>{if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=By(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursor=""},this.onPointerUp=(t,e)=>{if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=Ty.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(By(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(By(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:i});const s=r.clicksByButton[t.button];s.target===e.target&&i-s.timeStamp<200?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=i,e.detail=s.clickCount,By(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this.dispatchEvent(e,"tap"),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof wy))return void console.warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):By(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof Sy))return void console.warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e;if(!this.rootTarget)return;const i=this.mappingTable[t.type];let n;const r=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[r])?n=this._prePointTargetCache[r]:(n=this.pickTarget(t.canvasX,t.canvasY),this._prePointTargetCache={[r]:n}),i)for(let e=0,r=i.length;e<r;e++)i[e].fn(t,n);else console.warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){const n=this.allocateEvent(wy);return this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=i||this.pickTarget(n.global.x,n.global.y),"string"==typeof e&&(n.type=e),n}createWheelEvent(t,e){const i=this.allocateEvent(Sy);return this.copyWheelData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=e||this.pickTarget(i.global.x,i.global.y),i}clonePointerEvent(t,e){const i=this.allocateEvent(wy);return i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof wy&&e instanceof wy&&(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 xy&&e instanceof xy&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Ty.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);else 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){let i;const n=this.rootTarget.pick(t,e);return i=n&&n.graphic?n.graphic:n&&n.group?n.group:t>=0&&t<=Up(this.rootTarget,"width")&&e>=0&&e<=Up(this.rootTarget,"height")?this.rootTarget:null,i}}const _y={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof by))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Ay(t,e))}},Py={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Ey{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetElement(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor)},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor)},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,viewport:s,autoPreventDefault:o=!1}=t;this.manager=new Cy(n),this.globalObj=r,this.supportsPointerEvents=r.supportsPointerEvents,this.supportsTouchEvents=r.supportsTouchEvents,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=o,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new wy,this.rootWheelEvent=new Sy,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.setTargetElement(null)}setCursor(t="default"){const{applyStyles:e,domElement:i}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&e?i.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&e&&Object.assign(i.style,n):e&&Op(t)&&!Np(this.cursorStyles,t)&&(i.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){const e=this.viewport,{x:i,y:n}=t;return{x:i-e.x,y:n-e.y}}mapToCanvasPoint(t){var e;const i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;const{clientX:n,clientY:r}=t,s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];Rp(n.button)&&(n.button=0),Rp(n.buttons)&&(n.buttons=1),Rp(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),Rp(n.width)&&(n.width=n.radiusX||1),Rp(n.height)&&(n.height=n.radiusY||1),Rp(n.tiltX)&&(n.tiltX=0),Rp(n.tiltY)&&(n.tiltY=0),Rp(n.pointerType)&&(n.pointerType="touch"),Rp(n.pointerId)&&(n.pointerId=n.identifier||0),Rp(n.pressure)&&(n.pressure=n.force||.5),Rp(n.twist)&&(n.twist=0),Rp(n.tangentialPressure)&&(n.tangentialPressure=0),Rp(n.layerX)&&(n.layerX=n.offsetX=n.clientX),Rp(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const i=t;Rp(i.isPrimary)&&(i.isPrimary=!0),Rp(i.width)&&(i.width=1),Rp(i.height)&&(i.height=1),Rp(i.tiltX)&&(i.tiltX=0),Rp(i.tiltY)&&(i.tiltY=0),Rp(i.pointerType)&&(i.pointerType="mouse"),Rp(i.pointerId)&&(i.pointerId=1),Rp(i.pressure)&&(i.pressure=.5),Rp(i.twist)&&(i.twist=0),Rp(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Py[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Ty.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetElement(t){let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);return e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}const My=(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"},ky=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};class Ry{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Ry.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 Oy{static Avaliable(){return!0}avaliable(){return Oy.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 Dy{static Avaliable(){return!!fv.global.getRequestAnimationFrame()}avaliable(){return Dy.Avaliable()}tick(t,e){fv.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var Iy;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Iy||(Iy={}));class Ly{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Iy.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=Iy.INITIAL,fv.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),fv.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:Dy},{mode:"timeout",cons:Oy},{mode:"manual",cons:Ry}];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 Dy;break;case"timeout":t=new Oy;break;case"manual":t=new Ry;break;default:console.warn("非法的计时器模式"),t=new Dy}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!==Iy.INITIAL&&(this.status=Iy.PAUSE,!0)}resume(){return this.status!==Iy.INITIAL&&(this.status=Iy.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Iy.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Iy.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=Iy.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Iy.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Uy{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-Uy.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Uy.bounceIn(2*t):.5*Uy.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Kp*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Kp/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Kp*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Kp/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Kp*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Kp/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Kp/e)*.5+1}}}Uy.quadIn=Uy.getPowIn(2),Uy.quadOut=Uy.getPowOut(2),Uy.quadInOut=Uy.getPowInOut(2),Uy.cubicIn=Uy.getPowIn(3),Uy.cubicOut=Uy.getPowOut(3),Uy.cubicInOut=Uy.getPowInOut(3),Uy.quartIn=Uy.getPowIn(4),Uy.quartOut=Uy.getPowOut(4),Uy.quartInOut=Uy.getPowInOut(4),Uy.quintIn=Uy.getPowIn(5),Uy.quintOut=Uy.getPowOut(5),Uy.quintInOut=Uy.getPowInOut(5),Uy.backIn=Uy.getBackIn(1.7),Uy.backOut=Uy.getBackOut(1.7),Uy.backInOut=Uy.getBackInOut(1.7),Uy.elasticIn=Uy.getElasticIn(1,.3),Uy.elasticOut=Uy.getElasticOut(1,.3),Uy.elasticInOut=Uy.getElasticInOut(1,.3*1.5);class Wy{constructor(){this.id=yy.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){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),t.release()}}const Ny=new Wy;class Fy{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(i,this.step.getLastProps()),this.onUpdate(t,e,i),t&&this.onEnd()}}class jy extends Fy{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class zy{constructor(e=yy.GenAutoIncrementId(),i=Ny){this.id=e,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new Hy(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.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=Qp(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){zy.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e,i=zy.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 jy((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const o=zy.interpolateMap.get(t)||zy.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 Hy(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()}}zy.mode=t.AnimateMode.NORMAL,zy.interpolateMap=new Map;class Hy{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 Gy(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?Uy[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?Uy[n]:n,o=this._addStep(i,null,s);return o.type=t.AnimateStepType.to,this._appendProps(e,o,!!r&&r.tempProps),o.propKeys||(o.propKeys=Object.keys(o.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(o.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new Gy(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,o,a=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0)return a=!0,a;if(s=Math.floor(t/i),o=t-s*i,a=t>=n*i+i,a&&(o=i,s=n,t=o*s+i),t===r)return a;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let o=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Gy{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Vy={duration:200,easing:"cubicOut"},Xy={duration:1e3,easing:"quadInOut"};var Yy;t.Edge=void 0,(Yy=t.Edge||(t.Edge={}))[Yy.Top=1]="Top",Yy[Yy.Right=2]="Right",Yy[Yy.Bottom=4]="Bottom",Yy[Yy.Left=8]="Left",Yy[Yy.ALL=15]="ALL";const qy=[!1,!1,!1,!1],Ky=t=>{var e;let i=!0;if(_p(t,!0)){for(let n=0;n<4;n++)qy[n]=t,i&&(i=!(null!==(e=qy[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)qy[e]=!!t[e],i&&(i=!!qy[e]);else qy[0]=!1,qy[1]=!1,qy[2]=!1,qy[3]=!1;return{isFullStroke:i,stroke:qy}},$y=[0,0,0,0],Zy=t=>t?Dp(t)?0===t.length?0:1===t.length?t[0]:2===t.length?($y[0]=t[0],$y[2]=t[0],$y[1]=t[1],$y[3]=t[1],$y):t:t:0,Jy=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qy=[1,2,3,0,1,2,3,0];function tm(t,e,i,n){for(;t>=Kp;)t-=Kp;for(;t<0;)t+=Kp;for(;t>e;)e+=Kp;Jy[0].x=i,Jy[1].y=i,Jy[2].x=-i,Jy[3].y=-i;const r=Math.ceil(t/Yp)%4,s=Math.ceil(e/Yp)%4;if(n.add(Jp(t)*i,ef(t)*i),n.add(Jp(e)*i,ef(e)*i),r!==s||e-t>Xp){let t=!1;for(let e=0;e<Qy.length;e++)if(t||r!==Qy[e]){if(t&&s===Qy[e])break;if(t){const t=Jy[Qy[e]];n.add(t.x,t.y)}}else{t=!0;const e=Jy[r];n.add(e.x,e.y)}}}function em(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function im(t,e,i){const{x:n,y:r}=af(t.x,t.y,e.x,e.y,i),{x:s,y:o}=af(t.x1,t.y1,e.x1,e.y1,i),a=new lf(n,r,s,o);return a.defined=e.defined,a}function nm(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 lf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=im(t[r],e[r],i)}else{n=e.map((t=>{const e=new lf(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=im(t[r],e[r],i)}return n}const rm=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],sm=t=>rm.includes(t);function om(t,e){if(Dp(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class am{constructor(){this.durations=[],this.timeout=am.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}am.TimeOut=1e3/60;const hm=new am;var lm;!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"}(lm||(lm={}));class cm extends Fy{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function um(t,e,i,n,r,s){const o=(e-t)*r+t,a=(i-e)*r+e,h=(n-i)*r+i,l=(a-o)*r+o,c=(h-a)*r+a,u=(c-l)*r+l;s[0]=t,s[1]=o,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function dm(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],o=i<n?t:e,a=Math.min(i,n),h=Math.abs(n-i)/6,l=(a-2)/6,c=Math.ceil(h/l),u=[o[0],o[1]];let d=h;for(let t=2;t<a;t+=6){let e=o[t-2],i=o[t-1],n=o[t],a=o[t+1],h=o[t+2],l=o[t+3];const p=o[t+4],f=o[t+5];if(d<=0){u.push(n,a,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const o=t/g;um(e,n,h,p,o,r),um(i,a,l,f,o,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],a=s[5],h=r[6],l=s[6]}d-=g-1}return o===t?[u,e]:[t,u]}function pm(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 fm(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 gm(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 vm(t,e,i,n){const r=(t.length-2)/6;let s=1/0,o=0;const a=t.length,h=a-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<a;s+=2){const o=0===s?r:(r+s-2)%h+2,a=t[o]-i[0],l=t[o+1]-i[1],u=e[s]-n[0]-a,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,o=l)}return o}function ym(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=gm(a),c=gm(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=a.length;s&&(a=fm(a));const y=6*vm(a,h,l,c),m=v-2;for(let t=0;t<m;t+=2){const e=(y+t)%m+2;u[t+2]=a[e]-l[0],u[t+3]=a[e+1]-l[1]}if(u[0]=a[y]-l[0],u[1]=a[y+1]-l[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<a.length;e+=2){const r=u[e],s=u[e+1],o=h[e]-c[0],a=h[e+1]-c[1],l=o*i-a*t,d=o*t+a*i;g[e]=l,g[e+1]=d;const p=l-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<v;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function mm(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]=dm(a,h),i=l,n=c):(c=pm(n,a),l=a):(l=pm(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const bm=(t,e,i,n,r)=>{Gp(e,n)&&Gp(i,r)||t.push(e,i,n,r,n,r)};function xm(t){const e=t.commandList,i=[];let n,r=0,s=0,o=0,a=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(o=r=i[1],a=s=i[2],[Uf.L,Uf.C,Uf.Q].includes(i[0])&&(n=[o,a])),i[0]){case Uf.M:r=o=i[1],s=a=i[2],h(o,a);break;case Uf.L:l=i[1],c=i[2],bm(n,r,s,l,c),r=l,s=c;break;case Uf.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Uf.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Uf.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(o=l,a=c,h(o,a)):bm(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const y=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=y){const r=v?Math.max(i+y,g):Math.min(i+y,g);ig(n,i,r,t,e,u,d)}break}case Uf.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,y=!!i[8],m=!Gp(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,S=Math.sin(g)*d;m?(l=w*b-S*x+t,c=w*x+S*b+e):(l=w+t,c=S+e),p?(o=l,a=c,h(o,a)):bm(n,r,s,l,c),w=Math.cos(v)*u,S=Math.sin(v)*d,m?(r=w*b-S*x+t,s=w*x+S*b+e):(r=w+t,s=S+e);const A=(y?-1:1)*Math.PI/2;for(let i=g;y?i>v:i<v;i+=A){const r=y?Math.max(i+A,v):Math.min(i+A,v);if(ig(n,i,r,t,e,u,d),m){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],S=n[r+1],n[r]=(w-t)*b-(S-e)*x+t,n[r+1]=(w-t)*x+(S-e)*b+e}}break}case Uf.R:o=r=i[1],a=s=i[2],l=o+i[3],c=a+i[4],h(l,a),bm(n,l,a,l,c),bm(n,l,c,o,c),bm(n,o,c,o,a),bm(n,o,a,l,a);break;case Uf.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=cf.distancePP({x:r,y:s},{x:t,y:e}),d=cf.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,y=cf.distancePP({x:g,y:v},{x:0,y:0}),m=t+f*g/y,b=h+f*v/y,x=Math.sqrt(f*f-c*c);o=t+x*(r-t)/u,a=e+x*(s-e)/u,bm(n,r,s,o,a),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const w=gf({x:m,y:b},{x:o,y:a}),S=gf({x:m,y:b},{x:r,y:s});ig(n,w,S,m,b,c,c);break}case Uf.Z:n&&bm(n,r,s,o,a),r=o,s=a}}return n&&n.length>2&&i.push(n),i}function wm(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 Sm(t){const e=new jg;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}function Am(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 Tm=(t,e)=>{const i=t.getComputedAttribute("width"),n=t.getComputedAttribute("height"),r=Am(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},Bm=(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=Am(a*(s+o)/2,h,e),c=[],u=h/l.length,d=o>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=a/e;for(let r=0;r<e;r++)c.push({innerRadius:o-u*t*d,outerRadius:o-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Cm=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),o=Am(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},_m=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(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},Pm=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const o=r.segments;s||(s=o.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const a=s.filter((t=>!1!==t.defined&&Ip(t.x)&&Ip(t.y)));if(!a.length)return[];const h=[];a.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=a.length-1;t>=0;t--){const e=a[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return Om(s,e,l),l},Em=(t,e)=>{const i=t.attribute,n=i.points;if(n)return _m(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return _m(t,e)}return[]};const Mm=t=>t.map((t=>({x:t.x,y:t.y}))),km=(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=_f([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[Mm(t),Mm(t)];r.sort(((t,e)=>t.dot-e.dot));let a=r[0],h=r[r.length-1];a.edgeIndex>h.edgeIndex&&([a,h]=[h,a]);const l=a.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=a.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=a.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:l.x,y:l.y}),[u,d]},Rm=t=>{const e=new df;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 km(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return km(t,{x:e.x1,y:r},{x:e.x2,y:r})},Om=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Rm(t);Om(r[0],n,i),Om(r[1],e-n,i)}},Dm=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:Mm(i)}];const n=[];return Om(i,e,n),n},Im=(t,e)=>{const i=xm(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:Sm(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]});Om(e,t===n-1?o:s,r),o-=s}return r};var Lm={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const Um={};for(const t in Lm)Np(Lm,t)&&(Um[Lm[t]]=t);const Wm={to:{},get:{}};function Nm(t,e,i){return Math.min(Math.max(e,t),i)}function Fm(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Wm.get=function(t,e=[0,0,0,1]){let i,n;switch(t.substring(0,3).toLowerCase()){case"hsl":i=Wm.get.hsl(t,e),n="hsl";break;case"hwb":i=Wm.get.hwb(t,e),n="hwb";break;default:i=Wm.get.rgb(t,e),n="rgb"}return i?{model:n,value:i}:null},Wm.get.rgb=function(t,e=[0,0,0,1]){if(!t)return null;const i=e;let n,r,s;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(s=n[2],n=n[1],r=0;r<3;r++){const t=2*r;i[r]=parseInt(n.slice(t,t+2),16)}s&&(i[3]=Math.round(parseInt(s,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],s=n[3],r=0;r<3;r++)i[r]=parseInt(n[r]+n[r],16);s&&(i[3]=Math.round(parseInt(s+s,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(n[r+1],10);n[4]&&(i[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(n=t.match(/(\D+)/)){if("transparent"===n[1])return[0,0,0,0];const t=Lm[n[1]];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i?(i[3]=1,i):null}return null}for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(n[r+1]));n[4]&&(i[3]=parseFloat(n[4]))}for(r=0;r<3;r++)i[r]=Nm(i[r],0,255);return i[3]=Nm(i[3],0,1),i},Wm.get.hsl=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])+360)%360,e[1]=Nm(parseFloat(i[2]),0,100),e[2]=Nm(parseFloat(i[3]),0,100),e[3]=Nm(isNaN(t)?1:t,0,1),e}return null},Wm.get.hwb=function(t,e=[0,0,0,1]){if(!t)return null;const i=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(i){const t=parseFloat(i[4]);return e[0]=(parseFloat(i[1])%360+360)%360,e[1]=Nm(parseFloat(i[2]),0,100),e[2]=Nm(parseFloat(i[3]),0,100),e[3]=Nm(isNaN(t)?1:t,0,1),e}return null},Wm.to.hex=function(...t){const e=t;return"#"+Fm(e[0])+Fm(e[1])+Fm(e[2])+(e[3]<1?Fm(Math.round(255*e[3])):"")},Wm.to.rgb=function(...t){const e=t;return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Wm.to.rgb.percent=function(...t){const e=t,i=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+i+"%, "+n+"%, "+r+"%)":"rgba("+i+"%, "+n+"%, "+r+"%, "+e[3]+")"},Wm.to.hsl=function(...t){const e=t;return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Wm.to.hwb=function(...t){const e=t;let i="";return e.length>=4&&1!==e[3]&&(i=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+i+")"},Wm.to.keyword=function(t){return Um[t.slice(0,3)]};const jm=Wm;var zm;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(zm||(zm={}));class Hm{static Get(t,e=zm.Color1,i=[0,0,0,1]){if(e===zm.Color1){let e=Hm.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;if(e=Wm.get(t),e&&e.value){const n=e.value,r=[n[0]/255,n[1]/255,n[2]/255,n[3]];Hm.store1[t]=r,Hm.store255[t]=n,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3]}return i}let n=Hm.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;if(n=Wm.get(t),n&&n.value){const e=n.value;Hm.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Hm.store255[t]=e,i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}static Set(t,e,i){if(e===zm.Color1){if(Hm.store1[t])return;Hm.store1[t]=i,Hm.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Hm.store255[t])return;Hm.store255[t]=i,Hm.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Gm(t,e=!1){return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Vm(t,e,i,n,r){if(!t||!e)return t&&Gm(t)||e&&Gm(e)||!1;let s,o,a=!1,h=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Hm.Get(t,zm.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Hm.Get(e,zm.Color255):h=!0,a!==h){const s=a?t:e,o=a?e:t,h=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:Gm(o)})))});return a?Vm(s,h,i,n,r):Vm(h,s,i,n,r)}if(a){if(t.gradient===e.gradient){const n=t,r=e,s=n.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={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:qm(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={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:qm(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,r=e.stops,s={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:qm(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))};return s}(n,r,i)}return!1}r&&r(s,o);const l=function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(s,o,i);return Gm(l,n)}Hm.store255={},Hm.store1={};const Xm=[0,0,0,0],Ym=[0,0,0,0];function qm(t,e,i){return Hm.Get(t,zm.Color255,Xm),Hm.Get(e,zm.Color255,Ym),`rgba(${Math.round(Xm[0]+(Ym[0]-Xm[0])*i)},${Math.round(Xm[1]+(Ym[1]-Xm[1])*i)},${Math.round(Xm[2]+(Ym[2]-Xm[2])*i)},${Xm[3]+(Ym[3]-Xm[3])*i})`}const Km=(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=Vm(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},$m=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const o=t[s],a=o.from,h=o.to,l=o.rotation*i,c=o.fromCp,u=o.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<a.length;t+=2){const e=a[t],s=a[t+1],o=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=o*p-l*d+r[0],n[t+1]=o*d+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<a.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],o=n[t+3],a=n[t+4],h=n[t+5];f===i&&g===r&&s===a&&o===h?e.lineTo(a,h):e.bezierCurveTo(i,r,s,o,a,h),f=a,g=h}}},Zm=(t,e,i)=>{const n=t?xm(t):[],r=xm(e);i&&n&&(i.fromTransform&&wm(n,i.fromTransform.clone().getInverse()),wm(n,i.toTransfrom));const[s,o]=mm(n,r);return t?ym(s,o,10,Math.PI):o.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},Jm=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],Qm=(t,e)=>{if(!t||!e)return null;const i=[];let n=!1;return Object.keys(t).forEach((r=>{if(!Jm.includes(r))return;const s=e[r];Ep(s)||Ep(t[r])||s===t[r]||("fill"===r||"stroke"===r?i.push({from:"string"==typeof t[r]?Hm.Get(t[r],zm.Color255):t[r],to:"string"==typeof s?Hm.Get(s,zm.Color255):s,key:r}):i.push({from:t[r],to:s,key:r}),n=!0)})),n?i:null};class tb extends Fy{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;$m(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&Km(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const eb=(t,e,i,n)=>{var r,s,o;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let a=null==t?void 0:t.globalTransMatrix;n&&a&&(a=n.clone().multiply(a.a,a.b,a.c,a.d,a.e,a.f));const h=Zm(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:a,toTransfrom:e.globalTransMatrix}),l=Qm(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new tb({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:Xy.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:Xy.easing)),c};class ib extends Fy{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;$m(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&Km(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const nb=t=>{const e={};return Object.keys(t).forEach((i=>{sm(i)||(e[i]=t[i])})),e},rb=(t,e,i)=>{const n=nb(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=fv.graphicService.creator.rect({x:0,y:0,width:o,height:a});r.appendChild(i),e.push(i)}))}},sb=(t,e,i)=>{const n=[],r=i?null:nb(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new jg).fromCustomPath2D(s)};n.push(fv.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&rb(t,n,e),n},ob=(t,e,i)=>{const n=[],r=i?null:nb(t.attribute);if("rect"===t.type){Tm(t,e).forEach((t=>{n.push(fv.graphicService.creator.rect(i?t:Object.assign({},r,t)))}))}else if("arc"===t.type){Bm(t,e).forEach((t=>{n.push(fv.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("circle"===t.type){Cm(t,e).forEach((t=>{n.push(fv.graphicService.creator.arc(i?t:Object.assign({},r,t)))}))}else if("line"===t.type){const s=Em(t,e),o={size:10,symbolType:"circle"};s.forEach((t=>{n.push(fv.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else if("polygon"===t.type){Dm(t,e).forEach((t=>{n.push(fv.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("area"===t.type){Pm(t,e).forEach((t=>{n.push(fv.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}else if("path"===t.type){Im(t,e).forEach((t=>{"path"in t?n.push(fv.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(fv.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}))}return i&&rb(t,n,e),n};class ab{static GetImage(t,e){var i;let n=ab.cache.get(t);n?"fail"===n.loadState?fv.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&fv.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},ab.cache.set(t,n),n.dataPromise=fv.global.loadImage(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var i;let n=ab.cache.get(t);n?"fail"===n.loadState?fv.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&fv.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,n.data)})):(n={type:"image",loadState:"init"},ab.cache.set(t,n),n.dataPromise=fv.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))}))}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=ab.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"},ab.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=fv.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=fv.global.loadBlob(t):"json"===e&&(i.dataPromise=fv.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}}ab.cache=new Map;const hb=new Bf,lb=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],cb=["x","y"],ub=["scaleX","scaleY"],db=["angle"],pb=new lf;class fb extends my{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(fb.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(e={}){super(),this._AABBBounds=new pf,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),e.background&&this.loadImage(e.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){const{dx:i=t.dx,dy:n=t.dy}=this.attribute;if(e&&this.parent){const t=gy(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;pb.x=i+e,pb.y=n+r}else pb.x=i,pb.y=n;return pb}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;fv.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return fv.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Bf),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new lf(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):Ep(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<lb.length;e++){const i=lb[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<lb.length;e++){if(t===lb[e])return!0}return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background&&this.loadImage(e.background,!0),this._updateTag=t.UpdateTag.INIT,this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,cb,s);o&&(e=o.x,i=o.y,delete o.x,delete o.y,this._setAttributes(o));const a=this.attribute,h=a.postMatrix;return h?fv.transformUtil.fromMatrix(h,h).translate(e,i):(a.x=(null!==(n=a.x)&&void 0!==n?n:Vg.x)+e,a.y=(null!==(r=a.y)&&void 0!==r?r:Vg.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,cb,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const o={type:t.AttributeUpdateType.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,ub,o);a&&(e=a.scaleX,i=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new Bf,h.postMatrix=t),fv.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Vg.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Vg.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(o),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,ub,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this)}rotate(e){var i;if(0===e)return this;const n={type:t.AttributeUpdateType.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,db,n);if(r)return this._setAttributes(r,!1,n),this;const s=this.attribute;return s.angle=(null!==(i=s.angle)&&void 0!==i?i:Vg.angle)+e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),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,db,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new zy(null==t?void 0:t.id).bind(this);if(t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){fv.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)&&(!!Ep(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,o,a,h;if(n){const t=Object.keys(e),n=r?t.reduce(((t,i)=>(t[i]=void 0===e[i]?this.getDefaultAttribute(i):e[i],t)),{}):e,l=this.animate();l.stateNames=i,l.to(n,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==o?o:Vy.duration,null!==(h=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==h?h:Vy.easing)}else this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();Np(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else{if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}doUpdateLocalMatrix(){const{x:t=Vg.x,y:e=Vg.y,scaleX:i=Vg.scaleX,scaleY:n=Vg.scaleY,angle:r=Vg.angle,anchor:s,postMatrix:o}=this.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=this.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=this.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}!function(t,e,i,n,r,s,o,a){var h,l,c=e.a,u=e.b,d=e.c,p=e.d,f=e.e,g=e.f,v=Jp(o),y=ef(o);a?(h=a[0],l=a[1]):(h=i,l=n);var m=h-i,b=l-n,x=c*v+d*y,w=u*v+p*y,S=d*v-c*y,A=p*v-u*y;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=f+c*h+d*l-x*m-S*b,t.f=g+u*h+p*l-w*m-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,s&&a);const h=this.getOffsetXY(Vg);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,o){const t=hb.setValue(o.a,o.b,o.c,o.d,o.e,o.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){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),fv.graphicService.onSetStage(this,t))}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const o={};if(n.customAnimate)n.customAnimate.update(s,r,o);else{const t=n.props,a=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,o,n,r,s,t,void 0,a,h)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=o[s],u=null!==(l=a&&a[s])&&void 0!==l?l:t.getLastPropByName(s,n);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const o=r.fillColorArray,a=Vm(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){r||(r={});const o=r.strokeColorArray,a=Vm(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){r||(r={});const o=r.shadowColorArray,a=Vm(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(n[i]=a),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return gy(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:fv.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 Op(t,!0)?this.pathProxy=(new jg).fromString(t):this.pathProxy=new jg,this.pathProxy}loadImage(t,e=!1){if(!t)return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};var r;this.resources.set(i,n),"string"==typeof t?(n.state="loading",r=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(r)||function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)}(t)?(ab.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(ab.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Ay(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}function gb(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}fb.mixin(_y);let vb=0;function yb(){return vb++}var mb;function bb(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)Sb(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,(mb=t.TextDirection||(t.TextDirection={}))[mb.HORIZONTAL=0]="HORIZONTAL",mb[mb.VERTICAL=1]="VERTICAL";const xb=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>xb.set(t,!0)));const wb=new Map;function Sb(t){if(xb.has(t))return!0;if(wb.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>wb.set(t,!0)));const Ab=yb(),Tb=yb(),Bb=yb(),Cb=yb(),_b=yb(),Pb=yb(),Eb=yb(),Mb=yb(),kb=yb(),Rb=yb(),Ob=yb(),Db=yb(),Ib=yb(),Lb=yb(),Ub=yb(),Wb=yb(),Nb=Symbol.for("GraphicService"),Fb=Symbol.for("GraphicCreator");var jb;t.GroupUpdateAABBBoundsMode=void 0,(jb=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[jb.LESS_GROUP=0]="LESS_GROUP",jb[jb.MORE_GROUP=1]="MORE_GROUP";class zb extends fb{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Pb,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 py),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new py)}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 lf(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;fv.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return fv.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=gy(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=fv.graphicService.updateGroupAABBBounds(t,gy(this).group,this._AABBBounds,this),{boundsPadding:n=e.boundsPadding}=t,r=Zy(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(),fv.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),fv.graphicService.onClearIncremental(this,this.stage)}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){const i=super.insertBefore(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertAfter(t,e){const i=super.insertAfter(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertInto(t,e){const i=super.insertInto(t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}removeChild(t){const e=super.removeChild(t);return t.stage=null,fv.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{fv.graphicService.onRemove(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),fv.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=fv.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new zb(Object.assign({},this.attribute))}}const Hb=Symbol.for("LayerHandlerContribution");class Gb extends zb{get offscreen(){return this.layerHandler.offscreen}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=_v.get(Hb),this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new py,this.background="rgba(0, 0, 0, 0)",this.virtual=!!n.virtual,this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{fv.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}render(t,e){var i;const n=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:n.x,y:n.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){throw new Error("暂不支持")}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var i;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{fv.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}t.DefaultLayerService=class{constructor(t){this.global=t,this.layerMap=new Map}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}createLayer(t,e={main:!1}){this.tryInit();const i=new Gb(t,this.global,t.window,Object.assign(Object.assign({},e),{virtual:0===this.staticLayerCountInEnv})),n=this.layerMap.get(t)||[];return n.push(i),this.layerMap.set(t,n),this.staticLayerCountInEnv--,i}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}},t.DefaultLayerService=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],t.DefaultLayerService);const Vb=Symbol.for("VWindow"),Xb=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(t){this.global=t,this.hooks={onChange:new xp(["x","y","width","height"])},this._uid=yy.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;if(!t.env||this.actived)return;_v.getNamed(Xb,t.env).configure(this,t),this.actived=!0}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultWindow.prototype,"postInit",null),t.DefaultWindow=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],t.DefaultWindow);const Yb=Symbol.for("TransformUtil"),qb=Symbol.for("GraphicUtil"),Kb=Symbol.for("LayerService");var $b=new Qd((e=>{e(t.DefaultGlobal).toSelf().inSingletonScope(),e(Sp).toService(t.DefaultGlobal),e(t.DefaultWindow).to(t.DefaultWindow),e(Vb).toService(t.DefaultWindow),e(t.DefaultGraphicUtil).toSelf().inSingletonScope(),e(qb).toService(t.DefaultGraphicUtil),e(t.DefaultTransformUtil).toSelf().inSingletonScope(),e(Yb).toService(t.DefaultTransformUtil),e(t.DefaultLayerService).toSelf().inSingletonScope(),e(Kb).toService(t.DefaultLayerService)}));function Zb(t,e){return!(!t&&!e)}function Jb(t,e){let i;return i=Dp(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Qb(t,e,i){return i&&t*e>0}function tx(t,e,i,n,r){return r&&t*e>0&&i>0&&n>0}function ex(t,e){return t*e>0}function ix(t,e,i,n){return t*e>0&&i>0&&n>0}function nx(t,e,i,n,r,s,o,a){if(!t.pathProxy)return!1;const h=gy(t,null==s?void 0:s.theme)[t.type],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible}=t.attribute,v=Qb(u,d,l),y=ex(u,f),m=Zb(l),b=Jb(c,p);if(!g)return!0;if(!m&&!b)return!0;if(!(v||y||o||a))return!0;e.beginPath();return rg(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),b&&(a?a(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),m&&(o?o(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fill())),!0}function rx(t,e,i,n,r,s,o,a){const h=i-t,l=n-e,c=o-r,u=a-s;let d=u*h-c*l;return d*d<Vp?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function sx(t,e,i,n,r,s,o){const a=t-i,h=e-n,l=(o?s:-s)/Math.sqrt(a*a+h*h),c=l*h,u=-l*a,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,y=(p+g)/2,m=f-d,b=g-p,x=m*m+b*b,w=r-s,S=d*g-f*p,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let T=(S*b-m*A)/x,B=(-S*m-b*A)/x;const C=(S*b+m*A)/x,_=(-S*m+b*A)/x,P=T-v,E=B-y,M=C-v,k=_-y;return P*P+E*E>M*M+k*k&&(T=C,B=_),{cx:T,cy:B,x01:-c,y01:-u,x11:T*(r/w-1),y11:B*(r/w-1)}}function ox(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=$p(h-a),c=h>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=Vp)e.moveTo(i,n);else if(l>=Kp-Vp)e.moveTo(i+r*Jp(a),n+r*ef(a)),e.arc(i,n,r,a,h,!c),s>Vp&&(e.moveTo(i+s*Jp(h),n+s*ef(h)),e.arc(i,n,s,h,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:p,innerDeltaAngle:f,outerStartAngle:g,outerEndAngle:v,innerEndAngle:y,innerStartAngle:m}=t.getParsePadAngle(a,h),b=d,x=d,w=d,S=d,A=Math.max(x,b),T=Math.max(w,S);let B=A,C=T;const _=r*Jp(g),P=r*ef(g),E=s*Jp(y),M=s*ef(y);let k,R,O,D;if((T>Vp||A>Vp)&&(k=r*Jp(v),R=r*ef(v),O=s*Jp(m),D=s*ef(m),l<Xp)){const t=rx(_,P,O,D,k,R,E,M);if(t){const e=_-t[0],i=P-t[1],n=k-t[0],o=R-t[1],a=1/ef(sf((e*n+i*o)/(nf(e*e+i*i)*nf(n*n+o*o)))/2),h=nf(t[0]*t[0]+t[1]*t[1]);C=tf(T,(s-h)/(a-1)),B=tf(A,(r-h)/(a+1))}}if(p<.001)o&&(o[3]||o[1])&&e.moveTo(i+_,n+P),u=!0;else if(B>Vp){const t=tf(b,B),s=tf(x,B),a=sx(O,D,_,P,r,t,Number(c)),h=sx(k,R,E,M,r,s,Number(c));B<A&&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,Zp(a.y01,a.x01),Zp(h.y01,h.x01),!c)):e.moveTo(i+a.cx+B*Jp(Zp(h.y01,h.x01)),n+a.cy+B*ef(Zp(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,Zp(a.y01,a.x01),Zp(a.y11,a.x11),!c),e.arc(i,n,r,Zp(a.cy+a.y11,a.cx+a.x11),Zp(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,Zp(h.y11,h.x11),Zp(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*Jp(Zp(h.y01,h.x01)),n+h.cy+s*ef(Zp(h.y01,h.x01))):e.moveTo(i+k,n+r*ef(v))}else o&&!o[0]||(e.moveTo(i+_,n+P),e.arc(i,n,r,g,v,!c));if(!(s>Vp)||f<.001)!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),u=!0;else if(C>Vp){const t=tf(S,C),r=tf(w,C),a=sx(E,M,k,R,s,-r,Number(c)),h=sx(_,P,O,D,s,-t,Number(c));if(!o||o[1]?e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01):e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),C<T&&t===r){const t=Zp(h.y01,h.x01);!o||o[2]?e.arc(i+a.cx,n+a.cy,C,Zp(a.y01,a.x01),t,!c):e.moveTo(i+a.cx+Jp(t),n+a.cy+ef(t))}else!o||o[2]?(r>0&&e.arc(i+a.cx,n+a.cy,r,Zp(a.y01,a.x01),Zp(a.y11,a.x11),!c),e.arc(i,n,s,Zp(a.cy+a.y11,a.cx+a.x11),Zp(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,Zp(h.y11,h.x11),Zp(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*Jp(Zp(h.y01,h.x01)),n+h.cy+t*ef(Zp(h.y01,h.x01))):e.moveTo(i+O,n+D)}else!o||o[1]?e.lineTo(i+E,n+M):e.moveTo(i+E,n+M),!o||o[2]?e.arc(i,n,s,y,m,c):e.moveTo(i+s*Jp(m),n+s*ef(m))}return o?o[3]&&e.lineTo(i+r*Jp(h),n+r*Jp(h)):e.closePath(),u}class ax{static GetCanvas(){try{return ax.canvas||(ax.canvas=fv.global.createCanvas({})),ax.canvas}catch(t){return null}}static GetCtx(){if(!ax.ctx){const t=ax.GetCanvas();ax.ctx=t.getContext("2d")}return ax.ctx}}class hx{constructor(t=[],e=100){const i=ax.GetCanvas(),n=ax.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}static GetOrCreate(t=[],e=100){let i="";t.forEach((t=>i+=t.join())),i+=e;let n=hx.dataMap.get(i);return n||(n=new hx(t,e),hx.dataMap.set(i,n)),n}static SetColorInterpolateInstance(t,e){hx.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return hx.dataMap.get(t)}}hx.dataMap=new Map;class lx{static GetSize(t){for(let e=0;e<lx.ImageSize.length;e++)if(lx.ImageSize[e]>=t)return lx.ImageSize[e];return t}static Get(t,e,i,n,r,s,o){const a=lx.GenKey(t,e,i,n,r),h=lx.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=lx.GenKey(t,e,i,n,r);lx.cache[h]?lx.cache[h].push({width:o,height:a,pattern:s}):lx.cache[h]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function cx(t,e,i,n){const{stops:r,startAngle:s,endAngle:o}=n;for(;i<0;)i+=Kp;for(;i>Kp;)i-=Kp;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),Vm(a.color,h.color,l,!1)}function ux(t,e,i,n,r,s,o,a,h){const l=Math.floor(180*r/Math.PI),c=ax.GetCanvas(),u=ax.GetCtx();if(!u)return null;const d=lx.GetSize(a),p=lx.GetSize(h);let f=lx.Get(e,i,n,s,o,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=l+1,y=r/Math.max(1,v-1),m=hx.GetOrCreate(e,v),b=2*Math.PI*g/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*y>o);t++){const e=m.getColor(t);u.beginPath(),u.rotate(y),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&lx.Set(e,i,n,s,o,f,d,p),f}lx.cache={},lx.ImageSize=[20,40,80,160,320,640,1280,2560];const dx=Symbol.for("ArcRenderContribution"),px=Symbol.for("AreaRenderContribution"),fx=Symbol.for("CircleRenderContribution"),gx=Symbol.for("GroupRenderContribution"),vx=Symbol.for("ImageRenderContribution"),yx=Symbol.for("PathRenderContribution"),mx=Symbol.for("PolygonRenderContribution"),bx=Symbol.for("RectRenderContribution"),xx=Symbol.for("SymbolRenderContribution"),Sx=Symbol.for("TextRenderContribution"),Ax=Symbol.for("InteractiveSubRenderContribution");t.DefaultCanvasArcRender=class{constructor(t){this.arcRenderContribitions=t,this.numberType=Ab}drawArcTailCapPath(t,e,i,n,r,s,o,a){const h=a-o,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=a;const d=$p(u-c),p=u>c;let f=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:v,innerDeltaAngle:y,outerStartAngle:m,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,u),S=g,A=g,T=g,B=g,C=Math.max(A,S),_=Math.max(T,B);let P=C,E=_;const M=r*Jp(m),k=r*ef(m),R=s*Jp(x),O=s*ef(x);let D,I,L,U;if((_>Vp||C>Vp)&&(D=r*Jp(b),I=r*ef(b),L=s*Jp(w),U=s*ef(w),d<Xp)){const t=rx(M,k,L,U,D,I,R,O);if(t){const e=M-t[0],i=k-t[1],n=D-t[0],o=I-t[1],a=1/ef(sf((e*n+i*o)/(nf(e*e+i*i)*nf(n*n+o*o)))/2),h=nf(t[0]*t[0]+t[1]*t[1]);E=tf(_,(s-h)/(a-1)),P=tf(C,(r-h)/(a+1))}}if(P>Vp){const t=tf(S,P),s=tf(A,P),o=sx(L,U,M,k,r,t,Number(p)),a=sx(D,I,R,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,Zp(o.y01,o.x01),Zp(a.y01,a.x01),!p);else{const t=u-h-.03,o=Zp(a.y11,a.x11);e.arc(i,n,r,t,o,!p),s>0&&e.arc(i+a.cx,n+a.cy,s,Zp(a.y11,a.x11),Zp(a.y01,a.x01),!p)}}else e.moveTo(i+M,n+k);if(!(s>Vp)||y<.001)e.lineTo(i+R,n+O),f=!0;else if(E>Vp){const t=tf(B,E),r=tf(T,E),o=sx(R,O,D,I,s,-r,Number(p)),a=sx(M,k,L,U,s,-t,Number(p));if(e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01),E<_&&t===r){const t=Zp(a.y01,a.x01);e.arc(i+o.cx,n+o.cy,E,Zp(o.y01,o.x01),t,!p)}else{r>0&&e.arc(i+o.cx,n+o.cy,r,Zp(o.y01,o.x01),Zp(o.y11,o.x11),!p);const t=Zp(o.cy+o.y11,o.cx+o.x11),a=u-h-.03;e.arc(i,n,s,t,a,p)}}else e.lineTo(i+s*Jp(w),n+s*ef(w));return f}drawShape(e,i,n,r,s,o,a,h){const l=gy(e,null==o?void 0:o.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:y=l.visible,x:m=l.x,y:b=l.y}=e.attribute,x=Qb(p,f,c),w=ex(p,v),S=Zb(c,u),A=Jb(d,g);if(!e.valid||!y)return;if(!S&&!A)return;if(!(x||w||a||h||u))return;const{outerRadius:T=l.outerRadius,innerRadius:B=l.innerRadius,cap:C=l.cap,forceShowCap:_=l.forceShowCap}=e.attribute;let P=!1;const{isFullStroke:E,stroke:M}=Ky(d);if(S||E){if(i.beginPath(),ox(e,i,n,r,T,B),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),S&&(a?a(i,e.attribute,l):x&&(i.setCommonStyle(e,e.attribute,m-n,b-r,l),i.fill())),A&&E&&(h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,m-n,b-r,l),i.stroke()))}if(!E&&A){if(i.beginPath(),ox(e,i,n,r,T,B,M),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)}))}h?h(i,e.attribute,l):w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke())}if(C&&_){const{startAngle:o,endAngle:c}=e.getParsedAngle();if($p(c-o)>=Kp-Vp){i.beginPath();const o=Math.abs(T-B)/2/T,{endAngle:c=l.endAngle,fill:u=l.fill}=e.attribute,d=c;if(this.drawArcTailCapPath(e,i,n,r,T,B,d,d+o),!P){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const e=this.arcRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._arcBeforeRenderContribitions.push(e):this._arcAfterRenderContribitions.push(e)}))}P=!0,this._arcBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)}))}if(S){const t=u;if("conical"===t.gradient){const s=cx(0,0,c,t);a||Qb&&(i.setCommonStyle(e,e.attribute,n,r,l),i.fillStyle=s,i.fill())}}A&&(h||w&&(i.setStrokeStyle(e,e.attribute,n,r,l),i.stroke()))}}this._arcAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,S,A,x,w,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=gy(t,null==n?void 0:n.theme).arc;r.highPerformanceSave();let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);nx(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasArcRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(dx)),fp("design:paramtypes",[Object])],t.DefaultCanvasArcRender),t.DefaultCanvasCircleRender=class{constructor(t){this.circleRenderContribitions=t,this.numberType=Cb}drawShape(e,i,n,r,s,o,a,h){const l=gy(e,null==o?void 0:o.theme).circle,{fill:c=l.fill,background:u,stroke:d=l.stroke,radius:p=l.radius,startAngle:f=l.startAngle,endAngle:g=l.endAngle,fillOpacity:v=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,opacity:m=l.opacity,lineWidth:b=l.lineWidth,visible:x=l.visible,x:w=l.x,y:S=l.y}=e.attribute,A=Qb(m,v,c),T=ex(m,y),B=Zb(c,u),C=Jb(d,b);e.valid&&x&&(B||C)&&(A||T||a||h||u)&&(i.beginPath(),i.arc(n,r,p,f,g),i.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),B&&(a?a(i,e.attribute,l):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,l),i.fill())),C&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,l),i.stroke())),this._circleRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).circle;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);nx(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasCircleRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(fx)),fp("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);const Tx=["radius","startAngle","endAngle",...lb];class Bx extends fb{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Cb}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=gy(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=fv.graphicService.updateCircleAABBBounds(i,gy(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Zy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return gy(this).circle[t]}needUpdateTags(t){for(let e=0;e<Tx.length;e++){const i=Tx[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Tx.length;e++){if(t===Tx[e])return!0}return!1}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),a=new jg;return a.arc(0,0,r,s,o),a}clone(){return new Bx(Object.assign({},this.attribute))}}function Cx(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*i+"px "+(a||"sans-serif")}function _x(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Px(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}class Ex{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,n,r,s,o,a,h){const l=[],c=[e,i],u=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);l.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===n||"start"===n||("center"===n?u[0]=c[0]/-2:"right"!==n&&"end"!==n||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,l,n,r,s)}GetLayoutByLines(t,e,i,n,r="",s,o){t=t.map((t=>t.toString()));const a=[],h=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,r,s).str,width:e});h[0]=o}else{let e,i;o=0;for(let n=0,r=t.length;n<r;n++)i=t[n],e=this.textMeasure.measureTextWidth(i,this.textOptions),o=Math.max(o,e),a.push({str:i,width:e});h[0]=o}h[1]=a.length*n;const l={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(l,e,i),this.layoutWithBBox(l,a,e,i,n)}layoutWithBBox(t,e,i,n,r){const s=[0,0],o=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-o)/2:"bottom"===n&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const Mx=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight",...lb];class kx extends fb{get font(){const t=gy(this).text;return this._font||(this._font=Cx(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=gy(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:n=i.maxLineWidth}=e;return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=gy(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:i=t.maxLineWidth}=e;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text)}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Wb,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=gy(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=this.attribute,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}updateSingallineAABBBounds(t){const e=gy(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=gy(this).text,{direction:i=e.direction}=this.attribute;return"horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e;const i=gy(this).text,n=fv.graphicUtil.textMeasure;let r,s;const o=this.attribute,{maxLineWidth:a=i.maxLineWidth,ellipsis:h=i.ellipsis,textAlign:l=i.textAlign,textBaseline:c=i.textBaseline,fontSize:u=i.fontSize,fontWeight:d=i.fontWeight,stroke:p=i.stroke,lineWidth:f=i.lineWidth,wordBreak:g=i.wordBreak}=o,v=Math.max(2,.075*u),{lineHeight:y=(null!==(e=o.lineHeight)&&void 0!==e?e:(o.fontSize||i.fontSize)+v)}=o;if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth;const t=_x(l,r),e=Px(c,y,u);return this._AABBBounds.set(t,e,t+r,e+y),p&&this._AABBBounds.expand(f/2),this._AABBBounds}if(Number.isFinite(a)){if(h){const e=!0===h?i.ellipsis:h,o=n.clipTextWithSuffix(t.toString(),{fontSize:u,fontWeight:d},a,e,"break-word"===g);s=o.str,r=o.width}else{const e=n.clipText(t.toString(),{fontSize:u,fontWeight:d},a,"break-word"===g);s=e.str,r=e.width}this.cache.clipedText=s,this.cache.clipedWidth=r}else r=n.measureTextWidth(t.toString(),{fontSize:u,fontWeight:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=r;this.clearUpdateShapeTag();const m=_x(l,r);let b=y;cC.isSafari()&&(b+=.2*u);const x=Px(c,b,u,v);return this._AABBBounds.set(m,x,m+r,x+b),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalSinglelineAABBBounds(e){var i;const n=gy(this).text,r=fv.graphicUtil.textMeasure;let s;const o=2,a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:p=n.fontWeight,stroke:f=n.stroke,lineHeight:g=(null!==(i=a.lineHeight)&&void 0!==i?i:(a.fontSize||n.fontSize)+o),lineWidth:v=n.lineWidth,wordBreak:y=n.wordBreak}=a;if(!this.shouldUpdateShape()&&this.cache){s=this.cache.clipedWidth;const t=_x(c,s),e=Px(u,g,d);return this._AABBBounds.set(e,t,e+g,t+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}let m=[bb(e.toString())];if(Number.isFinite(h)){if(l){const t=!0===l?n.ellipsis:l,e=r.clipTextWithSuffixVertical(m[0],{fontSize:d,fontWeight:p},h,t,"break-word"===y);m=[e.verticalList],s=e.width}else{const t=r.clipTextVertical(m[0],{fontSize:d,fontWeight:p},h,"break-word"===y);m=[t.verticalList],s=t.width}this.cache.verticalList=m,this.cache.clipedWidth=s}else s=0,m[0].forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?d:r.measureTextWidth(e.text,{fontSize:d,fontWeight:p});s+=i,e.width=i})),this.cache.verticalList=m,this.cache.clipedWidth=s;this.clearUpdateShapeTag();const b=_x(c,s),x=Px(u,g,d);return this._AABBBounds.set(x,b,x+g,b+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const i=gy(this).text,n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:o=i.textBaseline,fontSize:a=i.fontSize,fontWeight:h=i.fontWeight,lineHeight:l=n.lineHeight||n.fontSize||i.fontSize,ellipsis:c=i.ellipsis,maxLineWidth:u,stroke:d=i.stroke,lineWidth:p=i.lineWidth,wordBreak:f=i.wordBreak}=n;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const g=fv.graphicUtil.textMeasure,v=new Ex(r,{fontSize:a,fontWeight:h},g).GetLayoutByLines(t,s,o,l,!0===c?i.ellipsis:c||void 0,"break-word"===f,u),{bbox:y}=v;return this.cache.layoutData=v,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i;const n=gy(this).text,r=fv.graphicUtil.textMeasure;let s;const o=2,a=this.attribute,{maxLineWidth:h=n.maxLineWidth,ellipsis:l=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:p=n.fontWeight,stroke:f=n.stroke,lineHeight:g=(null!==(i=a.lineHeight)&&void 0!==i?i:(a.fontSize||n.fontSize)+o),lineWidth:v=n.lineWidth,wordBreak:y=n.wordBreak}=a;if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=Qp(e,s)}));const t=_x(c,s),e=this.cache.verticalList.length*g,i=Px(u,e,d);return this._AABBBounds.set(i,t,i+e,t+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}const m=e.map((t=>bb(t.toString())));m.forEach(((e,i)=>{if(Number.isFinite(h))if(l){const t=!0===l?n.ellipsis:l,o=r.clipTextWithSuffixVertical(e,{fontSize:d,fontWeight:p},h,t,"break-word"===y);m[i]=o.verticalList,s=o.width}else{const t=r.clipTextVertical(e,{fontSize:d,fontWeight:p},h,"break-word"===y);m[i]=t.verticalList,s=t.width}else s=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?d:r.measureTextWidth(e.text,{fontSize:d,fontWeight:p});s+=i,e.width=i}))})),this.cache.verticalList=m,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=Qp(e,s)}));const b=_x(c,s),x=this.cache.verticalList.length*g,w=Px(u,x,d);return this._AABBBounds.set(w,b,w+x,b+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return gy(this).text[t]}needUpdateTags(t){for(let e=0;e<Mx.length;e++){const i=Mx[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Mx.length;e++){if(t===Mx[e])return!0}return!1}clone(){return new kx(Object.assign({},this.attribute))}}function Rx(t,e,i,n,r){return r?t.arc(i,n,e,0,qp,!1,r):t.arc(i,n,e,0,qp),!1}var Ox=new class{constructor(){this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return Rx(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Rx(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`}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var Dx=new class{constructor(){this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,e/6,i,n,r,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Ix(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 Lx=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Ix(t,e/2,i,n,r)}drawFitDir(t,e,i,n,r){return Ix(t,e/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Ix(t,e/2+r,i,n,s)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Ux(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var Wx=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Ux(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Ux(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};class Nx{constructor(){this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}}var Fx=new Nx;var jx=new class extends Nx{constructor(){super(...arguments),this.type="triangle"}};const zx=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Hx=Math.sin(qp/10)*zx,Gx=-Math.cos(qp/10)*zx;function Vx(t,e,i,n){const r=Hx*e,s=Gx*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let o=1;o<5;++o){const a=qp*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 Xx=new class{constructor(){this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return Vx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Vx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const Yx=nf(3);function qx(t,e,i,n){const r=e,s=r/Yx,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 Kx=new class{constructor(){this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return qx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return qx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function $x(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 Zx=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return $x(t,e/2,i,n)}drawOffset(t,e,i,n,r){return $x(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function Jx(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Qx=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Jx(t,e/2,i,n)}drawOffset(t,e,i,n,r){return Jx(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const tw=-.5,ew=nf(3)/2,iw=1/nf(12);function nw(t,e,i,n){const r=e/2,s=e*iw,o=r,a=e*iw+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(tw*r-ew*s+i,ew*r+tw*s+n),t.lineTo(tw*o-ew*a+i,ew*o+tw*a+n),t.lineTo(tw*h-ew*l+i,ew*h+tw*l+n),t.lineTo(tw*r+ew*s+i,tw*s-ew*r+n),t.lineTo(tw*o+ew*a+i,tw*a-ew*o+n),t.lineTo(tw*h+ew*l+i,tw*l-ew*h+n),t.closePath(),!1}var rw=new class{constructor(){this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,i,n){return nw(t,e/2,i,n)}drawOffset(t,e,i,n,r){return nw(t,e/2+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var sw=new class{constructor(){this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var ow=new class{constructor(){this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};var aw=new class{constructor(){this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}drawOffset(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};const hw=nf(3);function lw(t,e,i,n){const r=e*hw;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var cw=new class extends Nx{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return lw(t,e/2/hw,i,n)}drawOffset(t,e,i,n,r){return lw(t,e/2/hw+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function uw(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 dw=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.5 0.5"}draw(t,e,i,n){return uw(t,e/4,i,n)}drawOffset(t,e,i,n,r){return uw(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function pw(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 fw=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5"}draw(t,e,i,n){return pw(t,e/4,i,n)}drawOffset(t,e,i,n,r){return pw(t,e/4+r,i,n)}bounds(t,e){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}};function gw(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}var vw=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return gw(t,Ip(e)?[e,e]:e,i,n)}drawOffset(t,e,i,n,r){return gw(t,Ip(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],i,n)}bounds(t,e){const i=Ip(t)?[t,t]:t;e.x1=-i[0]/2,e.x2=i[0]/2,e.y1=-i[1]/2,e.y2=i[1]/2}};class yw{constructor(t,e){this.pathStr="",this.type=t,this.path=e}drawOffset(t,e,i,n,r){return rg(this.path.commandList,t,i,n,e+r,e+r),!1}draw(t,e,i,n){return rg(this.path.commandList,t,i,n,e,e),!1}bounds(t,e){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 mw=[Ox,Dx,Lx,Wx,cw,jx,Xx,Kx,Zx,Qx,rw,sw,ow,Fx,aw,dw,fw,vw],bw={};mw.forEach((t=>{bw[t.type]=t}));const xw=["symbolType","size",...lb];let ww=class t extends fb{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Ub}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Dp(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=gy(this).symbol,{symbolType:i=e.symbolType}=this.attribute;let n=bw[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;const r=(new jg).fromString(i),s=r.bounds.width(),o=r.bounds.height(),a=1/Qp(s,o);return r.transform(0,0,a,a),this._parsedPath=new yw(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=gy(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=fv.graphicService.updateSymbolAABBBounds(i,gy(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Zy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return gy(this).symbol[t]}needUpdateTags(t){for(let e=0;e<xw.length;e++){const i=xw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<xw.length;e++){if(t===xw[e])return!0}return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=Dp(e)?e:[e,e];return t.path?(new jg).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new jg).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}};ww.userSymbolMap={};const Sw=["segments","points","curveType",...lb];let Aw=class t extends fb{constructor(t={}){super(t),this.type="line",this.numberType=Mb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=nm(i,n,e))}doUpdateAABBBounds(){const t=gy(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateLineAABBBounds(e,gy(this).line,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return gy(this).line[t]}needUpdateTags(t){for(let e=0;e<Sw.length;e++){const i=Sw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Sw.length;e++){if(t===Sw[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=new jg,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t(Object.assign({},this.attribute))}};const Tw=["width","height","cornerRadius",...lb];class Bw extends fb{constructor(t){super(t),this.type="rect",this.numberType=Db}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=gy(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateRectAABBBounds(e,gy(this).rect,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return gy(this).rect[t]}needUpdateTags(t){for(let e=0;e<Tw.length;e++){const i=Tw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Tw.length;e++){if(t===Tw[e])return!0}return!1}toCustomPath(){const t=this.attribute,e=t.width,i=t.height,n=new jg;return n.moveTo(0,0),n.rect(0,0,e,i),n}clone(){return new Bw(Object.assign({},this.attribute))}}const Cw=[[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 _w extends Bw{constructor(t){super(t),this.type="rect3d",this.numberType=Ib}findFace(){const t={polygons:[],vertices:[],edges:[]},e=gy(this).rect3d,{width:i=e.width,height:n=e.width,length:r=tf(e.width,e.height)}=this.attribute;for(let e=0;e<Cw.length;e++){const s=Cw[e];t.vertices.push([s[0]*i,s[1]*n,s[2]*r])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}class Pw extends fb{constructor(t){super(t),this.type="glyph",this.numberType=_b,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}doUpdateAABBBounds(){this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const t=fv.graphicService.updateGlyphAABBBounds(this.attribute,gy(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some(((t,e)=>this.currentStates[e]!==t))))return;const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new Pw(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}}class Ew{constructor(t,e,i,n,r,s,o,a,h,l,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=gv[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=i:o+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+a,this.lines[i][this.directionKey.top]+o,e)}}}}return l}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],o=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&o-this.lines[i+1].height<this[this.directionKey.top]){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=this.lines[i].getWidthWithEllips();n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class Mw{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:o}=Av(t,i);let a=0,h=0,l=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),l=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+l),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=Av(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,o=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=wv(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=Av(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||yv;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const i=e&&e.fill||vv;if(!i)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=i;let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=wv(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:n}=Av(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const kw=["width","height","image",...lb];class Rw extends fb{constructor(t){super(t),this.type="image",this.numberType=Eb,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=gy(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateImageAABBBounds(e,gy(this).image,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return dv[t]}needUpdateTags(t){for(let e=0;e<kw.length;e++){const i=kw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<kw.length;e++){if(t===kw[e])return!0}return!1}clone(){return new Rw(Object.assign({},this.attribute))}}class Ow extends Rw{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Zy(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(Dp(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zy(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=dv.width,height:e=dv.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 Dw{constructor(t,e,i,n,r,s,o,a){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Ow?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=gv[this.direction];const h=this.directionKey;this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Mw){const e=xv.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=a?0:this.width-this.actualWidth;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof Ow?(t["_"+h.x]=c,c+=t[h.width]+u,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?l-t.height:(l-t.height)/2):(t[h.left]=c,c+=t[h.width]+u)}))}draw(t,e,i,n,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof Ow)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const{width:n}=Av("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add";break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}}this.paragraphs.map(((e,s)=>{if(e instanceof Ow)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);e.draw(t,n+this.ascent,i,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i instanceof Ow)break;const{width:n}=Av("...",i.character),r=n||0;if(r<=this.blankWidth+t){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+t+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+t;break}i.ellipsis="hide",t+=i.width}let e=0;return this.paragraphs.map(((t,i)=>{e+=t instanceof Ow?t.width:t.getWidthWithEllips(this.direction)})),e}}class Iw{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=gv[this.direction]}store(t){if(t instanceof Ow){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 Dw(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 Ow?"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=wv(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 Mw(i,t.newLine,t.character),new Mw(n,!0,t.character)]}(t,n);this.store(e),this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Lw=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...lb];class Uw extends fb{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Lb}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:uv.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:uv.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:uv.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:uv.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:uv.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:uv.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:uv.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:uv.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=gy(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateRichTextAABBBounds(e,gy(this).richtext,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return uv[t]}needUpdateTags(t){for(let e=0;e<Lw.length;e++){const i=Lw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Lw.length;e++){if(t===Lw[e])return!0}return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:i,maxHeight:n,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:h,textAlign:l,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,p=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const i=e[t],n=i.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(i.id);if(n)p.push(n);else{const t=new Ow(i);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=i.id,p.push(t)}}else if(e[t].text.includes("\n")){const i=e[t].text.split("\n");for(let n=0;n<i.length;n++)p.push(new Mw(i[n],0!==n,e[t]))}else p.push(new Mw(e[t].text,!1,e[t]));const f=new Ew(0,0,("number"==typeof i&&(!r||r>i)?i:r)||0,("number"==typeof n&&(!s||s>n)?n:s)||0,o,a,h,l,c,u||"horizontal","number"==typeof i&&(!r||r>i),"number"==typeof n&&(!s||s>n),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new Iw(f);for(let t=0;t<p.length;t++)g.deal(p[t]);g.send(),this._frameCache=f}clone(){return new Uw(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e);this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,n,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(o.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+i,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n)})),r}}const Ww=["path","customPath",...lb];class Nw extends fb{constructor(t){super(t),this.type="path",this.numberType=kb}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=gy(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof jg?e.path:(Ep(this.cache)&&this.doUpdatePathShape(),this.cache instanceof jg?this.cache:t.path)}doUpdateAABBBounds(){const t=gy(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updatePathAABBBounds(e,gy(this).path,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}doUpdatePathShape(){const t=this.attribute;Op(t.path,!0)?this.cache=(new jg).fromString(t.path):t.customPath&&(this.cache=new jg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return gy(this).path[t]}needUpdateTags(t){for(let e=0;e<Ww.length;e++){const i=Ww[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Ww.length;e++){if(t===Ww[e])return!0}return!1}toCustomPath(){return(new jg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Nw(Object.assign({},this.attribute))}}const Fw=["segments","points","curveType",...lb];class jw extends fb{constructor(t){super(t),this.type="area",this.numberType=Bb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=gy(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateAreaAABBBounds(e,gy(this).area,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=nm(i,n,e))}getDefaultAttribute(t){return gy(this).area[t]}needUpdateTags(t){for(let e=0;e<Fw.length;e++){const i=Fw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Fw.length;e++){if(t===Fw[e])return!0}return!1}toCustomPath(){const t=new jg,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new jw(Object.assign({},this.attribute))}}const zw=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...lb];class Hw extends fb{constructor(t){super(t),this.type="arc",this.numberType=Ab}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=gy(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:i=t.outerRadius,innerRadius:n=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(i-n);return Math.min(Ip(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=gy(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=ff(e),i=e+s,n&&$p(s)<Kp-Vp){let s=1,o=1;n.length&&(s=Number(n[0]),o=Number(n[1]));const{outerRadius:a=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute,l=Math.abs(a-h)/2,c=l/a;if(l>Vp&&a>Vp)return{startAngle:e-r*c*s,endAngle:i+r*c*o}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=gy(this).arc,{outerRadius:n=i.outerRadius,innerRadius:r=i.innerRadius,padAngle:s=i.padAngle}=this.attribute,{padRadius:o=nf(n*n+r*r)}=this.attribute,a=$p(e-t);let h=t,l=e,c=t,u=e;const d=s/2;let p=a,f=a;if(d>Vp&&o>Vp){const i=e>t?1:-1;let s=of(Number(o)/r*ef(d)),a=of(Number(o)/n*ef(d));return(p-=2*s)>Vp?(s*=i,c+=s,u-=s):(p=0,c=u=(t+e)/2),(f-=2*a)>Vp?(a*=i,h+=a,l-=a):(f=0,h=l=(t+e)/2),{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}return{outerStartAngle:h,outerEndAngle:l,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:p,outerDeltaAngle:f}}doUpdateAABBBounds(t){const e=gy(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const i=this.attribute,n=fv.graphicService.updateArcAABBBounds(i,gy(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=i,s=Zy(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<zw.length;e++){const i=zw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<zw.length;e++){if(t===zw[e])return!0}return!1}getDefaultAttribute(t){return gy(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let n=t.innerRadius,r=t.outerRadius;const s=$p(i-e),o=i>e;if(r<n){const t=r;r=n,n=t}const a=new jg;if(r<=Vp)a.moveTo(0,0);else if(s>=Kp-Vp)a.moveTo(0+r*Jp(e),0+r*ef(e)),a.arc(0,0,r,e,i,!o),n>Vp&&(a.moveTo(0+n*Jp(i),0+n*ef(i)),a.arc(0,0,n,i,e,o));else{const t=r*Jp(e),s=r*ef(e),h=n*Jp(i),l=n*ef(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 Hw(Object.assign({},this.attribute))}}class Gw extends Hw{constructor(t){super(t),this.type="arc3d",this.numberType=Tb}doUpdateAABBBounds(){const t=gy(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updateArc3dAABBBounds(e,gy(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}}const Vw=["points","cornerRadius",...lb];class Xw extends fb{constructor(t){super(t),this.type="polygon",this.numberType=Rb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=gy(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updatePolygonAABBBounds(e,gy(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(n);return r&&i.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,i,n,r){"points"===t&&(r.points=nm(i,n,e))}getDefaultAttribute(t){return gy(this).polygon[t]}needUpdateTags(t){for(let e=0;e<Vw.length;e++){const i=Vw[e];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){for(let e=0;e<Vw.length;e++){if(t===Vw[e])return!0}return!1}toCustomPath(){const t=this.attribute.points,e=new jg;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 Xw(Object.assign({},this.attribute))}}class Yw extends Xw{constructor(t){super(t),this.type="pyramid3d",this.numberType=Ob}doUpdateAABBBounds(){const t=gy(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,i=fv.graphicService.updatePyramid3dAABBBounds(e,gy(this).polygon,this._AABBBounds,this),{boundsPadding:n=t.boundsPadding}=e,r=Zy(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=cf.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=Qp(r,e);const o=cf.distancePP(i[s].p,i[s+1].p);i[s].d=o,i[s+1].d=o,r=Qp(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}}let qw=class{updateBounds(t,e,i,n){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:n=t.distance,lineWidth:o=t.lineWidth}=r;i.expand(n+s+o/2)}return i}};qw=dp([rp()],qw);const Kw=Symbol.for("RectBoundsContribution");let $w=class extends qw{};$w=dp([rp()],$w);const Zw=Symbol.for("SymbolBoundsContribution");let Jw=class extends qw{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;gb(i,n+s+a/2,!0,o)}return i}};Jw=dp([rp()],Jw);const Qw=Symbol.for("CircleBoundsContribution");let tS=class extends qw{};tS=dp([rp()],tS);const eS=Symbol.for("ArcBoundsContribution");let iS=class extends qw{};iS=dp([rp()],iS);const nS=Symbol.for("PathBoundsContribution");let rS=class extends qw{};rS=dp([rp()],rS);class sS{constructor(){this.pools=[]}static identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return sS.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const oS=new class{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new Bf(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 Bf(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},aS=new sS;function hS(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+l*n,t[5]=o*r+c*n,t[6]=a*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-o*n,t[10]=u*r-a*n,t[11]=d*r-h*n,t}function lS(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-l*n,t[1]=o*r-c*n,t[2]=a*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=o*n+c*r,t[10]=a*n+u*r,t[11]=h*n+d*r,t}function cS(t,e,i){const n=i[0],r=i[1],s=i[2];let o,a,h,l,c,u,d,p,f,g,v,y;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],y=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=y,t[12]=o*n+c*r+f*s+e[12],t[13]=a*n+u*r+g*s+e[13],t[14]=h*n+d*r+v*s+e[14],t[15]=l*n+p*r+y*s+e[15]),t}function uS(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 dS(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],y=e[14],m=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*a+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*y,t[3]=b*o+x*c+w*f+S*m,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*a+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*y,t[7]=b*o+x*c+w*f+S*m,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*a+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*y,t[11]=b*o+x*c+w*f+S*m,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*a+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*y,t[15]=b*o+x*c+w*f+S*m,t}function pS(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:y}=e.attribute,m=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;m[0]=i.x1+(i.x2-i.x1)*t}else m[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;m[1]=i.x1+(i.x2-i.x1)*t}else m[1]=v[1];m[2]=null!==(n=v[2])&&void 0!==n?n:0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),cS(t,t,[r+a,s+h,o+l]),cS(t,t,[m[0],m[1],m[2]]),hS(t,t,f),lS(t,t,p),cS(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,[c,u,d]),g){const i=aS.allocate(),n=[0,0];if(y){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}cS(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+l*n,t[1]=o*r+c*n,t[2]=a*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-o*n,t[6]=u*r-a*n,t[7]=d*r-h*n}(i,i,g),cS(i,i,[-n[0],-n[1],0]),dS(t,t,i)}}function fS(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t,e,i,n,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=i,this.circleBoundsContribitions=n,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new xp(["graphic"]),onSetStage:new xp(["graphic","stage"]),onRemove:new xp(["graphic"]),onAddIncremental:new xp(["graphic","group","stage"]),onClearIncremental:new xp(["graphic","group","stage"]),beforeUpdateAABBBounds:new xp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new xp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new pf,this.tempAABBBounds2=new pf}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Of(t);return rg(i.commandList,n,0,0),!0}updateRectAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}updateGroupAABBBounds(t,e,i,n){const{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,r,s),a||n.forEachChildren((t=>{i.union(t.AABBBounds)}));const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateGlyphAABBBounds(t,e,i,n){return n.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}updateRichTextAABBBounds(t,e,i,n){if(!n)return i;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:h=e.textAlign,textBaseline:l=e.textBaseline}=t;if(r>0&&s>0)i.set(0,0,r,s);else{const t=n.getFrameCache(),{width:e,height:h}=t.getActualSize();let l=r||e||0,c=s||h||0;c="number"==typeof a&&c>a?a:c||0,l="number"==typeof o&&l>o?o:l||0,i.set(0,0,l,c)}let c=0;switch(l){case"top":c=0;break;case"middle":c=-i.height()/2;break;case"bottom":c=-i.height()}let u=0;switch(h){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}i.translate(u,c);const d=this.tempAABBBounds1,p=this.tempAABBBounds2;return d.setValue(i.x1,i.y1,i.x2,i.y2),p.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateTextAABBBounds(t,e,i,n){if(!n)return i;const{text:r=e.text}=n.attribute;Array.isArray(r)?n.updateMultilineAABBBounds(r):n.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2);const{scaleX:a=e.scaleX,scaleY:h=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(l){gb(s,l/Math.abs(a+h),!0,c),i.union(s)}return this.combindShadowAABBBounds(i,n),uf(i,i,n.transMatrix),i}updatePathAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,n),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePathAABBBoundsImprecise(t,e,i,n){if(!n)return i;const r=n.getParsedPathShape();return i.union(r.getBounds()),i}updatePyramid3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updateArc3dAABBBounds(t,e,i,n){if(!n)return i;const r=n.stage;if(!r||!r.camera)return i;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;i.setValue(-a,-a,a,a);const h=this.tempAABBBounds1,l=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),l.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}updatePolygonAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updatePolygonAABBBoundsImprecise(t,e,i,n){const{points:r=e.points}=t;return r.forEach((t=>{i.add(t.x,t.y)})),i}updateLineAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}updateCircleAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}updateCircleAABBBoundsImprecise(t,e,i,n){const{radius:r=e.radius}=t;return i.set(-r,-r,r,r),i}updateCircleAABBBoundsAccurate(t,e,i,n){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>Kp-Vp?i.set(-o,-o,o,o):tm(r,s,o,i),i}updateArcAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateArcAABBBoundsImprecise(t,e,i,n){const{outerRadius:r=e.outerRadius}=t;return i.set(-r,-r,r,r),i}updateArcAABBBoundsAccurate(t,e,i,n){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=Vp?i.set(0,0,0,0):Math.abs(o-a)>Kp-Vp?i.set(-r,-r,r,r):(tm(a,o,r,i),tm(a,o,s,i)),i}updateSymbolAABBBounds(t,e,i,n,r){this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(i.x1,i.y1,i.x2,i.y2),o.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((n=>{n.updateBounds(t,e,s,r),i.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,i,e,"miter"===a,r),i}updateSymbolAABBBoundsImprecise(t,e,i,n){const{size:r=e.size}=t;if(Dp(r))i.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i,n){if(!n)return i;const{size:r=e.size}=t;return n.getParsedPath().bounds(r,i),i}updateImageAABBBounds(t,e,i,n){if(!this.updatePathProxyAABBBounds(i,n)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){const{scaleX:s=i.scaleX,scaleY:o=i.scaleY,stroke:a=i.stroke,shadowBlur:h=i.shadowBlur,lineWidth:l=i.lineWidth,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){gb(u,l/Math.abs(s+o),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(h){gb(u,h/Math.abs(s+o),n,c),e.union(u)}this.combindShadowAABBBounds(e,r),uf(e,e,r.transMatrix)}},t.DefaultGraphicService=dp([rp(),pp(0,ap(Fb)),pp(1,ap(vp)),pp(1,sp(Kw)),pp(2,ap(vp)),pp(2,sp(Zw)),pp(3,ap(vp)),pp(3,sp(Qw)),pp(4,ap(vp)),pp(4,sp(eS)),pp(5,ap(vp)),pp(5,sp(nS)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object])],t.DefaultGraphicService);class gS extends zb{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}const vS=["heightLimit","lineClamp"];class yS extends kx{_isValid(){const{text:t}=this.attribute;return Dp(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n;const r=gy(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,lineHeight:l=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:p=r.lineWidth,heightLimit:f=0,lineClamp:g}=this.attribute;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=fv.graphicUtil.textMeasure,y=new Ex(s,{fontSize:h},v),m=t.map((t=>t.toString())),b=[],x=[0,0];let w=1/0;if(f>0&&(w=Math.max(Math.floor(f/l),1)),g&&(w=Math.min(w,g)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<m.length;t++){const e=m[t];if(t===w-1){const t=y.textMeasure.clipTextWithSuffix(e,y.textOptions,u,c);b.push({str:t.str,width:t.width});break}const r=y.textMeasure.clipText(e,y.textOptions,u);if(""!==e&&""===r.str)if(c){const t=y.textMeasure.clipTextWithSuffix(e,y.textOptions,u,c);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;if(b.push({str:r.str,width:r.width}),r.str.length===e.length);else{const i=e.substring(r.str.length);m.splice(t+1,0,i)}}let t=0;b.forEach((e=>{t=Math.max(t,e.width)})),x[0]=t}else{let t,e,i=0;for(let n=0,r=m.length;n<r;n++){if(n===w-1){const t=y.textMeasure.clipTextWithSuffix(m[n],y.textOptions,u,c);b.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=m[n],t=y.textMeasure.measureTextWidth(e,y.textOptions),i=Math.max(i,t),b.push({str:e,width:t})}x[0]=i}x[1]=b.length*(l+2);const S={xOffset:0,yOffset:0,width:x[0],height:x[1]};y.LayoutBBox(S,o,a);const A=y.layoutWithBBox(S,b,o,a,l);return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<vS.length;e++){const i=vS[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<vS.length;e++){if(t===vS[e])return!0}return super.needUpdateTag(t)}}function mS(t){return new Hw(t)}function bS(t){return new jw(t)}function xS(t){return new Bx(t)}function wS(t){return new zb(t)}function SS(t){return new Aw(t)}function AS(t){return new Nw(t)}function TS(t){return new Bw(t)}function BS(t){return new _w(t)}function CS(t){return new kx(t)}function _S(t){return new yS(t)}function PS(t){return new ww(t)}function ES(t){return new Rw(t)}function MS(t){return new Xw(t)}function kS(t){return new gS(t)}function RS(t){return new Uw(t)}const OS={arc:mS,area:bS,circle:xS,group:wS,image:ES,line:SS,path:AS,rect:TS,rect3d:BS,symbol:PS,text:CS,richtext:RS,polygon:MS,shadowRoot:kS,wrapText:_S},DS=CS({text:""});const IS=RS({});function LS(e,i,n,r,s){var o;const{offsetX:a=0,offsetY:h=0,offsetZ:l=0,mode:c="none",drawConnect:u=!1,zeroX:d=0,zeroY:p=0}=s||{};if(u&&"none"===c)return;if(!i)return;let f=!0;const{curves:g}=i;if(n>=1){if(u){let t,i=!0;g.forEach(((n,r)=>{var s;let o=n.p0;if(n.originP1!==n.originP2){if(t&&t.originP1===t.originP2&&(o=t.p0),n.defined)i||(e.lineTo(o.x+a,o.y+h,l),i=!i);else{const{originP1:t,originP2:r}=n;let c;if(t&&!1!==t.defined?c=o:t&&!1!==r.defined&&(c=null!==(s=n.p3)&&void 0!==s?s:n.p1),i){i=!i;const t=c?c.x:n.p0.x,r=c?c.y:n.p0.y;e.moveTo(t+a,r+h,l)}else c&&(i=!i,e.lineTo(c.x+a,c.y+h,l))}t=n}else t=n}))}else g.forEach((t=>{t.defined?(f&&e.moveTo(t.p0.x+a,t.p0.y+h,l),NS(e,t,1,s),f=!1):f=!0}));return}if(n<=0)return;let v;"x"===r?v=t.Direction.ROW:"y"===r?v=t.Direction.COLUMN:"auto"===r&&(v=i.direction);const y=n*i.tryUpdateLength(v);let m=0,b=!0,x=null;for(let t=0,i=g.length;t<i;t++){const i=g[t],n=i.getLength(v),r=(y-m)/n;if(m+=n,r<0)break;if(u){let t=i.p0;if(i.originP1===i.originP2){x=i;continue}if(x&&x.originP1===x.originP2&&(t=x.p0),i.defined)b||(e.lineTo(t.x+a,t.y+h,l),b=!b);else{const{originP1:n,originP2:r}=i;let s;if(n&&!1!==n.defined?s=t:n&&!1!==r.defined&&(s=null!==(o=i.p3)&&void 0!==o?o:i.p1),b){b=!b;const t=s?s.x:i.p0.x,n=s?s.y:i.p0.y;e.moveTo(t+a,n+h,l)}else s&&(b=!b,e.lineTo(s.x+a,s.y+h,l))}x=i}else{if(!i.defined){f=!0;continue}f&&e.moveTo(i.p0.x+a,i.p0.y+h,l),NS(e,i,tf(r,1),s),f=!1}}}function US(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 WS(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}function NS(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]=cg(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 FS(e,i,n,r){var s;const{drawConnect:o=!1,mode:a="none"}=r||{};if(o&&"none"===a)return;const{top:h,bottom:l}=i;if(n>=1){const t=[],i=[];let n=!0;if(o){let n,s,o=!0;const a=h.curves.length;h.curves.forEach(((h,c)=>{const u=l.curves[a-c-1];let d=h,p=u;if(h.originP1===h.originP2)return n=h,void(s=u);if(n&&n.originP1===n.originP2&&(d=n,p=s),h.defined)o||(t.push(d),i.push(p),jS(e,t,i,r),t.length=0,i.length=0,o=!o);else{const{originP1:n,originP2:s}=h;let a,l;n&&!1!==n.defined?(a=d,l=p):n&&!1!==s.defined&&(a=h,l=u),o?(o=!o,t.push(a||h),i.push(l||u)):a&&(o=!o,t.push(a||h),i.push(l||u),jS(e,t,i,r),t.length=0,i.length=0)}n=h})),jS(e,t,i,r)}else{for(let s=0,o=h.curves.length;s<o;s++){const a=h.curves[s];n!==a.defined?(n?(zS(e,t,i,r),t.length=0,i.length=0):(t.push(a),i.push(l.curves[o-s-1])),n=!n):n&&(t.push(a),i.push(l.curves[o-s-1]))}zS(e,t,i,r)}return}if(n<=0)return;let{direction:c}=r||{};const{curves:u}=h,d=null!==(s=u[u.length-1].p3)&&void 0!==s?s:u[u.length-1].p1,p=$p(d.x-u[0].p0.x),f=$p(d.y-u[0].p0.y);c=null!=c?c:p>f?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(p)||(c=t.Direction.COLUMN),Number.isFinite(f)||(c=t.Direction.ROW);const g=n*(c===t.Direction.ROW?p:f);let v=0,y=!0;const m=[],b=[];let x,w,S=!0;for(let t=0,i=h.curves.length;t<i;t++){const n=h.curves[t],s=n.getLength(c),a=(g-v)/s;if(a<0)break;if(v+=s,o){const s=l.curves[i-t-1];let o=n,a=s;if(n.originP1===n.originP2){x=n,w=s;continue}if(x&&x.originP1===x.originP2&&(o=x,a=w),n.defined)S||(m.push(o),b.push(a),jS(e,m,b,r),m.length=0,b.length=0,S=!S);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),S?(S=!S,m.push(h||n),b.push(l||s)):h&&(S=!S,m.push(h||n),b.push(l||s),jS(e,m,b,r),m.length=0,b.length=0)}x=n}else{let s=null,o=null;y!==n.defined?(y?(zS(e,m,b,r),m.length=0,b.length=0):(s=n,o=l.curves[i-t-1]),y=!y):y&&(s=n,o=l.curves[i-t-1]),s&&o&&(a<1&&(s=s.p2&&s.p3?cg(s,a)[0]:dg(s,a)[0],o=o.p2&&o.p3?cg(o,1-a)[1]:dg(o,1-a)[1]),s.defined=y,o.defined=y,m.push(s),b.push(o)),s=null,o=null}}o?jS(e,m,b,r):zS(e,m,b,r)}function jS(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 zS(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),HS(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),HS(t,h,1,n),a=!1):a=!0}t.closePath()}function HS(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]=cg(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 GS(t,e,i){switch(e){case"linear":default:return mg(t,i);case"basis":return Ag(t,i);case"monotoneX":return kg(t,i);case"monotoneY":return Og(t,i);case"step":return Ig(t,.5,i);case"stepBefore":return Ig(t,0,i);case"stepAfter":return Ig(t,1,i);case"linearClosed":return Wg(t,i)}}t.BaseRender=class{transform(t,e,i,n=!1){const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:h=e.scaleX,scaleY:l=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,p=i.modelMatrix,f=i.camera,g={x:s,y:o,z:a,lastModelMatrix:p},v=f&&(n||fS(t));if(v){const n=aS.allocate(),r=aS.allocate();pS(r,t,e),dS(n,p||n,r),g.x=0,g.y=0,g.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),aS.free(r)}if(d&&!p){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,g.z=a,i.setTransformForCurrent()}else if(v)g.x=0,g.y=0,g.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(f&&i.project){const n=t.getOffsetXY(e);g.x+=n.x,g.y+=n.y,this.transformWithoutTranslate(i,g.x,g.y,g.z,h,l,c)}else i.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=n.project(0,0,i),a=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+u.y*a.x+(c.y-u.y)*o.x)*d,f=(c.y*h.y+l.y*(a.y-h.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(l.x*(h.x-a.x)-c.x*h.x+u.x*a.x+(c.x-u.x)*o.x)*d,v=-(c.x*h.y+l.x*(a.y-h.y)-u.x*a.y+(u.x-c.x)*o.y)*d,y=(l.x*(u.y*a.x-c.y*h.x)+l.y*(c.x*h.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,m=(l.x*(u.y*a.y-c.y*h.y)+l.y*(c.x*h.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;n.setTransform(p,f,g,v,y,m,!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()}},t.BaseRender=dp([rp()],t.BaseRender),t.DefaultCanvasLineRender=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Mb}draw(t,e,i,n){const{context:r}=i;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).line,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,nx(t,r,a,h)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var g,v,y,m,b;if(!e)return;t.beginPath();const x=null!==(g=this.z)&&void 0!==g?g:0;LS(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x}),d.cache&&!Dp(d.cache)&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,o,a);const{x:w=0,x:S=0}=o;!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,o,w-c,S-u,a),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,o,w-c,S-u,a),t.stroke()));let{connectedType:A,connectedX:T,connectedY:B,connectedStyle:C}=o;if(Dp(a)?(A=null!==(v=null!=A?A:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(y=null!=T?T:a[0].connectedX)&&void 0!==y?y:a[1].connectedX,B=null!==(m=null!=B?B:a[0].connectedY)&&void 0!==m?m:a[1].connectedY,C=null!==(b=null!=C?C:a[0].connectedStyle)&&void 0!==b?b:a[1].connectedStyle):(A=null!=A?A:a.connectedType,T=null!=T?T:a.connectedX,B=null!=B?B:a.connectedY,C=null!=C?C:a.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),"none"!==A){t.beginPath(),LS(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:x,drawConnect:!0,mode:A,zeroX:T,zeroY:B});const g=[];Dp(a)?a.forEach((t=>g.push(t))):g.push(a),g.push(o),!1!==i&&(p?p(t,o,a):r&&(t.setCommonStyle(d,C,w-c,S-u,g),t.fill())),!1!==n&&(f?f(t,o,a):s&&(t.setStrokeStyle(d,C,w-c,S-u,g),t.stroke()))}return!1}drawShape(t,e,i,n,r,s,o,a){const h=gy(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:g=h.visible}=t.attribute,v=Qb(u,d,l),y=ex(u,p),m=Zb(l),b=Jb(c,f);if(!t.valid||!g)return;if(!m&&!b)return;if(!(v||y||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=h.curveType}=t.attribute,r=e;if(i&&i.length){let e,r;t.cache=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY,defined:r.curves[r.curves.length-1].defined}:i>1&&(e.x=r.endX,e.y=r.endY,e.defined=r.curves[r.curves.length-1].defined),r=Fg(t.points,n,{startPoint:e}),r)))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Fg(r,n)}t.clearUpdateShapeTag()}const{clipRange:x=h.clipRange,clipRangeByDimension:w=h.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache))if(1===x){let r=!1;t.cache.forEach(((s,u)=>{r||(r=this.drawSegmentItem(e,s,!!l,!!c,d,p,t.attribute.segments[u],[h,t.attribute],x,w,i,n,t,o,a))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),s=x*r;let u=0,f=!1;t.cache.forEach(((r,g)=>{if(f)return;const v=r.getLength(),y=(s-u)/v;u+=v,y>0&&(f=this.drawSegmentItem(e,r,!!l,!!c,d,p,t.attribute.segments[g],[h,t.attribute],tf(y,1),w,i,n,t,o,a))}))}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,p,t.attribute,h,x,w,i,n,t,o,a)}},t.DefaultCanvasLineRender=dp([rp()],t.DefaultCanvasLineRender),t.DefaultCanvasAreaRender=class{constructor(t){this.areaRenderContribitions=t,this.numberType=Bb}drawShape(t,e,i,n,r,s,o,a){var h,l,c,u,d,p;const f=gy(t,null==s?void 0:s.theme).area,{fill:g=f.fill,fillOpacity:v=f.fillOpacity,opacity:y=f.opacity,visible:m=f.visible,z:b=f.z,background:x,stroke:w=t.attribute.stroke,lineWidth:S=f.lineWidth,strokeOpacity:A=f.strokeOpacity}=t.attribute,T=Qb(y,v,g),B=Zb(g,x),C=Jb(w,S),_=ex(y,A);if(!t.valid||!m)return;if(!B&&!C)return;if(!(T||o||_||a))return;const{clipRange:P=f.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:i,curveType:n=f.curveType}=t.attribute;if(i&&i.length){let e,r;const s=i.map(((t,i)=>(1===i?e={x:r.endX,y:r.endY}:i>1&&(e.x=r.endX,e.y=r.endY),r=GS(t.points,n,{startPoint:e}),r)));let o;const a=[];for(let t=i.length-1;t>=0;t--){const e=i[t].points,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=i[t-1].points,n=e[e.length-1];n&&r.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(u=n.y1)&&void 0!==u?u:n.y})}o=GS(r,"stepBefore"===n?"stepAfter":"stepAfter"===n?"stepBefore":n),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const i=e,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const s=GS(i,n),o=GS(r,"stepBefore"===n?"stepAfter":"stepAfter"===n?"stepBefore":n);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===P){let s=!1;t.cacheArea.forEach(((h,l)=>{s||(s=this.drawSegmentItem(e,h,B,v,C,A,t.attribute.segments[l],[f,t.attribute],P,i,n,b,t,r,o,a))}))}else{const s=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=P*s;let l=0,c=!1;t.cacheArea.forEach(((s,u)=>{if(c)return;const d=s.top.getLength(),p=(h-l)/d;l+=d,p>0&&(c=this.drawSegmentItem(e,s,B,v,C,A,t.attribute.segments[u],[f,t.attribute],tf(p,1),i,n,b,t,r,o,a))}))}else this.drawSegmentItem(e,t.cacheArea,B,v,C,A,t.attribute,f,P,i,n,b,t,r,o,a)}draw(t,e,i,n){const{context:r}=i,s=gy(t,null==n?void 0:n.theme).area;let{x:o=s.x,y:a=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);nx(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,g){let v=!1;return v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!1,f,g),v=v||this._drawSegmentItem(t,e,i,n,r,s,o,a,h,l,c,u,d,p,!0,f,g),v}_drawSegmentItem(e,i,n,r,s,o,a,h,l,c,u,d,p,f,g,v,y){var m,b,x,w;let{connectedType:S,connectedX:A,connectedY:T,connectedStyle:B}=a;const C=[];if(g&&(Dp(h)?(S=null!==(m=null!=S?S:h[0].connectedType)&&void 0!==m?m:h[1].connectedType,A=null!==(b=null!=A?A:h[0].connectedX)&&void 0!==b?b:h[1].connectedX,T=null!==(x=null!=T?T:h[0].connectedY)&&void 0!==x?x:h[1].connectedY,B=null!==(w=null!=B?B:h[0].connectedStyle)&&void 0!==w?w:h[1].connectedStyle):(S=null!=S?S:h.connectedType,A=null!=A?A:h.connectedX,T=null!=T?T:h.connectedY,B=null!=B?B:h.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),Dp(h)?h.forEach((t=>C.push(t))):C.push(h),C.push(a)),g&&"none"===S)return!1;if(!i)return;e.beginPath();const{points:_,segments:P}=p.attribute;let E,M,k=t.Direction.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],E=t.points[t.points.length-1]}else M=_[0],E=_[_.length-1];k=$p(E.x-M.x)>$p(E.y-M.y)?t.Direction.ROW:t.Direction.COLUMN,FS(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:k,drawConnect:g,mode:S,zeroX:A,zeroY:T}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.beforeFillStroke&&i.drawShape(p,e,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),e.setShadowStyle&&e.setShadowStyle(p,a,h);const{x:R=0,x:O=0}=a;if(!1!==n&&(v?v(e,a,h):r&&(e.setCommonStyle(p,g?B:a,R-c,O-u,g?C:h),e.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((i=>{i.time===t.BaseRenderContributionTime.afterFillStroke&&i.drawShape(p,e,c,u,!!r,!1,n,!1,h,f,v,null,{attribute:a})})),!1!==s)if(y)y(e,a,h);else{const{stroke:n}=a;Dp(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),LS(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,k===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d,drawConnect:g,mode:S,zeroX:A,zeroY:T})),e.setStrokeStyle(p,g?B:a,R-c,O-u,g?C:h),e.stroke()}return!1}},t.DefaultCanvasAreaRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(px)),fp("design:paramtypes",[Object])],t.DefaultCanvasAreaRender),t.DefaultCanvasPathRender=class extends t.BaseRender{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=kb}drawShape(e,i,n,r,s,o,a,h){var l,c;const u=gy(e,null==o?void 0:o.theme).path,{fill:d=u.fill,stroke:p=u.stroke,fillOpacity:f=u.fillOpacity,strokeOpacity:g=u.strokeOpacity,opacity:v=u.opacity,background:y,lineWidth:m=u.lineWidth,visible:b=u.visible,x:x=u.x,y:w=u.y}=e.attribute,S=null!==(l=this.z)&&void 0!==l?l:0,A=Qb(v,f,d),T=ex(v,g),B=Zb(d,y),C=Jb(p,m);if(e.valid&&b&&(B||C)&&(A||T||a||h||y)){if(i.beginPath(),e.pathShape)rg(e.pathShape.commandList,i,n,r,1,1,S);else{rg((null!==(c=e.attribute.path)&&void 0!==c?c:u.path).commandList,i,n,r,1,1,S)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,u,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,u),C&&(h?h(i,e.attribute,u):T&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,u),i.stroke())),B&&(a?a(i,e.attribute,u):A&&(i.setCommonStyle(e,e.attribute,x-n,w-r,u),i.fill())),this._pathRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,u,s,a,h)}))}}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).path,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,nx(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasPathRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(yx)),fp("design:paramtypes",[Object])],t.DefaultCanvasPathRender);const VS=Xp/2;function XS(t,e,i,n,r,s){let o;if(Ip(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(n<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,i,n,r);const[a,h,l,c]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],u=Math.min(n/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],f=[a[0],a[1]+d[0]],g=[h[0]-d[1],h[1]],v=[h[0],h[1]+d[1]],y=[l[0]-d[2],l[1]],m=[l[0],l[1]-d[2]],b=[c[0]+d[3],c[1]],x=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!jp(g,v)){const e=g[0],i=g[1]+d[1];t.arc(e,i,d[1],-VS,0,!1)}if(t.lineTo(m[0],m[1]),!jp(y,m)){const e=m[0]-d[2],i=m[1];t.arc(e,i,d[2],0,VS,!1)}if(t.lineTo(b[0],b[1]),!jp(b,x)){const e=b[0],i=b[1]-d[3];t.arc(e,i,d[3],VS,Xp,!1)}if(t.lineTo(f[0],f[1]),!jp(p,f)){const e=p[0],i=p[1]+d[0];t.arc(e,i,d[0],Xp,Xp+VS,!1)}return t.closePath(),t}function YS(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 qS(t,e){return Math.sqrt(t*t+e*e)}function KS(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.DefaultCanvasRectRender=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=Db}drawShape(e,i,n,r,s,o,a,h){const l=gy(e,null==o?void 0:o.theme).rect,{fill:c=l.fill,background:u,stroke:d=l.stroke,width:p=l.width,height:f=l.height,cornerRadius:g=l.cornerRadius,opacity:v=l.opacity,fillOpacity:y=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:S=l.y}=e.attribute,A=tx(v,y,p,f,c),T=ix(v,b,p,f),B=Zb(c,u),C=Jb(d,m);if(!e.valid||!x)return;if(!B&&!C)return;if(!(A||T||a||h||u))return;0===g||Dp(g)&&g.every((t=>0===t))?(i.beginPath(),i.rect(n,r,p,f)):(i.beginPath(),XS(i,n,r,p,f,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const _={doFill:B,doStroke:C};this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h,_)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):A&&(i.setCommonStyle(e,e.attribute,w-n,S-r,l),i.fill())),_.doStroke&&(h?h(i,e.attribute,l):T&&(i.setStrokeStyle(e,e.attribute,w-n,S-r,l),i.stroke())),this._rectRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).rect;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);nx(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasRectRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(bx)),fp("design:paramtypes",[Object])],t.DefaultCanvasRectRender),t.DefaultCanvasSymbolRender=class extends t.BaseRender{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Ub}drawShape(e,i,n,r,s,o,a,h){var l;const c=gy(e,null==o?void 0:o.theme).symbol,{size:u=c.size,fill:d=c.fill,background:p,fillOpacity:f=c.fillOpacity,strokeOpacity:g=c.strokeOpacity,opacity:v=c.opacity,lineWidth:y=c.lineWidth,stroke:m=c.stroke,visible:b=c.visible,x:x=c.x,y:w=c.y,scaleX:S=c.scaleX,scaleY:A=c.scaleY}=e.attribute,T=Qb(v,f,d),B=ex(v,g),C=Zb(d,p),_=Jb(m,y);if(!e.valid||!b)return;if(!C&&!_)return;if(!(T||B||a||h||p))return;const P=e.getParsedPath();if(!P)return;const{keepDirIn3d:E=c.keepDirIn3d}=e.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;if(i.beginPath(),E&&i.camera&&i.project){const t=i.project(n,r,M),e=i.camera;i.camera=null,!1===P.draw(i,u,t.x,t.y)&&i.closePath(),i.camera=e}else!1===P.draw(i,u,n,r,M)&&i.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,C,_,T,B,c,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),C&&(a?a(i,e.attribute,c):T&&(i.setCommonStyle(e,e.attribute,x-n,w-r,c),i.fill())),_&&(h?h(i,e.attribute,c):B&&(i.setStrokeStyle(e,e.attribute,(x-n)/S,(w-r)/A,c),i.stroke())),this._symbolRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,C,_,T,B,c,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).symbol,o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,nx(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}},t.DefaultCanvasSymbolRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(xx)),fp("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender),t.DefaultCanvasTextRender=class extends t.BaseRender{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Wb}drawShape(e,i,n,r,s,o,a,h){var l;const c=gy(e,null==o?void 0:o.theme).text,{text:u,fill:d=c.fill,stroke:p=c.stroke,fillOpacity:f=c.fillOpacity,strokeOpacity:g=c.strokeOpacity,opacity:v=c.opacity,lineWidth:y=c.lineWidth,visible:m=c.visible,underline:b=c.underline,lineThrough:x=c.lineThrough,keepDirIn3d:w=c.keepDirIn3d,direction:S=c.direction,fontSize:A=c.fontSize,textBaseline:T=c.textBaseline,textAlign:B=c.textAlign,x:C=c.x,y:_=c.y}=e.attribute,P=null!==(l=e.attribute.lineHeight)&&void 0!==l?l:A,E=Qb(v,f,d),M=ex(v,g),k=Zb(d),R=Jb(p,y);if(!e.valid||!m)return;if(!(k||R||E||M))return;const O=!w,D=this.z||0;if(i.beginPath(),!this._textBeforeRenderContribitions){const e=this.textRenderContribitions.getContributions()||[];e.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],e.forEach((e=>{e.time===t.BaseRenderContributionTime.beforeFillStroke?this._textBeforeRenderContribitions.push(e):this._textAfterRenderContribitions.push(e)}))}this._textBeforeRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,k,R,E,M,c,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,c),O&&this.transformUseContext2d(e,c,D,i);const I=(t,s,o,l)=>{let u=n+s;const d=r+o;if(l){i.highPerformanceSave(),u+=A;const t=oS.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),i.transformFromMatrix(t,!0),oS.free(t)}R&&(h?h(i,e.attribute,c):M&&(i.setStrokeStyle(e,e.attribute,C-n,_-r,c),i.strokeText(t,u,d,D))),k&&(a?a(i,e.attribute,c):E&&(i.setCommonStyle(e,e.attribute,C-n,_-r,c),i.fillText(t,u,d,D),this.drawUnderLine(b,x,e,u,d,D,c,i))),l&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(Array.isArray(u))if(i.setTextStyleWithoutAlignBaseline(e.attribute,c,D),"horizontal"===S){const{multilineLayout:t}=e;if(!t)return void i.highPerformanceRestore();const{xOffset:s,yOffset:o}=t.bbox;R&&(h?h(i,e.attribute,c):M&&(i.setStrokeStyle(e,e.attribute,C-n,_-r,c),t.lines.forEach((t=>{i.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,D)})))),k&&(a?a(i,e.attribute,c):E&&(i.setCommonStyle(e,e.attribute,C-n,_-r,c),t.lines.forEach((t=>{i.fillText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+o+r,D),this.drawMultiUnderLine(b,x,e,(t.leftOffset||0)+n,(t.topOffset||0)+o+r,D,t.width,c,i)}))))}else{const t=e.cache,{verticalList:n}=t;i.textAlign="left",i.textBaseline="top";const r=P*n.length;let s=0;n.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=Qp(e,s)}));let o=0,a=0;"bottom"===T?a=-r:"middle"===T&&(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;I(i,r-(e+1)*P+a,h,s),h+=n}))}))}else{const t=e.cache;if("horizontal"===S){i.setTextStyle(e.attribute,c,D);const t=e.clipedText;let n=0;P!==A&&("top"===T?n=(P-A)/2:"middle"===T||"bottom"===T&&(n=-(P-A)/2)),I(t,0,n,0)}else if(t){i.setTextStyleWithoutAlignBaseline(e.attribute,c,D);const{verticalList:n}=t;let r=0;const s=n[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===T?o=-P:"middle"===T&&(o=-P/2),"center"===B?r-=s/2:"right"===B&&(r-=s),i.textAlign="left",i.textBaseline="top",n[0].forEach((t=>{const{text:e,width:i,direction:n}=t;I(e,o,r,n),r+=i}))}}O&&this.restoreTransformUseContext2d(e,c,D,i),this._textAfterRenderContribitions.forEach((t=>{t.drawShape(e,i,n,r,k,R,E,M,c,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,r,a),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.z=u,this.drawShape(t,r,l,c,i,n),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,i,n,r,s,o,a){if(e+t<=0)return;const{textAlign:h=o.textAlign,textBaseline:l=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:p=o.fillOpacity}=i.attribute,f=i.clipedWidth,g=_x(h,f),v=Px(l,c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};if(t){y.lineWidth=t,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const e=r+v+c;a.moveTo(n+g,e,s),a.lineTo(n+g+f,e,s),a.stroke()}if(e){y.lineWidth=e,a.setStrokeStyle(i,y,n,r,o),a.beginPath();const t=r+v+c/2;a.moveTo(n+g,t,s),a.lineTo(n+g+f,t,s),a.stroke()}}drawMultiUnderLine(t,e,i,n,r,s,o,a,h){if(e+t<=0)return;const{textAlign:l=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:p=a.fillOpacity}=i.attribute,f=_x(l,o),g=Px("alphabetic",c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:p};let y=-3;if(t){v.lineWidth=t,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const e=r+g+c+y;h.moveTo(n+f,e,s),h.lineTo(n+f+o,e,s),h.stroke()}if(y=-1,e){v.lineWidth=e,h.setStrokeStyle(i,v,n,r,a),h.beginPath();const t=r+g+c/2+y;h.moveTo(n+f,t,s),h.lineTo(n+f+o,t,s),h.stroke()}}},t.DefaultCanvasTextRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(Sx)),fp("design:paramtypes",[Object])],t.DefaultCanvasTextRender),t.AbstractGraphicRender=class{},t.AbstractGraphicRender=dp([rp()],t.AbstractGraphicRender),t.DefaultCanvasPolygonRender=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=Rb}drawShape(e,i,n,r,s,o,a,h){const l=gy(e,null==o?void 0:o.theme).polygon,{points:c=l.points,fill:u=l.fill,stroke:d=l.stroke,cornerRadius:p=l.cornerRadius,fillOpacity:f=l.fillOpacity,background:g,strokeOpacity:v=l.strokeOpacity,lineWidth:y=l.lineWidth,opacity:m=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y}=e.attribute,S=Qb(m,f,u),A=ex(m,v),T=Zb(u,g),B=Jb(d,y);e.valid&&b&&(T||B)&&(S||A||a||h||g)&&(i.beginPath(),p<=0||Dp(p)&&p.every((t=>0===t))?YS(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r){var s;if(e.length<3)YS(t,e,i,n);else for(let o=0;o<e.length;o++){const a=e[o],h=e[(o+1)%e.length],l=e[(o+2)%e.length],c=h.x-a.x,u=h.y-a.y,d=h.x-l.x,p=h.y-l.y,f=(Math.atan2(u,c)-Math.atan2(p,d))/2,g=Math.abs(Math.tan(f));let v=Array.isArray(r)?null!==(s=r[(o+1)%e.length])&&void 0!==s?s:0:r,y=v/g;const m=qS(c,u),b=qS(d,p),x=Math.min(m,b);y>x&&(y=x,v=x*g);const w=KS(h,y,m,c,u),S=KS(h,y,b,d,p),A=2*h.x-w.x-S.x,T=2*h.y-w.y-S.y,B=qS(A,T),C=KS(h,qS(y,v),B,A,T);let _=Math.atan2(w.y-C.y,w.x-C.x);const P=Math.atan2(S.y-C.y,S.x-C.x);let E=P-_;E<0&&(_=P,E=-E),E>Math.PI&&(E-=Math.PI),0===o?t.moveTo(w.x+i,w.y+n):t.lineTo(w.x+i,w.y+n),E&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,v),t.lineTo(S.x+i,S.y+n)}}(i.camera?i:i.nativeContext,c,n,r,p),i.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,T,B,S,A,l,s,a,h)})),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),T&&(a?a(i,e.attribute,l):f&&(i.setCommonStyle(e,e.attribute,x-n,w-r,l),i.fill())),B&&(h?h(i,e.attribute,l):v&&(i.setStrokeStyle(e,e.attribute,x-n,w-r,l),i.stroke())),this._polygonRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,T,B,S,A,l,s,a,h)})))}draw(t,e,i,n){const{context:r}=i;if(!r)return;r.highPerformanceSave();const s=gy(t,null==n?void 0:n.theme).polygon;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);nx(t,r,o,a,0,n)||this.drawShape(t,r,o,a,i,n),r.highPerformanceRestore()}},t.DefaultCanvasPolygonRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(mx)),fp("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);const $S=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class{constructor(t){this.imageRenderContribitions=t,this.numberType=Eb}drawShape(e,i,n,r,s,o,a){const h=gy(e).image,{fill:l=h.fill,width:c=h.width,height:u=h.height,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,visible:f=h.visible,repeatX:g=h.repeatX,repeatY:v=h.repeatY,image:y}=e.attribute,m=Qb(d,p,l),b=Zb(l);if(e.valid&&f&&b&&(m||a)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,b,!1,m,!1,h,s,a)})),i.setShadowStyle&&i.setShadowStyle(e,h),b)if(a)a(i,e.attribute,h);else if(m){if(!y||!e.resources)return;const t=e.resources.get(y);if("success"!==t.state)return;i.setCommonStyle(e,e.attribute,n,r,h);let s=0;if("repeat"===g&&(s|=1),"repeat"===v&&(s|=2),s){const e=i.createPattern(t.data,$S[s]);i.fillStyle=e,i.fillRect(n,r,c,u)}else i.drawImage(t.data,n,r,c,u)}this._imageRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,i,n,r,b,!1,m,!1,h,s,a)}))}}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=gy(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(!a||!t.resources)return;if("success"===t.resources.get(a).state){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);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}}},t.DefaultCanvasImageRender=dp([rp(),pp(0,ap(vp)),pp(0,sp(vx)),fp("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const ZS=Symbol.for("IncrementalDrawContribution"),JS=Symbol.for("ArcRender"),QS=Symbol.for("Arc3dRender"),tA=Symbol.for("AreaRender"),eA=Symbol.for("CircleRender"),iA=Symbol.for("GraphicRender"),nA=Symbol.for("GroupRender"),rA=Symbol.for("LineRender"),sA=Symbol.for("PathRender"),oA=Symbol.for("PolygonRender"),aA=Symbol.for("RectRender"),hA=Symbol.for("Rect3DRender"),lA=Symbol.for("SymbolRender"),cA=Symbol.for("TextRender"),uA=Symbol.for("RichTextRender"),dA=Symbol.for("Pyramid3dRender"),pA=Symbol.for("GlyphRender"),fA=Symbol.for("ImageRender"),gA=Symbol.for("RenderSelector"),vA=Symbol.for("DrawContribution");function yA(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 mA(t,e,i,n,r){if(!e||!0===e)return"black";let s,o;if(Dp(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o,a,h;const l=i.AABBBounds;if(!l)return;let c=l.x2-l.x1,u=l.y2-l.y1,d=l.x1-n,p=l.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,p/=e}const f=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,p+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,p+(null!==(h=e.y1)&&void 0!==h?h:0)*u);return e.stops.forEach((t=>{f.addColorStop(t.offset,t.color)})),f}(t,o,i,n,r):"conical"===o.gradient?s=function(t,e,i,n=0,r=0){var s,o;const a=i.AABBBounds;if(!a)return;let h=a.x2-a.x1,l=a.y2-a.y1,c=a.x1-n,u=a.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;h/=t,l/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*h,u+(null!==(o=e.y)&&void 0!==o?o:0)*l,e.startAngle,e.endAngle);let p;return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(h+c,l+u,p)}(t,o,i,n,r):"radial"===o.gradient&&(s=function(t,e,i,n=0,r=0){var s,o,a,h,l,c;const u=i.AABBBounds;if(!u)return;let d=u.x2-u.x1,p=u.y2-u.y1,f=u.x1-n,g=u.y1-r;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;if(t*e==0)return;f/=t,g/=e,d/=t,p/=e}const v=t.createRadialGradient(f+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*p,Math.max(d,p)*(null!==(a=e.r0)&&void 0!==a?a:0),f+(null!==(h=e.x1)&&void 0!==h?h:.5)*d,g+(null!==(l=e.y1)&&void 0!==l?l:.5)*p,Math.max(d,p)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{v.addColorStop(t.offset,t.color)})),v}(t,o,i,n,r)),s||"orange")}const bA=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return Mv(Object.assign({nativeCanvas:fv.global.createCanvas(t)},t));const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr};return Mv(Object.assign({nativeCanvas:fv.global.createCanvas(e)},e))}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};t.DefaultBaseBackgroundRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{background:p}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=gy(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},t.DefaultBaseBackgroundRenderContribution=dp([rp()],t.DefaultBaseBackgroundRenderContribution),t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,o,a,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=dp([rp(),pp(0,ap(vp)),pp(0,sp(Ax)),fp("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution),t.DefaultBaseTextureRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,o=bA.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const h=n.createPattern(o.nativeCanvas,"repeat");return bA.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Kp),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;if(!p)return;let y=this.textureMap.get(p);if(!y)switch(p){case"circle":y=this.createCirclePattern(g,v,f,e);break;case"diamond":y=this.createDiamondPattern(g,v,f,e);break;case"rect":y=this.createRectPattern(g,v,f,e);break;case"vertical-line":y=this.createVerticalLinePattern(g,v,f,e);break;case"horizontal-line":y=this.createHorizontalLinePattern(g,v,f,e);break;case"bias-lr":y=this.createBiasLRLinePattern(g,v,f,e);break;case"bias-rl":y=this.createBiasRLLinePattern(g,v,f,e);break;case"grid":y=this.createGridPattern(g,v,f,e)}y&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=y,e.fill(),e.highPerformanceRestore())}},t.DefaultBaseTextureRenderContribution=dp([rp()],t.DefaultBaseTextureRenderContribution),t.DefaultArcRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{innerRadius:d=h.innerRadius,outerRadius:p=h.outerRadius,startAngle:f=h.startAngle,endAngle:g=h.endAngle,opacity:v=h.opacity,outerBorder:y,innerBorder:m}=t.attribute;if(y){const{distance:r=h.outerBorder.distance}=y,s=yA(e,r,e.dpr),o=r/p;if(t.setAttributes({outerRadius:p+s,innerRadius:d-s,startAngle:f-o,endAngle:g+o}),e.beginPath(),ox(t,e,i,n,p+s,d-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=v,e.setStrokeStyle(t,y,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(m){const{distance:r=h.innerBorder.distance}=m,s=yA(e,r,e.dpr),o=r/p;if(t.setAttributes({outerRadius:p-s,innerRadius:d+s,startAngle:f+o,endAngle:g-o}),e.beginPath(),ox(t,e,i,n,p-s,d+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,m,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=v,e.setStrokeStyle(t,m,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:p,innerRadius:d,startAngle:f,endAngle:g})}},t.DefaultArcRenderContribution=dp([rp()],t.DefaultArcRenderContribution),t.DefaultArcBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultArcBackgroundRenderContribution=dp([rp()],t.DefaultArcBackgroundRenderContribution),t.DefaultArcTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultArcTextureRenderContribution=dp([rp()],t.DefaultArcTextureRenderContribution),t.DefaultCircleRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{radius:d=h.radius,startAngle:p=h.startAngle,endAngle:f=h.endAngle,opacity:g=h.opacity,outerBorder:v,innerBorder:y}=t.attribute;if(v){const{distance:r=h.outerBorder.distance}=v,s=yA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d+s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,v,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,v,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=h.innerBorder.distance}=y,s=yA(e,r,e.dpr);if(e.beginPath(),e.arc(i,n,d-s,p,f),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultCircleRenderContribution=dp([rp()],t.DefaultCircleRenderContribution),t.DefaultCircleBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultCircleBackgroundRenderContribution=dp([rp()],t.DefaultCircleBackgroundRenderContribution),t.DefaultCircleTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultCircleTextureRenderContribution=dp([rp()],t.DefaultCircleTextureRenderContribution),t.DefaultGroupBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}},t.DefaultGroupBackgroundRenderContribution=dp([rp()],t.DefaultGroupBackgroundRenderContribution),t.DefaultImageBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{background:d,width:p,height:f}=t.attribute;if(d)if(t.backgroundImg){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=gy(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}const n=t.AABBBounds;e.drawImage(i.data,n.x1,n.y1,n.width(),n.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else{e.beginPath();const r=t.AABBBounds;e.rect(i,n,r.width(),r.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}},t.DefaultImageBackgroundRenderContribution=dp([rp()],t.DefaultImageBackgroundRenderContribution),t.DefaultRectRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{width:d=h.width,height:p=h.height,cornerRadius:f=h.cornerRadius,opacity:g=h.opacity,outerBorder:v,innerBorder:y}=t.attribute;if(v){const{distance:r=h.outerBorder.distance}=v,s=yA(e,r,e.dpr),o=i-s,l=n-s,c=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(o,l,d+c,p+c)):(e.beginPath(),XS(e,o,l,d+c,p+c,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,v,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=g,e.setStrokeStyle(t,v,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=h.innerBorder.distance}=y,s=yA(e,r,e.dpr),o=i+s,l=n+s,c=2*s;if(0===f||Dp(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(o,l,d-c,p-c)):(e.beginPath(),XS(e,o,l,d-c,p-c,f)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,y,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=g,e.setStrokeStyle(t,y,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}},t.DefaultRectRenderContribution=dp([rp()],t.DefaultRectRenderContribution),t.DefaultRectBackgroundRenderContribution=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}},t.DefaultRectBackgroundRenderContribution=dp([rp()],t.DefaultRectBackgroundRenderContribution),t.DefaultRectTextureRenderContribution=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}},t.DefaultRectTextureRenderContribution=dp([rp()],t.DefaultRectTextureRenderContribution),t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=dp([rp()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{width:d=h.width,height:p=h.height,stroke:f=h.stroke}=t.attribute;if(Array.isArray(f)&&f.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),e.beginPath(),e.moveTo(i,n),f[0]?e.lineTo(i+d,n):e.moveTo(i+d,n),f[1]?e.lineTo(i+d,n+p):e.moveTo(i+d,n+p),f[2]?e.lineTo(i,n+p):e.moveTo(i,n+p),f[3]){const t=f[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=dp([rp()],t.SplitRectAfterRenderContribution),t.DefaultSymbolRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,o,a,h,l,c,u){const{size:d=h.size,opacity:p=h.opacity,outerBorder:f,innerBorder:g}=t.attribute,v=t.getParsedPath();if(v){if(f){const{distance:r=h.outerBorder.distance}=f,s=yA(e,r,e.dpr);if(e.beginPath(),!1===v.drawOffset(e,d,i,n,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,f,h.outerBorder);else if(a){const r=h.outerBorder.opacity;h.outerBorder.opacity=p,e.setStrokeStyle(t,f,i,n,h.outerBorder),h.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=h.innerBorder.distance}=g,s=yA(e,r,e.dpr);if(e.beginPath(),!1===v.drawOffset(e,d,i,n,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),u)u(e,g,h.innerBorder);else if(a){const r=h.innerBorder.opacity;h.innerBorder.opacity=p,e.setStrokeStyle(t,g,i,n,h.innerBorder),h.innerBorder.opacity=r,e.stroke()}}}}},t.DefaultSymbolRenderContribution=dp([rp()],t.DefaultSymbolRenderContribution);class xA extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}}class wA extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}}const SA=Symbol.for("RenderService"),AA=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}},t.DefaultRenderService=dp([rp(),pp(0,ap(vA)),fp("design:paramtypes",[Object])],t.DefaultRenderService);var TA=new Qd((e=>{e(t.DefaultRenderService).toSelf(),e(SA).toService(t.DefaultRenderService)}));function BA(t,e,i,n=!1,r=!1){const s={},o=[];let a=!1;if(r)a=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return a=!0,!0;return!1}),n)}if(a){t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],o.push(i))}),n),o.sort(((t,e)=>n?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],h=s[e];r&&h.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<h.length;t++)if(i(h[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}function CA(t,e,i,n=!1){return gp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function _A(t,e,i,n=!1){const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(undefined!==n)return o=!0,!0;return!1}),n);let a=null,h=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=i}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),n),s.sort(((t,e)=>n?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const i=s[t],n=r[i];for(let t=0;t<n.length;t++){if(h){o=!0,a=n[t];break}n[t]._uid!==e||(h=!0)}}}else t.forEachChildren((t=>h?(a=t,!0):(t._uid===e&&(h=!0),!1)),n);return a}const PA=Symbol.for("PickItemInterceptor");let EA=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,h=!1;if(t.forEachChildren((t=>(a=t.numberType===Tb,!a))),t.forEachChildren((t=>(h=!!t.findFace,!h))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var i,n,r,s;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=Kp;for(;a<0;)a+=Kp;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",o=e.pickGroup(t,i,r.parentMatrix,n),o.graphic||(n.hack_pieFace="inside",o=e.pickGroup(t,i,r.parentMatrix,n)),o.graphic||(n.hack_pieFace="top",o=e.pickGroup(t,i,r.parentMatrix,n)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(h){const a=t.getChildren(),h=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));h.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),h.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),h.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,i,r.parentMatrix,n),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,i,r.parentMatrix,n);return s.camera=null,s.restore(),n.in3dInterceptor=!1,o}return null}initCanvasCtx(t){t.setTransformForCurrent()}};EA=dp([rp()],EA);const MA=Symbol.for("GraphicPicker"),kA=Symbol.for("PickerService");t.DefaultPickService=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;let r=0,s=0;if(i&&i.bounds){if(!i.bounds.contains(e.x,e.y))return n;r=i.bounds.x1,s=i.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new Bf(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(t[r].isContainer?n=this.pickGroup(t[r],e,o,i):n.graphic=this.pickItem(t[r],e,i),!n.graphic);r--)a||(a=n.group);return n.graphic||(n.group=a),this.pickContext&&(this.pickContext.inuse=!1),n}containsPoint(t,e,i){return!!this.pickItem(t,e,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=aS.allocate();if(uS(i,e),o){if(i){const t=aS.allocate();s.modelMatrix=dS(t,o,i),aS.free(i)}}else uS(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&&aS.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,h=oS.allocateByObj(i),l=new lf(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;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&&BA(t,Jg.zIndex,(i=>{if(i.isContainer){const s=new lf(e.x,e.y),o=gy(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;s.x-=a,s.y-=l,r=this.pickGroup(i,s,h,n)}else{const s=new lf(e.x,e.y);h.transformPoint(s,s);const o=gy(t).group,{scrollX:a=o.scrollX,scrollY:l=o.scrollY}=t.attribute;s.x-=a,s.y-=l;const c=this.pickItem(i,s,n);r.graphic=c}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&aS.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!u||t.stage.camera||(r.group=t),oS.free(h),r}selectPicker(t){const e=this.pickerMap.get(t.numberType);return e||null}},t.DefaultPickService=dp([rp(),pp(0,ap(Sp)),pp(1,ap(vp)),pp(1,sp(PA)),fp("design:paramtypes",[Object,Object])],t.DefaultPickService);const RA=Symbol.for("BoundsPicker"),OA=Symbol.for("GlobalPickerService");function DA(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],y=e[14],m=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*a+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*y,t[3]=b*o+x*c+w*f+S*m,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*a+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*y,t[7]=b*o+x*c+w*f+S*m,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*a+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*y,t[11]=b*o+x*c+w*f+S*m,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*a+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*y,t[15]=b*o+x*c+w*f+S*m,t}function IA(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}t.DefaultGlobalPickerService=class{constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new Bf(1,0,0,1,0,0);let s;for(let o=0;o<t.length&&(t[o].isContainer?n=this.pickGroup(t[o],e,r,i):n.graphic=this.pickItem(t[o],e,i),!n.graphic);o++)s||(s=n.group);return n.graphic||(n.group=s),n}containsPoint(t,e,i){return!!this.pickItem(t,e,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 lf(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 lf(e.x,e.y);i.transformPoint(s,s),r.graphic=this.pickItem(t,s,n)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}},t.DefaultGlobalPickerService=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],t.DefaultGlobalPickerService);class LA{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=aS.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=aS.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let r,s,o,a,h,l,c,u,d,p;const f=e[0],g=e[1],v=e[2],y=n[0],m=n[1],b=n[2],x=i[0],w=i[1],S=i[2];Math.abs(f-x)<Vp&&Math.abs(g-w)<Vp&&Math.abs(v-S)<Vp?sS.identity(t):(c=f-x,u=g-w,d=v-S,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=m*d-b*u,s=b*c-y*d,o=y*u-m*c,p=Math.hypot(r,s,o),p?(p=1/p,r*=p,s*=p,o*=p):(r=0,s=0,o=0),a=u*o-d*s,h=d*r-c*o,l=c*s-u*r,p=Math.hypot(a,h,l),p?(p=1/p,a*=p,h*=p,l*=p):(a=0,h=0,l=0),t[0]=r,t[1]=a,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+o*v),t[13]=-(a*f+h*g+l*v),t[14]=-(c*f+u*g+d*v),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=aS.allocate()),this._vp=DA(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=aS.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=aS.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,r,s,o){const a=1/(e-i),h=1/(n-r),l=1/(s-o);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}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=aS.allocate()),this._vp=DA(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return IA(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;IA(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}const UA=[0,0,0],WA=new Bf(1,0,0,1,0,0);t.BrowserContext2d=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}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Xg),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},qg),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Kg),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Bf(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Bf(1,0,0,1,0,0)}reset(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Bf(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(t=!1){!t&&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 oS.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&&(oS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(oS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.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-=Kp;else for(;i<e;)i+=Kp;const h=Xp/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,u=c<l?-1:1,d=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=d*s+n,y=p*o+r,m=f*s+n,b=g*o+r,x=s*a*u,w=o*a*u;t.push([v-x*p,y+w*d,m+x*g,b-w*f,m,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&&(IA(UA,[t,e,o],this.modelMatrix),t=UA[0],e=UA[1],a=UA[2],IA(UA,[i,n,o],this.modelMatrix),i=UA[0],n=UA[1],h=UA[2],IA(UA,[r,s,o],this.modelMatrix),r=UA[0],s=UA[1],o=UA[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&&(IA(UA,[t,e,i],this.modelMatrix),t=UA[0],e=UA[1],i=UA[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&&(IA(UA,[t,e,i],this.modelMatrix),t=UA[0],e=UA[1],i=UA[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&&(IA(UA,[t,e,r],this.modelMatrix),t=UA[0],e=UA[1],s=UA[2],IA(UA,[i,n,r],this.modelMatrix),i=UA[0],n=UA[1],r=UA[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=ux(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&&(IA(UA,[t,e,i],this.modelMatrix),t=UA[0],e=UA[1],i=UA[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&&(IA(UA,[t,e,i],this.modelMatrix),t=UA[0],e=UA[1],i=UA[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(IA(UA,[e,i,n],this.modelMatrix),e=UA[0],i=UA[1],n=UA[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,e=fv.global.measureTextMethod){var i,n;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=fv.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(i=this.fontFamily)&&void 0!==i?i:Kg.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(n=this.fontSize)&&void 0!==n?n:Kg.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,e)):this.nativeContext.measureText(t)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?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&&(IA(UA,[e,i,n],this.modelMatrix),e=UA[0],i=UA[1],n=UA[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={};return r.forEach((t=>{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,s.fillStyle=mA(this,h,t,i,n)):s.globalAlpha=o*a}setShadowStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowStyle(t,i[0]);const n={};return i.forEach((t=>{Object.assign(n,t)})),this._setShadowStyle(t,e,n)}return this._setShadowStyle(t,e,i)}_setShadowStyle(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}=e;r<=1e-12||(s||a||h?(n.shadowBlur=s,n.shadowColor=o,n.shadowOffsetX=a,n.shadowOffsetY=h,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))}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={};return r.forEach((t=>{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:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=yA(this,h,this.dpr),s.strokeStyle=mA(this,l,t,i,n),s.lineJoin=c,s.setLineDash(u),s.lineCap=d,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=Cx(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=Cx(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(WA,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>oS.free(t))),this.stack.length=0}},t.BrowserContext2d.env="browser",t.BrowserContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.BrowserContext2d);const NA={WIDTH:500,HEIGHT:500,DPR:1};t.BrowserCanvas=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.width,this.height)}constructor(e){const{nativeCanvas:i,width:n=NA.WIDTH,height:r=NA.HEIGHT,dpr:s=NA.DPR,container:o,x:a,y:h,canvasControled:l=!0}=e;if(this._x=null!=a?a:0,this._y=null!=h?h:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==e.visiable,this.controled=l,"string"==typeof o){const t=fv.global.getElementById(o);t&&(this._container=t)}else this._container=o;this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._context=new t.BrowserContext2d(this,this._dpr),this._id=i.id,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),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}getNativeCanvas(){return this._nativeCanvas}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.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${n}px`,t.style.height=`${r}px`)}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}resize(t,e){if(!this.controled)return;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}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}},t.BrowserCanvas.env="browser",t.BrowserCanvas=dp([rp(),fp("design:paramtypes",[Object])],t.BrowserCanvas);const FA=Symbol.for("CanvasArcPicker"),jA=Symbol.for("CanvasArc3dPicker"),zA=Symbol.for("CanvasAreaPicker"),HA=Symbol.for("CanvasCirclePicker"),GA=Symbol.for("CanvasImagePicker"),VA=Symbol.for("CanvasLinePicker"),XA=Symbol.for("CanvasPathPicker"),YA=Symbol.for("CanvasRectPicker"),qA=Symbol.for("CanvasRect3dPicker"),KA=Symbol.for("CanvasSymbolPicker"),$A=Symbol.for("CanvasTextPicker"),ZA=Symbol.for("CanvasPolygonPicker"),JA=Symbol.for("CanvasPyramid3dPicker"),QA=Symbol.for("CanvasRichTextPicker"),tT=Symbol.for("CanvasGlyphPicker"),eT=Symbol.for("CanvasPickerContribution"),iT=Symbol.for("MathArcPicker"),nT=Symbol.for("MathAreaPicker"),rT=Symbol.for("MathCirclePicker"),sT=Symbol.for("MathLinePicker"),oT=Symbol.for("MathPathPicker"),aT=Symbol.for("MathRectPicker"),hT=Symbol.for("MathSymbolPicker"),lT=Symbol.for("MathTextPicker"),cT=Symbol.for("MathPolygonPicker"),uT=Symbol.for("MathGlyphPicker"),dT=Symbol.for("MathPickerContribution");t.DefaultCanvasPickerService=class extends t.DefaultPickService{constructor(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){super(p,f),this.contributions=t,this.circlePicker=e,this.rectPicker=i,this.arcPicker=n,this.areaPicker=r,this.imagePicker=s,this.linePicker=o,this.pathPicker=a,this.symbolPicker=h,this.textPicker=l,this.polygonPicker=c,this.richtextPicker=u,this.drawContribution=d,this.global=p,this.pickItemInterceptorContributions=f,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}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){const n={width:100,height:100,nativeCanvas:e.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new t.BrowserCanvas(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforePickItem&&r.beforePickItem(t,this,e,i))return t}const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultCanvasPickerService.prototype,"init",null),t.DefaultCanvasPickerService=dp([rp(),pp(0,ap(vp)),pp(0,sp(eT)),pp(1,ap(HA)),pp(2,ap(YA)),pp(3,ap(FA)),pp(4,ap(zA)),pp(5,ap(GA)),pp(6,ap(VA)),pp(7,ap(XA)),pp(8,ap(KA)),pp(9,ap($A)),pp(10,ap(ZA)),pp(11,ap(QA)),pp(12,ap(vA)),pp(13,ap(Sp)),pp(14,ap(vp)),pp(14,sp(PA)),fp("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],t.DefaultCanvasPickerService);const pT=new Bf(1,0,0,1,0,0),fT={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Bf(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Bf(1,0,0,1,0,0),this.path=new jg}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return oS.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(oS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(oS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,r=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s,o=!0,a=this.dpr){this.matrix.setValue(a*t,a*e,a*i,a*n,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s,o=!0){this.matrix.multiply(t,e,i,n,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},fT),function(t,e,i){return sy(t,0,!1,e,i)}(this.path.commandList,fT.x,fT.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},fT);const i=yA(this,this.lineWidth,this.dpr);return function(t,e,i,n){return sy(t,e,!0,i,n)}(this.path.commandList,i,fT.x,fT.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(pT,t,e)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>oS.free(t))),this.stack.length=0}},t.EmptyContext2d=dp([rp(),fp("design:paramtypes",[Object,Number])],t.EmptyContext2d),t.DefaultMathPickerService=class extends t.DefaultPickService{constructor(t,e,i){super(e,i),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=i,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}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){if(!1===t.attribute.pickable)return null;const n=this.pickerMap.get(t.numberType);return n&&n.contains(t,e,i)?t:null}},dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],t.DefaultMathPickerService.prototype,"init",null),t.DefaultMathPickerService=dp([rp(),pp(0,ap(vp)),pp(0,sp(dT)),pp(1,ap(Sp)),pp(2,ap(vp)),pp(2,sp(PA)),fp("design:paramtypes",[Object,Object,Object])],t.DefaultMathPickerService);var gT=new Qd((e=>{e(t.DefaultCanvasPickerService).toSelf().inSingletonScope(),e(t.DefaultMathPickerService).toSelf().inSingletonScope(),e(kA).toService(t.DefaultCanvasPickerService),e(t.DefaultGlobalPickerService).toSelf().inSingletonScope(),e(OA).toService(t.DefaultGlobalPickerService),e(EA).toSelf().inSingletonScope(),e(PA).toService(EA),mp(e,PA)})),vT=new Qd((e=>{e(t.DefaultGraphicService).toSelf().inSingletonScope(),e(Nb).toService(t.DefaultGraphicService),e($w).toSelf().inSingletonScope(),e(Kw).toService($w),mp(e,Kw),e(Jw).toSelf().inSingletonScope(),e(Zw).toService(Jw),mp(e,Zw),e(tS).toSelf().inSingletonScope(),e(Qw).toService(tS),mp(e,Qw),e(iS).toSelf().inSingletonScope(),e(eS).toService(iS),mp(e,eS),e(rS).toSelf().inSingletonScope(),e(nS).toService(rS),mp(e,nS),e(Fb).toConstantValue(OS)}));const yT=Symbol.for("AutoEnablePlugins"),mT=Symbol.for("PluginService");let bT=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&_v.isBound(yT)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};bT=dp([rp(),pp(0,ap(vp)),pp(0,sp(yT)),fp("design:paramtypes",[Object])],bT);var xT=new Qd((t=>{t(bT).toSelf(),t(mT).toService(bT),mp(t,yT)}));function wT(t,e=!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)}if(i.src=t,i.complete)return Promise.resolve(i);const n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}t.BaseEnvContribution=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}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){const e=fetch(t).then((t=>t.arrayBuffer()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){const e=fetch(t).then((t=>t.blob()));return e.then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}},t.BaseEnvContribution=dp([rp()],t.BaseEnvContribution);let ST=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i;if(e){const{clientX:n,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let a,h;return o&&(a=s.width/o.offsetWidth,h=s.height/o.offsetHeight),{x:(n-s.left)/(Lp(a)?a:1),y:(r-s.top)/(Lp(h)?a:1)}}return{x:t.offsetX,y:t.offsetY}}loadImage(t){return wT(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return wT(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const n=document.createElement("canvas");t.id&&(n.id=null!==(e=t.id)&&void 0!==e?e:yy.GenAutoIncrementId().toString());const r=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,n.width=t.width*r,n.height=t.height*r),n}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}};function AT(){_v.rebind(kA).toService(t.DefaultMathPickerService)}function TT(){_v.rebind(kA).toService(t.DefaultMathPickerService)}ST=dp([rp(),fp("design:paramtypes",[])],ST);let BT=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=tt.getSystemInfoSync().pixelRatio;e.forEach(((e,o)=>{const a=tt.createCanvasContext(e);a.canvas={width:t.width*s,height:t.height*s};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>a,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,h),o>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),AT())}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 hm.call(t)}}getCancelAnimationFrame(){return t=>{hm.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(...t){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};BT=dp([rp(),fp("design:paramtypes",[])],BT);let CT=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}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);n.canvas={width:i.width*h,height:i.height*h},n.createRadialGradient||(n.createRadialGradient=(...t)=>n.createCircularGradient(...t)),!n.getImageData&&a.canvasGetImageData&&(n.getImageData=(e,i,n,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:i,width:n,height:r,success(t){s(t)}})}catch(t){o(t)}})));const l={id:t,width:i.width*h,height:i.height*h,offsetWidth:i.width,offsetHeight:i.height,getContext:()=>n,getBoundingClientRect:()=>({height:i.height,width:i.width})};return r.set(t,l),e>=s&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,TT())}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(...t){}};CT=dp([rp(),fp("design:paramtypes",[])],CT);let _T=!1;try{_T=!!lynx.createCanvasNG}catch(t){}let PT=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r){const s=SystemInfo.pixelRatio;e.forEach(((e,o)=>{const a=_T?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,_T&&a.attachToCanvasView(e);const h=a.getContext("2d");h.draw=(t,e)=>{e()};const l={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>h,getBoundingClientRect:()=>({height:t.height,width:t.width})};i.set(e,l),o>=n&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),AT())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){const e=function(t,e=!1){if(e)return Promise.reject();const i=lynx.createImage(t),n=new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}));return n}(t,!1);return e.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 hm.call(t)}}getCancelAnimationFrame(){return t=>{hm.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(...t){}};PT=dp([rp(),fp("design:paramtypes",[])],PT);let ET=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 1}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){const e=fetch(t).then((t=>t.arrayBuffer()));return e.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 hm.call(t)}}getCancelAnimationFrame(){return t=>{hm.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};ET=dp([rp()],ET);let MT=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r){return gp(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let s=0;s<e.length;s++){const o=e[s];yield new Promise((e=>{wx.createSelectorQuery().select(`#${o}`).fields({node:!0,size:!0}).exec((a=>{const h=a[0].node,l=a[0].width,c=a[0].height;h.width=l*t,h.height=c*t,i.set(o,h),s>=n&&r.push(h),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList).then((()=>{AT()}))}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 hm.call(t)}}getCancelAnimationFrame(){return t=>{hm.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(...t){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};MT=dp([rp(),fp("design:paramtypes",[])],MT);var kT=new Qd((t=>{t(ST).toSelf().inSingletonScope(),t(wp).toService(ST),t(BT).toSelf().inSingletonScope(),t(wp).toService(BT),t(CT).toSelf().inSingletonScope(),t(wp).toService(CT),t(PT).toSelf().inSingletonScope(),t(wp).toService(PT),t(MT).toSelf().inSingletonScope(),t(wp).toService(MT),t(ET).toSelf().inSingletonScope(),t(wp).toService(ET),mp(t,wp)}));t.BaseWindowHandlerContribution=class{constructor(){this._uid=yy.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}},t.BaseWindowHandlerContribution=dp([rp(),fp("design:paramtypes",[])],t.BaseWindowHandlerContribution);let RT=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser"}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 this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(e){const i=this.global.createCanvas({width:e.width,height:e.height});let n;if(n="string"==typeof e.container?this.global.getElementById(e.container):e.container?e.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");e.offscreen?n=null:n.appendChild(i);const r={width:e.width,height:e.height,dpr:e.dpr,nativeCanvas:i,container:n,id:yy.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new t.BrowserCanvas(r)}createWindowByCanvas(e){var i;let n;if("string"==typeof e.canvas){if(n=this.global.getElementById(e.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=e.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let r=e.width,s=e.height;if(null==r||null==s||!e.canvasControled){const t=n.getBoundingClientRect();r=t.width,s=t.height}let o=e.dpr;if(!1===e.canvasControled&&(o&&console.warn("canvasControled为false后,dpr参数将无效"),o=null),null==o){o=null!==(i=n.getContext("2d").pixelRatio)&&void 0!==i?i:n.width/r}this.canvas=new t.BrowserCanvas({width:r,height:s,dpr:o,nativeCanvas:n,canvasControled:e.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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};RT.env="browser",RT=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],RT);let OT=class extends t.BrowserContext2d{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,i,n){return new Promise(((r,s)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o:this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}createPattern(t,e){return null}};OT.env="feishu",OT=dp([rp()],OT);const DT={WIDTH:500,HEIGHT:500,DPR:1};let IT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=DT.WIDTH,height:n=DT.HEIGHT,dpr:r=DT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new OT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};IT.env="feishu",IT=dp([rp(),fp("design:paramtypes",[Object])],IT);let LT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:yy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new IT(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 IT({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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};LT.env="feishu",LT=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],LT);let UT=class extends t.BrowserContext2d{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(mA(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:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(yA(this,h,this.dpr)),s.setStrokeStyle(mA(this,l,t,i,n)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=Cx(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Cx(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}};UT.env="taro",UT=dp([rp()],UT);const WT={WIDTH:500,HEIGHT:500,DPR:1};let NT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=WT.WIDTH,height:n=WT.HEIGHT,dpr:r=WT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new UT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};NT.env="taro",NT=dp([rp(),fp("design:paramtypes",[Object])],NT);let FT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:yy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new NT(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 NT({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]=Object.assign(Object.assign({},t.changedTouches[i]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]=Object.assign(Object.assign({},t.touches[i]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};FT.env="taro",FT=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],FT);let jT=class extends t.BrowserContext2d{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;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:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=yA(this,h,this.dpr),s.strokeStyle=mA(this,l,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};jT.env="lynx",jT=dp([rp()],jT);const zT={WIDTH:500,HEIGHT:500,DPR:1};let HT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=zT.WIDTH,height:n=zT.HEIGHT,dpr:r=zT.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new jT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};HT.env="lynx",HT=dp([rp(),fp("design:paramtypes",[Object])],HT);let GT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.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:yy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new HT(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 HT({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,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};GT.env="lynx",GT=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],GT),new Bf(1,0,0,1,0,0);let VT=class extends t.BrowserContext2d{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 Bf(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};VT.env="node",VT=dp([rp(),fp("design:paramtypes",[Object,Number])],VT);const XT={WIDTH:500,HEIGHT:500,DPR:1};let YT=class{get id(){return this._id}get x(){return 0}set x(t){}get y(){return 0}set 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 displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}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.width,this.height)}constructor(t){const{nativeCanvas:e,width:i=XT.WIDTH,height:n=XT.HEIGHT,canvasControled:r=!0,dpr:s=XT.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=i*s,this._pixelHeight=n*s,this._displayWidth=i,this._displayHeight=n,this._nativeCanvas=e,this._context=new VT(this,t.dpr),this._id=e.id,this._dpr=s}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}hide(){}show(){}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this._nativeCanvas.release&&Pp(this._nativeCanvas.release)&&this._nativeCanvas.release()}};YT.env="node",YT=dp([rp(),fp("design:paramtypes",[Object])],YT);let qT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:yy.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new YT(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 YT({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(t="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,e){}};qT.env="node",qT=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],qT);let KT=class extends t.BrowserContext2d{draw(){}createPattern(t,e){return null}};KT.env="wx",KT=dp([rp()],KT);const $T={WIDTH:500,HEIGHT:500,DPR:1};let ZT=class{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)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}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}constructor(t){const{nativeCanvas:e,width:i=$T.WIDTH,height:n=$T.HEIGHT,dpr:r=$T.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=i*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this._displayWidth=i,this._displayHeight=n,this._dpr=r,this._nativeCanvas=e,this._context=new KT(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){}};ZT.env="wx",ZT=dp([rp(),fp("design:paramtypes",[Object])],ZT);class JT{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let QT=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new JT}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:yy.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new ZT(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 ZT({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(i.fillStyle=e,i.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),i.nativeContext.restore()}};QT.env="wx",QT=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],QT);var tB=new Qd((t=>{t(RT).toSelf(),t(Xb).toDynamicValue((t=>t.container.get(RT))).whenTargetNamed(RT.env),t(LT).toSelf(),t(Xb).toDynamicValue((t=>t.container.get(LT))).whenTargetNamed(LT.env),t(FT).toSelf(),t(Xb).toDynamicValue((t=>t.container.get(FT))).whenTargetNamed(FT.env),t(GT).toSelf(),t(Xb).toDynamicValue((t=>t.container.get(GT))).whenTargetNamed(GT.env),t(QT).toSelf(),t(Xb).toDynamicValue((t=>t.container.get(QT))).whenTargetNamed(QT.env),t(qT).toSelf(),t(Xb).toDynamicValue((t=>t.container.get(qT))).whenTargetNamed(qT.env)})),eB=new Qd((t=>{t(Cv).toSelf().inSingletonScope(),t(Bv).toService(Cv),mp(t,Bv)}));let iB=class{constructor(t){this.global=t,this.offscreen=!1}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Mv({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};iB=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],iB);let nB=class{constructor(t){this.global=t,this.offscreen=!0}init(t,e,i){this.layer=t;const n=Mv({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,i){const n=t.getContext(),r=t.dpr,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:h=this.layer.viewHeight}=i;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,o,a,h),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,h),n.nativeContext.restore()}merge(t){}};nB=dp([rp(),pp(0,ap(Sp)),fp("design:paramtypes",[Object])],nB);var rB=new Qd((t=>{t(iB).toSelf(),t(nB).toSelf(),t(Hb).toService(iB)}));const sB=Symbol.for("DrawItemInterceptor"),oB=new pf;let aB=class{constructor(){this.order=1}afterDrawItem(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){oB.copy(n.dirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e)}return n.renderGroup(t.shadowRoot,i),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(oB),!0}};aB=dp([rp()],aB);let hB=class{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=aS.allocate();uS(h,a);const l=s.modelMatrix;if(l){if(h){const t=aS.allocate();s.modelMatrix=dS(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===Tb,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var i,n,r,s;let o=((null!==(i=t.attribute.startAngle)&&void 0!==i?i:0)+(null!==(n=t.attribute.endAngle)&&void 0!==n?n:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=Kp;for(;a<0;)a+=Kp;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",n.renderGroup(t,i),i.hack_pieFace="inside",n.renderGroup(t,i),i.hack_pieFace="top",n.renderGroup(t,i),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),n.renderGroup(t,i,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else n.renderGroup(t,i)}else n.renderItem(t,i);return s.camera=null,s.restore(),s.modelMatrix!==l&&aS.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};hB=dp([rp()],hB);let lB=class{constructor(t,e,i,n){this.contributions=t,this.renderSelector=e,this.layerService=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new df,this.backupDirtyBounds=new df}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,x:r=0,y:s=0,width:o,height:a}=e;if(!i)return;const h=this.dirtyBounds.setValue(0,0,o,a);if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=(l=h,c=n.dirtyBounds,u=!1,null===l?c:null===c?l:(vf=l.x1,yf=l.x2,mf=l.y1,bf=l.y2,xf=c.x1,wf=c.x2,Sf=c.y1,Af=c.y2,u&&(vf>yf&&(vf=(d=[yf,vf])[0],yf=d[1]),mf>bf&&(mf=(p=[bf,mf])[0],bf=p[1]),xf>wf&&(xf=(f=[wf,xf])[0],wf=f[1]),Sf>Af&&(Sf=(g=[Af,Sf])[0],Af=g[1])),vf>=wf||yf<=xf||mf>=Af||bf<=Sf?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(vf,xf),y1:Math.max(mf,Sf),x2:Math.min(yf,wf),y2:Math.min(bf,Af)}));h.x1=Math.floor(t.x1),h.y1=Math.floor(t.y1),h.x2=Math.ceil(t.x2),h.y2=Math.ceil(t.y2)}var l,c,u,d,p,f,g;this.backupDirtyBounds.copy(h),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);const v=h.width()*i.dpr!==i.canvas.width||h.height()*i.dpr!==i.canvas.height;i.save(),i.translate(r,s,!0),v&&(i.beginPath(),i.rect(h.x1,h.y1,h.width(),h.height()),i.clip()),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Jg.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Jg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=_A(e,i,Jg.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!Pf(t.AABBBounds,this.dirtyBounds,!1))return;const n=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var n;i?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):BA(t,Jg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.camera))}}),this.dirtyBounds.copy(n)}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||_v.get(ZS);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1}))}}getRenderContribution(t){let e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;if(!t.isContainer&&!Pf(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=r),r?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){const{clear:n}=i;if(n){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=i,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=mA(e,n,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}};dp([up(),fp("design:type",Function),fp("design:paramtypes",[]),fp("design:returntype",void 0)],lB.prototype,"init",null),lB=dp([rp(),pp(0,hp(iA)),pp(1,ap(gA)),pp(2,ap(Kb)),pp(3,ap(vp)),pp(3,sp(sB)),fp("design:paramtypes",[Array,Object,Object,Object])],lB);let cB=class{selector(t){return null}};cB=dp([rp()],cB);let uB=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Pb}drawShape(e,i,n,r,s,o,a,h){const l=gy(e,null==o?void 0:o.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:y=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:S=l.visible}=e.attribute,A=tx(p,y,f,g,c),T=ix(p,m,f,g),B=Zb(c,u),C=Jb(d,w);if(!e.valid||!S)return;if(!v){if(!B&&!C)return;if(!(A||T||a||h||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,o)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||Dp(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),XS(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const _={doFill:B,doStroke:C};this._groupRenderContribitions.forEach((o=>{o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,i,n,r,B,C,A,T,l,s,a,h,_)})),v&&i.clip(),i.setShadowStyle&&i.setShadowStyle(e,e.attribute,l),_.doFill&&(a?a(i,e.attribute,l):A&&(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,A,T,l,s,a,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=gy(t,null==n?void 0:n.theme).group,a=r.modelMatrix;if(r.camera){const e=aS.allocate(),i=aS.allocate();pS(i,t,o),dS(e,a||e,i),r.modelMatrix=e,aS.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:h=o.scrollX,scrollY:l=o.scrollY}=t.attribute;let c;(h||l)&&r.translate(h,l),n&&n.drawingCb&&(c=n.drawingCb()),r.modelMatrix!==a&&aS.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};uB=dp([rp(),pp(0,ap(vp)),pp(0,sp(gx)),fp("design:paramtypes",[Object])],uB);let dB=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=Mb}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=gy(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,y=Qb(d,p,c),m=ex(d,f),b=Zb(c),x=Jb(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(y||m||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(),US(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};dB=dp([rp()],dB);let pB=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=Bb}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=gy(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=Qb(d,u,c),g=Zb(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(),WS(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};var fB;pB=dp([rp()],pB),function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(fB||(fB={}));let gB=class extends lB{constructor(t,e,i,n,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=i,this.areaRender=n,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=fB.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new xp([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return gp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,x:r=0,y:s=0}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r,s,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Jg.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Jg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return gp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return gp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>gp(this,void 0,void 0,(function*(){if(2!==t.count)yield CA(t,Jg.zIndex,((i,n)=>{if(this.status===fB.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return gp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return gp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return gp(this,void 0,void 0,(function*(){this.rendering&&(this.status=fB.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=fB.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return gp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>gp(this,void 0,void 0,(function*(){yield CA(t,Jg.zIndex,(t=>gp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};dp([ap(Sp),fp("design:type",Object)],gB.prototype,"global",void 0),gB=dp([rp(),pp(0,hp(iA)),pp(1,ap(gA)),pp(2,ap(dB)),pp(3,ap(pB)),pp(4,ap(Kb)),pp(5,ap(vp)),pp(5,sp(sB)),fp("design:paramtypes",[Array,Object,Object,Object,Object,Object])],gB);let vB=class extends t.BaseRender{constructor(){super(...arguments),this.type="rect3d",this.numberType=Ib}drawShape(t,e,i,n,r,s,o,a){var h;const l=gy(t,null==s?void 0:s.theme).rect3d,{fill:c=l.fill,stroke:u=l.stroke,width:d=l.width,height:p=l.height,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:v=l.lineWidth,strokeOpacity:y=l.strokeOpacity,visible:m=l.visible}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=tx(f,g,d,p,c),w=ix(f,y,d,p),S=Zb(c),A=Jb(u,v);if(!t.valid||!m)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:T,camera:B}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,C,r,e,T,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,C,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(t,e,i,n,r,s,o,a){const h=jm.get(r).value,l=n.vertices,c=l.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];n.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,r=c[i[0]],s=c[i[1]],o=c[i[2]],a=c[i[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((n=>{const{polygon:c,normal:u}=n.polygon,d=l[c[0]],p=l[c[1]],f=l[c[2]],g=l[c[3]],v={x:t+d[0],y:e+d[1],z:i+d[2]},y={x:t+p[0],y:e+p[1],z:i+p[2]},m={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]};s.beginPath(),s.moveTo(v.x,v.y,v.z),s.lineTo(y.x,y.y,y.z),s.lineTo(m.x,m.y,m.z),s.lineTo(b.x,b.y,b.z),s.closePath(),a?a(s,null,null):(s.fillStyle=o?o.computeColor(u,h):r,s.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=gy(t).rect,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};vB=dp([rp()],vB);let yB=class{constructor(){this.numberType=Lb}drawShape(t,e,i,n,r){const s=gy(t).richtext,{width:o=s.width,height:a=s.height,opacity:h=s.opacity,fillOpacity:l=s.fillOpacity,visible:c=s.visible}=t.attribute;if(!t.valid||!c)return;if(!Qb(h,l,!0))return;e.translate(i,n);t.getFrameCache().draw(e,this.drawIcon)}drawIcon(t,e,i,n,r){var s;const o=gy(t).richtextIcon,{width:a=o.width,height:h=o.height,opacity:l=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:p=o.backgroundStroke,backgroundStrokeOpacity:f=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:y=a,backgroundHeight:m=h}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-a)/2,r=(m-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,y,m)):(e.beginPath(),XS(e,i-t,n-r,y,m,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=l,e.drawImage(b.data,i,n,a,h))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=gy(t).richtext;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);this.drawShape(t,n,s,o,i),n.highPerformanceRestore()}};yB=dp([rp()],yB);let mB=class{constructor(){this.numberType=_b}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=gy(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};mB=dp([rp()],mB);let bB=class extends t.BaseRender{constructor(){super(...arguments),this.numberType=Tb}drawShape(t,e,i,n,r,s,o,a){var h;const l=gy(t,null==s?void 0:s.theme).arc,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,fillOpacity:f=l.fillOpacity,lineWidth:g=l.lineWidth,strokeOpacity:v=l.strokeOpacity,visible:y=l.visible}=t.attribute,m=Qb(p,f,c),b=ex(p,v),x=Zb(c,u),w=Jb(d,g),S=null!==(h=this.z)&&void 0!==h?h:0;if(!t.valid||!y)return;if(!x&&!w)return;if(!(m||b||o||a||u))return;const{outerRadius:A=l.outerRadius,innerRadius:T=l.innerRadius,height:B=10}=t.attribute,C=jm.get(c).value,{light:_}=r.stage||{},P=r.hack_pieFace,E={top:S,bottom:S+B},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===P||"top"===P?(e.beginPath(),function(t,e,i,n,r,s,o){const{startAngle:a,endAngle:h}=t.getParsedAngle(),l=$p(h-a),c=h>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=Vp)e.moveTo(i,n,r);else if(l>=Kp-Vp)e.moveTo(i+s*Jp(a),n+s*ef(a),r),e.arc(i,n,s,a,h,!c,r),o>Vp&&(e.moveTo(i+o*Jp(h),n+o*ef(h),r),e.arc(i,n,o,h,a,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(a,h),y=s*Jp(p),m=s*ef(p),b=o*Jp(g),x=o*ef(g);l<.001?u=!0:(e.moveTo(i+y,n+m,r),e.arc(i,n,s,p,f,!c,r)),!(o>Vp)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,o,g,v,c,r))}e.closePath()}(t,e,i,n,E[P],A,T),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],C):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke()))):"outside"!==P&&"inside"!==P||("inside"===P&&(e.save(),e.beginPath(),e.arc(i,n,T,0,Kp,!0,E.top),e.clip()),e.beginPath(),function(t,e,i,n,r,s,o,a){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=$p(l-h),u=l>h;let d=!1;if(o<=Vp)e.moveTo(i,n,r);else if(c>=Kp-Vp)e.moveTo(i+o*Jp(h),n+o*ef(h),r),e.arc(i,n,o,h,l,!u,r),e.lineTo(i+o*Jp(l),n+o*ef(l),s),e.arc(i,n,o,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=a(h,l),f=o*Jp(c),g=o*ef(c),v=o*Jp(p),y=o*ef(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,o,c,p,!u,r),e.lineTo(i+v,n+y,s),e.arc(i,n,o,p,c,u,s))}e.closePath()}(t,e,i,n,E.top,E.bottom,"outside"===P?A:T,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:h}=t.getParsePadAngle(e,i);return"outside"===P?{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:h}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),x&&(o?o(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=_?_.computeColor(M[P],C):c,e.fill())),w&&(a?a(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),"inside"===P&&e.restore())}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=gy(t,null==n?void 0:n.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:h,z:l,lastModelMatrix:c}=o;this.z=l,nx(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,i,n),this.z=0,r.modelMatrix!==c&&aS.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};bB=dp([rp()],bB);let xB=class extends t.BaseRender{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Ob}drawShape(t,e,i,n,r,s,o,a){var h;const l=gy(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:v=l.visible,points:y,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(h=this.z)&&void 0!==h?h:0,x=Qb(d,p,c),w=ex(d,g),S=Zb(c),A=Jb(u,f);if(!t.valid||!v||4!==y.length)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:T,camera:B}=r.stage||{},C=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,b,C,m,r,e,T,B,t,l,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,b,C,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(t,e,i,n,r,s,o,a,h,l,c,u){const d=jm.get(s).value,p=n.vertices,f=p.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i,normal:n}=t,s=f[i[0]],o=f[i[1]],a=f[i[2]],h=f[i[3]];t.ave_z=s+o+a+h})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:r,normal:h}=n.polygon,f=p[r[0]],g=p[r[1]],v=p[r[2]],y=p[r[3]],m={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+g[0],y:e+g[1],z:i+g[2]},x={x:t+v[0],y:e+v[1],z:i+v[2]},w={x:t+y[0],y:e+y[1],z:i+y[2]};o.beginPath(),o.moveTo(m.x,m.y,m.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,l.attribute,c):(o.fillStyle=a?a.computeColor(h,d):s,o.fill())}))}draw(t,e,i){const{context:n}=i;if(!n)return;n.highPerformanceSave();const r=gy(t).polygon,s=this.transform(t,r,n),{x:o,y:a,z:h,lastModelMatrix:l}=s;this.z=h,this.drawShape(t,n,o,a,i),this.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore()}};xB=dp([rp()],xB);let wB=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};wB=dp([rp()],wB);let SB=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};SB=dp([rp()],SB);let AB=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};AB=dp([rp()],AB);let TB=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}};TB=dp([rp()],TB);let BB=class extends t.DefaultBaseBackgroundRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}};BB=dp([rp()],BB);let CB=class extends t.DefaultBaseTextureRenderContribution{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,o,a,h,l,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:y=t.attribute}=d||{},{texture:m=(null!==(p=t.attribute.texture)&&void 0!==p?p:om(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:om(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:om(h,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:om(h,"texturePadding"))}=y;if(!m)return;let S=this.textureMap.get(m);if(!S)switch(m){case"circle":S=this.createCirclePattern(x,w,b,e);break;case"diamond":S=this.createDiamondPattern(x,w,b,e);break;case"rect":S=this.createRectPattern(x,w,b,e);break;case"vertical-line":S=this.createVerticalLinePattern(x,w,b,e);break;case"horizontal-line":S=this.createHorizontalLinePattern(x,w,b,e);break;case"bias-lr":S=this.createBiasLRLinePattern(x,w,b,e);break;case"bias-rl":S=this.createBiasRLLinePattern(x,w,b,e);break;case"grid":S=this.createGridPattern(x,w,b,e)}S&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S,e.fill(),e.highPerformanceRestore())}};CB=dp([rp()],CB);var _B=new Qd((e=>{e(lB).toSelf(),e(vA).toService(lB),e(gB).toSelf(),e(ZS).toService(gB),e(cB).toSelf(),e(gA).toService(cB),e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(eA).to(t.DefaultCanvasCircleRender),e(iA).to(t.DefaultCanvasCircleRender),e(t.DefaultCircleRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultCircleTextureRenderContribution).toSelf().inSingletonScope(),e(fx).toService(t.DefaultCircleRenderContribution),e(fx).toService(t.DefaultCircleBackgroundRenderContribution),e(fx).toService(t.DefaultCircleTextureRenderContribution),mp(e,fx),e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(aA).to(t.DefaultCanvasRectRender),e(iA).to(t.DefaultCanvasRectRender),e(vB).toSelf().inSingletonScope(),e(hA).toService(vB),e(iA).toService(hA),e(t.DefaultRectRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultRectTextureRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectBeforeRenderContribution).toSelf().inSingletonScope(),e(t.SplitRectAfterRenderContribution).toSelf().inSingletonScope(),e(bx).toService(t.DefaultRectRenderContribution),e(bx).toService(t.DefaultRectBackgroundRenderContribution),e(bx).toService(t.DefaultRectTextureRenderContribution),e(bx).toService(t.SplitRectBeforeRenderContribution),e(bx).toService(t.SplitRectAfterRenderContribution),mp(e,bx),e(t.DefaultCanvasTextRender).toSelf().inSingletonScope(),e(cA).to(t.DefaultCanvasTextRender),e(iA).to(t.DefaultCanvasTextRender),mp(e,Sx),e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(sA).to(t.DefaultCanvasPathRender),e(iA).to(t.DefaultCanvasPathRender),e(AB).toSelf().inSingletonScope(),e(TB).toSelf().inSingletonScope(),e(yx).toService(AB),e(yx).toService(TB),mp(e,yx),e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(lA).to(t.DefaultCanvasSymbolRender),e(iA).to(t.DefaultCanvasSymbolRender),e(t.DefaultSymbolRenderContribution).toSelf().inSingletonScope(),e(xA).toSelf().inSingletonScope(),e(wA).toSelf().inSingletonScope(),e(xx).toService(t.DefaultSymbolRenderContribution),e(xx).toService(xA),e(xx).toService(wA),mp(e,xx),e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(JS).to(t.DefaultCanvasArcRender),e(iA).to(t.DefaultCanvasArcRender),e(bB).toSelf().inSingletonScope(),e(QS).toService(bB),e(iA).toService(QS),e(t.DefaultArcRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcBackgroundRenderContribution).toSelf().inSingletonScope(),e(t.DefaultArcTextureRenderContribution).toSelf().inSingletonScope(),e(dx).toService(t.DefaultArcRenderContribution),e(dx).toService(t.DefaultArcBackgroundRenderContribution),e(dx).toService(t.DefaultArcTextureRenderContribution),mp(e,dx),e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(rA).to(t.DefaultCanvasLineRender),e(iA).to(t.DefaultCanvasLineRender),e(dB).toSelf().inSingletonScope(),e(pB).toSelf().inSingletonScope(),e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(tA).to(t.DefaultCanvasAreaRender),e(iA).to(t.DefaultCanvasAreaRender),e(BB).toSelf().inSingletonScope(),e(CB).toSelf().inSingletonScope(),e(px).toService(BB),e(px).toService(CB),mp(e,px),e(uB).toSelf().inSingletonScope(),e(nA).to(uB),e(iA).to(uB),e(t.DefaultGroupBackgroundRenderContribution).toSelf().inSingletonScope(),e(gx).toService(t.DefaultGroupBackgroundRenderContribution),mp(e,gx),e(t.DefaultCanvasPolygonRender).toSelf().inSingletonScope(),e(oA).to(t.DefaultCanvasPolygonRender),e(iA).to(t.DefaultCanvasPolygonRender),e(wB).toSelf().inSingletonScope(),e(SB).toSelf().inSingletonScope(),e(mx).toService(wB),e(mx).toService(SB),mp(e,mx),e(mB).toSelf().inSingletonScope(),e(pA).toService(mB),e(iA).toService(pA),e(t.DefaultCanvasImageRender).toSelf().inSingletonScope(),e(fA).toService(t.DefaultCanvasImageRender),e(iA).toService(fA),e(t.DefaultImageBackgroundRenderContribution).toSelf().inSingletonScope(),e(vx).toService(t.DefaultImageBackgroundRenderContribution),mp(e,vx),e(yB).toSelf().inSingletonScope(),e(uA).toService(yB),e(iA).toService(uA),e(xB).toSelf().inSingletonScope(),e(dA).toService(xB),e(iA).toService(dA),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),e(Sx).toService(t.DefaultBaseInteractiveRenderContribution),e(dx).toService(t.DefaultBaseInteractiveRenderContribution),e(yx).toService(t.DefaultBaseInteractiveRenderContribution),e(xx).toService(t.DefaultBaseInteractiveRenderContribution),e(bx).toService(t.DefaultBaseInteractiveRenderContribution),e(vx).toService(t.DefaultBaseInteractiveRenderContribution),e(fx).toService(t.DefaultBaseInteractiveRenderContribution),e(px).toService(t.DefaultBaseInteractiveRenderContribution),e(mx).toService(t.DefaultBaseInteractiveRenderContribution),mp(e,Ax),mp(e,iA),e(aB).toSelf().inSingletonScope(),e(sB).toService(aB),e(hB).toSelf().inSingletonScope(),e(sB).toService(hB),mp(e,sB)}));let PB=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Cb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=yA(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};PB=dp([rp(),pp(0,ap(eA)),fp("design:paramtypes",[Object])],PB);const EB=new pf;let MB=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Db}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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||Ip(s,!0)&&0!==s||Dp(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;return n.lineWidth=yA(n,s,n.dpr),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;EB.setValue(i.x1,i.y1,i.x2,i.y2),EB.expand(-s/2),l=!EB.containsPoint(e)}}return n.highPerformanceRestore(),l}};MB=dp([rp(),pp(0,ap(aA)),fp("design:paramtypes",[Object])],MB);let kB=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Ab}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=yA(n,s,n.dpr),a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};kB=dp([rp(),pp(0,ap(JS)),fp("design:paramtypes",[Object])],kB);let RB=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Bb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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}};RB=dp([rp(),pp(0,ap(tA)),fp("design:paramtypes",[Object])],RB);let OB=class{constructor(){this.type="image",this.numberType=Eb}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};OB=dp([rp()],OB);let DB=class extends t.BaseRender{};DB=dp([rp()],DB);let IB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Mb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=gy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yA(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};IB=dp([rp(),pp(0,ap(rA)),fp("design:paramtypes",[Object])],IB);let LB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=kb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yA(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};LB=dp([rp(),pp(0,ap(sA)),fp("design:paramtypes",[Object])],LB);let UB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Ub}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=gy(t).symbol,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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth;return n.lineWidth=yA(n,r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};UB=dp([rp(),pp(0,ap(lA)),fp("design:paramtypes",[Object])],UB);let WB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Wb}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=gy(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,h=this.transform(t,s,n,a),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,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,d=h.height(),g=h.width(),v=Px(o,d,r),y=_x(a,g);return e.rect(y+l,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&aS.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};WB=dp([rp(),pp(0,ap(cA)),fp("design:paramtypes",[Object])],WB);let NB=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Rb}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};NB=dp([rp(),pp(0,ap(oA)),fp("design:paramtypes",[Object])],NB),new pf;let FB=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Lb}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};FB=dp([rp(),pp(0,ap(uA)),fp("design:paramtypes",[Object])],FB);let jB=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=_b}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};jB=dp([rp(),pp(0,ap(pA)),fp("design:paramtypes",[Object])],jB),new pf;let zB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Ib}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};zB=dp([rp(),pp(0,ap(hA)),fp("design:paramtypes",[Object])],zB),new pf;let HB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Ob}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>!1)),this.canvasRenderer.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};HB=dp([rp(),pp(0,ap(dA)),fp("design:paramtypes",[Object])],HB),new pf;let GB=class extends DB{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Tb}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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 u=!1;return this.canvasRenderer.drawShape(t,n,o,a,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&aS.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}};GB=dp([rp(),pp(0,ap(QS)),fp("design:paramtypes",[Object])],GB);var VB=new Qd(((t,e,i,n)=>{t(PB).toSelf().inSingletonScope(),t(HA).toService(PB),t(eT).toService(HA),t(MB).toSelf().inSingletonScope(),t(YA).toService(MB),t(eT).toService(YA),t(zB).toSelf().inSingletonScope(),t(qA).toService(zB),t(eT).toService(qA),t(kB).toSelf().inSingletonScope(),t(FA).toService(kB),t(eT).toService(FA),t(RB).toSelf().inSingletonScope(),t(zA).toService(RB),t(eT).toService(zA),t(OB).toSelf().inSingletonScope(),t(GA).toService(OB),t(eT).toService(GA),t(IB).toSelf().inSingletonScope(),t(VA).toService(IB),t(eT).toService(VA),t(LB).toSelf().inSingletonScope(),t(XA).toService(LB),t(eT).toService(XA),t(UB).toSelf().inSingletonScope(),t(KA).toService(UB),t(eT).toService(KA),t(WB).toSelf().inSingletonScope(),t($A).toService(WB),t(eT).toService($A),t(NB).toSelf().inSingletonScope(),t(ZA).toService(NB),t(eT).toService(ZA),t(HB).toSelf().inSingletonScope(),t(JA).toService(HB),t(eT).toService(JA),t(GB).toSelf().inSingletonScope(),t(jA).toService(GB),t(eT).toService(jA),t(FB).toSelf().inSingletonScope(),t(QA).toService(FB),t(eT).toService(QA),t(jB).toSelf().inSingletonScope(),t(tT).toService(jB),t(eT).toService(tT),mp(t,eT)}));let XB=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=kb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};XB=dp([rp(),pp(0,ap(sA)),fp("design:paramtypes",[Object])],XB);let YB=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Cb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};YB=dp([rp(),pp(0,ap(eA)),fp("design:paramtypes",[Object])],YB);const qB=new pf;let KB=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Db}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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||Ip(s,!0)&&0!==s||Dp(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;return n.lineWidth=s,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;qB.setValue(i.x1,i.y1,i.x2,i.y2),qB.expand(-s/2),l=!qB.containsPoint(e)}}return n.highPerformanceRestore(),l}};KB=dp([rp(),pp(0,ap(aA)),fp("design:paramtypes",[Object])],KB);let $B=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Ab}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};$B=dp([rp(),pp(0,ap(JS)),fp("design:paramtypes",[Object])],$B);let ZB=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Bb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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}};ZB=dp([rp(),pp(0,ap(tA)),fp("design:paramtypes",[Object])],ZB);let JB=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=Mb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};JB=dp([rp(),pp(0,ap(rA)),fp("design:paramtypes",[Object])],JB);let QB=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=Ub}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};QB=dp([rp(),pp(0,ap(lA)),fp("design:paramtypes",[Object])],QB);let tC=class{constructor(){this.type="text",this.numberType=Wb}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};tC=dp([rp()],tC);let eC=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Rb}contains(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=gy(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;return n.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),n.highPerformanceRestore(),a}};eC=dp([rp(),pp(0,ap(oA)),fp("design:paramtypes",[Object])],eC);let iC=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=_b}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{n||(n=!!r.pickItem(t,e,i))})),n}return!1}};iC=dp([rp(),pp(0,ap(pA)),fp("design:paramtypes",[Object])],iC);var nC=new Qd((t=>{t(YB).toSelf().inSingletonScope(),t(rT).toService(YB),t(dT).toService(rT),t(KB).toSelf().inSingletonScope(),t(aT).toService(KB),t(dT).toService(aT),t($B).toSelf().inSingletonScope(),t(iT).toService($B),t(dT).toService(iT),t(ZB).toSelf().inSingletonScope(),t(nT).toService(ZB),t(dT).toService(nT),t(JB).toSelf().inSingletonScope(),t(sT).toService(JB),t(dT).toService(sT),t(XB).toSelf().inSingletonScope(),t(oT).toService(XB),t(dT).toService(oT),t(QB).toSelf().inSingletonScope(),t(hT).toService(QB),t(dT).toService(hT),t(tC).toSelf().inSingletonScope(),t(lT).toService(tC),t(dT).toService(lT),t(eC).toSelf().inSingletonScope(),t(cT).toService(eC),t(dT).toService(cT),t(iC).toSelf().inSingletonScope(),t(uT).toService(iC),t(iC).toService(uT),mp(t,dT)}));var rC=new Qd((e=>{e(Pv).toDynamicValue((()=>e=>new t.BrowserCanvas(e))).whenTargetNamed(t.BrowserCanvas.env),e(Ev).toDynamicValue((()=>(e,i)=>new t.BrowserContext2d(e,i))).whenTargetNamed(t.BrowserContext2d.env)})),sC=new Qd((t=>{t(Pv).toDynamicValue((()=>t=>new NT(t))).whenTargetNamed(NT.env),t(Ev).toDynamicValue((()=>(t,e)=>new UT(t,e))).whenTargetNamed(UT.env)})),oC=new Qd((t=>{t(Pv).toDynamicValue((()=>t=>new IT(t))).whenTargetNamed(IT.env),t(Ev).toDynamicValue((()=>(t,e)=>new OT(t,e))).whenTargetNamed(OT.env)})),aC=new Qd((t=>{t(Pv).toDynamicValue((()=>t=>new HT(t))).whenTargetNamed(HT.env),t(Ev).toDynamicValue((()=>(t,e)=>new jT(t,e))).whenTargetNamed(jT.env)})),hC=new Qd((t=>{t(Pv).toDynamicValue((()=>t=>new ZT(t))).whenTargetNamed(ZT.env),t(Ev).toDynamicValue((()=>(t,e)=>new KT(t,e))).whenTargetNamed(KT.env)})),lC=new Qd((t=>{t(Pv).toDynamicValue((()=>t=>new YT(t))).whenTargetNamed(YT.env),t(Ev).toDynamicValue((()=>(t,e)=>new VT(t,e))).whenTargetNamed(VT.env)}));_v.load($b),_v.load(vT),_v.load(TA),_v.load(gT),_v.load(xT),function(t){t.load(kT),t.load(tB),t.load(eB),t.load(rB)}(_v),function(t){t.load(_B)}(_v),function(t){t.load(VB),t.load(nC)}(_v),function(t){t.load(rC),t.load(oC),t.load(sC),t.load(aC),t.load(hC),t.load(lC)}(_v);const cC=_v.get(Sp);fv.global=cC;const uC=_v.get(qb);fv.graphicUtil=uC;const dC=_v.get(Yb);fv.transformUtil=dC;const pC=_v.get(Nb);fv.graphicService=pC;const fC=_v.get(OA),gC=_v.get(Kb);fv.layerService=gC;class vC{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=yy.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,fv.graphicService.hooks.onAttributeUpdate.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),fv.graphicService.hooks.onSetStage.tap(this.key,(e=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}deactivate(t){fv.graphicService.hooks.onAttributeUpdate.taps=fv.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),fv.graphicService.hooks.onSetStage.taps=fv.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}class yC{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=yy.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const o=r/100,a=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+o,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+a,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}class mC{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=yy.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,fv.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))})),fv.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){fv.graphicService.hooks.onAddIncremental.taps=fv.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),fv.graphicService.hooks.onClearIncremental.taps=fv.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,fv.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({x:t.x,y:t.y,width:i.viewWidth,height:i.viewHeight,stage:t,layer:i,clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const bC=new pf;class xC{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=yy.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),fv.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&&(bC.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(bC,t.parent&&t.parent.globalTransMatrix)))})),fv.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))})),fv.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){fv.graphicService.hooks.beforeUpdateAABBBounds.taps=fv.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),fv.graphicService.hooks.afterUpdateAABBBounds.taps=fv.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)),fv.graphicService.hooks.onRemove.taps=fv.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}class wC{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=yy.GenAutoIncrementId(),this.key=this.name+this.id}tryLayout(t){const e=t.parent;if(!e)return;const i=gy(e).group,{display:n=i.display}=e.attribute;if("flex"!==n)return;const{width:r,height:s,flexDirection:o=i.flexDirection,flexWrap:a=i.flexWrap,justifyContent:h=i.justifyContent,alignItems:l=i.alignItems,alignContent:c=i.alignContent}=e.attribute;if(!r||!s)return;const u={main:{len:r,field:"x"},cross:{len:s,field:"y"},dir:1},d=u.main,p=u.cross;"row-reverse"===o?u.dir=-1:"column"===o?(d.len=s,p.len=r,d.field="y",p.field="x"):"column-reverse"===o&&(d.len=s,p.len=r,d.field="y",p.field="x",u.dir=-1);let f=0,g=0;const v=[];e.forEachChildren((t=>{const e=t.AABBBounds,i="x"===d.field?e.width():e.height(),n="x"===p.field?e.width():e.height();v.push({mainLen:i,crossLen:n}),f+=i,g=Math.max(g,n)}));const y=[];if(f>d.len&&"wrap"===a){let t=0,e=0;v.forEach((({mainLen:i,crossLen:n},r)=>{t+i>d.len?0===t?(y.push({idx:r,mainLen:t+i,crossLen:n}),t=0,e=0):(y.push({idx:r-1,mainLen:t,crossLen:n}),t=i,e=n):(t+=i,e=Math.max(e,n))})),y.push({idx:v.length-1,mainLen:t,crossLen:e})}else y.push({idx:v.length-1,mainLen:f,crossLen:g});const m=e.getChildren();let b=0;if(y.forEach((t=>{this.layoutMain(e,m,h,d,v,b,t),b=t.idx+1})),g=y.reduce(((t,e)=>t+e.crossLen),0),1===y.length){if("flex-end"===l){const t=p.len;this.layoutCross(m,l,p,t,v,y[0],0)}else if("center"===l){const t=p.len/2;this.layoutCross(m,l,p,t,v,y[0],0)}}else if("flex-start"===c){b=0;let t=0;y.forEach(((e,i)=>{this.layoutCross(m,"flex-start",p,t,v,y[i],b),b=e.idx+1,t+=e.crossLen}))}else if("center"===c){b=0;let t=Math.max(0,(p.len-g)/2);y.forEach(((e,i)=>{this.layoutCross(m,"center",p,t+e.crossLen/2,v,y[i],b),b=e.idx+1,t+=e.crossLen}))}else if("space-around"===c){b=0;const t=Math.max(0,(p.len-g)/y.length/2);let e=t;y.forEach(((i,n)=>{this.layoutCross(m,"flex-start",p,e,v,y[n],b),b=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===c){b=0;const t=Math.max(0,(p.len-g)/(2*y.length-2));let e=0;y.forEach(((i,n)=>{this.layoutCross(m,"flex-start",p,e,v,y[n],b),b=i.idx+1,e+=i.crossLen+2*t}))}}layoutMain(t,e,i,n,r,s,o){if("flex-start"===i){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t,t+=r[i].mainLen}else if("flex-end"===i){let t=n.len;for(let i=s;i<=o.idx;i++)t-=r[i].mainLen,e[i].attribute[n.field]=t}else if("space-around"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t,t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/t/2;let a=i;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a,a+=r[t].mainLen+2*i}else if("space-between"===i)if(o.mainLen>=n.len){let t=0;for(let i=s;i<=o.idx;i++)e[i].attribute[n.field]=t,t+=r[i].mainLen}else{const t=o.idx-s+1,i=(n.len-o.mainLen)/(2*t-2);let a=0;for(let t=s;t<=o.idx;t++)e[t].attribute[n.field]=a,a+=r[t].mainLen+2*i}}layoutCross(t,e,i,n,r,s,o){if("flex-end"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen;else if("center"===e)for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n-r[e].crossLen/2;else for(let e=o;e<=s.idx;e++)t[e].attribute[i.field]=n}activate(t){this.pluginService=t,pC.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)})),pC.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t)}))}deactivate(t){pC.hooks.onAttributeUpdate.taps=pC.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),pC.hooks.onSetStage.taps=pC.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const SC=new Ly;SC.addTimeline(Ny);SC.setFPS(60);class AC{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=jm.get(e).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;const n=nf(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=tf(Qp((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let r;if(Op(e)){r=jm.get(e).value}else r=e;const s=this.colorRgb;return jm.to.rgb(s[0]*r[0]*n,s[1]*r[1]*n,s[2]*r[2]*n)}}const TC="white";class BC extends zb{set viewBox(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}get viewBox(){return this._viewBox}get x(){return this._viewBox.x1}set x(t){this._viewBox.translate(t-this._viewBox.x1,0)}get y(){return this._viewBox.y1}set y(t){this._viewBox.translate(0,t-this._viewBox.y1)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this._viewBox.width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this._viewBox.height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:TC}set background(t){this._background=t}get defaultLayer(){return this.at(0)}constructor(t){var e;super({}),this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.theme=new py,this.hooks={beforeRender:new xp(["stage"]),afterRender:new xp(["stage"])},this.global=_v.get(Sp),this.window=_v.get(Vb),this.renderService=_v.get(SA),this.pickerService=_v.get(kA),this.pluginService=_v.get(mT),this.layerService=_v.get(Kb),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this._viewBox=new pf,t.viewBox?this._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):this._viewBox.setValue(0,0,this.width,this.height),this.renderCount=0,this._subView=!(this._viewBox.width()===this.width&&this._viewBox.height()===this.height),this._background=null!==(e=t.background)&&void 0!==e?e:TC,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,this.global.supportEvent&&(this.eventSystem=new Ey({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,viewport:{viewBox:this._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.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||SC,this.supportInteractiveLayer=!1!==t.interactiveLayer}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:o=1,fieldDepth:a}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:o,fieldDepth:a})}set3dOptions(t){var e,i,n,r,s,o;this.option3d=t;const a=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=a,{dir:g=[1,1,-1],color:v="white",ambient:y}=h,m=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[m,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(o=l.dz)&&void 0!==o?o:0)];let w=0,S=0,A=0;c||(w=Math.sin(u)+m,S=Math.sin(d)+b,A=Math.cos(u)*Math.cos(d)*1),this.light=new AC(g,v,y);const T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,S,A],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new LA(T),t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new yC))}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new vC))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new mC))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new df;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new xC,this.pluginService.register(t)),t.activate(this.pluginService)}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}enableLayout(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new wC))}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{t.deactivate(this.pluginService)})))}tryUpdateAABBBounds(){const t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t){const e=this.layerService.createLayer(this,{main:!1,canvasId:t});return this.appendChild(e),e}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive")}clearViewBox(t){this.window.clearViewBox(this._viewBox,t)}render(t,e){this.ticker.start(),this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach(((t,i)=>{t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},Object.assign({renderStyle:this.renderStyle},e))})),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear(),this.hooks.afterRender.call(this)}combineLayersToWindow(){this.forEach(((t,e)=>{t.combineTo(this.window,{clear:0===e,x:this.x,y:this.y,width:this.viewWidth,height:this.viewHeight,renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds})}))}renderNextFrame(t){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){this.nextFrameRenderLayerSet.size&&(this.ticker.start(),this.hooks.beforeRender.call(this),this.forEach((t=>{this.nextFrameRenderLayerSet.has(t)&&t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!!this.dirtyBounds},Object.assign({renderStyle:this.renderStyle},this.lastRenderparams||{}))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear())}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render()}resizeView(t,e,i=!0){this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render()}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){this.forEachChildren((e=>{e.setDpr(t)}))}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){const i=this.pickerService.pick(this.children,new lf(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.eventSystem&&this.eventSystem.release(),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release()}setStage(t){}dirty(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t,e){this.forEachChildren(((i,n)=>{i.drawTo(t,Object.assign(Object.assign({},e),{renderService:this.renderService,background:i===this.defaultLayer?this.background:void 0,clear:0===n,updateBounds:!!this.dirtyBounds}))}))}renderToNewWindow(t=!0){const e=_v.get(Vb);return t?e.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}):e.create({width:Math.min(this.viewWidth,this.window.width-this.x),height:Math.min(this.viewHeight,this.window.height-this.y),dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e,{x:0,y:0,width:e.width,height:e.height}),e}toCanvas(t=!0){const e=this.renderToNewWindow(t).getNativeHandler();return e.nativeCanvas?e.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t)}getCursor(){return this._cursor}}var CC;!function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(CC||(CC={}));t.ACustomAnimate=Fy,t.ARC3D_NUMBER_TYPE=Tb,t.ARC_NUMBER_TYPE=Ab,t.AREA_NUMBER_TYPE=Bb,t.Animate=zy,t.AnimateGroup=class extends Fy{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?Uy[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends Fy{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?Uy[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Arc=Hw,t.Arc3d=Gw,t.Arc3dRender=QS,t.ArcRender=JS,t.ArcRenderContribution=dx,t.Area=jw,t.AreaRender=tA,t.AreaRenderContribution=px,t.AttributeAnimate=class extends Fy{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=yT,t.Basis=wg,t.BeforeRenderConstribution=AA,t.BoundsContext=Of,t.BoundsPicker=RA,t.CIRCLE_NUMBER_TYPE=Cb,t.CanvasFactory=Pv,t.CanvasTextLayout=Ex,t.CbAnimate=jy,t.Circle=Bx,t.CircleRender=eA,t.CircleRenderContribution=fx,t.ClipAngleAnimate=class extends cm{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g,v;const y=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},m=null!==(a=y.width)&&void 0!==a?a:0,b=null!==(h=y.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,S=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let A=0,T=0;"anticlockwise"===S?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(A=w,T="out"===x?w+2*Math.PI:w);const B=fv.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(m+b)/2,innerRadius:0,startAngle:A,endAngle:T,fill:!0});let C,_;"anticlockwise"===S?(C={startAngle:w+2*Math.PI},_={startAngle:w}):(C={endAngle:w},_={endAngle:w+2*Math.PI}),super("in"===x?C:_,"in"===x?_:C,i,n,{group:null==r?void 0:r.group,clipGraphic:B})}},t.ClipDirectionAnimate=class extends cm{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p;const f=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},g=null!==(h=null!==(a=null==r?void 0:r.width)&&void 0!==a?a:f.width)&&void 0!==h?h:0,v=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,y=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",m=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=fv.graphicService.creator.rect({x:0,y:0,width:"in"===y&&"x"===m?0:g,height:"in"===y&&"y"===m?0:v,fill:!0});let w={},S={};"y"===m?"negative"===b?(w={y:v,height:0},S={y:0,height:v}):(w={height:0},S={height:v}):"negative"===b?(w={x:g,width:0},S={x:0,width:g}):(w={width:0},S={width:g}),super("in"===y?w:S,"in"===y?S:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=cm,t.ClipRadiusAnimate=class extends cm{constructor(t,e,i,n,r){var s,o,a,h,l,c,u,d,p,f,g;const v=null!==(o=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==o?o:{},y=null!==(a=v.width)&&void 0!==a?a:0,m=null!==(h=v.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((y/2)**2+(m/2)**2),S=fv.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:m/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),A={outerRadius:x},T={outerRadius:w};super("in"===b?A:T,"in"===b?T:A,i,n,{group:null==r?void 0:r.group,clipGraphic:S})}},t.ColorInterpolate=hx,t.Context2dFactory=Ev,t.ContributionProvider=vp,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new pg(new lf(this._lastX,this._lastY),new lf(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const o=new ug(new lf(this._lastX,this._lastY),new lf(t,e),new lf(i,n),new lf(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=Ay,t.CustomPath2D=jg,t.CustomSymbolClass=yw,t.DefaultArcAttribute=Qg,t.DefaultAreaAttribute=tv,t.DefaultAttribute=Jg,t.DefaultCircleAttribute=ev,t.DefaultConnectAttribute=Zg,t.DefaultFillStyle=Xg,t.DefaultGlyphAttribute=nv,t.DefaultGroupAttribute=iv,t.DefaultImageAttribute=dv,t.DefaultLayout=Gg,t.DefaultLineAttribute=rv,t.DefaultMorphingAnimateConfig=Xy,t.DefaultPathAttribute=sv,t.DefaultPolygonAttribute=ov,t.DefaultRect3dAttribute=hv,t.DefaultRectAttribute=av,t.DefaultRichTextAttribute=uv,t.DefaultRichTextIconAttribute=pv,t.DefaultStateAnimateConfig=Vy,t.DefaultStrokeStyle=qg,t.DefaultStyle=$g,t.DefaultSymbolAttribute=lv,t.DefaultSymbolBackgroundRenderContribution=xA,t.DefaultSymbolTextureRenderContribution=wA,t.DefaultTextAttribute=cv,t.DefaultTextStyle=Kg,t.DefaultTicker=Ly,t.DefaultTimeline=Wy,t.DefaultTransform=Vg,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function o(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",o);const a=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerupoutside",a,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=vA,t.EventManager=Cy,t.EventSystem=Ey,t.EventTarget=_y,t.FadeInPlus=class extends Fy{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=lm.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 lm.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case lm.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case lm.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case lm.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=by,t.FederatedMouseEvent=xy,t.FederatedPointerEvent=wy,t.FederatedWheelEvent=Sy,t.GLYPH_NUMBER_TYPE=_b,t.GRAPHIC_UPDATE_TAG_KEY=lb,t.GROUP_NUMBER_TYPE=Pb,t.Generator=yy,t.Gesture=class extends Bp{constructor(t,e={}){var i,n,r,s,o,a,h,l;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.onStart=t=>{this.reset(),this.startTime=Ty.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=ky(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((()=>{const e="press",n="none";t.direction=n,t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent(e,t),this.triggerEvent(e,t),this.eventType=e,this.direction=n}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:o}=n;for(let t=0,e=i.length;t<e;t++)if(o===i[t].pointerId){i[t]=n;break}const a={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Ty.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||My(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,u=ky(h[0],h[1]);n.scale=u/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const t=Ty.now(),i=this.lastMoveTime;if(t-i<100){const t=i-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=ky(i,r),o=s/t;o>this.config.swipe.velocity&&s>this.config.swipe.threshold&&(e.velocity=o,e.direction=My(i,r),this.triggerEvent("swipe",e))}}}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.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(a=null===(o=null==e?void 0:e.swipe)||void 0===o?void 0:o.threshold)&&void 0!==a?a:10,velocity:null!==(l=null===(h=null==e?void 0:e.swipe)||void 0===h?void 0:h.velocity)&&void 0!==l?l:.3}},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=Ty.now()-i>this.config.press.time&&ky(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=fv.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=OA,t.Glyph=Pw,t.GlyphRender=pA,t.Graphic=fb,t.GraphicAnimate=class extends Fy{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=Fb,t.GraphicPicker=MA,t.GraphicRender=iA,t.GraphicService=Nb,t.GraphicUtil=qb,t.Group=zb,t.GroupFadeIn=class extends Fy{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 Fy{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=nA,t.GroupRenderContribution=gx,t.IMAGE_NUMBER_TYPE=Eb,t.Image=Rw,t.ImageRender=fA,t.ImageRenderContribution=vx,t.IncreaseCount=class extends Fy{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s;this.fromNumber=Ip(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=Ip(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}onEnd(){}onUpdate(t,e,i){var n,r;!1!==this.valid&&(i.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(n=this.params)||void 0===n?void 0:n.fixed)&&void 0!==r?r:0))}},t.IncrementalDrawContribution=ZS,t.InputText=class extends Fy{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||Dp(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=fv.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,o=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,o);const a=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;a.setAttribute("x",h)}},t.InteractiveSubRenderContribution=Ax,t.LINE_NUMBER_TYPE=Mb,t.Layer=Gb,t.LayerHandlerContribution=Hb,t.LayerService=Kb,t.Line=Aw,t.LineRender=rA,t.Linear=yg,t.LinearClosed=Ug,t.ManualTickHandler=Ry,t.ManualTicker=class extends Ly{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Ry;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.Meteor=class extends Fy{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 lf(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=Pg,t.MonotoneY=Eg,t.MorphingPath=tb,t.MotionPath=class extends Fy{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=ib,t.Node=my,t.PATH_NUMBER_TYPE=kb,t.POLYGON_NUMBER_TYPE=Rb,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=Ob,t.Path=Nw,t.PathRender=sA,t.PathRenderContribution=yx,t.PickerService=kA,t.PluginService=mT,t.Polygon=Xw,t.PolygonRender=oA,t.PolygonRenderContribution=mx,t.Pyramid3d=Yw,t.Pyramid3dRender=dA,t.RAFTickHandler=Dy,t.RECT3D_NUMBER_TYPE=Ib,t.RECT_NUMBER_TYPE=Db,t.RICHTEXT_NUMBER_TYPE=Lb,t.RafBasedSTO=am,t.Rect=Bw,t.Rect3DRender=hA,t.Rect3d=_w,t.RectRender=aA,t.RectRenderContribution=bx,t.ReflectSegContext=gg,t.RenderSelector=gA,t.RenderService=SA,t.ResourceLoader=ab,t.RichText=Uw,t.RichTextRender=uA,t.RotateBySphereAnimate=class extends Fy{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=Kp-o),this.theta=o,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r}="function"==typeof this.params?this.params():this.params,s=2*Math.PI*e,o=this.theta+s,a=this.phi,h=r*Math.sin(a)*Math.cos(o)+n.x,l=r*Math.cos(a)+n.y,c=r*Math.sin(a)*Math.sin(o)+n.z;for(i.x=h,i.y=l,i.z=c,i.alpha=o+Xp/2;i.alpha>Kp;)i.alpha-=Kp;i.alpha=Kp-i.alpha,i.zIndex=-1e4*i.z}},t.SYMBOL_NUMBER_TYPE=Ub,t.SegContext=fg,t.Stage=BC,t.Step=Dg,t.StreamLight=class extends Fy{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){var t;const e=this.target.attachShadow(),i=this.target.AABBBounds.height(),n=fv.graphicService.creator.rect(Object.assign(Object.assign({height:i,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(t=this.params)||void 0===t?void 0:t.attribute),{x:0,y:0,width:0}));this.rect=n,e.add(n)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(e,i,n){var r,s,o,a,h,l;const c=null!==(r=this.target.attribute.width)&&void 0!==r?r:250,u=null!==(o=null===(s=this.params)||void 0===s?void 0:s.streamLength)&&void 0!==o?o:c,d=null!==(l=null===(h=null===(a=this.params)||void 0===a?void 0:a.attribute)||void 0===h?void 0:h.width)&&void 0!==l?l:60,p=-d,f=p+(u-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+d,d),u-f),y=v+g>c?Math.max(c-g,0):v;this.rect.setAttributes({x:g,width:y},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}},t.SubAnimate=Hy,t.Symbol=ww,t.SymbolRender=lA,t.SymbolRenderContribution=xx,t.TEXT_NUMBER_TYPE=Wb,t.TagPointsUpdate=class extends Fy{constructor(t,e,i,n,r){super(t,e,i,n,r),this.newPointAnimateType="appear"===(null==r?void 0:r.newPointAnimateType)?"appear":"grow"}onBind(){var t,e;const i=null===(t=this.from)||void 0===t?void 0:t.points,n=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=n?Array.isArray(n)?n:[n]:[];const r=new Map;this.fromPoints.forEach((t=>{t.context&&r.set(t.context,t)}));let s,o,a=1/0,h=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(r.has(this.toPoints[t].context)){a=t,s=r.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(r.has(this.toPoints[t].context)){h=t,o=r.get(this.toPoints[t].context);break}let l=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const i=r.get(t.context);return i?(l=i,[i,t]):"appear"===this.newPointAnimateType?[t,t]:e<a&&s?[s,t]:e>h&&o?[o,t]:[l,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new lf(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=im(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),i.points=this.points}},t.Text=kx,t.TextRender=cA,t.TextRenderContribution=Sx,t.Theme=py,t.TimeOutTickHandler=Oy,t.TransformUtil=Yb,t.VWindow=Vb,t.WindowHandlerContribution=Xb,t.addArcToBezierPath=ig,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=mm,t.alignSubpath=dm,t.applyTransformOnBezierCurves=wm,t.bezier=tg,t.bezierCurversToPath=Sm,t.binarySplitPolygon=Rm,t.bindContributionProvider=mp,t.boundStroke=gb,t.builtinSymbols=mw,t.builtinSymbolsMap=bw,t.calcLineCache=Fg,t.centroidOfSubpath=gm,t.circleBounds=tm,t.cloneGraphic=sb,t.container=_v,t.cornerTangents=sx,t.createArc=mS,t.createArc3d=function(t){return new Gw(t)},t.createArea=bS,t.createCircle=xS,t.createColor=mA,t.createConicalGradient=ux,t.createGlyph=function(t){return new Pw(t)},t.createGroup=wS,t.createImage=ES,t.createLine=SS,t.createPath=AS,t.createPolygon=MS,t.createPyramid3d=function(t){return new Yw(t)},t.createRect=TS,t.createRect3d=BS,t.createRectPath=XS,t.createRichText=RS,t.createShadowRoot=kS,t.createStage=function(t){return new BC(t)},t.createSymbol=PS,t.createText=CS,t.createWrapText=_S,t.cubicCalc=hg,t.cubicLength=ag,t.cubicPointAt=lg,t.cubicSubdivide=um,t.defaultTicker=SC,t.defaultTimeline=Ny,t.drawArc=eg,t.drawArcPath=ox,t.drawAreaSegments=FS,t.drawIncrementalAreaSegments=WS,t.drawIncrementalSegments=US,t.drawPathProxy=nx,t.drawSegments=LS,t.enumCommandMap=Uf,t.fillVisible=Qb,t.findBestMorphingRotation=ym,t.findNextGraphic=_A,t.foreach=BA,t.foreachAsync=CA,t.genBasisSegments=Ag,t.genBasisTypeSegments=Sg,t.genLinearClosedSegments=Wg,t.genLinearClosedTypeSegments=Ng,t.genLinearSegments=mg,t.genLinearTypeSegments=bg,t.genMonotoneXSegments=kg,t.genMonotoneYSegments=Og,t.genMonotpneXTypeSegments=Mg,t.genMonotpneYTypeSegments=Rg,t.genNumberType=yb,t.genStepSegments=Ig,t.genStepTypeSegments=Lg,t.getAttributeFromDefaultAttrList=om,t.getConicGradientAt=cx,t.getContextFont=Cx,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]+=_x(t,i.clipedWidth)}o[0]+=t,o[1]+=e;const a=aS.allocate();return cS(a,a,[o[0],o[1],0]),r&&hS(a,a,r),n&&lS(a,a,n),cS(a,a,[-o[0],-o[1],0]),a},t.getModelMatrix=pS,t.getRichTextBounds=function(t){return IS.setAttributes(t),IS.AABBBounds},t.getScaledStroke=yA,t.getTextBounds=function(t){return DS.setAttributes(t),DS.AABBBounds},t.getTheme=gy,t.getThemeFromGroup=vy,t.globalTheme=fy,t.graphicCreator=OS,t.graphicService=pC,t.graphicUtil=uC,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.intersect=rx,t.isTransformKey=sm,t.layerService=gC,t.loadFeishuContributions=AT,t.loadTaroContributions=TT,t.mat3Tomat4=uS,t.morphPath=eb,t.multiToOneMorph=(e,i,n)=>{var r,s,o;const a=e.filter((t=>t.toCustomPath&&t.valid));a.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?sb:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:ob)(i,a.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=a.map(((t,e)=>Zm(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=a.map(((t,e)=>Qm(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=a.length;const o=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,a.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:o}));d.wait(l),d.play(new tb({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:Xy.duration,null!==(h=n.easing)&&void 0!==h?h:Xy.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const a=i.animate(r);(null==n?void 0:n.delay)&&a.wait(n.delay),a.play(new ib({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:Xy.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:Xy.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],y=e[14],m=e[15];let b=i.a,x=i.b,w=0,S=0;return t[0]=b*n+x*a+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*y,t[3]=b*o+x*c+w*f+S*m,b=i.c,x=i.d,w=0,S=0,t[4]=b*n+x*a+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*y,t[7]=b*o+x*c+w*f+S*m,b=0,x=0,w=1,S=0,t[8]=b*n+x*a+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*y,t[11]=b*o+x*c+w*f+S*m,b=i.e,x=i.f,w=0,S=1,t[12]=b*n+x*a+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*y,t[15]=b*o+x*c+w*f+S*m,t},t.multiplyMat4Mat4=dS,t.newThemeObj=cy,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?sb:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:ob)(t,r.length,!1),o=null==i?void 0:i.onEnd;let a=r.length;const h=()=>{a--,0===a&&o&&o()};r.forEach(((e,n)=>{var o;const a=s[n],l=(null!==(o=null==i?void 0:i.delay)&&void 0!==o?o:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,a,e):0);eb(a,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.parsePadding=Zy,t.parseStroke=Ky,t.parseSvgPath=Gf,t.pathToBezierCurves=xm,t.pickerService=fC,t.point=xg,t.pointEqual=em,t.pointInterpolation=im,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=af(t.x,t.y,e.x,e.y,i),{x:o,y:a}=af(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)=>em(t,e[i]))):!Number.isNaN(t.x+t.y)&&em(t,e))},t.pointsInterpolation=nm,t.rafBasedSto=hm,t.rectFillVisible=tx,t.rectStrokeVisible=ix,t.recursiveCallBinarySplit=Om,t.renderCommandList=rg,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.rotateX=hS,t.rotateY=lS,t.runFill=Zb,t.runStroke=Jb,t.segments=Qf,t.shouldUseMat4=fS,t.snapLength=og,t.splitArc=Bm,t.splitArea=Pm,t.splitCircle=Cm,t.splitGraphic=ob,t.splitLine=Em,t.splitPath=Im,t.splitPolygon=Dm,t.splitRect=Tm,t.splitToGrids=Am,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=ex,t.textDrawOffsetX=_x,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=Px,t.transformKeys=rm,t.transformUtil=dC,t.translate=cS,t.version="0.14.2",t.verticalLayout=bb,t.vglobal=cC,t.waitForAllSubLayers=function(t){return gp(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{fv.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Mv,t.wrapContext=function(t,e){return _v.getNamed(Ev,fv.global.env)(t,e)}}));
|