@visactor/vutils-extension 1.4.0-alpha.4 → 1.4.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VDatasetExtension={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,s||t,o),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,r,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,s),!0;case 6:return c.fn.call(c.context,e,i,r,s,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,f=c.length;for(h=0;h<f;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,i);break;case 4:c[h].fn.call(c[h].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,r){var s=n?n+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||i&&a.context!==i||o(this,s);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==e||r&&!a[l].once||i&&a[l].context!==i)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(i);var r=n(i.exports);var s=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var o=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||s(t,"Boolean")};var a=t=>"function"==typeof t;var l=t=>null==t;var h=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var u=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||s(t,"String")};var d=t=>Array.isArray?Array.isArray(t):s(t,"Array");var f=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var p=t=>s(t,"Date");var g=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||s(t,"Number")};var y=t=>g(t)&&Number.isFinite(t);var v=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var m=t=>s(t,"RegExp");var b=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const x=Object.prototype.hasOwnProperty;var w=(t,e)=>null!=t&&x.call(t,e);function S(t){if(f(t))return t[t.length-1]}function A(t,e){if(!d(t)||!d(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const _=1e-12,B=Math.PI,T=B/2,C=2*B,P=2*Math.PI,R=Math.abs,O=Math.atan2,M=Math.cos,E=Math.max,k=Math.min,I=Math.sin,j=Math.sqrt,D=Math.pow;function L(t){return t>1?0:t<-1?B:Math.acos(t)}function N(t){return t>=1?T:t<=-1?-T:Math.asin(t)}function W(t,e,n,i,r){let s,o;return"number"==typeof t&&"number"==typeof n&&(s=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(o=(1-r)*e+r*i),{x:s,y:o}}class F{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new F(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return g(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return g(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class U{static distancePP(t,e){return j(D(t.x-e.x,2)+D(t.y-e.y,2))}static distanceNN(t,e,n,i){return j(D(t-n,2)+D(e-i,2))}static distancePN(t,e,n){return j(D(e-t.x,2)+D(n-t.y,2))}static pointAtPP(t,e,n){return new F((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function z(t,e,n){const{x1:i,y1:r,x2:s,y2:o}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*o+n.e,n.b*s+n.d*o+n.f),t.add(n.a*i+n.c*o+n.e,n.b*i+n.d*o+n.f),e)}class H{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new H(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return d(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return z(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),h=e-e*a+n*l,c=n-e*l-n*a;return[a*i-l*r+h,l*i+a*r+c,a*i-l*o+h,l*i+a*o+c,a*s-l*r+h,l*s+a*r+c,a*s-l*o+h,l*s+a*o+c]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:o,y2:a}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*o+(1-t)*n,e*a+(1-e)*i]}}class V extends H{}function G(t){return t*(Math.PI/180)}const X=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-C;)t+=C;else if(t>0)for(;t>C;)t-=C;return t};class Y{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,o=new Y,a=t*i-e*n;return o.a=i/a,o.b=-e/a,o.c=-n/a,o.d=t/a,o.e=(n*s-i*r)/a,o.f=-(t*s-e*r)/a,o}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,o=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=o,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,o=(1-i)*n-r*e,a=i*this.a-r*this.b,l=r*this.a+i*this.b,h=i*this.c-r*this.d,c=r*this.c+i*this.d,u=i*this.e-r*this.f+s,d=r*this.e+i*this.f+o;return this.a=a,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const o=this.a,a=this.b,l=this.c,h=this.d,c=o*t+l*e,u=a*t+h*e,d=o*n+l*i,f=a*n+h*i,p=o*r+l*s+this.e,g=a*r+h*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new Y;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:o,f:a}=this,l=n*s-i*r,h=s/l,c=-i/l,u=-r/l,d=n/l,f=(r*a-s*o)/l,p=-(n*a-i*o)/l,{x:g,y:y}=t;e.x=g*h+y*u+f,e.y=g*c+y*d+p}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Y(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const o=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/o):-Math.acos(n/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}let q,$,K,Z,J,Q,et,nt;var it;function rt(t,e,n){return!(t&&e&&(n?(q=t.x1,$=t.x2,K=t.y1,Z=t.y2,J=e.x1,Q=e.x2,et=e.y1,nt=e.y2,q>$&&([q,$]=[$,q]),K>Z&&([K,Z]=[Z,K]),J>Q&&([J,Q]=[Q,J]),et>nt&&([et,nt]=[nt,et]),q>Q||$<J||K>nt||Z<et):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"}(it||(it={}));const st=t=>{let e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e&=1023,n&=1023,i=e<<10|n,i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};class ot{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),h(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=h(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(l(this._canvas)&&(h(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),l(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&h(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),l(this._context)&&h(this._canvas)){const t=this._canvas.getContext("2d");h(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:n=e.fontStyle,fontVariant:i=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(i?i+" ":"")+(r?r+" ":"")+s+"px "+(o||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,n;const{defaultFontParams:i={}}=this._option,{fontStyle:r=i.fontStyle,fontVariant:s=i.fontVariant,fontWeight:o=(null!==(t=i.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=i.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(n=i.fontFamily)&&void 0!==n?n:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:f,limit:p,lineHeight:g=a}=this._userSpec;return{fontStyle:r,fontVariant:s,fontFamily:l,fontSize:a,fontWeight:o,textAlign:c,textBaseline:d,ellipsis:f,limit:p,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(l(t))return{width:0,height:0};if(l(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:n,fontWeight:i,textAlign:r,textBaseline:s,ellipsis:o,limit:a,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:n,fontWeight:i,textAlign:r,textBaseline:s,ellipsis:!!o,maxLineWidth:a||1/0,lineHeight:h});c={width:l.width(),height:l.height()}}catch(e){this._notSupportVRender=!0,c=this.measureWithNaiveCanvas(t)}return c}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const e=this._context.measureText(t),{fontSize:n,lineHeight:i}=this.textSpec;return{width:e.width,height:null!=i?i:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let n=0;n<t.length;n++){const i=t[n];let r=this._measureSpecialChar(i);l(r)&&ot.NUMBERS_CHAR_SET.includes(i)&&(r=this._measureNumberChar()),l(r)&&["F","W"].includes(st(i))&&(r=this._measureFullSizeChar()),l(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){const e={width:0,height:0},{fontSize:n,lineHeight:i}=this.textSpec;for(let i=0;i<t.length;i++){const r=t[i],s=["F","W"].includes(st(r))?1:.53;e.width+=s*n}return e.height=null!=i?i:n,e}_measureReduce(t,e){const{fontSize:n,lineHeight:i}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(d(t)){const s=t.filter(h).map((t=>t.toString()));return 0===s.length?r:1===s.length?e(s[0]):{width:s.reduce(((t,n)=>Math.max(t,e(n).width)),0),height:s.length*((null!=i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(ot.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ot.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ot.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(ot.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ot.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return h(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){h(this._canvas)&&(this._canvas=null),h(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}var at;function lt(t){switch(t){case at.Linear:case at.Log:case at.Pow:case at.Sqrt:case at.Symlog:case at.Time:return!0;default:return!1}}ot.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ot.NUMBERS_CHAR_SET="0123456789",ot.FULL_SIZE_CHAR="字",function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(at||(at={}));var ht=function(t){return t&&t.Math==Math&&t},ct=ht("object"==typeof globalThis&&globalThis)||ht("object"==typeof window&&window)||ht("object"==typeof self&&self)||ht("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),ut={},dt=function(t){try{return!!t()}catch(t){return!0}},ft=!dt((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),pt=!dt((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),gt=pt,yt=Function.prototype.call,vt=gt?yt.bind(yt):function(){return yt.apply(yt,arguments)},mt={},bt={}.propertyIsEnumerable,xt=Object.getOwnPropertyDescriptor,wt=xt&&!bt.call({1:2},1);mt.f=wt?function(t){var e=xt(this,t);return!!e&&e.enumerable}:bt;var St,At,_t=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Bt=pt,Tt=Function.prototype,Ct=Tt.call,Pt=Bt&&Tt.bind.bind(Ct,Ct),Rt=Bt?Pt:function(t){return function(){return Ct.apply(t,arguments)}},Ot=Rt,Mt=Ot({}.toString),Et=Ot("".slice),kt=function(t){return Et(Mt(t),8,-1)},It=dt,jt=kt,Dt=Object,Lt=Rt("".split),Nt=It((function(){return!Dt("z").propertyIsEnumerable(0)}))?function(t){return"String"==jt(t)?Lt(t,""):Dt(t)}:Dt,Wt=function(t){return null==t},Ft=Wt,Ut=TypeError,zt=function(t){if(Ft(t))throw Ut("Can't call method on "+t);return t},Ht=Nt,Vt=zt,Gt=function(t){return Ht(Vt(t))},Xt="object"==typeof document&&document.all,Yt={all:Xt,IS_HTMLDDA:void 0===Xt&&void 0!==Xt},qt=Yt.all,$t=Yt.IS_HTMLDDA?function(t){return"function"==typeof t||t===qt}:function(t){return"function"==typeof t},Kt=$t,Zt=Yt.all,Jt=Yt.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:Kt(t)||t===Zt}:function(t){return"object"==typeof t?null!==t:Kt(t)},Qt=ct,te=$t,ee=function(t,e){return arguments.length<2?(n=Qt[t],te(n)?n:void 0):Qt[t]&&Qt[t][e];var n},ne=Rt({}.isPrototypeOf),ie=ct,re="undefined"!=typeof navigator&&String(navigator.userAgent)||"",se=ie.process,oe=ie.Deno,ae=se&&se.versions||oe&&oe.version,le=ae&&ae.v8;le&&(At=(St=le.split("."))[0]>0&&St[0]<4?1:+(St[0]+St[1])),!At&&re&&(!(St=re.match(/Edge\/(\d+)/))||St[1]>=74)&&(St=re.match(/Chrome\/(\d+)/))&&(At=+St[1]);var he=At,ce=dt,ue=ct.String,de=!!Object.getOwnPropertySymbols&&!ce((function(){var t=Symbol();return!ue(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&he&&he<41})),fe=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pe=ee,ge=$t,ye=ne,ve=Object,me=fe?function(t){return"symbol"==typeof t}:function(t){var e=pe("Symbol");return ge(e)&&ye(e.prototype,ve(t))},be=String,xe=function(t){try{return be(t)}catch(t){return"Object"}},we=$t,Se=xe,Ae=TypeError,_e=function(t){if(we(t))return t;throw Ae(Se(t)+" is not a function")},Be=_e,Te=Wt,Ce=function(t,e){var n=t[e];return Te(n)?void 0:Be(n)},Pe=vt,Re=$t,Oe=Jt,Me=TypeError,Ee={exports:{}},ke=ct,Ie=Object.defineProperty,je=function(t,e){try{Ie(ke,t,{value:e,configurable:!0,writable:!0})}catch(n){ke[t]=e}return e},De=je,Le="__core-js_shared__",Ne=ct[Le]||De(Le,{}),We=Ne;(Ee.exports=function(t,e){return We[t]||(We[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 Fe=Ee.exports,Ue=zt,ze=Object,He=function(t){return ze(Ue(t))},Ve=He,Ge=Rt({}.hasOwnProperty),Xe=Object.hasOwn||function(t,e){return Ge(Ve(t),e)},Ye=Rt,qe=0,$e=Math.random(),Ke=Ye(1..toString),Ze=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Ke(++qe+$e,36)},Je=Fe,Qe=Xe,tn=Ze,en=de,nn=fe,rn=ct.Symbol,sn=Je("wks"),on=nn?rn.for||rn:rn&&rn.withoutSetter||tn,an=function(t){return Qe(sn,t)||(sn[t]=en&&Qe(rn,t)?rn[t]:on("Symbol."+t)),sn[t]},ln=vt,hn=Jt,cn=me,un=Ce,dn=function(t,e){var n,i;if("string"===e&&Re(n=t.toString)&&!Oe(i=Pe(n,t)))return i;if(Re(n=t.valueOf)&&!Oe(i=Pe(n,t)))return i;if("string"!==e&&Re(n=t.toString)&&!Oe(i=Pe(n,t)))return i;throw Me("Can't convert object to primitive value")},fn=TypeError,pn=an("toPrimitive"),gn=function(t,e){if(!hn(t)||cn(t))return t;var n,i=un(t,pn);if(i){if(void 0===e&&(e="default"),n=ln(i,t,e),!hn(n)||cn(n))return n;throw fn("Can't convert object to primitive value")}return void 0===e&&(e="number"),dn(t,e)},yn=me,vn=function(t){var e=gn(t,"string");return yn(e)?e:e+""},mn=Jt,bn=ct.document,xn=mn(bn)&&mn(bn.createElement),wn=function(t){return xn?bn.createElement(t):{}},Sn=wn,An=!ft&&!dt((function(){return 7!=Object.defineProperty(Sn("div"),"a",{get:function(){return 7}}).a})),_n=ft,Bn=vt,Tn=mt,Cn=_t,Pn=Gt,Rn=vn,On=Xe,Mn=An,En=Object.getOwnPropertyDescriptor;ut.f=_n?En:function(t,e){if(t=Pn(t),e=Rn(e),Mn)try{return En(t,e)}catch(t){}if(On(t,e))return Cn(!Bn(Tn.f,t,e),t[e])};var kn={},In=ft&&dt((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),jn=Jt,Dn=String,Ln=TypeError,Nn=function(t){if(jn(t))return t;throw Ln(Dn(t)+" is not an object")},Wn=ft,Fn=An,Un=In,zn=Nn,Hn=vn,Vn=TypeError,Gn=Object.defineProperty,Xn=Object.getOwnPropertyDescriptor,Yn="enumerable",qn="configurable",$n="writable";kn.f=Wn?Un?function(t,e,n){if(zn(t),e=Hn(e),zn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&$n in n&&!n[$n]){var i=Xn(t,e);i&&i[$n]&&(t[e]=n.value,n={configurable:qn in n?n[qn]:i[qn],enumerable:Yn in n?n[Yn]:i[Yn],writable:!1})}return Gn(t,e,n)}:Gn:function(t,e,n){if(zn(t),e=Hn(e),zn(n),Fn)try{return Gn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Vn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var Kn=kn,Zn=_t,Jn=ft?function(t,e,n){return Kn.f(t,e,Zn(1,n))}:function(t,e,n){return t[e]=n,t},Qn={exports:{}},ti=ft,ei=Xe,ni=Function.prototype,ii=ti&&Object.getOwnPropertyDescriptor,ri=ei(ni,"name"),si={EXISTS:ri,PROPER:ri&&"something"===function(){}.name,CONFIGURABLE:ri&&(!ti||ti&&ii(ni,"name").configurable)},oi=$t,ai=Ne,li=Rt(Function.toString);oi(ai.inspectSource)||(ai.inspectSource=function(t){return li(t)});var hi,ci,ui,di=ai.inspectSource,fi=$t,pi=ct.WeakMap,gi=fi(pi)&&/native code/.test(String(pi)),yi=Ze,vi=Fe("keys"),mi=function(t){return vi[t]||(vi[t]=yi(t))},bi={},xi=gi,wi=ct,Si=Jt,Ai=Jn,_i=Xe,Bi=Ne,Ti=mi,Ci=bi,Pi="Object already initialized",Ri=wi.TypeError,Oi=wi.WeakMap;if(xi||Bi.state){var Mi=Bi.state||(Bi.state=new Oi);Mi.get=Mi.get,Mi.has=Mi.has,Mi.set=Mi.set,hi=function(t,e){if(Mi.has(t))throw Ri(Pi);return e.facade=t,Mi.set(t,e),e},ci=function(t){return Mi.get(t)||{}},ui=function(t){return Mi.has(t)}}else{var Ei=Ti("state");Ci[Ei]=!0,hi=function(t,e){if(_i(t,Ei))throw Ri(Pi);return e.facade=t,Ai(t,Ei,e),e},ci=function(t){return _i(t,Ei)?t[Ei]:{}},ui=function(t){return _i(t,Ei)}}var ki={set:hi,get:ci,has:ui,enforce:function(t){return ui(t)?ci(t):hi(t,{})},getterFor:function(t){return function(e){var n;if(!Si(e)||(n=ci(e)).type!==t)throw Ri("Incompatible receiver, "+t+" required");return n}}},Ii=Rt,ji=dt,Di=$t,Li=Xe,Ni=ft,Wi=si.CONFIGURABLE,Fi=di,Ui=ki.enforce,zi=ki.get,Hi=String,Vi=Object.defineProperty,Gi=Ii("".slice),Xi=Ii("".replace),Yi=Ii([].join),qi=Ni&&!ji((function(){return 8!==Vi((function(){}),"length",{value:8}).length})),$i=String(String).split("String"),Ki=Qn.exports=function(t,e,n){"Symbol("===Gi(Hi(e),0,7)&&(e="["+Xi(Hi(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Li(t,"name")||Wi&&t.name!==e)&&(Ni?Vi(t,"name",{value:e,configurable:!0}):t.name=e),qi&&n&&Li(n,"arity")&&t.length!==n.arity&&Vi(t,"length",{value:n.arity});try{n&&Li(n,"constructor")&&n.constructor?Ni&&Vi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=Ui(t);return Li(i,"source")||(i.source=Yi($i,"string"==typeof e?e:"")),t};Function.prototype.toString=Ki((function(){return Di(this)&&zi(this).source||Fi(this)}),"toString");var Zi=Qn.exports,Ji=$t,Qi=kn,tr=Zi,er=je,nr=function(t,e,n,i){i||(i={});var r=i.enumerable,s=void 0!==i.name?i.name:e;if(Ji(n)&&tr(n,s,i),i.global)r?t[e]=n:er(e,n);else{try{i.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=n:Qi.f(t,e,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t},ir={},rr=Math.ceil,sr=Math.floor,or=Math.trunc||function(t){var e=+t;return(e>0?sr:rr)(e)},ar=function(t){var e=+t;return e!=e||0===e?0:or(e)},lr=ar,hr=Math.max,cr=Math.min,ur=function(t,e){var n=lr(t);return n<0?hr(n+e,0):cr(n,e)},dr=ar,fr=Math.min,pr=function(t){return t>0?fr(dr(t),9007199254740991):0},gr=function(t){return pr(t.length)},yr=Gt,vr=ur,mr=gr,br=function(t){return function(e,n,i){var r,s=yr(e),o=mr(s),a=vr(i,o);if(t&&n!=n){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===n)return t||a||0;return!t&&-1}},xr={includes:br(!0),indexOf:br(!1)},wr=Xe,Sr=Gt,Ar=xr.indexOf,_r=bi,Br=Rt([].push),Tr=function(t,e){var n,i=Sr(t),r=0,s=[];for(n in i)!wr(_r,n)&&wr(i,n)&&Br(s,n);for(;e.length>r;)wr(i,n=e[r++])&&(~Ar(s,n)||Br(s,n));return s},Cr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pr=Tr,Rr=Cr.concat("length","prototype");ir.f=Object.getOwnPropertyNames||function(t){return Pr(t,Rr)};var Or={};Or.f=Object.getOwnPropertySymbols;var Mr=ee,Er=ir,kr=Or,Ir=Nn,jr=Rt([].concat),Dr=Mr("Reflect","ownKeys")||function(t){var e=Er.f(Ir(t)),n=kr.f;return n?jr(e,n(t)):e},Lr=Xe,Nr=Dr,Wr=ut,Fr=kn,Ur=dt,zr=$t,Hr=/#|\.prototype\./,Vr=function(t,e){var n=Xr[Gr(t)];return n==qr||n!=Yr&&(zr(e)?Ur(e):!!e)},Gr=Vr.normalize=function(t){return String(t).replace(Hr,".").toLowerCase()},Xr=Vr.data={},Yr=Vr.NATIVE="N",qr=Vr.POLYFILL="P",$r=Vr,Kr=ct,Zr=ut.f,Jr=Jn,Qr=nr,ts=je,es=function(t,e,n){for(var i=Nr(e),r=Fr.f,s=Wr.f,o=0;o<i.length;o++){var a=i[o];Lr(t,a)||n&&Lr(n,a)||r(t,a,s(e,a))}},ns=$r,is=function(t,e){var n,i,r,s,o,a=t.target,l=t.global,h=t.stat;if(n=l?Kr:h?Kr[a]||ts(a,{}):(Kr[a]||{}).prototype)for(i in e){if(s=e[i],r=t.dontCallGetSet?(o=Zr(n,i))&&o.value:n[i],!ns(l?i:a+(h?".":"#")+i,t.forced)&&void 0!==r){if(typeof s==typeof r)continue;es(s,r)}(t.sham||r&&r.sham)&&Jr(s,"sham",!0),Qr(n,i,s,t)}},rs={exports:{}},ss={},os=vn,as=kn,ls=_t,hs=ur,cs=gr,us=function(t,e,n){var i=os(e);i in t?as.f(t,i,ls(0,n)):t[i]=n},ds=Array,fs=Math.max,ps=kt,gs=Gt,ys=ir.f,vs=function(t,e,n){for(var i=cs(t),r=hs(e,i),s=hs(void 0===n?i:n,i),o=ds(fs(s-r,0)),a=0;r<s;r++,a++)us(o,a,t[r]);return o.length=a,o},ms="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ss.f=function(t){return ms&&"Window"==ps(t)?function(t){try{return ys(t)}catch(t){return vs(ms)}}(t):ys(gs(t))};var bs=dt((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),xs=dt,ws=Jt,Ss=kt,As=bs,_s=Object.isExtensible,Bs=xs((function(){_s(1)}))||As?function(t){return!!ws(t)&&((!As||"ArrayBuffer"!=Ss(t))&&(!_s||_s(t)))}:_s,Ts=!dt((function(){return Object.isExtensible(Object.preventExtensions({}))})),Cs=is,Ps=Rt,Rs=bi,Os=Jt,Ms=Xe,Es=kn.f,ks=ir,Is=ss,js=Bs,Ds=Ts,Ls=!1,Ns=Ze("meta"),Ws=0,Fs=function(t){Es(t,Ns,{value:{objectID:"O"+Ws++,weakData:{}}})},Us=rs.exports={enable:function(){Us.enable=function(){},Ls=!0;var t=ks.f,e=Ps([].splice),n={};n[Ns]=1,t(n).length&&(ks.f=function(n){for(var i=t(n),r=0,s=i.length;r<s;r++)if(i[r]===Ns){e(i,r,1);break}return i},Cs({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Is.f}))},fastKey:function(t,e){if(!Os(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Ms(t,Ns)){if(!js(t))return"F";if(!e)return"E";Fs(t)}return t[Ns].objectID},getWeakData:function(t,e){if(!Ms(t,Ns)){if(!js(t))return!0;if(!e)return!1;Fs(t)}return t[Ns].weakData},onFreeze:function(t){return Ds&&Ls&&js(t)&&!Ms(t,Ns)&&Fs(t),t}};Rs[Ns]=!0;var zs=rs.exports,Hs=kt,Vs=Rt,Gs=function(t){if("Function"===Hs(t))return Vs(t)},Xs=_e,Ys=pt,qs=Gs(Gs.bind),$s=function(t,e){return Xs(t),void 0===e?t:Ys?qs(t,e):function(){return t.apply(e,arguments)}},Ks={},Zs=Ks,Js=an("iterator"),Qs=Array.prototype,to={};to[an("toStringTag")]="z";var eo="[object z]"===String(to),no=$t,io=kt,ro=an("toStringTag"),so=Object,oo="Arguments"==io(function(){return arguments}()),ao=eo?io:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=so(t),ro))?n:oo?io(e):"Object"==(i=io(e))&&no(e.callee)?"Arguments":i},lo=ao,ho=Ce,co=Wt,uo=Ks,fo=an("iterator"),po=function(t){if(!co(t))return ho(t,fo)||ho(t,"@@iterator")||uo[lo(t)]},go=vt,yo=_e,vo=Nn,mo=xe,bo=po,xo=TypeError,wo=vt,So=Nn,Ao=Ce,_o=$s,Bo=vt,To=Nn,Co=xe,Po=function(t){return void 0!==t&&(Zs.Array===t||Qs[Js]===t)},Ro=gr,Oo=ne,Mo=function(t,e){var n=arguments.length<2?bo(t):e;if(yo(n))return vo(go(n,t));throw xo(mo(t)+" is not iterable")},Eo=po,ko=function(t,e,n){var i,r;So(t);try{if(!(i=Ao(t,"return"))){if("throw"===e)throw n;return n}i=wo(i,t)}catch(t){r=!0,i=t}if("throw"===e)throw n;if(r)throw i;return So(i),n},Io=TypeError,jo=function(t,e){this.stopped=t,this.result=e},Do=jo.prototype,Lo=function(t,e,n){var i,r,s,o,a,l,h,c=n&&n.that,u=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=_o(e,c),y=function(t){return i&&ko(i,"normal",t),new jo(!0,t)},v=function(t){return u?(To(t),p?g(t[0],t[1],y):g(t[0],t[1])):p?g(t,y):g(t)};if(d)i=t.iterator;else if(f)i=t;else{if(!(r=Eo(t)))throw Io(Co(t)+" is not iterable");if(Po(r)){for(s=0,o=Ro(t);o>s;s++)if((a=v(t[s]))&&Oo(Do,a))return a;return new jo(!1)}i=Mo(t,r)}for(l=d?t.next:i.next;!(h=Bo(l,i)).done;){try{a=v(h.value)}catch(t){ko(i,"throw",t)}if("object"==typeof a&&a&&Oo(Do,a))return a}return new jo(!1)},No=ne,Wo=TypeError,Fo=function(t,e){if(No(e,t))return t;throw Wo("Incorrect invocation")},Uo=an("iterator"),zo=!1;try{var Ho=0,Vo={next:function(){return{done:!!Ho++}},return:function(){zo=!0}};Vo[Uo]=function(){return this},Array.from(Vo,(function(){throw 2}))}catch(t){}var Go=kn.f,Xo=Xe,Yo=an("toStringTag"),qo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!Xo(t,Yo)&&Go(t,Yo,{configurable:!0,value:e})},$o=Rt,Ko=_e,Zo=$t,Jo=String,Qo=TypeError,ta=function(t,e,n){try{return $o(Ko(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},ea=Nn,na=function(t){if("object"==typeof t||Zo(t))return t;throw Qo("Can't set "+Jo(t)+" as a prototype")},ia=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=ta(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return ea(n),na(i),e?t(n,i):n.__proto__=i,n}}():void 0),ra=$t,sa=Jt,oa=ia,aa=is,la=ct,ha=Rt,ca=$r,ua=nr,da=zs,fa=Lo,pa=Fo,ga=$t,ya=Wt,va=Jt,ma=dt,ba=function(t,e){if(!e&&!zo)return!1;var n=!1;try{var i={};i[Uo]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n},xa=qo,wa=function(t,e,n){var i,r;return oa&&ra(i=e.constructor)&&i!==n&&sa(r=i.prototype)&&r!==n.prototype&&oa(t,r),t},Sa=function(t,e,n){var i=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=i?"set":"add",o=la[t],a=o&&o.prototype,l=o,h={},c=function(t){var e=ha(a[t]);ua(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!va(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!va(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!va(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(ca(t,!ga(o)||!(r||a.forEach&&!ma((function(){(new o).entries().next()})))))l=n.getConstructor(e,t,i,s),da.enable();else if(ca(t,!0)){var u=new l,d=u[s](r?{}:-0,1)!=u,f=ma((function(){u.has(1)})),p=ba((function(t){new o(t)})),g=!r&&ma((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));p||((l=e((function(t,e){pa(t,a);var n=wa(new o,t,l);return ya(e)||fa(e,n[s],{that:n,AS_ENTRIES:i}),n}))).prototype=a,a.constructor=l),(f||g)&&(c("delete"),c("has"),i&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return h[t]=l,aa({global:!0,constructor:!0,forced:l!=o},h),xa(l,t),r||n.setStrong(l,t,i),l},Aa={},_a=Tr,Ba=Cr,Ta=Object.keys||function(t){return _a(t,Ba)},Ca=ft,Pa=In,Ra=kn,Oa=Nn,Ma=Gt,Ea=Ta;Aa.f=Ca&&!Pa?Object.defineProperties:function(t,e){Oa(t);for(var n,i=Ma(e),r=Ea(e),s=r.length,o=0;s>o;)Ra.f(t,n=r[o++],i[n]);return t};var ka,Ia=ee("document","documentElement"),ja=Nn,Da=Aa,La=Cr,Na=bi,Wa=Ia,Fa=wn,Ua="prototype",za="script",Ha=mi("IE_PROTO"),Va=function(){},Ga=function(t){return"<"+za+">"+t+"</"+za+">"},Xa=function(t){t.write(Ga("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ya=function(){try{ka=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Ya="undefined"!=typeof document?document.domain&&ka?Xa(ka):(e=Fa("iframe"),n="java"+za+":",e.style.display="none",Wa.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Ga("document.F=Object")),t.close(),t.F):Xa(ka);for(var i=La.length;i--;)delete Ya[Ua][La[i]];return Ya()};Na[Ha]=!0;var qa,$a,Ka,Za=Object.create||function(t,e){var n;return null!==t?(Va[Ua]=ja(t),n=new Va,Va[Ua]=null,n[Ha]=t):n=Ya(),void 0===e?n:Da.f(n,e)},Ja=Zi,Qa=kn,tl=function(t,e,n){return n.get&&Ja(n.get,e,{getter:!0}),n.set&&Ja(n.set,e,{setter:!0}),Qa.f(t,e,n)},el=nr,nl=function(t,e,n){for(var i in e)el(t,i,e[i],n);return t},il=!dt((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),rl=Xe,sl=$t,ol=He,al=il,ll=mi("IE_PROTO"),hl=Object,cl=hl.prototype,ul=al?hl.getPrototypeOf:function(t){var e=ol(t);if(rl(e,ll))return e[ll];var n=e.constructor;return sl(n)&&e instanceof n?n.prototype:e instanceof hl?cl:null},dl=dt,fl=$t,pl=Jt,gl=ul,yl=nr,vl=an("iterator"),ml=!1;[].keys&&("next"in(Ka=[].keys())?($a=gl(gl(Ka)))!==Object.prototype&&(qa=$a):ml=!0);var bl=!pl(qa)||dl((function(){var t={};return qa[vl].call(t)!==t}));bl&&(qa={}),fl(qa[vl])||yl(qa,vl,(function(){return this}));var xl={IteratorPrototype:qa,BUGGY_SAFARI_ITERATORS:ml},wl=xl.IteratorPrototype,Sl=Za,Al=_t,_l=qo,Bl=Ks,Tl=function(){return this},Cl=is,Pl=vt,Rl=$t,Ol=function(t,e,n,i){var r=e+" Iterator";return t.prototype=Sl(wl,{next:Al(+!i,n)}),_l(t,r,!1),Bl[r]=Tl,t},Ml=ul,El=ia,kl=qo,Il=Jn,jl=nr,Dl=Ks,Ll=si.PROPER,Nl=si.CONFIGURABLE,Wl=xl.IteratorPrototype,Fl=xl.BUGGY_SAFARI_ITERATORS,Ul=an("iterator"),zl="keys",Hl="values",Vl="entries",Gl=function(){return this},Xl=ee,Yl=tl,ql=ft,$l=an("species"),Kl=Za,Zl=tl,Jl=nl,Ql=$s,th=Fo,eh=Wt,nh=Lo,ih=function(t,e,n,i,r,s,o){Ol(n,e,i);var a,l,h,c=function(t){if(t===r&&g)return g;if(!Fl&&t in f)return f[t];switch(t){case zl:case Hl:case Vl:return function(){return new n(this,t)}}return function(){return new n(this)}},u=e+" Iterator",d=!1,f=t.prototype,p=f[Ul]||f["@@iterator"]||r&&f[r],g=!Fl&&p||c(r),y="Array"==e&&f.entries||p;if(y&&(a=Ml(y.call(new t)))!==Object.prototype&&a.next&&(Ml(a)!==Wl&&(El?El(a,Wl):Rl(a[Ul])||jl(a,Ul,Gl)),kl(a,u,!0)),Ll&&r==Hl&&p&&p.name!==Hl&&(Nl?Il(f,"name",Hl):(d=!0,g=function(){return Pl(p,this)})),r)if(l={values:c(Hl),keys:s?g:c(zl),entries:c(Vl)},o)for(h in l)(Fl||d||!(h in f))&&jl(f,h,l[h]);else Cl({target:e,proto:!0,forced:Fl||d},l);return f[Ul]!==g&&jl(f,Ul,g,{name:r}),Dl[e]=g,l},rh=function(t,e){return{value:t,done:e}},sh=function(t){var e=Xl(t);ql&&e&&!e[$l]&&Yl(e,$l,{configurable:!0,get:function(){return this}})},oh=ft,ah=zs.fastKey,lh=ki.set,hh=ki.getterFor,ch={getConstructor:function(t,e,n,i){var r=t((function(t,r){th(t,s),lh(t,{type:e,index:Kl(null),first:void 0,last:void 0,size:0}),oh||(t.size=0),eh(r)||nh(r,t[i],{that:t,AS_ENTRIES:n})})),s=r.prototype,o=hh(e),a=function(t,e,n){var i,r,s=o(t),a=l(t,e);return a?a.value=n:(s.last=a={index:r=ah(e,!0),key:e,value:n,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=a),i&&(i.next=a),oh?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},l=function(t,e){var n,i=o(t),r=ah(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return Jl(s,{clear:function(){for(var t=o(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,oh?t.size=0:this.size=0},delete:function(t){var e=this,n=o(e),i=l(e,t);if(i){var r=i.next,s=i.previous;delete n.index[i.index],i.removed=!0,s&&(s.next=r),r&&(r.previous=s),n.first==i&&(n.first=r),n.last==i&&(n.last=s),oh?n.size--:e.size--}return!!i},forEach:function(t){for(var e,n=o(this),i=Ql(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!l(this,t)}}),Jl(s,n?{get:function(t){var e=l(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)}}),oh&&Zl(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,n){var i=e+" Iterator",r=hh(e),s=hh(i);ih(t,e,(function(t,e){lh(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?rh("keys"==e?n.key:"values"==e?n.value:[n.key,n.value],!1):(t.target=void 0,rh(void 0,!0))}),n?"entries":"values",!n,!0),sh(e)}};Sa("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ch);var uh=kt,dh=Array.isArray||function(t){return"Array"==uh(t)},fh=Rt,ph=dt,gh=$t,yh=ao,vh=di,mh=function(){},bh=[],xh=ee("Reflect","construct"),wh=/^\s*(?:class|function)\b/,Sh=fh(wh.exec),Ah=!wh.exec(mh),_h=function(t){if(!gh(t))return!1;try{return xh(mh,bh,t),!0}catch(t){return!1}},Bh=function(t){if(!gh(t))return!1;switch(yh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ah||!!Sh(wh,vh(t))}catch(t){return!0}};Bh.sham=!0;var Th=!xh||ph((function(){var t;return _h(_h.call)||!_h(Object)||!_h((function(){t=!0}))||t}))?Bh:_h,Ch=dh,Ph=Th,Rh=Jt,Oh=an("species"),Mh=Array,Eh=function(t){var e;return Ch(t)&&(e=t.constructor,(Ph(e)&&(e===Mh||Ch(e.prototype))||Rh(e)&&null===(e=e[Oh]))&&(e=void 0)),void 0===e?Mh:e},kh=$s,Ih=Nt,jh=He,Dh=gr,Lh=function(t,e){return new(Eh(t))(0===e?0:e)},Nh=Rt([].push),Wh=function(t){var e=1==t,n=2==t,i=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(l,h,c,u){for(var d,f,p=jh(l),g=Ih(p),y=kh(h,c),v=Dh(g),m=0,b=u||Lh,x=e?b(l,v):n||o?b(l,0):void 0;v>m;m++)if((a||m in g)&&(f=y(d=g[m],m,p),t))if(e)x[m]=f;else if(f)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:Nh(x,d)}else switch(t){case 4:return!1;case 7:Nh(x,d)}return s?-1:i||r?r:x}},Fh={forEach:Wh(0),map:Wh(1),filter:Wh(2),some:Wh(3),every:Wh(4),find:Wh(5),findIndex:Wh(6),filterReject:Wh(7)},Uh=Rt,zh=nl,Hh=zs.getWeakData,Vh=Fo,Gh=Nn,Xh=Wt,Yh=Jt,qh=Lo,$h=Xe,Kh=ki.set,Zh=ki.getterFor,Jh=Fh.find,Qh=Fh.findIndex,tc=Uh([].splice),ec=0,nc=function(t){return t.frozen||(t.frozen=new ic)},ic=function(){this.entries=[]},rc=function(t,e){return Jh(t.entries,(function(t){return t[0]===e}))};ic.prototype={get:function(t){var e=rc(this,t);if(e)return e[1]},has:function(t){return!!rc(this,t)},set:function(t,e){var n=rc(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=Qh(this.entries,(function(e){return e[0]===t}));return~e&&tc(this.entries,e,1),!!~e}};var sc,oc={getConstructor:function(t,e,n,i){var r=t((function(t,r){Vh(t,s),Kh(t,{type:e,id:ec++,frozen:void 0}),Xh(r)||qh(r,t[i],{that:t,AS_ENTRIES:n})})),s=r.prototype,o=Zh(e),a=function(t,e,n){var i=o(t),r=Hh(Gh(e),!0);return!0===r?nc(i).set(e,n):r[i.id]=n,t};return zh(s,{delete:function(t){var e=o(this);if(!Yh(t))return!1;var n=Hh(t);return!0===n?nc(e).delete(t):n&&$h(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!Yh(t))return!1;var n=Hh(t);return!0===n?nc(e).has(t):n&&$h(n,e.id)}}),zh(s,n?{get:function(t){var e=o(this);if(Yh(t)){var n=Hh(t);return!0===n?nc(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},ac=Ts,lc=ct,hc=Rt,cc=nl,uc=zs,dc=Sa,fc=oc,pc=Jt,gc=ki.enforce,yc=dt,vc=gi,mc=Object,bc=Array.isArray,xc=mc.isExtensible,wc=mc.isFrozen,Sc=mc.isSealed,Ac=mc.freeze,_c=mc.seal,Bc={},Tc={},Cc=!lc.ActiveXObject&&"ActiveXObject"in lc,Pc=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Rc=dc("WeakMap",Pc,fc),Oc=Rc.prototype,Mc=hc(Oc.set);if(vc)if(Cc){sc=fc.getConstructor(Pc,"WeakMap",!0),uc.enable();var Ec=hc(Oc.delete),kc=hc(Oc.has),Ic=hc(Oc.get);cc(Oc,{delete:function(t){if(pc(t)&&!xc(t)){var e=gc(this);return e.frozen||(e.frozen=new sc),Ec(this,t)||e.frozen.delete(t)}return Ec(this,t)},has:function(t){if(pc(t)&&!xc(t)){var e=gc(this);return e.frozen||(e.frozen=new sc),kc(this,t)||e.frozen.has(t)}return kc(this,t)},get:function(t){if(pc(t)&&!xc(t)){var e=gc(this);return e.frozen||(e.frozen=new sc),kc(this,t)?Ic(this,t):e.frozen.get(t)}return Ic(this,t)},set:function(t,e){if(pc(t)&&!xc(t)){var n=gc(this);n.frozen||(n.frozen=new sc),kc(this,t)?Mc(this,t,e):n.frozen.set(t,e)}else Mc(this,t,e);return this}})}else ac&&yc((function(){var t=Ac([]);return Mc(new Rc,t,1),!wc(t)}))&&cc(Oc,{set:function(t,e){var n;return bc(t)&&(wc(t)?n=Bc:Sc(t)&&(n=Tc)),Mc(this,t,e),n==Bc&&Ac(t),n==Tc&&_c(t),this}});var jc=ee,Dc=Rt,Lc=Fe,Nc=jc("Map"),Wc=jc("WeakMap"),Fc=Dc([].push),Uc=Lc("metadata"),zc=Uc.store||(Uc.store=new Wc),Hc=function(t,e,n){var i=zc.get(t);if(!i){if(!n)return;zc.set(t,i=new Nc)}var r=i.get(e);if(!r){if(!n)return;i.set(e,r=new Nc)}return r},Vc={store:zc,getMap:Hc,has:function(t,e,n){var i=Hc(e,n,!1);return void 0!==i&&i.has(t)},get:function(t,e,n){var i=Hc(e,n,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,n,i){Hc(n,i,!0).set(t,e)},keys:function(t,e){var n=Hc(t,e,!1),i=[];return n&&n.forEach((function(t,e){Fc(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}},Gc=Nn,Xc=Vc.toKey,Yc=Vc.set;is({target:"Reflect",stat:!0},{defineMetadata:function(t,e,n){var i=arguments.length<4?void 0:Xc(arguments[3]);Yc(t,e,Gc(n),i)}});var qc=Nn,$c=Vc.toKey,Kc=Vc.getMap,Zc=Vc.store;is({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var n=arguments.length<3?void 0:$c(arguments[2]),i=Kc(qc(e),n,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var r=Zc.get(e);return r.delete(n),!!r.size||Zc.delete(e)}});var Jc=Nn,Qc=ul,tu=Vc.has,eu=Vc.get,nu=Vc.toKey,iu=function(t,e,n){if(tu(t,e,n))return eu(t,e,n);var i=Qc(e);return null!==i?iu(t,i,n):void 0};is({target:"Reflect",stat:!0},{getMetadata:function(t,e){var n=arguments.length<3?void 0:nu(arguments[2]);return iu(t,Jc(e),n)}});var ru=Rt,su=Map.prototype,ou={Map:Map,set:ru(su.set),get:ru(su.get),has:ru(su.has),remove:ru(su.delete),proto:su},au=vt,lu=Rt,hu=function(t,e,n){for(var i,r,s=n||t.next;!(i=au(s,t)).done;)if(void 0!==(r=e(i.value)))return r},cu=ou.Map,uu=ou.proto,du=lu(uu.forEach),fu=lu(uu.entries),pu=fu(new cu).next,gu=_e,yu=Wt,vu=gr,mu=He,bu=function(t,e,n){return n?hu(fu(t),(function(t){return e(t[1],t[0])}),pu):du(t,e)},xu=ou.Map,wu=ou.has,Su=ou.set,Au=Rt([].push),_u=is,Bu=Rt,Tu=Vc,Cu=Nn,Pu=ul,Ru=Bu((function(t){var e,n,i,r=mu(this),s=vu(r),o=[],a=new xu,l=yu(t)?function(t){return t}:gu(t);for(e=0;e<s;e++)i=l(n=r[e]),wu(a,i)||Su(a,i,n);return bu(a,(function(t){Au(o,t)})),o})),Ou=Bu([].concat),Mu=Tu.keys,Eu=Tu.toKey,ku=function(t,e){var n=Mu(t,e),i=Pu(t);if(null===i)return n;var r=ku(i,e);return r.length?n.length?Ru(Ou(n,r)):r:n};_u({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Eu(arguments[1]);return ku(Cu(t),e)}});var Iu=Nn,ju=Vc.get,Du=Vc.toKey;is({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var n=arguments.length<3?void 0:Du(arguments[2]);return ju(t,Iu(e),n)}});var Lu=Nn,Nu=Vc.keys,Wu=Vc.toKey;is({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:Wu(arguments[1]);return Nu(Lu(t),e)}});var Fu=Nn,Uu=ul,zu=Vc.has,Hu=Vc.toKey,Vu=function(t,e,n){if(zu(t,e,n))return!0;var i=Uu(e);return null!==i&&Vu(t,i,n)};is({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var n=arguments.length<3?void 0:Hu(arguments[2]);return Vu(t,Fu(e),n)}});var Gu=Nn,Xu=Vc.has,Yu=Vc.toKey;is({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var n=arguments.length<3?void 0:Yu(arguments[2]);return Xu(t,Gu(e),n)}});var qu=Nn,$u=Vc.toKey,Ku=Vc.set;is({target:"Reflect",stat:!0},{metadata:function(t,e){return function(n,i){Ku(t,e,qu(n),$u(i))}}});var Zu="named",Ju="name",Qu="unmanaged",td="optional",ed="inject",nd="multi_inject",id="inversify:tagged",rd="inversify:tagged_props",sd="inversify:paramtypes",od="post_construct",ad="pre_destroy";var ld=[ed,nd,Ju,Qu,Zu,td],hd={Request:"Request",Singleton:"Singleton",Transient:"Transient"},cd={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},ud={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},dd=0;function fd(){return dd++}var pd=function(){function t(t,e){this.id=fd(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=cd.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===hd.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}(),gd="Metadata key was used more than once in a parameter:",yd="NULL argument",vd="Key Not Found",md="Ambiguous match found for serviceIdentifier:",bd="No matching bindings found for serviceIdentifier:",xd="Missing required @injectable annotation in:",wd="Missing required @inject or @multiInject annotation in:",Sd="Circular dependency found:",Ad="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",_d=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."},Bd=function(t,e){return"@postConstruct error in class "+t+": "+e},Td=function(t,e){return"@preDestroy error in class "+t+": "+e},Cd=function(t,e){return"onDeactivation() error in class "+t+": "+e},Pd="Maximum call stack size exceeded",Rd=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(sd,t),userGeneratedMetadata:Reflect.getMetadata(id,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(rd,t)||[]},t}(),Od={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Md(t){return t instanceof RangeError||t.message===Pd}function Ed(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function kd(t,e,n){var i="",r=n(t,e);return 0!==r.length&&(i="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Dd(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i}function Id(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Id(t.parentRequest,e))}function jd(t){t.childRequests.forEach((function(t){if(Id(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,n){void 0===n&&(n=[]);var i=Ed(e.serviceIdentifier);return n.push(i),null!==e.parentRequest?t(e.parentRequest,n):n}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Sd+" "+e)}jd(t)}))}function Dd(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}var Ld=function(){function t(t){this.id=fd(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),Nd=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===Zu?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Wd=function(t,e){this.parentContext=t,this.rootRequest=e},Fd=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Ud=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,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},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}(),zd=function(){function t(t,e,n,i){this.id=fd(),this.type=t,this.serviceIdentifier=n;var r="symbol"==typeof e?e.toString().slice(7,-1):e;this.name=new Ud(r||""),this.identifier=e,this.metadata=new Array;var s=null;"string"==typeof i?s=new Nd(Zu,i):i instanceof Nd&&(s=i),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(nd)},t.prototype.matchesArray=function(t){return this.matchesTag(nd)(t)},t.prototype.isNamed=function(){return this.hasTag(Zu)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return ld.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(td)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===Zu}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return ld.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(Zu)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;i<r.length;i++){var s=r[i];if(s.key===t&&s.value===n)return!0}return!1}},t}(),Hd=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function Vd(t,e,n,i){var r=t.getConstructorMetadata(n),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(xd+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),l=0===n.length&&a.length>0,h=a.length>n.length,c=function(t,e,n,i,r){for(var s=[],o=0;o<r;o++){var a=Gd(o,t,e,n,i);null!==a&&s.push(a)}return s}(i,e,s,o,l||h?a.length:n.length),u=Yd(t,n,e);return Hd(Hd([],c,!0),u,!0)}function Gd(t,e,n,i,r){var s=r[t.toString()]||[],o=$d(s),a=!0!==o.unmanaged,l=i[t],h=o.inject||o.multiInject;if((l=h||l)instanceof Fd&&(l=l.unwrap()),a){if(!e&&(l===Object||l===Function||void 0===l))throw new Error(wd+" argument "+t+" in class "+n+".");var c=new zd(ud.ConstructorArgument,o.targetName,l);return c.metadata=s,c}return null}function Xd(t,e,n,i){var r=t||e;if(void 0===r){var s=xd+" for property "+String(n)+" in class "+i+".";throw new Error(s)}return r}function Yd(t,e,n){for(var i=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(i),o=0,a=Object.keys(i).concat(s);o<a.length;o++){var l=a[o],h=i[l],c=$d(h),u=c.targetName||l,d=Xd(c.inject,c.multiInject,l,n),f=new zd(ud.ClassProperty,u,d);f.metadata=h,r.push(f)}var p=Object.getPrototypeOf(e.prototype).constructor;if(p!==Object){var g=Yd(t,p,n);r=Hd(Hd([],r,!0),g,!0)}return r}function qd(t,e){var n=Object.getPrototypeOf(e.prototype).constructor;if(n!==Object){var i=Vd(t,Dd(n),n,!0),r=i.map((function(t){return t.metadata.filter((function(t){return t.key===Qu}))})),s=[].concat.apply([],r).length,o=i.length-s;return o>0?o:qd(t,n)}return 0}function $d(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[ed],multiInject:e[nd],targetName:e[Ju],unmanaged:e[Qu]}}var Kd=function(){function t(t,e,n,i,r){this.id=fd(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();function Zd(t){return t._bindingDictionary}function Jd(t,e,n,i,r){var s=tf(n.container,r.serviceIdentifier),o=[];return s.length===Od.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),s=tf(n.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new Kd(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case Od.NoBindingsAvailable:if(n.isOptional())return e;var r=Ed(t),s=bd;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t}(r,n),s+=kd(i,r,tf),new Error(s);case Od.OnlyOneBindingAvailable:return e;case Od.MultipleBindingsAvailable:default:if(n.isArray())return e;r=Ed(t),s=md+" "+r;throw s+=kd(i,r,tf),new Error(s)}}(r.serviceIdentifier,o,r,n.container),o}function Qd(t,e,n,i,r,s){var o,a;if(null===r){o=Jd(t,e,i,null,s),a=new Kd(n,i,null,o,s);var l=new Wd(i,a);i.addPlan(l)}else o=Jd(t,e,i,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var n=null;if(s.isArray())n=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;n=a}if(e.type===cd.Instance&&null!==e.implementationType){var r=function(t,e){return Vd(t,Dd(e),e,!1)}(t,e.implementationType);if(!i.container.options.skipBaseClassChecks){var o=qd(t,e.implementationType);if(r.length<o){var l=_d(Dd(e.implementationType));throw new Error(l)}}r.forEach((function(e){Qd(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function tf(t,e){var n=[],i=Zd(t);return i.hasKey(e)?n=i.get(e):null!==t.parent&&(n=tf(t.parent,e)),n}function ef(t,e,n,i,r,s,o,a){void 0===a&&(a=!1);var l=new Ld(e),h=function(t,e,n,i,r,s){var o=new Nd(t?nd:ed,n),a=new zd(e,i,n,o);if(void 0!==r){var l=new Nd(r,s);a.metadata.push(l)}return a}(n,i,r,"",s,o);try{return Qd(t,a,r,l,null,h),l}catch(t){throw Md(t)&&jd(l.plan.rootRequest),t}}function nf(t){return("object"==typeof t&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function rf(t){return!!nf(t)||Array.isArray(t)&&t.some(nf)}var sf,of=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},af=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},lf=function(t,e,n){t.has(e.id)||t.set(e.id,n)},hf=function(t,e){t.cache=e,t.activated=!0,nf(e)&&cf(t,e)},cf=function(t,e){return of(void 0,void 0,void 0,(function(){var n,i;return af(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return n=r.sent(),t.cache=n,[3,3];case 2:throw i=r.sent(),t.cache=null,t.activated=!1,i;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(sf||(sf={}));var uf=function(){return uf=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},uf.apply(this,arguments)},df=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},ff=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},pf=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function gf(t,e,n){var i;if(e.length>0){var r=function(t,e){return t.reduce((function(t,n){var i=e(n);return n.target.type===ud.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=rf(i)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,n),s=uf(uf({},r),{constr:t});i=r.isAsync?function(t){return df(this,void 0,void 0,(function(){var e,n;return ff(this,(function(i){switch(i.label){case 0:return[4,vf(t.constructorInjections)];case 1:return e=i.sent(),[4,vf(t.propertyInjections)];case 2:return n=i.sent(),[2,yf(uf(uf({},t),{constructorInjections:e,propertyInjections:n}))]}}))}))}(s):yf(s)}else i=new t;return i}function yf(t){var e,n=new((e=t.constr).bind.apply(e,pf([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,i){var r=e.target.identifier,s=t.propertyInjections[i];n[r]=s})),n}function vf(t){return df(this,void 0,void 0,(function(){var e,n,i,r;return ff(this,(function(s){for(e=[],n=0,i=t;n<i.length;n++)r=i[n],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function mf(t,e){var n=function(t,e){var n,i;if(Reflect.hasMetadata(od,t)){var r=Reflect.getMetadata(od,t);try{return null===(i=(n=e)[r.value])||void 0===i?void 0:i.call(n)}catch(e){throw new Error(Bd(t.name,e.message))}}}(t,e);return nf(n)?n.then((function(){return e})):e}function bf(t,e){t.scope!==hd.Singleton&&function(t,e){var n="Class cannot be instantiated in "+(t.scope===hd.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Cd(e.name,n));if(Reflect.hasMetadata(ad,e))throw new Error(Td(e.name,n))}(t,e)}var xf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},wf=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Sf=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,i=e.childRequests,r=e.target&&e.target.isArray(),s=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(r&&s)return i.map((function(e){return Sf(t)(e)}));if(!e.target.isOptional()||0!==n.length){var o=n[0];return Tf(t,e,o)}}},Af=function(t,e){var n=function(t){switch(t.type){case cd.Factory:return{factory:t.factory,factoryType:sf.Factory};case cd.Provider:return{factory:t.provider,factoryType:sf.Provider};case cd.DynamicValue:return{factory:t.dynamicValue,factoryType:sf.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Md(t)&&(t=e()),t}}((function(){return n.factory.bind(t)(e)}),(function(){return new Error((t=n.factoryType,i=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+i+"'."));var t,i}))},_f=function(t,e,n){var i,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case cd.ConstantValue:case cd.Function:e=t.cache;break;case cd.Constructor:case cd.Instance:e=t.implementationType;break;case cd.DynamicValue:e=t.dynamicValue;break;case cd.Provider:e=t.provider;break;case cd.Factory:e=t.factory}if(null===e){var n=Ed(t.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case cd.ConstantValue:case cd.Function:i=n.cache;break;case cd.Constructor:i=n.implementationType;break;case cd.Instance:i=function(t,e,n,i){bf(t,e);var r=gf(e,n,i);return nf(r)?r.then((function(t){return mf(e,t)})):mf(e,r)}(n,n.implementationType,r,Sf(t));break;default:i=Af(n,e.parentContext)}return i},Bf=function(t,e,n){var i=function(t,e){return e.scope===hd.Singleton&&e.activated?e.cache:e.scope===hd.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==i||function(t,e,n){e.scope===hd.Singleton&&hf(e,n),e.scope===hd.Request&&lf(t,e,n)}(t,e,i=n()),i},Tf=function(t,e,n){return Bf(t,n,(function(){var i=_f(t,e,n);return i=nf(i)?i.then((function(t){return Cf(e,n,t)})):Cf(e,n,i)}))};function Cf(t,e,n){var i,r=Pf(t.parentContext,e,n),s=Ef(t.parentContext.container),o=s.next();do{i=o.value;var a=t.parentContext,l=t.serviceIdentifier,h=Mf(i,l);r=nf(r)?Of(h,a,r):Rf(h,a,r),o=s.next()}while(!0!==o.done&&!Zd(i).hasKey(t.serviceIdentifier));return r}var Pf=function(t,e,n){return"function"==typeof e.onActivation?e.onActivation(t,n):n},Rf=function(t,e,n){for(var i=t.next();!i.done;){if(nf(n=i.value(e,n)))return Of(t,e,n);i=t.next()}return n},Of=function(t,e,n){return xf(void 0,void 0,void 0,(function(){var i,r;return wf(this,(function(s){switch(s.label){case 0:return[4,n];case 1:i=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,i)];case 3:return i=s.sent(),r=t.next(),[3,2];case 4:return[2,i]}}))}))},Mf=function(t,e){var n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},Ef=function(t){for(var e=[t],n=t.parent;null!==n;)e.push(n),n=n.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var kf=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||kf(n,e))},If=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new Nd(t,e),n}},jf=If(Zu),Df=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var i=e.bindings[0].implementationType;return t===i}return!1}},Lf=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Nf(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=jf(t),new Nf(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 Nf(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=If(t)(e),new Nf(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Df(t)(e.parentRequest)},new Nf(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&jf(t)(e.parentRequest)},new Nf(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&If(t)(e)(n.parentRequest)},new Nf(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&kf(e,Df(t))},new Nf(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!kf(e,Df(t))},new Nf(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&kf(e,jf(t))},new Nf(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!kf(e,jf(t))},new Nf(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&kf(n,If(t)(e))},new Nf(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&!kf(n,If(t)(e))},new Nf(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&kf(e,t)},new Nf(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!kf(e,t)},new Nf(this._binding)},t}(),Nf=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Lf(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Lf(this._binding)},t}(),Wf=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Lf(this._binding),this._bindingOnSyntax=new Nf(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}(),Ff=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=hd.Request,new Wf(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=hd.Transient,new Wf(this._binding)},t}(),Uf=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Lf(this._binding),this._bindingOnSyntax=new Nf(this._binding),this._bindingInSyntax=new Ff(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}(),zf=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=cd.Instance,this._binding.implementationType=t,new Uf(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=cd.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=cd.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Uf(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=cd.Constructor,this._binding.implementationType=t,this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=cd.Factory,this._binding.factory=t,this._binding.scope=hd.Singleton,new Wf(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=cd.Function,this._binding.scope=hd.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=cd.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=cd.Factory,this._binding.factory=function(e){return function(n){return e.container.getNamed(t,n)}},new Wf(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=cd.Provider,this._binding.provider=t,this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Hf=function(){function t(){}return t.of=function(e,n,i,r,s){var o=new t;return o.bindings=e,o.middleware=n,o.deactivations=r,o.activations=i,o.moduleActivationStore=s,o},t}();var Vf=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(yd);if(null==e)throw new Error(yd);var n=this._map.get(t);void 0!==n?n.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(yd);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(vd)},t.prototype.remove=function(t){if(null==t)throw new Error(yd);if(!this._map.delete(t))throw new Error(vd)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(n,i){var r=t.hasKey(n)?t.get(n):void 0;if(void 0!==r){var s=i.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(n,s)}}))},t.prototype.removeByCondition=function(t){var e=this,n=[];return this._map.forEach((function(i,r){for(var s=[],o=0,a=i;o<a.length;o++){var l=a[o];t(l)?n.push(l):s.push(l)}e._setValue(r,s)})),n},t.prototype.hasKey=function(t){if(null==t)throw new Error(yd);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,"object"==typeof(i=t)&&null!==i&&"clone"in i&&"function"==typeof i.clone?t.clone():t);var i}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Gf=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,n){this._getModuleActivationHandlers(t).onDeactivations.add(e,n)},t.prototype.addActivation=function(t,e,n){this._getModuleActivationHandlers(t).onActivations.add(e,n)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){e._map.set(n,{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 Vf,onDeactivations:new Vf}},t}(),Xf=function(){return Xf=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Xf.apply(this,arguments)},Yf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},qf=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},$f=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},Kf=function(){function t(t){var e=t||{};if("object"!=typeof e)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=hd.Transient;else if(e.defaultScope!==hd.Singleton&&e.defaultScope!==hd.Transient&&e.defaultScope!==hd.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=fd(),this._bindingDictionary=new Vf,this._snapshots=[],this._middleware=null,this._activations=new Vf,this._deactivations=new Vf,this.parent=null,this._metadataReader=new Rd,this._moduleActivationStore=new Gf}return t.merge=function(e,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var s=new t,o=$f([e,n],i,!0).map((function(t){return Zd(t)})),a=Zd(s);return o.forEach((function(t){var e;e=a,t.traverse((function(t,n){n.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 n=this._getContainerModuleHelpersFactory(),i=0,r=t;i<r.length;i++){var s=r[i],o=n(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 Yf(this,void 0,void 0,(function(){var e,n,i,r,s;return qf(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,o.label=1;case 1:return n<i.length?(r=i[n],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 n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){var n=t._removeModuleBindings(e.id);t._deactivateSingletons(n),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yf(this,void 0,void 0,(function(){var e,n,i,r;return qf(this,(function(s){switch(s.label){case 0:e=0,n=t,s.label=1;case 1:return e<n.length?(i=n[e],r=this._removeModuleBindings(i.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(i.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||hd.Transient,n=new pd(t,e);return this._bindingDictionary.add(t,n),new zf(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Yf(this,void 0,void 0,(function(){return qf(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 Yf(this,void 0,void 0,(function(){var e;return qf(this,(function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,n){t._deactivateSingletons(n)})),this._bindingDictionary=new Vf},t.prototype.unbindAllAsync=function(){return Yf(this,void 0,void 0,(function(){var t,e=this;return qf(this,(function(n){switch(n.label){case 0:return t=[],this._bindingDictionary.traverse((function(n,i){t.push(e._deactivateSingletonsAsync(i))})),[4,Promise.all(t)];case 1:return n.sent(),this._bindingDictionary=new Vf,[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,Zu,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,n,i){var r=new zd(ud.Variable,"",e,new Nd(n,i)),s=new Ld(t);return new Kd(e,s,null,[],r)}(this,t,e,n);i=r.some((function(t){return t.constraint(s)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(Hf.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 n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},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 Yf(this,void 0,void 0,(function(){var e;return qf(this,(function(n){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,n){var i=this._getNotAllArgs(t,!1,e,n);return this._getButThrowIfAsync(i)},t.prototype.getTaggedAsync=function(t,e,n){return Yf(this,void 0,void 0,(function(){var i;return qf(this,(function(r){return i=this._getNotAllArgs(t,!1,e,n),[2,this._get(i)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,Zu,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,Zu,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,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getButThrowIfAsync(i)},t.prototype.getAllTaggedAsync=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getAll(i)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,Zu,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,Zu,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var n=this.get(t);return e||this.unbind(t),n},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(ad,t))return e[Reflect.getMetadata(ad,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 n=this,i=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(nf(r))return this._handleDeactivationError(r.then((function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,i)})),i)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(nf(s))return this._handleDeactivationError(s,i)}catch(t){throw new Error(Cd(i.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Yf(this,void 0,void 0,(function(){var n;return qf(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),new Error(Cd(e.name,n.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var n=this,i=e.next();i.value;){var r=i.value(t);if(nf(r))return r.then((function(){return n._deactivateContainerAsync(t,e)}));i=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Yf(this,void 0,void 0,(function(){var n;return qf(this,(function(i){switch(i.label){case 0:n=e.next(),i.label=1;case 1:return n.value?[4,n.value(t)]:[3,3];case 2:return i.sent(),n=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}},i=function(e){return function(n,i){t._moduleActivationStore.addActivation(e,n,i),t.onActivation(n,i)}},r=function(e){return function(n,i){t._moduleActivationStore.addDeactivation(e,n,i),t.onDeactivation(n,i)}};return function(s){return{bindFunction:(o=s,function(n){var i=t.bind(n);return e(i,o),i}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:i(s),onDeactivationFunction:r(s),rebindFunction:n(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=Xf(Xf({},t),{contextInterceptor:function(t){return t},targetType:ud.Variable});if(this._middleware){var n=this._middleware(e);if(null==n)throw new Error("Invalid return type in middleware. Middleware must return!");return n}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(rf(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,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=ef(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Sf(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(n=e.contextInterceptor(n))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return nf(t.cache)?t.cache.then((function(n){return e._deactivate(t,n)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,n=t;e<n.length;e++){var i=n[e];if(nf(this._deactivateIfSingleton(i)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Yf(this,void 0,void 0,(function(){var e=this;return qf(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return n.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,n){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,n)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,n){return Yf(this,void 0,void 0,(function(){return qf(this,(function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,n)];case 3:i.sent(),i.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: "+Ed(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,n){var i=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(nf(r))return r.then((function(){return i._preDestroy(n,e)}))}return this._preDestroy(n,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,n){return Yf(this,void 0,void 0,(function(){return qf(this,(function(i){switch(i.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,e)];case 3:return i.sent(),[2]}}))}))},t}(),Zf=function(t){this.id=fd(),this.registry=t};function Jf(t,e,n,i){!function(t){if(void 0!==t)throw new Error(Ad)}(e),tp(id,t,n.toString(),i)}function Qf(t){var e=[];if(Array.isArray(t)){var n=function(t){for(var e=new Set,n=0,i=t;n<i.length;n++){var r=i[n];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==n)throw new Error(gd+" "+n.toString())}else e=[t];return e}function tp(t,e,n,i){var r=Qf(i),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[n];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(gd+" "+t.key.toString())},l=0,h=o;l<h.length;l++){a(h[l])}o.push.apply(o,r),s[n]=o,Reflect.defineMetadata(t,s,e)}function ep(t){return function(e,n,i){"number"==typeof i?Jf(e,n,i,t):function(t,e,n){if(void 0!==t.prototype)throw new Error(Ad);tp(rd,t.constructor,e,n)}(e,n,t)}}function np(){return function(t){if(Reflect.hasOwnMetadata(sd,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(sd,e,t),t}}function ip(t){return ep(new Nd(Zu,t))}function rp(t){return function(e){return function(n,i,r){if(void 0===e){var s="function"==typeof n?n.name:n.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 ep(new Nd(t,e))(n,i,r)}}}var sp=rp(ed),op=rp(nd);var ap,lp,hp=(ap=od,lp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var n=new Nd(ap,e);if(Reflect.hasOwnMetadata(ap,t.constructor))throw new Error(lp);Reflect.defineMetadata(ap,n,t.constructor)}});const cp=Symbol("ContributionProvider");class up{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 dp(t,e){t(cp).toDynamicValue((t=>{let{container:n}=t;return new up(e,n)})).inSingletonScope().whenTargetNamed(e)}class fp{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>t.name!==n&&(!e||t.fn===e))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+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>n)){i++;break}}this.taps[i]=t}}class pp extends fp{call(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const gp=Symbol.for("EnvContribution"),yp=Symbol.for("VGlobal");var vp=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bp=function(t,e){return function(n,i){e(n,i,t)}};let xp=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new pp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((n=>{const i=n.configure(this,t);i&&i.then&&e.push(i)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const n=this._env;this._env=t;const i=this.bindContribution(e);if(i&&i.then)return i.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}removeEventListener(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};xp=vp([np(),bp(0,sp(cp)),bp(0,ip(gp)),mp("design:paramtypes",[Object])],xp);const wp=C-1e-8;class Sp{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>wp)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let o,a,l,h,c=1/0,u=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),h=n*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>f&&(f=h)}if(p(i),p(r),r!==i)if((i%=C)<0&&(i+=C),(r%=C)<0&&(r+=C),r<i&&(s=!s,o=i,i=r,r=o),s)for(r-=C,o=i-i%T,a=0;a<4&&o>r;++a,o-=T)p(o);else for(o=i-i%T+T,a=0;a<4&&o<r;++a,o+=T)p(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+f)}arcTo(t,e,n,i,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),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,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(){}}class Ap{constructor(){this.curves=[],this.bounds=new V}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const _p=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Bp={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},Tp={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Cp,Pp,Rp,Op,Mp,Ep;var kp,Ip,jp,Dp,Lp,Np,Wp,Fp,Up;function zp(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=l*s,c=-a*o,u=a*s,d=l*o,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),y=Math.sin(r),v=.5*(r-i),m=Math.sin(.5*v),b=8/3*m*m/Math.sin(v),x=e+f-b*p,w=n+p+b*f,S=e+g,A=n+y,_=S+b*y,B=A-b*g;return[h*x+c*w,u*x+d*w,h*_+c*B,u*_+d*B,h*S+c*A,u*S+d*A]}function Hp(t,e,n,i){const r=function(t,e,n,i,r,s,o,a,l){const h=G(o),c=Math.sin(h),u=Math.cos(h),d=u*(a-t)*.5+c*(l-e)*.5,f=u*(l-e)*.5-c*(a-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=u/n,y=c/n,v=-c/i,m=u/i,b=g*a+y*l,x=v*a+m*l,w=g*t+y*e,S=v*t+m*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let _=Math.sqrt(A);s===r&&(_=-_);const B=.5*(b+w)-_*(S-x),P=.5*(x+S)+_*(w-b),R=Math.atan2(x-P,b-B);let O=Math.atan2(S-P,w-B)-R;O<0&&1===s?O+=C:O>0&&0===s&&(O-=C);const M=Math.ceil(Math.abs(O/(T+.001))),E=[];for(let t=0;t<M;++t){const e=R+t*O/M,r=R+(t+1)*O/M;E[t]=[B,P,e,r,n,i,c,u]}return E}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=zp(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(kp||(kp={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Ip||(Ip={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(jp||(jp={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Dp||(Dp={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Lp||(Lp={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Np||(Np={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Wp||(Wp={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Fp||(Fp={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Up||(Up={}));const Vp=[(t,e,n,i,r,s,o)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,n,i,r,s,o)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,o),(t,e,n,i,r,s,o)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,o),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,o)=>e.lineTo(t[1]*r+n,t[2]*s+i,o),(t,e,n,i,r,s,o)=>e.moveTo(t[1]*r+n,t[2]*s+i,o),(t,e,n,i,r,s,o)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,o),(t,e,n,i,r,s,o)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,o)];function Gp(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const l=t[a];Vp[l[0]](l,e,n,i,r,s,o)}}class Xp{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Yp(t,e,n,i,r){return function(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],o=e[r],a=t[(r+1)%i],l=e[(r+1)%i];n+=U.distanceNN(s,o,a,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function qp(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function $p(t,e,n,i,r){const s=qp(t.x,e.x,n.x,i.x,r),o=qp(t.y,e.y,n.y,i.y,r);return new F(s,o)}function Kp(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,o=$p(n,i,r,s,e),a=U.pointAtPP(n,i,e),l=U.pointAtPP(i,r,e),h=U.pointAtPP(r,s,e),c=U.pointAtPP(a,l,e),u=U.pointAtPP(l,h,e);return[new Zp(n,a,c,o),new Zp(o,u,h,s)]}class Zp extends Xp{constructor(t,e,n,i){super(),this.type=Fp.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_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 $p(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Yp(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Wp.ROW?R(this.p0.x-this.p3.x):t===Wp.COLUMN?R(this.p0.y-this.p3.y):0}getAngleAt(t){const e=E(t-.01,0),n=k(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return O(r.y-i.y,r.x-i.x)}}function Jp(t,e){const{p0:n,p1:i}=t,r=U.pointAtPP(n,i,e);return[new Qp(n,r),new Qp(r,i)]}class Qp extends Xp{constructor(t,e){super(),this.type=Fp.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return U.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=O(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()?U.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Wp.ROW?R(this.p0.x-this.p1.x):t===Wp.COLUMN?R(this.p0.y-this.p1.y):0}}class tg{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,n,i,r,s,o,a){const l=new Zp(new F(this._lastX,this._lastY),new F(t,e),new F(n,i),new F(r,s));l.originP1=this._lastOriginP,l.originP2=a,l.defined=o,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new Qp(new F(this._lastX,this._lastY),new F(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===Wp.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return R(t.p0.y-i.y)}if(t===Wp.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 R(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class eg extends tg{bezierCurveTo(t,e,n,i,r,s,o,a){return super.bezierCurveTo(e,t,i,n,s,r,o,a)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function ng(t,e){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 ig{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function rg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=new tg("linear",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new ig(r,i),t),r}function sg(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class og{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&sg(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:sg(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function ag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return rg(t,e);const r=new tg("basis",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new og(r,i),t),r}function lg(t){return t<0?-1:1}function hg(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),o=(n-t._y1)/(r||Number(i<0&&-0)),a=(s*r+o*i)/(i+r);return(lg(s)+lg(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function cg(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ug(t,e,n,i,r){const s=t._x0,o=t._y0,a=t._x1,l=t._y1,h=(a-s)/3;t.context.bezierCurveTo(s+h,o+h*e,a-h,l-h*n,a,l,i,t.lastPoint1)}class dg{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:ug(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 n=t.x,i=t.y;if(n!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,ug(this,cg(this,e=hg(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:ug(this,this._t0,e=hg(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}tryUpdateLength(){return this.context.tryUpdateLength()}}class fg extends dg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function pg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return rg(t,e);const r=new tg("monotoneX",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new dg(r,i),t),r}function gg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return rg(t,e);const r=new eg("monotoneY",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new fg(r,i),t),r}let yg=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function vg(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new tg("step",null!=i?i:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new yg(s,e,r),t),s}class mg{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function bg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=new tg("linear",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new mg(r,i),t),r}function xg(t,e,n){switch(e){case"linear":default:return rg(t,n);case"basis":return ag(t,n);case"monotoneX":return pg(t,n);case"monotoneY":return gg(t,n);case"step":return vg(t,.5,n);case"stepBefore":return vg(t,0,n);case"stepAfter":return vg(t,1,n);case"linearClosed":return bg(t,n)}}class wg extends Ap{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Sp(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Tp.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Tp.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Tp.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([Tp.C,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([Tp.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,o,a){return this.commandList.push([Tp.E,t,e,n,i,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,o,a),this}rect(t,e,n,i){return this.commandList.push([Tp.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([Tp.A,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([Tp.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[Tp.M]=t=>`M${t[1]} ${t[2]}`,t[Tp.L]=t=>`L${t[1]} ${t[2]}`,t[Tp.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Tp.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Tp.A]=t=>{const e=[];((t,e,n,i,r,s,o)=>{const a=Math.abs(n-e),l=4*Math.tan(a/4)/3,h=n<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(n),f=Math.sin(n),p=c*s+i,g=u*o+r,y=d*s+i,v=f*o+r,m=s*l*h,b=o*l*h;t.push(p-m*u,g+b*c,y+m*f,v-b*d,y,v)})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let n="";for(let t=0;t<e.length;t+=6)n+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return n},t[Tp.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Cp=e[t],Pp=Cp.slice(1),Rp=Cp[0],n=[Rp],i=Pp.match(_p),null!==i){for(let t=0,e=i.length;t<e;t++)Op=i[t],Mp=parseFloat(Op),Number.isNaN(Mp)||n.push(Mp);if(Ep=Bp[Rp],n.length-1>Ep){let t;for(let e=1,i=n.length;e<i;e+=Ep){t=[Rp];for(let i=e,r=e+Ep;i<r;i++)t.push(n[i]);r.push(t)}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=xg(e,n);"x"===i?this.direction=Wp.ROW:"y"===i?this.direction=Wp.COLUMN:"auto"===i&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[Tp.M]=this.moveToTransform,t[Tp.L]=this.lineToTransform,t[Tp.Q]=this.quadraticCurveToTransform,t[Tp.C]=this.bezierCurveToTransform,t[Tp.AT]=this.arcToTransform,t[Tp.E]=this.ellipseTransform,t[Tp.R]=this.rectTransform,t[Tp.A]=this.arcTransform,t[Tp.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t){let e,n,i,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,f=0,p=0;for(let g=0,y=t.length;g<y;++g){switch(e=t[g],1===l&&1===h||(e=Ag(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+o,d+a);break;case"L":u=e[1],d=e[2],this.lineTo(u+o,d+a);break;case"h":u+=e[1],this.lineTo(u+o,d+a);break;case"H":u=e[1],this.lineTo(u+o,d+a);break;case"v":d+=e[1],this.lineTo(u+o,d+a);break;case"V":d=e[1],this.lineTo(u+o,d+a);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+o,d+a);break;case"M":u=e[1],d=e[2],this.moveTo(u+o,d+a);break;case"c":n=u+e[5],i=d+e[6],f=u+e[3],p=d+e[4],this.bezierCurveTo(u+e[1]+o,d+e[2]+a,f+o,p+a,n+o,i+a),u=n,d=i;break;case"C":u=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,f+o,p+a,u+o,d+a);break;case"s":n=u+e[3],i=d+e[4],f=2*u-f,p=2*d-p,this.bezierCurveTo(f+o,p+a,u+e[1]+o,d+e[2]+a,n+o,i+a),f=u+e[1],p=d+e[2],u=n,d=i;break;case"S":n=e[3],i=e[4],f=2*u-f,p=2*d-p,this.bezierCurveTo(f+o,p+a,e[1]+o,e[2]+a,n+o,i+a),u=n,d=i,f=e[1],p=e[2];break;case"q":n=u+e[3],i=d+e[4],f=u+e[1],p=d+e[2],this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,n+o,i+a),u=n,d=i,f=e[1],p=e[2];break;case"t":n=u+e[1],i=d+e[2],null===c[0].match(/[QqTt]/)?(f=u,p=d):"t"===c[0]?(f=2*u-r,p=2*d-s):"q"===c[0]&&(f=2*u-f,p=2*d-p),r=f,s=p,this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i,f=u+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*u-f,p=2*d-p,this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i;break;case"a":Hp(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+o,e[7]+d+a]),u+=e[6],d+=e[7];break;case"A":Hp(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Tp.L:this.lineToTransform(o,e,n,i,r);break;case Tp.M:this.moveToTransform(o,e,n,i,r);break;case Tp.C:this.bezierCurveToTransform(o,e,n,i,r);break;case Tp.Q:this.quadraticCurveToTransform(o,e,n,i,r);break;case Tp.A:this.arcToTransform(o,e,n,i,r);break;case Tp.E:this.ellipseTransform(o,e,n,i,r);break;case Tp.R:this.rectTransform(o,e,n,i,r);break;case Tp.AT:this.arcToTransform(o,e,n,i,r);break;case Tp.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Gp(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Wp.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return R(t.p0.y-e.p1.y)}if(this.direction===Wp.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return R(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,n=0;for(let i=0;i<this.curves.length;i++){e=this.curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}}const Sg=["l",0,0,0,0,0,0,0];function Ag(t,e,n){const i=Sg[0]=t[0];if("a"===i||"A"===i)Sg[1]=e*t[1],Sg[2]=n*t[2],Sg[3]=t[3],Sg[4]=t[4],Sg[5]=t[5],Sg[6]=e*t[6],Sg[7]=n*t[7];else if("h"===i||"H"===i)Sg[1]=e*t[1];else if("v"===i||"V"===i)Sg[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)Sg[i]=(i%2==1?e:n)*t[i];return Sg}const _g={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Y},Bg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Tg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Cg=Object.assign({outerBorder:Object.assign(Object.assign({},Tg),{distance:0}),innerBorder:Object.assign(Object.assign({},Tg),{distance:0})},Tg),Pg={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1},Rg=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Bg),Cg),{alignSelf:"auto"}),Og={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Mg=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1},Rg),_g),Eg=Object.assign(Object.assign({},Mg),{startAngle:0,endAngle:P,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),kg=Object.assign(Object.assign(Object.assign({},Mg),Og),{points:[],segments:[],curveType:"linear",clipRange:1}),Ig=Object.assign(Object.assign({},Mg),{radius:1,startAngle:0,endAngle:P}),jg=Object.assign(Object.assign({},Mg),{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"}),Dg=Object.assign(Object.assign({},Mg),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Lg=Object.assign(Object.assign(Object.assign({},Mg),Og),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),Ng=Object.assign(Object.assign({},Mg),{path:new wg,customPath:()=>{console.warn("空函数")}}),Wg=Object.assign(Object.assign({},Mg),{points:[],cornerRadius:0}),Fg=Object.assign(Object.assign({},Mg),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),Ug=Object.assign(Object.assign({},Mg),{width:0,height:0,cornerRadius:0,length:0}),zg=Object.assign(Object.assign({},Mg),{symbolType:"circle",size:10,keepDirIn3d:!0}),Hg=Object.assign(Object.assign(Object.assign({},Mg),Pg),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Vg=Object.assign(Object.assign({},Mg),{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}),Gg=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Mg),{fill:!0,cornerRadius:0}),Xg=Object.assign(Object.assign({},Gg),{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 Yg=new class{},qg={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"}},$g=!0,Kg=!1,Zg=/\w|\(|\)|-/,Jg=/[.?!,;:/,。?!、;:]/,Qg=/\S/;function ty(t,e,n,i,r){if(!e||e<=0)return 0;const s=Yg.graphicUtil.textMeasure;let o=i,a=t.slice(0,o),l=Math.floor(s.measureText(a,n).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,n).width);for(;l>e||c<=e;){if(l>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),l=Math.floor(s.measureText(a,n).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,n).width)}return r&&(o=ey(t,o)),o}function ey(t,e){let n=e;for(;Zg.test(t[n-1])&&Zg.test(t[n])||Jg.test(t[n]);)if(n--,n<=0)return e;return n}function ny(t,e){const n=Yg.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var iy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let ry=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:n=Hg.fontSize}=e,i=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:r++;return{width:~~(.8*i*n+r*n),height:n}}measureTextPixelHeight(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Pg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Pg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,n,i){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<n;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,n-o,0,t[a].text.length-1);if(i&&r.str!==t[a].text){let n="",i=0;for(let e=0;e<a;e++){const r=t[e];n+=r.text,i+=r.text.length}n+=t[a].text;let s=ey(n,i+r.str.length);s-=i,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,n,i){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>n)return{str:"",width:0};const s=this._clipText(t,e,n,0,t.length-1);if(i&&s.str!==t){const n=ey(t,s.str.length);n!==s.str.length&&(s.str=t.substring(0,n),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,n,i,r){const s=Math.floor((i+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let l;if(a>n){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return l=this.measureTextWidth(r,e),l<=n?{str:r,width:l}:this._clipText(t,e,n,i,s)}if(a<n){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const i=t.substring(0,s+2);return l=this.measureTextWidth(i,e),l>=n?{str:o,width:a}:this._clipText(t,e,n,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,n,i,r){if(""===i)return this.clipTextVertical(t,e,n,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,n,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(i,e);if(o>n)return s;n-=o;const a=this.clipTextVertical(t,e,n,r);return a.width+=o,a.verticalList.push({text:i,direction:1,width:o}),a}clipTextWithSuffix(t,e,n,i,r){if(""===i)return this.clipText(t,e,n,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=n)return{str:t,width:s};const o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;const a=this._clipText(t,e,n,0,t.length-1);if(r&&a.str!==t){const n=ey(t,a.str.length);n!==a.str.length&&(a.str=t.substring(0,n),a.width=this.measureTextWidth(a.str,e))}return a.str+=i,a.width+=o,a}};ry=iy([np()],ry);var sy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const oy=Symbol.for("TextMeasureContribution");let ay=class extends ry{};ay=sy([np()],ay);const ly=new Kf,hy=Symbol.for("CanvasFactory"),cy=Symbol.for("Context2dFactory");function uy(t){return ly.getNamed(hy,Yg.global.env)(t)}const dy=1e-4,fy=Math.sqrt(3),py=1/3;function gy(t){return t>-Ry&&t<Ry}function yy(t){return t>Ry||t<-Ry}const vy=[0,0],my=[0,0],by=[0,0];function xy(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function wy(t,e,n,i){const r=1-i;return r*(r*t+2*i*e)+i*i*n}function Sy(t,e,n,i,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*i+3*s*n)}function Ay(t){return(t%=P)<0&&(t+=P),t}function _y(t,e,n,i,r,s){if(s>e&&s>i||s<e&&s<i)return 0;if(i===e)return 0;const o=(s-e)/(i-e);let a=i<e?1:-1;1!==o&&0!==o||(a=i<e?.5:-.5);const l=o*(n-t)+t;return l===r?1/0:l>r?a:0}function By(t,e,n,i,r,s,o,a,l){if(0===o)return!1;const h=o;return!(l>e+h&&l>i+h&&l>s+h||l<e-h&&l<i-h&&l<s-h||a>t+h&&a>n+h&&a>r+h||a<t-h&&a<n-h&&a<r-h)&&function(t,e,n,i,r,s,o,a,l){let h=0,c=.005,u=1/0;vy[0]=o,vy[1]=a;for(let o=0;o<1;o+=.05){my[0]=wy(t,n,r,o),my[1]=wy(e,i,s,o);const a=xy(vy,my);a<u&&(h=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<dy);o++){const o=h-c,a=h+c;my[0]=wy(t,n,r,o),my[1]=wy(e,i,s,o);const l=xy(my,vy);if(o>=0&&l<u)h=o,u=l;else{by[0]=wy(t,n,r,a),by[1]=wy(e,i,s,a);const o=xy(by,vy);a<=1&&o<u?(h=a,u=o):c*=.5}}return l&&(l[0]=wy(t,n,r,h),l[1]=wy(e,i,s,h)),Math.sqrt(u)}(t,e,n,i,r,s,a,l,null)<=h/2}function Ty(t,e,n,i,r,s,o,a,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>i+u&&c>s+u&&c>a+u||c<e-u&&c<i-u&&c<s-u&&c<a-u||h>t+u&&h>n+u&&h>r+u&&h>o+u||h<t-u&&h<n-u&&h<r-u&&h<o-u)&&function(t,e,n,i,r,s,o,a,l,h,c){let u,d,f,p,g=0,y=.005,v=1/0;vy[0]=l,vy[1]=h;for(let l=0;l<1;l+=.05)my[0]=Sy(t,n,r,o,l),my[1]=Sy(e,i,s,a,l),f=xy(vy,my),f<v&&(g=l,v=f);v=1/0;for(let l=0;l<32&&!(y<dy);l++)u=g-y,d=g+y,my[0]=Sy(t,n,r,o,u),my[1]=Sy(e,i,s,a,u),f=xy(my,vy),u>=0&&f<v?(g=u,v=f):(by[0]=Sy(t,n,r,o,d),by[1]=Sy(e,i,s,a,d),p=xy(by,vy),d<=1&&p<v?(g=d,v=p):y*=.5);return c&&(c[0]=Sy(t,n,r,o,g),c[1]=Sy(e,i,s,a,g)),Math.sqrt(v)}(t,e,n,i,r,s,o,a,h,c,null)<=u/2}function Cy(t,e,n,i,r,s,o,a,l){if(0===o)return!1;const h=o;a-=t,l-=e;const c=Math.sqrt(a*a+l*l);if(c-h>n||c+h<n)return!1;if(Math.abs(i-r)%P<1e-4)return!0;if(s){const t=i;i=Ay(r),r=Ay(t)}else i=Ay(i),r=Ay(r);i>r&&(r+=P);let u=Math.atan2(l,a);return u<0&&(u+=P),u>=i&&u<=r||u+P>=i&&u+P<=r}function Py(t,e,n,i,r,s,o){if(0===r)return!1;const a=r,l=r/2;let h=0,c=t;if(o>e+l&&o>i+l||o<e-l&&o<i-l||s>t+l&&s>n+l||s<t-l&&s<n-l)return!1;if(t===n)return Math.abs(s-t)<=a/2;h=(e-i)/(t-n),c=(t*i-n*e)/(t-n);const u=h*s-o+c;return u*u/(h*h+1)<=a/2*a/2}const Ry=1e-4;function Oy(t,e,n,i,r){const s=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,a=3*e-3*t;let l=0;if(gy(o)){if(yy(s)){const t=-a/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*o*a;if(gy(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),n=(-s+e)/(2*o),i=(-s-e)/(2*o);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}const My=[-1,-1,-1],Ey=[-1,-1];function ky(){const t=Ey[0];Ey[0]=Ey[1],Ey[1]=t}function Iy(t,e,n,i,r,s,o,a,l,h){if(h>e&&h>i&&h>s&&h>a||h<e&&h<i&&h<s&&h<a)return 0;const c=function(t,e,n,i,r,s){const o=i+3*(e-n)-t,a=3*(n-2*e+t),l=3*(e-t),h=t-r,c=a*a-3*o*l,u=a*l-9*o*h,d=l*l-3*a*h;let f=0;if(gy(c)&&gy(u))if(gy(a))s[0]=0;else{const t=-l/a;t>=0&&t<=1&&(s[f++]=t)}else{const t=u*u-4*c*d;if(gy(t)){const t=u/c,e=-a/o+t,n=-t/2;e>=0&&e<=1&&(s[f++]=e),n>=0&&n<=1&&(s[f++]=n)}else if(t>0){const e=Math.sqrt(t);let n=c*a+1.5*o*(-u+e),i=c*a+1.5*o*(-u-e);n=n<0?-Math.pow(-n,py):Math.pow(n,py),i=i<0?-Math.pow(-i,py):Math.pow(i,py);const r=(-a-(n+i))/(3*o);r>=0&&r<=1&&(s[f++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,n=Math.sqrt(c),i=Math.cos(e),r=(-a-2*n*i)/(3*o),l=(-a+n*(i+fy*Math.sin(e)))/(3*o),h=(-a+n*(i-fy*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[f++]=r),l>=0&&l<=1&&(s[f++]=l),h>=0&&h<=1&&(s[f++]=h)}}return f}(e,i,s,a,h,My);if(0===c)return 0;let u=0,d=-1,f=0,p=0;for(let h=0;h<c;h++){const c=My[h],g=0===c||1===c?.5:1;Sy(t,n,r,o,c)<l||(d<0&&(d=Oy(e,i,s,a,Ey),Ey[1]<Ey[0]&&d>1&&ky(),f=Sy(e,i,s,a,Ey[0]),d>1&&(p=Sy(e,i,s,a,Ey[1]))),2===d?c<Ey[0]?u+=f<e?g:-g:c<Ey[1]?u+=p<f?g:-g:u+=a<p?g:-g:c<Ey[0]?u+=f<e?g:-g:u+=a<f?g:-g)}return u}function jy(t,e,n,i,r,s,o,a){if(a>e&&a>i&&a>s||a<e&&a<i&&a<s)return 0;const l=function(t,e,n,i,r){const s=t-2*e+n,o=2*(e-t),a=t-i;let l=0;if(gy(s)){if(yy(o)){const t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{const t=o*o-4*s*a;if(gy(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),n=(-o+e)/(2*s),i=(-o-e)/(2*s);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}(e,i,s,a,My);if(0===l)return 0;const h=function(t,e,n){const i=t+n-2*e;return 0===i?.5:(t-e)/i}(e,i,s);if(h>=0&&h<=1){let a=0;const c=wy(e,i,s,h);for(let i=0;i<l;i++){const l=0===My[i]||1===My[i]?.5:1;wy(t,n,r,My[i])<o||(My[i]<h?a+=c<e?l:-l:a+=s<c?l:-l)}return a}const c=0===My[0]||1===My[0]?.5:1;return wy(t,n,r,My[0])<o?0:s<e?c:-c}function Dy(t,e,n,i,r,s,o,a){if((a-=e)>n||a<-n)return 0;const l=Math.sqrt(n*n-a*a);My[0]=-l,My[1]=l;const h=Math.abs(i-r);if(h<1e-4)return 0;if(h>=P-1e-4){i=0,r=P;const e=s?1:-1;return o>=My[0]+t&&o<=My[1]+t?e:0}if(i>r){const t=i;i=r,r=t}i<0&&(i+=P,r+=P);let c=0;for(let e=0;e<2;e++){const n=My[e];if(n+t>o){let t=Math.atan2(a,n),e=s?1:-1;t<0&&(t=P+t),(t>=i&&t<=r||t+P>=i&&t+P<=r)&&(t>B/2&&t<1.5*B&&(e=-e),c+=e)}}return c}function Ly(t){return Math.round(t/B*1e8)/1e8%2*B}function Ny(t,e){let n=Ly(t[0]);n<0&&(n+=P);const i=n-t[0];let r=t[1];r+=i,!e&&r-n>=P?r=n+P:e&&n-r>=P?r=n-P:!e&&n>r?r=n+(P-Ly(n-r)):e&&n<r&&(r=n-(P-Ly(r-n))),t[0]=n,t[1]=r}const Wy=[0,0];function Fy(t,e,n,i,r){const s=t,o=t.length;let a,l,h=0,c=0,u=0,d=0,f=0;for(let t=0;t<o;t++){const o=s[t],p=0===t;o[0]===Tp.M&&t>1&&(n||(h+=_y(c,u,d,f,i,r))),p&&(c=o[1],u=o[2],d=c,f=u);const g=o[0],y=o[1],v=o[2],m=o[3],b=o[4],x=o[5],w=o[6];let S=b,A=x;Wy[0]=S,Wy[1]=A,Ny(Wy,Boolean(o[6])),S=Wy[0],A=Wy[1];const _=S,B=A-S,T=!!(1-(o[6]?0:1)),C=(i-y)*m/m+y;switch(g){case Tp.M:d=y,f=v,c=d,u=f;break;case Tp.L:if(n){if(Py(c,u,y,v,e,i,r))return!0}else h+=_y(c,u,y,v,i,r)||0;c=y,u=v;break;case Tp.C:if(n){if(Ty(c,u,y,v,m,b,x,w,e,i,r))return!0}else h+=Iy(c,u,y,v,m,b,x,w,i,r)||0;c=x,u=w;break;case Tp.Q:if(n){if(By(c,u,y,v,m,b,e,i,r))return!0}else h+=jy(c,u,y,v,m,b,i,r)||0;c=m,u=b;break;case Tp.A:if(a=Math.cos(_)*m+y,l=Math.sin(_)*m+v,p?(d=a,f=l):h+=_y(c,u,a,l,i,r),n){if(Cy(y,v,m,_,_+B,T,e,C,r))return!0}else h+=Dy(y,v,m,_,_+B,T,C,r);c=Math.cos(_+B)*m+y,u=Math.sin(_+B)*m+v;break;case Tp.R:if(d=c=y,f=u=v,a=d+m,l=f+b,n){if(Py(d,f,a,f,e,i,r)||Py(a,f,a,l,e,i,r)||Py(a,l,d,l,e,i,r)||Py(d,l,d,f,e,i,r))return!0}else h+=_y(a,f,a,l,i,r),h+=_y(d,l,d,f,i,r);break;case Tp.Z:if(n){if(Py(c,u,d,f,e,i,r))return!0}else h+=_y(c,u,d,f,i,r);c=d,u=f}}return n||(p=u,g=f,Math.abs(p-g)<Ry)||(h+=_y(c,u,d,f,i,r)||0),0!==h;var p,g}var Uy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},zy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hy=function(t,e){return function(n,i){e(n,i,t)}};let Vy=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,n)=>{this.configured=!1,this.configure(n,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const n=uy({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=n,this.context=n.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var i;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=n;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:Pg.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,n){return this.configure(this.global,this.global.env),new ot(Object.assign({defaultFontParams:{fontFamily:Pg.fontFamily,fontSize:Pg.fontSize},getCanvasForMeasure:n||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ot.ALPHABET_CHAR_SET+ot.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}};var Gy;Vy=Uy([np(),Hy(0,sp(cp)),Hy(0,ip(oy)),Hy(1,sp(yp)),zy("design:paramtypes",[Object,Object])],Vy),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Gy||(Gy={}));const Xy=new Y;let Yy=class{constructor(){this.matrix=new Y}init(t){return this.mode=Gy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Gy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,n){const i=this.outSourceMatrix;if(Xy.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){const{x:i,y:r}=n;this.outTargetMatrix.translate(i,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-i,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Xy.a,Xy.b,Xy.c,Xy.d,Xy.e,Xy.f),this}rotateMatrix(t,e){const n=this.outSourceMatrix;if(Xy.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),e){const{x:n,y:i}=e;this.outTargetMatrix.translate(n,i),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-i)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Xy.a,Xy.b,Xy.c,Xy.d,Xy.e,Xy.f),this}scale(t,e,n){return this.mode===Gy.matrix?this.scaleMatrix(t,e,n):this}rotate(t,e){return this.mode===Gy.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const n=this.outSourceMatrix;return Xy.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Xy.a,Xy.b,Xy.c,Xy.d,Xy.e,Xy.f),this}translate(t,e){return this.mode===Gy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Gy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Yy=Uy([np(),zy("design:paramtypes",[])],Yy);const qy={arc:Eg,area:kg,circle:Ig,line:Lg,path:Ng,symbol:zg,text:Hg,rect:Fg,rect3d:Ug,polygon:Wg,richtext:Vg,richtextIcon:Xg,image:Gg,group:jg,glyph:Dg},$y=Object.keys(qy);function Ky(){return{arc:Object.assign({},qy.arc),area:Object.assign({},qy.area),circle:Object.assign({},qy.circle),line:Object.assign({},qy.line),path:Object.assign({},qy.path),symbol:Object.assign({},qy.symbol),text:Object.assign({},qy.text),rect:Object.assign({},qy.rect),rect3d:Object.assign({},qy.rect3d),polygon:Object.assign({},qy.polygon),richtext:Object.assign({},qy.richtext),richtextIcon:Object.assign({},qy.richtextIcon),image:Object.assign({},qy.image),group:Object.assign({},qy.group),glyph:Object.assign({},qy.glyph)}}function Zy(t,e){e&&(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?Object.keys(e).forEach((n=>{t[n]?Object.assign(t[n],e[n]):t[n]=e[n]})):Object.keys(e).forEach((n=>{if(t[n]){const i=t[n],r=e[n];Object.keys(e[n]).forEach((t=>{void 0===i[t]&&(i[t]=r[t])}))}else t[n]=e[n]})))}const Jy=new Array(60).fill(0).map((()=>Ky()));class Qy{constructor(){this._defaultTheme=Jy.pop()||Ky(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0),this.userTheme?Zy(this.userTheme,t.userTheme,!1):this.userTheme=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;const r=[],s=[];return void 0===e&&(e=!0),void 0===n&&(n=1/0),function t(n,o){if(null===n)return null;if(0===o)return n;let a;if("object"!=typeof n)return n;if(d(n)?a=[]:m(n)?(a=new RegExp(n.source,function(t){let e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}(n)),n.lastIndex&&(a.lastIndex=n.lastIndex)):a=p(n)?new Date(n.getTime()):void 0===i?Object.create(Object.getPrototypeOf(n)):Object.create(i),e){const t=r.indexOf(n);if(-1!==t)return s[t];r.push(n),s.push(a)}for(const e in n)a[e]=t(n[e],o-1);return a}(t,n)}(t.userTheme),Zy(e,t.userTheme)}this.userTheme?this.doCombine(e):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this._defaultTheme,i=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);$y.forEach((r=>{var o,a;e[r]||s||t[r]?i[r]=Object.assign({},n[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):i[r]=n[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const tv=new Qy;function ev(t,e){return t.glyphHost?ev(t.glyphHost):e?(t.isContainer,e):function(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)):tv.getTheme()}return null}(t)||tv.getTheme()}class nv{static GenAutoIncrementId(){return nv.auto_increment_id++}}nv.auto_increment_id=0;var iv=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class rv extends r{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=nv.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return iv(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)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){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 n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<t;n++){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 n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._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,n){const i=o(n,!0)&&n||c(n)&&n.capture,r=c(n)&&n.once,s=a(e)?void 0:e;return t=i?`${t}capture`:t,e=a(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=o(n,!0)&&n||c(n)&&n.capture,r=a(e)?void 0:e;t=i?`${t}capture`:t,e=a(e)?e:e.handleEvent;const s=c(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return c(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return super.emit(t.type,t,...n),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class sv{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=sv.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new F,this.page=new F,this.canvas=new F,this.viewport=new F,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 ov extends sv{constructor(){super(...arguments),this.client=new F,this.movement=new F,this.offset=new F,this.global=new F,this.screen=new F}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,n,i,r,s,o,a,l,h,c,u,d,f,p){throw new Error("Method not implemented.")}}class av extends ov{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,n;const i=new av(this.manager);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i.nativeEvent=this.nativeEvent,i.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,i),null===(e=this.manager)||void 0===e||e.copyMouseData(this,i),null===(n=this.manager)||void 0===n||n.copyData(this,i),i.target=this.target,i.path=this.composedPath().slice(),i.type=this.type,i}}av.DOM_DELTA_PIXEL=0,av.DOM_DELTA_LINE=1,av.DOM_DELTA_PAGE=2;class lv extends sv{constructor(t,e){super(),this.type=t,this.detail=e}}const hv={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof sv))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 lv(t,e))}};class cv{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return cv.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 uv{static Avaliable(){return!0}avaliable(){return uv.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 dv{static Avaliable(){return!!Yg.global.getRequestAnimationFrame()}avaliable(){return dv.Avaliable()}tick(t,e){Yg.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var fv;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(fv||(fv={}));class pv{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-pv.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*pv.bounceIn(2*t):.5*pv.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/P*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*P/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/P*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*P/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/P*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*P/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*P/e)*.5+1}}}pv.quadIn=pv.getPowIn(2),pv.quadOut=pv.getPowOut(2),pv.quadInOut=pv.getPowInOut(2),pv.cubicIn=pv.getPowIn(3),pv.cubicOut=pv.getPowOut(3),pv.cubicInOut=pv.getPowInOut(3),pv.quartIn=pv.getPowIn(4),pv.quartOut=pv.getPowOut(4),pv.quartInOut=pv.getPowInOut(4),pv.quintIn=pv.getPowIn(5),pv.quintOut=pv.getPowOut(5),pv.quintInOut=pv.getPowInOut(5),pv.backIn=pv.getBackIn(1.7),pv.backOut=pv.getBackOut(1.7),pv.backInOut=pv.getBackInOut(1.7),pv.elasticIn=pv.getElasticIn(1,.3),pv.elasticOut=pv.getElasticOut(1,.3),pv.elasticInOut=pv.getElasticInOut(1,.3*1.5);const gv=new class{constructor(){this.id=nv.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(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Dp.END?this.removeAnimate(e):e.status===Dp.RUNNING||e.status===Dp.INITIAL?(this.animateCount++,e.advance(t)):e.status===Dp.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class yv{constructor(t,e,n,i,r){this.from=t,this.to=e,this.duration=n,this.easing=i,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,n){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(n,this.step.getLastProps()),this.onUpdate(t,e,n),t&&this.onEnd()}}class vv extends yv{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class mv{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nv.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gv;this.id=t,this.timeline=e,this.status=Dp.INITIAL,this.tailAnimate=new bv(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=E(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){mv.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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mv.mode;t&&e&Lp.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:jp.ANIMATE_PLAY})}runCb(t){const e=new vv((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const o=mv.interpolateMap.get(t)||mv.interpolateMap.get("");return!!o&&o(t,e,n,i,r,s)}pause(){this.status===Dp.RUNNING&&(this.status=Dp.PAUSED)}resume(){this.status===Dp.PAUSED&&(this.status=Dp.RUNNING)}to(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),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 bv(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(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Dp.INITIAL&&(this.status=Dp.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===Dp.RUNNING&&(this.status=Dp.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,n=0;const i=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===i)return s;for(let i=0;i<this.subAnimates.length&&(e=this.subAnimates[i],!(n+e.totalDuration>=t));i++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),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=Dp.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()}}mv.mode=Lp.NORMAL,mv.interpolateMap=new Map;class bv{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 xv(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(t){let e=t.duration;(null==e||e<0)&&(e=0);const n=t.easing,i="string"==typeof n?pv[n]:n,r=this._addStep(e,null,i);return r.type=Np.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,n,i){(null==e||e<0)&&(e=0);const r="string"==typeof n?pv[n]:n,s=this._addStep(e,null,r);return s.type=Np.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(s.propKeys)})),this}from(t,e,n,i){this.to(t,0,n,i);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{r[t]=this.getLastPropByName(t,this.stepTail)})),this.to(r,e,n,i),this.stepTail.type=Np.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(t){if(t>0){const e=this._addStep(+t,null);e.type=Np.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,n){const i=new xv(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}_appendProps(t,e,n){e.props=n?t:Object.assign({},t);let i=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))}));i.prev;)i.props&&(i.propKeys||(i.propKeys=Object.keys(i.props)),i.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=i.props[t])}))),i=i.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 n=this.duration,i=this.loop,r=this.rawPosition;let s,o,a=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,n<=0)return a=!0,a;if(s=Math.floor(t/n),o=t-s*n,a=t>=i*n+n,a&&(o=n,s=i,t=o*s+n),t===r)return a;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(o=n-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+l,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let n=this.stepHead.next;const i=this.position,r=this.duration;if(this.target&&n){let s=n.next;for(;s&&s.position<=i;)n=s,s=n.next;let o=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(o=n.easing(o)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,o,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(n,o)))}}tryCallCustomAnimateLifeCycle(t,e,n){if(t!==e)if(n){let n=e.prev;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let n=e.next;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=n.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}class xv{constructor(t,e,n,i){this.duration=e,this.position=t,this.props=n,this.easing=i}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 wv=200,Sv="cubicOut";var Av;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Av||(Av={}));const _v=[!1,!1,!1,!1],Bv=[0,0,0,0],Tv=t=>t?d(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Bv[0]=t[0],Bv[2]=t[0],Bv[1]=t[1],Bv[3]=t[1],Bv):t:t:0,Cv=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Pv=[1,2,3,0,1,2,3,0];function Rv(t,e,n,i){for(;t>=P;)t-=P;for(;t<0;)t+=P;for(;t>e;)e+=P;Cv[0].x=n,Cv[1].y=n,Cv[2].x=-n,Cv[3].y=-n;const r=Math.ceil(t/T)%4,s=Math.ceil(e/T)%4;if(i.add(M(t)*n,I(t)*n),i.add(M(e)*n,I(e)*n),r!==s||e-t>B){let t=!1;for(let e=0;e<Pv.length;e++)if(t||r!==Pv[e]){if(t&&s===Pv[e])break;if(t){const t=Cv[Pv[e]];i.add(t.x,t.y)}}else{t=!0;const e=Cv[r];i.add(e.x,e.y)}}}function Ov(t,e,n){const{x:i,y:r}=W(t.x,t.y,e.x,e.y,n),{x:s,y:o}=W(t.x1,t.y1,e.x1,e.y1,n),a=new F(i,r,s,o);return a.defined=e.defined,a}function Mv(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let i=[];if(t.length>e.length){i=e.map((t=>{const e=new F(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)i[r]=Ov(t[r],e[r],n)}else{i=e.map((t=>{const e=new F(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)i[r]=Ov(t[r],e[r],n)}return i}function Ev(t,e){if(d(t)){let n;for(let i=0;i<t.length&&void 0===n;i++)n=t[i][e];return n}return t[e]}class kv{constructor(){this.durations=[],this.timeout=kv.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)}}kv.TimeOut=1e3/60;const Iv=new kv;var jv;!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"}(jv||(jv={}));var Dv={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 Lv={};for(const t in Dv)w(Dv,t)&&(Lv[Dv[t]]=t);const Nv={to:{},get:{}};function Wv(t,e,n){return Math.min(Math.max(e,t),n)}function Fv(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Nv.get=function(t){let e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];switch(t.substring(0,3).toLowerCase()){case"hsl":e=Nv.get.hsl(t,i),n="hsl";break;case"hwb":e=Nv.get.hwb(t,i),n="hwb";break;default:e=Nv.get.rgb(t,i),n="rgb"}return e?{model:n,value:e}:null},Nv.get.rgb=function(t){if(!t)return null;const e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];let n,i,r;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=n[2],n=n[1],i=0;i<3;i++){const t=2*i;e[i]=parseInt(n.slice(t,t+2),16)}r&&(e[3]=Math.round(parseInt(r,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],r=n[3],i=0;i<3;i++)e[i]=parseInt(n[i]+n[i],16);r&&(e[3]=Math.round(parseInt(r+r,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(i=0;i<3;i++)e[i]=parseInt(n[i+1],10);n[4]&&(e[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=Dv[n[1]];return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e?(e[3]=1,e):null}return null}for(i=0;i<3;i++)e[i]=Math.round(2.55*parseFloat(n[i+1]));n[4]&&(e[3]=parseFloat(n[4]))}for(i=0;i<3;i++)e[i]=Wv(e[i],0,255);return e[3]=Wv(e[3],0,1),e},Nv.get.hsl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;const n=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){const t=parseFloat(n[4]);return e[0]=(parseFloat(n[1])+360)%360,e[1]=Wv(parseFloat(n[2]),0,100),e[2]=Wv(parseFloat(n[3]),0,100),e[3]=Wv(isNaN(t)?1:t,0,1),e}return null},Nv.get.hwb=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;const n=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){const t=parseFloat(n[4]);return e[0]=(parseFloat(n[1])%360+360)%360,e[1]=Wv(parseFloat(n[2]),0,100),e[2]=Wv(parseFloat(n[3]),0,100),e[3]=Wv(isNaN(t)?1:t,0,1),e}return null},Nv.to.hex=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return"#"+Fv(i[0])+Fv(i[1])+Fv(i[2])+(i[3]<1?Fv(Math.round(255*i[3])):"")},Nv.to.rgb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return i.length<4||1===i[3]?"rgb("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+")":"rgba("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+", "+i[3]+")"},Nv.to.rgb.percent=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e,r=Math.round(i[0]/255*100),s=Math.round(i[1]/255*100),o=Math.round(i[2]/255*100);return i.length<4||1===i[3]?"rgb("+r+"%, "+s+"%, "+o+"%)":"rgba("+r+"%, "+s+"%, "+o+"%, "+i[3]+")"},Nv.to.hsl=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return i.length<4||1===i[3]?"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)":"hsla("+i[0]+", "+i[1]+"%, "+i[2]+"%, "+i[3]+")"},Nv.to.hwb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;let r="";return i.length>=4&&1!==i[3]&&(r=", "+i[3]),"hwb("+i[0]+", "+i[1]+"%, "+i[2]+"%"+r+")"},Nv.to.keyword=function(t){return Lv[t.slice(0,3)]};const Uv=Nv;var zv;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(zv||(zv={}));class Hv{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zv.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===zv.Color1){let e=Hv.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;if(e=Nv.get(t),e&&e.value){const i=e.value,r=[i[0]/255,i[1]/255,i[2]/255,i[3]];Hv.store1[t]=r,Hv.store255[t]=i,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3]}return n}let i=Hv.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;if(i=Nv.get(t),i&&i.value){const e=i.value;Hv.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Hv.store255[t]=e,n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}static Set(t,e,n){if(e===zv.Color1){if(Hv.store1[t])return;Hv.store1[t]=n,Hv.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Hv.store255[t])return;Hv.store255[t]=n,Hv.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Vv(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Gv(t,e,n,i,r){if(!t||!e)return t&&Vv(t)||e&&Vv(e)||!1;let s,o,a=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Hv.Get(t,zv.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Hv.Get(e,zv.Color255):l=!0,a!==l){const s=a?t:e,o=a?e:t,l=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:Vv(o)})))});return a?Gv(s,l,n,i,r):Gv(l,s,n,i,r)}if(a){if(t.gradient===e.gradient){const i=t,r=e,s=i.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:qv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("radial"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:qv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("conical"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:qv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n)}return!1}return r&&r(s,o),Vv(function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(s,o,n),i)}Hv.store255={},Hv.store1={};const Xv=[0,0,0,0],Yv=[0,0,0,0];function qv(t,e,n){return Hv.Get(t,zv.Color255,Xv),Hv.Get(e,zv.Color255,Yv),`rgba(${Math.round(Xv[0]+(Yv[0]-Xv[0])*n)},${Math.round(Xv[1]+(Yv[1]-Xv[1])*n)},${Math.round(Xv[2]+(Yv[2]-Xv[2])*n)},${Xv[3]+(Yv[3]-Xv[3])*n})`}class $v{static GetImage(t,e){var n;let i=$v.cache.get(t);i?"fail"===i.loadState?Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},$v.cache.set(t,i),i.dataPromise=Yg.global.loadImage(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var n;let i=$v.cache.get(t);i?"fail"===i.loadState?Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},$v.cache.set(t,i),i.dataPromise=Yg.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=$v.cache.get(t);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},$v.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=Yg.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=Yg.global.loadBlob(t):"json"===e&&(n.dataPromise=Yg.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}}$v.cache=new Map;const Kv=new Y,Zv=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],Jv=["x","y"],Qv=["scaleX","scaleY"],tm=["angle"],em=new F;class nm extends rv{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(nm.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._AABBBounds=new V,this._updateTag=kp.INIT,this.attribute=t,this.valid=this.isValid(),t.background&&this.loadImage(t.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{dx:n=t.dx,dy:i=t.dy}=this.attribute;if(e&&this.parent){const t=ev(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;em.x=n+e,em.y=i+r}else em.x=n,em.y=i;return em}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Yg.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Yg.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(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Y),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&kp.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&kp.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&kp.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&kp.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&kp.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&kp.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=kp.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===Ip.GLOBAL){const n=new F(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,n)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):l(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<Zv.length;e++){const n=Zv[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<Zv.length;e++)if(t===Zv[e])return!0;return!1}initAttributes(t){const e={type:jp.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=kp.INIT,this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:jp.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Jv,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const o=this.attribute,a=o.postMatrix;return a?Yg.transformUtil.fromMatrix(a,a).translate(t,e):(o.x=(null!==(n=o.x)&&void 0!==n?n:_g.x)+t,o.y=(null!==(i=o.y)&&void 0!==i?i:_g.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:jp.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Jv,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:jp.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,Qv,s);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const a=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new Y,a.postMatrix=i),Yg.transformUtil.fromMatrix(i,i).scale(t,e,n)}else a.scaleX=(null!==(i=a.scaleX)&&void 0!==i?i:_g.scaleX)*t,a.scaleY=(null!==(r=a.scaleY)&&void 0!==r?r:_g.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:jp.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Qv,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:jp.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,tm,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new Y,s.postMatrix=n),Yg.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:_g.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:jp.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,tm,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new mv(null==t?void 0:t.id).bind(this);if(t){const{onStart:n,onFrame:i,onEnd:r,onRemove:s}=t;null!=n&&e.onStart(n),null!=i&&e.onFrame(i),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){Yg.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)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s,o,a;if(n){const n=Object.keys(t),l=i?n.reduce(((e,n)=>(e[n]=void 0===t[n]?this.getDefaultAttribute(n):t[n],e)),{}):t,h=this.animate();h.stateNames=e,h.to(l,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:wv,null!==(a=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==a?a:Sv)}else this.setAttributes(t,!1,{type:jp.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((n=>{if(n.stateNames){const i=n.getEndProps();w(i,t)&&(e=i[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 n=this.currentStates.filter((e=>e!==t));this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=kp.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=kp.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=kp.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&kp.UPDATE_SHAPE_AND_BOUNDS)===kp.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=kp.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=kp.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=kp.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=kp.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=kp.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=kp.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=kp.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&kp.UPDATE_LAYOUT)}doUpdateLocalMatrix(){const{x:t=_g.x,y:e=_g.y,scaleX:n=_g.scaleX,scaleY:i=_g.scaleY,angle:r=_g.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute,l=[0,0];if(o){if("string"==typeof o[0]){const t=parseFloat(o[0])/100,e=this.AABBBounds;l[0]=e.x1+(e.x2-e.x1)*t}else l[0]=o[0];if("string"==typeof o[1]){const t=parseFloat(o[1])/100,e=this.AABBBounds;l[1]=e.x1+(e.x2-e.x1)*t}else l[1]=o[1]}if(!s||1===n&&1===i)!function(t,e,n,i,r,s,o,a){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,f=e.f,p=M(o),g=I(o);let y,v;a?(y=a[0],v=a[1]):(y=n,v=i);const m=y-n,b=v-i,x=l*p+c*g,w=h*p+u*g,S=c*p-l*g,A=u*p-h*g;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=d+l*y+c*v-x*m-S*b,t.f=f+h*y+u*v-w*m-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,o&&l);else{const o=this._transMatrix;o.reset(),o.translate(l[0],l[1]),o.rotate(r),o.translate(-l[0],-l[1]),o.translate(t,e),Yg.transformUtil.fromMatrix(o,o).scale(n,i,{x:s[0],y:s[1]})}const h=this.getOffsetXY(_g);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,a){const t=Kv.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Yg.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:jp.ANIMATE_END})}onStep(t,e,n,i,r){const s={};if(n.customAnimate)n.customAnimate.update(r,i,s);else{const o=n.props,a=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,s,n,i,r,o,void 0,a,l)}this.setAttributes(s,!1,{type:jp.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,n,i,r,s,o,a,l,h){h||(h=Object.keys(o),i.propKeys=h),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=o[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const c=o[s],u=null!==(h=a&&a[s])&&void 0!==h?h:t.getLastPropByName(s,i);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,n),d||(d=e.customInterpolate(s,r,u,c,this,n),d||this.defaultInterpolate(c,u,s,n,l,r)||this._interpolate(s,r,u,c,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const o=r.fillColorArray,a=Gv(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(i[n]=a),!0}if("stroke"===n){r||(r={});const o=r.strokeColorArray,a=Gv(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(i[n]=a),!0}if("shadowColor"===n){r||(r={});const o=r.shadowColorArray,a=Gv(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(i[n]=a),!0}return!1}_interpolate(t,e,n,i,r){}getDefaultAttribute(t){return ev(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Yg.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 u(t,!0)?this.pathProxy=(new wg).fromString(t):this.pathProxy=new wg,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",v(t)||b(t)?($v.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&($v.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new lv(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}nm.mixin(hv);var im={},rm={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+e+"]["+(e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",i=new RegExp("^"+n+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let s=0;s<r;s++)t[i[s]]="strict"===n?[e[i[s]]]:e[i[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){const e=i.exec(t);return!(null==e)},t.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},t.nameRegexp=n}(rm);const sm=rm,om={allowBooleanAttributes:!1,unpairedTags:[]};function am(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function lm(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return ym("InvalidXml","XML declaration allowed only at the start of the document.",mm(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function hm(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}im.validate=function(t,e){e=Object.assign({},om,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=lm(t,o),o.err)return o}else{if("<"!==t[o]){if(am(t[o]))continue;return ym("InvalidChar","char '"+t[o]+"' is not expected.",mm(t,o))}{let a=o;if(o++,"!"===t[o]){o=hm(t,o);continue}{let l=!1;"/"===t[o]&&(l=!0,o++);let h="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)h+=t[o];if(h=h.trim(),"/"===h[h.length-1]&&(h=h.substring(0,h.length-1),o--),s=h,!sm.isName(s)){let e;return e=0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",ym("InvalidTag",e,mm(t,o))}const c=dm(t,o);if(!1===c)return ym("InvalidAttr","Attributes for '"+h+"' have open quote.",mm(t,o));let u=c.value;if(o=c.index,"/"===u[u.length-1]){const n=o-u.length;u=u.substring(0,u.length-1);const r=pm(u,e);if(!0!==r)return ym(r.err.code,r.err.msg,mm(t,n+r.err.line));i=!0}else if(l){if(!c.tagClosed)return ym("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",mm(t,o));if(u.trim().length>0)return ym("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",mm(t,a));{const e=n.pop();if(h!==e.tagName){let n=mm(t,e.tagStartPos);return ym("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+h+"'.",mm(t,a))}0==n.length&&(r=!0)}}else{const s=pm(u,e);if(!0!==s)return ym(s.err.code,s.err.msg,mm(t,o-u.length+s.err.line));if(!0===r)return ym("InvalidXml","Multiple possible root nodes found.",mm(t,o));-1!==e.unpairedTags.indexOf(h)||n.push({tagName:h,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=hm(t,o);continue}if("?"!==t[o+1])break;if(o=lm(t,++o),o.err)return o}else if("&"===t[o]){const e=gm(t,o);if(-1==e)return ym("InvalidChar","char '&' is not expected.",mm(t,o));o=e}else if(!0===r&&!am(t[o]))return ym("InvalidXml","Extra text at the end",mm(t,o));"<"===t[o]&&o--}}}var s;return i?1==n.length?ym("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",mm(t,n[0].tagStartPos)):!(n.length>0)||ym("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):ym("InvalidXml","Start tag expected.",1)};const cm='"',um="'";function dm(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===cm||t[e]===um)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const fm=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function pm(t,e){const n=sm.getAllMatches(t,fm),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return ym("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",bm(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return ym("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",bm(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return ym("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",bm(n[t]));const r=n[t][2];if(!vm(r))return ym("InvalidAttr","Attribute '"+r+"' is an invalid name.",bm(n[t]));if(i.hasOwnProperty(r))return ym("InvalidAttr","Attribute '"+r+"' is repeated.",bm(n[t]));i[r]=1}return!0}function gm(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function ym(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function vm(t){return sm.isName(t)}function mm(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function bm(t){return t.startIndex+t[1].length}var xm={};const wm={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};xm.buildOptions=function(t){return Object.assign({},wm,t)},xm.defaultOptions=wm;var Sm=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}};const Am=rm;function _m(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function Bm(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function Tm(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Cm(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function Pm(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Rm(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function Om(t){if(Am.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}var Mm=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&Tm(t,e))e+=7,[entityName,val,e]=_m(t,e+1),-1===val.indexOf("&")&&(n[Om(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(r&&Cm(t,e))e+=8;else if(r&&Pm(t,e))e+=8;else if(r&&Rm(t,e))e+=9;else{if(!Bm)throw new Error("Invalid DOCTYPE");s=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}};const Em=/^[-+]?0x[a-fA-F0-9]+$/,km=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Im={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var jm=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},Im,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&Em.test(n))return Number.parseInt(n,16);{const i=km.exec(n);if(i){const r=i[1],s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(i[3]);const a=i[4]||i[6];if(!e.leadingZeros&&s.length>0&&r&&"."!==n[2])return t;if(!e.leadingZeros&&s.length>0&&!r&&"."!==n[1])return t;{const i=Number(n),l=""+i;return-1!==l.search(/[eE]/)||a?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===l&&""===o||l===o||r&&l==="-"+o?i:t:s?o===l||r+o===l?i:t:n===l||n===r+l?i:t}}return t}};const Dm=rm,Lm=Sm,Nm=Mm,Wm=jm;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Dm.nameRegexp);function Fm(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function Um(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,s);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return Qm(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?Qm(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function zm(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const Hm=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Vm(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=Dm.getAllMatches(t,Hm),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:Qm(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const Gm=function(t){t=t.replace(/\r\n?/g,"\n");const e=new Lm("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=Km(t,">",s,"Closing Tag is not closed.");let o=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),n=this.tagsNodeStack.pop(),i="",s=e}else if("?"===t[s+1]){let e=Zm(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new Lm(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=Km(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(s+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=e}else if("!D"===t.substr(s+1,2)){const e=Nm(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=Km(t,"]]>",s,"CDATA is not closed.")-2,o=t.substring(s+9,e);if(i=this.saveTextToParentTag(i,n,r),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,r,!0,!1,!0);null==t&&(t=""),n.add(this.options.textNodeName,t)}s=e+2}else{let o=Zm(t,s,this.options.removeNSPrefix),a=o.tagName,l=o.tagExp,h=o.attrExpPresent,c=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const u=n;if(u&&-1!==this.options.unpairedTags.indexOf(u.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const n=this.readStopNodeData(t,a,c+1);if(!n)throw new Error(`Unexpected end of ${a}`);s=n.i,e=n.tagContent}const i=new Lm(a);a!==l&&h&&(i[":@"]=this.buildAttributesMap(l,r,a)),e&&(e=this.parseTextData(e,a,r,!0,h,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),l=a):l=l.substr(0,l.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new Lm(a);a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Lm(a);this.tagsNodeStack.push(n),a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(n,t,r),n=t}i="",s=c}}else i+=t[s]}return e.child};function Xm(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const Ym=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function qm(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function $m(t,e,n){const i="*."+n;for(const n in t){const r=t[n];if(i===r||e===r)return!0}return!1}function Km(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Zm(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const s=i.index,o=r.search(/\s/);let a=r,l=!0;if(-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1)),n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==i.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:l}}function Jm(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Km(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=Km(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Km(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Km(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Zm(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function Qm(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&Wm(t,n)}return Dm.isExist(t)?t:""}var tb=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=Fm,this.parseXml=Gm,this.parseTextData=Um,this.resolveNameSpace=zm,this.buildAttributesMap=Vm,this.isItStopNode=$m,this.replaceEntitiesValue=Ym,this.readStopNodeData=Jm,this.saveTextToParentTag=qm,this.addChild=Xm}},eb={};function nb(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=ib(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=nb(o[a],e,l);const n=sb(t,e);o[":@"]?rb(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function ib(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function rb(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];i.isArray(s,n+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function sb(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}eb.prettify=function(t,e){return nb(t,e)};const{buildOptions:ob}=xm,ab=tb,{prettify:lb}=eb,hb=im;var cb=class{constructor(t){this.externalEntities={},this.options=ob(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=hb.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new ab(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:lb(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}};function ub(t,e,n,i){let r="",s=!1;for(let o=0;o<t.length;o++){const a=t[o],l=db(a);let h="";if(h=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];pb(h,e)||(t=e.tagValueProcessor(l,t),t=gb(t,e)),s&&(r+=i),r+=t,s=!1;continue}if(l===e.cdataPropName){s&&(r+=i),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,s=!1;continue}if(l===e.commentPropName){r+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const t=fb(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",r+=n+`<${l}${o}${t}?>`,s=!0;continue}let c=i;""!==c&&(c+=e.indentBy);const u=i+`<${l}${fb(a[":@"],e)}`,d=ub(a[l],e,h,c);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=u+">":r+=u+"/>":d&&0!==d.length||!e.suppressEmptyNode?d&&d.endsWith(">")?r+=u+`>${d}${i}</${l}>`:(r+=u+">",d&&""!==i&&(d.includes("/>")||d.includes("</"))?r+=i+e.indentBy+d+i:r+=d,r+=`</${l}>`):r+=u+"/>",s=!0}return r}function db(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function fb(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){let r=e.attributeValueProcessor(i,t[i]);r=gb(r,e),!0===r&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${r}"`}return n}function pb(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function gb(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const yb=function(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),ub(t,e,"",n)},vb={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function mb(t){this.options=Object.assign({},vb,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=wb),this.processTextOrObjNode=bb,this.options.format?(this.indentate=xb,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function bb(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function xb(t){return this.options.indentBy.repeat(t)}function wb(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}mb.prototype.build=function(t){return this.options.preserveOrder?yb(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},mb.prototype.j2x=function(t,e){let n="",i="";for(let r in t)if(void 0===t[r])this.isAttribute(r)&&(i+="");else if(null===t[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)i+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const s=this.isAttribute(r);if(s)n+=this.buildAttrPairStr(s,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const n=t[r].length;let s="";for(let o=0;o<n;o++){const n=t[r][o];void 0===n||(null===n?"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof n?this.options.oneListGroup?s+=this.j2x(n,e+1).val:s+=this.processTextOrObjNode(n,r,e):s+=this.buildTextValNode(n,r,"",e))}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,"",e)),i+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let s=0;s<i;s++)n+=this.buildAttrPairStr(e[s],""+t[r][e[s]])}else i+=this.processTextOrObjNode(t[r],r,e);return{attrStr:n,val:i}},mb.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},mb.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+s+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+s+">"+t+r}},mb.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},mb.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},mb.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};var Sb={XMLParser:cb,XMLValidator:im,XMLBuilder:mb};function Ab(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}let _b=0;function Bb(){return _b++}var Tb;function Cb(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Ob(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:Tb.VERTICAL}),i="",n=0),e.push({text:t[r],direction:Tb.HORIZONTAL}));return i&&e.push({text:i,direction:Tb.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Tb||(Tb={}));const Pb=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Pb.set(t,!0)));const Rb=new Map;function Ob(t){if(Pb.has(t))return!0;if(Rb.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Rb.set(t,!0)));const Mb=Bb(),Eb=Bb(),kb=Bb(),Ib=Bb(),jb=Bb(),Db=Bb(),Lb=Bb(),Nb=Bb(),Wb=Bb(),Fb=Bb(),Ub=Bb(),zb=Bb(),Hb=Bb(),Vb=Bb(),Gb=Bb(),Xb=Bb(),Yb=Symbol.for("GraphicService"),qb=Symbol.for("GraphicCreator"),$b={"@_stroke-linecap":"lineCap","@_stroke-linejoin":"lineJoin","@_stroke-dasharray":"lineDash","@_stroke-dashoffset":"lineDashOffset","@_stroke-width":"lineWidth","@_fill-opacity":"fillOpacity","@_stroke-opacity":"strokeOpacity","@_stroke":"stroke","@_fill":"fill"},Kb=Object.keys($b);var Zb;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Zb||(Zb={}));class Jb extends nm{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Db,this._childUpdateTag=kp.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 Qy),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Qy)}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(t,e,n){if(n===Ip.GLOBAL){const n=new F(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&kp.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Yg.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Yg.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=ev(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=Yg.graphicService.updateGroupAABBBounds(t,ev(this).group,this._AABBBounds,this),{boundsPadding:i=e.boundsPadding}=t,r=Tv(i);return r&&n.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}clearUpdateBoundTag(){this._updateTag&=kp.CLEAR_BOUNDS,this._childUpdateTag&=kp.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=kp.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&kp.UPDATE_BOUNDS||(this._childUpdateTag|=kp.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(),Yg.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Yg.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertBefore(t,e){const n=super.insertBefore(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertAfter(t,e){const n=super.insertAfter(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertInto(t,e){const n=super.insertInto(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}removeChild(t){const e=super.removeChild(t);return t.stage=null,Yg.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{Yg.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),Yg.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&kp.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=Yg.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new Jb(Object.assign({},this.attribute))}}const Qb=Symbol.for("LayerHandlerContribution");class tx extends Jb{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,n,i){var r;super({}),this.stage=t,this.global=e,this.window=n,this.main=i.main,this.layerHandler=ly.get(Qb),this.layerHandler.init(this,n,{main:i.main,canvasId:i.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=i.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Qy,this.background="rgba(0, 0, 0, 0)",this.virtual=!!i.virtual,this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Yg.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 n;const i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var n,i,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:null!==(i=e.x)&&void 0!==i?i:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Yg.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var n,i,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:null!==(i=e.x)&&void 0!==i?i:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}var ex=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},nx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ix=function(t,e){return function(n,i){e(n,i,t)}};let rx=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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();const n=new tx(t,this.global,t.window,Object.assign(Object.assign({},e),{virtual:0===this.staticLayerCountInEnv})),i=this.layerMap.get(t)||[];return i.push(n),this.layerMap.set(t,i),this.staticLayerCountInEnv--,n}releaseLayer(t,e){e.release();const n=this.layerMap.get(t)||[];this.layerMap.set(t,n.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}};rx=ex([np(),ix(0,sp(yp)),nx("design:paramtypes",[Object])],rx);var sx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ox=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ax=function(t,e){return function(n,i){e(n,i,t)}};const lx=Symbol.for("VWindow"),hx=Symbol.for("WindowHandlerContribution");let cx=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 pp(["x","y","width","height"])},this._uid=nv.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;t.env&&!this.actived&&(ly.getNamed(hx,t.env).configure(this,t),this.actived=!0,this._handler)}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,n){return this._handler.addEventListener(t,e,n)}removeEventListener(t,e,n){return this._handler.removeEventListener(t,e,n)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};sx([hp(),ox("design:type",Function),ox("design:paramtypes",[]),ox("design:returntype",void 0)],cx.prototype,"postInit",null),cx=sx([np(),ax(0,sp(yp)),ox("design:paramtypes",[Object])],cx);const ux=Symbol.for("TransformUtil"),dx=Symbol.for("GraphicUtil"),fx=Symbol.for("LayerService");var px=new Zf((t=>{t(xp).toSelf().inSingletonScope(),t(yp).toService(xp),t(cx).to(cx),t(lx).toService(cx),t(Vy).toSelf().inSingletonScope(),t(dx).toService(Vy),t(Yy).toSelf().inSingletonScope(),t(ux).toService(Yy),t(rx).toSelf().inSingletonScope(),t(fx).toService(rx)}));function gx(t,e){return!(!t&&!e)}function yx(t,e){let n;return n=d(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function vx(t,e,n){return n&&t*e>0}function mx(t,e,n,i,r){return r&&t*e>0&&n>0&&i>0}function bx(t,e){return t*e>0}function xx(t,e,n,i){return t*e>0&&n>0&&i>0}function Sx(t,e,n,i,r,s,o,a){if(!t.pathProxy)return!1;const l=ev(t,null==s?void 0:s.theme)[t.type],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible}=t.attribute,y=vx(u,d,h),v=bx(u,p),m=gx(h),b=yx(c,f);if(!g)return!0;if(!m&&!b)return!0;if(!(y||v||o||a))return!0;e.beginPath();return Gp(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),b&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),m&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),!0}function Ax(t,e,n,i,r,s,o,a){const l=n-t,h=i-e,c=o-r,u=a-s;let d=u*l-c*h;return d*d<_?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*l,e+d*h])}function _x(t,e,n,i,r,s,o){const a=t-n,l=e-i,h=(o?s:-s)/Math.sqrt(a*a+l*l),c=h*l,u=-h*a,d=t+c,f=e+u,p=n+c,g=i+u,y=(d+p)/2,v=(f+g)/2,m=p-d,b=g-f,x=m*m+b*b,w=r-s,S=d*g-p*f,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let _=(S*b-m*A)/x,B=(-S*m-b*A)/x;const T=(S*b+m*A)/x,C=(-S*m+b*A)/x,P=_-y,R=B-v,O=T-y,M=C-v;return P*P+R*R>O*O+M*M&&(_=T,B=C),{cx:_,cy:B,x01:-c,y01:-u,x11:_*(r/w-1),y11:B*(r/w-1)}}function Bx(t,e,n,i,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=R(l-a),c=l>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=_)e.moveTo(n,i);else if(h>=P-_)e.moveTo(n+r*M(a),i+r*I(a)),e.arc(n,i,r,a,l,!c),s>_&&(e.moveTo(n+s*M(l),i+s*I(l)),e.arc(n,i,s,l,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:f,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:y,innerEndAngle:v,innerStartAngle:m}=t.getParsePadAngle(a,l),b=d,x=d,w=d,S=d,A=Math.max(x,b),T=Math.max(w,S);let C=A,P=T;const R=r*M(g),E=r*I(g),D=s*M(v),N=s*I(v);let W,F,U,z;if((T>_||A>_)&&(W=r*M(y),F=r*I(y),U=s*M(m),z=s*I(m),h<B)){const t=Ax(R,E,U,z,W,F,D,N);if(t){const e=R-t[0],n=E-t[1],i=W-t[0],o=F-t[1],a=1/I(L((e*i+n*o)/(j(e*e+n*n)*j(i*i+o*o)))/2),l=j(t[0]*t[0]+t[1]*t[1]);P=k(T,(s-l)/(a-1)),C=k(A,(r-l)/(a+1))}}if(f<.001)o&&(o[3]||o[1])&&e.moveTo(n+R,i+E),u=!0;else if(C>_){const t=k(b,C),s=k(x,C),a=_x(U,z,R,E,r,t,Number(c)),l=_x(W,F,D,N,r,s,Number(c));C<A&&t===s?!o||o[0]?(e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),e.arc(n+a.cx,i+a.cy,C,O(a.y01,a.x01),O(l.y01,l.x01),!c)):e.moveTo(n+a.cx+C*M(O(l.y01,l.x01)),i+a.cy+C*I(O(l.y01,l.x01))):!o||o[0]?(e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),t>0&&e.arc(n+a.cx,i+a.cy,t,O(a.y01,a.x01),O(a.y11,a.x11),!c),e.arc(n,i,r,O(a.cy+a.y11,a.cx+a.x11),O(l.cy+l.y11,l.cx+l.x11),!c),s>0&&e.arc(n+l.cx,i+l.cy,s,O(l.y11,l.x11),O(l.y01,l.x01),!c)):s>0?e.moveTo(n+l.cx+s*M(O(l.y01,l.x01)),i+l.cy+s*I(O(l.y01,l.x01))):e.moveTo(n+W,i+r*I(y))}else o&&!o[0]||(e.moveTo(n+R,i+E),e.arc(n,i,r,g,y,!c));if(!(s>_)||p<.001)!o||o[1]?e.lineTo(n+D,i+N):e.moveTo(n+D,i+N),u=!0;else if(P>_){const t=k(S,P),r=k(w,P),a=_x(D,N,W,F,s,-r,Number(c)),l=_x(R,E,U,z,s,-t,Number(c));if(!o||o[1]?e.lineTo(n+a.cx+a.x01,i+a.cy+a.y01):e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),P<T&&t===r){const t=O(l.y01,l.x01);!o||o[2]?e.arc(n+a.cx,i+a.cy,P,O(a.y01,a.x01),t,!c):e.moveTo(n+a.cx+M(t),i+a.cy+I(t))}else!o||o[2]?(r>0&&e.arc(n+a.cx,i+a.cy,r,O(a.y01,a.x01),O(a.y11,a.x11),!c),e.arc(n,i,s,O(a.cy+a.y11,a.cx+a.x11),O(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(n+l.cx,i+l.cy,t,O(l.y11,l.x11),O(l.y01,l.x01),!c)):t>0?e.moveTo(n+l.cx+t*M(O(l.y01,l.x01)),i+l.cy+t*I(O(l.y01,l.x01))):e.moveTo(n+U,i+z)}else!o||o[1]?e.lineTo(n+D,i+N):e.moveTo(n+D,i+N),!o||o[2]?e.arc(n,i,s,v,m,c):e.moveTo(n+s*M(m),i+s*I(m))}return o?o[3]&&e.lineTo(n+r*M(l),i+r*M(l)):e.closePath(),u}class Tx{static GetCanvas(){try{return Tx.canvas||(Tx.canvas=Yg.global.createCanvas({})),Tx.canvas}catch(t){return null}}static GetCtx(){if(!Tx.ctx){const t=Tx.GetCanvas();Tx.ctx=t.getContext("2d")}return Tx.ctx}}class Cx{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const n=Tx.GetCanvas(),i=Tx.GetCtx();if(n.width=e,n.height=1,!i)return;if(i.translate(0,0),!i)throw new Error("获取ctx发生错误");const r=i.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),i.fillStyle=r,i.fillRect(0,0,e,1),this.rgbaSet=i.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n="";t.forEach((t=>n+=t.join())),n+=e;let i=Cx.dataMap.get(n);return i||(i=new Cx(t,e),Cx.dataMap.set(n,i)),i}static SetColorInterpolateInstance(t,e){Cx.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Cx.dataMap.get(t)}}Cx.dataMap=new Map;class Px{static GetSize(t){for(let e=0;e<Px.ImageSize.length;e++)if(Px.ImageSize[e]>=t)return Px.ImageSize[e];return t}static Get(t,e,n,i,r,s,o){const a=Px.GenKey(t,e,n,i,r),l=Px.cache[a];if(!l||0===l.length)return null;for(let t=0;t<l.length;t++)if(l[t].width>=s&&l[t].height>=o)return l[t].pattern;return null}static Set(t,e,n,i,r,s,o,a){const l=Px.GenKey(t,e,n,i,r);Px.cache[l]?Px.cache[l].push({width:o,height:a,pattern:s}):Px.cache[l]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,n,i,r){return`${e},${n},${i},${r},${t.join()}`}}Px.cache={},Px.ImageSize=[20,40,80,160,320,640,1280,2560];const Rx=Symbol.for("ArcRenderContribution"),Ox=Symbol.for("AreaRenderContribution"),Mx=Symbol.for("CircleRenderContribution"),Ex=Symbol.for("GroupRenderContribution"),kx=Symbol.for("ImageRenderContribution"),Ix=Symbol.for("PathRenderContribution"),jx=Symbol.for("PolygonRenderContribution"),Dx=Symbol.for("RectRenderContribution"),Lx=Symbol.for("SymbolRenderContribution"),Nx=Symbol.for("TextRenderContribution"),Wx=Symbol.for("InteractiveSubRenderContribution");var Fx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Ux=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zx=function(t,e){return function(n,i){e(n,i,t)}};let Hx=class{constructor(t){this.arcRenderContribitions=t,this.numberType=Mb}drawArcTailCapPath(t,e,n,i,r,s,o,a){const l=a-o,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=a;const d=R(u-c),f=u>c;let p=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:y,innerDeltaAngle:v,outerStartAngle:m,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,u),S=g,A=g,T=g,C=g,P=Math.max(A,S),E=Math.max(T,C);let D=P,N=E;const W=r*M(m),F=r*I(m),U=s*M(x),z=s*I(x);let H,V,G,X;if((E>_||P>_)&&(H=r*M(b),V=r*I(b),G=s*M(w),X=s*I(w),d<B)){const t=Ax(W,F,G,X,H,V,U,z);if(t){const e=W-t[0],n=F-t[1],i=H-t[0],o=V-t[1],a=1/I(L((e*i+n*o)/(j(e*e+n*n)*j(i*i+o*o)))/2),l=j(t[0]*t[0]+t[1]*t[1]);N=k(E,(s-l)/(a-1)),D=k(P,(r-l)/(a+1))}}if(D>_){const t=k(S,D),s=k(A,D),o=_x(G,X,W,F,r,t,Number(f)),a=_x(H,V,U,z,r,s,Number(f));if(D<P&&t===s)e.moveTo(n+o.cx+o.x01,i+o.cy+o.y01),e.arc(n+o.cx,i+o.cy,D,O(o.y01,o.x01),O(a.y01,a.x01),!f);else{const t=u-l-.03,o=O(a.y11,a.x11);e.arc(n,i,r,t,o,!f),s>0&&e.arc(n+a.cx,i+a.cy,s,O(a.y11,a.x11),O(a.y01,a.x01),!f)}}else e.moveTo(n+W,i+F);if(!(s>_)||v<.001)e.lineTo(n+U,i+z),p=!0;else if(N>_){const t=k(C,N),r=k(T,N),o=_x(U,z,H,V,s,-r,Number(f)),a=_x(W,F,G,X,s,-t,Number(f));if(e.lineTo(n+o.cx+o.x01,i+o.cy+o.y01),N<E&&t===r){const t=O(a.y01,a.x01);e.arc(n+o.cx,i+o.cy,N,O(o.y01,o.x01),t,!f)}else{r>0&&e.arc(n+o.cx,i+o.cy,r,O(o.y01,o.x01),O(o.y11,o.x11),!f);const t=O(o.cy+o.y11,o.cx+o.x11),a=u-l-.03;e.arc(n,i,s,t,a,f)}}else e.lineTo(n+s*M(w),i+s*I(w));return p}drawShape(t,e,n,i,r,s,a,l){const h=ev(t,null==s?void 0:s.theme).arc,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible,x:m=h.x,y:b=h.y}=t.attribute,x=vx(f,p,c),w=bx(f,y),S=gx(c,u),A=yx(d,g);if(!t.valid||!v)return;if(!S&&!A)return;if(!(x||w||a||l||u))return;const{outerRadius:B=h.outerRadius,innerRadius:T=h.innerRadius,cap:C=h.cap,forceShowCap:O=h.forceShowCap}=t.attribute;let M=0;const E=(o(C)&&C||C[0])&&"conical"===c.gradient;if(E){const{sc:e,startAngle:n,endAngle:i}=t.getParsedAngle();R(i-n)<P-_&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let k=!1;const{isFullStroke:I,stroke:j}=(t=>{var e;let n=!0;if(o(t,!0)){for(let i=0;i<4;i++)_v[i]=t,n&&(n=!(null!==(e=_v[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(let e=0;e<4;e++)_v[e]=!!t[e],n&&(n=!!_v[e]);else _v[0]=!1,_v[1]=!1,_v[2]=!1,_v[3]=!1;return{isFullStroke:n,stroke:_v}})(d);if(S||I){if(e.beginPath(),Bx(t,e,n,i,B,T),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Up.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,S,A,x,w,h,r,a,l)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),S&&(a?a(e,t.attribute,h):x&&(e.setCommonStyle(t,t.attribute,m-n,b-i,h),e.fill())),A&&I&&(l?l(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,m-n,b-i,h),e.stroke()))}if(!I&&A){if(e.beginPath(),Bx(t,e,n,i,B,T,j),!k){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Up.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,S,A,x,w,h,r,a,l)}))}l?l(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())}if((o(C)&&C||C[1])&&O){const{startAngle:s,endAngle:o}=t.getParsedAngle();if(R(o-s)>=P-_){e.beginPath();const s=Math.abs(B-T)/2/B,{endAngle:o=h.endAngle,fill:c=h.fill}=t.attribute,u=o;if(this.drawArcTailCapPath(t,e,n,i,B,T,u,u+s),!k){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Up.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,S,A,x,w,h,r,a,l)}))}if(S){const r=c;if("conical"===r.gradient){const s=function(t,e,n,i){const{stops:r,startAngle:s,endAngle:o}=i;for(;n<0;)n+=P;for(;n>P;)n-=P;if(n<s)return r[0].color;if(n>o)return r[0].color;let a,l,h=(n-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=h){a=r[t-1],l=r[t];break}return h=(h-a.offset)/(l.offset-a.offset),Gv(a.color,l.color,h,!1)}(0,0,o,r);a||vx&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=s,e.fill())}}A&&(l||w&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))}}this._arcAfterRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,S,A,x,w,h,r,a,l)})),E&&(c.startAngle+=M,c.endAngle+=M)}draw(t,e,n,i){const{context:r}=n;if(!r)return;const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};Hx=Fx([np(),zx(0,sp(cp)),zx(0,ip(Rx)),Ux("design:paramtypes",[Object])],Hx);var Vx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Gx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xx=function(t,e){return function(n,i){e(n,i,t)}};let Yx=class{constructor(t){this.circleRenderContribitions=t,this.numberType=Ib}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).circle,{fill:h=l.fill,background:c,stroke:u=l.stroke,radius:d=l.radius,startAngle:f=l.startAngle,endAngle:p=l.endAngle,fillOpacity:g=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,opacity:v=l.opacity,lineWidth:m=l.lineWidth,visible:b=l.visible,x:x=l.x,y:w=l.y}=t.attribute,S=vx(v,g,h),A=bx(v,y),_=gx(h,c),B=yx(u,m);t.valid&&b&&(_||B)&&(S||A||o||a||c)&&(e.beginPath(),e.arc(n,i,d,f,p),e.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):S&&(e.setCommonStyle(t,t.attribute,x-n,w-i,l),e.fill())),B&&(a?a(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,x-n,w-i,l),e.stroke())),this._circleRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};Yx=Vx([np(),Xx(0,sp(cp)),Xx(0,ip(Mx)),Gx("design:paramtypes",[Object])],Yx);const qx=["radius","startAngle","endAngle",...Zv];class $x extends nm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=Ib}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)}doUpdateAABBBounds(t){const e=ev(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Yg.graphicService.updateCircleAABBBounds(n,ev(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=Tv(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).circle[t]}needUpdateTags(t){for(let e=0;e<qx.length;e++){const n=qx[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<qx.length;e++)if(t===qx[e])return!0;return!1}toCustomPath(){var t,e,n;const i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),a=new wg;return a.arc(0,0,r,s,o),a}clone(){return new $x(Object.assign({},this.attribute))}}function Kx(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*n+"px "+(a||"sans-serif")}function Zx(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Jx(t,e,n){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}class Qx{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}GetLayout(t,e,n,i,r,s,o,a,l){const h=[],c=[e,n],u=[0,0];for(;t.length>0;){const{str:n}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);h.push({str:n,width:this.textMeasure.measureTextWidth(n,this.textOptions)}),t=t.substring(n.length)}"left"===i||"start"===i||("center"===i?u[0]=c[0]/-2:"right"!==i&&"end"!==i||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,h,i,r,s)}GetLayoutByLines(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;t=t.map((t=>t.toString()));const a=[],l=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++)e=Math.min(this.textMeasure.measureTextWidth(t[n],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,e,r,s).str,width:e});l[0]=o}else{let e,n;o=0;for(let i=0,r=t.length;i<r;i++)n=t[i],e=this.textMeasure.measureTextWidth(n,this.textOptions),o=Math.max(o,e),a.push({str:n,width:e});l[0]=o}l[1]=a.length*i,l[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const h={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(h,e,n),this.layoutWithBBox(h,a,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],o=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-o)/2:"bottom"===i&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const tw=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight",...Zv];class ew extends nm{get font(){const t=ev(this).text;return this._font||(this._font=Kx(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=ev(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:i=n.maxLineWidth}=e;return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=ev(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:n=t.maxLineWidth}=e;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=Xb,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=ev(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=this.attribute,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updateSingallineAABBBounds(t){const e=ev(this).text,{direction:n=e.direction}=this.attribute;return"horizontal"===n?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=ev(this).text,{direction:n=e.direction}=this.attribute;return"horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,n;const i=ev(this).text,r=Yg.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:l=i.maxLineWidth,ellipsis:h=i.ellipsis,textAlign:c=i.textAlign,textBaseline:u=i.textBaseline,fontFamily:d=i.fontFamily,fontSize:f=i.fontSize,fontWeight:p=i.fontWeight,stroke:g=i.stroke,lineWidth:y=i.lineWidth,wordBreak:v=i.wordBreak,ignoreBuf:m=i.ignoreBuf}=a,b=m?0:Math.max(2,.075*f),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||i.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(n=this.cache.clipedWidth)&&void 0!==n?n:0;const t=Zx(c,s),e=Jx(u,x,f);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(y/2),this._AABBBounds}if(Number.isFinite(l)){if(h){const e=!0===h?i.ellipsis:h,n=r.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d},l,e,!1);o=n.str,s=n.width}else{const e=r.clipText(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d},l,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const w=Zx(c,s);let S=x;Yg.global&&Yg.global.isSafari()&&(S+=.2*f);const A=Jx(u,S,f,b);return this._AABBBounds.set(w,A,w+s,A+S),g&&this._AABBBounds.expand(y/2),this._AABBBounds}updateVerticalSinglelineAABBBounds(t){var e;const n=ev(this).text,i=Yg.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=n.ignoreBuf}=s,a=o?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:f=n.fontWeight,fontFamily:p=n.fontFamily,stroke:g=n.stroke,lineHeight:y=(null!==(e=s.lineHeight)&&void 0!==e?e:(s.fontSize||n.fontSize)+a),lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak}=s;if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth;const t=Zx(c,r),e=Jx(u,y,d);return this._AABBBounds.set(e,t,e+y,t+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}let b=[Cb(t.toString())];if(Number.isFinite(l)){if(h){const t=!0===h?n.ellipsis:h,e=i.clipTextWithSuffixVertical(b[0],{fontSize:d,fontWeight:f,fontFamily:p},l,t,!1);b=[e.verticalList],r=e.width}else{const t=i.clipTextVertical(b[0],{fontSize:d,fontWeight:f,fontFamily:p},l,!1);b=[t.verticalList],r=t.width}this.cache.verticalList=b,this.cache.clipedWidth=r}else r=0,b[0].forEach((t=>{const e=t.direction===Tb.HORIZONTAL?d:i.measureTextWidth(t.text,{fontSize:d,fontWeight:f,fontFamily:p});r+=e,t.width=e})),this.cache.verticalList=b,this.cache.clipedWidth=r;this.clearUpdateShapeTag();const x=Zx(c,r),w=Jx(u,y,d);return this._AABBBounds.set(w,x,w+y,x+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const n=ev(this).text,i=this.attribute,{fontFamily:r=n.fontFamily,textAlign:s=n.textAlign,textBaseline:o=n.textBaseline,fontSize:a=n.fontSize,fontWeight:l=n.fontWeight,lineHeight:h=i.lineHeight||i.fontSize||n.fontSize,ellipsis:c=n.ellipsis,maxLineWidth:u,stroke:d=n.stroke,lineWidth:f=n.lineWidth,wordBreak:p=n.wordBreak}=i;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(f/2),this._AABBBounds}const g=Yg.graphicUtil.textMeasure,y=new Qx(r,{fontSize:a,fontWeight:l,fontFamily:r},g).GetLayoutByLines(t,s,o,h,!0===c?n.ellipsis:c||void 0,!1,u),{bbox:v}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(v.xOffset,v.yOffset,v.xOffset+v.width,v.yOffset+v.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e;const n=ev(this).text,i=Yg.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=n.ignoreBuf}=s,a=o?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:f=n.fontSize,fontWeight:p=n.fontWeight,stroke:g=n.stroke,lineHeight:y=(null!==(e=s.lineHeight)&&void 0!==e?e:(s.fontSize||n.fontSize)+a),lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak}=s;if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=E(e,r)}));const t=Zx(c,r),e=this.cache.verticalList.length*y,n=Jx(u,e,f);return this._AABBBounds.set(n,t,n+e,t+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}const b=t.map((t=>Cb(t.toString())));b.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const s=!0===h?n.ellipsis:h,o=i.clipTextWithSuffixVertical(t,{fontSize:f,fontWeight:p,fontFamily:d},l,s,!1);b[e]=o.verticalList,r=o.width}else{const n=i.clipTextVertical(t,{fontSize:f,fontWeight:p,fontFamily:d},l,!1);b[e]=n.verticalList,r=n.width}else r=0,t.forEach((t=>{const e=t.direction===Tb.HORIZONTAL?f:i.measureTextWidth(t.text,{fontSize:f,fontWeight:p,fontFamily:d});r+=e,t.width=e}))})),this.cache.verticalList=b,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=E(e,r)}));const x=Zx(c,r),w=this.cache.verticalList.length*y,S=Jx(u,w,f);return this._AABBBounds.set(S,x,S+w,x+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).text[t]}needUpdateTags(t){for(let e=0;e<tw.length;e++){const n=tw[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<tw.length;e++)if(t===tw[e])return!0;return!1}clone(){return new ew(Object.assign({},this.attribute))}}const nw=["heightLimit","lineClamp"];class iw extends ew{_isValid(){const{text:t}=this.attribute;return d(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i;const r=ev(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:l=r.fontSize,lineHeight:h=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:f=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:y=r.ignoreBuf,heightLimit:v=0,lineClamp:m}=this.attribute,b=y?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=Yg.graphicUtil.textMeasure,w=new Qx(s,{fontSize:l,fontWeight:g,fontFamily:s},x),S=t.map((t=>t.toString())),A=[],_=[0,0];let B=1/0;if(v>0&&(B=Math.max(Math.floor(v/h),1)),m&&(B=Math.min(B,m)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<S.length;t++){const e=S[t];let r=!0;if(t===B-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);A.push({str:t.str,width:t.width});break}const s=w.textMeasure.clipText(e,w.textOptions,u,"break-word"===p);if(""!==e&&""===s.str){if(c){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(i=t.width)&&void 0!==i?i:0}else s.str="",s.width=0;r=!1}if(A.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const n=e.substring(s.str.length);S.splice(t+1,0,n)}}let t=0;A.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,n=0;for(let i=0,r=S.length;i<r;i++){if(i===B-1){const t=w.textMeasure.clipTextWithSuffix(S[i],w.textOptions,u,c,!1);A.push({str:t.str,width:t.width}),n=Math.max(n,t.width);break}e=S[i],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===p),n=Math.max(n,t),A.push({str:e,width:t})}_[0]=n}_[1]=A.length*(h+b);const T={xOffset:0,yOffset:0,width:_[0],height:_[1]};w.LayoutBBox(T,o,a);const C=w.layoutWithBBox(T,A,o,a,h);return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(T.xOffset,T.yOffset,T.xOffset+T.width,T.yOffset+T.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<nw.length;e++){const n=nw[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<nw.length;e++)if(t===nw[e])return!0;return super.needUpdateTag(t)}}function rw(t,e,n,i,r){return r?t.arc(n,i,e,0,C,!1,r):t.arc(n,i,e,0,C),!1}var sw=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,n,i,r){return rw(t,e/2,n,i,r)}drawOffset(t,e,n,i,r,s){return rw(t,e/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var ow=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,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,e/6,n,i,r,s)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function aw(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var lw=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return aw(t,e/2,n,i,r)}drawFitDir(t,e,n,i,r){return aw(t,e/2,n,i,r)}drawOffset(t,e,n,i,r,s){return aw(t,e/2+r,n,i,s)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function hw(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var cw=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return hw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return hw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};class uw{constructor(){this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}var dw=new uw;var fw=new class extends uw{constructor(){super(...arguments),this.type="triangle"}};const pw=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),gw=Math.sin(C/10)*pw,yw=-Math.cos(C/10)*pw;function vw(t,e,n,i){const r=gw*e,s=yw*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let o=1;o<5;++o){const a=C*o/5,l=Math.cos(a),h=Math.sin(a);t.lineTo(h*e+n,-l*e+i),t.lineTo(l*r-h*s+n,h*r+l*s+i)}return t.closePath(),!0}var mw=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,n,i){return vw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return vw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const bw=j(3);function xw(t,e,n,i){const r=e,s=r/bw,o=s/5,a=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(o/2+n,i),t.lineTo(o/2+n,a+i),t.lineTo(-o/2+n,a+i),t.lineTo(-o/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var ww=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,n,i){return xw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return xw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Sw(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Aw=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Sw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Sw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function _w(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Bw=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,n,i){return _w(t,e/2,n,i)}drawOffset(t,e,n,i,r){return _w(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const Tw=-.5,Cw=j(3)/2,Pw=1/j(12);function Rw(t,e,n,i){const r=e/2,s=e*Pw,o=r,a=e*Pw+e,l=-o,h=a;return t.moveTo(r+n,s+i),t.lineTo(o+n,a+i),t.lineTo(l+n,h+i),t.lineTo(Tw*r-Cw*s+n,Cw*r+Tw*s+i),t.lineTo(Tw*o-Cw*a+n,Cw*o+Tw*a+i),t.lineTo(Tw*l-Cw*h+n,Cw*l+Tw*h+i),t.lineTo(Tw*r+Cw*s+n,Tw*s-Cw*r+i),t.lineTo(Tw*o+Cw*a+n,Tw*a-Cw*o+i),t.lineTo(Tw*l+Cw*h+n,Tw*h-Cw*l+i),t.closePath(),!1}var Ow=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,n,i){return Rw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Rw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Mw=new class{constructor(){this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Ew=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,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var kw=new class{constructor(){this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const Iw=j(3);function jw(t,e,n,i){const r=e*Iw;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var Dw=new class extends uw{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return jw(t,e/2/Iw,n,i)}drawOffset(t,e,n,i,r){return jw(t,e/2/Iw+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Lw(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var Nw=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,n,i){return Lw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Lw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Ww(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var Fw=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,n,i){return Ww(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Ww(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Uw(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var zw=new class{constructor(){this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,n,i){return Uw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Uw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Hw(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var Vw=new class{constructor(){this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,n,i){return Hw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Hw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Gw(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var Xw=new class{constructor(){this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return Gw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return Gw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e}, ${n-r} L ${e},${n+r}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Yw(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var qw=new class{constructor(){this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return Yw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return Yw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n} L ${e+r},${n}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function $w(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var Kw=new class{constructor(){this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,n,i,r){return $w(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return $w(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Zw(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}var Jw=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return Zw(t,g(e)?[e,e]:e,n,i)}drawOffset(t,e,n,i,r){return Zw(t,g(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],n,i)}bounds(t,e){const n=g(t)?[t,t]:t;e.x1=-n[0]/2,e.x2=n[0]/2,e.y1=-n[1]/2,e.y2=n[1]/2}};const Qw=new V;class tS{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,d(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Gp(r.path.commandList,t,n,i,e,e),o&&o(r.path,r.attribute)})),!1):(Gp(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Gp(r.path.commandList,t,n,i,e,e),s&&s(r.path,r.attribute)})),!1):(Gp(this.path.commandList,t,n,i,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;Qw.x1=i.bounds.x1*t,Qw.y1=i.bounds.y1*t,Qw.x2=i.bounds.x2*t,Qw.y2=i.bounds.y2*t,e.union(Qw)}))}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 eS={};[sw,ow,lw,cw,Dw,fw,mw,ww,Aw,Bw,Ow,Mw,Ew,dw,kw,Nw,Fw,zw,Vw,Jw,Xw,qw,Kw].forEach((t=>{eS[t.type]=t}));const nS=["symbolType","size",...Zv];let iS=class t extends nm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Gb}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return d(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=ev(this).symbol,{symbolType:n=e.symbolType}=this.attribute;let i=eS[n];if(i)return this._parsedPath=i,i;if(i=t.userSymbolMap[n],i)return this._parsedPath=i,i;if(!0===Sb.XMLValidator.validate(n,{allowBooleanAttributes:!0})){const e=new Sb.XMLParser({ignoreAttributes:!1}),{svg:i}=e.parse(n);if(!i)return null;const r=d(i.path)?i.path:[i.path],s=new V,o=[];r.forEach((t=>{const e=(new wg).fromString(t["@_d"]),n={fill:"black"};Kb.forEach((e=>{t[e]&&(n[$b[e]]=t[e])})),o.push({path:e,attribute:n}),s.union(e.bounds)}));const a=s.width(),l=s.height(),h=1/E(a,l);return o.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new tS(n,o,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}const r=(new wg).fromString(n),s=r.bounds.width(),o=r.bounds.height(),a=1/E(s,o);return r.transform(0,0,a,a),this._parsedPath=new tS(n,r),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=ev(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Yg.graphicService.updateSymbolAABBBounds(n,ev(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=Tv(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).symbol[t]}needUpdateTags(t){for(let e=0;e<nS.length;e++){const n=nS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<nS.length;e++)if(t===nS[e])return!0;return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=d(e)?e:[e,e];return t.path?(new wg).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new wg).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}};iS.userSymbolMap={};const rS=["segments","points","curveType",...Zv];let sS=class t extends nm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=Nb}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,n,i,r){"points"===t&&(r.points=Mv(n,i,e))}doUpdateAABBBounds(){const t=ev(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateLineAABBBounds(e,ev(this).line,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).line[t]}needUpdateTags(t){for(let e=0;e<rS.length;e++){const n=rS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<rS.length;e++)if(t===rS[e])return!0;return!1}toCustomPath(){const t=this.attribute,e=new wg,n=t.segments,i=t=>{if(t&&t.length){let n=!0;t.forEach((t=>{!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((t=>{i(t.points)})):t.points&&i(t.points),e}clone(){return new t(Object.assign({},this.attribute))}};const oS=["width","height","cornerRadius",...Zv];class aS extends nm{constructor(t){super(t),this.type="rect",this.numberType=zb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=ev(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateRectAABBBounds(e,ev(this).rect,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).rect[t]}needUpdateTags(t){for(let e=0;e<oS.length;e++){const n=oS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<oS.length;e++)if(t===oS[e])return!0;return!1}toCustomPath(){const t=this.attribute,e=t.width,n=t.height,i=new wg;return i.moveTo(0,0),i.rect(0,0,e,n),i}clone(){return new aS(Object.assign({},this.attribute))}}const lS=[[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 hS extends aS{constructor(t){super(t),this.type="rect3d",this.numberType=Hb}findFace(){const t={polygons:[],vertices:[],edges:[]},e=ev(this).rect3d,{width:n=e.width,height:i=e.width,length:r=k(e.width,e.height)}=this.attribute;for(let e=0;e<lS.length;e++){const s=lS[e];t.vertices.push([s[0]*n,s[1]*i,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 cS{constructor(t,e,n,i,r,s,o,a,l,h,c,u,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=qg[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);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 l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=n:o+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,h=!0),this.lines[n].draw(t,i,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,h=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=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 n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],o=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&o-this.lines[n+1].height<this[this.directionKey.top]){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class uS{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic","number"==typeof n.lineHeight?this.lineHeight=n.lineHeight>this.fontSize?n.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:i,height:r,descent:s,width:o}=ny(t,n);let a=0,l=0,h=0;this.height>r&&(a=(this.height-r)/2,l=Math.ceil(a),h=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=i+l,this.descent=s+h),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=ny(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,n,i,r){let s=this.text,o=this.left+n;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=ty(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}=ny(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 n=e&&e.stroke||Kg;if(!n)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=n;let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const n=e&&e.fill||$g;if(!n)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=n;let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,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 n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=ty(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:i}=ny(this.text.slice(t),this.character);return n+this.ellipsisWidth-i}return n}}const dS=["width","height","image",...Zv];class fS extends nm{constructor(t){super(t),this.type="image",this.numberType=Lb,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,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=ev(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateImageAABBBounds(e,ev(this).image,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Gg[t]}needUpdateTags(t){for(let e=0;e<dS.length;e++){const n=dS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<dS.length;e++)if(t===dS[e])return!0;return!1}clone(){return new fS(Object.assign({},this.attribute))}}class pS extends fS{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=Tv(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(d(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=Tv(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=Gg.width,height:e=Gg.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-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 gS{constructor(t,e,n,i,r,s,o,a){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof pS?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=qg[this.direction];const l=this.directionKey;this.actualWidth=0;let h=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof uS){const e=Qg.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],h=Math.max(t[this.directionKey.height],h)})),this.height=h,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 pS?(t["_"+l.x]=c,c+=t[l.width]+u,t["_"+l.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?h-t.height:(h-t.height)/2):(t[l.left]=c,c+=t[l.width]+u)}))}draw(t,e,n,i,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n instanceof pS)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const{width:i}=ny("...",n.character),r=i||0;if(r<=this.blankWidth+t){n.ellipsis="add";break}if(r<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}}this.paragraphs.map(((e,s)=>{if(e instanceof pS)return e.setAttributes({x:n+e._x,y:i+e._y}),void r(e,t,n+e._x,i+e._y,this.ascent);e.draw(t,i+this.ascent,n,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n instanceof pS)break;const{width:i}=ny("...",n.character),r=i||0;if(r<=this.blankWidth+t){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}let e=0;return this.paragraphs.map(((t,n)=>{e+=t instanceof pS?t.width:t.getWidthWithEllips(this.direction)})),e}}class yS{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=qg[this.direction]}store(t){if(t instanceof pS){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new gS(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof pS?"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,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=ty(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){const[e,n]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new uS(n,t.newLine,t.character),new uS(i,!0,t.character)]}(t,i);this.store(e),this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const vS=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...Zv];class mS extends nm{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Vb}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Vg.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:Vg.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:Vg.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:Vg.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:Vg.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:Vg.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:Vg.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:Vg.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=ev(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateRichTextAABBBounds(e,ev(this).richtext,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Vg[t]}needUpdateTags(t){for(let e=0;e<vS.length;e++){const n=vS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<vS.length;e++)if(t===vS[e])return!0;return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:n,maxHeight:i,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,f=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const n=e[t],i=n.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(n.id);if(i)f.push(i);else{const t=new pS(n);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=n.id,f.push(t)}}else if(e[t].text.includes("\n")){const n=e[t].text.split("\n");for(let i=0;i<n.length;i++)f.push(new uS(n[i],0!==i,e[t]))}else f.push(new uS(e[t].text,!1,e[t]));const p=new cS(0,0,("number"==typeof n&&(!r||r>n)?n:r)||0,("number"==typeof i&&(!s||s>i)?i:s)||0,o,a,l,h,c,u||"horizontal","number"==typeof n&&(!r||r>n),"number"==typeof i&&(!s||s>i),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new yS(p);for(let t=0;t<f.length;t++)g.deal(f[t]);g.send(),this._frameCache=p}clone(){return new mS(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,n,i,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===(n=this.stage)||void 0===n||n.setCursor(o.attribute.cursor),null===(i=this.stage)||void 0===i||i.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,n;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(n=this.stage)||void 0===n||n.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+n,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i)})),r}}const bS=["path","customPath",...Zv];class xS extends nm{constructor(t){super(t),this.type="path",this.numberType=Wb}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=ev(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof wg?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof wg?this.cache:t.path)}doUpdateAABBBounds(){const t=ev(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updatePathAABBBounds(e,ev(this).path,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}doUpdatePathShape(){const t=this.attribute;u(t.path,!0)?this.cache=(new wg).fromString(t.path):t.customPath&&(this.cache=new wg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).path[t]}needUpdateTags(t){for(let e=0;e<bS.length;e++){const n=bS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<bS.length;e++)if(t===bS[e])return!0;return!1}toCustomPath(){return(new wg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new xS(Object.assign({},this.attribute))}}const wS=["segments","points","curveType",...Zv];class SS extends nm{constructor(t){super(t),this.type="area",this.numberType=kb}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=ev(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateAreaAABBBounds(e,ev(this).area,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Mv(n,i,e))}getDefaultAttribute(t){return ev(this).area[t]}needUpdateTags(t){for(let e=0;e<wS.length;e++){const n=wS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<wS.length;e++)if(t===wS[e])return!0;return!1}toCustomPath(){const t=new wg,e=this.attribute,n=e.segments,i=e=>{if(e&&e.length){let n=!0;const i=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),n=!1)})),i.length){for(let e=i.length-1;e>=0;e--)t.lineTo(i[e].x,i[e].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((t=>{i(t.points)})),t}clone(){return new SS(Object.assign({},this.attribute))}}const AS=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Zv];class _S extends nm{constructor(t){super(t),this.type="arc",this.numberType=Mb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=ev(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:n=t.outerRadius,innerRadius:i=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(n-i);return Math.min(g(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=ev(this).arc;let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=X(e),n=e+s,i&&R(s)<P-_){let s=1,o=1;i.length&&(s=Number(i[0]),o=Number(i[1]));const{outerRadius:a=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute,h=Math.abs(a-l)/2,c=h/a;if(h>_&&a>_)return{startAngle:e-r*c*s,endAngle:n+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=ev(this).arc,{outerRadius:i=n.outerRadius,innerRadius:r=n.innerRadius,padAngle:s=n.padAngle}=this.attribute,{padRadius:o=j(i*i+r*r)}=this.attribute,a=R(e-t);let l=t,h=e,c=t,u=e;const d=s/2;let f=a,p=a;if(d>_&&o>_){const n=e>t?1:-1;let s=N(Number(o)/r*I(d)),a=N(Number(o)/i*I(d));return(f-=2*s)>_?(s*=n,c+=s,u-=s):(f=0,c=u=(t+e)/2),(p-=2*a)>_?(a*=n,l+=a,h-=a):(p=0,l=h=(t+e)/2),{outerStartAngle:l,outerEndAngle:h,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:f,outerDeltaAngle:p}}return{outerStartAngle:l,outerEndAngle:h,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:f,outerDeltaAngle:p}}doUpdateAABBBounds(t){const e=ev(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Yg.graphicService.updateArcAABBBounds(n,ev(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=Tv(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<AS.length;e++){const n=AS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<AS.length;e++)if(t===AS[e])return!0;return!1}getDefaultAttribute(t){return ev(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:n}=this.getParsedAngle();let i=t.innerRadius,r=t.outerRadius;const s=R(n-e),o=n>e;if(r<i){const t=r;r=i,i=t}const a=new wg;if(r<=_)a.moveTo(0,0);else if(s>=P-_)a.moveTo(0+r*M(e),0+r*I(e)),a.arc(0,0,r,e,n,!o),i>_&&(a.moveTo(0+i*M(n),0+i*I(n)),a.arc(0,0,i,n,e,o));else{const t=r*M(e),s=r*I(e),l=i*M(n),h=i*I(n);a.moveTo(0+t,0+s),a.arc(0,0,r,e,n,!o),a.lineTo(0+l,0+h),a.arc(0,0,i,n,e,o),a.closePath()}return a}clone(){return new _S(Object.assign({},this.attribute))}}const BS=["points","cornerRadius",...Zv];class TS extends nm{constructor(t){super(t),this.type="polygon",this.numberType=Fb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=ev(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updatePolygonAABBBounds(e,ev(this).polygon,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Tv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Mv(n,i,e))}getDefaultAttribute(t){return ev(this).polygon[t]}needUpdateTags(t){for(let e=0;e<BS.length;e++){const n=BS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<BS.length;e++)if(t===BS[e])return!0;return!1}toCustomPath(){const t=this.attribute.points,e=new wg;return t.forEach(((t,n)=>{0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new TS(Object.assign({},this.attribute))}}var CS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let PS=class{updateBounds(t,e,n,i){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:i=t.distance,lineWidth:o=t.lineWidth}=r;n.expand(i+s+o/2)}return n}};PS=CS([np()],PS);var RS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const OS=Symbol.for("RectBoundsContribution");let MS=class extends PS{};MS=RS([np()],MS);var ES=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const kS=Symbol.for("SymbolBoundsContribution");let IS=class extends PS{updateBounds(t,e,n,i){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:i=t.distance,lineWidth:a=t.lineWidth}=r;Ab(n,i+s+a/2,!0,o)}return n}};IS=ES([np()],IS);var jS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const DS=Symbol.for("CircleBoundsContribution");let LS=class extends PS{};LS=jS([np()],LS);var NS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const WS=Symbol.for("ArcBoundsContribution");let FS=class extends PS{};FS=NS([np()],FS);var US=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const zS=Symbol.for("PathBoundsContribution");let HS=class extends PS{};HS=US([np()],HS);class VS{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 VS.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 n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const GS=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new Y(t,e,n,i,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=i,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new Y(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},XS=new VS;var YS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},qS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$S=function(t,e){return function(n,i){e(n,i,t)}};function KS(t,e,n){const i=n[0],r=n[1],s=n[2];let o,a,l,h,c,u,d,f,p,g,y,v;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],f=e[7],p=e[8],g=e[9],y=e[10],v=e[11],t[0]=o,t[1]=a,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=y,t[11]=v,t[12]=o*i+c*r+p*s+e[12],t[13]=a*i+u*r+g*s+e[13],t[14]=l*i+d*r+y*s+e[14],t[15]=h*i+f*r+v*s+e[15]),t}function ZS(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 JS(t,e,n){const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],y=e[13],v=e[14],m=e[15];let b=n[0],x=n[1],w=n[2],S=n[3];return t[0]=b*i+x*a+w*u+S*g,t[1]=b*r+x*l+w*d+S*y,t[2]=b*s+x*h+w*f+S*v,t[3]=b*o+x*c+w*p+S*m,b=n[4],x=n[5],w=n[6],S=n[7],t[4]=b*i+x*a+w*u+S*g,t[5]=b*r+x*l+w*d+S*y,t[6]=b*s+x*h+w*f+S*v,t[7]=b*o+x*c+w*p+S*m,b=n[8],x=n[9],w=n[10],S=n[11],t[8]=b*i+x*a+w*u+S*g,t[9]=b*r+x*l+w*d+S*y,t[10]=b*s+x*h+w*f+S*v,t[11]=b*o+x*c+w*p+S*m,b=n[12],x=n[13],w=n[14],S=n[15],t[12]=b*i+x*a+w*u+S*g,t[13]=b*r+x*l+w*d+S*y,t[14]=b*s+x*h+w*f+S*v,t[15]=b*o+x*c+w*p+S*m,t}function QS(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:o=n.z,dx:a=n.dx,dy:l=n.dy,dz:h=n.dz,scaleX:c=n.scaleX,scaleY:u=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:y=e.attribute.anchor,anchor:v}=e.attribute,m=[0,0,0];if(y){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,n=e.AABBBounds;m[0]=n.x1+(n.x2-n.x1)*t}else m[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,n=e.AABBBounds;m[1]=n.x1+(n.x2-n.x1)*t}else m[1]=y[1];m[2]=null!==(i=y[2])&&void 0!==i?i:0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),KS(t,t,[r+a,s+l,o+h]),KS(t,t,[m[0],m[1],m[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+h*i,t[5]=o*r+c*i,t[6]=a*r+u*i,t[7]=l*r+d*i,t[8]=h*r-s*i,t[9]=c*r-o*i,t[10]=u*r-a*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-h*i,t[1]=o*r-c*i,t[2]=a*r-u*i,t[3]=l*r-d*i,t[8]=s*i+h*r,t[9]=o*i+c*r,t[10]=a*i+u*r,t[11]=l*i+d*r}(t,t,f),KS(t,t,[-m[0],-m[1],m[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*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 n=XS.allocate(),i=[0,0];if(v){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=y[1]}KS(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+h*i,t[1]=o*r+c*i,t[2]=a*r+u*i,t[3]=l*r+d*i,t[4]=h*r-s*i,t[5]=c*r-o*i,t[6]=u*r-a*i,t[7]=d*r-l*i}(n,n,g),KS(n,n,[-i[0],-i[1],0]),JS(t,t,n)}}let tA=class{constructor(t,e,n,i,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=n,this.circleBoundsContribitions=i,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new pp(["graphic"]),onSetStage:new pp(["graphic","stage"]),onRemove:new pp(["graphic"]),onAddIncremental:new pp(["graphic","group","stage"]),onClearIncremental:new pp(["graphic","group","stage"]),beforeUpdateAABBBounds:new pp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new pp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new V,this.tempAABBBounds2=new V}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,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new Sp(t);return Gp(n.commandList,i,0,0),!0}updateRectAABBBounds(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,i),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,n,e,!1,i),n}updateGroupAABBBounds(t,e,n,i){const{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,r,s),a||i.forEachChildren((t=>{n.union(t.AABBBounds)}));const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateGlyphAABBBounds(t,e,n,i){return i.getSubGraphic().forEach((t=>{n.union(t.AABBBounds)})),n}updateRichTextAABBBounds(t,e,n,i){if(!i)return n;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline}=t;if(r>0&&s>0)n.set(0,0,r,s);else{const t=i.getFrameCache(),{width:e,height:l}=t.getActualSize();let h=r||e||0,c=s||l||0;c="number"==typeof a&&c>a?a:c||0,h="number"==typeof o&&h>o?o:h||0,n.set(0,0,h,c)}let c=0;switch(h){case"top":c=0;break;case"middle":c=-n.height()/2;break;case"bottom":c=-n.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-n.width()/2;break;case"right":u=-n.width()}n.translate(u,c);const d=this.tempAABBBounds1,f=this.tempAABBBounds2;return d.setValue(n.x1,n.y1,n.x2,n.y2),f.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateTextAABBBounds(t,e,n,i){if(!i)return n;const{text:r=e.text}=i.attribute;Array.isArray(r)?i.updateMultilineAABBBounds(r):i.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2);const{scaleX:a=e.scaleX,scaleY:l=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(h){Ab(s,h/Math.abs(a+l),!0,c),n.union(s)}return this.combindShadowAABBBounds(n,i),z(n,n,i.transMatrix),n}updatePathAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,i),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updatePathAABBBoundsImprecise(t,e,n,i){if(!i)return n;const r=i.getParsedPathShape();return n.union(r.getBounds()),n}updatePyramid3dAABBBounds(t,e,n,i){if(!i)return n;const r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((t=>{const e=t[0],i=t[1];n.add(e,i)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateArc3dAABBBounds(t,e,n,i){if(!i)return n;const r=i.stage;if(!r||!r.camera)return n;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;n.setValue(-a,-a,a,a);const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updatePolygonAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updatePolygonAABBBoundsImprecise(t,e,n,i){const{points:r=e.points}=t;return r.forEach((t=>{n.add(t.x,t.y)})),n}updateLineAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updateLineAABBBoundsByPoints(t,e,n,i){const{points:r=e.points}=t,s=n;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,n,i){const{segments:r=e.segments}=t,s=n;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updateAreaAABBBoundsByPoints(t,e,n,i){const{points:r=e.points}=t,s=n;return r.forEach((t=>{var e,n;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,n,i){const{segments:r=e.segments}=t,s=n;return r.forEach((t=>{t.points.forEach((t=>{var e,n;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),s}updateCircleAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,n,e,!1,r),n}updateCircleAABBBoundsImprecise(t,e,n,i){const{radius:r=e.radius}=t;return n.set(-r,-r,r,r),n}updateCircleAABBBoundsAccurate(t,e,n,i){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>P-_?n.set(-o,-o,o,o):Rv(r,s,o,n),n}updateArcAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===a,r),n}updateArcAABBBoundsImprecise(t,e,n,i){const{outerRadius:r=e.outerRadius}=t;return n.set(-r,-r,r,r),n}updateArcAABBBoundsAccurate(t,e,n,i){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<=_?n.set(0,0,0,0):Math.abs(o-a)>P-_?n.set(-r,-r,r,r):(Rv(a,o,r,n),Rv(a,o,s,n)),n}updateSymbolAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===a,r),n}updateSymbolAABBBoundsImprecise(t,e,n,i){const{size:r=e.size}=t;if(d(r))n.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n,i){if(!i)return n;const{size:r=e.size}=t;return i.getParsedPath().bounds(r,n),n}updateImageAABBBounds(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){const{scaleX:s=n.scaleX,scaleY:o=n.scaleY,stroke:a=n.stroke,shadowBlur:l=n.shadowBlur,lineWidth:h=n.lineWidth,strokeBoundsBuffer:c=n.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){Ab(u,h/Math.abs(s+o),i,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(l){Ab(u,l/Math.abs(s+o),i,c),e.union(u)}this.combindShadowAABBBounds(e,r),z(e,e,r.transMatrix)}};tA=YS([np(),$S(0,sp(qb)),$S(1,sp(cp)),$S(1,ip(OS)),$S(2,sp(cp)),$S(2,ip(kS)),$S(3,sp(cp)),$S(3,ip(DS)),$S(4,sp(cp)),$S(4,ip(WS)),$S(5,sp(cp)),$S(5,ip(zS)),qS("design:paramtypes",[Object,Object,Object,Object,Object,Object])],tA);class eA extends Jb{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function nA(t){return new aS(t)}function iA(t){return new ew(t)}function rA(t){return new mS(t)}const sA={arc:function(t){return new _S(t)},area:function(t){return new SS(t)},circle:function(t){return new $x(t)},group:function(t){return new Jb(t)},image:function(t){return new fS(t)},line:function(t){return new sS(t)},path:function(t){return new xS(t)},rect:nA,rect3d:function(t){return new hS(t)},symbol:function(t){return new iS(t)},text:iA,richtext:rA,polygon:function(t){return new TS(t)},shadowRoot:function(t){return new eA(t)},wrapText:function(t){return new iw(t)}},oA=iA({text:""});function aA(t){return oA.setAttributes(t),oA.AABBBounds}rA({});var lA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let hA=class{transform(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:l=e.scaleX,scaleY:h=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,f=n.modelMatrix,p=n.camera,g={x:s,y:o,z:a,lastModelMatrix:f},y=p&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t));if(y){const i=XS.allocate(),r=XS.allocate();QS(r,t,e),JS(i,f||i,r),g.x=0,g.y=0,g.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),XS.free(r)}if(d&&!f){const i=t.getOffsetXY(e);g.x+=i.x,g.y+=i.y,g.z=a,n.setTransformForCurrent()}else if(y)g.x=0,g.y=0,g.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(p&&n.project){const i=t.getOffsetXY(e);g.x+=i.x,g.y+=i.y,this.transformWithoutTranslate(n,g.x,g.y,g.z,l,h,c)}else n.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=i.project(0,0,n),a=i.project(r,0,n),l=i.project(r,s,n),h={x:0,y:0},c={x:r,y:0},u={x:r,y:s};i.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),f=-(h.y*(l.x-a.x)-c.y*l.x+u.y*a.x+(c.y-u.y)*o.x)*d,p=(c.y*l.y+h.y*(a.y-l.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(h.x*(l.x-a.x)-c.x*l.x+u.x*a.x+(c.x-u.x)*o.x)*d,y=-(c.x*l.y+h.x*(a.y-l.y)-u.x*a.y+(u.x-c.x)*o.y)*d,v=(h.x*(u.y*a.x-c.y*l.x)+h.y*(c.x*l.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,m=(h.x*(u.y*a.y-c.y*l.y)+h.y*(c.x*l.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;i.setTransform(f,p,g,y,v,m,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,o){const a=t.project(e,n,i);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()}};function cA(t,e,n,i,r){var s;const{offsetX:o=0,offsetY:a=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1,zeroX:u=0,zeroY:d=0}=r||{};if(c&&"none"===h)return;if(!e)return;let f=!0;const{curves:p}=e;if(n>=1){if(c){let e,n=!0;p.forEach(((i,r)=>{var s;let h=i.p0;if(i.originP1!==i.originP2){if(e&&e.originP1===e.originP2&&(h=e.p0),i.defined)n||(t.lineTo(h.x+o,h.y+a,l),n=!n);else{const{originP1:e,originP2:r}=i;let c;if(e&&!1!==e.defined?c=h:e&&!1!==r.defined&&(c=null!==(s=i.p3)&&void 0!==s?s:i.p1),n){n=!n;const e=c?c.x:i.p0.x,r=c?c.y:i.p0.y;t.moveTo(e+o,r+a,l)}else c&&(n=!n,t.lineTo(c.x+o,c.y+a,l))}e=i}else e=i}))}else p.forEach((e=>{e.defined?(f&&t.moveTo(e.p0.x+o,e.p0.y+a,l),uA(t,e,1,r),f=!1):f=!0}));return}if(n<=0)return;let g;"x"===i?g=Wp.ROW:"y"===i?g=Wp.COLUMN:"auto"===i&&(g=e.direction);const y=n*e.tryUpdateLength(g);let v=0,m=!0,b=null;for(let e=0,n=p.length;e<n;e++){const n=p[e],i=n.getLength(g),h=(y-v)/i;if(v+=i,h<0)break;if(c){let e=n.p0;if(n.originP1===n.originP2){b=n;continue}if(b&&b.originP1===b.originP2&&(e=b.p0),n.defined)m||(t.lineTo(e.x+o,e.y+a,l),m=!m);else{const{originP1:i,originP2:r}=n;let h;if(i&&!1!==i.defined?h=e:i&&!1!==r.defined&&(h=null!==(s=n.p3)&&void 0!==s?s:n.p1),m){m=!m;const e=h?h.x:n.p0.x,i=h?h.y:n.p0.y;t.moveTo(e+o,i+a,l)}else h&&(m=!m,t.lineTo(h.x+o,h.y+a,l))}b=n}else{if(!n.defined){f=!0;continue}f&&t.moveTo(n.p0.x+o,n.p0.y+a,l),uA(t,n,k(h,1),r),f=!1}}}function uA(t,e,n,i){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};if(1===n)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[i]=Kp(e,n);t.bezierCurveTo(r+i.p1.x,s+i.p1.y,r+i.p2.x,s+i.p2.y,r+i.p3.x,s+i.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,s+i.y,o)}}hA=lA([np()],hA);var dA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let fA=class extends hA{constructor(){super(...arguments),this.numberType=Nb}draw(t,e,n,i){const{context:r}=n;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).line,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&XS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,f,p,g){var y,v,m,b,x;if(!e)return;t.beginPath();const w=null!==(y=this.z)&&void 0!==y?y:0;cA(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:w}),f.cache&&!d(f.cache)&&f.attribute.curveType&&f.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(f,o,a);const{x:S=0,x:A=0}=o;!1!==n&&(p?p(t,o,a):r&&(t.setCommonStyle(f,o,S-c,A-u,a),t.fill())),!1!==i&&(g?g(t,o,a):s&&(t.setStrokeStyle(f,o,S-c,A-u,a),t.stroke()));let{connectedType:_,connectedX:B,connectedY:T,connectedStyle:C}=o;if(d(a)?(_=null!==(v=null!=_?_:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,B=null!==(m=null!=B?B:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,T=null!==(b=null!=T?T:a[0].connectedY)&&void 0!==b?b:a[1].connectedY,C=null!==(x=null!=C?C:a[0].connectedStyle)&&void 0!==x?x:a[1].connectedStyle):(_=null!=_?_:a.connectedType,B=null!=B?B:a.connectedX,T=null!=T?T:a.connectedY,C=null!=C?C:a.connectedStyle),"connect"!==_&&"zero"!==_&&(_="none"),"none"!==_){t.beginPath(),cA(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:w,drawConnect:!0,mode:_,zeroX:B,zeroY:T});const y=[];d(a)?a.forEach((t=>y.push(t))):y.push(a),y.push(o),!1!==n&&(p?p(t,o,a):r&&(t.setCommonStyle(f,C,S-c,A-u,y),t.fill())),!1!==i&&(g?g(t,o,a):s&&(t.setStrokeStyle(f,C,S-c,A-u,y),t.stroke()))}return!1}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).line,{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:p=l.lineWidth,visible:g=l.visible}=t.attribute,y=vx(u,d,h),v=bx(u,f),m=gx(h),b=yx(c,p);if(!t.valid||!g)return;if(!m&&!b)return;if(!(y||v||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:n,closePath:i}=t.attribute;let{curveType:r=l.curveType}=t.attribute;i&&"linear"===r&&(r="linearClosed");const s=e;if(n&&n.length){let e,i;if(t.cache=n.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===n?e={x:i.endX,y:i.endY,defined:i.curves[i.curves.length-1].defined}:n>1&&(e.x=i.endX,e.y=i.endY,e.defined=i.curves[i.curves.length-1].defined);const s=xg(t.points,r,{startPoint:e});return i=s,s})).filter((t=>!!t)),"linearClosed"===r){let e;for(let n=0;n<t.cache.length;n++){const i=t.cache[n];for(let t=0;t<i.curves.length;t++)if(i.curves[t].defined){e=i.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=xg(s,r)}t.clearUpdateShapeTag()}const{clipRange:x=l.clipRange,clipRangeByDimension:w=l.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let s=!1;t.cache.forEach(((u,p)=>{s||(s=this.drawSegmentItem(e,u,!!h,!!c,d,f,r[p],[l,t.attribute],x,w,n,i,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),u=x*s;let p=0,g=!1;t.cache.forEach(((s,y)=>{if(g)return;const v=s.getLength(),m=(u-p)/v;p+=v,m>0&&(g=this.drawSegmentItem(e,s,!!h,!!c,d,f,r[y],[l,t.attribute],k(m,1),w,n,i,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,d,f,t.attribute,l,x,w,n,i,t,o,a)}};function pA(t,e,n,i){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=i||{};let l=e[0];t.moveTo(l.p0.x+r,l.p0.y+s,o),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+r,h.y+s,o),l=n[n.length-1],t.lineTo(l.p0.x+r,l.p0.y+s,o),l=n[0],h=l.p3||l.p1,t.lineTo(h.x+r,h.y+s,o),t.closePath()}function gA(t,e,n,i){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),yA(t,e,1,i),a=!1):a=!0})),a=!0;for(let e=n.length-1;e>=0;e--){const l=n[e];l.defined?(a&&t.lineTo(l.p0.x+r,l.p0.y+s,o),yA(t,l,1,i),a=!1):a=!0}t.closePath()}function yA(t,e,n,i){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};if(1===n)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[i]=Kp(e,n);t.bezierCurveTo(r+i.p1.x,s+i.p1.y,r+i.p2.x,s+i.p2.y,r+i.p3.x,s+i.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,s+i.y,o)}}fA=dA([np()],fA);var vA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bA=function(t,e){return function(n,i){e(n,i,t)}};function xA(t,e,n){switch(e){case"linear":default:return rg(t,n);case"basis":return ag(t,n);case"monotoneX":return pg(t,n);case"monotoneY":return gg(t,n);case"step":return vg(t,.5,n);case"stepBefore":return vg(t,0,n);case"stepAfter":return vg(t,1,n);case"linearClosed":return bg(t,n)}}let wA=class{constructor(t){this.areaRenderContribitions=t,this.numberType=kb}drawShape(t,e,n,i,r,s,o,a){var l,h,c,u,d,f;const p=ev(t,null==s?void 0:s.theme).area,{fill:g=p.fill,fillOpacity:y=p.fillOpacity,opacity:v=p.opacity,visible:m=p.visible,z:b=p.z,background:x,stroke:w=t.attribute.stroke,lineWidth:S=p.lineWidth,strokeOpacity:A=p.strokeOpacity}=t.attribute,_=vx(v,y,g),B=gx(g,x),T=yx(w,S),C=bx(v,A);if(!t.valid||!m)return;if(!B&&!T)return;if(!(_||o||C||a))return;const{clipRange:P=p.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:n,curveType:i=p.curveType}=t.attribute;if(n&&n.length){let e,r;const s=n.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(r={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:r.endX,y:r.endY}:n>1&&(e.x=r.endX,e.y=r.endY);const s=xA(t.points,i,{startPoint:e});return r=s,s})).filter((t=>!!t));let o;const a=[];for(let t=n.length-1;t>=0;t--){const e=n[t].points,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=n[t-1].points,i=e[e.length-1];i&&r.push({x:null!==(c=i.x1)&&void 0!==c?c:i.x,y:null!==(u=i.y1)&&void 0!==u?u:i.y})}o=xA(r,"stepBefore"===i?"stepAfter":"stepAfter"===i?"stepBefore":i),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 n=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!==(f=e[t].y1)&&void 0!==f?f:e[t].y});const s=xA(n,i),o=xA(r,"stepBefore"===i?"stepAfter":"stepAfter"===i?"stepBefore":i);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===P){let l=!1;t.cacheArea.forEach(((h,c)=>{l||(l=this.drawSegmentItem(e,h,B,y,T,A,s[c],[p,t.attribute],P,n,i,b,t,r,o,a))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=P*l;let c=0,u=!1;t.cacheArea.forEach(((l,d)=>{if(u)return;const f=l.top.getLength(),g=(h-c)/f;c+=f,g>0&&(u=this.drawSegmentItem(e,l,B,y,T,A,s[d],[p,t.attribute],k(g,1),n,i,b,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,B,y,T,A,t.attribute,p,P,n,i,b,t,r,o,a)}draw(t,e,n,i){const{context:r}=n,s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p,g){let y=!1;return y=y||this._drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,!1,p,g),y=y||this._drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,!0,p,g),y}_drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,f,p,g,y,v){var m,b,x,w;let{connectedType:S,connectedX:A,connectedY:_,connectedStyle:B}=o;const T=[];if(g&&(d(a)?(S=null!==(m=null!=S?S:a[0].connectedType)&&void 0!==m?m:a[1].connectedType,A=null!==(b=null!=A?A:a[0].connectedX)&&void 0!==b?b:a[1].connectedX,_=null!==(x=null!=_?_:a[0].connectedY)&&void 0!==x?x:a[1].connectedY,B=null!==(w=null!=B?B:a[0].connectedStyle)&&void 0!==w?w:a[1].connectedStyle):(S=null!=S?S:a.connectedType,A=null!=A?A:a.connectedX,_=null!=_?_:a.connectedY,B=null!=B?B:a.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),d(a)?a.forEach((t=>T.push(t))):T.push(a),T.push(o)),g&&"none"===S)return!1;if(!e)return;t.beginPath();const{points:C,segments:P}=f.attribute;let O,M,E=Wp.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],O=t.points[t.points.length-1]}else M=C[0],O=C[C.length-1];E=R(O.x-M.x)>R(O.y-M.y)?Wp.ROW:Wp.COLUMN,function(t,e,n,i){var r;const{drawConnect:s=!1,mode:o="none"}=i||{};if(s&&"none"===o)return;const{top:a,bottom:l}=e;if(n>=1){const e=[],n=[];let r=!0;if(s){let r,s,o=!0;const h=a.curves.length;a.curves.forEach(((a,c)=>{const u=l.curves[h-c-1];let d=a,f=u;if(a.originP1===a.originP2)return r=a,void(s=u);if(r&&r.originP1===r.originP2&&(d=r,f=s),a.defined)o||(e.push(d),n.push(f),pA(t,e,n,i),e.length=0,n.length=0,o=!o);else{const{originP1:r,originP2:s}=a;let l,h;r&&!1!==r.defined?(l=d,h=f):r&&!1!==s.defined&&(l=a,h=u),o?(o=!o,e.push(l||a),n.push(h||u)):l&&(o=!o,e.push(l||a),n.push(h||u),pA(t,e,n,i),e.length=0,n.length=0)}r=a})),pA(t,e,n,i)}else{for(let s=0,o=a.curves.length;s<o;s++){const h=a.curves[s];r!==h.defined?(r?(gA(t,e,n,i),e.length=0,n.length=0):(e.push(h),n.push(l.curves[o-s-1])),r=!r):r&&(e.push(h),n.push(l.curves[o-s-1]))}gA(t,e,n,i)}return}if(n<=0)return;let{direction:h}=i||{};const{curves:c}=a,u=null!==(r=c[c.length-1].p3)&&void 0!==r?r:c[c.length-1].p1,d=R(u.x-c[0].p0.x),f=R(u.y-c[0].p0.y);h=null!=h?h:d>f?Wp.ROW:Wp.COLUMN,Number.isFinite(d)||(h=Wp.COLUMN),Number.isFinite(f)||(h=Wp.ROW);const p=n*(h===Wp.ROW?d:f);let g=0,y=!0;const v=[],m=[];let b,x,w=!0;for(let e=0,n=a.curves.length;e<n;e++){const r=a.curves[e],o=r.getLength(h),c=(p-g)/o;if(c<0)break;if(g+=o,s){const s=l.curves[n-e-1];let o=r,a=s;if(r.originP1===r.originP2){b=r,x=s;continue}if(b&&b.originP1===b.originP2&&(o=b,a=x),r.defined)w||(v.push(o),m.push(a),pA(t,v,m,i),v.length=0,m.length=0,w=!w);else{const{originP1:e,originP2:n}=r;let l,h;e&&!1!==e.defined?(l=o,h=a):e&&!1!==n.defined&&(l=r,h=s),w?(w=!w,v.push(l||r),m.push(h||s)):l&&(w=!w,v.push(l||r),m.push(h||s),pA(t,v,m,i),v.length=0,m.length=0)}b=r}else{let s=null,o=null;y!==r.defined?(y?(gA(t,v,m,i),v.length=0,m.length=0):(s=r,o=l.curves[n-e-1]),y=!y):y&&(s=r,o=l.curves[n-e-1]),s&&o&&(c<1&&(s=s.p2&&s.p3?Kp(s,c)[0]:Jp(s,c)[0],o=o.p2&&o.p3?Kp(o,1-c)[1]:Jp(o,1-c)[1]),s.defined=y,o.defined=y,v.push(s),m.push(o)),s=null,o=null}}s?pA(t,v,m,i):gA(t,v,m,i)}(t.camera?t:t.nativeContext,e,l,{offsetX:h,offsetY:c,offsetZ:u,direction:E,drawConnect:g,mode:S,zeroX:A,zeroY:_}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((e=>{e.time===Up.beforeFillStroke&&e.drawShape(f,t,h,c,!!i,!1,n,!1,a,p,y,null,{attribute:o})})),t.setShadowStyle&&t.setShadowStyle(f,o,a);const{x:k=0,x:I=0}=o;if(!1!==n&&(y?y(t,o,a):i&&(t.setCommonStyle(f,g?B:o,k-h,I-c,g?T:a),t.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((e=>{e.time===Up.afterFillStroke&&e.drawShape(f,t,h,c,!!i,!1,n,!1,a,p,y,null,{attribute:o})})),!1!==r)if(v)v(t,o,a);else{const{stroke:n=a&&a[1]&&a[1].stroke}=o;d(n)&&(n[0]||n[2])&&!1===n[1]&&(t.beginPath(),cA(t.camera?t:t.nativeContext,n[0]?e.top:e.bottom,l,E===Wp.ROW?"x":"y",{offsetX:h,offsetY:c,offsetZ:u,drawConnect:g,mode:S,zeroX:A,zeroY:_})),t.setStrokeStyle(f,g?B:o,k-h,I-c,g?T:a),t.stroke()}return!1}};wA=vA([np(),bA(0,sp(cp)),bA(0,ip(Ox)),mA("design:paramtypes",[Object])],wA);var SA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},AA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_A=function(t,e){return function(n,i){e(n,i,t)}};let BA=class extends hA{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Wb}drawShape(t,e,n,i,r,s,o,a){var l,h;const c=ev(t,null==s?void 0:s.theme).path,{fill:u=c.fill,stroke:d=c.stroke,fillOpacity:f=c.fillOpacity,strokeOpacity:p=c.strokeOpacity,opacity:g=c.opacity,background:y,lineWidth:v=c.lineWidth,visible:m=c.visible,x:b=c.x,y:x=c.y}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0,S=vx(g,f,u),A=bx(g,p),_=gx(u,y),B=yx(d,v);if(t.valid&&m&&(_||B)&&(S||A||o||a||y)){if(e.beginPath(),t.pathShape)Gp(t.pathShape.commandList,e,n,i,1,1,w);else{Gp((null!==(h=t.attribute.path)&&void 0!==h?h:c.path).commandList,e,n,i,1,1,w)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,c,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,c),B&&(a?a(e,t.attribute,c):A&&(e.setStrokeStyle(t,t.attribute,b-n,x-i,c),e.stroke())),_&&(o?o(e,t.attribute,c):S&&(e.setCommonStyle(t,t.attribute,b-n,x-i,c),e.fill())),this._pathRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,c,r,o,a)}))}}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).path,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&XS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}};BA=SA([np(),_A(0,sp(cp)),_A(0,ip(Ix)),AA("design:paramtypes",[Object])],BA);const TA=B/2;function CA(t,e,n,i,r,s){let o;if(g(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(i<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,n,i,r);const[a,l,h,c]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],u=Math.min(i/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],f=[a[0]+d[0],a[1]],p=[a[0],a[1]+d[0]],y=[l[0]-d[1],l[1]],v=[l[0],l[1]+d[1]],m=[h[0]-d[2],h[1]],b=[h[0],h[1]-d[2]],x=[c[0]+d[3],c[1]],w=[c[0],c[1]-d[3]];if(t.moveTo(f[0],f[1]),t.lineTo(y[0],y[1]),!A(y,v)){const e=y[0],n=y[1]+d[1];t.arc(e,n,d[1],-TA,0,!1)}if(t.lineTo(b[0],b[1]),!A(m,b)){const e=b[0]-d[2],n=b[1];t.arc(e,n,d[2],0,TA,!1)}if(t.lineTo(x[0],x[1]),!A(x,w)){const e=x[0],n=x[1]-d[3];t.arc(e,n,d[3],TA,B,!1)}if(t.lineTo(p[0],p[1]),!A(f,p)){const e=f[0],n=f[1]+d[0];t.arc(e,n,d[0],B,B+TA,!1)}return t.closePath(),t}var PA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},RA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},OA=function(t,e){return function(n,i){e(n,i,t)}};let MA=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=zb}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).rect,{fill:h=l.fill,background:c,stroke:u=l.stroke,width:f=l.width,height:p=l.height,cornerRadius:g=l.cornerRadius,opacity:y=l.opacity,fillOpacity:v=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:S=l.y}=t.attribute,A=mx(y,v,f,p,h),_=xx(y,b,f,p),B=gx(h,c),T=yx(u,m);if(!t.valid||!x)return;if(!B&&!T)return;if(!(A||_||o||a||c))return;0===g||d(g)&&g.every((t=>0===t))?(e.beginPath(),e.rect(n,i,f,p)):(e.beginPath(),CA(e,n,i,f,p,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const C={doFill:B,doStroke:T};this._rectRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a,C)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),C.doFill&&(o?o(e,t.attribute,l):A&&(e.setCommonStyle(t,t.attribute,w-n,S-i,l),e.fill())),C.doStroke&&(a?a(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,w-n,S-i,l),e.stroke())),this._rectRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};MA=PA([np(),OA(0,sp(cp)),OA(0,ip(Dx)),RA("design:paramtypes",[Object])],MA);var EA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IA=function(t,e){return function(n,i){e(n,i,t)}};let jA=class extends hA{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Gb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).symbol,{size:c=h.size,fill:u=h.fill,background:d,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,opacity:g=h.opacity,lineWidth:y=h.lineWidth,stroke:v=h.stroke,visible:m=h.visible,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:S=h.scaleY}=t.attribute,A=vx(g,f,u),_=bx(g,p),B=gx(u,d),T=yx(v,y);if(!t.valid||!m)return;if(!B&&!T)return;if(!(A||_||o||a||d))return;const C=t.getParsedPath();if(!C)return;const{keepDirIn3d:P=h.keepDirIn3d}=t.attribute,R=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),P&&e.camera&&e.project){const r=e.project(n,i,R),s=e.camera;e.camera=null,!1===C.draw(e,c,r.x,r.y,void 0,((r,s)=>{s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,b-n,x-i),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(b-n)/w,(x-i)/S),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===C.draw(e,c,n,i,R,((r,s)=>{s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,b-n,x-i),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(b-n)/w,(x-i)/S),e.stroke()))}))&&e.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,h,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),B&&!C.isSvg&&(o?o(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,b-n,x-i,h),e.fill())),T&&!C.isSvg&&(a?a(e,t.attribute,h):_&&(e.setStrokeStyle(t,t.attribute,(b-n)/w,(x-i)/S,h),e.stroke())),this._symbolRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,h,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).symbol,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&XS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}};jA=EA([np(),IA(0,sp(cp)),IA(0,ip(Lx)),kA("design:paramtypes",[Object])],jA);var DA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NA=function(t,e){return function(n,i){e(n,i,t)}};let WA=class extends hA{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Xb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).text,{text:c,fill:u=h.fill,stroke:d=h.stroke,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,opacity:g=h.opacity,lineWidth:y=h.lineWidth,visible:v=h.visible,underline:m=h.underline,lineThrough:b=h.lineThrough,keepDirIn3d:x=h.keepDirIn3d,direction:w=h.direction,fontSize:S=h.fontSize,textBaseline:A=h.textBaseline,textAlign:_=h.textAlign,x:B=h.x,y:T=h.y}=t.attribute,C=null!==(l=t.attribute.lineHeight)&&void 0!==l?l:S,P=vx(g,f,u),R=bx(g,p),O=gx(u),M=yx(d,y);if(!t.valid||!v)return;if(!(O||M||P||R))return;const k=!x,I=this.z||0;if(e.beginPath(),!this._textBeforeRenderContribitions){const t=this.textRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],t.forEach((t=>{t.time===Up.beforeFillStroke?this._textBeforeRenderContribitions.push(t):this._textAfterRenderContribitions.push(t)}))}this._textBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,O,M,P,R,h,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),k&&this.transformUseContext2d(t,h,I,e);const j=(r,s,l,c)=>{let u=n+s;const d=i+l;if(c){e.highPerformanceSave(),u+=S;const t=GS.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),GS.free(t)}M&&(a?a(e,t.attribute,h):R&&(e.setStrokeStyle(t,t.attribute,B-n,T-i,h),e.strokeText(r,u,d,I))),O&&(o?o(e,t.attribute,h):P&&(e.setCommonStyle(t,t.attribute,B-n,T-i,h),e.fillText(r,u,d,I),this.drawUnderLine(m,b,t,u,d,I,h,e))),c&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(Array.isArray(c))if(e.setTextStyleWithoutAlignBaseline(t.attribute,h,I),"horizontal"===w){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;M&&(a?a(e,t.attribute,h):R&&(e.setStrokeStyle(t,t.attribute,B-n,T-i,h),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,I)})))),O&&(o?o(e,t.attribute,h):P&&(e.setCommonStyle(t,t.attribute,B-n,T-i,h),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,I),this.drawMultiUnderLine(m,b,t,(r.leftOffset||0)+n,(r.topOffset||0)+l+i,I,r.width,h,e)}))))}else{const n=t.cache,{verticalList:i}=n;e.textAlign="left",e.textBaseline="top";const r=C*i.length;let s=0;i.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=E(e,s)}));let o=0,a=0;"bottom"===A?a=-r:"middle"===A&&(a=-r/2),"center"===_?o-=s/2:"right"===_&&(o-=s),i.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),i=s-n;let l=o;"center"===_?l+=i/2:"right"===_&&(l+=i),t.forEach((t=>{const{text:n,width:i,direction:s}=t;j(n,r-(e+1)*C+a,l,s),l+=i}))}))}else{const n=t.cache;if("horizontal"===w){e.setTextStyle(t.attribute,h,I);const n=t.clipedText;let i=0;C!==S&&("top"===A?i=(C-S)/2:"middle"===A||"bottom"===A&&(i=-(C-S)/2)),j(n,0,i,0)}else if(n){e.setTextStyleWithoutAlignBaseline(t.attribute,h,I);const{verticalList:i}=n;let r=0;const s=i[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===A?o=-C:"middle"===A&&(o=-C/2),"center"===_?r-=s/2:"right"===_&&(r-=s),e.textAlign="left",e.textBaseline="top",i[0].forEach((t=>{const{text:e,width:n,direction:i}=t;j(e,o,r,i),r+=n}))}}k&&this.restoreTransformUseContext2d(t,h,I,e),this._textAfterRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,O,M,P,R,h,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,r,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawShape(t,r,h,c,n,i),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,n,i,r,s,o,a){if(e+t<=0)return;const{textAlign:l=o.textAlign,textBaseline:h=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:f=o.fillOpacity}=n.attribute,p=n.clipedWidth,g=Zx(l,p),y=Jx(h,c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:f};if(t){v.lineWidth=t,a.setStrokeStyle(n,v,i,r,o),a.beginPath();const e=r+y+c;a.moveTo(i+g,e,s),a.lineTo(i+g+p,e,s),a.stroke()}if(e){v.lineWidth=e,a.setStrokeStyle(n,v,i,r,o),a.beginPath();const t=r+y+c/2;a.moveTo(i+g,t,s),a.lineTo(i+g+p,t,s),a.stroke()}}drawMultiUnderLine(t,e,n,i,r,s,o,a,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:f=a.fillOpacity}=n.attribute,p=Zx(h,o),g=Jx("alphabetic",c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:f};let v=-3;if(t){y.lineWidth=t,l.setStrokeStyle(n,y,i,r,a),l.beginPath();const e=r+g+c+v;l.moveTo(i+p,e,s),l.lineTo(i+p+o,e,s),l.stroke()}if(v=-1,e){y.lineWidth=e,l.setStrokeStyle(n,y,i,r,a),l.beginPath();const t=r+g+c/2+v;l.moveTo(i+p,t,s),l.lineTo(i+p+o,t,s),l.stroke()}}};WA=DA([np(),NA(0,sp(cp)),NA(0,ip(Nx)),LA("design:paramtypes",[Object])],WA);var FA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let UA=class{};function zA(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function HA(t,e){return Math.sqrt(t*t+e*e)}function VA(t,e,n,i,r){const s=e/n;return{x:t.x-i*s,y:t.y-r*s}}UA=FA([np()],UA);var GA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},XA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},YA=function(t,e){return function(n,i){e(n,i,t)}};let qA=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=Fb}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).polygon,{points:h=l.points,fill:c=l.fill,stroke:u=l.stroke,cornerRadius:f=l.cornerRadius,fillOpacity:p=l.fillOpacity,background:g,strokeOpacity:y=l.strokeOpacity,lineWidth:v=l.lineWidth,opacity:m=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y}=t.attribute,S=vx(m,p,c),A=bx(m,y),_=gx(c,g),B=yx(u,v);t.valid&&b&&(_||B)&&(S||A||o||a||g)&&(e.beginPath(),f<=0||d(f)&&f.every((t=>0===t))?zA(e.camera?e:e.nativeContext,h,n,i):function(t,e,n,i,r){var s;if(e.length<3)zA(t,e,n,i);else for(let o=0;o<e.length;o++){const a=e[o],l=e[(o+1)%e.length],h=e[(o+2)%e.length],c=l.x-a.x,u=l.y-a.y,d=l.x-h.x,f=l.y-h.y,p=(Math.atan2(u,c)-Math.atan2(f,d))/2,g=Math.abs(Math.tan(p));let y=Array.isArray(r)?null!==(s=r[(o+1)%e.length])&&void 0!==s?s:0:r,v=y/g;const m=HA(c,u),b=HA(d,f),x=Math.min(m,b);v>x&&(v=x,y=x*g);const w=VA(l,v,m,c,u),S=VA(l,v,b,d,f),A=2*l.x-w.x-S.x,_=2*l.y-w.y-S.y,B=HA(A,_),T=VA(l,HA(v,y),B,A,_);let C=Math.atan2(w.y-T.y,w.x-T.x);const P=Math.atan2(S.y-T.y,S.x-T.x);let R=P-C;R<0&&(C=P,R=-R),R>Math.PI&&(R-=Math.PI),0===o?t.moveTo(w.x+n,w.y+i):t.lineTo(w.x+n,w.y+i),R&&t.arcTo(l.x+n,l.y+i,S.x+n,S.y+i,y),t.lineTo(S.x+n,S.y+i)}}(e.camera?e:e.nativeContext,h,n,i,f),e.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):p&&(e.setCommonStyle(t,t.attribute,x-n,w-i,l),e.fill())),B&&(a?a(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,x-n,w-i,l),e.stroke())),this._polygonRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};qA=GA([np(),YA(0,sp(cp)),YA(0,ip(jx)),XA("design:paramtypes",[Object])],qA);var $A=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},KA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ZA=function(t,e){return function(n,i){e(n,i,t)}};const JA=["","repeat-x","repeat-y","repeat"];let QA=class{constructor(t){this.imageRenderContribitions=t,this.numberType=Lb}drawShape(t,e,n,i,r,s,o){const a=ev(t).image,{fill:l=a.fill,width:h=a.width,height:c=a.height,opacity:u=a.opacity,fillOpacity:f=a.fillOpacity,visible:p=a.visible,repeatX:g=a.repeatX,repeatY:y=a.repeatY,cornerRadius:v=a.cornerRadius,image:m}=t.attribute,b=vx(u,f,l),x=gx(l);if(t.valid&&p&&x&&(b||o)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,x,!1,b,!1,a,r,o)})),e.setShadowStyle&&e.setShadowStyle(t,a),x)if(o)o(e,t.attribute,a);else if(b){if(!m||!t.resources)return;const r=t.resources.get(m);if("success"!==r.state)return;let s=!1;0===v||d(v)&&v.every((t=>0===t))||(e.beginPath(),CA(e,n,i,h,c,v),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,n,i,a);let o=0;if("repeat"===g&&(o|=1),"repeat"===y&&(o|=2),o){const t=e.createPattern(r.data,JA[o]);e.fillStyle=t,e.fillRect(n,i,h,c)}else e.drawImage(r.data,n,i,h,c);s&&e.restore()}this._imageRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,x,!1,b,!1,a,r,o)}))}}draw(t,e,n){const{context:i}=e.drawParams;if(!i)return;const r=ev(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(a&&t.resources&&"success"===t.resources.get(a).state){if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,o,n),i.highPerformanceRestore()}}};QA=$A([np(),ZA(0,sp(cp)),ZA(0,ip(kx)),KA("design:paramtypes",[Object])],QA);const t_=Symbol.for("IncrementalDrawContribution"),e_=Symbol.for("ArcRender"),n_=Symbol.for("Arc3dRender"),i_=Symbol.for("AreaRender"),r_=Symbol.for("CircleRender"),s_=Symbol.for("GraphicRender"),o_=Symbol.for("GroupRender"),a_=Symbol.for("LineRender"),l_=Symbol.for("PathRender"),h_=Symbol.for("PolygonRender"),c_=Symbol.for("RectRender"),u_=Symbol.for("Rect3DRender"),d_=Symbol.for("SymbolRender"),f_=Symbol.for("TextRender"),p_=Symbol.for("RichTextRender"),g_=Symbol.for("Pyramid3dRender"),y_=Symbol.for("GlyphRender"),v_=Symbol.for("ImageRender"),m_=Symbol.for("RenderSelector"),b_=Symbol.for("DrawContribution");function x_(t,e,n){let i=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(a)*Math.sqrt(o*o+a*a);return l+h===0?0:(i=i/Math.abs(l+h)*2*n,i)}function w_(t,e,n,i,r){if(!e||!0===e)return"black";let s,o;if(d(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,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l;const h=n.AABBBounds;if(!h)return;let c=h.x2-h.x1,u=h.y2-h.y1,d=h.x1-i,f=h.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,f/=e}const p=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,f+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,f+(null!==(l=e.y1)&&void 0!==l?l:0)*u);return e.stops.forEach((t=>{p.addColorStop(t.offset,t.color)})),p}(t,o,n,i,r):"conical"===o.gradient?s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o;const a=n.AABBBounds;if(!a)return;let l=a.x2-a.x1,h=a.y2-a.y1,c=a.x1-i,u=a.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;l/=t,h/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*l,u+(null!==(o=e.y)&&void 0!==o?o:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(l+c,h+u,void 0)}(t,o,n,i,r):"radial"===o.gradient&&(s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l,h,c;const u=n.AABBBounds;if(!u)return;let d=u.x2-u.x1,f=u.y2-u.y1,p=u.x1-i,g=u.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;p/=t,g/=e,d/=t,f/=e}const y=t.createRadialGradient(p+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*f,Math.max(d,f)*(null!==(a=e.r0)&&void 0!==a?a:0),p+(null!==(l=e.x1)&&void 0!==l?l:.5)*d,g+(null!==(h=e.y1)&&void 0!==h?h:.5)*f,Math.max(d,f)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{y.addColorStop(t.offset,t.color)})),y}(t,o,n,i,r)),s||"orange")}const S_=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return uy(Object.assign({nativeCanvas:Yg.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 uy(Object.assign({nativeCanvas:Yg.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(){this.pools=[]}};var A_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},__=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},B_=function(t,e){return function(n,i){e(n,i,t)}};let T_=class{constructor(){this.time=Up.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){const{background:f}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=ev(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),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,n,i,l),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}};T_=A_([np()],T_);let C_=class{constructor(t){this.subRenderContribitions=t,this.time=Up.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,o,a,l,h,c,u,d)}))}};C_=A_([np(),B_(0,sp(cp)),B_(0,ip(Wx)),__("design:paramtypes",[Object])],C_);let P_=class{constructor(){this.time=Up.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,o=S_.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 l=i.createPattern(o.nativeCanvas,"repeat");return S_.free(o),l}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,P),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:y=l.texturePadding}=t.attribute;if(!f)return;let v=this.textureMap.get(f);if(!v)switch(f){case"circle":v=this.createCirclePattern(g,y,p,e);break;case"diamond":v=this.createDiamondPattern(g,y,p,e);break;case"rect":v=this.createRectPattern(g,y,p,e);break;case"vertical-line":v=this.createVerticalLinePattern(g,y,p,e);break;case"horizontal-line":v=this.createHorizontalLinePattern(g,y,p,e);break;case"bias-lr":v=this.createBiasLRLinePattern(g,y,p,e);break;case"bias-rl":v=this.createBiasRLLinePattern(g,y,p,e);break;case"grid":v=this.createGridPattern(g,y,p,e)}v&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=v,e.fill(),e.highPerformanceRestore())}};P_=A_([np()],P_);var R_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let O_=class{constructor(){this.time=Up.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{innerRadius:y=l.innerRadius,outerRadius:v=l.outerRadius,startAngle:m=l.startAngle,endAngle:b=l.endAngle,opacity:x=l.opacity,x:w=l.x,y:S=l.y,scaleX:A=l.scaleX,scaleY:_=l.scaleY}=t.attribute,B=!(!d||!d.stroke),T=!(!f||!f.stroke);if(p){const{distance:r=l.outerBorder.distance}=d,s=x_(e,r,e.dpr),o=r/v;if(t.setAttributes({outerRadius:v+s,innerRadius:y-s,startAngle:m-o,endAngle:b+o}),e.beginPath(),Bx(t,e,n,i,v+s,y-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(B){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-n)/A,(S-i)/_,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=f,s=x_(e,r,e.dpr),o=r/v;if(t.setAttributes({outerRadius:v-s,innerRadius:y+s,startAngle:m+o,endAngle:b-o}),e.beginPath(),Bx(t,e,n,i,v-s,y+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,f,(w-n)/A,(S-i)/_,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:v,innerRadius:y,startAngle:m,endAngle:b})}};O_=R_([np()],O_);let M_=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}};M_=R_([np()],M_);let E_=class extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}};E_=R_([np()],E_);var k_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let I_=class{constructor(){this.time=Up.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{radius:y=l.radius,startAngle:v=l.startAngle,endAngle:m=l.endAngle,opacity:b=l.opacity,x:x=l.x,y:w=l.y,scaleX:S=l.scaleX,scaleY:A=l.scaleY}=t.attribute,_=!(!d||!d.stroke),B=!(!f||!f.stroke);if(p){const{distance:r=l.outerBorder.distance}=d,s=x_(e,r,e.dpr);if(e.beginPath(),e.arc(n,i,y+s,v,m),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(_){const r=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-n)/S,(w-i)/A,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=f,s=x_(e,r,e.dpr);if(e.beginPath(),e.arc(n,i,y-s,v,m),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(B){const r=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,f,(x-n)/S,(w-i)/A,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};I_=k_([np()],I_);let j_=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}};j_=k_([np()],j_);let D_=class extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}};D_=k_([np()],D_);var L_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let N_=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const n=t.resources.get(d);if("success"!==n.state||!n.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const i=t.AABBBounds;e.drawImage(n.data,i.x1,i.y1,i.width(),i.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}};N_=L_([np()],N_);var W_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let F_=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,u,d){const{background:f,width:p,height:y}=t.attribute;if(f)if(t.backgroundImg){const n=t.resources.get(f);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=ev(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}const i=t.AABBBounds;e.drawImage(n.data,i.x1,i.y1,i.width(),i.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(c(f)){const{stroke:n,fill:i,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=f;if(!n&&!i)return;e.beginPath();const{x:l,y:h,width:c,height:u}=function(t){const e=Tv(t.attribute.boundsPadding),n=t.AABBBounds;let i=n.x1,r=n.y1,s=n.width(),o=n.height();return g(e)?(i+=e,r+=e,s-=2*e,o-=2*e):(i+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]),{x:i,y:r,width:s,height:o}}(t);s?CA(e,l-o,h-a,c+2*o,u+2*a,s):e.rect(l-o,h-a,c+2*o,u+2*a),e.globalAlpha=1,i&&(e.fillStyle=i,e.fill()),n&&r>0&&(e.lineWidth=r,e.strokeStyle=n,e.stroke())}else{e.beginPath();const r=t.AABBBounds;e.rect(n,i,r.width(),r.height()),e.fillStyle=f,e.globalAlpha=1,e.fill()}}};F_=W_([np()],F_);var U_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let z_=class{constructor(){this.time=Up.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,y=p&&!1!==p.visible;if(!g&&!y)return;const{width:v=l.width,height:m=l.height,cornerRadius:b=l.cornerRadius,opacity:x=l.opacity,x:w=l.x,y:S=l.y,scaleX:A=l.scaleX,scaleY:_=l.scaleY}=t.attribute,B=!(!f||!f.stroke),T=!(!p||!p.stroke);if(g){const{distance:r=l.outerBorder.distance}=f,s=x_(e,r,e.dpr),o=n-s,a=i-s,h=2*s;if(0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v+h,m+h)):(e.beginPath(),CA(e,o,a,v+h,m+h,b)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.outerBorder);else if(B){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,f,(w-n)/A,(S-i)/_,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=l.innerBorder.distance}=p,s=x_(e,r,e.dpr),o=n+s,a=i+s,h=2*s;if(0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v-h,m-h)):(e.beginPath(),CA(e,o,a,v-h,m-h,b)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-n)/A,(S-i)/_,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};z_=U_([np()],z_);let H_=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}};H_=U_([np()],H_);let V_=class extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}};V_=U_([np()],V_);let G_=class{constructor(){this.time=Up.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};G_=U_([np()],G_);let X_=class{constructor(){this.time=Up.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{width:d=l.width,height:f=l.height,stroke:p=l.stroke}=t.attribute;if(Array.isArray(p)&&p.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),p[0]?e.lineTo(n+d,i):e.moveTo(n+d,i),p[1]?e.lineTo(n+d,i+f):e.moveTo(n+d,i+f),p[2]?e.lineTo(n,i+f):e.moveTo(n,i+f),p[3]){const t=p[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};X_=U_([np()],X_);var Y_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let q_=class{constructor(){this.time=Up.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,y=p&&!1!==p.visible;if(!g&&!y)return;const{size:v=l.size,opacity:m=l.opacity,x:b=l.x,y:x=l.y,scaleX:w=l.scaleX,scaleY:S=l.scaleY}=t.attribute,A=!(!f||!f.stroke),_=!(!p||!p.stroke);if(g){const{distance:r=l.outerBorder.distance}=f,s=x_(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,v,n,i,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.outerBorder);else if(A){const r=l.outerBorder.opacity;l.outerBorder.opacity=m,e.setStrokeStyle(t,f,(b-n)/w,(x-i)/S,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=l.innerBorder.distance}=p,s=x_(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,v,n,i,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(_){const r=l.innerBorder.opacity;l.innerBorder.opacity=m,e.setStrokeStyle(t,p,(b-n)/w,(x-i)/S,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};q_=Y_([np()],q_);class $_ extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}}class K_ extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}}var Z_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},J_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Q_=function(t,e){return function(n,i){e(n,i,t)}};const tB=Symbol.for("RenderService");let eB=class{constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}};eB=Z_([np(),Q_(0,sp(b_)),J_("design:paramtypes",[Object])],eB);var nB=new Zf((t=>{t(eB).toSelf(),t(tB).toService(eB)})),iB=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};function rB(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s={},o=[];let a=!1;if(r)a=!0;else{let n;t.forEachChildren(((t,i)=>{const{zIndex:r=e}=t.attribute;if(0===i)n=r;else if(n!==r)return a=!0,!0;return!1}),i)}if(a){t.forEachChildren((t=>{const{zIndex:n=e}=t.attribute;s[n]?s[n].push(t):(s[n]=[t],o.push(n))}),i),o.sort(((t,e)=>i?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],l=s[e];r&&l.sort(((t,e)=>{var n,r;return(i?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<l.length;t++)if(n(l[t],t)){a=!0;break}}}else t.forEachChildren(n,i)}function sB(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return iB(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(n,i)}))}function oB(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:i=n}=t.attribute;if(0===e);else if(void 0!==i)return o=!0,!0;return!1}),i);let a=null,l=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=n}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),i),s.sort(((t,e)=>i?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const n=s[t],i=r[n];for(let t=0;t<i.length;t++){if(l){o=!0,a=i[t];break}i[t]._uid!==e||(l=!0)}}}else t.forEachChildren((t=>l?(a=t,!0):(t._uid===e&&(l=!0),!1)),i);return a}var aB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const lB=Symbol.for("PickItemInterceptor");let hB=class{constructor(){this.order=1}afterPickItem(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this._pickItem(t,e,n,i,r)}beforePickItem(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this._pickItem(t,e,n,i,r)}_pickItem(t,e,n,i,r){if(!t.shadowRoot)return!1;const{parentMatrix:s}=r||{};if(!s)return!1;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,l=GS.allocateByObj(s),h=new F(n.x,n.y);s.transformPoint(h,h);const c=t.transMatrix;l.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,h.clone(),l,i);return o.highPerformanceRestore(),u}};hB=aB([np()],hB);let cB=class{constructor(){this.order=1}beforePickItem(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(i.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,l=!1;if(t.forEachChildren((t=>(a=t.numberType===Eb,!a))),t.forEachChildren((t=>(l=!!t.findFace,!l))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var n,i,r,s;let o=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i: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+=P;for(;a<0;)a+=P;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",o=e.pickGroup(t,n,r.parentMatrix,i),o.graphic||(i.hack_pieFace="inside",o=e.pickGroup(t,n,r.parentMatrix,i)),o.graphic||(i.hack_pieFace="top",o=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(l){const a=t.getChildren(),l=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var n;return s.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));l.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),l.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),l.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,n,r.parentMatrix,i);return s.camera=null,i.in3dInterceptor=!1,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};cB=aB([np()],cB);var uB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fB=function(t,e){return function(n,i){e(n,i,t)}};const pB=Symbol.for("PickerService");let gB=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,n){let i={graphic:null,group:null};n.pickerService=this;let r=0,s=0;if(n&&n.bounds){if(!n.bounds.contains(e.x,e.y))return i;r=n.bounds.x1,s=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new Y(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(t[r].isContainer?i=this.pickGroup(t[r],e,o,n):i.graphic=this.pickItem(t[r],e,o,n),!i.graphic);r--)a||(a=i.group);if(i.graphic||(i.group=a),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){let t=i.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=t.shadowHost)}return i}containsPoint(t,e,n){return!!this.pickItem(t,e,null,n)}pickGroup(t,e,n,i){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=i.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,n=XS.allocate();if(ZS(n,e),o){if(n){const t=XS.allocate();s.modelMatrix=JS(t,o,n),XS.free(n)}}else ZS(n,t.globalTransMatrix),s.modelMatrix=n}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,i,{parentMatrix:n});if(r)return s.modelMatrix!==o&&XS.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,l=GS.allocateByObj(n),h=new F(e.x,e.y);l.transformPoint(h,h);const c=t.AABBBounds.containsPoint(h);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,h.clone(),n,i);u&&(r.graphic=u);const d=!1!==t.attribute.pickable&&c;return l.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u||rB(t,Mg.zIndex,(s=>{if(s.isContainer){const n=new F(e.x,e.y),o=ev(t).group,{scrollX:a=o.scrollX,scrollY:h=o.scrollY}=t.attribute;n.x-=a,n.y-=h,r=this.pickGroup(s,n,l,i)}else{const o=new F(e.x,e.y);l.transformPoint(o,o);const a=ev(t).group,{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=h,o.y-=c;const u=this.pickItem(s,o,n,i);r.graphic=u}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&XS.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),GS.free(l),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};gB=uB([np(),fB(0,sp(yp)),fB(1,sp(cp)),fB(1,ip(lB)),dB("design:paramtypes",[Object,Object])],gB);var yB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},vB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mB=function(t,e){return function(n,i){e(n,i,t)}};const bB=Symbol.for("GlobalPickerService");let xB=class{constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,n)=>{this.configure(n,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,n){let i={graphic:null,group:null};const r=new Y(1,0,0,1,0,0);let s;for(let o=0;o<t.length&&(t[o].isContainer?i=this.pickGroup(t[o],e,r,n):i.graphic=this.pickItem(t[o],e,r,n),!i.graphic);o++)s||(s=i.group);if(i.graphic||(i.group=s),i.graphic){let t=i.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=t.shadowHost)}return i}containsPoint(t,e,n){return!!this.pickItem(t,e,null,n)}pickGroup(t,e,n,i){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new F(e.x,e.y);n.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const l=!1!==t.attribute.pickable&&a;return n.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,n,i);else{const s=new F(e.x,e.y);n.transformPoint(s,s),r.graphic=this.pickItem(t,s,n,i)}return!!r.graphic||!!r.group})),r.graphic||r.group||!l||(r.group=t),r}pickItem(t,e,n,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}};function wB(t,e,n){const i=e[0],r=e[1],s=e[2];let o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*s+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*s+n[14])/o,t}xB=yB([np(),mB(0,sp(yp)),vB("design:paramtypes",[Object])],xB);var SB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},AB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const _B=[0,0,0],BB=new Y(1,0,0,1,0,0);let TB=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({},Bg),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Cg),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Pg),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new Y(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Y(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 Y(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return GS.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&&(GS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(GS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*n,a*i,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}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,n,i,r,s,o){if(o=o||0,this.camera){const a=[];((t,e,n,i,r,s,o,a)=>{if(a)for(;n>e;)n-=P;else for(;n<e;)n+=P;const l=B/3*(n>e?1:-1);let h=e,c=h;for(;c!==n;){c=l>0?Math.min(c+l,n):Math.max(c+l,n);const e=Math.abs(c-h),a=4*Math.tan(e/4)/3,u=c<h?-1:1,d=Math.cos(h),f=Math.sin(h),p=Math.cos(c),g=Math.sin(c),y=d*s+i,v=f*o+r,m=p*s+i,b=g*o+r,x=s*a*u,w=o*a*u;t.push([y-x*f,v+w*d,m+x*g,b-w*p,m,b]),h=c}})(a,i,r,t,e,n,n,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,n,i,r,s)}arcTo(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s,o){if(o=o||0,this.camera){let a=o,l=o;this.modelMatrix&&(wB(_B,[t,e,o],this.modelMatrix),t=_B[0],e=_B[1],a=_B[2],wB(_B,[n,i,o],this.modelMatrix),n=_B[0],i=_B[1],l=_B[2],wB(_B,[r,s,o],this.modelMatrix),r=_B[0],s=_B[1],o=_B[2]);let h=this.camera.vp(r,s,o);r=h.x,s=h.y,h=this.camera.vp(t,e,a),t=h.x,e=h.y,h=this.camera.vp(n,i,l),n=h.x,i=h.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,n,i,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,n,i,r,s,o):this.nativeContext.ellipse(t,e,n,i,r,s,o,a)}lineTo(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(wB(_B,[t,e,n],this.modelMatrix),t=_B[0],e=_B[1],n=_B[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(wB(_B,[t,e,n],this.modelMatrix),t=_B[0],e=_B[1],n=_B[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,n,i,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(wB(_B,[t,e,r],this.modelMatrix),t=_B[0],e=_B[1],s=_B[2],wB(_B,[n,i,r],this.modelMatrix),n=_B[0],i=_B[1],r=_B[2]);let o=this.camera.vp(n,i,r);n=o.x,i=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}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,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,n,i,r,s){return this.nativeContext.createRadialGradient(t,e,n,i,r,s)}createConicGradient(t,e,n,i){let r,s=!1;const o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,l,h){return s&&(h||(h=i-n),r=function(t,e,n,i,r,s,o,a,l){const h=Math.floor(180*r/Math.PI),c=Tx.GetCanvas(),u=Tx.GetCtx();if(!u)return null;const d=Px.GetSize(a),f=Px.GetSize(l);let p=Px.Get(e,n,i,s,o,d,f);if(p)return p;const g=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),y=h+1,v=r/Math.max(1,y-1),m=Cx.GetOrCreate(e,y),b=2*Math.PI*g/360;c.width=d,c.height=f,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,f),u.translate(n,i),u.rotate(s);for(let t=0,e=y-1;t<e&&!(s+t*v>o);t++){const e=m.getColor(t);u.beginPath(),u.rotate(v),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,f);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),p=t.createPattern(c,"no-repeat"),p&&Px.Set(e,n,i,s,o,p,d,f),p}(o,this.stops,t,e,h,n,i,a,l),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}clearRect(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}project(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(wB(_B,[t,e,n],this.modelMatrix),t=_B[0],e=_B[1],n=_B[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}view(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(wB(_B,[t,e,n],this.modelMatrix),t=_B[0],e=_B[1],n=_B[2]),this.camera.view(t,e,n)):[t,e,n]}fillText(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(wB(_B,[e,n,i],this.modelMatrix),e=_B[0],n=_B[1],i=_B[2]);const t=this.camera.vp(e,n,i);e=t.x,n=t.y}this.nativeContext.fillText(t,e,n)}getImageData(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yg.global.measureTextMethod;var n,i;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=Yg.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(n=this.fontFamily)&&void 0!==n?n:Pg.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(i=this.fontSize)&&void 0!==i?i:Pg.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,n){this.nativeContext.putImageData(t,e,n)}setLineDash(t){const e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}strokeText(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(wB(_B,[e,n,i],this.modelMatrix),e=_B[0],n=_B[1],i=_B[2]);const t=this.camera.vp(e,n,i);e=t.x,n=t.y}this.nativeContext.strokeText(t,e,n)}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,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setCommonStyle(t,e,n,i,s)}return this._setCommonStyle(t,e,n,i,r)}_setCommonStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12?(s.globalAlpha=o*a,s.fillStyle=w_(this,l,t,n,i)):s.globalAlpha=o*a}setShadowStyle(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowStyle(t,n[0]);const i={};return n.forEach((t=>{Object.assign(i,t)})),this._setShadowStyle(t,e,i)}return this._setShadowStyle(t,e,n)}_setShadowStyle(t,e,n){const i=this.nativeContext;n||(n=this.fillAttributes);const{opacity:r=n.opacity,shadowBlur:s=n.shadowBlur,shadowColor:o=n.shadowColor,shadowOffsetX:a=n.shadowOffsetX,shadowOffsetY:l=n.shadowOffsetY,blur:h=n.blur}=e;r<=1e-12||(s||a||l?(i.shadowBlur=s,i.shadowColor=o,i.shadowOffsetX=a,i.shadowOffsetY=l,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),h?(i.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1))}setStrokeStyle(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setStrokeStyle(t,e,n,i,s)}return this._setStrokeStyle(t,e,n,i,r)}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=x_(this,l,this.dpr),s.strokeStyle=w_(this,h,t,n,i),s.lineJoin=c,s.setLineDash(u),s.lineCap=d,s.miterLimit=f}}setTextStyleWithoutAlignBaseline(t,e,n){const i=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?i.font=t.font:i.font=Kx(t,e,r&&this.camera&&this.camera.getProjectionScale(n));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,i.textAlign="left",i.textBaseline="alphabetic"}setTextStyle(t,e,n){var i,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=Kx(t,e,this.camera&&this.camera.getProjectionScale(n));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(BB,t,e)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>GS.free(t))),this.stack.length=0}};TB.env="browser",TB=SB([np(),AB("design:paramtypes",[Object,Number])],TB);var CB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},PB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const RB={WIDTH:500,HEIGHT:500,DPR:1};let OB=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){const{nativeCanvas:e,width:n=RB.WIDTH,height:i=RB.HEIGHT,dpr:r=RB.DPR,container:s,x:o,y:a,canvasControled:l=!0}=t;if(this._x=null!=o?o:0,this._y=null!=a?a:0,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this.controled=l,"string"==typeof s){const t=Yg.global.getElementById(s);t&&(this._container=t)}else this._container=s;this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new TB(this,this._dpr),this._id=e.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:n=this._displayHeight,dpr:i=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:o}=this;o.width=e*i,o.height=n*i,!o.style||this.setCanvasStyle(o,r,s,e,n),t.id&&(o.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,n,i,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${i}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){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}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,n,i){return this._context.getImageData(t,e,n,i)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}};OB.env="browser",OB=CB([np(),PB("design:paramtypes",[Object])],OB);const MB=Symbol.for("CanvasArcPicker"),EB=Symbol.for("CanvasArc3dPicker"),kB=Symbol.for("CanvasAreaPicker"),IB=Symbol.for("CanvasCirclePicker"),jB=Symbol.for("CanvasImagePicker"),DB=Symbol.for("CanvasLinePicker"),LB=Symbol.for("CanvasPathPicker"),NB=Symbol.for("CanvasRectPicker"),WB=Symbol.for("CanvasRect3dPicker"),FB=Symbol.for("CanvasSymbolPicker"),UB=Symbol.for("CanvasTextPicker"),zB=Symbol.for("CanvasPolygonPicker"),HB=Symbol.for("CanvasPyramid3dPicker"),VB=Symbol.for("CanvasRichTextPicker"),GB=Symbol.for("CanvasGlyphPicker"),XB=Symbol.for("CanvasGroupPicker"),YB=Symbol.for("CanvasPickerContribution"),qB=Symbol.for("MathArcPicker"),$B=Symbol.for("MathAreaPicker"),KB=Symbol.for("MathCirclePicker"),ZB=Symbol.for("MathLinePicker"),JB=Symbol.for("MathPathPicker"),QB=Symbol.for("MathRectPicker"),tT=Symbol.for("MathSymbolPicker"),eT=Symbol.for("MathTextPicker"),nT=Symbol.for("MathPolygonPicker"),iT=Symbol.for("MathGlyphPicker"),rT=Symbol.for("MathPickerContribution");var sT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aT=function(t,e){return function(n,i){e(n,i,t)}};let lT=class extends gB{constructor(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p){super(f,p),this.contributions=t,this.circlePicker=e,this.rectPicker=n,this.arcPicker=i,this.areaPicker=r,this.imagePicker=s,this.linePicker=o,this.pathPicker=a,this.symbolPicker=l,this.textPicker=h,this.polygonPicker=c,this.richtextPicker=u,this.drawContribution=d,this.global=f,this.pickItemInterceptorContributions=p,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,n)=>{this.configure(n,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(t,e){const n={width:100,height:100,nativeCanvas:t.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new OB(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,n,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,i,{parentMatrix:n});if(r)return!0===r?t:r.graphic}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,i)?t:null;if(s)return s;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,i,{parentMatrix:n});if(r)return!0===r?t:r.graphic}}return s}};sT([hp(),oT("design:type",Function),oT("design:paramtypes",[]),oT("design:returntype",void 0)],lT.prototype,"init",null),lT=sT([np(),aT(0,sp(cp)),aT(0,ip(YB)),aT(1,sp(IB)),aT(2,sp(NB)),aT(3,sp(MB)),aT(4,sp(kB)),aT(5,sp(jB)),aT(6,sp(DB)),aT(7,sp(LB)),aT(8,sp(FB)),aT(9,sp(UB)),aT(10,sp(zB)),aT(11,sp(VB)),aT(12,sp(b_)),aT(13,sp(yp)),aT(14,sp(cp)),aT(14,ip(lB)),oT("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],lT);var hT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const uT=new Y(1,0,0,1,0,0),dT={x:0,y:0};let fT=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Y(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Y(1,0,0,1,0,0),this.path=new wg}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return GS.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(GS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(GS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*n,a*i,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,n,i,r,s){this.path.arc(t,e,n,i,r,s)}arcTo(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s){this.path.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.path.closePath()}ellipse(t,e,n,i,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i){this.path.rect(t,e,n,i)}createImageData(t,e){return null}createLinearGradient(t,e,n,i){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,n,i,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,n,i){return null}fill(t,e){}fillRect(t,e,n,i){this.path.rect(t,e,n,i)}clearRect(t,e,n,i){}fillText(t,e,n){}getImageData(t,e,n,i){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},dT),function(t,e,n){return Fy(t,0,!1,e,n)}(this.path.commandList,dT.x,dT.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},dT);const n=x_(this,this.lineWidth,this.dpr);return function(t,e,n,i){return Fy(t,e,!0,n,i)}(this.path.commandList,n,dT.x,dT.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,n){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,n,i){this.path.rect(t,e,n,i)}strokeText(t,e,n){}drawImage(){}setCommonStyle(t,e,n,i,r){}_setCommonStyle(t,e,n,i){}setStrokeStyle(t,e,n,i,r){}_setStrokeStyle(t,e,n,i){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(uT,t,e)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>GS.free(t))),this.stack.length=0}};fT=hT([np(),cT("design:paramtypes",[Object,Number])],fT);var pT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},gT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yT=function(t,e){return function(n,i){e(n,i,t)}};let vT=class extends gB{constructor(t,e,n){super(e,n),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=n,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,n)=>{this.configure(n,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(t,e){this.pickContext=new fT(null,1)}pickItem(t,e,n,i){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);return r&&r.contains(t,e,i)?t:null}};pT([hp(),gT("design:type",Function),gT("design:paramtypes",[]),gT("design:returntype",void 0)],vT.prototype,"init",null),vT=pT([np(),yT(0,sp(cp)),yT(0,ip(rT)),yT(1,sp(yp)),yT(2,sp(cp)),yT(2,ip(lB)),gT("design:paramtypes",[Object,Object,Object])],vT);var mT=new Zf((t=>{t(lT).toSelf().inSingletonScope(),t(vT).toSelf().inSingletonScope(),t(pB).toService(lT),t(xB).toSelf().inSingletonScope(),t(bB).toService(xB),t(cB).toSelf().inSingletonScope(),t(lB).toService(cB),t(hB).toSelf().inSingletonScope(),t(lB).toService(hB),dp(t,lB)})),bT=new Zf((t=>{t(tA).toSelf().inSingletonScope(),t(Yb).toService(tA),t(MS).toSelf().inSingletonScope(),t(OS).toService(MS),dp(t,OS),t(IS).toSelf().inSingletonScope(),t(kS).toService(IS),dp(t,kS),t(LS).toSelf().inSingletonScope(),t(DS).toService(LS),dp(t,DS),t(FS).toSelf().inSingletonScope(),t(WS).toService(FS),dp(t,WS),t(HS).toSelf().inSingletonScope(),t(zS).toService(HS),dp(t,zS),t(qb).toConstantValue(sA)}));const xT=Symbol.for("AutoEnablePlugins"),wT=Symbol.for("PluginService");var ST=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},AT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_T=function(t,e){return function(n,i){e(n,i,t)}};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:n}=e;n&&ly.isBound(xT)&&this.autoEnablePlugins.getContributions().forEach((t=>{n.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((n=>{n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((n=>{n.name===t&&e.push(n)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};BT=ST([np(),_T(0,sp(cp)),_T(0,ip(xT)),AT("design:paramtypes",[Object])],BT);var TT=new Zf((t=>{t(BT).toSelf(),t(wT).toService(BT),function(t,e){t(cp).toDynamicValue((t=>{let{container:n}=t;return new up(e,n)})).whenTargetNamed(e)}(t,xT)})),CT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let PT=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new V}removeDom(t){return!1}createDom(t){return null}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};PT=CT([np()],PT);var RT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},OT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class MT{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function ET(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(n.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let kT=class extends PT{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 n;if(e){const{clientX:i,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let a,l;return o&&(a=s.width/o.offsetWidth,l=s.height/o.offsetHeight),{x:(i-s.left)/(y(a)?a:1),y:(r-s.top)/(y(l)?a:1)}}return{x:t.offsetX,y:t.offsetY}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/xml").firstChild),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new MT(t)}return new V}removeDom(t){return t.parentElement.removeChild(t),!0}createDom(t){const{tagName:e="div",width:n,height:i,style:r,parent:s}=t,o=document.createElement(e);if(r&&(u(r)?o.setAttribute("style",r):Object.keys(r).forEach((t=>{o.setAttribute(t,r[t])}))),null!=n&&(o.style.width=`${n}px`),null!=i&&(o.style.height=`${i}px`),s){const t=u(s)?this.getElementById(s):s;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return ET(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return ET(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:nv.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}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,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}};function IT(){ly.rebind(pB).toService(vT)}kT=RT([np(),OT("design:paramtypes",[])],kT);var jT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},DT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let LT=class extends PT{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,n,i,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 l={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})};n.set(e,l),o>=i&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),IT())}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 Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};LT=jT([np(),DT("design:paramtypes",[])],LT);var NT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},WT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let FT=class extends PT{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 n,i,r,s,o,a,l;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,l=e.pixelRatio,i.forEach(((t,e)=>{const i=a.createCanvasContext(t);i.canvas={width:n.width*l,height:n.height*l},i.createRadialGradient||(i.createRadialGradient=function(){return i.createCircularGradient(...arguments)}),!i.getImageData&&a.canvasGetImageData&&(i.getImageData=(e,n,i,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:n,width:i,height:r,success(t){s(t)}})}catch(t){o(t)}})));const h={id:t,width:n.width*l,height:n.height*l,offsetWidth:n.width,offsetHeight:n.height,getContext:()=>i,getBoundingClientRect:()=>({height:n.height,width:n.width})};return r.set(t,h),e>=s&&o.push(h),h})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,ly.rebind(pB).toService(vT))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const n=new e.Blob([t],{type:"image/svg+xml"}),i=e.URL.createObjectURL(n);return Promise.resolve({data:i,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,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};FT=NT([np(),WT("design:paramtypes",[])],FT);var UT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},zT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let HT=!1;try{HT=!!lynx.createCanvasNG}catch(t){}let VT=class extends PT{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,n,i,r){const s=SystemInfo.pixelRatio;e.forEach(((e,o)=>{const a=HT?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,HT&&a.attachToCanvasView(e);const l=a.getContext("2d");l.draw=(t,e)=>{e()};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>l,getBoundingClientRect:()=>({height:t.height,width:t.width})};n.set(e,h),o>=i&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),IT())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,n)=>{e.onload=()=>{t(e)},e.onerror=()=>{n(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};VT=UT([np(),zT("design:paramtypes",[])],VT);var GT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let XT=class extends PT{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){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const n=new e(t).render().asPng();return this.loadImage(n)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){}removeEventListener(t,e,n){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};XT=GT([np()],XT);var YT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},qT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$T=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};let KT=class extends PT{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,n,i,r,s){return $T(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=wx.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const l=s[0].node,h=s[0].width,c=s[0].height;l.width=h*t,l.height=c*t,n.set(a,l),o>=i&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.compoient).then((()=>{IT()}))}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 Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};KT=YT([np(),qT("design:paramtypes",[])],KT);var ZT=new Zf((t=>{t(kT).toSelf().inSingletonScope(),t(gp).toService(kT),t(LT).toSelf().inSingletonScope(),t(gp).toService(LT),t(FT).toSelf().inSingletonScope(),t(gp).toService(FT),t(VT).toSelf().inSingletonScope(),t(gp).toService(VT),t(KT).toSelf().inSingletonScope(),t(gp).toService(KT),t(XT).toSelf().inSingletonScope(),t(gp).toService(XT),dp(t,gp)})),JT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},QT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let tC=class{constructor(){this._uid=nv.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}};tC=JT([np(),QT("design:paramtypes",[])],tC);var eC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},nC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iC=function(t,e){return function(n,i){e(n,i,t)}};let rC=class extends tC{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser",this._canvasIsIntersecting=!0}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),this.postInit()}postInit(){try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>n||e.top>i)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let n;if(n="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");t.offscreen?n=null:n.appendChild(e);const i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:n,id:nv.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new OB(i)}createWindowByCanvas(t){var e;let n;if("string"==typeof t.canvas){if(n=this.global.getElementById(t.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){const t=n.getBoundingClientRect();i=t.width,r=t.height}let s=t.dpr;!1===t.canvasControled&&(s&&console.warn("canvasControled为false后,dpr参数将无效"),s=null),null==s&&(s=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new OB({width:i,height:r,dpr:s,nativeCanvas:n,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}removeEventListener(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};rC.env="browser",rC=eC([np(),iC(0,sp(yp)),nC("design:paramtypes",[Object])],rC);var sC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let oC=class extends TB{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,n,i){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:n,height:i,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}};oC.env="feishu",oC=sC([np()],oC);var aC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const hC={WIDTH:500,HEIGHT:500,DPR:1};let cC=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:n=hC.WIDTH,height:i=hC.HEIGHT,dpr:r=hC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new oC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};cC.env="feishu",cC=aC([np(),lC("design:paramtypes",[Object])],cC);var uC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fC=function(t,e){return function(n,i){e(n,i,t)}};let pC=class extends tC{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new cC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new cC({width:n,height:i,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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};pC.env="feishu",pC=uC([np(),fC(0,sp(yp)),dC("design:paramtypes",[Object])],pC);var gC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let yC=class extends TB{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,n){}_setCommonStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(w_(this,l,t,n,i)))}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(x_(this,l,this.dpr)),s.setStrokeStyle(w_(this,h,t,n,i)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(f)}}setTextStyleWithoutAlignBaseline(t,e){var n;const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Kx(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}setTextStyle(t,e){var n,i;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Kx(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}createConicGradient(t,e,n,i){return null}createPattern(t,e){return null}};yC.env="taro",yC=gC([np()],yC);var vC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const bC={WIDTH:500,HEIGHT:500,DPR:1};let xC=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:n=bC.WIDTH,height:i=bC.HEIGHT,dpr:r=bC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new yC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};xC.env="taro",xC=vC([np(),mC("design:paramtypes",[Object])],xC);var wC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},SC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},AC=function(t,e){return function(n,i){e(n,i,t)}};let _C=class extends tC{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new xC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new xC({width:n,height:i,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,n)=>{t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,n)=>{t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};_C.env="taro",_C=wC([np(),AC(0,sp(yp)),SC("design:paramtypes",[Object])],_C);var BC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let TC=class extends TB{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,n=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;n.setLineDash(t)}}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=x_(this,l,this.dpr),s.strokeStyle=w_(this,h,t,n,i),s.lineJoin=c,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=f}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};TC.env="lynx",TC=BC([np()],TC);var CC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},PC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const RC={WIDTH:500,HEIGHT:500,DPR:1};let OC=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:n=RC.WIDTH,height:i=RC.HEIGHT,dpr:r=RC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new TC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};OC.env="lynx",OC=CC([np(),PC("design:paramtypes",[Object])],OC);var MC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},EC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kC=function(t,e){return function(n,i){e(n,i,t)}};let IC=class extends tC{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new OC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new OC({width:n,height:i,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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};IC.env="lynx",IC=MC([np(),kC(0,sp(yp)),EC("design:paramtypes",[Object])],IC);var jC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},DC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let LC=class extends TB{constructor(t,e){super(t,e);const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new Y(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};LC.env="node",LC=jC([np(),DC("design:paramtypes",[Object,Number])],LC);var NC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},WC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const FC={WIDTH:500,HEIGHT:500,DPR:1};let UC=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:n=FC.WIDTH,height:i=FC.HEIGHT,canvasControled:r=!0,dpr:s=FC.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=n*s,this._pixelHeight=i*s,this._displayWidth=n,this._displayHeight=i,this._nativeCanvas=e,this._context=new LC(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,n,i){return this._context.getImageData(t,e,n,i)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this._nativeCanvas.release&&a(this._nativeCanvas.release)&&this._nativeCanvas.release()}};UC.env="node",UC=NC([np(),WC("design:paramtypes",[Object])],UC);var zC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},HC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},VC=function(t,e){return function(n,i){e(n,i,t)}};let GC=class extends tC{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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new UC(n)}createWindowByCanvas(t){const e=t.canvas;let n=t.width,i=t.height;null!=n&&null!=i&&t.canvasControled||(n=e.width,i=e.height),this.canvas=new UC({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,n){}dispatchEvent(t){return!0}removeEventListener(t,e,n){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t,e){}};GC.env="node",GC=zC([np(),VC(0,sp(yp)),HC("design:paramtypes",[Object])],GC);var XC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let YC=class extends TB{draw(){}createPattern(t,e){return null}};YC.env="wx",YC=XC([np()],YC);var qC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$C=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const KC={WIDTH:500,HEIGHT:500,DPR:1};let ZC=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:n=KC.WIDTH,height:i=KC.HEIGHT,dpr:r=KC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new YC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};ZC.env="wx",ZC=qC([np(),$C("design:paramtypes",[Object])],ZC);var JC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},QC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tP=function(t,e){return function(n,i){e(n,i,t)}};class eP{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,1)}cleanEvent(){this.cache={}}}let nP=class extends tC{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new eP}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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new ZC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new ZC({width:n,height:i,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,n,i,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!==(n=t.changedTouches[0].x)&&void 0!==n?n:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(i=t.changedTouches[0].y)&&void 0!==i?i:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};nP.env="wx",nP=JC([np(),tP(0,sp(yp)),QC("design:paramtypes",[Object])],nP);var iP=new Zf((t=>{t(rC).toSelf(),t(hx).toDynamicValue((t=>t.container.get(rC))).whenTargetNamed(rC.env),t(pC).toSelf(),t(hx).toDynamicValue((t=>t.container.get(pC))).whenTargetNamed(pC.env),t(_C).toSelf(),t(hx).toDynamicValue((t=>t.container.get(_C))).whenTargetNamed(_C.env),t(IC).toSelf(),t(hx).toDynamicValue((t=>t.container.get(IC))).whenTargetNamed(IC.env),t(nP).toSelf(),t(hx).toDynamicValue((t=>t.container.get(nP))).whenTargetNamed(nP.env),t(GC).toSelf(),t(hx).toDynamicValue((t=>t.container.get(GC))).whenTargetNamed(GC.env)})),rP=new Zf((t=>{t(ay).toSelf().inSingletonScope(),t(oy).toService(ay),dp(t,oy)})),sP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aP=function(t,e){return function(n,i){e(n,i,t)}};let lP=class{constructor(t){this.global=t,this.offscreen=!1}setDpr(t){this.canvas.dpr=t}init(t,e,n){if(this.layer=t,this.window=e,n.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=n.canvasId?this.global.getElementById(n.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const i=e.getContext().getCanvas().nativeCanvas,r=uy({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:i.offsetLeft,y:i.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,n){var i;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,n){var i;const r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};lP=sP([np(),aP(0,sp(yp)),oP("design:paramtypes",[Object])],lP);var hP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uP=function(t,e){return function(n,i){e(n,i,t)}};let dP=class{constructor(t){this.global=t,this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,n){this.layer=t;const i=uy({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var n;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,n){const i=t.getContext(),r=t.dpr,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:l=this.layer.viewHeight}=n;i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(s,o,a,l),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,l),i.nativeContext.restore()}merge(t){}};dP=hP([np(),uP(0,sp(yp)),cP("design:paramtypes",[Object])],dP);var fP=new Zf((t=>{t(lP).toSelf(),t(dP).toSelf(),t(Qb).toService(lP)}));var pP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const gP=Symbol.for("DrawItemInterceptor"),yP=new V;let vP=class{constructor(){this.order=1}afterDrawItem(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,n,i,r),!1}beforeDrawItem(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,n,i,r),!1}drawItem(t,e,n,i,r){if(!t.shadowRoot)return!1;const{context:s}=n;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){yP.copy(i.dirtyBounds);const e=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(e)}return i.renderGroup(t.shadowRoot,n),s.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&i.dirtyBounds.copy(yP),!0}};vP=pP([np()],vP);let mP=class{constructor(){this.order=1}beforeDrawItem(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const l=XS.allocate();ZS(l,a);const h=s.modelMatrix;if(h){if(l){const t=XS.allocate();s.modelMatrix=JS(t,h,l)}}else s.modelMatrix=l;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===Eb,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var n,i,r,s;let o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i: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+=P;for(;a<0;)a+=P;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",i.renderGroup(t,n),n.hack_pieFace="inside",i.renderGroup(t,n),n.hack_pieFace="top",i.renderGroup(t,n),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 n;return s.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n: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)})),i.renderGroup(t,n,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else i.renderGroup(t,n)}else i.renderItem(t,n);return s.camera=null,s.restore(),s.modelMatrix!==h&&XS.free(s.modelMatrix),s.modelMatrix=h,n.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};mP=pP([np()],mP);var bP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wP=function(t,e){return function(n,i){e(n,i,t)}};let SP=class{constructor(t,e,n,i){this.contributions=t,this.renderSelector=e,this.layerService=n,this.drawItemInterceptorContributions=i,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new H,this.backupDirtyBounds=new H}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:n,stage:i,x:r=0,y:s=0,width:o,height:a}=e;if(!n)return;const l=this.dirtyBounds.setValue(0,0,o,a);if(i.dirtyBounds&&!i.dirtyBounds.empty()){const t=(h=l,c=i.dirtyBounds,u=!1,null===h?c:null===c?h:(q=h.x1,$=h.x2,K=h.y1,Z=h.y2,J=c.x1,Q=c.x2,et=c.y1,nt=c.y2,u&&(q>$&&([q,$]=[$,q]),K>Z&&([K,Z]=[Z,K]),J>Q&&([J,Q]=[Q,J]),et>nt&&([et,nt]=[nt,et])),q>=Q||$<=J||K>=nt||Z<=et?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(q,J),y1:Math.max(K,et),x2:Math.min($,Q),y2:Math.min(Z,nt)}));l.x1=Math.floor(t.x1),l.y1=Math.floor(t.y1),l.x2=Math.ceil(t.x2),l.y2=Math.ceil(t.y2)}var h,c,u;this.backupDirtyBounds.copy(l),n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0);const d=l.width()*n.dpr!==n.canvas.width||l.height()*n.dpr!==n.canvas.height;n.save(),n.translate(r,s,!0),d&&(n.beginPath(),n.rect(l.x1,l.y1,l.width(),l.height()),n.clip()),i.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,n,e),n.save(),t.renderTreeRoots.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Mg.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Mg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),n.restore(),n.restore(),n.draw(),n.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,n=t._uid;for(;e;){const t=oB(e,n,Mg.zIndex);if(t)return t;n=e._uid,e=e.parent}return null}renderGroup(t,e,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!rt(t.AABBBounds,this.dirtyBounds,!1))return;const i=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):rB(t,Mg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.dirtyBounds.copy(i)}_increaseRender(t,e){const{layer:n,stage:i}=e,{subLayers:r}=n;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||ly.get(t_);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=r.get(l._uid);t||(t={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(l._uid,t));const n=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:t.layer,context:n,startAtId:l._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,n){if(this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}const i=this.getRenderContribution(t);if(!i)return;if(!t.isContainer&&!rt(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=r),r?t.isContainer&&i.draw(t,this.currentRenderService,e,n):i.draw(t,this.currentRenderService,e,n),this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const i=this.InterceptorContributions[n];if(i.afterDrawItem&&i.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,n){const{clear:i}=n;if(i){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=n,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=w_(e,i,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};bP([sp(yp),xP("design:type",Object)],SP.prototype,"global",void 0),bP([hp(),xP("design:type",Function),xP("design:paramtypes",[]),xP("design:returntype",void 0)],SP.prototype,"init",null),SP=bP([np(),wP(0,op(s_)),wP(1,sp(m_)),wP(2,sp(fx)),wP(3,sp(cp)),wP(3,ip(gP)),xP("design:paramtypes",[Array,Object,Object,Object])],SP);var AP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let _P=class{selector(t){return null}};_P=AP([np()],_P);var BP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},TP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},CP=function(t,e){return function(n,i){e(n,i,t)}};let PP=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Db}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).group,{fill:h=l.fill,background:c,stroke:u=l.stroke,opacity:f=l.opacity,width:p=l.width,height:g=l.height,clip:y=l.clip,fillOpacity:v=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:S=l.visible}=t.attribute,A=mx(f,v,p,g,h),_=xx(f,m,p,g),B=gx(h,c),T=yx(u,w);if(!t.valid||!S)return;if(!y){if(!B&&!T)return;if(!(A||_||o||a||c))return}if(x&&x.length&&r.drawContribution){const t=e.disableFill,n=e.disableStroke,i=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,x.forEach((t=>{r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,s)})),e.disableFill=t,e.disableStroke=n,e.disableBeginPath=i}else 0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(n,i,p,g)):(e.beginPath(),CA(e,n,i,p,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const C={doFill:B,doStroke:T};this._groupRenderContribitions.forEach((s=>{s.time===Up.beforeFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a,C)})),y&&e.clip(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),C.doFill&&(o?o(e,t.attribute,l):A&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),C.doStroke&&(a?a(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._groupRenderContribitions.forEach((s=>{s.time===Up.afterFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=ev(t,null==i?void 0:i.theme).group,a=r.modelMatrix;if(r.camera){const e=XS.allocate(),n=XS.allocate();QS(n,t,o),JS(e,a||e,n),r.modelMatrix=e,XS.free(n),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,n);const{scrollX:l=o.scrollX,scrollY:h=o.scrollY}=t.attribute;let c;(l||h)&&r.translate(l,h),i&&i.drawingCb&&(c=i.drawingCb()),r.modelMatrix!==a&&XS.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};PP=BP([np(),CP(0,sp(cp)),CP(0,ip(Ex)),TP("design:paramtypes",[Object])],PP);var RP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let OP=class extends fA{constructor(){super(...arguments),this.numberType=Nb}drawShape(t,e,n,i,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=ev(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:y=h.visible}=t.attribute,v=vx(d,f,c),m=bx(d,p),b=gx(c),x=yx(u,g);if(!t.valid||!y)return;if(!b&&!x)return;if(!(v||m||o||a))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],n,i)}else super.drawShape(t,e,n,i,r,s,o,a)}drawIncreaseSegment(t,e,n,i,r,s,o,a){i&&(e.beginPath(),function(t,e,n,i){const{offsetX:r=0,offsetY:s=0}=i||{},o=e?e.points[e.points.length-1]:n.points[0];t.moveTo(o.x+r,o.y+s),n.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}(e.nativeContext,n,i,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};OP=RP([np()],OP);var MP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let EP=class extends wA{constructor(){super(...arguments),this.numberType=kb}drawShape(t,e,n,i,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(s>l.length)return;const h=ev(t).area,{fill:c=h.fill,fillOpacity:u=h.fillOpacity,opacity:d=h.opacity,visible:f=h.visible}=t.attribute,p=vx(d,u,c),g=gx(c);if(!t.valid||!f)return;if(!g)return;if(!p&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],n,i)}else super.drawShape(t,e,n,i,r,s,o)}drawIncreaseSegment(t,e,n,i,r,s,o,a){i&&(e.beginPath(),function(t,e,n,i){const{offsetX:r=0,offsetY:s=0}=i||{},{points:o}=n,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((n,i)=>{var o,a,l,h;const c=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(c.x+r,c.y+s),n.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=n.length-1;e>=0;e--){const i=n[e];t.lineTo(null!==(o=i.x1)&&void 0!==o?o:i.x,null!==(a=i.y1)&&void 0!==a?a:i.y)}t.lineTo(null!==(l=c.x1)&&void 0!==l?l:c.x,null!==(h=c.y1)&&void 0!==h?h:c.y),t.closePath()}))}(e.camera?e:e.nativeContext,n,i,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};EP=MP([np()],EP);var kP,IP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},DP=function(t,e){return function(n,i){e(n,i,t)}},LP=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(kP||(kP={}));let NP=class extends SP{constructor(t,e,n,i,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=n,this.areaRender=i,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=kP.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new pp([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return LP(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const n=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,n)return;this.currentRenderService=t;const{context:i,x:r=0,y:s=0}=e;i&&(i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0),i.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,i,e),i.translate(r,s,!0),i.save(),t.renderTreeRoots.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Mg.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Mg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{i.restore(),i.restore(),i.draw(),i.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return LP(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return LP(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((n=>{this.renderItem(t,e,{drawingCb:()=>LP(this,void 0,void 0,(function*(){if(2!==t.count)yield sB(t,Mg.zIndex,((n,i)=>{if(this.status===kP.STOP)return!0;if(n.isContainer)return!1;if(i<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return i<r&&(this.currentIdx=i+1,this.renderItem(n,e)),i===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),n(!1);else{const i=t.getChildAt(0);if(i.incremental&&i.attribute.segments)for(i.incrementalAt||(i.incrementalAt=0);i.incrementalAt<i.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:i.incrementalAt,length:i.incremental},this.renderItem(i,e),i.incrementalAt+=i.incremental,yield this.waitToNextFrame();else this.renderItem(i,e);n(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return LP(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return LP(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return LP(this,void 0,void 0,(function*(){this.rendering&&(this.status=kP.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=kP.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 LP(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((n=>{this.renderItem(t,e,{drawingCb:()=>LP(this,void 0,void 0,(function*(){yield sB(t,Mg.zIndex,(t=>LP(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),n(!1)}))})})))}))}};IP([sp(yp),jP("design:type",Object)],NP.prototype,"global",void 0),NP=IP([np(),DP(0,op(s_)),DP(1,sp(m_)),DP(2,sp(OP)),DP(3,sp(EP)),DP(4,sp(fx)),DP(5,sp(cp)),DP(5,ip(gP)),jP("design:paramtypes",[Array,Object,Object,Object,Object,Object])],NP);var WP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let FP=class extends hA{constructor(){super(...arguments),this.type="rect3d",this.numberType=Hb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).rect3d,{fill:c=h.fill,stroke:u=h.stroke,width:d=h.width,height:f=h.height,opacity:p=h.opacity,fillOpacity:g=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:m=h.visible}=t.attribute,b=null!==(l=this.z)&&void 0!==l?l:0,x=mx(p,g,d,f,c),w=xx(p,v,d,f),S=gx(c),A=yx(u,y);if(!t.valid||!m)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:_,camera:B}=r.stage||{},T=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,n,i,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(n,i,b,T,r,e,_,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,b,T,e))}stroke(t,e,n,i,r){const s=i.vertices;i.edges.forEach((i=>{const o=s[i[0]],a={x:t+o[0],y:e+o[1],z:n+o[2]},l=s[i[1]],h={x:t+l[0],y:e+l[1],z:n+l[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(t,e,n,i,r,s,o,a){const l=Uv.get(r).value,h=i.vertices,c=h.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];i.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:n,normal:i}=t,r=c[n[0]],s=c[n[1]],o=c[n[2]],a=c[n[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((i=>{const{polygon:c,normal:u}=i.polygon,d=h[c[0]],f=h[c[1]],p=h[c[2]],g=h[c[3]],y={x:t+d[0],y:e+d[1],z:n+d[2]},v={x:t+f[0],y:e+f[1],z:n+f[2]},m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]};s.beginPath(),s.moveTo(y.x,y.y,y.z),s.lineTo(v.x,v.y,v.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,l):r,s.fill())}))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=ev(t).rect,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;this.z=l,this.drawShape(t,i,o,a,n),this.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}};FP=WP([np()],FP);var UP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let zP=class{constructor(){this.numberType=Vb}drawShape(t,e,n,i,r){const s=ev(t).richtext,{width:o=s.width,height:a=s.height,opacity:l=s.opacity,fillOpacity:h=s.fillOpacity,visible:c=s.visible}=t.attribute;t.valid&&c&&vx(l,h,!0)&&(e.translate(n,i),t.getFrameCache().draw(e,this.drawIcon))}drawIcon(t,e,n,i,r){var s;const o=ev(t).richtextIcon,{width:a=o.width,height:l=o.height,opacity:h=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:f=o.backgroundStroke,backgroundStrokeOpacity:p=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:y}=t.attribute,{backgroundWidth:v=a,backgroundHeight:m=l}=t.attribute;if(y&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(v-a)/2,r=(m-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,v,m)):(e.beginPath(),CA(e,n-t,i-r,v,m,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=h,e.drawImage(b.data,n,i,a,l))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=ev(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,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,o,n),i.highPerformanceRestore()}};zP=UP([np()],zP);var HP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let VP=class{constructor(){this.numberType=jb}drawShape(t,e,n,i,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,n,i,r,s,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;if(r.highPerformanceSave(),!n.drawContribution)return;const s=ev(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{n.drawContribution.renderItem(t,n,{theme:s})})),r.highPerformanceRestore()}};VP=HP([np()],VP);var GP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let XP=class extends hA{constructor(){super(...arguments),this.numberType=Eb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).arc,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible}=t.attribute,m=vx(f,p,c),b=bx(f,y),x=gx(c,u),w=yx(d,g),S=null!==(l=this.z)&&void 0!==l?l:0;if(!t.valid||!v)return;if(!x&&!w)return;if(!(m||b||o||a||u))return;const{outerRadius:A=h.outerRadius,innerRadius:B=h.innerRadius,height:T=10}=t.attribute,C=Uv.get(c).value,{light:O}=r.stage||{},E=r.hack_pieFace,k={top:S,bottom:S+T},j={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===E||"top"===E?(e.beginPath(),function(t,e,n,i,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=R(l-a),c=l>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=_)e.moveTo(n,i,r);else if(h>=P-_)e.moveTo(n+s*M(a),i+s*I(a),r),e.arc(n,i,s,a,l,!c,r),o>_&&(e.moveTo(n+o*M(l),i+o*I(l),r),e.arc(n,i,o,l,a,c,r));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:f,outerEndAngle:p,innerEndAngle:g,innerStartAngle:y}=t.getParsePadAngle(a,l),v=s*M(f),m=s*I(f),b=o*M(g),x=o*I(g);h<.001?u=!0:(e.moveTo(n+v,i+m,r),e.arc(n,i,s,f,p,!c,r)),!(o>_)||d<.001?(e.lineTo(n+b,i+x,r),u=!0):(e.lineTo(n+b,i+x,r),e.arc(n,i,o,g,y,c,r))}e.closePath()}(t,e,n,i,k[E],A,B),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),x&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=O?O.computeColor(j[E],C):c,e.fill())),w&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))):"outside"!==E&&"inside"!==E||("inside"===E&&(e.save(),e.beginPath(),e.arc(n,i,B,0,P,!0,k.top),e.clip()),e.beginPath(),function(t,e,n,i,r,s,o,a){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=R(h-l),u=h>l;let d=!1;if(o<=_)e.moveTo(n,i,r);else if(c>=P-_)e.moveTo(n+o*M(l),i+o*I(l),r),e.arc(n,i,o,l,h,!u,r),e.lineTo(n+o*M(h),i+o*I(h),s),e.arc(n,i,o,h,l,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:f}=a(l,h),p=o*M(c),g=o*I(c),y=o*M(f),v=o*I(f);t<.001?d=!0:(e.moveTo(n+p,i+g,r),e.arc(n,i,o,c,f,!u,r),e.lineTo(n+y,i+v,s),e.arc(n,i,o,f,c,u,s))}e.closePath()}(t,e,n,i,k.top,k.bottom,"outside"===E?A:B,((e,n)=>{const{outerDeltaAngle:i,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:l}=t.getParsePadAngle(e,n);return"outside"===E?{innerouterDeltaAngle:i,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:l}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),x&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=O?O.computeColor(j[E],C):c,e.fill())),w&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())),"inside"===E&&e.restore())}draw(t,e,n,i){const{context:r}=n;if(!r)return;const s=ev(t,null==i?void 0:i.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&XS.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};XP=GP([np()],XP);var YP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let qP=class extends hA{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Ub}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:y=h.visible,points:v,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(l=this.z)&&void 0!==l?l:0,x=vx(d,f,c),w=bx(d,g),S=gx(c),A=yx(u,p);if(!t.valid||!y||4!==v.length)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:_,camera:B}=r.stage||{},T=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,n,i,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(n,i,b,T,m,r,e,_,B,t,h,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,b,T,e))}stroke(t,e,n,i,r){const s=i.vertices;i.edges.forEach((i=>{const o=s[i[0]],a=s[i[1]],l={x:t+o[0],y:e+o[1],z:n+o[2]},h={x:t+a[0],y:e+a[1],z:n+a[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(t,e,n,i,r,s,o,a,l,h,c,u){const d=Uv.get(s).value,f=i.vertices,p=f.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];i.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:n,normal:i}=t,s=p[n[0]],o=p[n[1]],a=p[n[2]],l=p[n[3]];t.ave_z=s+o+a+l})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((i=>{const{polygon:r,normal:l}=i.polygon,p=f[r[0]],g=f[r[1]],y=f[r[2]],v=f[r[3]],m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]},x={x:t+y[0],y:e+y[1],z:n+y[2]},w={x:t+v[0],y:e+v[1],z:n+v[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,h.attribute,c):(o.fillStyle=a?a.computeColor(l,d):s,o.fill())}))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=ev(t).polygon,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;this.z=l,this.drawShape(t,i,o,a,n),this.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}};qP=YP([np()],qP);var $P=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let KP=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}};KP=$P([np()],KP);let ZP=class extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}};ZP=$P([np()],ZP);var JP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let QP=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}};QP=JP([np()],QP);let tR=class extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}};tR=JP([np()],tR);var eR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let nR=class extends T_{constructor(){super(...arguments),this.time=Up.beforeFillStroke}};nR=eR([np()],nR);let iR=class extends P_{constructor(){super(...arguments),this.time=Up.afterFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){var f,p,g,y;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:v=t.attribute}=d||{},{texture:m=(null!==(f=t.attribute.texture)&&void 0!==f?f:Ev(l,"texture")),textureColor:b=(null!==(p=t.attribute.textureColor)&&void 0!==p?p:Ev(l,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:Ev(l,"textureSize")),texturePadding:w=(null!==(y=t.attribute.texturePadding)&&void 0!==y?y:Ev(l,"texturePadding"))}=v;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,n,i,l),e.fillStyle=S,e.fill(),e.highPerformanceRestore())}};iR=eR([np()],iR);var rR=new Zf((t=>{t(SP).toSelf(),t(b_).toService(SP),t(NP).toSelf(),t(t_).toService(NP),t(_P).toSelf(),t(m_).toService(_P),t(Yx).toSelf().inSingletonScope(),t(r_).to(Yx),t(s_).to(Yx),t(I_).toSelf().inSingletonScope(),t(j_).toSelf().inSingletonScope(),t(D_).toSelf().inSingletonScope(),t(Mx).toService(I_),t(Mx).toService(j_),t(Mx).toService(D_),dp(t,Mx),t(MA).toSelf().inSingletonScope(),t(c_).to(MA),t(s_).to(MA),t(FP).toSelf().inSingletonScope(),t(u_).toService(FP),t(s_).toService(u_),t(z_).toSelf().inSingletonScope(),t(H_).toSelf().inSingletonScope(),t(V_).toSelf().inSingletonScope(),t(G_).toSelf().inSingletonScope(),t(X_).toSelf().inSingletonScope(),t(Dx).toService(z_),t(Dx).toService(H_),t(Dx).toService(V_),t(Dx).toService(G_),t(Dx).toService(X_),dp(t,Dx),t(WA).toSelf().inSingletonScope(),t(f_).to(WA),t(s_).to(WA),dp(t,Nx),t(BA).toSelf().inSingletonScope(),t(l_).to(BA),t(s_).to(BA),t(QP).toSelf().inSingletonScope(),t(tR).toSelf().inSingletonScope(),t(Ix).toService(QP),t(Ix).toService(tR),dp(t,Ix),t(jA).toSelf().inSingletonScope(),t(d_).to(jA),t(s_).to(jA),t(q_).toSelf().inSingletonScope(),t($_).toSelf().inSingletonScope(),t(K_).toSelf().inSingletonScope(),t(Lx).toService(q_),t(Lx).toService($_),t(Lx).toService(K_),dp(t,Lx),t(Hx).toSelf().inSingletonScope(),t(e_).to(Hx),t(s_).to(Hx),t(XP).toSelf().inSingletonScope(),t(n_).toService(XP),t(s_).toService(n_),t(O_).toSelf().inSingletonScope(),t(M_).toSelf().inSingletonScope(),t(E_).toSelf().inSingletonScope(),t(Rx).toService(O_),t(Rx).toService(M_),t(Rx).toService(E_),dp(t,Rx),t(fA).toSelf().inSingletonScope(),t(a_).to(fA),t(s_).to(fA),t(OP).toSelf().inSingletonScope(),t(EP).toSelf().inSingletonScope(),t(wA).toSelf().inSingletonScope(),t(i_).to(wA),t(s_).to(wA),t(nR).toSelf().inSingletonScope(),t(iR).toSelf().inSingletonScope(),t(Ox).toService(nR),t(Ox).toService(iR),dp(t,Ox),t(PP).toSelf().inSingletonScope(),t(o_).to(PP),t(s_).to(PP),t(N_).toSelf().inSingletonScope(),t(Ex).toService(N_),dp(t,Ex),t(qA).toSelf().inSingletonScope(),t(h_).to(qA),t(s_).to(qA),t(KP).toSelf().inSingletonScope(),t(ZP).toSelf().inSingletonScope(),t(jx).toService(KP),t(jx).toService(ZP),dp(t,jx),t(VP).toSelf().inSingletonScope(),t(y_).toService(VP),t(s_).toService(y_),t(QA).toSelf().inSingletonScope(),t(v_).toService(QA),t(s_).toService(v_),t(F_).toSelf().inSingletonScope(),t(kx).toService(F_),dp(t,kx),t(zP).toSelf().inSingletonScope(),t(p_).toService(zP),t(s_).toService(p_),t(qP).toSelf().inSingletonScope(),t(g_).toService(qP),t(s_).toService(g_),t(C_).toSelf().inSingletonScope(),t(Nx).toService(C_),t(Rx).toService(C_),t(Ix).toService(C_),t(Lx).toService(C_),t(Dx).toService(C_),t(kx).toService(C_),t(Mx).toService(C_),t(Ox).toService(C_),t(jx).toService(C_),dp(t,Wx),dp(t,s_),t(vP).toSelf().inSingletonScope(),t(gP).toService(vP),t(mP).toSelf().inSingletonScope(),t(gP).toService(mP),dp(t,gP)}));var sR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aR=function(t,e){return function(n,i){e(n,i,t)}};let lR=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Ib}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=x_(i,s,i.dpr),a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};lR=sR([np(),aR(0,sp(r_)),oR("design:paramtypes",[Object])],lR);var hR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uR=function(t,e){return function(n,i){e(n,i,t)}};const dR=new V;let fR=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=zb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,i.setTransformForCurrent()}else o=0,a=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||g(s,!0)&&0!==s||d(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=x_(i,s,i.dpr),h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;dR.setValue(n.x1,n.y1,n.x2,n.y2),dR.expand(-s/2),h=!dR.containsPoint(e)}}return i.highPerformanceRestore(),h}};fR=hR([np(),uR(0,sp(c_)),cR("design:paramtypes",[Object])],fR);var pR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},gR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yR=function(t,e){return function(n,i){e(n,i,t)}};let vR=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Mb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).arc;i.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,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=x_(i,s,i.dpr),a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};vR=pR([np(),yR(0,sp(e_)),gR("design:paramtypes",[Object])],vR);var mR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xR=function(t,e){return function(n,i){e(n,i,t)}};let wR=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=kb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),i.highPerformanceRestore(),a}};wR=mR([np(),xR(0,sp(i_)),bR("design:paramtypes",[Object])],wR);var SR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let AR=class{constructor(){this.type="image",this.numberType=Lb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};AR=SR([np()],AR);var _R=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let BR=class extends hA{};BR=_R([np()],BR);var TR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PR=function(t,e){return function(n,i){e(n,i,t)}};let RR=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Nb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;i.highPerformanceSave();const r=ev(t).line,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>{if(u)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=x_(i,r,i.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};RR=TR([np(),PR(0,sp(a_)),CR("design:paramtypes",[Object])],RR);var OR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},MR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ER=function(t,e){return function(n,i){e(n,i,t)}};let kR=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Wb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).path;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>{if(u)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=x_(i,r,i.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};kR=OR([np(),ER(0,sp(l_)),MR("design:paramtypes",[Object])],kR);var IR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},DR=function(t,e){return function(n,i){e(n,i,t)}};nA({});let LR=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Gb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=ev(t).symbol,o=this.transform(t,s,i),{x:a,y:l,z:h,lastModelMatrix:c}=o;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,i,a,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=x_(i,r,i.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==c&&XS.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),d}};LR=IR([np(),DR(0,sp(d_)),jR("design:paramtypes",[Object])],LR);var NR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},WR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},FR=function(t,e){return function(n,i){e(n,i,t)}};let UR=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Xb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=ev(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,i,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,h,c,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),y=Jx(o,d,r),v=Zx(a,g);return e.rect(v+h,y+c,g,d,u),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&XS.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};UR=NR([np(),FR(0,sp(f_)),WR("design:paramtypes",[Object])],UR);var zR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},HR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},VR=function(t,e){return function(n,i){e(n,i,t)}};let GR=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Fb}contains(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};GR=zR([np(),VR(0,sp(h_)),HR("design:paramtypes",[Object])],GR);var XR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},YR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qR=function(t,e){return function(n,i){e(n,i,t)}};new V;let $R=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Vb}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};$R=XR([np(),qR(0,sp(p_)),YR("design:paramtypes",[Object])],$R);var KR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ZR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JR=function(t,e){return function(n,i){e(n,i,t)}};let QR=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=jb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=null==n?void 0:n.pickerService;if(r){let i=!1;return t.getSubGraphic().forEach((t=>{i||(i=!!r.pickItem(t,e,null,n))})),i}return!1}};QR=KR([np(),JR(0,sp(y_)),ZR("design:paramtypes",[Object])],QR);var tO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},eO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nO=function(t,e){return function(n,i){e(n,i,t)}};new V;let iO=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Hb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).rect;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,n,null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};iO=tO([np(),nO(0,sp(u_)),eO("design:paramtypes",[Object])],iO);var rO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},sO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oO=function(t,e){return function(n,i){e(n,i,t)}};new V;let aO=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Ub}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).polygon;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>!1)),this.canvasRenderer.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};aO=rO([np(),oO(0,sp(g_)),sO("design:paramtypes",[Object])],aO);var lO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cO=function(t,e){return function(n,i){e(n,i,t)}};new V;let uO=class extends BR{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Eb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).arc;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,n,null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,i.modelMatrix!==h&&XS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};uO=lO([np(),cO(0,sp(n_)),hO("design:paramtypes",[Object])],uO);var dO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let fO=class{constructor(){this.type="group",this.numberType=Db}contains(t,e,n){return!1}};fO=dO([np()],fO);var pO=new Zf(((t,e,n,i)=>{t(lR).toSelf().inSingletonScope(),t(IB).toService(lR),t(YB).toService(IB),t(fR).toSelf().inSingletonScope(),t(NB).toService(fR),t(YB).toService(NB),t(iO).toSelf().inSingletonScope(),t(WB).toService(iO),t(YB).toService(WB),t(vR).toSelf().inSingletonScope(),t(MB).toService(vR),t(YB).toService(MB),t(wR).toSelf().inSingletonScope(),t(kB).toService(wR),t(YB).toService(kB),t(AR).toSelf().inSingletonScope(),t(jB).toService(AR),t(YB).toService(jB),t(RR).toSelf().inSingletonScope(),t(DB).toService(RR),t(YB).toService(DB),t(kR).toSelf().inSingletonScope(),t(LB).toService(kR),t(YB).toService(LB),t(LR).toSelf().inSingletonScope(),t(FB).toService(LR),t(YB).toService(FB),t(UR).toSelf().inSingletonScope(),t(UB).toService(UR),t(YB).toService(UB),t(GR).toSelf().inSingletonScope(),t(zB).toService(GR),t(YB).toService(zB),t(aO).toSelf().inSingletonScope(),t(HB).toService(aO),t(YB).toService(HB),t(uO).toSelf().inSingletonScope(),t(EB).toService(uO),t(YB).toService(EB),t($R).toSelf().inSingletonScope(),t(VB).toService($R),t(YB).toService(VB),t(QR).toSelf().inSingletonScope(),t(GB).toService(QR),t(YB).toService(GB),t(fO).toSelf().inSingletonScope(),t(XB).toService(fO),t(YB).toService(XB),dp(t,YB)})),gO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vO=function(t,e){return function(n,i){e(n,i,t)}};let mO=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=Wb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};mO=gO([np(),vO(0,sp(l_)),yO("design:paramtypes",[Object])],mO);var bO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wO=function(t,e){return function(n,i){e(n,i,t)}};let SO=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Ib}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};SO=bO([np(),wO(0,sp(r_)),xO("design:paramtypes",[Object])],SO);var AO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},_O=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},BO=function(t,e){return function(n,i){e(n,i,t)}};const TO=new V;let CO=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=zb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,i.setTransformForCurrent()}else o=0,a=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||g(s,!0)&&0!==s||d(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;TO.setValue(n.x1,n.y1,n.x2,n.y2),TO.expand(-s/2),h=!TO.containsPoint(e)}}return i.highPerformanceRestore(),h}};CO=AO([np(),BO(0,sp(c_)),_O("design:paramtypes",[Object])],CO);var PO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},RO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},OO=function(t,e){return function(n,i){e(n,i,t)}};let MO=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Mb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).arc;i.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,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};MO=PO([np(),OO(0,sp(e_)),RO("design:paramtypes",[Object])],MO);var EO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IO=function(t,e){return function(n,i){e(n,i,t)}};let jO=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=kb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),i.highPerformanceRestore(),a}};jO=EO([np(),IO(0,sp(i_)),kO("design:paramtypes",[Object])],jO);var DO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NO=function(t,e){return function(n,i){e(n,i,t)}};let WO=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=Nb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};WO=DO([np(),NO(0,sp(a_)),LO("design:paramtypes",[Object])],WO);var FO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},UO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zO=function(t,e){return function(n,i){e(n,i,t)}};let HO=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=Gb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};HO=FO([np(),zO(0,sp(d_)),UO("design:paramtypes",[Object])],HO);var VO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let GO=class{constructor(){this.type="text",this.numberType=Xb}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};GO=VO([np()],GO);var XO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},YO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qO=function(t,e){return function(n,i){e(n,i,t)}};let $O=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Fb}contains(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};$O=XO([np(),qO(0,sp(h_)),YO("design:paramtypes",[Object])],$O);var KO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ZO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JO=function(t,e){return function(n,i){e(n,i,t)}};let QO=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=jb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=null==n?void 0:n.pickerService;if(r){let i=!1;return t.getSubGraphic().forEach((t=>{i||(i=!!r.pickItem(t,e,null,n))})),i}return!1}};QO=KO([np(),JO(0,sp(y_)),ZO("design:paramtypes",[Object])],QO);var tM=new Zf((t=>{t(SO).toSelf().inSingletonScope(),t(KB).toService(SO),t(rT).toService(KB),t(CO).toSelf().inSingletonScope(),t(QB).toService(CO),t(rT).toService(QB),t(MO).toSelf().inSingletonScope(),t(qB).toService(MO),t(rT).toService(qB),t(jO).toSelf().inSingletonScope(),t($B).toService(jO),t(rT).toService($B),t(WO).toSelf().inSingletonScope(),t(ZB).toService(WO),t(rT).toService(ZB),t(mO).toSelf().inSingletonScope(),t(JB).toService(mO),t(rT).toService(JB),t(HO).toSelf().inSingletonScope(),t(tT).toService(HO),t(rT).toService(tT),t(GO).toSelf().inSingletonScope(),t(eT).toService(GO),t(rT).toService(eT),t($O).toSelf().inSingletonScope(),t(nT).toService($O),t(rT).toService(nT),t(QO).toSelf().inSingletonScope(),t(iT).toService(QO),t(QO).toService(iT),dp(t,rT)}));var eM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new OB(t))).whenTargetNamed(OB.env),t(cy).toDynamicValue((()=>(t,e)=>new TB(t,e))).whenTargetNamed(TB.env)})),nM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new xC(t))).whenTargetNamed(xC.env),t(cy).toDynamicValue((()=>(t,e)=>new yC(t,e))).whenTargetNamed(yC.env)})),iM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new cC(t))).whenTargetNamed(cC.env),t(cy).toDynamicValue((()=>(t,e)=>new oC(t,e))).whenTargetNamed(oC.env)})),rM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new OC(t))).whenTargetNamed(OC.env),t(cy).toDynamicValue((()=>(t,e)=>new TC(t,e))).whenTargetNamed(TC.env)})),sM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new ZC(t))).whenTargetNamed(ZC.env),t(cy).toDynamicValue((()=>(t,e)=>new YC(t,e))).whenTargetNamed(YC.env)})),oM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new UC(t))).whenTargetNamed(UC.env),t(cy).toDynamicValue((()=>(t,e)=>new LC(t,e))).whenTargetNamed(LC.env)}));ly.load(px),ly.load(bT),ly.load(nB),ly.load(mT),ly.load(TT),function(t){t.load(ZT),t.load(iP),t.load(rP),t.load(fP)}(ly),function(t){t.load(rR)}(ly),function(t){t.load(pO),t.load(tM)}(ly),function(t){t.load(eM),t.load(iM),t.load(nM),t.load(rM),t.load(sM),t.load(oM)}(ly);const aM=ly.get(yp);Yg.global=aM;const lM=ly.get(dx);Yg.graphicUtil=lM;const hM=ly.get(ux);Yg.transformUtil=hM;const cM=ly.get(Yb);Yg.graphicService=cM,ly.get(bB);const uM=ly.get(fx);Yg.layerService=uM,new V;const dM=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.handleTick=(t,e)=>{const{once:n=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),n||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let n=0;this.lastFrameTime>=0&&(n=e-this.lastFrameTime),this.lastFrameTime=e,this.status===fv.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(n)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=fv.INITIAL,Yg.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),Yg.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:dv},{mode:"timeout",cons:uv},{mode:"manual",cons:cv}];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 dv;break;case"timeout":t=new uv;break;case"manual":t=new cv;break;default:console.warn("非法的计时器模式"),t=new dv}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!==fv.INITIAL&&(this.status=fv.PAUSE,!0)}resume(){return this.status!==fv.INITIAL&&(this.status=fv.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===fv.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===fv.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=fv.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=fv.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};var fM;dM.addTimeline(gv),dM.setFPS(60),function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(fM||(fM={}));const pM=(t,e,n,i)=>new ot(Object.assign({defaultFontParams:Object.assign({fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14},i),getTextBounds:n?void 0:aA,specialCharSet:"-/: .,@%'\"~"+ot.ALPHABET_CHAR_SET+ot.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function gM(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function yM(t){let e="center",n="middle";return e=(t=gM(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",n=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:n}}const vM=t=>t.map(((t,e)=>({index:e,value:t}))),mM=(t,e,n=0)=>{const i=new V(t).expand(n/2),r=new V(e).expand(n/2);return i.intersects(r)},bM=(t,e)=>{let n=0;t.x2<e.x1?n=e.x1-t.x2:e.x2<t.x1&&(n=t.x1-e.x2);let i=0;return t.y2<e.y1?i=e.y1-t.y2:e.y2<t.y1&&(i=t.y1-e.y2),[n,i]};function xM(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function wM(t,e){for(let n,i=1,r=t.length,s=t[0];i<r;s=n,++i)if(n=t[i],xM(s.AABBBounds,n.AABBBounds,e))return!0;return!1}const SM=(t,e,n)=>{var i;const{labelStyle:r,axisOrientType:s,labelFlush:o,labelFormatter:a,startAngle:l=0}=n,h=null!==(i=r.angle)&&void 0!==i?i:0,c=["bottom","top"].includes(s),u=["left","right"].includes(s);let d=l;c?d=0:u&&(d=G(-90));const f=pM(r),p=e.map(((n,i)=>{var s,l;const p=a?a(n):`${n}`,{width:g,height:y}=f.quickMeasure(p),v=Math.max(g,12),m=Math.max(y,12),b=t.scale(n);let x,w,S=Math.cos(d)*b,A=-Math.sin(d)*b;x=o&&c&&0===i?"left":o&&c&&i===e.length-1?"right":null!==(s=r.textAlign)&&void 0!==s?s:"center","right"===x?S-=v:"center"===x&&(S-=v/2),w=o&&u&&0===i?"top":o&&u&&i===e.length-1?"bottom":null!==(l=r.textBaseline)&&void 0!==l?l:"middle","bottom"===w?A-=m:"middle"===w&&(A-=m/2);return(new V).set(S,A,S+v,A+m).rotate(h,S+v/2,A+m/2)}));return p},AM=(t,e,n)=>{var i;const{labelStyle:r,getRadius:s,labelOffset:o,labelFormatter:a}=n,l=null==s?void 0:s(),h=null!==(i=r.angle)&&void 0!==i?i:0,c=pM(r),u=e.map((e=>{const n=a?a(e):`${e}`,{width:i,height:r}=c.quickMeasure(n),s=Math.max(i,12),u=Math.max(r,12),d=t.scale(e);let f=0,p=0;const g=yM(d),{x:y,y:v}=function(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}({x:0,y:0},l+o,d);f=y+("right"===g.align?-s:"center"===g.align?-s/2:0),p=v+("bottom"===g.baseline?-u:"middle"===g.baseline?-u/2:0);return(new V).set(f,p,f+s,p+u).rotate(h,f+s/2,p+u/2)}));return u},_M={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let n;return t.filter(((t,i)=>(!i||!xM(n.AABBBounds,t.AABBBounds,e))&&(n=t,!0)))}},BM=(t,e,n,i,r,s)=>{let o=s,a=0,l=0,h=0,c=-1,u=Number.MAX_VALUE;do{let s=!0;o++;let d=0;do{d+o<t.length&&mM(e[d],e[d+o],n)&&(s=!1),d+=o}while(s&&d<t.length);if(s){if(!i){h=o;break}{const i=t.length-1;a=0;do{if(d-=o,d!==i&&!mM(e[d],e[i],n))break;a++}while(d>0);if(d===i){h=o,l=a;break}{const n=Math.floor(t.length/o)-a+1;if(n<c)break;{c=n;const t=r?0:1,s=bM(e[d],e[i])[t],f=d-o>=0?bM(e[d-o],e[d])[t]:s,p=Math.abs(s-f);p<u&&(u=p,h=o,l=a)}}}}}while(o<=t.length);return{step:h,delCount:l}},TM=(t,e,n,i)=>{let r=i;do{let i=!0;r++;let s=0;do{s+r<t.length&&mM(e[s],e[s+r],n)&&(i=!1),s+=r}while(i&&s<t.length);if(i)break}while(r<=t.length);let s=0;if(t.length>2){let n=t.length-t.length%r;for(n>=t.length&&(n-=r);n>0&&mM(e[0],e[n]);)s++,n-=r}return{step:r,delCount:s}};t.angleLabelOrientAttribute=yM,t.convertDomainToTickData=vM,t.initTextMeasure=pM,t.normalizeAngle=gM,t.ticks=(t,e)=>{if(lt(t.type))return((t,e)=>{if(!lt(t.type))return vM(t.domain());const n=t.range();if(Math.abs(n[n.length-1]-n[0])<2)return vM([t.domain()[0]]);const{tickCount:i,forceTickCount:r,tickStep:s,noDecimals:o=!1}=e;let a;if(a=h(s)?t.stepTicks(s):h(r)?t.forceTicks(r):"d3"===e.tickMode?t.d3Ticks(null!=i?i:5,{noDecimals:o}):t.ticks(null!=i?i:5,{noDecimals:o}),e.sampling&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:n=4,labelFlush:i}=e;let r=SM(t,a,e).map(((t,e)=>({AABBBounds:t,value:a[e]})));for(;r.length>=3&&wM(r,n);)r=_M.parity(r);const s=r.map((t=>t.value));s.length<3&&i&&(s.length>1&&s.pop(),S(s)!==S(a)&&s.push(S(a))),a=s}return vM(a)})(t,e);if(function(t){switch(t){case at.Ordinal:case at.Point:case at.Band:return!0;default:return!1}}(t.type)){if("cartesian"===e.coordinateType)return((t,e)=>{var n;const i=t.domain();if(!i.length)return[];const{tickCount:r,forceTickCount:s,tickStep:o,labelGap:a=4,axisOrientType:l}=e,c=["bottom","top"].includes(l),u=t.range(),d=t.calculateWholeRangeSize();if(d<2)return e.labelLastVisible?vM([i[i.length-1]]):vM([i[0]]);let f;if(h(o))f=t.stepTicks(o);else if(h(s))f=t.forceTicks(s);else if(h(r))f=t.ticks(r);else if(e.sampling){let r;const s=(null!==(n=e.labelStyle.fontSize)&&void 0!==n?n:12)+2;if(i.length<=d/s)r=SM(t,i,e);else{const n=[i[0],i[Math.floor(i.length/2)],i[i.length-1]],s=SM(t,n,e);let o=null,a=0;s.forEach(((t,e)=>{if(!o)return o=t,void(a=e);c?o.width()<t.width()&&(o=t,a=e):o.height()<t.height()&&(o=t,a=e)}));const l=0===a?0:2===a?i.length-1:Math.floor(i.length/2),h=t.scale(i[l]);r=new Array(i.length);for(let e=0;e<r.length;e++){r[e]=o.clone();const n=t.scale(i[e]);c?r[e].translate(n-h,0):r[e].translate(0,n-h)}}const o=r.map((t=>c?t.width():t.height())),l=Math.min(...u),h=(Math.max(...u)-l)/i.length,p=BM(i,r,a,e.labelLastVisible,c,Math.floor(Math.min(...o)/h));f=t.stepTicks(p.step),e.labelLastVisible&&(f=f.slice(0,f.length-p.delCount),f.push(i[i.length-1]))}else f=t.domain();return vM(f)})(t,e);if("polar"===e.coordinateType&&"angle"===e.axisOrientType)return((t,e)=>{const{tickCount:n,forceTickCount:i,tickStep:r,getRadius:s,labelOffset:o,labelGap:a=0}=e,l=null==s?void 0:s();if(!l)return vM(t.domain());let c;if(h(r))c=t.stepTicks(r);else if(h(i))c=t.forceTicks(i);else if(h(n))c=t.ticks(n);else if(e.sampling){const n=t.domain(),i=t.range(),r=AM(t,n,e),s=Math.min(...i),h=Math.max(...i),u=Math.abs(h-s)*(l+o)/n.length,{step:d,delCount:f}=TM(n,r,a,Math.floor(r.reduce(((t,e)=>Math.min(t,e.width(),e.height())),Number.MAX_VALUE)/u));c=t.stepTicks(d),c=c.slice(0,c.length-f)}else c=t.domain();return vM(c)})(t,e)}return vM(t.domain())}}));
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).VDatasetExtension={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,s||t,o),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,r,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,s),!0;case 6:return c.fn.call(c.context,e,i,r,s,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,f=c.length;for(h=0;h<f;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,i);break;case 4:c[h].fn.call(c[h].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,r){var s=n?n+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||i&&a.context!==i||o(this,s);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==e||r&&!a[l].once||i&&a[l].context!==i)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(i);var r=n(i.exports);var s=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var o=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||s(t,"Boolean")};var a=t=>"function"==typeof t;var l=t=>null==t;var h=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var u=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||s(t,"String")};var d=t=>Array.isArray?Array.isArray(t):s(t,"Array");var f=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var p=t=>s(t,"Date");var g=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||s(t,"Number")};var y=t=>g(t)&&Number.isFinite(t);var v=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var m=t=>s(t,"RegExp");var b=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const x=Object.prototype.hasOwnProperty;var w=(t,e)=>null!=t&&x.call(t,e);function A(t){if(f(t))return t[t.length-1]}function S(t,e){if(!d(t)||!d(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const _=1e-12,T=Math.PI,B=T/2,C=2*T,P=2*Math.PI,R=Math.abs,O=Math.atan2,M=Math.cos,E=Math.max,k=Math.min,I=Math.sin,j=Math.sqrt,D=Math.pow;function L(t){return t>1?0:t<-1?T:Math.acos(t)}function N(t){return t>=1?B:t<=-1?-B:Math.asin(t)}function W(t,e,n,i,r){let s,o;return"number"==typeof t&&"number"==typeof n&&(s=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(o=(1-r)*e+r*i),{x:s,y:o}}class U{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new U(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return g(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return g(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class F{static distancePP(t,e){return j(D(t.x-e.x,2)+D(t.y-e.y,2))}static distanceNN(t,e,n,i){return j(D(t-n,2)+D(e-i,2))}static distancePN(t,e,n){return j(D(e-t.x,2)+D(n-t.y,2))}static pointAtPP(t,e,n){return new U((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function z(t,e,n){const{x1:i,y1:r,x2:s,y2:o}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*o+n.e,n.b*s+n.d*o+n.f),t.add(n.a*i+n.c*o+n.e,n.b*i+n.d*o+n.f),e)}class H{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new H(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return d(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return z(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),h=e-e*a+n*l,c=n-e*l-n*a;return[a*i-l*r+h,l*i+a*r+c,a*i-l*o+h,l*i+a*o+c,a*s-l*r+h,l*s+a*r+c,a*s-l*o+h,l*s+a*o+c]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:o,y2:a}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*o+(1-t)*n,e*a+(1-e)*i]}}class V extends H{}function G(t){return t*(Math.PI/180)}const X=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-C;)t+=C;else if(t>0)for(;t>C;)t-=C;return t};class Y{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,o=new Y,a=t*i-e*n;return o.a=i/a,o.b=-e/a,o.c=-n/a,o.d=t/a,o.e=(n*s-i*r)/a,o.f=-(t*s-e*r)/a,o}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,o=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=o,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,o=(1-i)*n-r*e,a=i*this.a-r*this.b,l=r*this.a+i*this.b,h=i*this.c-r*this.d,c=r*this.c+i*this.d,u=i*this.e-r*this.f+s,d=r*this.e+i*this.f+o;return this.a=a,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const o=this.a,a=this.b,l=this.c,h=this.d,c=o*t+l*e,u=a*t+h*e,d=o*n+l*i,f=a*n+h*i,p=o*r+l*s+this.e,g=a*r+h*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new Y;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:o,f:a}=this,l=n*s-i*r,h=s/l,c=-i/l,u=-r/l,d=n/l,f=(r*a-s*o)/l,p=-(n*a-i*o)/l,{x:g,y:y}=t;e.x=g*h+y*u+f,e.y=g*c+y*d+p}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Y(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const o=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/o):-Math.acos(n/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}let q,K,$,Z,J,Q,et,nt;var it;function rt(t,e,n){return!(t&&e&&(n?(q=t.x1,K=t.x2,$=t.y1,Z=t.y2,J=e.x1,Q=e.x2,et=e.y1,nt=e.y2,q>K&&([q,K]=[K,q]),$>Z&&([$,Z]=[Z,$]),J>Q&&([J,Q]=[Q,J]),et>nt&&([et,nt]=[nt,et]),q>Q||K<J||$>nt||Z<et):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"}(it||(it={}));const st=t=>{let e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e&=1023,n&=1023,i=e<<10|n,i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};class ot{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),h(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=h(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(l(this._canvas)&&(h(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),l(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&h(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),l(this._context)&&h(this._canvas)){const t=this._canvas.getContext("2d");h(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:n=e.fontStyle,fontVariant:i=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(i?i+" ":"")+(r?r+" ":"")+s+"px "+(o||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,n;const{defaultFontParams:i={}}=this._option,{fontStyle:r=i.fontStyle,fontVariant:s=i.fontVariant,fontWeight:o=(null!==(t=i.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=i.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(n=i.fontFamily)&&void 0!==n?n:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:f,limit:p,lineHeight:g=a}=this._userSpec;return{fontStyle:r,fontVariant:s,fontFamily:l,fontSize:a,fontWeight:o,textAlign:c,textBaseline:d,ellipsis:f,limit:p,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(l(t))return{width:0,height:0};if(l(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:n,fontWeight:i,textAlign:r,textBaseline:s,ellipsis:o,limit:a,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:n,fontWeight:i,textAlign:r,textBaseline:s,ellipsis:!!o,maxLineWidth:a||1/0,lineHeight:h});c={width:l.width(),height:l.height()}}catch(e){this._notSupportVRender=!0,c=this.measureWithNaiveCanvas(t)}return c}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const e=this._context.measureText(t),{fontSize:n,lineHeight:i}=this.textSpec;return{width:e.width,height:null!=i?i:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let n=0;n<t.length;n++){const i=t[n];let r=this._measureSpecialChar(i);l(r)&&ot.NUMBERS_CHAR_SET.includes(i)&&(r=this._measureNumberChar()),l(r)&&["F","W"].includes(st(i))&&(r=this._measureFullSizeChar()),l(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){const e={width:0,height:0},{fontSize:n,lineHeight:i}=this.textSpec;for(let i=0;i<t.length;i++){const r=t[i],s=["F","W"].includes(st(r))?1:.53;e.width+=s*n}return e.height=null!=i?i:n,e}_measureReduce(t,e){const{fontSize:n,lineHeight:i}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(d(t)){const s=t.filter(h).map((t=>t.toString()));return 0===s.length?r:1===s.length?e(s[0]):{width:s.reduce(((t,n)=>Math.max(t,e(n).width)),0),height:s.length*((null!=i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(ot.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ot.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ot.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(ot.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ot.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return h(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){h(this._canvas)&&(this._canvas=null),h(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}var at;function lt(t){switch(t){case at.Linear:case at.Log:case at.Pow:case at.Sqrt:case at.Symlog:case at.Time:return!0;default:return!1}}ot.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ot.NUMBERS_CHAR_SET="0123456789",ot.FULL_SIZE_CHAR="字",function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(at||(at={}));var ht=function(t){return t&&t.Math==Math&&t},ct=ht("object"==typeof globalThis&&globalThis)||ht("object"==typeof window&&window)||ht("object"==typeof self&&self)||ht("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),ut={},dt=function(t){try{return!!t()}catch(t){return!0}},ft=!dt((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),pt=!dt((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),gt=pt,yt=Function.prototype.call,vt=gt?yt.bind(yt):function(){return yt.apply(yt,arguments)},mt={},bt={}.propertyIsEnumerable,xt=Object.getOwnPropertyDescriptor,wt=xt&&!bt.call({1:2},1);mt.f=wt?function(t){var e=xt(this,t);return!!e&&e.enumerable}:bt;var At,St,_t=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Tt=pt,Bt=Function.prototype,Ct=Bt.call,Pt=Tt&&Bt.bind.bind(Ct,Ct),Rt=Tt?Pt:function(t){return function(){return Ct.apply(t,arguments)}},Ot=Rt,Mt=Ot({}.toString),Et=Ot("".slice),kt=function(t){return Et(Mt(t),8,-1)},It=dt,jt=kt,Dt=Object,Lt=Rt("".split),Nt=It((function(){return!Dt("z").propertyIsEnumerable(0)}))?function(t){return"String"==jt(t)?Lt(t,""):Dt(t)}:Dt,Wt=function(t){return null==t},Ut=Wt,Ft=TypeError,zt=function(t){if(Ut(t))throw Ft("Can't call method on "+t);return t},Ht=Nt,Vt=zt,Gt=function(t){return Ht(Vt(t))},Xt="object"==typeof document&&document.all,Yt={all:Xt,IS_HTMLDDA:void 0===Xt&&void 0!==Xt},qt=Yt.all,Kt=Yt.IS_HTMLDDA?function(t){return"function"==typeof t||t===qt}:function(t){return"function"==typeof t},$t=Kt,Zt=Yt.all,Jt=Yt.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:$t(t)||t===Zt}:function(t){return"object"==typeof t?null!==t:$t(t)},Qt=ct,te=Kt,ee=function(t,e){return arguments.length<2?(n=Qt[t],te(n)?n:void 0):Qt[t]&&Qt[t][e];var n},ne=Rt({}.isPrototypeOf),ie=ct,re="undefined"!=typeof navigator&&String(navigator.userAgent)||"",se=ie.process,oe=ie.Deno,ae=se&&se.versions||oe&&oe.version,le=ae&&ae.v8;le&&(St=(At=le.split("."))[0]>0&&At[0]<4?1:+(At[0]+At[1])),!St&&re&&(!(At=re.match(/Edge\/(\d+)/))||At[1]>=74)&&(At=re.match(/Chrome\/(\d+)/))&&(St=+At[1]);var he=St,ce=dt,ue=ct.String,de=!!Object.getOwnPropertySymbols&&!ce((function(){var t=Symbol();return!ue(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&he&&he<41})),fe=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pe=ee,ge=Kt,ye=ne,ve=Object,me=fe?function(t){return"symbol"==typeof t}:function(t){var e=pe("Symbol");return ge(e)&&ye(e.prototype,ve(t))},be=String,xe=function(t){try{return be(t)}catch(t){return"Object"}},we=Kt,Ae=xe,Se=TypeError,_e=function(t){if(we(t))return t;throw Se(Ae(t)+" is not a function")},Te=_e,Be=Wt,Ce=function(t,e){var n=t[e];return Be(n)?void 0:Te(n)},Pe=vt,Re=Kt,Oe=Jt,Me=TypeError,Ee={exports:{}},ke=ct,Ie=Object.defineProperty,je=function(t,e){try{Ie(ke,t,{value:e,configurable:!0,writable:!0})}catch(n){ke[t]=e}return e},De=je,Le="__core-js_shared__",Ne=ct[Le]||De(Le,{}),We=Ne;(Ee.exports=function(t,e){return We[t]||(We[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 Ue=Ee.exports,Fe=zt,ze=Object,He=function(t){return ze(Fe(t))},Ve=He,Ge=Rt({}.hasOwnProperty),Xe=Object.hasOwn||function(t,e){return Ge(Ve(t),e)},Ye=Rt,qe=0,Ke=Math.random(),$e=Ye(1..toString),Ze=function(t){return"Symbol("+(void 0===t?"":t)+")_"+$e(++qe+Ke,36)},Je=Ue,Qe=Xe,tn=Ze,en=de,nn=fe,rn=ct.Symbol,sn=Je("wks"),on=nn?rn.for||rn:rn&&rn.withoutSetter||tn,an=function(t){return Qe(sn,t)||(sn[t]=en&&Qe(rn,t)?rn[t]:on("Symbol."+t)),sn[t]},ln=vt,hn=Jt,cn=me,un=Ce,dn=function(t,e){var n,i;if("string"===e&&Re(n=t.toString)&&!Oe(i=Pe(n,t)))return i;if(Re(n=t.valueOf)&&!Oe(i=Pe(n,t)))return i;if("string"!==e&&Re(n=t.toString)&&!Oe(i=Pe(n,t)))return i;throw Me("Can't convert object to primitive value")},fn=TypeError,pn=an("toPrimitive"),gn=function(t,e){if(!hn(t)||cn(t))return t;var n,i=un(t,pn);if(i){if(void 0===e&&(e="default"),n=ln(i,t,e),!hn(n)||cn(n))return n;throw fn("Can't convert object to primitive value")}return void 0===e&&(e="number"),dn(t,e)},yn=me,vn=function(t){var e=gn(t,"string");return yn(e)?e:e+""},mn=Jt,bn=ct.document,xn=mn(bn)&&mn(bn.createElement),wn=function(t){return xn?bn.createElement(t):{}},An=wn,Sn=!ft&&!dt((function(){return 7!=Object.defineProperty(An("div"),"a",{get:function(){return 7}}).a})),_n=ft,Tn=vt,Bn=mt,Cn=_t,Pn=Gt,Rn=vn,On=Xe,Mn=Sn,En=Object.getOwnPropertyDescriptor;ut.f=_n?En:function(t,e){if(t=Pn(t),e=Rn(e),Mn)try{return En(t,e)}catch(t){}if(On(t,e))return Cn(!Tn(Bn.f,t,e),t[e])};var kn={},In=ft&&dt((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),jn=Jt,Dn=String,Ln=TypeError,Nn=function(t){if(jn(t))return t;throw Ln(Dn(t)+" is not an object")},Wn=ft,Un=Sn,Fn=In,zn=Nn,Hn=vn,Vn=TypeError,Gn=Object.defineProperty,Xn=Object.getOwnPropertyDescriptor,Yn="enumerable",qn="configurable",Kn="writable";kn.f=Wn?Fn?function(t,e,n){if(zn(t),e=Hn(e),zn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Kn in n&&!n[Kn]){var i=Xn(t,e);i&&i[Kn]&&(t[e]=n.value,n={configurable:qn in n?n[qn]:i[qn],enumerable:Yn in n?n[Yn]:i[Yn],writable:!1})}return Gn(t,e,n)}:Gn:function(t,e,n){if(zn(t),e=Hn(e),zn(n),Un)try{return Gn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Vn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var $n=kn,Zn=_t,Jn=ft?function(t,e,n){return $n.f(t,e,Zn(1,n))}:function(t,e,n){return t[e]=n,t},Qn={exports:{}},ti=ft,ei=Xe,ni=Function.prototype,ii=ti&&Object.getOwnPropertyDescriptor,ri=ei(ni,"name"),si={EXISTS:ri,PROPER:ri&&"something"===function(){}.name,CONFIGURABLE:ri&&(!ti||ti&&ii(ni,"name").configurable)},oi=Kt,ai=Ne,li=Rt(Function.toString);oi(ai.inspectSource)||(ai.inspectSource=function(t){return li(t)});var hi,ci,ui,di=ai.inspectSource,fi=Kt,pi=ct.WeakMap,gi=fi(pi)&&/native code/.test(String(pi)),yi=Ze,vi=Ue("keys"),mi=function(t){return vi[t]||(vi[t]=yi(t))},bi={},xi=gi,wi=ct,Ai=Jt,Si=Jn,_i=Xe,Ti=Ne,Bi=mi,Ci=bi,Pi="Object already initialized",Ri=wi.TypeError,Oi=wi.WeakMap;if(xi||Ti.state){var Mi=Ti.state||(Ti.state=new Oi);Mi.get=Mi.get,Mi.has=Mi.has,Mi.set=Mi.set,hi=function(t,e){if(Mi.has(t))throw Ri(Pi);return e.facade=t,Mi.set(t,e),e},ci=function(t){return Mi.get(t)||{}},ui=function(t){return Mi.has(t)}}else{var Ei=Bi("state");Ci[Ei]=!0,hi=function(t,e){if(_i(t,Ei))throw Ri(Pi);return e.facade=t,Si(t,Ei,e),e},ci=function(t){return _i(t,Ei)?t[Ei]:{}},ui=function(t){return _i(t,Ei)}}var ki={set:hi,get:ci,has:ui,enforce:function(t){return ui(t)?ci(t):hi(t,{})},getterFor:function(t){return function(e){var n;if(!Ai(e)||(n=ci(e)).type!==t)throw Ri("Incompatible receiver, "+t+" required");return n}}},Ii=Rt,ji=dt,Di=Kt,Li=Xe,Ni=ft,Wi=si.CONFIGURABLE,Ui=di,Fi=ki.enforce,zi=ki.get,Hi=String,Vi=Object.defineProperty,Gi=Ii("".slice),Xi=Ii("".replace),Yi=Ii([].join),qi=Ni&&!ji((function(){return 8!==Vi((function(){}),"length",{value:8}).length})),Ki=String(String).split("String"),$i=Qn.exports=function(t,e,n){"Symbol("===Gi(Hi(e),0,7)&&(e="["+Xi(Hi(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Li(t,"name")||Wi&&t.name!==e)&&(Ni?Vi(t,"name",{value:e,configurable:!0}):t.name=e),qi&&n&&Li(n,"arity")&&t.length!==n.arity&&Vi(t,"length",{value:n.arity});try{n&&Li(n,"constructor")&&n.constructor?Ni&&Vi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=Fi(t);return Li(i,"source")||(i.source=Yi(Ki,"string"==typeof e?e:"")),t};Function.prototype.toString=$i((function(){return Di(this)&&zi(this).source||Ui(this)}),"toString");var Zi=Qn.exports,Ji=Kt,Qi=kn,tr=Zi,er=je,nr=function(t,e,n,i){i||(i={});var r=i.enumerable,s=void 0!==i.name?i.name:e;if(Ji(n)&&tr(n,s,i),i.global)r?t[e]=n:er(e,n);else{try{i.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=n:Qi.f(t,e,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t},ir={},rr=Math.ceil,sr=Math.floor,or=Math.trunc||function(t){var e=+t;return(e>0?sr:rr)(e)},ar=function(t){var e=+t;return e!=e||0===e?0:or(e)},lr=ar,hr=Math.max,cr=Math.min,ur=function(t,e){var n=lr(t);return n<0?hr(n+e,0):cr(n,e)},dr=ar,fr=Math.min,pr=function(t){return t>0?fr(dr(t),9007199254740991):0},gr=function(t){return pr(t.length)},yr=Gt,vr=ur,mr=gr,br=function(t){return function(e,n,i){var r,s=yr(e),o=mr(s),a=vr(i,o);if(t&&n!=n){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===n)return t||a||0;return!t&&-1}},xr={includes:br(!0),indexOf:br(!1)},wr=Xe,Ar=Gt,Sr=xr.indexOf,_r=bi,Tr=Rt([].push),Br=function(t,e){var n,i=Ar(t),r=0,s=[];for(n in i)!wr(_r,n)&&wr(i,n)&&Tr(s,n);for(;e.length>r;)wr(i,n=e[r++])&&(~Sr(s,n)||Tr(s,n));return s},Cr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pr=Br,Rr=Cr.concat("length","prototype");ir.f=Object.getOwnPropertyNames||function(t){return Pr(t,Rr)};var Or={};Or.f=Object.getOwnPropertySymbols;var Mr=ee,Er=ir,kr=Or,Ir=Nn,jr=Rt([].concat),Dr=Mr("Reflect","ownKeys")||function(t){var e=Er.f(Ir(t)),n=kr.f;return n?jr(e,n(t)):e},Lr=Xe,Nr=Dr,Wr=ut,Ur=kn,Fr=dt,zr=Kt,Hr=/#|\.prototype\./,Vr=function(t,e){var n=Xr[Gr(t)];return n==qr||n!=Yr&&(zr(e)?Fr(e):!!e)},Gr=Vr.normalize=function(t){return String(t).replace(Hr,".").toLowerCase()},Xr=Vr.data={},Yr=Vr.NATIVE="N",qr=Vr.POLYFILL="P",Kr=Vr,$r=ct,Zr=ut.f,Jr=Jn,Qr=nr,ts=je,es=function(t,e,n){for(var i=Nr(e),r=Ur.f,s=Wr.f,o=0;o<i.length;o++){var a=i[o];Lr(t,a)||n&&Lr(n,a)||r(t,a,s(e,a))}},ns=Kr,is=function(t,e){var n,i,r,s,o,a=t.target,l=t.global,h=t.stat;if(n=l?$r:h?$r[a]||ts(a,{}):($r[a]||{}).prototype)for(i in e){if(s=e[i],r=t.dontCallGetSet?(o=Zr(n,i))&&o.value:n[i],!ns(l?i:a+(h?".":"#")+i,t.forced)&&void 0!==r){if(typeof s==typeof r)continue;es(s,r)}(t.sham||r&&r.sham)&&Jr(s,"sham",!0),Qr(n,i,s,t)}},rs={exports:{}},ss={},os=vn,as=kn,ls=_t,hs=ur,cs=gr,us=function(t,e,n){var i=os(e);i in t?as.f(t,i,ls(0,n)):t[i]=n},ds=Array,fs=Math.max,ps=kt,gs=Gt,ys=ir.f,vs=function(t,e,n){for(var i=cs(t),r=hs(e,i),s=hs(void 0===n?i:n,i),o=ds(fs(s-r,0)),a=0;r<s;r++,a++)us(o,a,t[r]);return o.length=a,o},ms="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ss.f=function(t){return ms&&"Window"==ps(t)?function(t){try{return ys(t)}catch(t){return vs(ms)}}(t):ys(gs(t))};var bs=dt((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),xs=dt,ws=Jt,As=kt,Ss=bs,_s=Object.isExtensible,Ts=xs((function(){_s(1)}))||Ss?function(t){return!!ws(t)&&((!Ss||"ArrayBuffer"!=As(t))&&(!_s||_s(t)))}:_s,Bs=!dt((function(){return Object.isExtensible(Object.preventExtensions({}))})),Cs=is,Ps=Rt,Rs=bi,Os=Jt,Ms=Xe,Es=kn.f,ks=ir,Is=ss,js=Ts,Ds=Bs,Ls=!1,Ns=Ze("meta"),Ws=0,Us=function(t){Es(t,Ns,{value:{objectID:"O"+Ws++,weakData:{}}})},Fs=rs.exports={enable:function(){Fs.enable=function(){},Ls=!0;var t=ks.f,e=Ps([].splice),n={};n[Ns]=1,t(n).length&&(ks.f=function(n){for(var i=t(n),r=0,s=i.length;r<s;r++)if(i[r]===Ns){e(i,r,1);break}return i},Cs({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Is.f}))},fastKey:function(t,e){if(!Os(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Ms(t,Ns)){if(!js(t))return"F";if(!e)return"E";Us(t)}return t[Ns].objectID},getWeakData:function(t,e){if(!Ms(t,Ns)){if(!js(t))return!0;if(!e)return!1;Us(t)}return t[Ns].weakData},onFreeze:function(t){return Ds&&Ls&&js(t)&&!Ms(t,Ns)&&Us(t),t}};Rs[Ns]=!0;var zs=rs.exports,Hs=kt,Vs=Rt,Gs=function(t){if("Function"===Hs(t))return Vs(t)},Xs=_e,Ys=pt,qs=Gs(Gs.bind),Ks=function(t,e){return Xs(t),void 0===e?t:Ys?qs(t,e):function(){return t.apply(e,arguments)}},$s={},Zs=$s,Js=an("iterator"),Qs=Array.prototype,to={};to[an("toStringTag")]="z";var eo="[object z]"===String(to),no=Kt,io=kt,ro=an("toStringTag"),so=Object,oo="Arguments"==io(function(){return arguments}()),ao=eo?io:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=so(t),ro))?n:oo?io(e):"Object"==(i=io(e))&&no(e.callee)?"Arguments":i},lo=ao,ho=Ce,co=Wt,uo=$s,fo=an("iterator"),po=function(t){if(!co(t))return ho(t,fo)||ho(t,"@@iterator")||uo[lo(t)]},go=vt,yo=_e,vo=Nn,mo=xe,bo=po,xo=TypeError,wo=vt,Ao=Nn,So=Ce,_o=Ks,To=vt,Bo=Nn,Co=xe,Po=function(t){return void 0!==t&&(Zs.Array===t||Qs[Js]===t)},Ro=gr,Oo=ne,Mo=function(t,e){var n=arguments.length<2?bo(t):e;if(yo(n))return vo(go(n,t));throw xo(mo(t)+" is not iterable")},Eo=po,ko=function(t,e,n){var i,r;Ao(t);try{if(!(i=So(t,"return"))){if("throw"===e)throw n;return n}i=wo(i,t)}catch(t){r=!0,i=t}if("throw"===e)throw n;if(r)throw i;return Ao(i),n},Io=TypeError,jo=function(t,e){this.stopped=t,this.result=e},Do=jo.prototype,Lo=function(t,e,n){var i,r,s,o,a,l,h,c=n&&n.that,u=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=_o(e,c),y=function(t){return i&&ko(i,"normal",t),new jo(!0,t)},v=function(t){return u?(Bo(t),p?g(t[0],t[1],y):g(t[0],t[1])):p?g(t,y):g(t)};if(d)i=t.iterator;else if(f)i=t;else{if(!(r=Eo(t)))throw Io(Co(t)+" is not iterable");if(Po(r)){for(s=0,o=Ro(t);o>s;s++)if((a=v(t[s]))&&Oo(Do,a))return a;return new jo(!1)}i=Mo(t,r)}for(l=d?t.next:i.next;!(h=To(l,i)).done;){try{a=v(h.value)}catch(t){ko(i,"throw",t)}if("object"==typeof a&&a&&Oo(Do,a))return a}return new jo(!1)},No=ne,Wo=TypeError,Uo=function(t,e){if(No(e,t))return t;throw Wo("Incorrect invocation")},Fo=an("iterator"),zo=!1;try{var Ho=0,Vo={next:function(){return{done:!!Ho++}},return:function(){zo=!0}};Vo[Fo]=function(){return this},Array.from(Vo,(function(){throw 2}))}catch(t){}var Go=kn.f,Xo=Xe,Yo=an("toStringTag"),qo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!Xo(t,Yo)&&Go(t,Yo,{configurable:!0,value:e})},Ko=Rt,$o=_e,Zo=Kt,Jo=String,Qo=TypeError,ta=function(t,e,n){try{return Ko($o(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},ea=Nn,na=function(t){if("object"==typeof t||Zo(t))return t;throw Qo("Can't set "+Jo(t)+" as a prototype")},ia=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=ta(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return ea(n),na(i),e?t(n,i):n.__proto__=i,n}}():void 0),ra=Kt,sa=Jt,oa=ia,aa=is,la=ct,ha=Rt,ca=Kr,ua=nr,da=zs,fa=Lo,pa=Uo,ga=Kt,ya=Wt,va=Jt,ma=dt,ba=function(t,e){if(!e&&!zo)return!1;var n=!1;try{var i={};i[Fo]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n},xa=qo,wa=function(t,e,n){var i,r;return oa&&ra(i=e.constructor)&&i!==n&&sa(r=i.prototype)&&r!==n.prototype&&oa(t,r),t},Aa=function(t,e,n){var i=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=i?"set":"add",o=la[t],a=o&&o.prototype,l=o,h={},c=function(t){var e=ha(a[t]);ua(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!va(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!va(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!va(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(ca(t,!ga(o)||!(r||a.forEach&&!ma((function(){(new o).entries().next()})))))l=n.getConstructor(e,t,i,s),da.enable();else if(ca(t,!0)){var u=new l,d=u[s](r?{}:-0,1)!=u,f=ma((function(){u.has(1)})),p=ba((function(t){new o(t)})),g=!r&&ma((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));p||((l=e((function(t,e){pa(t,a);var n=wa(new o,t,l);return ya(e)||fa(e,n[s],{that:n,AS_ENTRIES:i}),n}))).prototype=a,a.constructor=l),(f||g)&&(c("delete"),c("has"),i&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return h[t]=l,aa({global:!0,constructor:!0,forced:l!=o},h),xa(l,t),r||n.setStrong(l,t,i),l},Sa={},_a=Br,Ta=Cr,Ba=Object.keys||function(t){return _a(t,Ta)},Ca=ft,Pa=In,Ra=kn,Oa=Nn,Ma=Gt,Ea=Ba;Sa.f=Ca&&!Pa?Object.defineProperties:function(t,e){Oa(t);for(var n,i=Ma(e),r=Ea(e),s=r.length,o=0;s>o;)Ra.f(t,n=r[o++],i[n]);return t};var ka,Ia=ee("document","documentElement"),ja=Nn,Da=Sa,La=Cr,Na=bi,Wa=Ia,Ua=wn,Fa="prototype",za="script",Ha=mi("IE_PROTO"),Va=function(){},Ga=function(t){return"<"+za+">"+t+"</"+za+">"},Xa=function(t){t.write(Ga("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ya=function(){try{ka=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Ya="undefined"!=typeof document?document.domain&&ka?Xa(ka):(e=Ua("iframe"),n="java"+za+":",e.style.display="none",Wa.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Ga("document.F=Object")),t.close(),t.F):Xa(ka);for(var i=La.length;i--;)delete Ya[Fa][La[i]];return Ya()};Na[Ha]=!0;var qa,Ka,$a,Za=Object.create||function(t,e){var n;return null!==t?(Va[Fa]=ja(t),n=new Va,Va[Fa]=null,n[Ha]=t):n=Ya(),void 0===e?n:Da.f(n,e)},Ja=Zi,Qa=kn,tl=function(t,e,n){return n.get&&Ja(n.get,e,{getter:!0}),n.set&&Ja(n.set,e,{setter:!0}),Qa.f(t,e,n)},el=nr,nl=function(t,e,n){for(var i in e)el(t,i,e[i],n);return t},il=!dt((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),rl=Xe,sl=Kt,ol=He,al=il,ll=mi("IE_PROTO"),hl=Object,cl=hl.prototype,ul=al?hl.getPrototypeOf:function(t){var e=ol(t);if(rl(e,ll))return e[ll];var n=e.constructor;return sl(n)&&e instanceof n?n.prototype:e instanceof hl?cl:null},dl=dt,fl=Kt,pl=Jt,gl=ul,yl=nr,vl=an("iterator"),ml=!1;[].keys&&("next"in($a=[].keys())?(Ka=gl(gl($a)))!==Object.prototype&&(qa=Ka):ml=!0);var bl=!pl(qa)||dl((function(){var t={};return qa[vl].call(t)!==t}));bl&&(qa={}),fl(qa[vl])||yl(qa,vl,(function(){return this}));var xl={IteratorPrototype:qa,BUGGY_SAFARI_ITERATORS:ml},wl=xl.IteratorPrototype,Al=Za,Sl=_t,_l=qo,Tl=$s,Bl=function(){return this},Cl=is,Pl=vt,Rl=Kt,Ol=function(t,e,n,i){var r=e+" Iterator";return t.prototype=Al(wl,{next:Sl(+!i,n)}),_l(t,r,!1),Tl[r]=Bl,t},Ml=ul,El=ia,kl=qo,Il=Jn,jl=nr,Dl=$s,Ll=si.PROPER,Nl=si.CONFIGURABLE,Wl=xl.IteratorPrototype,Ul=xl.BUGGY_SAFARI_ITERATORS,Fl=an("iterator"),zl="keys",Hl="values",Vl="entries",Gl=function(){return this},Xl=ee,Yl=tl,ql=ft,Kl=an("species"),$l=Za,Zl=tl,Jl=nl,Ql=Ks,th=Uo,eh=Wt,nh=Lo,ih=function(t,e,n,i,r,s,o){Ol(n,e,i);var a,l,h,c=function(t){if(t===r&&g)return g;if(!Ul&&t in f)return f[t];switch(t){case zl:case Hl:case Vl:return function(){return new n(this,t)}}return function(){return new n(this)}},u=e+" Iterator",d=!1,f=t.prototype,p=f[Fl]||f["@@iterator"]||r&&f[r],g=!Ul&&p||c(r),y="Array"==e&&f.entries||p;if(y&&(a=Ml(y.call(new t)))!==Object.prototype&&a.next&&(Ml(a)!==Wl&&(El?El(a,Wl):Rl(a[Fl])||jl(a,Fl,Gl)),kl(a,u,!0)),Ll&&r==Hl&&p&&p.name!==Hl&&(Nl?Il(f,"name",Hl):(d=!0,g=function(){return Pl(p,this)})),r)if(l={values:c(Hl),keys:s?g:c(zl),entries:c(Vl)},o)for(h in l)(Ul||d||!(h in f))&&jl(f,h,l[h]);else Cl({target:e,proto:!0,forced:Ul||d},l);return f[Fl]!==g&&jl(f,Fl,g,{name:r}),Dl[e]=g,l},rh=function(t,e){return{value:t,done:e}},sh=function(t){var e=Xl(t);ql&&e&&!e[Kl]&&Yl(e,Kl,{configurable:!0,get:function(){return this}})},oh=ft,ah=zs.fastKey,lh=ki.set,hh=ki.getterFor,ch={getConstructor:function(t,e,n,i){var r=t((function(t,r){th(t,s),lh(t,{type:e,index:$l(null),first:void 0,last:void 0,size:0}),oh||(t.size=0),eh(r)||nh(r,t[i],{that:t,AS_ENTRIES:n})})),s=r.prototype,o=hh(e),a=function(t,e,n){var i,r,s=o(t),a=l(t,e);return a?a.value=n:(s.last=a={index:r=ah(e,!0),key:e,value:n,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=a),i&&(i.next=a),oh?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},l=function(t,e){var n,i=o(t),r=ah(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return Jl(s,{clear:function(){for(var t=o(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,oh?t.size=0:this.size=0},delete:function(t){var e=this,n=o(e),i=l(e,t);if(i){var r=i.next,s=i.previous;delete n.index[i.index],i.removed=!0,s&&(s.next=r),r&&(r.previous=s),n.first==i&&(n.first=r),n.last==i&&(n.last=s),oh?n.size--:e.size--}return!!i},forEach:function(t){for(var e,n=o(this),i=Ql(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!l(this,t)}}),Jl(s,n?{get:function(t){var e=l(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)}}),oh&&Zl(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,n){var i=e+" Iterator",r=hh(e),s=hh(i);ih(t,e,(function(t,e){lh(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?rh("keys"==e?n.key:"values"==e?n.value:[n.key,n.value],!1):(t.target=void 0,rh(void 0,!0))}),n?"entries":"values",!n,!0),sh(e)}};Aa("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ch);var uh=kt,dh=Array.isArray||function(t){return"Array"==uh(t)},fh=Rt,ph=dt,gh=Kt,yh=ao,vh=di,mh=function(){},bh=[],xh=ee("Reflect","construct"),wh=/^\s*(?:class|function)\b/,Ah=fh(wh.exec),Sh=!wh.exec(mh),_h=function(t){if(!gh(t))return!1;try{return xh(mh,bh,t),!0}catch(t){return!1}},Th=function(t){if(!gh(t))return!1;switch(yh(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sh||!!Ah(wh,vh(t))}catch(t){return!0}};Th.sham=!0;var Bh=!xh||ph((function(){var t;return _h(_h.call)||!_h(Object)||!_h((function(){t=!0}))||t}))?Th:_h,Ch=dh,Ph=Bh,Rh=Jt,Oh=an("species"),Mh=Array,Eh=function(t){var e;return Ch(t)&&(e=t.constructor,(Ph(e)&&(e===Mh||Ch(e.prototype))||Rh(e)&&null===(e=e[Oh]))&&(e=void 0)),void 0===e?Mh:e},kh=Ks,Ih=Nt,jh=He,Dh=gr,Lh=function(t,e){return new(Eh(t))(0===e?0:e)},Nh=Rt([].push),Wh=function(t){var e=1==t,n=2==t,i=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(l,h,c,u){for(var d,f,p=jh(l),g=Ih(p),y=kh(h,c),v=Dh(g),m=0,b=u||Lh,x=e?b(l,v):n||o?b(l,0):void 0;v>m;m++)if((a||m in g)&&(f=y(d=g[m],m,p),t))if(e)x[m]=f;else if(f)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:Nh(x,d)}else switch(t){case 4:return!1;case 7:Nh(x,d)}return s?-1:i||r?r:x}},Uh={forEach:Wh(0),map:Wh(1),filter:Wh(2),some:Wh(3),every:Wh(4),find:Wh(5),findIndex:Wh(6),filterReject:Wh(7)},Fh=Rt,zh=nl,Hh=zs.getWeakData,Vh=Uo,Gh=Nn,Xh=Wt,Yh=Jt,qh=Lo,Kh=Xe,$h=ki.set,Zh=ki.getterFor,Jh=Uh.find,Qh=Uh.findIndex,tc=Fh([].splice),ec=0,nc=function(t){return t.frozen||(t.frozen=new ic)},ic=function(){this.entries=[]},rc=function(t,e){return Jh(t.entries,(function(t){return t[0]===e}))};ic.prototype={get:function(t){var e=rc(this,t);if(e)return e[1]},has:function(t){return!!rc(this,t)},set:function(t,e){var n=rc(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=Qh(this.entries,(function(e){return e[0]===t}));return~e&&tc(this.entries,e,1),!!~e}};var sc,oc={getConstructor:function(t,e,n,i){var r=t((function(t,r){Vh(t,s),$h(t,{type:e,id:ec++,frozen:void 0}),Xh(r)||qh(r,t[i],{that:t,AS_ENTRIES:n})})),s=r.prototype,o=Zh(e),a=function(t,e,n){var i=o(t),r=Hh(Gh(e),!0);return!0===r?nc(i).set(e,n):r[i.id]=n,t};return zh(s,{delete:function(t){var e=o(this);if(!Yh(t))return!1;var n=Hh(t);return!0===n?nc(e).delete(t):n&&Kh(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!Yh(t))return!1;var n=Hh(t);return!0===n?nc(e).has(t):n&&Kh(n,e.id)}}),zh(s,n?{get:function(t){var e=o(this);if(Yh(t)){var n=Hh(t);return!0===n?nc(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},ac=Bs,lc=ct,hc=Rt,cc=nl,uc=zs,dc=Aa,fc=oc,pc=Jt,gc=ki.enforce,yc=dt,vc=gi,mc=Object,bc=Array.isArray,xc=mc.isExtensible,wc=mc.isFrozen,Ac=mc.isSealed,Sc=mc.freeze,_c=mc.seal,Tc={},Bc={},Cc=!lc.ActiveXObject&&"ActiveXObject"in lc,Pc=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Rc=dc("WeakMap",Pc,fc),Oc=Rc.prototype,Mc=hc(Oc.set);if(vc)if(Cc){sc=fc.getConstructor(Pc,"WeakMap",!0),uc.enable();var Ec=hc(Oc.delete),kc=hc(Oc.has),Ic=hc(Oc.get);cc(Oc,{delete:function(t){if(pc(t)&&!xc(t)){var e=gc(this);return e.frozen||(e.frozen=new sc),Ec(this,t)||e.frozen.delete(t)}return Ec(this,t)},has:function(t){if(pc(t)&&!xc(t)){var e=gc(this);return e.frozen||(e.frozen=new sc),kc(this,t)||e.frozen.has(t)}return kc(this,t)},get:function(t){if(pc(t)&&!xc(t)){var e=gc(this);return e.frozen||(e.frozen=new sc),kc(this,t)?Ic(this,t):e.frozen.get(t)}return Ic(this,t)},set:function(t,e){if(pc(t)&&!xc(t)){var n=gc(this);n.frozen||(n.frozen=new sc),kc(this,t)?Mc(this,t,e):n.frozen.set(t,e)}else Mc(this,t,e);return this}})}else ac&&yc((function(){var t=Sc([]);return Mc(new Rc,t,1),!wc(t)}))&&cc(Oc,{set:function(t,e){var n;return bc(t)&&(wc(t)?n=Tc:Ac(t)&&(n=Bc)),Mc(this,t,e),n==Tc&&Sc(t),n==Bc&&_c(t),this}});var jc=ee,Dc=Rt,Lc=Ue,Nc=jc("Map"),Wc=jc("WeakMap"),Uc=Dc([].push),Fc=Lc("metadata"),zc=Fc.store||(Fc.store=new Wc),Hc=function(t,e,n){var i=zc.get(t);if(!i){if(!n)return;zc.set(t,i=new Nc)}var r=i.get(e);if(!r){if(!n)return;i.set(e,r=new Nc)}return r},Vc={store:zc,getMap:Hc,has:function(t,e,n){var i=Hc(e,n,!1);return void 0!==i&&i.has(t)},get:function(t,e,n){var i=Hc(e,n,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,n,i){Hc(n,i,!0).set(t,e)},keys:function(t,e){var n=Hc(t,e,!1),i=[];return n&&n.forEach((function(t,e){Uc(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}},Gc=Nn,Xc=Vc.toKey,Yc=Vc.set;is({target:"Reflect",stat:!0},{defineMetadata:function(t,e,n){var i=arguments.length<4?void 0:Xc(arguments[3]);Yc(t,e,Gc(n),i)}});var qc=Nn,Kc=Vc.toKey,$c=Vc.getMap,Zc=Vc.store;is({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var n=arguments.length<3?void 0:Kc(arguments[2]),i=$c(qc(e),n,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var r=Zc.get(e);return r.delete(n),!!r.size||Zc.delete(e)}});var Jc=Nn,Qc=ul,tu=Vc.has,eu=Vc.get,nu=Vc.toKey,iu=function(t,e,n){if(tu(t,e,n))return eu(t,e,n);var i=Qc(e);return null!==i?iu(t,i,n):void 0};is({target:"Reflect",stat:!0},{getMetadata:function(t,e){var n=arguments.length<3?void 0:nu(arguments[2]);return iu(t,Jc(e),n)}});var ru=Rt,su=Map.prototype,ou={Map:Map,set:ru(su.set),get:ru(su.get),has:ru(su.has),remove:ru(su.delete),proto:su},au=vt,lu=Rt,hu=function(t,e,n){for(var i,r,s=n||t.next;!(i=au(s,t)).done;)if(void 0!==(r=e(i.value)))return r},cu=ou.Map,uu=ou.proto,du=lu(uu.forEach),fu=lu(uu.entries),pu=fu(new cu).next,gu=_e,yu=Wt,vu=gr,mu=He,bu=function(t,e,n){return n?hu(fu(t),(function(t){return e(t[1],t[0])}),pu):du(t,e)},xu=ou.Map,wu=ou.has,Au=ou.set,Su=Rt([].push),_u=is,Tu=Rt,Bu=Vc,Cu=Nn,Pu=ul,Ru=Tu((function(t){var e,n,i,r=mu(this),s=vu(r),o=[],a=new xu,l=yu(t)?function(t){return t}:gu(t);for(e=0;e<s;e++)i=l(n=r[e]),wu(a,i)||Au(a,i,n);return bu(a,(function(t){Su(o,t)})),o})),Ou=Tu([].concat),Mu=Bu.keys,Eu=Bu.toKey,ku=function(t,e){var n=Mu(t,e),i=Pu(t);if(null===i)return n;var r=ku(i,e);return r.length?n.length?Ru(Ou(n,r)):r:n};_u({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Eu(arguments[1]);return ku(Cu(t),e)}});var Iu=Nn,ju=Vc.get,Du=Vc.toKey;is({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var n=arguments.length<3?void 0:Du(arguments[2]);return ju(t,Iu(e),n)}});var Lu=Nn,Nu=Vc.keys,Wu=Vc.toKey;is({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:Wu(arguments[1]);return Nu(Lu(t),e)}});var Uu=Nn,Fu=ul,zu=Vc.has,Hu=Vc.toKey,Vu=function(t,e,n){if(zu(t,e,n))return!0;var i=Fu(e);return null!==i&&Vu(t,i,n)};is({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var n=arguments.length<3?void 0:Hu(arguments[2]);return Vu(t,Uu(e),n)}});var Gu=Nn,Xu=Vc.has,Yu=Vc.toKey;is({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var n=arguments.length<3?void 0:Yu(arguments[2]);return Xu(t,Gu(e),n)}});var qu=Nn,Ku=Vc.toKey,$u=Vc.set;is({target:"Reflect",stat:!0},{metadata:function(t,e){return function(n,i){$u(t,e,qu(n),Ku(i))}}});var Zu="named",Ju="name",Qu="unmanaged",td="optional",ed="inject",nd="multi_inject",id="inversify:tagged",rd="inversify:tagged_props",sd="inversify:paramtypes",od="post_construct",ad="pre_destroy";var ld=[ed,nd,Ju,Qu,Zu,td],hd={Request:"Request",Singleton:"Singleton",Transient:"Transient"},cd={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},ud={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},dd=0;function fd(){return dd++}var pd=function(){function t(t,e){this.id=fd(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=cd.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===hd.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}(),gd="Metadata key was used more than once in a parameter:",yd="NULL argument",vd="Key Not Found",md="Ambiguous match found for serviceIdentifier:",bd="No matching bindings found for serviceIdentifier:",xd="Missing required @injectable annotation in:",wd="Missing required @inject or @multiInject annotation in:",Ad="Circular dependency found:",Sd="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",_d=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."},Td=function(t,e){return"@postConstruct error in class "+t+": "+e},Bd=function(t,e){return"@preDestroy error in class "+t+": "+e},Cd=function(t,e){return"onDeactivation() error in class "+t+": "+e},Pd="Maximum call stack size exceeded",Rd=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(sd,t),userGeneratedMetadata:Reflect.getMetadata(id,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(rd,t)||[]},t}(),Od={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Md(t){return t instanceof RangeError||t.message===Pd}function Ed(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function kd(t,e,n){var i="",r=n(t,e);return 0!==r.length&&(i="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Dd(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i}function Id(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Id(t.parentRequest,e))}function jd(t){t.childRequests.forEach((function(t){if(Id(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,n){void 0===n&&(n=[]);var i=Ed(e.serviceIdentifier);return n.push(i),null!==e.parentRequest?t(e.parentRequest,n):n}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Ad+" "+e)}jd(t)}))}function Dd(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}var Ld=function(){function t(t){this.id=fd(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),Nd=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===Zu?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Wd=function(t,e){this.parentContext=t,this.rootRequest=e},Ud=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Fd=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,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},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}(),zd=function(){function t(t,e,n,i){this.id=fd(),this.type=t,this.serviceIdentifier=n;var r="symbol"==typeof e?e.toString().slice(7,-1):e;this.name=new Fd(r||""),this.identifier=e,this.metadata=new Array;var s=null;"string"==typeof i?s=new Nd(Zu,i):i instanceof Nd&&(s=i),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(nd)},t.prototype.matchesArray=function(t){return this.matchesTag(nd)(t)},t.prototype.isNamed=function(){return this.hasTag(Zu)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return ld.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(td)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===Zu}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return ld.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(Zu)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;i<r.length;i++){var s=r[i];if(s.key===t&&s.value===n)return!0}return!1}},t}(),Hd=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function Vd(t,e,n,i){var r=t.getConstructorMetadata(n),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(xd+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),l=0===n.length&&a.length>0,h=a.length>n.length,c=function(t,e,n,i,r){for(var s=[],o=0;o<r;o++){var a=Gd(o,t,e,n,i);null!==a&&s.push(a)}return s}(i,e,s,o,l||h?a.length:n.length),u=Yd(t,n,e);return Hd(Hd([],c,!0),u,!0)}function Gd(t,e,n,i,r){var s=r[t.toString()]||[],o=Kd(s),a=!0!==o.unmanaged,l=i[t],h=o.inject||o.multiInject;if((l=h||l)instanceof Ud&&(l=l.unwrap()),a){if(!e&&(l===Object||l===Function||void 0===l))throw new Error(wd+" argument "+t+" in class "+n+".");var c=new zd(ud.ConstructorArgument,o.targetName,l);return c.metadata=s,c}return null}function Xd(t,e,n,i){var r=t||e;if(void 0===r){var s=xd+" for property "+String(n)+" in class "+i+".";throw new Error(s)}return r}function Yd(t,e,n){for(var i=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(i),o=0,a=Object.keys(i).concat(s);o<a.length;o++){var l=a[o],h=i[l],c=Kd(h),u=c.targetName||l,d=Xd(c.inject,c.multiInject,l,n),f=new zd(ud.ClassProperty,u,d);f.metadata=h,r.push(f)}var p=Object.getPrototypeOf(e.prototype).constructor;if(p!==Object){var g=Yd(t,p,n);r=Hd(Hd([],r,!0),g,!0)}return r}function qd(t,e){var n=Object.getPrototypeOf(e.prototype).constructor;if(n!==Object){var i=Vd(t,Dd(n),n,!0),r=i.map((function(t){return t.metadata.filter((function(t){return t.key===Qu}))})),s=[].concat.apply([],r).length,o=i.length-s;return o>0?o:qd(t,n)}return 0}function Kd(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[ed],multiInject:e[nd],targetName:e[Ju],unmanaged:e[Qu]}}var $d=function(){function t(t,e,n,i,r){this.id=fd(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();function Zd(t){return t._bindingDictionary}function Jd(t,e,n,i,r){var s=tf(n.container,r.serviceIdentifier),o=[];return s.length===Od.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),s=tf(n.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new $d(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case Od.NoBindingsAvailable:if(n.isOptional())return e;var r=Ed(t),s=bd;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t}(r,n),s+=kd(i,r,tf),new Error(s);case Od.OnlyOneBindingAvailable:return e;case Od.MultipleBindingsAvailable:default:if(n.isArray())return e;r=Ed(t),s=md+" "+r;throw s+=kd(i,r,tf),new Error(s)}}(r.serviceIdentifier,o,r,n.container),o}function Qd(t,e,n,i,r,s){var o,a;if(null===r){o=Jd(t,e,i,null,s),a=new $d(n,i,null,o,s);var l=new Wd(i,a);i.addPlan(l)}else o=Jd(t,e,i,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var n=null;if(s.isArray())n=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;n=a}if(e.type===cd.Instance&&null!==e.implementationType){var r=function(t,e){return Vd(t,Dd(e),e,!1)}(t,e.implementationType);if(!i.container.options.skipBaseClassChecks){var o=qd(t,e.implementationType);if(r.length<o){var l=_d(Dd(e.implementationType));throw new Error(l)}}r.forEach((function(e){Qd(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function tf(t,e){var n=[],i=Zd(t);return i.hasKey(e)?n=i.get(e):null!==t.parent&&(n=tf(t.parent,e)),n}function ef(t,e,n,i,r,s,o,a){void 0===a&&(a=!1);var l=new Ld(e),h=function(t,e,n,i,r,s){var o=new Nd(t?nd:ed,n),a=new zd(e,i,n,o);if(void 0!==r){var l=new Nd(r,s);a.metadata.push(l)}return a}(n,i,r,"",s,o);try{return Qd(t,a,r,l,null,h),l}catch(t){throw Md(t)&&jd(l.plan.rootRequest),t}}function nf(t){return("object"==typeof t&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function rf(t){return!!nf(t)||Array.isArray(t)&&t.some(nf)}var sf,of=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},af=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},lf=function(t,e,n){t.has(e.id)||t.set(e.id,n)},hf=function(t,e){t.cache=e,t.activated=!0,nf(e)&&cf(t,e)},cf=function(t,e){return of(void 0,void 0,void 0,(function(){var n,i;return af(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return n=r.sent(),t.cache=n,[3,3];case 2:throw i=r.sent(),t.cache=null,t.activated=!1,i;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(sf||(sf={}));var uf=function(){return uf=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},uf.apply(this,arguments)},df=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},ff=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},pf=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function gf(t,e,n){var i;if(e.length>0){var r=function(t,e){return t.reduce((function(t,n){var i=e(n);return n.target.type===ud.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=rf(i)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,n),s=uf(uf({},r),{constr:t});i=r.isAsync?function(t){return df(this,void 0,void 0,(function(){var e,n;return ff(this,(function(i){switch(i.label){case 0:return[4,vf(t.constructorInjections)];case 1:return e=i.sent(),[4,vf(t.propertyInjections)];case 2:return n=i.sent(),[2,yf(uf(uf({},t),{constructorInjections:e,propertyInjections:n}))]}}))}))}(s):yf(s)}else i=new t;return i}function yf(t){var e,n=new((e=t.constr).bind.apply(e,pf([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,i){var r=e.target.identifier,s=t.propertyInjections[i];n[r]=s})),n}function vf(t){return df(this,void 0,void 0,(function(){var e,n,i,r;return ff(this,(function(s){for(e=[],n=0,i=t;n<i.length;n++)r=i[n],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function mf(t,e){var n=function(t,e){var n,i;if(Reflect.hasMetadata(od,t)){var r=Reflect.getMetadata(od,t);try{return null===(i=(n=e)[r.value])||void 0===i?void 0:i.call(n)}catch(e){throw new Error(Td(t.name,e.message))}}}(t,e);return nf(n)?n.then((function(){return e})):e}function bf(t,e){t.scope!==hd.Singleton&&function(t,e){var n="Class cannot be instantiated in "+(t.scope===hd.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Cd(e.name,n));if(Reflect.hasMetadata(ad,e))throw new Error(Bd(e.name,n))}(t,e)}var xf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},wf=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Af=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,i=e.childRequests,r=e.target&&e.target.isArray(),s=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(r&&s)return i.map((function(e){return Af(t)(e)}));if(!e.target.isOptional()||0!==n.length){var o=n[0];return Bf(t,e,o)}}},Sf=function(t,e){var n=function(t){switch(t.type){case cd.Factory:return{factory:t.factory,factoryType:sf.Factory};case cd.Provider:return{factory:t.provider,factoryType:sf.Provider};case cd.DynamicValue:return{factory:t.dynamicValue,factoryType:sf.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Md(t)&&(t=e()),t}}((function(){return n.factory.bind(t)(e)}),(function(){return new Error((t=n.factoryType,i=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+i+"'."));var t,i}))},_f=function(t,e,n){var i,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case cd.ConstantValue:case cd.Function:e=t.cache;break;case cd.Constructor:case cd.Instance:e=t.implementationType;break;case cd.DynamicValue:e=t.dynamicValue;break;case cd.Provider:e=t.provider;break;case cd.Factory:e=t.factory}if(null===e){var n=Ed(t.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case cd.ConstantValue:case cd.Function:i=n.cache;break;case cd.Constructor:i=n.implementationType;break;case cd.Instance:i=function(t,e,n,i){bf(t,e);var r=gf(e,n,i);return nf(r)?r.then((function(t){return mf(e,t)})):mf(e,r)}(n,n.implementationType,r,Af(t));break;default:i=Sf(n,e.parentContext)}return i},Tf=function(t,e,n){var i=function(t,e){return e.scope===hd.Singleton&&e.activated?e.cache:e.scope===hd.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==i||function(t,e,n){e.scope===hd.Singleton&&hf(e,n),e.scope===hd.Request&&lf(t,e,n)}(t,e,i=n()),i},Bf=function(t,e,n){return Tf(t,n,(function(){var i=_f(t,e,n);return i=nf(i)?i.then((function(t){return Cf(e,n,t)})):Cf(e,n,i)}))};function Cf(t,e,n){var i,r=Pf(t.parentContext,e,n),s=Ef(t.parentContext.container),o=s.next();do{i=o.value;var a=t.parentContext,l=t.serviceIdentifier,h=Mf(i,l);r=nf(r)?Of(h,a,r):Rf(h,a,r),o=s.next()}while(!0!==o.done&&!Zd(i).hasKey(t.serviceIdentifier));return r}var Pf=function(t,e,n){return"function"==typeof e.onActivation?e.onActivation(t,n):n},Rf=function(t,e,n){for(var i=t.next();!i.done;){if(nf(n=i.value(e,n)))return Of(t,e,n);i=t.next()}return n},Of=function(t,e,n){return xf(void 0,void 0,void 0,(function(){var i,r;return wf(this,(function(s){switch(s.label){case 0:return[4,n];case 1:i=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,i)];case 3:return i=s.sent(),r=t.next(),[3,2];case 4:return[2,i]}}))}))},Mf=function(t,e){var n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},Ef=function(t){for(var e=[t],n=t.parent;null!==n;)e.push(n),n=n.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var kf=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||kf(n,e))},If=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new Nd(t,e),n}},jf=If(Zu),Df=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var i=e.bindings[0].implementationType;return t===i}return!1}},Lf=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Nf(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=jf(t),new Nf(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 Nf(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=If(t)(e),new Nf(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Df(t)(e.parentRequest)},new Nf(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&jf(t)(e.parentRequest)},new Nf(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&If(t)(e)(n.parentRequest)},new Nf(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&kf(e,Df(t))},new Nf(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!kf(e,Df(t))},new Nf(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&kf(e,jf(t))},new Nf(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!kf(e,jf(t))},new Nf(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&kf(n,If(t)(e))},new Nf(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&!kf(n,If(t)(e))},new Nf(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&kf(e,t)},new Nf(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!kf(e,t)},new Nf(this._binding)},t}(),Nf=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Lf(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Lf(this._binding)},t}(),Wf=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Lf(this._binding),this._bindingOnSyntax=new Nf(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}(),Uf=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=hd.Request,new Wf(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=hd.Transient,new Wf(this._binding)},t}(),Ff=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Lf(this._binding),this._bindingOnSyntax=new Nf(this._binding),this._bindingInSyntax=new Uf(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}(),zf=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=cd.Instance,this._binding.implementationType=t,new Ff(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=cd.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=cd.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ff(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=cd.Constructor,this._binding.implementationType=t,this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=cd.Factory,this._binding.factory=t,this._binding.scope=hd.Singleton,new Wf(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=cd.Function,this._binding.scope=hd.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=cd.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=cd.Factory,this._binding.factory=function(e){return function(n){return e.container.getNamed(t,n)}},new Wf(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=cd.Provider,this._binding.provider=t,this._binding.scope=hd.Singleton,new Wf(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Hf=function(){function t(){}return t.of=function(e,n,i,r,s){var o=new t;return o.bindings=e,o.middleware=n,o.deactivations=r,o.activations=i,o.moduleActivationStore=s,o},t}();var Vf=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(yd);if(null==e)throw new Error(yd);var n=this._map.get(t);void 0!==n?n.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(yd);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(vd)},t.prototype.remove=function(t){if(null==t)throw new Error(yd);if(!this._map.delete(t))throw new Error(vd)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(n,i){var r=t.hasKey(n)?t.get(n):void 0;if(void 0!==r){var s=i.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(n,s)}}))},t.prototype.removeByCondition=function(t){var e=this,n=[];return this._map.forEach((function(i,r){for(var s=[],o=0,a=i;o<a.length;o++){var l=a[o];t(l)?n.push(l):s.push(l)}e._setValue(r,s)})),n},t.prototype.hasKey=function(t){if(null==t)throw new Error(yd);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,"object"==typeof(i=t)&&null!==i&&"clone"in i&&"function"==typeof i.clone?t.clone():t);var i}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Gf=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,n){this._getModuleActivationHandlers(t).onDeactivations.add(e,n)},t.prototype.addActivation=function(t,e,n){this._getModuleActivationHandlers(t).onActivations.add(e,n)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){e._map.set(n,{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 Vf,onDeactivations:new Vf}},t}(),Xf=function(){return Xf=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Xf.apply(this,arguments)},Yf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},qf=function(t,e){var n,i,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(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=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++,i=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],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Kf=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},$f=function(){function t(t){var e=t||{};if("object"!=typeof e)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=hd.Transient;else if(e.defaultScope!==hd.Singleton&&e.defaultScope!==hd.Transient&&e.defaultScope!==hd.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=fd(),this._bindingDictionary=new Vf,this._snapshots=[],this._middleware=null,this._activations=new Vf,this._deactivations=new Vf,this.parent=null,this._metadataReader=new Rd,this._moduleActivationStore=new Gf}return t.merge=function(e,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var s=new t,o=Kf([e,n],i,!0).map((function(t){return Zd(t)})),a=Zd(s);return o.forEach((function(t){var e;e=a,t.traverse((function(t,n){n.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 n=this._getContainerModuleHelpersFactory(),i=0,r=t;i<r.length;i++){var s=r[i],o=n(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 Yf(this,void 0,void 0,(function(){var e,n,i,r,s;return qf(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,o.label=1;case 1:return n<i.length?(r=i[n],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 n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){var n=t._removeModuleBindings(e.id);t._deactivateSingletons(n),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yf(this,void 0,void 0,(function(){var e,n,i,r;return qf(this,(function(s){switch(s.label){case 0:e=0,n=t,s.label=1;case 1:return e<n.length?(i=n[e],r=this._removeModuleBindings(i.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(i.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||hd.Transient,n=new pd(t,e);return this._bindingDictionary.add(t,n),new zf(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Yf(this,void 0,void 0,(function(){return qf(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 Yf(this,void 0,void 0,(function(){var e;return qf(this,(function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,n){t._deactivateSingletons(n)})),this._bindingDictionary=new Vf},t.prototype.unbindAllAsync=function(){return Yf(this,void 0,void 0,(function(){var t,e=this;return qf(this,(function(n){switch(n.label){case 0:return t=[],this._bindingDictionary.traverse((function(n,i){t.push(e._deactivateSingletonsAsync(i))})),[4,Promise.all(t)];case 1:return n.sent(),this._bindingDictionary=new Vf,[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,Zu,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,n,i){var r=new zd(ud.Variable,"",e,new Nd(n,i)),s=new Ld(t);return new $d(e,s,null,[],r)}(this,t,e,n);i=r.some((function(t){return t.constraint(s)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(Hf.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 n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},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 Yf(this,void 0,void 0,(function(){var e;return qf(this,(function(n){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,n){var i=this._getNotAllArgs(t,!1,e,n);return this._getButThrowIfAsync(i)},t.prototype.getTaggedAsync=function(t,e,n){return Yf(this,void 0,void 0,(function(){var i;return qf(this,(function(r){return i=this._getNotAllArgs(t,!1,e,n),[2,this._get(i)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,Zu,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,Zu,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,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getButThrowIfAsync(i)},t.prototype.getAllTaggedAsync=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getAll(i)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,Zu,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,Zu,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var n=this.get(t);return e||this.unbind(t),n},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(ad,t))return e[Reflect.getMetadata(ad,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 n=this,i=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(nf(r))return this._handleDeactivationError(r.then((function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,i)})),i)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(nf(s))return this._handleDeactivationError(s,i)}catch(t){throw new Error(Cd(i.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Yf(this,void 0,void 0,(function(){var n;return qf(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),new Error(Cd(e.name,n.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var n=this,i=e.next();i.value;){var r=i.value(t);if(nf(r))return r.then((function(){return n._deactivateContainerAsync(t,e)}));i=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Yf(this,void 0,void 0,(function(){var n;return qf(this,(function(i){switch(i.label){case 0:n=e.next(),i.label=1;case 1:return n.value?[4,n.value(t)]:[3,3];case 2:return i.sent(),n=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}},i=function(e){return function(n,i){t._moduleActivationStore.addActivation(e,n,i),t.onActivation(n,i)}},r=function(e){return function(n,i){t._moduleActivationStore.addDeactivation(e,n,i),t.onDeactivation(n,i)}};return function(s){return{bindFunction:(o=s,function(n){var i=t.bind(n);return e(i,o),i}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:i(s),onDeactivationFunction:r(s),rebindFunction:n(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=Xf(Xf({},t),{contextInterceptor:function(t){return t},targetType:ud.Variable});if(this._middleware){var n=this._middleware(e);if(null==n)throw new Error("Invalid return type in middleware. Middleware must return!");return n}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(rf(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,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=ef(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Af(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(n=e.contextInterceptor(n))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return nf(t.cache)?t.cache.then((function(n){return e._deactivate(t,n)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,n=t;e<n.length;e++){var i=n[e];if(nf(this._deactivateIfSingleton(i)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Yf(this,void 0,void 0,(function(){var e=this;return qf(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return n.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,n){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,n)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,n){return Yf(this,void 0,void 0,(function(){return qf(this,(function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,n)];case 3:i.sent(),i.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: "+Ed(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,n){var i=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(nf(r))return r.then((function(){return i._preDestroy(n,e)}))}return this._preDestroy(n,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,n){return Yf(this,void 0,void 0,(function(){return qf(this,(function(i){switch(i.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,e)];case 3:return i.sent(),[2]}}))}))},t}(),Zf=function(t){this.id=fd(),this.registry=t};function Jf(t,e,n,i){!function(t){if(void 0!==t)throw new Error(Sd)}(e),tp(id,t,n.toString(),i)}function Qf(t){var e=[];if(Array.isArray(t)){var n=function(t){for(var e=new Set,n=0,i=t;n<i.length;n++){var r=i[n];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==n)throw new Error(gd+" "+n.toString())}else e=[t];return e}function tp(t,e,n,i){var r=Qf(i),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[n];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(gd+" "+t.key.toString())},l=0,h=o;l<h.length;l++){a(h[l])}o.push.apply(o,r),s[n]=o,Reflect.defineMetadata(t,s,e)}function ep(t){return function(e,n,i){"number"==typeof i?Jf(e,n,i,t):function(t,e,n){if(void 0!==t.prototype)throw new Error(Sd);tp(rd,t.constructor,e,n)}(e,n,t)}}function np(){return function(t){if(Reflect.hasOwnMetadata(sd,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(sd,e,t),t}}function ip(t){return ep(new Nd(Zu,t))}function rp(t){return function(e){return function(n,i,r){if(void 0===e){var s="function"==typeof n?n.name:n.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 ep(new Nd(t,e))(n,i,r)}}}var sp=rp(ed),op=rp(nd);var ap,lp,hp=(ap=od,lp="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var n=new Nd(ap,e);if(Reflect.hasOwnMetadata(ap,t.constructor))throw new Error(lp);Reflect.defineMetadata(ap,n,t.constructor)}});const cp=Symbol("ContributionProvider");class up{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 dp(t,e){t(cp).toDynamicValue((t=>{let{container:n}=t;return new up(e,n)})).inSingletonScope().whenTargetNamed(e)}class fp{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>t.name!==n&&(!e||t.fn===e))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+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>n)){i++;break}}this.taps[i]=t}}class pp extends fp{call(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const gp=Symbol.for("EnvContribution"),yp=Symbol.for("VGlobal");var vp=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bp=function(t,e){return function(n,i){e(n,i,t)}};let xp=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new pp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((n=>{const i=n.configure(this,t);i&&i.then&&e.push(i)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const n=this._env;this._env=t;const i=this.bindContribution(e);if(i&&i.then)return i.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}removeEventListener(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};xp=vp([np(),bp(0,sp(cp)),bp(0,ip(gp)),mp("design:paramtypes",[Object])],xp);const wp=C-1e-8;class Ap{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>wp)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let o,a,l,h,c=1/0,u=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),h=n*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>f&&(f=h)}if(p(i),p(r),r!==i)if((i%=C)<0&&(i+=C),(r%=C)<0&&(r+=C),r<i&&(s=!s,o=i,i=r,r=o),s)for(r-=C,o=i-i%B,a=0;a<4&&o>r;++a,o-=B)p(o);else for(o=i-i%B+B,a=0;a<4&&o<r;++a,o+=B)p(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+f)}arcTo(t,e,n,i,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),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,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(){}}class Sp{constructor(){this.curves=[],this.bounds=new V}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const _p=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Tp={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},Bp={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Cp,Pp,Rp,Op,Mp,Ep;var kp,Ip,jp,Dp,Lp,Np,Wp,Up,Fp;function zp(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=l*s,c=-a*o,u=a*s,d=l*o,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),y=Math.sin(r),v=.5*(r-i),m=Math.sin(.5*v),b=8/3*m*m/Math.sin(v),x=e+f-b*p,w=n+p+b*f,A=e+g,S=n+y,_=A+b*y,T=S-b*g;return[h*x+c*w,u*x+d*w,h*_+c*T,u*_+d*T,h*A+c*S,u*A+d*S]}function Hp(t,e,n,i){const r=function(t,e,n,i,r,s,o,a,l){const h=G(o),c=Math.sin(h),u=Math.cos(h),d=u*(a-t)*.5+c*(l-e)*.5,f=u*(l-e)*.5-c*(a-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=u/n,y=c/n,v=-c/i,m=u/i,b=g*a+y*l,x=v*a+m*l,w=g*t+y*e,A=v*t+m*e;let S=1/((w-b)*(w-b)+(A-x)*(A-x))-.25;S<0&&(S=0);let _=Math.sqrt(S);s===r&&(_=-_);const T=.5*(b+w)-_*(A-x),P=.5*(x+A)+_*(w-b),R=Math.atan2(x-P,b-T);let O=Math.atan2(A-P,w-T)-R;O<0&&1===s?O+=C:O>0&&0===s&&(O-=C);const M=Math.ceil(Math.abs(O/(B+.001))),E=[];for(let t=0;t<M;++t){const e=R+t*O/M,r=R+(t+1)*O/M;E[t]=[T,P,e,r,n,i,c,u]}return E}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=zp(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(kp||(kp={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Ip||(Ip={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(jp||(jp={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Dp||(Dp={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Lp||(Lp={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Np||(Np={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Wp||(Wp={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Up||(Up={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Fp||(Fp={}));const Vp=[(t,e,n,i,r,s,o)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,n,i,r,s,o)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,o),(t,e,n,i,r,s,o)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,o),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,o)=>e.lineTo(t[1]*r+n,t[2]*s+i,o),(t,e,n,i,r,s,o)=>e.moveTo(t[1]*r+n,t[2]*s+i,o),(t,e,n,i,r,s,o)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,o),(t,e,n,i,r,s,o)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,o)];function Gp(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const l=t[a];Vp[l[0]](l,e,n,i,r,s,o)}}class Xp{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Yp(t,e,n,i,r){return function(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],o=e[r],a=t[(r+1)%i],l=e[(r+1)%i];n+=F.distanceNN(s,o,a,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function qp(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function Kp(t,e,n,i,r){const s=qp(t.x,e.x,n.x,i.x,r),o=qp(t.y,e.y,n.y,i.y,r);return new U(s,o)}function $p(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,o=Kp(n,i,r,s,e),a=F.pointAtPP(n,i,e),l=F.pointAtPP(i,r,e),h=F.pointAtPP(r,s,e),c=F.pointAtPP(a,l,e),u=F.pointAtPP(l,h,e);return[new Zp(n,a,c,o),new Zp(o,u,h,s)]}class Zp extends Xp{constructor(t,e,n,i){super(),this.type=Up.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_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 Kp(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Yp(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Wp.ROW?R(this.p0.x-this.p3.x):t===Wp.COLUMN?R(this.p0.y-this.p3.y):0}getAngleAt(t){const e=E(t-.01,0),n=k(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return O(r.y-i.y,r.x-i.x)}}function Jp(t,e){const{p0:n,p1:i}=t,r=F.pointAtPP(n,i,e);return[new Qp(n,r),new Qp(r,i)]}class Qp extends Xp{constructor(t,e){super(),this.type=Up.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return F.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=O(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()?F.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Wp.ROW?R(this.p0.x-this.p1.x):t===Wp.COLUMN?R(this.p0.y-this.p1.y):0}}class tg{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,n,i,r,s,o,a){const l=new Zp(new U(this._lastX,this._lastY),new U(t,e),new U(n,i),new U(r,s));l.originP1=this._lastOriginP,l.originP2=a,l.defined=o,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new Qp(new U(this._lastX,this._lastY),new U(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===Wp.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return R(t.p0.y-i.y)}if(t===Wp.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 R(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class eg extends tg{bezierCurveTo(t,e,n,i,r,s,o,a){return super.bezierCurveTo(e,t,i,n,s,r,o,a)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function ng(t,e){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 ig{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function rg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=new tg("linear",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new ig(r,i),t),r}function sg(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class og{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&sg(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:sg(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function ag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return rg(t,e);const r=new tg("basis",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new og(r,i),t),r}function lg(t){return t<0?-1:1}function hg(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),o=(n-t._y1)/(r||Number(i<0&&-0)),a=(s*r+o*i)/(i+r);return(lg(s)+lg(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function cg(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ug(t,e,n,i,r){const s=t._x0,o=t._y0,a=t._x1,l=t._y1,h=(a-s)/3;t.context.bezierCurveTo(s+h,o+h*e,a-h,l-h*n,a,l,i,t.lastPoint1)}class dg{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:ug(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 n=t.x,i=t.y;if(n!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,ug(this,cg(this,e=hg(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:ug(this,this._t0,e=hg(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}tryUpdateLength(){return this.context.tryUpdateLength()}}class fg extends dg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function pg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return rg(t,e);const r=new tg("monotoneX",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new dg(r,i),t),r}function gg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return rg(t,e);const r=new eg("monotoneY",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new fg(r,i),t),r}let yg=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function vg(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new tg("step",null!=i?i:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new yg(s,e,r),t),s}class mg{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function bg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=new tg("linear",null!=n?n:R(t[t.length-1].x-t[0].x)>R(t[t.length-1].y-t[0].y)?Wp.ROW:Wp.COLUMN);return function(t,e){ng(t,e)}(new mg(r,i),t),r}function xg(t,e,n){switch(e){case"linear":default:return rg(t,n);case"basis":return ag(t,n);case"monotoneX":return pg(t,n);case"monotoneY":return gg(t,n);case"step":return vg(t,.5,n);case"stepBefore":return vg(t,0,n);case"stepAfter":return vg(t,1,n);case"linearClosed":return bg(t,n)}}class wg extends Sp{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Ap(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Bp.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Bp.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Bp.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([Bp.C,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([Bp.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,o,a){return this.commandList.push([Bp.E,t,e,n,i,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,o,a),this}rect(t,e,n,i){return this.commandList.push([Bp.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([Bp.A,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([Bp.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[Bp.M]=t=>`M${t[1]} ${t[2]}`,t[Bp.L]=t=>`L${t[1]} ${t[2]}`,t[Bp.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Bp.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Bp.A]=t=>{const e=[];((t,e,n,i,r,s,o)=>{const a=Math.abs(n-e),l=4*Math.tan(a/4)/3,h=n<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(n),f=Math.sin(n),p=c*s+i,g=u*o+r,y=d*s+i,v=f*o+r,m=s*l*h,b=o*l*h;t.push(p-m*u,g+b*c,y+m*f,v-b*d,y,v)})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let n="";for(let t=0;t<e.length;t+=6)n+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return n},t[Bp.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Cp=e[t],Pp=Cp.slice(1),Rp=Cp[0],n=[Rp],i=Pp.match(_p),null!==i){for(let t=0,e=i.length;t<e;t++)Op=i[t],Mp=parseFloat(Op),Number.isNaN(Mp)||n.push(Mp);if(Ep=Tp[Rp],n.length-1>Ep){let t;for(let e=1,i=n.length;e<i;e+=Ep){t=[Rp];for(let i=e,r=e+Ep;i<r;i++)t.push(n[i]);r.push(t)}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=xg(e,n);"x"===i?this.direction=Wp.ROW:"y"===i?this.direction=Wp.COLUMN:"auto"===i&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[Bp.M]=this.moveToTransform,t[Bp.L]=this.lineToTransform,t[Bp.Q]=this.quadraticCurveToTransform,t[Bp.C]=this.bezierCurveToTransform,t[Bp.AT]=this.arcToTransform,t[Bp.E]=this.ellipseTransform,t[Bp.R]=this.rectTransform,t[Bp.A]=this.arcTransform,t[Bp.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t){let e,n,i,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,f=0,p=0;for(let g=0,y=t.length;g<y;++g){switch(e=t[g],1===l&&1===h||(e=Sg(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+o,d+a);break;case"L":u=e[1],d=e[2],this.lineTo(u+o,d+a);break;case"h":u+=e[1],this.lineTo(u+o,d+a);break;case"H":u=e[1],this.lineTo(u+o,d+a);break;case"v":d+=e[1],this.lineTo(u+o,d+a);break;case"V":d=e[1],this.lineTo(u+o,d+a);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+o,d+a);break;case"M":u=e[1],d=e[2],this.moveTo(u+o,d+a);break;case"c":n=u+e[5],i=d+e[6],f=u+e[3],p=d+e[4],this.bezierCurveTo(u+e[1]+o,d+e[2]+a,f+o,p+a,n+o,i+a),u=n,d=i;break;case"C":u=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,f+o,p+a,u+o,d+a);break;case"s":n=u+e[3],i=d+e[4],f=2*u-f,p=2*d-p,this.bezierCurveTo(f+o,p+a,u+e[1]+o,d+e[2]+a,n+o,i+a),f=u+e[1],p=d+e[2],u=n,d=i;break;case"S":n=e[3],i=e[4],f=2*u-f,p=2*d-p,this.bezierCurveTo(f+o,p+a,e[1]+o,e[2]+a,n+o,i+a),u=n,d=i,f=e[1],p=e[2];break;case"q":n=u+e[3],i=d+e[4],f=u+e[1],p=d+e[2],this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,n+o,i+a),u=n,d=i,f=e[1],p=e[2];break;case"t":n=u+e[1],i=d+e[2],null===c[0].match(/[QqTt]/)?(f=u,p=d):"t"===c[0]?(f=2*u-r,p=2*d-s):"q"===c[0]&&(f=2*u-f,p=2*d-p),r=f,s=p,this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i,f=u+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*u-f,p=2*d-p,this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i;break;case"a":Hp(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+o,e[7]+d+a]),u+=e[6],d+=e[7];break;case"A":Hp(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case Bp.L:this.lineToTransform(o,e,n,i,r);break;case Bp.M:this.moveToTransform(o,e,n,i,r);break;case Bp.C:this.bezierCurveToTransform(o,e,n,i,r);break;case Bp.Q:this.quadraticCurveToTransform(o,e,n,i,r);break;case Bp.A:this.arcToTransform(o,e,n,i,r);break;case Bp.E:this.ellipseTransform(o,e,n,i,r);break;case Bp.R:this.rectTransform(o,e,n,i,r);break;case Bp.AT:this.arcToTransform(o,e,n,i,r);break;case Bp.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Gp(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Wp.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return R(t.p0.y-e.p1.y)}if(this.direction===Wp.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return R(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,n=0;for(let i=0;i<this.curves.length;i++){e=this.curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}}const Ag=["l",0,0,0,0,0,0,0];function Sg(t,e,n){const i=Ag[0]=t[0];if("a"===i||"A"===i)Ag[1]=e*t[1],Ag[2]=n*t[2],Ag[3]=t[3],Ag[4]=t[4],Ag[5]=t[5],Ag[6]=e*t[6],Ag[7]=n*t[7];else if("h"===i||"H"===i)Ag[1]=e*t[1];else if("v"===i||"V"===i)Ag[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)Ag[i]=(i%2==1?e:n)*t[i];return Ag}const _g={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Y},Tg={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Bg={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Cg=Object.assign({outerBorder:Object.assign(Object.assign({},Bg),{distance:0}),innerBorder:Object.assign(Object.assign({},Bg),{distance:0})},Bg),Pg={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1},Rg=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Tg),Cg),{alignSelf:"auto"}),Og={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Mg=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1},Rg),_g),Eg=Object.assign(Object.assign({},Mg),{startAngle:0,endAngle:P,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),kg=Object.assign(Object.assign(Object.assign({},Mg),Og),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Ig=Object.assign(Object.assign({},Mg),{radius:1,startAngle:0,endAngle:P}),jg=Object.assign(Object.assign({},Mg),{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"}),Dg=Object.assign(Object.assign({},Mg),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Lg=Object.assign(Object.assign(Object.assign({},Mg),Og),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),Ng=Object.assign(Object.assign({},Mg),{path:new wg,customPath:()=>{console.warn("空函数")}}),Wg=Object.assign(Object.assign({},Mg),{points:[],cornerRadius:0,closePath:!0}),Ug=Object.assign(Object.assign({},Mg),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),Fg=Object.assign(Object.assign({},Mg),{width:0,height:0,cornerRadius:0,length:0}),zg=Object.assign(Object.assign({},Mg),{symbolType:"circle",size:10,keepDirIn3d:!0}),Hg=Object.assign(Object.assign(Object.assign({},Mg),Pg),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Vg=Object.assign(Object.assign({},Mg),{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}),Gg=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Mg),{fill:!0,cornerRadius:0}),Xg=Object.assign(Object.assign({},Gg),{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 Yg=new class{},qg={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"}},Kg=!0,$g=!1,Zg=/\w|\(|\)|-/,Jg=/[.?!,;:/,。?!、;:]/,Qg=/\S/;function ty(t,e,n,i,r){if(!e||e<=0)return 0;const s=Yg.graphicUtil.textMeasure;let o=i,a=t.slice(0,o),l=Math.floor(s.measureText(a,n).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,n).width);for(;l>e||c<=e;){if(l>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),l=Math.floor(s.measureText(a,n).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,n).width)}return r&&(o=ey(t,o)),o}function ey(t,e){let n=e;for(;Zg.test(t[n-1])&&Zg.test(t[n])||Jg.test(t[n]);)if(n--,n<=0)return e;return n}function ny(t,e){const n=Yg.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var iy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let ry=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:n=Hg.fontSize}=e,i=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:r++;return{width:~~(.8*i*n+r*n),height:n}}measureTextPixelHeight(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Pg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Pg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,n,i){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<n;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,n-o,0,t[a].text.length-1);if(i&&r.str!==t[a].text){let n="",i=0;for(let e=0;e<a;e++){const r=t[e];n+=r.text,i+=r.text.length}n+=t[a].text;let s=ey(n,i+r.str.length);s-=i,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,n,i){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>n)return{str:"",width:0};const s=this._clipText(t,e,n,0,t.length-1);if(i&&s.str!==t){const n=ey(t,s.str.length);n!==s.str.length&&(s.str=t.substring(0,n),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,n,i,r){const s=Math.floor((i+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let l;if(a>n){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return l=this.measureTextWidth(r,e),l<=n?{str:r,width:l}:this._clipText(t,e,n,i,s)}if(a<n){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const i=t.substring(0,s+2);return l=this.measureTextWidth(i,e),l>=n?{str:o,width:a}:this._clipText(t,e,n,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,n,i,r){if(""===i)return this.clipTextVertical(t,e,n,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,n,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(i,e);if(o>n)return s;n-=o;const a=this.clipTextVertical(t,e,n,r);return a.width+=o,a.verticalList.push({text:i,direction:1,width:o}),a}clipTextWithSuffix(t,e,n,i,r){if(""===i)return this.clipText(t,e,n,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=n)return{str:t,width:s};const o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;const a=this._clipText(t,e,n,0,t.length-1);if(r&&a.str!==t){const n=ey(t,a.str.length);n!==a.str.length&&(a.str=t.substring(0,n),a.width=this.measureTextWidth(a.str,e))}return a.str+=i,a.width+=o,a}};ry=iy([np()],ry);var sy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const oy=Symbol.for("TextMeasureContribution");let ay=class extends ry{};ay=sy([np()],ay);const ly=new $f,hy=Symbol.for("CanvasFactory"),cy=Symbol.for("Context2dFactory");function uy(t){return ly.getNamed(hy,Yg.global.env)(t)}const dy=1e-4,fy=Math.sqrt(3),py=1/3;function gy(t){return t>-Ry&&t<Ry}function yy(t){return t>Ry||t<-Ry}const vy=[0,0],my=[0,0],by=[0,0];function xy(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function wy(t,e,n,i){const r=1-i;return r*(r*t+2*i*e)+i*i*n}function Ay(t,e,n,i,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*i+3*s*n)}function Sy(t){return(t%=P)<0&&(t+=P),t}function _y(t,e,n,i,r,s){if(s>e&&s>i||s<e&&s<i)return 0;if(i===e)return 0;const o=(s-e)/(i-e);let a=i<e?1:-1;1!==o&&0!==o||(a=i<e?.5:-.5);const l=o*(n-t)+t;return l===r?1/0:l>r?a:0}function Ty(t,e,n,i,r,s,o,a,l){if(0===o)return!1;const h=o;return!(l>e+h&&l>i+h&&l>s+h||l<e-h&&l<i-h&&l<s-h||a>t+h&&a>n+h&&a>r+h||a<t-h&&a<n-h&&a<r-h)&&function(t,e,n,i,r,s,o,a,l){let h=0,c=.005,u=1/0;vy[0]=o,vy[1]=a;for(let o=0;o<1;o+=.05){my[0]=wy(t,n,r,o),my[1]=wy(e,i,s,o);const a=xy(vy,my);a<u&&(h=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<dy);o++){const o=h-c,a=h+c;my[0]=wy(t,n,r,o),my[1]=wy(e,i,s,o);const l=xy(my,vy);if(o>=0&&l<u)h=o,u=l;else{by[0]=wy(t,n,r,a),by[1]=wy(e,i,s,a);const o=xy(by,vy);a<=1&&o<u?(h=a,u=o):c*=.5}}return l&&(l[0]=wy(t,n,r,h),l[1]=wy(e,i,s,h)),Math.sqrt(u)}(t,e,n,i,r,s,a,l,null)<=h/2}function By(t,e,n,i,r,s,o,a,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>i+u&&c>s+u&&c>a+u||c<e-u&&c<i-u&&c<s-u&&c<a-u||h>t+u&&h>n+u&&h>r+u&&h>o+u||h<t-u&&h<n-u&&h<r-u&&h<o-u)&&function(t,e,n,i,r,s,o,a,l,h,c){let u,d,f,p,g=0,y=.005,v=1/0;vy[0]=l,vy[1]=h;for(let l=0;l<1;l+=.05)my[0]=Ay(t,n,r,o,l),my[1]=Ay(e,i,s,a,l),f=xy(vy,my),f<v&&(g=l,v=f);v=1/0;for(let l=0;l<32&&!(y<dy);l++)u=g-y,d=g+y,my[0]=Ay(t,n,r,o,u),my[1]=Ay(e,i,s,a,u),f=xy(my,vy),u>=0&&f<v?(g=u,v=f):(by[0]=Ay(t,n,r,o,d),by[1]=Ay(e,i,s,a,d),p=xy(by,vy),d<=1&&p<v?(g=d,v=p):y*=.5);return c&&(c[0]=Ay(t,n,r,o,g),c[1]=Ay(e,i,s,a,g)),Math.sqrt(v)}(t,e,n,i,r,s,o,a,h,c,null)<=u/2}function Cy(t,e,n,i,r,s,o,a,l){if(0===o)return!1;const h=o;a-=t,l-=e;const c=Math.sqrt(a*a+l*l);if(c-h>n||c+h<n)return!1;if(Math.abs(i-r)%P<1e-4)return!0;if(s){const t=i;i=Sy(r),r=Sy(t)}else i=Sy(i),r=Sy(r);i>r&&(r+=P);let u=Math.atan2(l,a);return u<0&&(u+=P),u>=i&&u<=r||u+P>=i&&u+P<=r}function Py(t,e,n,i,r,s,o){if(0===r)return!1;const a=r,l=r/2;let h=0,c=t;if(o>e+l&&o>i+l||o<e-l&&o<i-l||s>t+l&&s>n+l||s<t-l&&s<n-l)return!1;if(t===n)return Math.abs(s-t)<=a/2;h=(e-i)/(t-n),c=(t*i-n*e)/(t-n);const u=h*s-o+c;return u*u/(h*h+1)<=a/2*a/2}const Ry=1e-4;function Oy(t,e,n,i,r){const s=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,a=3*e-3*t;let l=0;if(gy(o)){if(yy(s)){const t=-a/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*o*a;if(gy(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),n=(-s+e)/(2*o),i=(-s-e)/(2*o);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}const My=[-1,-1,-1],Ey=[-1,-1];function ky(){const t=Ey[0];Ey[0]=Ey[1],Ey[1]=t}function Iy(t,e,n,i,r,s,o,a,l,h){if(h>e&&h>i&&h>s&&h>a||h<e&&h<i&&h<s&&h<a)return 0;const c=function(t,e,n,i,r,s){const o=i+3*(e-n)-t,a=3*(n-2*e+t),l=3*(e-t),h=t-r,c=a*a-3*o*l,u=a*l-9*o*h,d=l*l-3*a*h;let f=0;if(gy(c)&&gy(u))if(gy(a))s[0]=0;else{const t=-l/a;t>=0&&t<=1&&(s[f++]=t)}else{const t=u*u-4*c*d;if(gy(t)){const t=u/c,e=-a/o+t,n=-t/2;e>=0&&e<=1&&(s[f++]=e),n>=0&&n<=1&&(s[f++]=n)}else if(t>0){const e=Math.sqrt(t);let n=c*a+1.5*o*(-u+e),i=c*a+1.5*o*(-u-e);n=n<0?-Math.pow(-n,py):Math.pow(n,py),i=i<0?-Math.pow(-i,py):Math.pow(i,py);const r=(-a-(n+i))/(3*o);r>=0&&r<=1&&(s[f++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,n=Math.sqrt(c),i=Math.cos(e),r=(-a-2*n*i)/(3*o),l=(-a+n*(i+fy*Math.sin(e)))/(3*o),h=(-a+n*(i-fy*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[f++]=r),l>=0&&l<=1&&(s[f++]=l),h>=0&&h<=1&&(s[f++]=h)}}return f}(e,i,s,a,h,My);if(0===c)return 0;let u=0,d=-1,f=0,p=0;for(let h=0;h<c;h++){const c=My[h],g=0===c||1===c?.5:1;Ay(t,n,r,o,c)<l||(d<0&&(d=Oy(e,i,s,a,Ey),Ey[1]<Ey[0]&&d>1&&ky(),f=Ay(e,i,s,a,Ey[0]),d>1&&(p=Ay(e,i,s,a,Ey[1]))),2===d?c<Ey[0]?u+=f<e?g:-g:c<Ey[1]?u+=p<f?g:-g:u+=a<p?g:-g:c<Ey[0]?u+=f<e?g:-g:u+=a<f?g:-g)}return u}function jy(t,e,n,i,r,s,o,a){if(a>e&&a>i&&a>s||a<e&&a<i&&a<s)return 0;const l=function(t,e,n,i,r){const s=t-2*e+n,o=2*(e-t),a=t-i;let l=0;if(gy(s)){if(yy(o)){const t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{const t=o*o-4*s*a;if(gy(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),n=(-o+e)/(2*s),i=(-o-e)/(2*s);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}(e,i,s,a,My);if(0===l)return 0;const h=function(t,e,n){const i=t+n-2*e;return 0===i?.5:(t-e)/i}(e,i,s);if(h>=0&&h<=1){let a=0;const c=wy(e,i,s,h);for(let i=0;i<l;i++){const l=0===My[i]||1===My[i]?.5:1;wy(t,n,r,My[i])<o||(My[i]<h?a+=c<e?l:-l:a+=s<c?l:-l)}return a}const c=0===My[0]||1===My[0]?.5:1;return wy(t,n,r,My[0])<o?0:s<e?c:-c}function Dy(t,e,n,i,r,s,o,a){if((a-=e)>n||a<-n)return 0;const l=Math.sqrt(n*n-a*a);My[0]=-l,My[1]=l;const h=Math.abs(i-r);if(h<1e-4)return 0;if(h>=P-1e-4){i=0,r=P;const e=s?1:-1;return o>=My[0]+t&&o<=My[1]+t?e:0}if(i>r){const t=i;i=r,r=t}i<0&&(i+=P,r+=P);let c=0;for(let e=0;e<2;e++){const n=My[e];if(n+t>o){let t=Math.atan2(a,n),e=s?1:-1;t<0&&(t=P+t),(t>=i&&t<=r||t+P>=i&&t+P<=r)&&(t>T/2&&t<1.5*T&&(e=-e),c+=e)}}return c}function Ly(t){return Math.round(t/T*1e8)/1e8%2*T}function Ny(t,e){let n=Ly(t[0]);n<0&&(n+=P);const i=n-t[0];let r=t[1];r+=i,!e&&r-n>=P?r=n+P:e&&n-r>=P?r=n-P:!e&&n>r?r=n+(P-Ly(n-r)):e&&n<r&&(r=n-(P-Ly(r-n))),t[0]=n,t[1]=r}const Wy=[0,0];function Uy(t,e,n,i,r){const s=t,o=t.length;let a,l,h=0,c=0,u=0,d=0,f=0;for(let t=0;t<o;t++){const o=s[t],p=0===t;o[0]===Bp.M&&t>1&&(n||(h+=_y(c,u,d,f,i,r))),p&&(c=o[1],u=o[2],d=c,f=u);const g=o[0],y=o[1],v=o[2],m=o[3],b=o[4],x=o[5],w=o[6];let A=b,S=x;Wy[0]=A,Wy[1]=S,Ny(Wy,Boolean(o[6])),A=Wy[0],S=Wy[1];const _=A,T=S-A,B=!!(1-(o[6]?0:1)),C=(i-y)*m/m+y;switch(g){case Bp.M:d=y,f=v,c=d,u=f;break;case Bp.L:if(n){if(Py(c,u,y,v,e,i,r))return!0}else h+=_y(c,u,y,v,i,r)||0;c=y,u=v;break;case Bp.C:if(n){if(By(c,u,y,v,m,b,x,w,e,i,r))return!0}else h+=Iy(c,u,y,v,m,b,x,w,i,r)||0;c=x,u=w;break;case Bp.Q:if(n){if(Ty(c,u,y,v,m,b,e,i,r))return!0}else h+=jy(c,u,y,v,m,b,i,r)||0;c=m,u=b;break;case Bp.A:if(a=Math.cos(_)*m+y,l=Math.sin(_)*m+v,p?(d=a,f=l):h+=_y(c,u,a,l,i,r),n){if(Cy(y,v,m,_,_+T,B,e,C,r))return!0}else h+=Dy(y,v,m,_,_+T,B,C,r);c=Math.cos(_+T)*m+y,u=Math.sin(_+T)*m+v;break;case Bp.R:if(d=c=y,f=u=v,a=d+m,l=f+b,n){if(Py(d,f,a,f,e,i,r)||Py(a,f,a,l,e,i,r)||Py(a,l,d,l,e,i,r)||Py(d,l,d,f,e,i,r))return!0}else h+=_y(a,f,a,l,i,r),h+=_y(d,l,d,f,i,r);break;case Bp.Z:if(n){if(Py(c,u,d,f,e,i,r))return!0}else h+=_y(c,u,d,f,i,r);c=d,u=f}}return n||(p=u,g=f,Math.abs(p-g)<Ry)||(h+=_y(c,u,d,f,i,r)||0),0!==h;var p,g}var Fy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},zy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hy=function(t,e){return function(n,i){e(n,i,t)}};let Vy=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,n)=>{this.configured=!1,this.configure(n,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const n=uy({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=n,this.context=n.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var i;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=n;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:Pg.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,n){return this.configure(this.global,this.global.env),new ot(Object.assign({defaultFontParams:{fontFamily:Pg.fontFamily,fontSize:Pg.fontSize},getCanvasForMeasure:n||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ot.ALPHABET_CHAR_SET+ot.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}};var Gy;Vy=Fy([np(),Hy(0,sp(cp)),Hy(0,ip(oy)),Hy(1,sp(yp)),zy("design:paramtypes",[Object,Object])],Vy),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Gy||(Gy={}));const Xy=new Y;let Yy=class{constructor(){this.matrix=new Y}init(t){return this.mode=Gy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Gy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,n){const i=this.outSourceMatrix;if(Xy.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){const{x:i,y:r}=n;this.outTargetMatrix.translate(i,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-i,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Xy.a,Xy.b,Xy.c,Xy.d,Xy.e,Xy.f),this}rotateMatrix(t,e){const n=this.outSourceMatrix;if(Xy.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),e){const{x:n,y:i}=e;this.outTargetMatrix.translate(n,i),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-i)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Xy.a,Xy.b,Xy.c,Xy.d,Xy.e,Xy.f),this}scale(t,e,n){return this.mode===Gy.matrix?this.scaleMatrix(t,e,n):this}rotate(t,e){return this.mode===Gy.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const n=this.outSourceMatrix;return Xy.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Xy.a,Xy.b,Xy.c,Xy.d,Xy.e,Xy.f),this}translate(t,e){return this.mode===Gy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Gy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Yy=Fy([np(),zy("design:paramtypes",[])],Yy);const qy={arc:Eg,area:kg,circle:Ig,line:Lg,path:Ng,symbol:zg,text:Hg,rect:Ug,rect3d:Fg,polygon:Wg,richtext:Vg,richtextIcon:Xg,image:Gg,group:jg,glyph:Dg},Ky=Object.keys(qy);function $y(){return{arc:Object.assign({},qy.arc),area:Object.assign({},qy.area),circle:Object.assign({},qy.circle),line:Object.assign({},qy.line),path:Object.assign({},qy.path),symbol:Object.assign({},qy.symbol),text:Object.assign({},qy.text),rect:Object.assign({},qy.rect),rect3d:Object.assign({},qy.rect3d),polygon:Object.assign({},qy.polygon),richtext:Object.assign({},qy.richtext),richtextIcon:Object.assign({},qy.richtextIcon),image:Object.assign({},qy.image),group:Object.assign({},qy.group),glyph:Object.assign({},qy.glyph)}}function Zy(t,e){e&&(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?Object.keys(e).forEach((n=>{t[n]?Object.assign(t[n],e[n]):t[n]=e[n]})):Object.keys(e).forEach((n=>{if(t[n]){const i=t[n],r=e[n];Object.keys(e[n]).forEach((t=>{void 0===i[t]&&(i[t]=r[t])}))}else t[n]=e[n]})))}const Jy=new Array(60).fill(0).map((()=>$y()));class Qy{constructor(){this._defaultTheme=Jy.pop()||$y(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0),this.userTheme?Zy(this.userTheme,t.userTheme,!1):this.userTheme=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;const r=[],s=[];return void 0===e&&(e=!0),void 0===n&&(n=1/0),function t(n,o){if(null===n)return null;if(0===o)return n;let a;if("object"!=typeof n)return n;if(d(n)?a=[]:m(n)?(a=new RegExp(n.source,function(t){let e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}(n)),n.lastIndex&&(a.lastIndex=n.lastIndex)):a=p(n)?new Date(n.getTime()):void 0===i?Object.create(Object.getPrototypeOf(n)):Object.create(i),e){const t=r.indexOf(n);if(-1!==t)return s[t];r.push(n),s.push(a)}for(const e in n)a[e]=t(n[e],o-1);return a}(t,n)}(t.userTheme),Zy(e,t.userTheme)}this.userTheme?this.doCombine(e):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this._defaultTheme,i=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);Ky.forEach((r=>{var o,a;e[r]||s||t[r]?i[r]=Object.assign({},n[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):i[r]=n[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const tv=new Qy;function ev(t,e){return t.glyphHost?ev(t.glyphHost):e?(t.isContainer,e):function(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)):tv.getTheme()}return null}(t)||tv.getTheme()}class nv{static GenAutoIncrementId(){return nv.auto_increment_id++}}nv.auto_increment_id=0;var iv=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class rv extends r{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=nv.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return iv(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)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){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 n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<t;n++){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 n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._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,n){const i=o(n,!0)&&n||c(n)&&n.capture,r=c(n)&&n.once,s=a(e)?void 0:e;return t=i?`${t}capture`:t,e=a(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=o(n,!0)&&n||c(n)&&n.capture,r=a(e)?void 0:e;t=i?`${t}capture`:t,e=a(e)?e:e.handleEvent;const s=c(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return c(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return super.emit(t.type,t,...n),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class sv{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=sv.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new U,this.page=new U,this.canvas=new U,this.viewport=new U,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 ov extends sv{constructor(){super(...arguments),this.client=new U,this.movement=new U,this.offset=new U,this.global=new U,this.screen=new U}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,n,i,r,s,o,a,l,h,c,u,d,f,p){throw new Error("Method not implemented.")}}class av extends ov{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,n;const i=new av(this.manager);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i.nativeEvent=this.nativeEvent,i.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,i),null===(e=this.manager)||void 0===e||e.copyMouseData(this,i),null===(n=this.manager)||void 0===n||n.copyData(this,i),i.target=this.target,i.path=this.composedPath().slice(),i.type=this.type,i}}av.DOM_DELTA_PIXEL=0,av.DOM_DELTA_LINE=1,av.DOM_DELTA_PAGE=2;class lv extends sv{constructor(t,e){super(),this.type=t,this.detail=e}}const hv={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof sv))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 lv(t,e))}};class cv{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return cv.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 uv{static Avaliable(){return!0}avaliable(){return uv.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 dv{static Avaliable(){return!!Yg.global.getRequestAnimationFrame()}avaliable(){return dv.Avaliable()}tick(t,e){Yg.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var fv;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(fv||(fv={}));class pv{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-pv.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*pv.bounceIn(2*t):.5*pv.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/P*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*P/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/P*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*P/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/P*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*P/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*P/e)*.5+1}}}pv.quadIn=pv.getPowIn(2),pv.quadOut=pv.getPowOut(2),pv.quadInOut=pv.getPowInOut(2),pv.cubicIn=pv.getPowIn(3),pv.cubicOut=pv.getPowOut(3),pv.cubicInOut=pv.getPowInOut(3),pv.quartIn=pv.getPowIn(4),pv.quartOut=pv.getPowOut(4),pv.quartInOut=pv.getPowInOut(4),pv.quintIn=pv.getPowIn(5),pv.quintOut=pv.getPowOut(5),pv.quintInOut=pv.getPowInOut(5),pv.backIn=pv.getBackIn(1.7),pv.backOut=pv.getBackOut(1.7),pv.backInOut=pv.getBackInOut(1.7),pv.elasticIn=pv.getElasticIn(1,.3),pv.elasticOut=pv.getElasticOut(1,.3),pv.elasticInOut=pv.getElasticInOut(1,.3*1.5);const gv=new class{constructor(){this.id=nv.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(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Dp.END?this.removeAnimate(e):e.status===Dp.RUNNING||e.status===Dp.INITIAL?(this.animateCount++,e.advance(t)):e.status===Dp.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class yv{constructor(t,e,n,i,r){this.from=t,this.to=e,this.duration=n,this.easing=i,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,n){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(n,this.step.getLastProps()),this.onUpdate(t,e,n),t&&this.onEnd()}}class vv extends yv{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class mv{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nv.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gv;this.id=t,this.timeline=e,this.status=Dp.INITIAL,this.tailAnimate=new bv(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=E(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){mv.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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mv.mode;t&&e&Lp.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:jp.ANIMATE_PLAY})}runCb(t){const e=new vv((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const o=mv.interpolateMap.get(t)||mv.interpolateMap.get("");return!!o&&o(t,e,n,i,r,s)}pause(){this.status===Dp.RUNNING&&(this.status=Dp.PAUSED)}resume(){this.status===Dp.PAUSED&&(this.status=Dp.RUNNING)}to(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),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 bv(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(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Dp.INITIAL&&(this.status=Dp.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===Dp.RUNNING&&(this.status=Dp.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,n=0;const i=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===i)return s;for(let i=0;i<this.subAnimates.length&&(e=this.subAnimates[i],!(n+e.totalDuration>=t));i++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),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=Dp.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()}}mv.mode=Lp.NORMAL,mv.interpolateMap=new Map;class bv{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 xv(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(t){let e=t.duration;(null==e||e<0)&&(e=0);const n=t.easing,i="string"==typeof n?pv[n]:n,r=this._addStep(e,null,i);return r.type=Np.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,n,i){(null==e||e<0)&&(e=0);const r="string"==typeof n?pv[n]:n,s=this._addStep(e,null,r);return s.type=Np.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(s.propKeys)})),this}from(t,e,n,i){this.to(t,0,n,i);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{r[t]=this.getLastPropByName(t,this.stepTail)})),this.to(r,e,n,i),this.stepTail.type=Np.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(t){if(t>0){const e=this._addStep(+t,null);e.type=Np.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,n){const i=new xv(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}_appendProps(t,e,n){e.props=n?t:Object.assign({},t);let i=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))}));i.prev;)i.props&&(i.propKeys||(i.propKeys=Object.keys(i.props)),i.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=i.props[t])}))),i=i.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 n=this.duration,i=this.loop,r=this.rawPosition;let s,o,a=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,n<=0)return a=!0,a;if(s=Math.floor(t/n),o=t-s*n,a=t>=i*n+n,a&&(o=n,s=i,t=o*s+n),t===r)return a;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(o=n-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+l,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let n=this.stepHead.next;const i=this.position,r=this.duration;if(this.target&&n){let s=n.next;for(;s&&s.position<=i;)n=s,s=n.next;let o=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(o=n.easing(o)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,o,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(n,o)))}}tryCallCustomAnimateLifeCycle(t,e,n){if(t!==e)if(n){let n=e.prev;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let n=e.next;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=n.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}class xv{constructor(t,e,n,i){this.duration=e,this.position=t,this.props=n,this.easing=i}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 wv=200,Av="cubicOut";var Sv;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Sv||(Sv={}));const _v=[!1,!1,!1,!1],Tv=[0,0,0,0],Bv=t=>t?d(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Tv[0]=t[0],Tv[2]=t[0],Tv[1]=t[1],Tv[3]=t[1],Tv):t:t:0,Cv=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Pv=[1,2,3,0,1,2,3,0];function Rv(t,e,n,i){for(;t>=P;)t-=P;for(;t<0;)t+=P;for(;t>e;)e+=P;Cv[0].x=n,Cv[1].y=n,Cv[2].x=-n,Cv[3].y=-n;const r=Math.ceil(t/B)%4,s=Math.ceil(e/B)%4;if(i.add(M(t)*n,I(t)*n),i.add(M(e)*n,I(e)*n),r!==s||e-t>T){let t=!1;for(let e=0;e<Pv.length;e++)if(t||r!==Pv[e]){if(t&&s===Pv[e])break;if(t){const t=Cv[Pv[e]];i.add(t.x,t.y)}}else{t=!0;const e=Cv[r];i.add(e.x,e.y)}}}function Ov(t,e,n){const{x:i,y:r}=W(t.x,t.y,e.x,e.y,n),{x:s,y:o}=W(t.x1,t.y1,e.x1,e.y1,n),a=new U(i,r,s,o);return a.defined=e.defined,a}function Mv(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let i=[];if(t.length>e.length){i=e.map((t=>{const e=new U(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)i[r]=Ov(t[r],e[r],n)}else{i=e.map((t=>{const e=new U(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)i[r]=Ov(t[r],e[r],n)}return i}function Ev(t,e){if(d(t)){let n;for(let i=0;i<t.length&&void 0===n;i++)n=t[i][e];return n}return t[e]}class kv{constructor(){this.durations=[],this.timeout=kv.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)}}kv.TimeOut=1e3/60;const Iv=new kv;var jv;!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"}(jv||(jv={}));var Dv={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 Lv={};for(const t in Dv)w(Dv,t)&&(Lv[Dv[t]]=t);const Nv={to:{},get:{}};function Wv(t,e,n){return Math.min(Math.max(e,t),n)}function Uv(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Nv.get=function(t){let e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];switch(t.substring(0,3).toLowerCase()){case"hsl":e=Nv.get.hsl(t,i),n="hsl";break;case"hwb":e=Nv.get.hwb(t,i),n="hwb";break;default:e=Nv.get.rgb(t,i),n="rgb"}return e?{model:n,value:e}:null},Nv.get.rgb=function(t){if(!t)return null;const e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];let n,i,r;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=n[2],n=n[1],i=0;i<3;i++){const t=2*i;e[i]=parseInt(n.slice(t,t+2),16)}r&&(e[3]=Math.round(parseInt(r,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],r=n[3],i=0;i<3;i++)e[i]=parseInt(n[i]+n[i],16);r&&(e[3]=Math.round(parseInt(r+r,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(i=0;i<3;i++)e[i]=parseInt(n[i+1],10);n[4]&&(e[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=Dv[n[1]];return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e?(e[3]=1,e):null}return null}for(i=0;i<3;i++)e[i]=Math.round(2.55*parseFloat(n[i+1]));n[4]&&(e[3]=parseFloat(n[4]))}for(i=0;i<3;i++)e[i]=Wv(e[i],0,255);return e[3]=Wv(e[3],0,1),e},Nv.get.hsl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;const n=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){const t=parseFloat(n[4]);return e[0]=(parseFloat(n[1])+360)%360,e[1]=Wv(parseFloat(n[2]),0,100),e[2]=Wv(parseFloat(n[3]),0,100),e[3]=Wv(isNaN(t)?1:t,0,1),e}return null},Nv.get.hwb=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;const n=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){const t=parseFloat(n[4]);return e[0]=(parseFloat(n[1])%360+360)%360,e[1]=Wv(parseFloat(n[2]),0,100),e[2]=Wv(parseFloat(n[3]),0,100),e[3]=Wv(isNaN(t)?1:t,0,1),e}return null},Nv.to.hex=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return"#"+Uv(i[0])+Uv(i[1])+Uv(i[2])+(i[3]<1?Uv(Math.round(255*i[3])):"")},Nv.to.rgb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return i.length<4||1===i[3]?"rgb("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+")":"rgba("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+", "+i[3]+")"},Nv.to.rgb.percent=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e,r=Math.round(i[0]/255*100),s=Math.round(i[1]/255*100),o=Math.round(i[2]/255*100);return i.length<4||1===i[3]?"rgb("+r+"%, "+s+"%, "+o+"%)":"rgba("+r+"%, "+s+"%, "+o+"%, "+i[3]+")"},Nv.to.hsl=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return i.length<4||1===i[3]?"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)":"hsla("+i[0]+", "+i[1]+"%, "+i[2]+"%, "+i[3]+")"},Nv.to.hwb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;let r="";return i.length>=4&&1!==i[3]&&(r=", "+i[3]),"hwb("+i[0]+", "+i[1]+"%, "+i[2]+"%"+r+")"},Nv.to.keyword=function(t){return Lv[t.slice(0,3)]};const Fv=Nv;var zv;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(zv||(zv={}));class Hv{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zv.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===zv.Color1){let e=Hv.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;if(e=Nv.get(t),e&&e.value){const i=e.value,r=[i[0]/255,i[1]/255,i[2]/255,i[3]];Hv.store1[t]=r,Hv.store255[t]=i,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3]}return n}let i=Hv.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;if(i=Nv.get(t),i&&i.value){const e=i.value;Hv.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Hv.store255[t]=e,n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}static Set(t,e,n){if(e===zv.Color1){if(Hv.store1[t])return;Hv.store1[t]=n,Hv.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Hv.store255[t])return;Hv.store255[t]=n,Hv.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Vv(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Gv(t,e,n,i,r){if(!t||!e)return t&&Vv(t)||e&&Vv(e)||!1;let s,o,a=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Hv.Get(t,zv.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Hv.Get(e,zv.Color255):l=!0,a!==l){const s=a?t:e,o=a?e:t,l=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:Vv(o)})))});return a?Gv(s,l,n,i,r):Gv(l,s,n,i,r)}if(a){if(t.gradient===e.gradient){const i=t,r=e,s=i.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:qv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("radial"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:qv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("conical"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:qv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n)}return!1}return r&&r(s,o),Vv(function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(s,o,n),i)}Hv.store255={},Hv.store1={};const Xv=[0,0,0,0],Yv=[0,0,0,0];function qv(t,e,n){return Hv.Get(t,zv.Color255,Xv),Hv.Get(e,zv.Color255,Yv),`rgba(${Math.round(Xv[0]+(Yv[0]-Xv[0])*n)},${Math.round(Xv[1]+(Yv[1]-Xv[1])*n)},${Math.round(Xv[2]+(Yv[2]-Xv[2])*n)},${Xv[3]+(Yv[3]-Xv[3])*n})`}class Kv{static GetImage(t,e){var n;let i=Kv.cache.get(t);i?"fail"===i.loadState?Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Kv.cache.set(t,i),i.dataPromise=Yg.global.loadImage(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var n;let i=Kv.cache.get(t);i?"fail"===i.loadState?Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&Yg.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Kv.cache.set(t,i),i.dataPromise=Yg.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=Kv.cache.get(t);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},Kv.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=Yg.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=Yg.global.loadBlob(t):"json"===e&&(n.dataPromise=Yg.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}}Kv.cache=new Map;const $v=new Y,Zv=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],Jv=["x","y"],Qv=["scaleX","scaleY"],tm=["angle"],em=new U,nm={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class im extends rv{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(im.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._AABBBounds=new V,this._updateTag=kp.INIT,this.attribute=t,this.valid=this.isValid(),t.background&&this.loadImage(t.background,!0)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{dx:n=t.dx,dy:i=t.dy}=this.attribute;if(e&&this.parent){const t=ev(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;em.x=n+e,em.y=i+r}else em.x=n,em.y=i;return em}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Yg.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Yg.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(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new Y),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&kp.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&kp.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&kp.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&kp.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&kp.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&kp.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=kp.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===Ip.GLOBAL){const n=new U(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,n)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):l(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<Zv.length;e++){const n=Zv[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<Zv.length;e++)if(t===Zv[e])return!0;return!1}initAttributes(t){const e={type:jp.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=kp.INIT,this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:jp.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Jv,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const o=this.attribute,a=o.postMatrix;return a?Yg.transformUtil.fromMatrix(a,a).translate(t,e):(o.x=(null!==(n=o.x)&&void 0!==n?n:_g.x)+t,o.y=(null!==(i=o.y)&&void 0!==i?i:_g.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:jp.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Jv,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:jp.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,Qv,s);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const a=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new Y,a.postMatrix=i),Yg.transformUtil.fromMatrix(i,i).scale(t,e,n)}else a.scaleX=(null!==(i=a.scaleX)&&void 0!==i?i:_g.scaleX)*t,a.scaleY=(null!==(r=a.scaleY)&&void 0!==r?r:_g.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:jp.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Qv,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:jp.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,tm,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new Y,s.postMatrix=n),Yg.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:_g.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:jp.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,tm,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new mv(null==t?void 0:t.id).bind(this);if(t){const{onStart:n,onFrame:i,onEnd:r,onRemove:s}=t;null!=n&&e.onStart(n),null!=i&&e.onFrame(i),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){Yg.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)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s,o,a;if(n){const n=Object.keys(t),l=i?n.reduce(((e,n)=>(e[n]=void 0===t[n]?this.getDefaultAttribute(n):t[n],e)),{}):t,h=this.animate();h.stateNames=e,h.to(l,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:wv,null!==(a=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==a?a:Av)}else this.setAttributes(t,!1,{type:jp.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((n=>{if(n.stateNames){const i=n.getEndProps();w(i,t)&&(e=i[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 n=this.currentStates.filter((e=>e!==t));this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=kp.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=kp.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=kp.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&kp.UPDATE_SHAPE_AND_BOUNDS)===kp.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=kp.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=kp.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=kp.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=kp.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=kp.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=kp.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=kp.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&kp.UPDATE_LAYOUT)}doUpdateLocalMatrix(){const{x:t=_g.x,y:e=_g.y,scaleX:n=_g.scaleX,scaleY:i=_g.scaleY,angle:r=_g.angle,scaleCenter:s,anchor:o,postMatrix:a}=this.attribute,l=[0,0];if(o){if("string"==typeof o[0]){const t=parseFloat(o[0])/100,e=this.AABBBounds;l[0]=e.x1+(e.x2-e.x1)*t}else l[0]=o[0];if("string"==typeof o[1]){const t=parseFloat(o[1])/100,e=this.AABBBounds;l[1]=e.x1+(e.x2-e.x1)*t}else l[1]=o[1]}if(!s||1===n&&1===i)!function(t,e,n,i,r,s,o,a){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,f=e.f,p=M(o),g=I(o);let y,v;a?(y=a[0],v=a[1]):(y=n,v=i);const m=y-n,b=v-i,x=l*p+c*g,w=h*p+u*g,A=c*p-l*g,S=u*p-h*g;t.a=r*x,t.b=r*w,t.c=s*A,t.d=s*S,t.e=d+l*y+c*v-x*m-A*b,t.f=f+h*y+u*v-w*m-S*b}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,o&&l);else{const o=this._transMatrix;o.reset(),o.translate(l[0],l[1]),o.rotate(r),o.translate(-l[0],-l[1]),o.translate(t,e),Yg.transformUtil.fromMatrix(o,o).scale(n,i,{x:s[0],y:s[1]})}const h=this.getOffsetXY(_g);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,a){const t=$v.setValue(a.a,a.b,a.c,a.d,a.e,a.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Yg.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:jp.ANIMATE_END})}onStep(t,e,n,i,r){const s={};if(n.customAnimate)n.customAnimate.update(r,i,s);else{const o=n.props,a=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,s,n,i,r,o,void 0,a,l)}this.setAttributes(s,!1,{type:jp.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,n,i,r,s,o,a,l,h){h||(h=Object.keys(o),i.propKeys=h),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=o[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const c=o[s],u=null!==(h=a&&a[s])&&void 0!==h?h:t.getLastPropByName(s,i);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,n),d||(d=e.customInterpolate(s,r,u,c,this,n),d||this.defaultInterpolate(c,u,s,n,l,r)||this._interpolate(s,r,u,c,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const o=r.fillColorArray,a=Gv(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(i[n]=a),!0}if("stroke"===n){r||(r={});const o=r.strokeColorArray,a=Gv(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(i[n]=a),!0}if("shadowColor"===n){r||(r={});const o=r.shadowColorArray,a=Gv(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(i[n]=a),!0}return!1}_interpolate(t,e,n,i,r){}getDefaultAttribute(t){return ev(this)[this.type][t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Yg.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 u(t,!0)?this.pathProxy=(new wg).fromString(t):this.pathProxy=new wg,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",v(t)||b(t)?(Kv.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(Kv.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new lv(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}im.mixin(hv);var rm={},sm={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+e+"]["+(e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",i=new RegExp("^"+n+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let s=0;s<r;s++)t[i[s]]="strict"===n?[e[i[s]]]:e[i[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){const e=i.exec(t);return!(null==e)},t.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},t.nameRegexp=n}(sm);const om=sm,am={allowBooleanAttributes:!1,unpairedTags:[]};function lm(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function hm(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return vm("InvalidXml","XML declaration allowed only at the start of the document.",bm(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function cm(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}rm.validate=function(t,e){e=Object.assign({},am,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=hm(t,o),o.err)return o}else{if("<"!==t[o]){if(lm(t[o]))continue;return vm("InvalidChar","char '"+t[o]+"' is not expected.",bm(t,o))}{let a=o;if(o++,"!"===t[o]){o=cm(t,o);continue}{let l=!1;"/"===t[o]&&(l=!0,o++);let h="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)h+=t[o];if(h=h.trim(),"/"===h[h.length-1]&&(h=h.substring(0,h.length-1),o--),s=h,!om.isName(s)){let e;return e=0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",vm("InvalidTag",e,bm(t,o))}const c=fm(t,o);if(!1===c)return vm("InvalidAttr","Attributes for '"+h+"' have open quote.",bm(t,o));let u=c.value;if(o=c.index,"/"===u[u.length-1]){const n=o-u.length;u=u.substring(0,u.length-1);const r=gm(u,e);if(!0!==r)return vm(r.err.code,r.err.msg,bm(t,n+r.err.line));i=!0}else if(l){if(!c.tagClosed)return vm("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",bm(t,o));if(u.trim().length>0)return vm("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",bm(t,a));{const e=n.pop();if(h!==e.tagName){let n=bm(t,e.tagStartPos);return vm("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+h+"'.",bm(t,a))}0==n.length&&(r=!0)}}else{const s=gm(u,e);if(!0!==s)return vm(s.err.code,s.err.msg,bm(t,o-u.length+s.err.line));if(!0===r)return vm("InvalidXml","Multiple possible root nodes found.",bm(t,o));-1!==e.unpairedTags.indexOf(h)||n.push({tagName:h,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=cm(t,o);continue}if("?"!==t[o+1])break;if(o=hm(t,++o),o.err)return o}else if("&"===t[o]){const e=ym(t,o);if(-1==e)return vm("InvalidChar","char '&' is not expected.",bm(t,o));o=e}else if(!0===r&&!lm(t[o]))return vm("InvalidXml","Extra text at the end",bm(t,o));"<"===t[o]&&o--}}}var s;return i?1==n.length?vm("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",bm(t,n[0].tagStartPos)):!(n.length>0)||vm("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):vm("InvalidXml","Start tag expected.",1)};const um='"',dm="'";function fm(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===um||t[e]===dm)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const pm=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function gm(t,e){const n=om.getAllMatches(t,pm),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return vm("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",xm(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return vm("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",xm(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return vm("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",xm(n[t]));const r=n[t][2];if(!mm(r))return vm("InvalidAttr","Attribute '"+r+"' is an invalid name.",xm(n[t]));if(i.hasOwnProperty(r))return vm("InvalidAttr","Attribute '"+r+"' is repeated.",xm(n[t]));i[r]=1}return!0}function ym(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function vm(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function mm(t){return om.isName(t)}function bm(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function xm(t){return t.startIndex+t[1].length}var wm={};const Am={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};wm.buildOptions=function(t){return Object.assign({},Am,t)},wm.defaultOptions=Am;var Sm=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}};const _m=sm;function Tm(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function Bm(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function Cm(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Pm(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function Rm(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Om(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function Mm(t){if(_m.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}var Em=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&Cm(t,e))e+=7,[entityName,val,e]=Tm(t,e+1),-1===val.indexOf("&")&&(n[Mm(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(r&&Pm(t,e))e+=8;else if(r&&Rm(t,e))e+=8;else if(r&&Om(t,e))e+=9;else{if(!Bm)throw new Error("Invalid DOCTYPE");s=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}};const km=/^[-+]?0x[a-fA-F0-9]+$/,Im=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const jm={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var Dm=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},jm,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&km.test(n))return Number.parseInt(n,16);{const i=Im.exec(n);if(i){const r=i[1],s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(i[3]);const a=i[4]||i[6];if(!e.leadingZeros&&s.length>0&&r&&"."!==n[2])return t;if(!e.leadingZeros&&s.length>0&&!r&&"."!==n[1])return t;{const i=Number(n),l=""+i;return-1!==l.search(/[eE]/)||a?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===l&&""===o||l===o||r&&l==="-"+o?i:t:s?o===l||r+o===l?i:t:n===l||n===r+l?i:t}}return t}};const Lm=sm,Nm=Sm,Wm=Em,Um=Dm;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Lm.nameRegexp);function Fm(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function zm(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,s);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return tb(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?tb(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function Hm(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const Vm=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function Gm(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=Lm.getAllMatches(t,Vm),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:tb(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const Xm=function(t){t=t.replace(/\r\n?/g,"\n");const e=new Nm("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=Zm(t,">",s,"Closing Tag is not closed.");let o=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),n=this.tagsNodeStack.pop(),i="",s=e}else if("?"===t[s+1]){let e=Jm(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new Nm(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=Zm(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(s+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=e}else if("!D"===t.substr(s+1,2)){const e=Wm(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=Zm(t,"]]>",s,"CDATA is not closed.")-2,o=t.substring(s+9,e);if(i=this.saveTextToParentTag(i,n,r),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,r,!0,!1,!0);null==t&&(t=""),n.add(this.options.textNodeName,t)}s=e+2}else{let o=Jm(t,s,this.options.removeNSPrefix),a=o.tagName,l=o.tagExp,h=o.attrExpPresent,c=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const u=n;if(u&&-1!==this.options.unpairedTags.indexOf(u.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const n=this.readStopNodeData(t,a,c+1);if(!n)throw new Error(`Unexpected end of ${a}`);s=n.i,e=n.tagContent}const i=new Nm(a);a!==l&&h&&(i[":@"]=this.buildAttributesMap(l,r,a)),e&&(e=this.parseTextData(e,a,r,!0,h,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),l=a):l=l.substr(0,l.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new Nm(a);a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Nm(a);this.tagsNodeStack.push(n),a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(n,t,r),n=t}i="",s=c}}else i+=t[s]}return e.child};function Ym(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const qm=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Km(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function $m(t,e,n){const i="*."+n;for(const n in t){const r=t[n];if(i===r||e===r)return!0}return!1}function Zm(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Jm(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const s=i.index,o=r.search(/\s/);let a=r,l=!0;if(-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1)),n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==i.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:l}}function Qm(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=Zm(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=Zm(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=Zm(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=Zm(t,"]]>",n,"StopNode is not closed.")-2}else{const i=Jm(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function tb(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&Um(t,n)}return Lm.isExist(t)?t:""}var eb=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=Fm,this.parseXml=Xm,this.parseTextData=zm,this.resolveNameSpace=Hm,this.buildAttributesMap=Gm,this.isItStopNode=$m,this.replaceEntitiesValue=qm,this.readStopNodeData=Qm,this.saveTextToParentTag=Km,this.addChild=Ym}},nb={};function ib(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=rb(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=ib(o[a],e,l);const n=ob(t,e);o[":@"]?sb(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function rb(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function sb(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];i.isArray(s,n+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function ob(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}nb.prettify=function(t,e){return ib(t,e)};const{buildOptions:ab}=wm,lb=eb,{prettify:hb}=nb,cb=rm;var ub=class{constructor(t){this.externalEntities={},this.options=ab(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=cb.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new lb(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:hb(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}};function db(t,e,n,i){let r="",s=!1;for(let o=0;o<t.length;o++){const a=t[o],l=fb(a);let h="";if(h=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];gb(h,e)||(t=e.tagValueProcessor(l,t),t=yb(t,e)),s&&(r+=i),r+=t,s=!1;continue}if(l===e.cdataPropName){s&&(r+=i),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,s=!1;continue}if(l===e.commentPropName){r+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const t=pb(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",r+=n+`<${l}${o}${t}?>`,s=!0;continue}let c=i;""!==c&&(c+=e.indentBy);const u=i+`<${l}${pb(a[":@"],e)}`,d=db(a[l],e,h,c);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=u+">":r+=u+"/>":d&&0!==d.length||!e.suppressEmptyNode?d&&d.endsWith(">")?r+=u+`>${d}${i}</${l}>`:(r+=u+">",d&&""!==i&&(d.includes("/>")||d.includes("</"))?r+=i+e.indentBy+d+i:r+=d,r+=`</${l}>`):r+=u+"/>",s=!0}return r}function fb(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function pb(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){let r=e.attributeValueProcessor(i,t[i]);r=yb(r,e),!0===r&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${r}"`}return n}function gb(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function yb(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const vb=function(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),db(t,e,"",n)},mb={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function bb(t){this.options=Object.assign({},mb,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ab),this.processTextOrObjNode=xb,this.options.format?(this.indentate=wb,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function xb(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function wb(t){return this.options.indentBy.repeat(t)}function Ab(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}bb.prototype.build=function(t){return this.options.preserveOrder?vb(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},bb.prototype.j2x=function(t,e){let n="",i="";for(let r in t)if(void 0===t[r])this.isAttribute(r)&&(i+="");else if(null===t[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)i+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const s=this.isAttribute(r);if(s)n+=this.buildAttrPairStr(s,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const n=t[r].length;let s="";for(let o=0;o<n;o++){const n=t[r][o];void 0===n||(null===n?"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof n?this.options.oneListGroup?s+=this.j2x(n,e+1).val:s+=this.processTextOrObjNode(n,r,e):s+=this.buildTextValNode(n,r,"",e))}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,"",e)),i+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let s=0;s<i;s++)n+=this.buildAttrPairStr(e[s],""+t[r][e[s]])}else i+=this.processTextOrObjNode(t[r],r,e);return{attrStr:n,val:i}},bb.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},bb.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+s+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+s+">"+t+r}},bb.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},bb.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},bb.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};var Sb={XMLParser:ub,XMLValidator:rm,XMLBuilder:bb};function _b(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}let Tb=0;function Bb(){return Tb++}var Cb;function Pb(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Mb(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:Cb.VERTICAL}),i="",n=0),e.push({text:t[r],direction:Cb.HORIZONTAL}));return i&&e.push({text:i,direction:Cb.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Cb||(Cb={}));const Rb=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Rb.set(t,!0)));const Ob=new Map;function Mb(t){if(Rb.has(t))return!0;if(Ob.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Ob.set(t,!0)));const Eb=Bb(),kb=Bb(),Ib=Bb(),jb=Bb(),Db=Bb(),Lb=Bb(),Nb=Bb(),Wb=Bb(),Ub=Bb(),Fb=Bb(),zb=Bb(),Hb=Bb(),Vb=Bb(),Gb=Bb(),Xb=Bb(),Yb=Bb(),qb=Symbol.for("GraphicService"),Kb=Symbol.for("GraphicCreator"),$b={"@_stroke-linecap":"lineCap","@_stroke-linejoin":"lineJoin","@_stroke-dasharray":"lineDash","@_stroke-dashoffset":"lineDashOffset","@_stroke-width":"lineWidth","@_fill-opacity":"fillOpacity","@_stroke-opacity":"strokeOpacity","@_stroke":"stroke","@_fill":"fill"},Zb=Object.keys($b);var Jb;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Jb||(Jb={}));class Qb extends im{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Lb,this._childUpdateTag=kp.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 Qy),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Qy)}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(t,e,n){if(n===Ip.GLOBAL){const n=new U(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&kp.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Yg.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Yg.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=ev(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=Yg.graphicService.updateGroupAABBBounds(t,ev(this).group,this._AABBBounds,this),{boundsPadding:i=e.boundsPadding}=t,r=Bv(i);return r&&n.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}clearUpdateBoundTag(){this._updateTag&=kp.CLEAR_BOUNDS,this._childUpdateTag&=kp.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=kp.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&kp.UPDATE_BOUNDS||(this._childUpdateTag|=kp.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(),Yg.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Yg.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertBefore(t,e){const n=super.insertBefore(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertAfter(t,e){const n=super.insertAfter(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertInto(t,e){const n=super.insertInto(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}removeChild(t){const e=super.removeChild(t);return t.stage=null,Yg.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{Yg.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),Yg.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&kp.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=Yg.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new Qb(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Qb.NOWORK_ANIMATE_ATTR}}Qb.NOWORK_ANIMATE_ATTR=nm;const tx=Symbol.for("LayerHandlerContribution");class ex extends Qb{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,n,i){var r;super({}),this.stage=t,this.global=e,this.window=n,this.main=i.main,this.layerHandler=ly.get(tx),this.layerHandler.init(this,n,{main:i.main,canvasId:i.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=i.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Qy,this.background="rgba(0, 0, 0, 0)",this.virtual=!!i.virtual,this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Yg.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 n;const i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var n,i,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:null!==(i=e.x)&&void 0!==i?i:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Yg.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var n,i,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:null!==(i=e.x)&&void 0!==i?i:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}var nx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ix=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rx=function(t,e){return function(n,i){e(n,i,t)}};let sx=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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();const n=new ex(t,this.global,t.window,Object.assign(Object.assign({},e),{virtual:0===this.staticLayerCountInEnv})),i=this.layerMap.get(t)||[];return i.push(n),this.layerMap.set(t,i),this.staticLayerCountInEnv--,n}releaseLayer(t,e){e.release();const n=this.layerMap.get(t)||[];this.layerMap.set(t,n.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}};sx=nx([np(),rx(0,sp(yp)),ix("design:paramtypes",[Object])],sx);var ox=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ax=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lx=function(t,e){return function(n,i){e(n,i,t)}};const hx=Symbol.for("VWindow"),cx=Symbol.for("WindowHandlerContribution");let ux=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 pp(["x","y","width","height"])},this._uid=nv.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;t.env&&!this.actived&&(ly.getNamed(cx,t.env).configure(this,t),this.actived=!0,this._handler)}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,n){return this._handler.addEventListener(t,e,n)}removeEventListener(t,e,n){return this._handler.removeEventListener(t,e,n)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};ox([hp(),ax("design:type",Function),ax("design:paramtypes",[]),ax("design:returntype",void 0)],ux.prototype,"postInit",null),ux=ox([np(),lx(0,sp(yp)),ax("design:paramtypes",[Object])],ux);const dx=Symbol.for("TransformUtil"),fx=Symbol.for("GraphicUtil"),px=Symbol.for("LayerService");var gx=new Zf((t=>{t(xp).toSelf().inSingletonScope(),t(yp).toService(xp),t(ux).to(ux),t(hx).toService(ux),t(Vy).toSelf().inSingletonScope(),t(fx).toService(Vy),t(Yy).toSelf().inSingletonScope(),t(dx).toService(Yy),t(sx).toSelf().inSingletonScope(),t(px).toService(sx)}));function yx(t,e){return!(!t&&!e)}function vx(t,e){let n;return n=d(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function mx(t,e,n){return n&&t*e>0}function bx(t,e,n,i,r){return r&&t*e>0&&n>0&&i>0}function xx(t,e){return t*e>0}function Ax(t,e,n,i){return t*e>0&&n>0&&i>0}function Sx(t,e,n,i,r,s,o,a){if(!t.pathProxy)return!1;const l=ev(t,null==s?void 0:s.theme)[t.type],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible}=t.attribute,y=mx(u,d,h),v=xx(u,p),m=yx(h),b=vx(c,f);if(!g)return!0;if(!m&&!b)return!0;if(!(y||v||o||a))return!0;e.beginPath();return Gp(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),b&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),m&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),!0}function _x(t,e,n,i,r,s,o,a){const l=n-t,h=i-e,c=o-r,u=a-s;let d=u*l-c*h;return d*d<_?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*l,e+d*h])}function Tx(t,e,n,i,r,s,o){const a=t-n,l=e-i,h=(o?s:-s)/Math.sqrt(a*a+l*l),c=h*l,u=-h*a,d=t+c,f=e+u,p=n+c,g=i+u,y=(d+p)/2,v=(f+g)/2,m=p-d,b=g-f,x=m*m+b*b,w=r-s,A=d*g-p*f,S=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-A*A));let _=(A*b-m*S)/x,T=(-A*m-b*S)/x;const B=(A*b+m*S)/x,C=(-A*m+b*S)/x,P=_-y,R=T-v,O=B-y,M=C-v;return P*P+R*R>O*O+M*M&&(_=B,T=C),{cx:_,cy:T,x01:-c,y01:-u,x11:_*(r/w-1),y11:T*(r/w-1)}}function Bx(t,e,n,i,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=R(l-a),c=l>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=_)e.moveTo(n,i);else if(h>=P-_)e.moveTo(n+r*M(a),i+r*I(a)),e.arc(n,i,r,a,l,!c),s>_&&(e.moveTo(n+s*M(l),i+s*I(l)),e.arc(n,i,s,l,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:f,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:y,innerEndAngle:v,innerStartAngle:m}=t.getParsePadAngle(a,l),b=d,x=d,w=d,A=d,S=Math.max(x,b),B=Math.max(w,A);let C=S,P=B;const R=r*M(g),E=r*I(g),D=s*M(v),N=s*I(v);let W,U,F,z;if((B>_||S>_)&&(W=r*M(y),U=r*I(y),F=s*M(m),z=s*I(m),h<T)){const t=_x(R,E,F,z,W,U,D,N);if(t){const e=R-t[0],n=E-t[1],i=W-t[0],o=U-t[1],a=1/I(L((e*i+n*o)/(j(e*e+n*n)*j(i*i+o*o)))/2),l=j(t[0]*t[0]+t[1]*t[1]);P=k(B,(s-l)/(a-1)),C=k(S,(r-l)/(a+1))}}if(f<.001)o&&(o[3]||o[1])&&e.moveTo(n+R,i+E),u=!0;else if(C>_){const t=k(b,C),s=k(x,C),a=Tx(F,z,R,E,r,t,Number(c)),l=Tx(W,U,D,N,r,s,Number(c));C<S&&t===s?!o||o[0]?(e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),e.arc(n+a.cx,i+a.cy,C,O(a.y01,a.x01),O(l.y01,l.x01),!c)):e.moveTo(n+a.cx+C*M(O(l.y01,l.x01)),i+a.cy+C*I(O(l.y01,l.x01))):!o||o[0]?(e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),t>0&&e.arc(n+a.cx,i+a.cy,t,O(a.y01,a.x01),O(a.y11,a.x11),!c),e.arc(n,i,r,O(a.cy+a.y11,a.cx+a.x11),O(l.cy+l.y11,l.cx+l.x11),!c),s>0&&e.arc(n+l.cx,i+l.cy,s,O(l.y11,l.x11),O(l.y01,l.x01),!c)):s>0?e.moveTo(n+l.cx+s*M(O(l.y01,l.x01)),i+l.cy+s*I(O(l.y01,l.x01))):e.moveTo(n+W,i+r*I(y))}else!o||o[0]?(e.moveTo(n+R,i+E),e.arc(n,i,r,g,y,!c)):e.moveTo(n+r*M(y),i+(null!=U?U:0));if(!(s>_)||p<.001)!o||o[1]?e.lineTo(n+D,i+N):e.moveTo(n+D,i+N),u=!0;else if(P>_){const t=k(A,P),r=k(w,P),a=Tx(D,N,W,U,s,-r,Number(c)),l=Tx(R,E,F,z,s,-t,Number(c));if(!o||o[1]?e.lineTo(n+a.cx+a.x01,i+a.cy+a.y01):e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),P<B&&t===r){const t=O(l.y01,l.x01);!o||o[2]?e.arc(n+a.cx,i+a.cy,P,O(a.y01,a.x01),t,!c):e.moveTo(n+a.cx+M(t),i+a.cy+I(t))}else!o||o[2]?(r>0&&e.arc(n+a.cx,i+a.cy,r,O(a.y01,a.x01),O(a.y11,a.x11),!c),e.arc(n,i,s,O(a.cy+a.y11,a.cx+a.x11),O(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(n+l.cx,i+l.cy,t,O(l.y11,l.x11),O(l.y01,l.x01),!c)):t>0?e.moveTo(n+l.cx+t*M(O(l.y01,l.x01)),i+l.cy+t*I(O(l.y01,l.x01))):e.moveTo(n+F,i+z)}else!o||o[1]?e.lineTo(n+D,i+N):e.moveTo(n+D,i+N),!o||o[2]?e.arc(n,i,s,v,m,c):e.moveTo(n+s*M(m),i+s*I(m))}return o?o[3]&&e.lineTo(n+r*M(a),i+r*I(a)):e.closePath(),u}class Cx{static GetCanvas(){try{return Cx.canvas||(Cx.canvas=Yg.global.createCanvas({})),Cx.canvas}catch(t){return null}}static GetCtx(){if(!Cx.ctx){const t=Cx.GetCanvas();Cx.ctx=t.getContext("2d")}return Cx.ctx}}class Px{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const n=Cx.GetCanvas(),i=Cx.GetCtx();if(n.width=e,n.height=1,!i)return;if(i.translate(0,0),!i)throw new Error("获取ctx发生错误");const r=i.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),i.fillStyle=r,i.fillRect(0,0,e,1),this.rgbaSet=i.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n="";t.forEach((t=>n+=t.join())),n+=e;let i=Px.dataMap.get(n);return i||(i=new Px(t,e),Px.dataMap.set(n,i)),i}static SetColorInterpolateInstance(t,e){Px.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Px.dataMap.get(t)}}Px.dataMap=new Map;class Rx{static GetSize(t){for(let e=0;e<Rx.ImageSize.length;e++)if(Rx.ImageSize[e]>=t)return Rx.ImageSize[e];return t}static Get(t,e,n,i,r,s,o){const a=Rx.GenKey(t,e,n,i,r),l=Rx.cache[a];if(!l||0===l.length)return null;for(let t=0;t<l.length;t++)if(l[t].width>=s&&l[t].height>=o)return l[t].pattern;return null}static Set(t,e,n,i,r,s,o,a){const l=Rx.GenKey(t,e,n,i,r);Rx.cache[l]?Rx.cache[l].push({width:o,height:a,pattern:s}):Rx.cache[l]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,n,i,r){return`${e},${n},${i},${r},${t.join()}`}}Rx.cache={},Rx.ImageSize=[20,40,80,160,320,640,1280,2560];const Ox=Symbol.for("ArcRenderContribution"),Mx=Symbol.for("AreaRenderContribution"),Ex=Symbol.for("CircleRenderContribution"),kx=Symbol.for("GroupRenderContribution"),Ix=Symbol.for("ImageRenderContribution"),jx=Symbol.for("PathRenderContribution"),Dx=Symbol.for("PolygonRenderContribution"),Lx=Symbol.for("RectRenderContribution"),Nx=Symbol.for("SymbolRenderContribution"),Wx=Symbol.for("TextRenderContribution"),Ux=Symbol.for("InteractiveSubRenderContribution");var Fx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},zx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hx=function(t,e){return function(n,i){e(n,i,t)}};let Vx=class{constructor(t){this.arcRenderContribitions=t,this.numberType=Eb}drawArcTailCapPath(t,e,n,i,r,s,o,a){const l=a-o,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=a;const d=R(u-c),f=u>c;let p=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:y,innerDeltaAngle:v,outerStartAngle:m,outerEndAngle:b,innerEndAngle:x,innerStartAngle:w}=t.getParsePadAngle(c,u),A=g,S=g,B=g,C=g,P=Math.max(S,A),E=Math.max(B,C);let D=P,N=E;const W=r*M(m),U=r*I(m),F=s*M(x),z=s*I(x);let H,V,G,X;if((E>_||P>_)&&(H=r*M(b),V=r*I(b),G=s*M(w),X=s*I(w),d<T)){const t=_x(W,U,G,X,H,V,F,z);if(t){const e=W-t[0],n=U-t[1],i=H-t[0],o=V-t[1],a=1/I(L((e*i+n*o)/(j(e*e+n*n)*j(i*i+o*o)))/2),l=j(t[0]*t[0]+t[1]*t[1]);N=k(E,(s-l)/(a-1)),D=k(P,(r-l)/(a+1))}}if(D>_){const t=k(A,D),s=k(S,D),o=Tx(G,X,W,U,r,t,Number(f)),a=Tx(H,V,F,z,r,s,Number(f));if(D<P&&t===s)e.moveTo(n+o.cx+o.x01,i+o.cy+o.y01),e.arc(n+o.cx,i+o.cy,D,O(o.y01,o.x01),O(a.y01,a.x01),!f);else{const t=u-l-.03,o=O(a.y11,a.x11);e.arc(n,i,r,t,o,!f),s>0&&e.arc(n+a.cx,i+a.cy,s,O(a.y11,a.x11),O(a.y01,a.x01),!f)}}else e.moveTo(n+W,i+U);if(!(s>_)||v<.001)e.lineTo(n+F,i+z),p=!0;else if(N>_){const t=k(C,N),r=k(B,N),o=Tx(F,z,H,V,s,-r,Number(f)),a=Tx(W,U,G,X,s,-t,Number(f));if(e.lineTo(n+o.cx+o.x01,i+o.cy+o.y01),N<E&&t===r){const t=O(a.y01,a.x01);e.arc(n+o.cx,i+o.cy,N,O(o.y01,o.x01),t,!f)}else{r>0&&e.arc(n+o.cx,i+o.cy,r,O(o.y01,o.x01),O(o.y11,o.x11),!f);const t=O(o.cy+o.y11,o.cx+o.x11),a=u-l-.03;e.arc(n,i,s,t,a,f)}}else e.lineTo(n+s*M(w),i+s*I(w));return p}drawShape(t,e,n,i,r,s,a,l){const h=ev(t,null==s?void 0:s.theme).arc,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible,x:m=h.x,y:b=h.y}=t.attribute,x=mx(f,p,c),w=xx(f,y),A=yx(c,u),S=vx(d,g);if(!t.valid||!v)return;if(!A&&!S)return;if(!(x||w||a||l||u))return;const{outerRadius:T=h.outerRadius,innerRadius:B=h.innerRadius,cap:C=h.cap,forceShowCap:O=h.forceShowCap}=t.attribute;let M=0;const E=(o(C)&&C||C[0])&&"conical"===c.gradient;if(E){const{sc:e,startAngle:n,endAngle:i}=t.getParsedAngle();R(i-n)<P-_&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let k=!1;const{isFullStroke:I,stroke:j}=(t=>{var e;let n=!0;if(o(t,!0)){for(let i=0;i<4;i++)_v[i]=t,n&&(n=!(null!==(e=_v[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(let e=0;e<4;e++)_v[e]=!!t[e],n&&(n=!!_v[e]);else _v[0]=!1,_v[1]=!1,_v[2]=!1,_v[3]=!1;return{isFullStroke:n,stroke:_v}})(d);if(A||I){if(e.beginPath(),Bx(t,e,n,i,T,B),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Fp.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,S,x,w,h,r,a,l)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),A&&(a?a(e,t.attribute,h):x&&(e.setCommonStyle(t,t.attribute,m-n,b-i,h),e.fill())),S&&I&&(l?l(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,m-n,b-i,h),e.stroke()))}if(!I&&S){if(e.beginPath(),Bx(t,e,n,i,T,B,j),!k){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Fp.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,S,x,w,h,r,a,l)}))}l?l(e,t.attribute,h):w&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())}if((o(C)&&C||C[1])&&O){const{startAngle:s,endAngle:o}=t.getParsedAngle();if(R(o-s)>=P-_){e.beginPath();const s=Math.abs(T-B)/2/T,{endAngle:o=h.endAngle,fill:c=h.fill}=t.attribute,u=o;if(this.drawArcTailCapPath(t,e,n,i,T,B,u,u+s),!k){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Fp.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,S,x,w,h,r,a,l)}))}if(A){const r=c;if("conical"===r.gradient){const s=function(t,e,n,i){const{stops:r,startAngle:s,endAngle:o}=i;for(;n<0;)n+=P;for(;n>P;)n-=P;if(n<s)return r[0].color;if(n>o)return r[0].color;let a,l,h=(n-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=h){a=r[t-1],l=r[t];break}return h=(h-a.offset)/(l.offset-a.offset),Gv(a.color,l.color,h,!1)}(0,0,o,r);a||mx&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=s,e.fill())}}S&&(l||w&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))}}this._arcAfterRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,S,x,w,h,r,a,l)})),E&&(c.startAngle+=M,c.endAngle+=M)}draw(t,e,n,i){const{context:r}=n;if(!r)return;const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};Vx=Fx([np(),Hx(0,sp(cp)),Hx(0,ip(Ox)),zx("design:paramtypes",[Object])],Vx);var Gx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Xx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yx=function(t,e){return function(n,i){e(n,i,t)}};let qx=class{constructor(t){this.circleRenderContribitions=t,this.numberType=jb}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).circle,{fill:h=l.fill,background:c,stroke:u=l.stroke,radius:d=l.radius,startAngle:f=l.startAngle,endAngle:p=l.endAngle,fillOpacity:g=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,opacity:v=l.opacity,lineWidth:m=l.lineWidth,visible:b=l.visible,x:x=l.x,y:w=l.y}=t.attribute,A=mx(v,g,h),S=xx(v,y),_=yx(h,c),T=vx(u,m);t.valid&&b&&(_||T)&&(A||S||o||a||c)&&(e.beginPath(),e.arc(n,i,d,f,p),e.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,_,T,A,S,l,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):A&&(e.setCommonStyle(t,t.attribute,x-n,w-i,l),e.fill())),T&&(a?a(e,t.attribute,l):S&&(e.setStrokeStyle(t,t.attribute,x-n,w-i,l),e.stroke())),this._circleRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,_,T,A,S,l,r,o,a)})))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};qx=Gx([np(),Yx(0,sp(cp)),Yx(0,ip(Ex)),Xx("design:paramtypes",[Object])],qx);const Kx=["radius","startAngle","endAngle",...Zv];class $x extends im{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=jb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)}doUpdateAABBBounds(t){const e=ev(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Yg.graphicService.updateCircleAABBBounds(n,ev(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=Bv(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).circle[t]}needUpdateTags(t){for(let e=0;e<Kx.length;e++){const n=Kx[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<Kx.length;e++)if(t===Kx[e])return!0;return!1}toCustomPath(){var t,e,n;const i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),a=new wg;return a.arc(0,0,r,s,o),a}clone(){return new $x(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return $x.NOWORK_ANIMATE_ATTR}}function Zx(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*n+"px "+(a||"sans-serif")}function Jx(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Qx(t,e,n){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}$x.NOWORK_ANIMATE_ATTR=nm;class tw{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}GetLayout(t,e,n,i,r,s,o,a,l){const h=[],c=[e,n],u=[0,0];for(;t.length>0;){const{str:n}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);h.push({str:n,width:this.textMeasure.measureTextWidth(n,this.textOptions)}),t=t.substring(n.length)}"left"===i||"start"===i||("center"===i?u[0]=c[0]/-2:"right"!==i&&"end"!==i||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,h,i,r,s)}GetLayoutByLines(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;t=t.map((t=>t.toString()));const a=[],l=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++)e=Math.min(this.textMeasure.measureTextWidth(t[n],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,e,r,s).str,width:e});l[0]=o}else{let e,n;o=0;for(let i=0,r=t.length;i<r;i++)n=t[i],e=this.textMeasure.measureTextWidth(n,this.textOptions),o=Math.max(o,e),a.push({str:n,width:e});l[0]=o}l[1]=a.length*i,l[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const h={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(h,e,n),this.layoutWithBBox(h,a,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],o=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-o)/2:"bottom"===i&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const ew=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak",...Zv];class nw extends im{get font(){const t=ev(this).text;return this._font||(this._font=Zx(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=ev(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:i=n.maxLineWidth}=e;return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=ev(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:n=t.maxLineWidth}=e;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=Yb,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=ev(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=this.attribute,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updateSingallineAABBBounds(t){const e=ev(this).text,{direction:n=e.direction}=this.attribute;return"horizontal"===n?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=ev(this).text,{direction:n=e.direction}=this.attribute;return"horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,n;const i=ev(this).text,r=Yg.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:l=i.maxLineWidth,ellipsis:h=i.ellipsis,textAlign:c=i.textAlign,textBaseline:u=i.textBaseline,fontFamily:d=i.fontFamily,fontSize:f=i.fontSize,fontWeight:p=i.fontWeight,stroke:g=i.stroke,lineWidth:y=i.lineWidth,wordBreak:v=i.wordBreak,ignoreBuf:m=i.ignoreBuf}=a,b=m?0:Math.max(2,.075*f),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||i.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(n=this.cache.clipedWidth)&&void 0!==n?n:0;const t=Jx(c,s),e=Qx(u,x,f);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(y/2),this._AABBBounds}if(Number.isFinite(l)){if(h){const e=!0===h?i.ellipsis:h,n=r.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d},l,e,!1);o=n.str,s=n.width}else{const e=r.clipText(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d},l,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const w=Jx(c,s);let A=x;Yg.global&&Yg.global.isSafari()&&(A+=.2*f);const S=Qx(u,A,f,b);return this._AABBBounds.set(w,S,w+s,S+A),g&&this._AABBBounds.expand(y/2),this._AABBBounds}updateVerticalSinglelineAABBBounds(t){var e;const n=ev(this).text,i=Yg.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=n.ignoreBuf}=s,a=o?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:f=n.fontWeight,fontFamily:p=n.fontFamily,stroke:g=n.stroke,lineHeight:y=(null!==(e=s.lineHeight)&&void 0!==e?e:(s.fontSize||n.fontSize)+a),lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak}=s;if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth;const t=Jx(c,r),e=Qx(u,y,d);return this._AABBBounds.set(e,t,e+y,t+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}let b=[Pb(t.toString())];if(Number.isFinite(l)){if(h){const t=!0===h?n.ellipsis:h,e=i.clipTextWithSuffixVertical(b[0],{fontSize:d,fontWeight:f,fontFamily:p},l,t,!1);b=[e.verticalList],r=e.width}else{const t=i.clipTextVertical(b[0],{fontSize:d,fontWeight:f,fontFamily:p},l,!1);b=[t.verticalList],r=t.width}this.cache.verticalList=b,this.cache.clipedWidth=r}else r=0,b[0].forEach((t=>{const e=t.direction===Cb.HORIZONTAL?d:i.measureTextWidth(t.text,{fontSize:d,fontWeight:f,fontFamily:p});r+=e,t.width=e})),this.cache.verticalList=b,this.cache.clipedWidth=r;this.clearUpdateShapeTag();const x=Jx(c,r),w=Qx(u,y,d);return this._AABBBounds.set(w,x,w+y,x+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const n=ev(this).text,i=this.attribute,{fontFamily:r=n.fontFamily,textAlign:s=n.textAlign,textBaseline:o=n.textBaseline,fontSize:a=n.fontSize,fontWeight:l=n.fontWeight,lineHeight:h=i.lineHeight||i.fontSize||n.fontSize,ellipsis:c=n.ellipsis,maxLineWidth:u,stroke:d=n.stroke,lineWidth:f=n.lineWidth,wordBreak:p=n.wordBreak}=i;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(f/2),this._AABBBounds}const g=Yg.graphicUtil.textMeasure,y=new tw(r,{fontSize:a,fontWeight:l,fontFamily:r},g).GetLayoutByLines(t,s,o,h,!0===c?n.ellipsis:c||void 0,!1,u),{bbox:v}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(v.xOffset,v.yOffset,v.xOffset+v.width,v.yOffset+v.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e;const n=ev(this).text,i=Yg.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=n.ignoreBuf}=s,a=o?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:f=n.fontSize,fontWeight:p=n.fontWeight,stroke:g=n.stroke,lineHeight:y=(null!==(e=s.lineHeight)&&void 0!==e?e:(s.fontSize||n.fontSize)+a),lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak}=s;if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=E(e,r)}));const t=Jx(c,r),e=this.cache.verticalList.length*y,n=Qx(u,e,f);return this._AABBBounds.set(n,t,n+e,t+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}const b=t.map((t=>Pb(t.toString())));b.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const s=!0===h?n.ellipsis:h,o=i.clipTextWithSuffixVertical(t,{fontSize:f,fontWeight:p,fontFamily:d},l,s,!1);b[e]=o.verticalList,r=o.width}else{const n=i.clipTextVertical(t,{fontSize:f,fontWeight:p,fontFamily:d},l,!1);b[e]=n.verticalList,r=n.width}else r=0,t.forEach((t=>{const e=t.direction===Cb.HORIZONTAL?f:i.measureTextWidth(t.text,{fontSize:f,fontWeight:p,fontFamily:d});r+=e,t.width=e}))})),this.cache.verticalList=b,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=E(e,r)}));const x=Jx(c,r),w=this.cache.verticalList.length*y,A=Qx(u,w,f);return this._AABBBounds.set(A,x,A+w,x+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).text[t]}needUpdateTags(t){for(let e=0;e<ew.length;e++){const n=ew[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<ew.length;e++)if(t===ew[e])return!0;return!1}clone(){return new nw(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return nw.NOWORK_ANIMATE_ATTR}}nw.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},nm);const iw=["heightLimit","lineClamp"];class rw extends nw{_isValid(){const{text:t}=this.attribute;return d(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i;const r=ev(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:l=r.fontSize,lineHeight:h=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:f=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:y=r.ignoreBuf,heightLimit:v=0,lineClamp:m}=this.attribute,b=y?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=Yg.graphicUtil.textMeasure,w=new tw(s,{fontSize:l,fontWeight:g,fontFamily:s},x),A=t.map((t=>t.toString())),S=[],_=[0,0];let T=1/0;if(v>0&&(T=Math.max(Math.floor(v/h),1)),m&&(T=Math.min(T,m)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<A.length;t++){const e=A[t];let r=!0;if(t===T-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);S.push({str:t.str,width:t.width});break}const s=w.textMeasure.clipText(e,w.textOptions,u,"break-word"===p);if(""!==e&&""===s.str){if(c){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(i=t.width)&&void 0!==i?i:0}else s.str="",s.width=0;r=!1}if(S.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const n=e.substring(s.str.length);A.splice(t+1,0,n)}}let t=0;S.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,n=0;for(let i=0,r=A.length;i<r;i++){if(i===T-1){const t=w.textMeasure.clipTextWithSuffix(A[i],w.textOptions,u,c,!1);S.push({str:t.str,width:t.width}),n=Math.max(n,t.width);break}e=A[i],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===p),n=Math.max(n,t),S.push({str:e,width:t})}_[0]=n}_[1]=S.length*(h+b);const B={xOffset:0,yOffset:0,width:_[0],height:_[1]};w.LayoutBBox(B,o,a);const C=w.layoutWithBBox(B,S,o,a,h);return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<iw.length;e++){const n=iw[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<iw.length;e++)if(t===iw[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return rw.NOWORK_ANIMATE_ATTR}}function sw(t,e,n,i,r){return r?t.arc(n,i,e,0,C,!1,r):t.arc(n,i,e,0,C),!1}var ow=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,n,i,r){return sw(t,e/2,n,i,r)}drawOffset(t,e,n,i,r,s){return sw(t,e/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var aw=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,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,e/6,n,i,r,s)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function lw(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var hw=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return lw(t,e/2,n,i,r)}drawFitDir(t,e,n,i,r){return lw(t,e/2,n,i,r)}drawOffset(t,e,n,i,r,s){return lw(t,e/2+r,n,i,s)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function cw(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var uw=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return cw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return cw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};class dw{constructor(){this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}var fw=new dw;var pw=new class extends dw{constructor(){super(...arguments),this.type="triangle"}};const gw=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),yw=Math.sin(C/10)*gw,vw=-Math.cos(C/10)*gw;function mw(t,e,n,i){const r=yw*e,s=vw*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let o=1;o<5;++o){const a=C*o/5,l=Math.cos(a),h=Math.sin(a);t.lineTo(h*e+n,-l*e+i),t.lineTo(l*r-h*s+n,h*r+l*s+i)}return t.closePath(),!0}var bw=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,n,i){return mw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return mw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const xw=j(3);function ww(t,e,n,i){const r=e,s=r/xw,o=s/5,a=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(o/2+n,i),t.lineTo(o/2+n,a+i),t.lineTo(-o/2+n,a+i),t.lineTo(-o/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var Aw=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,n,i){return ww(t,e/2,n,i)}drawOffset(t,e,n,i,r){return ww(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Sw(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var _w=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Sw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Sw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Tw(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Bw=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,n,i){return Tw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Tw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const Cw=-.5,Pw=j(3)/2,Rw=1/j(12);function Ow(t,e,n,i){const r=e/2,s=e*Rw,o=r,a=e*Rw+e,l=-o,h=a;return t.moveTo(r+n,s+i),t.lineTo(o+n,a+i),t.lineTo(l+n,h+i),t.lineTo(Cw*r-Pw*s+n,Pw*r+Cw*s+i),t.lineTo(Cw*o-Pw*a+n,Pw*o+Cw*a+i),t.lineTo(Cw*l-Pw*h+n,Pw*l+Cw*h+i),t.lineTo(Cw*r+Pw*s+n,Cw*s-Pw*r+i),t.lineTo(Cw*o+Pw*a+n,Cw*a-Pw*o+i),t.lineTo(Cw*l+Pw*h+n,Cw*h-Pw*l+i),t.closePath(),!1}var Mw=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,n,i){return Ow(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Ow(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Ew=new class{constructor(){this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var kw=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,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Iw=new class{constructor(){this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const jw=j(3);function Dw(t,e,n,i){const r=e*jw;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var Lw=new class extends dw{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return Dw(t,e/2/jw,n,i)}drawOffset(t,e,n,i,r){return Dw(t,e/2/jw+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Nw(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var Ww=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,n,i){return Nw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Nw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Uw(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var Fw=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,n,i){return Uw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Uw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function zw(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var Hw=new class{constructor(){this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,n,i){return zw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return zw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Vw(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var Gw=new class{constructor(){this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,n,i){return Vw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Vw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Xw(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var Yw=new class{constructor(){this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return Xw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return Xw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e}, ${n-r} L ${e},${n+r}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function qw(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var Kw=new class{constructor(){this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return qw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return qw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n} L ${e+r},${n}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function $w(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var Zw=new class{constructor(){this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,n,i,r){return $w(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return $w(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Jw(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}var Qw=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return Jw(t,g(e)?[e,e]:e,n,i)}drawOffset(t,e,n,i,r){return Jw(t,g(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],n,i)}bounds(t,e){const n=g(t)?[t,t]:t;e.x1=-n[0]/2,e.x2=n[0]/2,e.y1=-n[1]/2,e.y2=n[1]/2}};const tA=new V;class eA{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,d(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Gp(r.path.commandList,t,n,i,e,e),o&&o(r.path,r.attribute)})),!1):(Gp(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Gp(r.path.commandList,t,n,i,e,e),s&&s(r.path,r.attribute)})),!1):(Gp(this.path.commandList,t,n,i,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;tA.x1=i.bounds.x1*t,tA.y1=i.bounds.y1*t,tA.x2=i.bounds.x2*t,tA.y2=i.bounds.y2*t,e.union(tA)}))}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 nA={};[ow,aw,hw,uw,Lw,pw,bw,Aw,_w,Bw,Mw,Ew,kw,fw,Iw,Ww,Fw,Hw,Gw,Qw,Yw,Kw,Zw].forEach((t=>{nA[t.type]=t}));const iA=["symbolType","size",...Zv];let rA=class t extends im{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Xb}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return d(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=ev(this).symbol,{symbolType:n=e.symbolType}=this.attribute;let i=nA[n];if(i)return this._parsedPath=i,i;if(i=t.userSymbolMap[n],i)return this._parsedPath=i,i;if(!0===Sb.XMLValidator.validate(n,{allowBooleanAttributes:!0})){const e=new Sb.XMLParser({ignoreAttributes:!1}),{svg:i}=e.parse(n);if(!i)return null;const r=d(i.path)?i.path:[i.path],s=new V,o=[];r.forEach((t=>{const e=(new wg).fromString(t["@_d"]),n={fill:"black"};Zb.forEach((e=>{t[e]&&(n[$b[e]]=t[e])})),o.push({path:e,attribute:n}),s.union(e.bounds)}));const a=s.width(),l=s.height(),h=1/E(a,l);return o.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new eA(n,o,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}const r=(new wg).fromString(n),s=r.bounds.width(),o=r.bounds.height(),a=1/E(s,o);return r.transform(0,0,a,a),this._parsedPath=new eA(n,r),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=ev(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Yg.graphicService.updateSymbolAABBBounds(n,ev(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=Bv(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).symbol[t]}needUpdateTags(t){for(let e=0;e<iA.length;e++){const n=iA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<iA.length;e++)if(t===iA[e])return!0;return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=d(e)?e:[e,e];return t.path?(new wg).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new wg).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};rA.userSymbolMap={},rA.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},nm);const sA=["segments","points","curveType",...Zv];let oA=class t extends im{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=Wb}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,n,i,r){"points"===t&&(r.points=Mv(n,i,e))}doUpdateAABBBounds(){const t=ev(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateLineAABBBounds(e,ev(this).line,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).line[t]}needUpdateTags(t){for(let e=0;e<sA.length;e++){const n=sA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<sA.length;e++)if(t===sA[e])return!0;return!1}toCustomPath(){const t=this.attribute,e=new wg,n=t.segments,i=t=>{if(t&&t.length){let n=!0;t.forEach((t=>{!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((t=>{i(t.points)})):t.points&&i(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};oA.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},nm);const aA=["width","height","cornerRadius",...Zv];class lA extends im{constructor(t){super(t),this.type="rect",this.numberType=Hb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=ev(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateRectAABBBounds(e,ev(this).rect,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).rect[t]}needUpdateTags(t){for(let e=0;e<aA.length;e++){const n=aA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<aA.length;e++)if(t===aA[e])return!0;return!1}toCustomPath(){const t=this.attribute,e=t.width,n=t.height,i=new wg;return i.moveTo(0,0),i.rect(0,0,e,n),i}clone(){return new lA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return lA.NOWORK_ANIMATE_ATTR}}lA.NOWORK_ANIMATE_ATTR=nm;const hA=[[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 cA extends lA{constructor(t){super(t),this.type="rect3d",this.numberType=Vb}findFace(){const t={polygons:[],vertices:[],edges:[]},e=ev(this).rect3d,{width:n=e.width,height:i=e.width,length:r=k(e.width,e.height)}=this.attribute;for(let e=0;e<hA.length;e++){const s=hA[e];t.vertices.push([s[0]*n,s[1]*i,s[2]*r])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return cA.NOWORK_ANIMATE_ATTR}}cA.NOWORK_ANIMATE_ATTR=nm;class uA extends im{constructor(t){super(t),this.type="glyph",this.numberType=Db,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,n,i){super.setAttribute(t,e,n,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;super.setAttributes(t,e,n),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,n){return super.scale(t,e,n),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=Yg.graphicService.updateGlyphAABBBounds(this.attribute,ev(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 n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var n;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(i,s.attributes),(null===(n=s.subAttributes)||void 0===n?void 0:n.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((n,i)=>{n.updateNormalAttrs(r[i]),n.applyStateAttrs(r[i],t,e)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}clearStates(t){this.hasState()&&this.normalAttrs&&(this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[])}clone(){const t=new uA(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return uA.NOWORK_ANIMATE_ATTR}}uA.NOWORK_ANIMATE_ATTR=nm;class dA{constructor(t,e,n,i,r,s,o,a,l,h,c,u,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=qg[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);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 l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=n:o+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,h=!0),this.lines[n].draw(t,i,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,h=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=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 n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],o=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&o-this.lines[n+1].height<this[this.directionKey.top]){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class fA{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic","number"==typeof n.lineHeight?this.lineHeight=n.lineHeight>this.fontSize?n.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:i,height:r,descent:s,width:o}=ny(t,n);let a=0,l=0,h=0;this.height>r&&(a=(this.height-r)/2,l=Math.ceil(a),h=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=i+l,this.descent=s+h),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=ny(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,n,i,r){let s=this.text,o=this.left+n;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=ty(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}=ny(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 n=e&&e.stroke||$g;if(!n)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=n;let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const n=e&&e.fill||Kg;if(!n)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=n;let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,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 n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=ty(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:i}=ny(this.text.slice(t),this.character);return n+this.ellipsisWidth-i}return n}}const pA=["width","height","image",...Zv];class gA extends im{constructor(t){super(t),this.type="image",this.numberType=Nb,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,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=ev(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateImageAABBBounds(e,ev(this).image,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Gg[t]}needUpdateTags(t){for(let e=0;e<pA.length;e++){const n=pA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<pA.length;e++)if(t===pA[e])return!0;return!1}clone(){return new gA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gA.NOWORK_ANIMATE_ATTR}}gA.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},nm);class yA extends gA{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=Bv(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(d(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=Bv(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=Gg.width,height:e=Gg.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-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 vA{constructor(t,e,n,i,r,s,o,a){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof yA?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=qg[this.direction];const l=this.directionKey;this.actualWidth=0;let h=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof fA){const e=Qg.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],h=Math.max(t[this.directionKey.height],h)})),this.height=h,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 yA?(t["_"+l.x]=c,c+=t[l.width]+u,t["_"+l.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?h-t.height:(h-t.height)/2):(t[l.left]=c,c+=t[l.width]+u)}))}draw(t,e,n,i,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n instanceof yA)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const{width:i}=ny("...",n.character),r=i||0;if(r<=this.blankWidth+t){n.ellipsis="add";break}if(r<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}}this.paragraphs.map(((e,s)=>{if(e instanceof yA)return e.setAttributes({x:n+e._x,y:i+e._y}),void r(e,t,n+e._x,i+e._y,this.ascent);e.draw(t,i+this.ascent,n,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n instanceof yA)break;const{width:i}=ny("...",n.character),r=i||0;if(r<=this.blankWidth+t){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}let e=0;return this.paragraphs.map(((t,n)=>{e+=t instanceof yA?t.width:t.getWidthWithEllips(this.direction)})),e}}class mA{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=qg[this.direction]}store(t){if(t instanceof yA){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new vA(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof yA?"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,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=ty(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){const[e,n]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new fA(n,t.newLine,t.character),new fA(i,!0,t.character)]}(t,i);this.store(e),this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const bA=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...Zv];class xA extends im{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Gb}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Vg.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:Vg.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:Vg.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:Vg.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:Vg.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:Vg.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:Vg.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:Vg.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=ev(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateRichTextAABBBounds(e,ev(this).richtext,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Vg[t]}needUpdateTags(t){for(let e=0;e<bA.length;e++){const n=bA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<bA.length;e++)if(t===bA[e])return!0;return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:n,maxHeight:i,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,f=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const n=e[t],i=n.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(n.id);if(i)f.push(i);else{const t=new yA(n);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=n.id,f.push(t)}}else if(e[t].text.includes("\n")){const n=e[t].text.split("\n");for(let i=0;i<n.length;i++)f.push(new fA(n[i],0!==i,e[t]))}else f.push(new fA(e[t].text,!1,e[t]));const p=new dA(0,0,("number"==typeof n&&(!r||r>n)?n:r)||0,("number"==typeof i&&(!s||s>i)?i:s)||0,o,a,l,h,c,u||"horizontal","number"==typeof n&&(!r||r>n),"number"==typeof i&&(!s||s>i),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new mA(p);for(let t=0;t<f.length;t++)g.deal(f[t]);g.send(),this._frameCache=p}clone(){return new xA(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,n,i,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===(n=this.stage)||void 0===n||n.setCursor(o.attribute.cursor),null===(i=this.stage)||void 0===i||i.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,n;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(n=this.stage)||void 0===n||n.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+n,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i)})),r}getNoWorkAnimateAttr(){return xA.NOWORK_ANIMATE_ATTR}}xA.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},nm);const wA=["path","customPath",...Zv];class AA extends im{constructor(t){super(t),this.type="path",this.numberType=Ub}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=ev(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof wg?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof wg?this.cache:t.path)}doUpdateAABBBounds(){const t=ev(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updatePathAABBBounds(e,ev(this).path,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}doUpdatePathShape(){const t=this.attribute;u(t.path,!0)?this.cache=(new wg).fromString(t.path):t.customPath&&(this.cache=new wg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return ev(this).path[t]}needUpdateTags(t){for(let e=0;e<wA.length;e++){const n=wA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<wA.length;e++)if(t===wA[e])return!0;return!1}toCustomPath(){return(new wg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new AA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return AA.NOWORK_ANIMATE_ATTR}}AA.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},nm);const SA=["segments","points","curveType",...Zv];class _A extends im{constructor(t){super(t),this.type="area",this.numberType=Ib}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=ev(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateAreaAABBBounds(e,ev(this).area,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Mv(n,i,e))}getDefaultAttribute(t){return ev(this).area[t]}needUpdateTags(t){for(let e=0;e<SA.length;e++){const n=SA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<SA.length;e++)if(t===SA[e])return!0;return!1}toCustomPath(){const t=new wg,e=this.attribute,n=e.segments,i=e=>{if(e&&e.length){let n=!0;const i=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),n=!1)})),i.length){for(let e=i.length-1;e>=0;e--)t.lineTo(i[e].x,i[e].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((t=>{i(t.points)})),t}clone(){return new _A(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return _A.NOWORK_ANIMATE_ATTR}}_A.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},nm);const TA=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Zv];class BA extends im{constructor(t){super(t),this.type="arc",this.numberType=Eb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=ev(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:n=t.outerRadius,innerRadius:i=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(n-i);return Math.min(g(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=ev(this).arc;let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=X(e),n=e+s,i&&R(s)<P-_){let s=1,o=1;i.length&&(s=Number(i[0]),o=Number(i[1]));const{outerRadius:a=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute,h=Math.abs(a-l)/2,c=h/a;if(h>_&&a>_)return{startAngle:e-r*c*s,endAngle:n+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=ev(this).arc,{outerRadius:i=n.outerRadius,innerRadius:r=n.innerRadius,padAngle:s=n.padAngle}=this.attribute,{padRadius:o=j(i*i+r*r)}=this.attribute,a=R(e-t);let l=t,h=e,c=t,u=e;const d=s/2;let f=a,p=a;if(d>_&&o>_){const n=e>t?1:-1;let s=N(Number(o)/r*I(d)),a=N(Number(o)/i*I(d));return(f-=2*s)>_?(s*=n,c+=s,u-=s):(f=0,c=u=(t+e)/2),(p-=2*a)>_?(a*=n,l+=a,h-=a):(p=0,l=h=(t+e)/2),{outerStartAngle:l,outerEndAngle:h,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:f,outerDeltaAngle:p}}return{outerStartAngle:l,outerEndAngle:h,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:f,outerDeltaAngle:p}}doUpdateAABBBounds(t){const e=ev(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Yg.graphicService.updateArcAABBBounds(n,ev(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=Bv(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<TA.length;e++){const n=TA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<TA.length;e++)if(t===TA[e])return!0;return!1}getDefaultAttribute(t){return ev(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:n}=this.getParsedAngle();let i=t.innerRadius,r=t.outerRadius;const s=R(n-e),o=n>e;if(r<i){const t=r;r=i,i=t}const a=new wg;if(r<=_)a.moveTo(0,0);else if(s>=P-_)a.moveTo(0+r*M(e),0+r*I(e)),a.arc(0,0,r,e,n,!o),i>_&&(a.moveTo(0+i*M(n),0+i*I(n)),a.arc(0,0,i,n,e,o));else{const t=r*M(e),s=r*I(e),l=i*M(n),h=i*I(n);a.moveTo(0+t,0+s),a.arc(0,0,r,e,n,!o),a.lineTo(0+l,0+h),a.arc(0,0,i,n,e,o),a.closePath()}return a}clone(){return new BA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return BA.NOWORK_ANIMATE_ATTR}}BA.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},nm);class CA extends BA{constructor(t){super(t),this.type="arc3d",this.numberType=kb}doUpdateAABBBounds(){const t=ev(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updateArc3dAABBBounds(e,ev(this).polygon,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}getNoWorkAnimateAttr(){return CA.NOWORK_ANIMATE_ATTR}}CA.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},nm);const PA=["points","cornerRadius",...Zv];class RA extends im{constructor(t){super(t),this.type="polygon",this.numberType=Fb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=ev(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updatePolygonAABBBounds(e,ev(this).polygon,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Mv(n,i,e))}getDefaultAttribute(t){return ev(this).polygon[t]}needUpdateTags(t){for(let e=0;e<PA.length;e++){const n=PA[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<PA.length;e++)if(t===PA[e])return!0;return!1}toCustomPath(){const t=this.attribute.points,e=new wg;return t.forEach(((t,n)=>{0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new RA(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return RA.NOWORK_ANIMATE_ATTR}}RA.NOWORK_ANIMATE_ATTR=nm;class OA extends RA{constructor(t){super(t),this.type="pyramid3d",this.numberType=zb}doUpdateAABBBounds(){const t=ev(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Yg.graphicService.updatePyramid3dAABBBounds(e,ev(this).polygon,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=Bv(i);return r&&n.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}findFace(){const{points:t}=this.attribute,e=t.map(((e,n)=>{const i=3===n?t[0]:t[n+1],r=e.x-i.x;return 0===r?0:(e.y-i.y)/r})),n=t.map((t=>({p:t,d:0})));let i=!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]){i=!0;const e=F.distancePP(n[t].p,n[t+1].p);n[t].d=e,n[t+1].d=e,r=E(r,e);const o=F.distancePP(n[s].p,n[s+1].p);n[s].d=o,n[s+1].d=o,r=E(r,o)}if(i)break}if(i)break}for(let e=t.length-1;e>=0;e--){const i=t[e];n.unshift({p:i,d:0})}for(let e=0;e<t.length;e++){const i=(r-n[e+t.length].d)/2;n[e].d+=i,n[e+t.length].d+=i}const s={polygons:[],vertices:[],edges:[]};return n.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return OA.NOWORK_ANIMATE_ATTR}}OA.NOWORK_ANIMATE_ATTR=nm;var MA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let EA=class{updateBounds(t,e,n,i){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:i=t.distance,lineWidth:o=t.lineWidth}=r;n.expand(i+s+o/2)}return n}};EA=MA([np()],EA);var kA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const IA=Symbol.for("RectBoundsContribution");let jA=class extends EA{};jA=kA([np()],jA);var DA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const LA=Symbol.for("SymbolBoundsContribution");let NA=class extends EA{updateBounds(t,e,n,i){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:i=t.distance,lineWidth:a=t.lineWidth}=r;_b(n,i+s+a/2,!0,o)}return n}};NA=DA([np()],NA);var WA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const UA=Symbol.for("CircleBoundsContribution");let FA=class extends EA{};FA=WA([np()],FA);var zA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const HA=Symbol.for("ArcBoundsContribution");let VA=class extends EA{};VA=zA([np()],VA);var GA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const XA=Symbol.for("PathBoundsContribution");let YA=class extends EA{};YA=GA([np()],YA);class qA{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 qA.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 n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const KA=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new Y(t,e,n,i,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=i,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new Y(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},$A=new qA;var ZA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},JA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},QA=function(t,e){return function(n,i){e(n,i,t)}};function tS(t,e,n){const i=n[0],r=n[1],s=n[2];let o,a,l,h,c,u,d,f,p,g,y,v;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],f=e[7],p=e[8],g=e[9],y=e[10],v=e[11],t[0]=o,t[1]=a,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=y,t[11]=v,t[12]=o*i+c*r+p*s+e[12],t[13]=a*i+u*r+g*s+e[13],t[14]=l*i+d*r+y*s+e[14],t[15]=h*i+f*r+v*s+e[15]),t}function eS(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 nS(t,e,n){const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],y=e[13],v=e[14],m=e[15];let b=n[0],x=n[1],w=n[2],A=n[3];return t[0]=b*i+x*a+w*u+A*g,t[1]=b*r+x*l+w*d+A*y,t[2]=b*s+x*h+w*f+A*v,t[3]=b*o+x*c+w*p+A*m,b=n[4],x=n[5],w=n[6],A=n[7],t[4]=b*i+x*a+w*u+A*g,t[5]=b*r+x*l+w*d+A*y,t[6]=b*s+x*h+w*f+A*v,t[7]=b*o+x*c+w*p+A*m,b=n[8],x=n[9],w=n[10],A=n[11],t[8]=b*i+x*a+w*u+A*g,t[9]=b*r+x*l+w*d+A*y,t[10]=b*s+x*h+w*f+A*v,t[11]=b*o+x*c+w*p+A*m,b=n[12],x=n[13],w=n[14],A=n[15],t[12]=b*i+x*a+w*u+A*g,t[13]=b*r+x*l+w*d+A*y,t[14]=b*s+x*h+w*f+A*v,t[15]=b*o+x*c+w*p+A*m,t}function iS(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:o=n.z,dx:a=n.dx,dy:l=n.dy,dz:h=n.dz,scaleX:c=n.scaleX,scaleY:u=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:y=e.attribute.anchor,anchor:v}=e.attribute,m=[0,0,0];if(y){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,n=e.AABBBounds;m[0]=n.x1+(n.x2-n.x1)*t}else m[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,n=e.AABBBounds;m[1]=n.x1+(n.x2-n.x1)*t}else m[1]=y[1];m[2]=null!==(i=y[2])&&void 0!==i?i:0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),tS(t,t,[r+a,s+l,o+h]),tS(t,t,[m[0],m[1],m[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+h*i,t[5]=o*r+c*i,t[6]=a*r+u*i,t[7]=l*r+d*i,t[8]=h*r-s*i,t[9]=c*r-o*i,t[10]=u*r-a*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-h*i,t[1]=o*r-c*i,t[2]=a*r-u*i,t[3]=l*r-d*i,t[8]=s*i+h*r,t[9]=o*i+c*r,t[10]=a*i+u*r,t[11]=l*i+d*r}(t,t,f),tS(t,t,[-m[0],-m[1],m[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*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 n=$A.allocate(),i=[0,0];if(v){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=y[1]}tS(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+h*i,t[1]=o*r+c*i,t[2]=a*r+u*i,t[3]=l*r+d*i,t[4]=h*r-s*i,t[5]=c*r-o*i,t[6]=u*r-a*i,t[7]=d*r-l*i}(n,n,g),tS(n,n,[-i[0],-i[1],0]),nS(t,t,n)}}let rS=class{constructor(t,e,n,i,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=n,this.circleBoundsContribitions=i,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new pp(["graphic"]),onSetStage:new pp(["graphic","stage"]),onRemove:new pp(["graphic"]),onAddIncremental:new pp(["graphic","group","stage"]),onClearIncremental:new pp(["graphic","group","stage"]),beforeUpdateAABBBounds:new pp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new pp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new V,this.tempAABBBounds2=new V}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,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new Ap(t);return Gp(n.commandList,i,0,0),!0}updateRectAABBBounds(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,i),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,n,e,!1,i),n}updateGroupAABBBounds(t,e,n,i){const{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,r,s),a||i.forEachChildren((t=>{n.union(t.AABBBounds)}));const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateGlyphAABBBounds(t,e,n,i){return i.getSubGraphic().forEach((t=>{n.union(t.AABBBounds)})),n}updateRichTextAABBBounds(t,e,n,i){if(!i)return n;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline}=t;if(r>0&&s>0)n.set(0,0,r,s);else{const t=i.getFrameCache(),{width:e,height:l}=t.getActualSize();let h=r||e||0,c=s||l||0;c="number"==typeof a&&c>a?a:c||0,h="number"==typeof o&&h>o?o:h||0,n.set(0,0,h,c)}let c=0;switch(h){case"top":c=0;break;case"middle":c=-n.height()/2;break;case"bottom":c=-n.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-n.width()/2;break;case"right":u=-n.width()}n.translate(u,c);const d=this.tempAABBBounds1,f=this.tempAABBBounds2;return d.setValue(n.x1,n.y1,n.x2,n.y2),f.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateTextAABBBounds(t,e,n,i){if(!i)return n;const{text:r=e.text}=i.attribute;Array.isArray(r)?i.updateMultilineAABBBounds(r):i.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2);const{scaleX:a=e.scaleX,scaleY:l=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(h){_b(s,h/Math.abs(a+l),!0,c),n.union(s)}return this.combindShadowAABBBounds(n,i),z(n,n,i.transMatrix),n}updatePathAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,i),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updatePathAABBBoundsImprecise(t,e,n,i){if(!i)return n;const r=i.getParsedPathShape();return n.union(r.getBounds()),n}updatePyramid3dAABBBounds(t,e,n,i){if(!i)return n;const r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((t=>{const e=t[0],i=t[1];n.add(e,i)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateArc3dAABBBounds(t,e,n,i){if(!i)return n;const r=i.stage;if(!r||!r.camera)return n;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;n.setValue(-a,-a,a,a);const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updatePolygonAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updatePolygonAABBBoundsImprecise(t,e,n,i){const{points:r=e.points}=t;return r.forEach((t=>{n.add(t.x,t.y)})),n}updateLineAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updateLineAABBBoundsByPoints(t,e,n,i){const{points:r=e.points}=t,s=n;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,n,i){const{segments:r=e.segments}=t,s=n;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updateAreaAABBBoundsByPoints(t,e,n,i){const{points:r=e.points}=t,s=n;return r.forEach((t=>{var e,n;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,n,i){const{segments:r=e.segments}=t,s=n;return r.forEach((t=>{t.points.forEach((t=>{var e,n;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),s}updateCircleAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,n,e,!1,r),n}updateCircleAABBBoundsImprecise(t,e,n,i){const{radius:r=e.radius}=t;return n.set(-r,-r,r,r),n}updateCircleAABBBoundsAccurate(t,e,n,i){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>P-_?n.set(-o,-o,o,o):Rv(r,s,o,n),n}updateArcAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===a,r),n}updateArcAABBBoundsImprecise(t,e,n,i){const{outerRadius:r=e.outerRadius}=t;return n.set(-r,-r,r,r),n}updateArcAABBBoundsAccurate(t,e,n,i){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<=_?n.set(0,0,0,0):Math.abs(o-a)>P-_?n.set(-r,-r,r,r):(Rv(a,o,r,n),Rv(a,o,s,n)),n}updateSymbolAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===a,r),n}updateSymbolAABBBoundsImprecise(t,e,n,i){const{size:r=e.size}=t;if(d(r))n.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n,i){if(!i)return n;const{size:r=e.size}=t;return i.getParsedPath().bounds(r,n),n}updateImageAABBBounds(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){const{scaleX:s=n.scaleX,scaleY:o=n.scaleY,stroke:a=n.stroke,shadowBlur:l=n.shadowBlur,lineWidth:h=n.lineWidth,strokeBoundsBuffer:c=n.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){_b(u,h/Math.abs(s+o),i,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(l){_b(u,l/Math.abs(s+o),i,c),e.union(u)}this.combindShadowAABBBounds(e,r),z(e,e,r.transMatrix)}};rS=ZA([np(),QA(0,sp(Kb)),QA(1,sp(cp)),QA(1,ip(IA)),QA(2,sp(cp)),QA(2,ip(LA)),QA(3,sp(cp)),QA(3,ip(UA)),QA(4,sp(cp)),QA(4,ip(HA)),QA(5,sp(cp)),QA(5,ip(XA)),JA("design:paramtypes",[Object,Object,Object,Object,Object,Object])],rS);class sS extends Qb{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function oS(t){return new lA(t)}function aS(t){return new nw(t)}function lS(t){return new xA(t)}const hS={arc:function(t){return new BA(t)},area:function(t){return new _A(t)},circle:function(t){return new $x(t)},group:function(t){return new Qb(t)},image:function(t){return new gA(t)},line:function(t){return new oA(t)},path:function(t){return new AA(t)},rect:oS,rect3d:function(t){return new cA(t)},symbol:function(t){return new rA(t)},text:aS,richtext:lS,polygon:function(t){return new RA(t)},shadowRoot:function(t){return new sS(t)},wrapText:function(t){return new rw(t)}},cS=aS({text:""});function uS(t){return cS.setAttributes(t),cS.AABBBounds}lS({});var dS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let fS=class{transform(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:l=e.scaleX,scaleY:h=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,f=n.modelMatrix,p=n.camera,g={x:s,y:o,z:a,lastModelMatrix:f},y=p&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t));if(y){const i=$A.allocate(),r=$A.allocate();iS(r,t,e),nS(i,f||i,r),g.x=0,g.y=0,g.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),$A.free(r)}if(d&&!f){const i=t.getOffsetXY(e);g.x+=i.x,g.y+=i.y,g.z=a,n.setTransformForCurrent()}else if(y)g.x=0,g.y=0,g.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(p&&n.project){const i=t.getOffsetXY(e);g.x+=i.x,g.y+=i.y,this.transformWithoutTranslate(n,g.x,g.y,g.z,l,h,c)}else n.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=i.project(0,0,n),a=i.project(r,0,n),l=i.project(r,s,n),h={x:0,y:0},c={x:r,y:0},u={x:r,y:s};i.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),f=-(h.y*(l.x-a.x)-c.y*l.x+u.y*a.x+(c.y-u.y)*o.x)*d,p=(c.y*l.y+h.y*(a.y-l.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(h.x*(l.x-a.x)-c.x*l.x+u.x*a.x+(c.x-u.x)*o.x)*d,y=-(c.x*l.y+h.x*(a.y-l.y)-u.x*a.y+(u.x-c.x)*o.y)*d,v=(h.x*(u.y*a.x-c.y*l.x)+h.y*(c.x*l.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,m=(h.x*(u.y*a.y-c.y*l.y)+h.y*(c.x*l.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;i.setTransform(f,p,g,y,v,m,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,o){const a=t.project(e,n,i);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()}};function pS(t,e,n,i,r){var s;const{offsetX:o=0,offsetY:a=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1,zeroX:u=0,zeroY:d=0}=r||{};if(c&&"none"===h)return;if(!e)return;let f=!0;const{curves:p}=e;if(n>=1){if(c){let e,n=!0;p.forEach(((i,r)=>{var s;let h=i.p0;if(i.originP1!==i.originP2){if(e&&e.originP1===e.originP2&&(h=e.p0),i.defined)n||(t.lineTo(h.x+o,h.y+a,l),n=!n);else{const{originP1:e,originP2:r}=i;let c;if(e&&!1!==e.defined?c=h:e&&!1!==r.defined&&(c=null!==(s=i.p3)&&void 0!==s?s:i.p1),n){n=!n;const e=c?c.x:i.p0.x,r=c?c.y:i.p0.y;t.moveTo(e+o,r+a,l)}else c&&(n=!n,t.lineTo(c.x+o,c.y+a,l))}e=i}else e=i}))}else p.forEach((e=>{e.defined?(f&&t.moveTo(e.p0.x+o,e.p0.y+a,l),gS(t,e,1,r),f=!1):f=!0}));return}if(n<=0)return;let g;"x"===i?g=Wp.ROW:"y"===i?g=Wp.COLUMN:"auto"===i&&(g=e.direction);const y=n*e.tryUpdateLength(g);let v=0,m=!0,b=null;for(let e=0,n=p.length;e<n;e++){const n=p[e],i=n.getLength(g),h=(y-v)/i;if(v+=i,h<0)break;if(c){let e=n.p0;if(n.originP1===n.originP2){b=n;continue}if(b&&b.originP1===b.originP2&&(e=b.p0),n.defined)m||(t.lineTo(e.x+o,e.y+a,l),m=!m);else{const{originP1:i,originP2:r}=n;let h;if(i&&!1!==i.defined?h=e:i&&!1!==r.defined&&(h=null!==(s=n.p3)&&void 0!==s?s:n.p1),m){m=!m;const e=h?h.x:n.p0.x,i=h?h.y:n.p0.y;t.moveTo(e+o,i+a,l)}else h&&(m=!m,t.lineTo(h.x+o,h.y+a,l))}b=n}else{if(!n.defined){f=!0;continue}f&&t.moveTo(n.p0.x+o,n.p0.y+a,l),gS(t,n,k(h,1),r),f=!1}}}function gS(t,e,n,i){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};if(1===n)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[i]=$p(e,n);t.bezierCurveTo(r+i.p1.x,s+i.p1.y,r+i.p2.x,s+i.p2.y,r+i.p3.x,s+i.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,s+i.y,o)}}fS=dS([np()],fS);var yS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let vS=class extends fS{constructor(){super(...arguments),this.numberType=Wb}draw(t,e,n,i){const{context:r}=n;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).line,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&$A.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,f,p,g){var y,v,m,b,x;if(!e)return;t.beginPath();const w=null!==(y=this.z)&&void 0!==y?y:0;pS(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:w}),f.cache&&!d(f.cache)&&f.cache.curves.every((t=>t.defined))&&f.attribute.curveType&&f.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(f,o,a);const{x:A=0,x:S=0}=o;!1!==n&&(p?p(t,o,a):r&&(t.setCommonStyle(f,o,A-c,S-u,a),t.fill())),!1!==i&&(g?g(t,o,a):s&&(t.setStrokeStyle(f,o,A-c,S-u,a),t.stroke()));let{connectedType:_,connectedX:T,connectedY:B,connectedStyle:C}=o;if(d(a)?(_=null!==(v=null!=_?_:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,T=null!==(m=null!=T?T:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,B=null!==(b=null!=B?B:a[0].connectedY)&&void 0!==b?b:a[1].connectedY,C=null!==(x=null!=C?C:a[0].connectedStyle)&&void 0!==x?x:a[1].connectedStyle):(_=null!=_?_:a.connectedType,T=null!=T?T:a.connectedX,B=null!=B?B:a.connectedY,C=null!=C?C:a.connectedStyle),"connect"!==_&&"zero"!==_&&(_="none"),"none"!==_){t.beginPath(),pS(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:w,drawConnect:!0,mode:_,zeroX:T,zeroY:B});const y=[];d(a)?a.forEach((t=>y.push(t))):y.push(a),y.push(o),!1!==n&&(p?p(t,o,a):r&&(t.setCommonStyle(f,C,A-c,S-u,y),t.fill())),!1!==i&&(g?g(t,o,a):s&&(t.setStrokeStyle(f,C,A-c,S-u,y),t.stroke()))}return!1}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).line,{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:p=l.lineWidth,visible:g=l.visible}=t.attribute,y=mx(u,d,h),v=xx(u,f),m=yx(h),b=vx(c,p);if(!t.valid||!g)return;if(!m&&!b)return;if(!(y||v||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:n,closePath:i}=t.attribute;let{curveType:r=l.curveType}=t.attribute;i&&"linear"===r&&(r="linearClosed");const s=e;if(n&&n.length){let e,i;if(t.cache=n.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===n?e={x:i.endX,y:i.endY,defined:i.curves[i.curves.length-1].defined}:n>1&&(e.x=i.endX,e.y=i.endY,e.defined=i.curves[i.curves.length-1].defined);const s=xg(t.points,r,{startPoint:e});return i=s,s})).filter((t=>!!t)),"linearClosed"===r){let e;for(let n=0;n<t.cache.length;n++){const i=t.cache[n];for(let t=0;t<i.curves.length;t++)if(i.curves[t].defined){e=i.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=xg(s,r)}t.clearUpdateShapeTag()}const{clipRange:x=l.clipRange,clipRangeByDimension:w=l.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let s=!1;t.cache.forEach(((u,p)=>{s||(s=this.drawSegmentItem(e,u,!!h,!!c,d,f,r[p],[l,t.attribute],x,w,n,i,t,o,a))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),u=x*s;let p=0,g=!1;t.cache.forEach(((s,y)=>{if(g)return;const v=s.getLength(),m=(u-p)/v;p+=v,m>0&&(g=this.drawSegmentItem(e,s,!!h,!!c,d,f,r[y],[l,t.attribute],k(m,1),w,n,i,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,d,f,t.attribute,l,x,w,n,i,t,o,a)}};function mS(t,e,n,i){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=i||{};let l=e[0];t.moveTo(l.p0.x+r,l.p0.y+s,o),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+r,h.y+s,o),l=n[n.length-1],t.lineTo(l.p0.x+r,l.p0.y+s,o),l=n[0],h=l.p3||l.p1,t.lineTo(h.x+r,h.y+s,o),t.closePath()}function bS(t,e,n,i){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),xS(t,e,1,i),a=!1):a=!0})),a=!0;for(let e=n.length-1;e>=0;e--){const l=n[e];l.defined?(a&&t.lineTo(l.p0.x+r,l.p0.y+s,o),xS(t,l,1,i),a=!1):a=!0}t.closePath()}function xS(t,e,n,i){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};if(1===n)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[i]=$p(e,n);t.bezierCurveTo(r+i.p1.x,s+i.p1.y,r+i.p2.x,s+i.p2.y,r+i.p3.x,s+i.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,s+i.y,o)}}vS=yS([np()],vS);var wS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},AS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},SS=function(t,e){return function(n,i){e(n,i,t)}};function _S(t,e,n){switch(e){case"linear":default:return rg(t,n);case"basis":return ag(t,n);case"monotoneX":return pg(t,n);case"monotoneY":return gg(t,n);case"step":return vg(t,.5,n);case"stepBefore":return vg(t,0,n);case"stepAfter":return vg(t,1,n);case"linearClosed":return bg(t,n)}}let TS=class{constructor(t){this.areaRenderContribitions=t,this.numberType=Ib}drawShape(t,e,n,i,r,s,o,a){var l,h,c,u,d,f;const p=ev(t,null==s?void 0:s.theme).area,{fill:g=p.fill,fillOpacity:y=p.fillOpacity,opacity:v=p.opacity,visible:m=p.visible,z:b=p.z,background:x,stroke:w=t.attribute.stroke,lineWidth:A=p.lineWidth,strokeOpacity:S=p.strokeOpacity}=t.attribute,_=mx(v,y,g),T=yx(g,x),B=vx(w,A),C=xx(v,S);if(!t.valid||!m)return;if(!T&&!B)return;if(!(_||o||C||a))return;const{clipRange:P=p.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:n,closePath:i}=t.attribute;let{curveType:r=p.curveType}=t.attribute;if(i&&"linear"===r&&(r="linearClosed"),n&&n.length){let e,i;const s=n.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const s=_S(t.points,r,{startPoint:e});return i=s,s})).filter((t=>!!t));let o;const a=[];for(let t=n.length-1;t>=0;t--){const e=n[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=n[t-1].points,r=e[e.length-1];r&&i.push({x:null!==(c=r.x1)&&void 0!==c?c:r.x,y:null!==(u=r.y1)&&void 0!==u?u:r.y})}o=_S(i,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const n=e,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(f=e[t].y1)&&void 0!==f?f:e[t].y});const s=_S(n,r),o=_S(i,"stepBefore"===r?"stepAfter":"stepAfter"===r?"stepBefore":r);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===P){let l=!1;t.cacheArea.forEach(((h,c)=>{l||(l=this.drawSegmentItem(e,h,T,y,B,S,s[c],[p,t.attribute],P,n,i,b,t,r,o,a))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=P*l;let c=0,u=!1;t.cacheArea.forEach(((l,d)=>{if(u)return;const f=l.top.getLength(),g=(h-c)/f;c+=f,g>0&&(u=this.drawSegmentItem(e,l,T,y,B,S,s[d],[p,t.attribute],k(g,1),n,i,b,t,r,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,T,y,B,S,t.attribute,p,P,n,i,b,t,r,o,a)}draw(t,e,n,i){const{context:r}=n,s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p,g){let y=!1;return y=y||this._drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,!1,p,g),y=y||this._drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,!0,p,g),y}_drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,f,p,g,y,v){var m,b,x,w;let{connectedType:A,connectedX:S,connectedY:_,connectedStyle:T}=o;const B=[];if(g&&(d(a)?(A=null!==(m=null!=A?A:a[0].connectedType)&&void 0!==m?m:a[1].connectedType,S=null!==(b=null!=S?S:a[0].connectedX)&&void 0!==b?b:a[1].connectedX,_=null!==(x=null!=_?_:a[0].connectedY)&&void 0!==x?x:a[1].connectedY,T=null!==(w=null!=T?T:a[0].connectedStyle)&&void 0!==w?w:a[1].connectedStyle):(A=null!=A?A:a.connectedType,S=null!=S?S:a.connectedX,_=null!=_?_:a.connectedY,T=null!=T?T:a.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),d(a)?a.forEach((t=>B.push(t))):B.push(a),B.push(o)),g&&"none"===A)return!1;if(!e)return;t.beginPath();const{points:C,segments:P}=f.attribute;let O,M,E=Wp.ROW;if(P){const t=P[P.length-1];M=P[0].points[0],O=t.points[t.points.length-1]}else M=C[0],O=C[C.length-1];E=R(O.x-M.x)>R(O.y-M.y)?Wp.ROW:Wp.COLUMN,function(t,e,n,i){var r;const{drawConnect:s=!1,mode:o="none"}=i||{};if(s&&"none"===o)return;const{top:a,bottom:l}=e;if(n>=1){const e=[],n=[];let r=!0;if(s){let r,s,o=!0;const h=a.curves.length;a.curves.forEach(((a,c)=>{const u=l.curves[h-c-1];let d=a,f=u;if(a.originP1===a.originP2)return r=a,void(s=u);if(r&&r.originP1===r.originP2&&(d=r,f=s),a.defined)o||(e.push(d),n.push(f),mS(t,e,n,i),e.length=0,n.length=0,o=!o);else{const{originP1:r,originP2:s}=a;let l,h;r&&!1!==r.defined?(l=d,h=f):r&&!1!==s.defined&&(l=a,h=u),o?(o=!o,e.push(l||a),n.push(h||u)):l&&(o=!o,e.push(l||a),n.push(h||u),mS(t,e,n,i),e.length=0,n.length=0)}r=a})),mS(t,e,n,i)}else{for(let s=0,o=a.curves.length;s<o;s++){const h=a.curves[s];r!==h.defined?(r?(bS(t,e,n,i),e.length=0,n.length=0):(e.push(h),n.push(l.curves[o-s-1])),r=!r):r&&(e.push(h),n.push(l.curves[o-s-1]))}bS(t,e,n,i)}return}if(n<=0)return;let{direction:h}=i||{};const{curves:c}=a,u=null!==(r=c[c.length-1].p3)&&void 0!==r?r:c[c.length-1].p1,d=R(u.x-c[0].p0.x),f=R(u.y-c[0].p0.y);h=null!=h?h:d>f?Wp.ROW:Wp.COLUMN,Number.isFinite(d)||(h=Wp.COLUMN),Number.isFinite(f)||(h=Wp.ROW);const p=n*(h===Wp.ROW?d:f);let g=0,y=!0;const v=[],m=[];let b,x,w=!0;for(let e=0,n=a.curves.length;e<n;e++){const r=a.curves[e],o=r.getLength(h),c=(p-g)/o;if(c<0)break;if(g+=o,s){const s=l.curves[n-e-1];let o=r,a=s;if(r.originP1===r.originP2){b=r,x=s;continue}if(b&&b.originP1===b.originP2&&(o=b,a=x),r.defined)w||(v.push(o),m.push(a),mS(t,v,m,i),v.length=0,m.length=0,w=!w);else{const{originP1:e,originP2:n}=r;let l,h;e&&!1!==e.defined?(l=o,h=a):e&&!1!==n.defined&&(l=r,h=s),w?(w=!w,v.push(l||r),m.push(h||s)):l&&(w=!w,v.push(l||r),m.push(h||s),mS(t,v,m,i),v.length=0,m.length=0)}b=r}else{let s=null,o=null;y!==r.defined?(y?(bS(t,v,m,i),v.length=0,m.length=0):(s=r,o=l.curves[n-e-1]),y=!y):y&&(s=r,o=l.curves[n-e-1]),s&&o&&(c<1&&(s=s.p2&&s.p3?$p(s,c)[0]:Jp(s,c)[0],o=o.p2&&o.p3?$p(o,1-c)[1]:Jp(o,1-c)[1]),s.defined=y,o.defined=y,v.push(s),m.push(o)),s=null,o=null}}s?mS(t,v,m,i):bS(t,v,m,i)}(t.camera?t:t.nativeContext,e,l,{offsetX:h,offsetY:c,offsetZ:u,direction:E,drawConnect:g,mode:A,zeroX:S,zeroY:_}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((e=>{e.time===Fp.beforeFillStroke&&e.drawShape(f,t,h,c,!!i,!1,n,!1,a,p,y,null,{attribute:o})})),t.setShadowStyle&&t.setShadowStyle(f,o,a);const{x:k=0,x:I=0}=o;if(!1!==n&&(y?y(t,o,a):i&&(t.setCommonStyle(f,g?T:o,k-h,I-c,g?B:a),t.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((e=>{e.time===Fp.afterFillStroke&&e.drawShape(f,t,h,c,!!i,!1,n,!1,a,p,y,null,{attribute:o})})),!1!==r)if(v)v(t,o,a);else{const{stroke:n=a&&a[1]&&a[1].stroke}=o;d(n)&&(n[0]||n[2])&&!1===n[1]&&(t.beginPath(),pS(t.camera?t:t.nativeContext,n[0]?e.top:e.bottom,l,E===Wp.ROW?"x":"y",{offsetX:h,offsetY:c,offsetZ:u,drawConnect:g,mode:A,zeroX:S,zeroY:_})),t.setStrokeStyle(f,g?T:o,k-h,I-c,g?B:a),t.stroke()}return!1}};TS=wS([np(),SS(0,sp(cp)),SS(0,ip(Mx)),AS("design:paramtypes",[Object])],TS);var BS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PS=function(t,e){return function(n,i){e(n,i,t)}};let RS=class extends fS{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Ub}drawShape(t,e,n,i,r,s,o,a){var l,h;const c=ev(t,null==s?void 0:s.theme).path,{fill:u=c.fill,stroke:d=c.stroke,fillOpacity:f=c.fillOpacity,strokeOpacity:p=c.strokeOpacity,opacity:g=c.opacity,background:y,lineWidth:v=c.lineWidth,visible:m=c.visible,x:b=c.x,y:x=c.y}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0,A=mx(g,f,u),S=xx(g,p),_=yx(u,y),T=vx(d,v);if(t.valid&&m&&(_||T)&&(A||S||o||a||y)){if(e.beginPath(),t.pathShape)Gp(t.pathShape.commandList,e,n,i,1,1,w);else{Gp((null!==(h=t.attribute.path)&&void 0!==h?h:c.path).commandList,e,n,i,1,1,w)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,_,T,A,S,c,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,c),T&&(a?a(e,t.attribute,c):S&&(e.setStrokeStyle(t,t.attribute,b-n,x-i,c),e.stroke())),_&&(o?o(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,b-n,x-i,c),e.fill())),this._pathRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,_,T,A,S,c,r,o,a)}))}}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).path,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&$A.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}};RS=BS([np(),PS(0,sp(cp)),PS(0,ip(jx)),CS("design:paramtypes",[Object])],RS);const OS=T/2;function MS(t,e,n,i,r,s){let o;if(g(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(i<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,n,i,r);const[a,l,h,c]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],u=Math.min(i/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],f=[a[0]+d[0],a[1]],p=[a[0],a[1]+d[0]],y=[l[0]-d[1],l[1]],v=[l[0],l[1]+d[1]],m=[h[0]-d[2],h[1]],b=[h[0],h[1]-d[2]],x=[c[0]+d[3],c[1]],w=[c[0],c[1]-d[3]];if(t.moveTo(f[0],f[1]),t.lineTo(y[0],y[1]),!S(y,v)){const e=y[0],n=y[1]+d[1];t.arc(e,n,d[1],-OS,0,!1)}if(t.lineTo(b[0],b[1]),!S(m,b)){const e=b[0]-d[2],n=b[1];t.arc(e,n,d[2],0,OS,!1)}if(t.lineTo(x[0],x[1]),!S(x,w)){const e=x[0],n=x[1]-d[3];t.arc(e,n,d[3],OS,T,!1)}if(t.lineTo(p[0],p[1]),!S(f,p)){const e=f[0],n=f[1]+d[0];t.arc(e,n,d[0],T,T+OS,!1)}return t.closePath(),t}var ES=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IS=function(t,e){return function(n,i){e(n,i,t)}};let jS=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=Hb}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).rect,{fill:h=l.fill,background:c,stroke:u=l.stroke,width:f=l.width,height:p=l.height,cornerRadius:g=l.cornerRadius,opacity:y=l.opacity,fillOpacity:v=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:A=l.y}=t.attribute,S=bx(y,v,f,p,h),_=Ax(y,b,f,p),T=yx(h,c),B=vx(u,m);if(!t.valid||!x)return;if(!T&&!B)return;if(!(S||_||o||a||c))return;0===g||d(g)&&g.every((t=>0===t))?(e.beginPath(),e.rect(n,i,f,p)):(e.beginPath(),MS(e,n,i,f,p,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const C={doFill:T,doStroke:B};this._rectRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,l,r,o,a,C)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),C.doFill&&(o?o(e,t.attribute,l):S&&(e.setCommonStyle(t,t.attribute,w-n,A-i,l),e.fill())),C.doStroke&&(a?a(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,w-n,A-i,l),e.stroke())),this._rectRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,l,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};jS=ES([np(),IS(0,sp(cp)),IS(0,ip(Lx)),kS("design:paramtypes",[Object])],jS);var DS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NS=function(t,e){return function(n,i){e(n,i,t)}};let WS=class extends fS{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Xb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).symbol,{size:c=h.size,fill:u=h.fill,background:d,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,opacity:g=h.opacity,lineWidth:y=h.lineWidth,stroke:v=h.stroke,visible:m=h.visible,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:A=h.scaleY}=t.attribute,S=mx(g,f,u),_=xx(g,p),T=yx(u,d),B=vx(v,y);if(!t.valid||!m)return;if(!T&&!B)return;if(!(S||_||o||a||d))return;const C=t.getParsedPath();if(!C)return;const{keepDirIn3d:P=h.keepDirIn3d}=t.attribute,R=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),P&&e.camera&&e.project){const r=e.project(n,i,R),s=e.camera;e.camera=null,!1===C.draw(e,c,r.x,r.y,void 0,((r,s)=>{s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,b-n,x-i),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(b-n)/w,(x-i)/A),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===C.draw(e,c,n,i,R,((r,s)=>{s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,b-n,x-i),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(b-n)/w,(x-i)/A),e.stroke()))}))&&e.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,h,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),T&&!C.isSvg&&(o?o(e,t.attribute,h):S&&(e.setCommonStyle(t,t.attribute,b-n,x-i,h),e.fill())),B&&!C.isSvg&&(a?a(e,t.attribute,h):_&&(e.setStrokeStyle(t,t.attribute,(b-n)/w,(x-i)/A,h),e.stroke())),this._symbolRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,h,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).symbol,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&$A.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}};WS=DS([np(),NS(0,sp(cp)),NS(0,ip(Nx)),LS("design:paramtypes",[Object])],WS);var US=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},FS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zS=function(t,e){return function(n,i){e(n,i,t)}};let HS=class extends fS{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Yb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).text,{text:c,fill:u=h.fill,stroke:d=h.stroke,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,opacity:g=h.opacity,lineWidth:y=h.lineWidth,visible:v=h.visible,underline:m=h.underline,lineThrough:b=h.lineThrough,keepDirIn3d:x=h.keepDirIn3d,direction:w=h.direction,fontSize:A=h.fontSize,textBaseline:S=h.textBaseline,textAlign:_=h.textAlign,x:T=h.x,y:B=h.y}=t.attribute,C=null!==(l=t.attribute.lineHeight)&&void 0!==l?l:A,P=mx(g,f,u),R=xx(g,p),O=yx(u),M=vx(d,y);if(!t.valid||!v)return;if(!(O||M||P||R))return;const k=!x,I=this.z||0;if(e.beginPath(),!this._textBeforeRenderContribitions){const t=this.textRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],t.forEach((t=>{t.time===Fp.beforeFillStroke?this._textBeforeRenderContribitions.push(t):this._textAfterRenderContribitions.push(t)}))}this._textBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,O,M,P,R,h,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),k&&this.transformUseContext2d(t,h,I,e);const j=(r,s,l,c)=>{let u=n+s;const d=i+l;if(c){e.highPerformanceSave(),u+=A;const t=KA.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),KA.free(t)}M&&(a?a(e,t.attribute,h):R&&(e.setStrokeStyle(t,t.attribute,T-n,B-i,h),e.strokeText(r,u,d,I))),O&&(o?o(e,t.attribute,h):P&&(e.setCommonStyle(t,t.attribute,T-n,B-i,h),e.fillText(r,u,d,I),this.drawUnderLine(m,b,t,u,d,I,h,e))),c&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(Array.isArray(c))if(e.setTextStyleWithoutAlignBaseline(t.attribute,h,I),"horizontal"===w){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;M&&(a?a(e,t.attribute,h):R&&(e.setStrokeStyle(t,t.attribute,T-n,B-i,h),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,I)})))),O&&(o?o(e,t.attribute,h):P&&(e.setCommonStyle(t,t.attribute,T-n,B-i,h),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,I),this.drawMultiUnderLine(m,b,t,(r.leftOffset||0)+n,(r.topOffset||0)+l+i,I,r.width,h,e)}))))}else{const n=t.cache,{verticalList:i}=n;e.textAlign="left",e.textBaseline="top";const r=C*i.length;let s=0;i.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=E(e,s)}));let o=0,a=0;"bottom"===S?a=-r:"middle"===S&&(a=-r/2),"center"===_?o-=s/2:"right"===_&&(o-=s),i.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),i=s-n;let l=o;"center"===_?l+=i/2:"right"===_&&(l+=i),t.forEach((t=>{const{text:n,width:i,direction:s}=t;j(n,r-(e+1)*C+a,l,s),l+=i}))}))}else{const n=t.cache;if("horizontal"===w){e.setTextStyle(t.attribute,h,I);const n=t.clipedText;let i=0;C!==A&&("top"===S?i=(C-A)/2:"middle"===S||"bottom"===S&&(i=-(C-A)/2)),j(n,0,i,0)}else if(n){e.setTextStyleWithoutAlignBaseline(t.attribute,h,I);const{verticalList:i}=n;let r=0;const s=i[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===S?o=-C:"middle"===S&&(o=-C/2),"center"===_?r-=s/2:"right"===_&&(r-=s),e.textAlign="left",e.textBaseline="top",i[0].forEach((t=>{const{text:e,width:n,direction:i}=t;j(e,o,r,i),r+=n}))}}k&&this.restoreTransformUseContext2d(t,h,I,e),this._textAfterRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,O,M,P,R,h,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,r,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawShape(t,r,h,c,n,i),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,n,i,r,s,o,a){if(e+t<=0)return;const{textAlign:l=o.textAlign,textBaseline:h=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:f=o.fillOpacity}=n.attribute,p=n.clipedWidth,g=Jx(l,p),y=Qx(h,c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:f};if(t){v.lineWidth=t,a.setStrokeStyle(n,v,i,r,o),a.beginPath();const e=r+y+c;a.moveTo(i+g,e,s),a.lineTo(i+g+p,e,s),a.stroke()}if(e){v.lineWidth=e,a.setStrokeStyle(n,v,i,r,o),a.beginPath();const t=r+y+c/2;a.moveTo(i+g,t,s),a.lineTo(i+g+p,t,s),a.stroke()}}drawMultiUnderLine(t,e,n,i,r,s,o,a,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:f=a.fillOpacity}=n.attribute,p=Jx(h,o),g=Qx("alphabetic",c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:f};let v=-3;if(t){y.lineWidth=t,l.setStrokeStyle(n,y,i,r,a),l.beginPath();const e=r+g+c+v;l.moveTo(i+p,e,s),l.lineTo(i+p+o,e,s),l.stroke()}if(v=-1,e){y.lineWidth=e,l.setStrokeStyle(n,y,i,r,a),l.beginPath();const t=r+g+c/2+v;l.moveTo(i+p,t,s),l.lineTo(i+p+o,t,s),l.stroke()}}};HS=US([np(),zS(0,sp(cp)),zS(0,ip(Wx)),FS("design:paramtypes",[Object])],HS);var VS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let GS=class{};function XS(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function YS(t,e){return Math.sqrt(t*t+e*e)}function qS(t,e,n,i,r){const s=e/n;return{x:t.x-i*s,y:t.y-r*s}}GS=VS([np()],GS);var KS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$S=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ZS=function(t,e){return function(n,i){e(n,i,t)}};let JS=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=Fb}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).polygon,{points:h=l.points,fill:c=l.fill,stroke:u=l.stroke,cornerRadius:f=l.cornerRadius,fillOpacity:p=l.fillOpacity,background:g,strokeOpacity:y=l.strokeOpacity,lineWidth:v=l.lineWidth,opacity:m=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y,closePath:A=l.closePath}=t.attribute,S=mx(m,p,c),_=xx(m,y),T=yx(c,g),B=vx(u,v);t.valid&&b&&(T||B)&&(S||_||o||a||g)&&(e.beginPath(),f<=0||d(f)&&f.every((t=>0===t))?XS(e.camera?e:e.nativeContext,h,n,i):function(t,e,n,i,r){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var o;if(e.length<3)return void XS(t,e,n,i);let a=0,l=e.length-1;s||(a+=1,l-=1,t.moveTo(e[0].x+n,e[0].y+i));for(let s=a;s<=l;s++){const a=e[0===s?l:(s-1)%e.length],h=e[s%e.length],c=e[(s+1)%e.length],u=h.x-a.x,d=h.y-a.y,f=h.x-c.x,p=h.y-c.y,g=(Math.atan2(d,u)-Math.atan2(p,f))/2,y=Math.abs(Math.tan(g));let v=Array.isArray(r)?null!==(o=r[s%e.length])&&void 0!==o?o:0:r,m=v/y;const b=YS(u,d),x=YS(f,p),w=Math.min(b,x);m>w&&(m=w,v=w*y);const A=qS(h,m,b,u,d),S=qS(h,m,x,f,p),_=2*h.x-A.x-S.x,T=2*h.y-A.y-S.y,B=YS(_,T),C=qS(h,YS(m,v),B,_,T);let P=Math.atan2(A.y-C.y,A.x-C.x);const R=Math.atan2(S.y-C.y,S.x-C.x);let O=R-P;O<0&&(P=R,O=-O),O>Math.PI&&(O-=Math.PI),0===s?t.moveTo(A.x+n,A.y+i):t.lineTo(A.x+n,A.y+i),O&&t.arcTo(h.x+n,h.y+i,S.x+n,S.y+i,v),t.lineTo(S.x+n,S.y+i)}s||t.lineTo(e[l+1].x+n,e[l+1].y+i)}(e.camera?e:e.nativeContext,h,n,i,f,A),A&&e.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,l,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),T&&(o?o(e,t.attribute,l):p&&(e.setCommonStyle(t,t.attribute,x-n,w-i,l),e.fill())),B&&(a?a(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,x-n,w-i,l),e.stroke())),this._polygonRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,l,r,o,a)})))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=ev(t,null==i?void 0:i.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);Sx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};JS=KS([np(),ZS(0,sp(cp)),ZS(0,ip(Dx)),$S("design:paramtypes",[Object])],JS);var QS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},t_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},e_=function(t,e){return function(n,i){e(n,i,t)}};const n_=["","repeat-x","repeat-y","repeat"];let i_=class{constructor(t){this.imageRenderContribitions=t,this.numberType=Nb}drawShape(t,e,n,i,r,s,o){const a=ev(t).image,{fill:l=a.fill,width:h=a.width,height:c=a.height,opacity:u=a.opacity,fillOpacity:f=a.fillOpacity,visible:p=a.visible,repeatX:g=a.repeatX,repeatY:y=a.repeatY,cornerRadius:v=a.cornerRadius,image:m}=t.attribute,b=mx(u,f,l),x=yx(l);if(t.valid&&p&&x&&(b||o)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,x,!1,b,!1,a,r,o)})),e.setShadowStyle&&e.setShadowStyle(t,a),x)if(o)o(e,t.attribute,a);else if(b){if(!m||!t.resources)return;const r=t.resources.get(m);if("success"!==r.state)return;let s=!1;0===v||d(v)&&v.every((t=>0===t))||(e.beginPath(),MS(e,n,i,h,c,v),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,n,i,a);let o=0;if("repeat"===g&&(o|=1),"repeat"===y&&(o|=2),o){const t=e.createPattern(r.data,n_[o]);e.fillStyle=t,e.fillRect(n,i,h,c)}else e.drawImage(r.data,n,i,h,c);s&&e.restore()}this._imageRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,x,!1,b,!1,a,r,o)}))}}draw(t,e,n){const{context:i}=e.drawParams;if(!i)return;const r=ev(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(a&&t.resources&&"success"===t.resources.get(a).state){if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,o,n),i.highPerformanceRestore()}}};i_=QS([np(),e_(0,sp(cp)),e_(0,ip(Ix)),t_("design:paramtypes",[Object])],i_);const r_=Symbol.for("IncrementalDrawContribution"),s_=Symbol.for("ArcRender"),o_=Symbol.for("Arc3dRender"),a_=Symbol.for("AreaRender"),l_=Symbol.for("CircleRender"),h_=Symbol.for("GraphicRender"),c_=Symbol.for("GroupRender"),u_=Symbol.for("LineRender"),d_=Symbol.for("PathRender"),f_=Symbol.for("PolygonRender"),p_=Symbol.for("RectRender"),g_=Symbol.for("Rect3DRender"),y_=Symbol.for("SymbolRender"),v_=Symbol.for("TextRender"),m_=Symbol.for("RichTextRender"),b_=Symbol.for("Pyramid3dRender"),x_=Symbol.for("GlyphRender"),w_=Symbol.for("ImageRender"),A_=Symbol.for("RenderSelector"),S_=Symbol.for("DrawContribution");function __(t,e,n){let i=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(a)*Math.sqrt(o*o+a*a);return l+h===0?0:(i=i/Math.abs(l+h)*2*n,i)}function T_(t,e,n,i,r){if(!e||!0===e)return"black";let s,o;if(d(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,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l;const h=n.AABBBounds;if(!h)return;let c=h.x2-h.x1,u=h.y2-h.y1,d=h.x1-i,f=h.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,f/=e}const p=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,f+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,f+(null!==(l=e.y1)&&void 0!==l?l:0)*u);return e.stops.forEach((t=>{p.addColorStop(t.offset,t.color)})),p}(t,o,n,i,r):"conical"===o.gradient?s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o;const a=n.AABBBounds;if(!a)return;let l=a.x2-a.x1,h=a.y2-a.y1,c=a.x1-i,u=a.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;l/=t,h/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*l,u+(null!==(o=e.y)&&void 0!==o?o:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(l+c,h+u,void 0)}(t,o,n,i,r):"radial"===o.gradient&&(s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l,h,c;const u=n.AABBBounds;if(!u)return;let d=u.x2-u.x1,f=u.y2-u.y1,p=u.x1-i,g=u.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;p/=t,g/=e,d/=t,f/=e}const y=t.createRadialGradient(p+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*f,Math.max(d,f)*(null!==(a=e.r0)&&void 0!==a?a:0),p+(null!==(l=e.x1)&&void 0!==l?l:.5)*d,g+(null!==(h=e.y1)&&void 0!==h?h:.5)*f,Math.max(d,f)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{y.addColorStop(t.offset,t.color)})),y}(t,o,n,i,r)),s||"orange")}const B_=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return uy(Object.assign({nativeCanvas:Yg.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 uy(Object.assign({nativeCanvas:Yg.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(){this.pools=[]}};var C_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},P_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},R_=function(t,e){return function(n,i){e(n,i,t)}};let O_=class{constructor(){this.time=Fp.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){const{background:f}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=ev(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),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,n,i,l),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}};O_=C_([np()],O_);let M_=class{constructor(t){this.subRenderContribitions=t,this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,o,a,l,h,c,u,d)}))}};M_=C_([np(),R_(0,sp(cp)),R_(0,ip(Ux)),P_("design:paramtypes",[Object])],M_);let E_=class{constructor(){this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,o=B_.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 l=i.createPattern(o.nativeCanvas,"repeat");return B_.free(o),l}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,P),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:y=l.texturePadding}=t.attribute;if(!f)return;let v=this.textureMap.get(f);if(!v)switch(f){case"circle":v=this.createCirclePattern(g,y,p,e);break;case"diamond":v=this.createDiamondPattern(g,y,p,e);break;case"rect":v=this.createRectPattern(g,y,p,e);break;case"vertical-line":v=this.createVerticalLinePattern(g,y,p,e);break;case"horizontal-line":v=this.createHorizontalLinePattern(g,y,p,e);break;case"bias-lr":v=this.createBiasLRLinePattern(g,y,p,e);break;case"bias-rl":v=this.createBiasRLLinePattern(g,y,p,e);break;case"grid":v=this.createGridPattern(g,y,p,e)}v&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=v,e.fill(),e.highPerformanceRestore())}};E_=C_([np()],E_);var k_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let I_=class{constructor(){this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{innerRadius:y=l.innerRadius,outerRadius:v=l.outerRadius,startAngle:m=l.startAngle,endAngle:b=l.endAngle,opacity:x=l.opacity,x:w=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:_=l.scaleY}=t.attribute,T=!(!d||!d.stroke),B=!(!f||!f.stroke);if(p){const{distance:r=l.outerBorder.distance}=d,s=__(e,r,e.dpr),o=r/v;if(t.setAttributes({outerRadius:v+s,innerRadius:y-s,startAngle:m-o,endAngle:b+o}),e.beginPath(),Bx(t,e,n,i,v+s,y-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(T){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-n)/S,(A-i)/_,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=f,s=__(e,r,e.dpr),o=r/v;if(t.setAttributes({outerRadius:v-s,innerRadius:y+s,startAngle:m+o,endAngle:b-o}),e.beginPath(),Bx(t,e,n,i,v-s,y+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(B){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,f,(w-n)/S,(A-i)/_,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:v,innerRadius:y,startAngle:m,endAngle:b})}};I_=k_([np()],I_);let j_=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}};j_=k_([np()],j_);let D_=class extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}};D_=k_([np()],D_);var L_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let N_=class{constructor(){this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{radius:y=l.radius,startAngle:v=l.startAngle,endAngle:m=l.endAngle,opacity:b=l.opacity,x:x=l.x,y:w=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY}=t.attribute,_=!(!d||!d.stroke),T=!(!f||!f.stroke);if(p){const{distance:r=l.outerBorder.distance}=d,s=__(e,r,e.dpr);if(e.beginPath(),e.arc(n,i,y+s,v,m),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(_){const r=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-n)/A,(w-i)/S,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=f,s=__(e,r,e.dpr);if(e.beginPath(),e.arc(n,i,y-s,v,m),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,f,(x-n)/A,(w-i)/S,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};N_=L_([np()],N_);let W_=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}};W_=L_([np()],W_);let U_=class extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}};U_=L_([np()],U_);var F_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let z_=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const n=t.resources.get(d);if("success"!==n.state||!n.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const i=t.AABBBounds;e.drawImage(n.data,i.x1,i.y1,i.width(),i.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}};z_=F_([np()],z_);var H_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let V_=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,u,d){const{background:f,width:p,height:y}=t.attribute;if(f)if(t.backgroundImg){const n=t.resources.get(f);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=ev(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}const i=t.AABBBounds;e.drawImage(n.data,i.x1,i.y1,i.width(),i.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(c(f)){const{stroke:n,fill:i,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=f;if(!n&&!i)return;e.beginPath();const{x:l,y:h,width:c,height:u}=function(t){const e=Bv(t.attribute.boundsPadding),n=t.AABBBounds;let i=n.x1,r=n.y1,s=n.width(),o=n.height();return g(e)?(i+=e,r+=e,s-=2*e,o-=2*e):(i+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]),{x:i,y:r,width:s,height:o}}(t);s?MS(e,l-o,h-a,c+2*o,u+2*a,s):e.rect(l-o,h-a,c+2*o,u+2*a),e.globalAlpha=1,i&&(e.fillStyle=i,e.fill()),n&&r>0&&(e.lineWidth=r,e.strokeStyle=n,e.stroke())}else{e.beginPath();const r=t.AABBBounds;e.rect(n,i,r.width(),r.height()),e.fillStyle=f,e.globalAlpha=1,e.fill()}}};V_=H_([np()],V_);var G_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let X_=class{constructor(){this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,y=p&&!1!==p.visible;if(!g&&!y)return;const{width:v=l.width,height:m=l.height,cornerRadius:b=l.cornerRadius,opacity:x=l.opacity,x:w=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:_=l.scaleY}=t.attribute,T=!(!f||!f.stroke),B=!(!p||!p.stroke);if(g){const{distance:r=l.outerBorder.distance}=f,s=__(e,r,e.dpr),o=n-s,a=i-s,h=2*s;if(0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v+h,m+h)):(e.beginPath(),MS(e,o,a,v+h,m+h,b)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.outerBorder);else if(T){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,f,(w-n)/S,(A-i)/_,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=l.innerBorder.distance}=p,s=__(e,r,e.dpr),o=n+s,a=i+s,h=2*s;if(0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v-h,m-h)):(e.beginPath(),MS(e,o,a,v-h,m-h,b)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(B){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-n)/S,(A-i)/_,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};X_=G_([np()],X_);let Y_=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}};Y_=G_([np()],Y_);let q_=class extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}};q_=G_([np()],q_);let K_=class{constructor(){this.time=Fp.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};K_=G_([np()],K_);let $_=class{constructor(){this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{width:d=l.width,height:f=l.height,stroke:p=l.stroke}=t.attribute;if(Array.isArray(p)&&p.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),p[0]?e.lineTo(n+d,i):e.moveTo(n+d,i),p[1]?e.lineTo(n+d,i+f):e.moveTo(n+d,i+f),p[2]?e.lineTo(n,i+f):e.moveTo(n,i+f),p[3]){const t=p[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};$_=G_([np()],$_);var Z_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let J_=class{constructor(){this.time=Fp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,y=p&&!1!==p.visible;if(!g&&!y)return;const{size:v=l.size,opacity:m=l.opacity,x:b=l.x,y:x=l.y,scaleX:w=l.scaleX,scaleY:A=l.scaleY}=t.attribute,S=!(!f||!f.stroke),_=!(!p||!p.stroke);if(g){const{distance:r=l.outerBorder.distance}=f,s=__(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,v,n,i,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.outerBorder);else if(S){const r=l.outerBorder.opacity;l.outerBorder.opacity=m,e.setStrokeStyle(t,f,(b-n)/w,(x-i)/A,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=l.innerBorder.distance}=p,s=__(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,v,n,i,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(_){const r=l.innerBorder.opacity;l.innerBorder.opacity=m,e.setStrokeStyle(t,p,(b-n)/w,(x-i)/A,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};J_=Z_([np()],J_);class Q_ extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}}class tT extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}}var eT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},nT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iT=function(t,e){return function(n,i){e(n,i,t)}};const rT=Symbol.for("RenderService");let sT=class{constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}};sT=eT([np(),iT(0,sp(S_)),nT("design:paramtypes",[Object])],sT);var oT=new Zf((t=>{t(sT).toSelf(),t(rT).toService(sT)})),aT=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};function lT(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s={},o=[];let a=!1;if(r)a=!0;else{let n;t.forEachChildren(((t,i)=>{const{zIndex:r=e}=t.attribute;if(0===i)n=r;else if(n!==r)return a=!0,!0;return!1}),i)}if(a){t.forEachChildren((t=>{const{zIndex:n=e}=t.attribute;s[n]?s[n].push(t):(s[n]=[t],o.push(n))}),i),o.sort(((t,e)=>i?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],l=s[e];r&&l.sort(((t,e)=>{var n,r;return(i?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<l.length;t++)if(n(l[t],t)){a=!0;break}}}else t.forEachChildren(n,i)}function hT(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return aT(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(n,i)}))}function cT(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:i=n}=t.attribute;if(0===e);else if(void 0!==i)return o=!0,!0;return!1}),i);let a=null,l=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=n}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),i),s.sort(((t,e)=>i?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const n=s[t],i=r[n];for(let t=0;t<i.length;t++){if(l){o=!0,a=i[t];break}i[t]._uid!==e||(l=!0)}}}else t.forEachChildren((t=>l?(a=t,!0):(t._uid===e&&(l=!0),!1)),i);return a}var uT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const dT=Symbol.for("PickItemInterceptor");let fT=class{constructor(){this.order=1}afterPickItem(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this._pickItem(t,e,n,i,r)}beforePickItem(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this._pickItem(t,e,n,i,r)}_pickItem(t,e,n,i,r){if(!t.shadowRoot)return!1;const{parentMatrix:s}=r||{};if(!s)return!1;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,l=KA.allocateByObj(s),h=new U(n.x,n.y);s.transformPoint(h,h);const c=t.transMatrix;l.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,h.clone(),l,i);return o.highPerformanceRestore(),u}};fT=uT([np()],fT);let pT=class{constructor(){this.order=1}beforePickItem(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(i.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,l=!1;if(t.forEachChildren((t=>(a=t.numberType===kb,!a))),t.forEachChildren((t=>(l=!!t.findFace,!l))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var n,i,r,s;let o=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i: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+=P;for(;a<0;)a+=P;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",o=e.pickGroup(t,n,r.parentMatrix,i),o.graphic||(i.hack_pieFace="inside",o=e.pickGroup(t,n,r.parentMatrix,i)),o.graphic||(i.hack_pieFace="top",o=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(l){const a=t.getChildren(),l=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var n;return s.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));l.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),l.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),l.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,n,r.parentMatrix,i);return s.camera=null,i.in3dInterceptor=!1,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};pT=uT([np()],pT);var gT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vT=function(t,e){return function(n,i){e(n,i,t)}};const mT=Symbol.for("PickerService");let bT=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,n){let i={graphic:null,group:null};n.pickerService=this;let r=0,s=0;if(n&&n.bounds){if(!n.bounds.contains(e.x,e.y))return i;r=n.bounds.x1,s=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new Y(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(t[r].isContainer?i=this.pickGroup(t[r],e,o,n):i.graphic=this.pickItem(t[r],e,o,n),!i.graphic);r--)a||(a=i.group);if(i.graphic||(i.group=a),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){let t=i.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=t.shadowHost)}return i}containsPoint(t,e,n){return!!this.pickItem(t,e,null,n)}pickGroup(t,e,n,i){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=i.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,n=$A.allocate();if(eS(n,e),o){if(n){const t=$A.allocate();s.modelMatrix=nS(t,o,n),$A.free(n)}}else eS(n,t.globalTransMatrix),s.modelMatrix=n}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,i,{parentMatrix:n});if(r)return s.modelMatrix!==o&&$A.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,l=KA.allocateByObj(n),h=new U(e.x,e.y);l.transformPoint(h,h);const c=t.AABBBounds.containsPoint(h);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,h.clone(),n,i);u&&(r.graphic=u);const d=!1!==t.attribute.pickable&&c;return l.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u||lT(t,Mg.zIndex,(s=>{if(s.isContainer){const n=new U(e.x,e.y),o=ev(t).group,{scrollX:a=o.scrollX,scrollY:h=o.scrollY}=t.attribute;n.x-=a,n.y-=h,r=this.pickGroup(s,n,l,i)}else{const o=new U(e.x,e.y);l.transformPoint(o,o);const a=ev(t).group,{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=h,o.y-=c;const u=this.pickItem(s,o,n,i);r.graphic=u}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&$A.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),KA.free(l),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};bT=gT([np(),vT(0,sp(yp)),vT(1,sp(cp)),vT(1,ip(dT)),yT("design:paramtypes",[Object,Object])],bT);var xT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},AT=function(t,e){return function(n,i){e(n,i,t)}};const ST=Symbol.for("GlobalPickerService");let _T=class{constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,n)=>{this.configure(n,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,n){let i={graphic:null,group:null};const r=new Y(1,0,0,1,0,0);let s;for(let o=0;o<t.length&&(t[o].isContainer?i=this.pickGroup(t[o],e,r,n):i.graphic=this.pickItem(t[o],e,r,n),!i.graphic);o++)s||(s=i.group);if(i.graphic||(i.group=s),i.graphic){let t=i.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=t.shadowHost)}return i}containsPoint(t,e,n){return!!this.pickItem(t,e,null,n)}pickGroup(t,e,n,i){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new U(e.x,e.y);n.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const l=!1!==t.attribute.pickable&&a;return n.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,n,i);else{const s=new U(e.x,e.y);n.transformPoint(s,s),r.graphic=this.pickItem(t,s,n,i)}return!!r.graphic||!!r.group})),r.graphic||r.group||!l||(r.group=t),r}pickItem(t,e,n,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}};function TT(t,e,n){const i=e[0],r=e[1],s=e[2];let o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*s+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*s+n[14])/o,t}_T=xT([np(),AT(0,sp(yp)),wT("design:paramtypes",[Object])],_T);var BT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const PT=[0,0,0],RT=new Y(1,0,0,1,0,0);let OT=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({},Tg),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Cg),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Pg),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new Y(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Y(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 Y(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return KA.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&&(KA.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(KA.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*n,a*i,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}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,n,i,r,s,o){if(o=o||0,this.camera){const a=[];((t,e,n,i,r,s,o,a)=>{if(a)for(;n>e;)n-=P;else for(;n<e;)n+=P;const l=T/3*(n>e?1:-1);let h=e,c=h;for(;c!==n;){c=l>0?Math.min(c+l,n):Math.max(c+l,n);const e=Math.abs(c-h),a=4*Math.tan(e/4)/3,u=c<h?-1:1,d=Math.cos(h),f=Math.sin(h),p=Math.cos(c),g=Math.sin(c),y=d*s+i,v=f*o+r,m=p*s+i,b=g*o+r,x=s*a*u,w=o*a*u;t.push([y-x*f,v+w*d,m+x*g,b-w*p,m,b]),h=c}})(a,i,r,t,e,n,n,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,n,i,r,s)}arcTo(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s,o){if(o=o||0,this.camera){let a=o,l=o;this.modelMatrix&&(TT(PT,[t,e,o],this.modelMatrix),t=PT[0],e=PT[1],a=PT[2],TT(PT,[n,i,o],this.modelMatrix),n=PT[0],i=PT[1],l=PT[2],TT(PT,[r,s,o],this.modelMatrix),r=PT[0],s=PT[1],o=PT[2]);let h=this.camera.vp(r,s,o);r=h.x,s=h.y,h=this.camera.vp(t,e,a),t=h.x,e=h.y,h=this.camera.vp(n,i,l),n=h.x,i=h.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,n,i,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,n,i,r,s,o):this.nativeContext.ellipse(t,e,n,i,r,s,o,a)}lineTo(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(TT(PT,[t,e,n],this.modelMatrix),t=PT[0],e=PT[1],n=PT[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(TT(PT,[t,e,n],this.modelMatrix),t=PT[0],e=PT[1],n=PT[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,n,i,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(TT(PT,[t,e,r],this.modelMatrix),t=PT[0],e=PT[1],s=PT[2],TT(PT,[n,i,r],this.modelMatrix),n=PT[0],i=PT[1],r=PT[2]);let o=this.camera.vp(n,i,r);n=o.x,i=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}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,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,n,i,r,s){return this.nativeContext.createRadialGradient(t,e,n,i,r,s)}createConicGradient(t,e,n,i){let r,s=!1;const o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,l,h){return s&&(h||(h=i-n),r=function(t,e,n,i,r,s,o,a,l){const h=Math.floor(180*r/Math.PI),c=Cx.GetCanvas(),u=Cx.GetCtx();if(!u)return null;const d=Rx.GetSize(a),f=Rx.GetSize(l);let p=Rx.Get(e,n,i,s,o,d,f);if(p)return p;const g=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),y=h+1,v=r/Math.max(1,y-1),m=Px.GetOrCreate(e,y),b=2*Math.PI*g/360;c.width=d,c.height=f,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,f),u.translate(n,i),u.rotate(s);for(let t=0,e=y-1;t<e&&!(s+t*v>o);t++){const e=m.getColor(t);u.beginPath(),u.rotate(v),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,f);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),p=t.createPattern(c,"no-repeat"),p&&Rx.Set(e,n,i,s,o,p,d,f),p}(o,this.stops,t,e,h,n,i,a,l),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}clearRect(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}project(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(TT(PT,[t,e,n],this.modelMatrix),t=PT[0],e=PT[1],n=PT[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}view(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(TT(PT,[t,e,n],this.modelMatrix),t=PT[0],e=PT[1],n=PT[2]),this.camera.view(t,e,n)):[t,e,n]}fillText(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(TT(PT,[e,n,i],this.modelMatrix),e=PT[0],n=PT[1],i=PT[2]);const t=this.camera.vp(e,n,i);e=t.x,n=t.y}this.nativeContext.fillText(t,e,n)}getImageData(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yg.global.measureTextMethod;var n,i;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=Yg.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(n=this.fontFamily)&&void 0!==n?n:Pg.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(i=this.fontSize)&&void 0!==i?i:Pg.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,n){this.nativeContext.putImageData(t,e,n)}setLineDash(t){const e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}strokeText(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(TT(PT,[e,n,i],this.modelMatrix),e=PT[0],n=PT[1],i=PT[2]);const t=this.camera.vp(e,n,i);e=t.x,n=t.y}this.nativeContext.strokeText(t,e,n)}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,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setCommonStyle(t,e,n,i,s)}return this._setCommonStyle(t,e,n,i,r)}_setCommonStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12?(s.globalAlpha=o*a,s.fillStyle=T_(this,l,t,n,i)):s.globalAlpha=o*a}setShadowStyle(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowStyle(t,n[0]);const i={};return n.forEach((t=>{Object.assign(i,t)})),this._setShadowStyle(t,e,i)}return this._setShadowStyle(t,e,n)}_setShadowStyle(t,e,n){const i=this.nativeContext;n||(n=this.fillAttributes);const{opacity:r=n.opacity,shadowBlur:s=n.shadowBlur,shadowColor:o=n.shadowColor,shadowOffsetX:a=n.shadowOffsetX,shadowOffsetY:l=n.shadowOffsetY,blur:h=n.blur}=e;r<=1e-12||(s||a||l?(i.shadowBlur=s,i.shadowColor=o,i.shadowOffsetX=a,i.shadowOffsetY=l,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),h?(i.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1))}setStrokeStyle(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setStrokeStyle(t,e,n,i,s)}return this._setStrokeStyle(t,e,n,i,r)}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=__(this,l,this.dpr),s.strokeStyle=T_(this,h,t,n,i),s.lineJoin=c,s.setLineDash(u),s.lineCap=d,s.miterLimit=f}}setTextStyleWithoutAlignBaseline(t,e,n){const i=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?i.font=t.font:i.font=Zx(t,e,r&&this.camera&&this.camera.getProjectionScale(n));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,i.textAlign="left",i.textBaseline="alphabetic"}setTextStyle(t,e,n){var i,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=Zx(t,e,this.camera&&this.camera.getProjectionScale(n));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(RT,t,e)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>KA.free(t))),this.stack.length=0}};OT.env="browser",OT=BT([np(),CT("design:paramtypes",[Object,Number])],OT);var MT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ET=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const kT={WIDTH:500,HEIGHT:500,DPR:1};let IT=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){const{nativeCanvas:e,width:n=kT.WIDTH,height:i=kT.HEIGHT,dpr:r=kT.DPR,container:s,x:o,y:a,canvasControled:l=!0}=t;if(this._x=null!=o?o:0,this._y=null!=a?a:0,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this.controled=l,"string"==typeof s){const t=Yg.global.getElementById(s);t&&(this._container=t)}else this._container=s;this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new OT(this,this._dpr),this._id=e.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:n=this._displayHeight,dpr:i=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:o}=this;o.width=e*i,o.height=n*i,!o.style||this.setCanvasStyle(o,r,s,e,n),t.id&&(o.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,n,i,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${i}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){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}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,n,i){return this._context.getImageData(t,e,n,i)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}};IT.env="browser",IT=MT([np(),ET("design:paramtypes",[Object])],IT);const jT=Symbol.for("CanvasArcPicker"),DT=Symbol.for("CanvasArc3dPicker"),LT=Symbol.for("CanvasAreaPicker"),NT=Symbol.for("CanvasCirclePicker"),WT=Symbol.for("CanvasImagePicker"),UT=Symbol.for("CanvasLinePicker"),FT=Symbol.for("CanvasPathPicker"),zT=Symbol.for("CanvasRectPicker"),HT=Symbol.for("CanvasRect3dPicker"),VT=Symbol.for("CanvasSymbolPicker"),GT=Symbol.for("CanvasTextPicker"),XT=Symbol.for("CanvasPolygonPicker"),YT=Symbol.for("CanvasPyramid3dPicker"),qT=Symbol.for("CanvasRichTextPicker"),KT=Symbol.for("CanvasGlyphPicker"),$T=Symbol.for("CanvasGroupPicker"),ZT=Symbol.for("CanvasPickerContribution"),JT=Symbol.for("MathArcPicker"),QT=Symbol.for("MathAreaPicker"),tB=Symbol.for("MathCirclePicker"),eB=Symbol.for("MathLinePicker"),nB=Symbol.for("MathPathPicker"),iB=Symbol.for("MathRectPicker"),rB=Symbol.for("MathSymbolPicker"),sB=Symbol.for("MathTextPicker"),oB=Symbol.for("MathPolygonPicker"),aB=Symbol.for("MathGlyphPicker"),lB=Symbol.for("MathPickerContribution");var hB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uB=function(t,e){return function(n,i){e(n,i,t)}};let dB=class extends bT{constructor(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p){super(f,p),this.contributions=t,this.circlePicker=e,this.rectPicker=n,this.arcPicker=i,this.areaPicker=r,this.imagePicker=s,this.linePicker=o,this.pathPicker=a,this.symbolPicker=l,this.textPicker=h,this.polygonPicker=c,this.richtextPicker=u,this.drawContribution=d,this.global=f,this.pickItemInterceptorContributions=p,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,n)=>{this.configure(n,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(t,e){const n={width:100,height:100,nativeCanvas:t.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new IT(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,n,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,i,{parentMatrix:n});if(r)return!0===r?t:r.graphic}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,i)?t:null;if(s)return s;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,i,{parentMatrix:n});if(r)return!0===r?t:r.graphic}}return s}};hB([hp(),cB("design:type",Function),cB("design:paramtypes",[]),cB("design:returntype",void 0)],dB.prototype,"init",null),dB=hB([np(),uB(0,sp(cp)),uB(0,ip(ZT)),uB(1,sp(NT)),uB(2,sp(zT)),uB(3,sp(jT)),uB(4,sp(LT)),uB(5,sp(WT)),uB(6,sp(UT)),uB(7,sp(FT)),uB(8,sp(VT)),uB(9,sp(GT)),uB(10,sp(XT)),uB(11,sp(qT)),uB(12,sp(S_)),uB(13,sp(yp)),uB(14,sp(cp)),uB(14,ip(dT)),cB("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],dB);var fB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const gB=new Y(1,0,0,1,0,0),yB={x:0,y:0};let vB=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Y(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Y(1,0,0,1,0,0),this.path=new wg}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return KA.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(KA.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(KA.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*n,a*i,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,n,i,r,s){this.path.arc(t,e,n,i,r,s)}arcTo(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s){this.path.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.path.closePath()}ellipse(t,e,n,i,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i){this.path.rect(t,e,n,i)}createImageData(t,e){return null}createLinearGradient(t,e,n,i){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,n,i,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,n,i){return null}fill(t,e){}fillRect(t,e,n,i){this.path.rect(t,e,n,i)}clearRect(t,e,n,i){}fillText(t,e,n){}getImageData(t,e,n,i){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},yB),function(t,e,n){return Uy(t,0,!1,e,n)}(this.path.commandList,yB.x,yB.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},yB);const n=__(this,this.lineWidth,this.dpr);return function(t,e,n,i){return Uy(t,e,!0,n,i)}(this.path.commandList,n,yB.x,yB.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,n){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,n,i){this.path.rect(t,e,n,i)}strokeText(t,e,n){}drawImage(){}setCommonStyle(t,e,n,i,r){}_setCommonStyle(t,e,n,i){}setStrokeStyle(t,e,n,i,r){}_setStrokeStyle(t,e,n,i){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(gB,t,e)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>KA.free(t))),this.stack.length=0}};vB=fB([np(),pB("design:paramtypes",[Object,Number])],vB);var mB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xB=function(t,e){return function(n,i){e(n,i,t)}};let wB=class extends bT{constructor(t,e,n){super(e,n),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=n,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,n)=>{this.configure(n,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(t,e){this.pickContext=new vB(null,1)}pickItem(t,e,n,i){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);return r&&r.contains(t,e,i)?t:null}};mB([hp(),bB("design:type",Function),bB("design:paramtypes",[]),bB("design:returntype",void 0)],wB.prototype,"init",null),wB=mB([np(),xB(0,sp(cp)),xB(0,ip(lB)),xB(1,sp(yp)),xB(2,sp(cp)),xB(2,ip(dT)),bB("design:paramtypes",[Object,Object,Object])],wB);var AB=new Zf((t=>{t(dB).toSelf().inSingletonScope(),t(wB).toSelf().inSingletonScope(),t(mT).toService(dB),t(_T).toSelf().inSingletonScope(),t(ST).toService(_T),t(pT).toSelf().inSingletonScope(),t(dT).toService(pT),t(fT).toSelf().inSingletonScope(),t(dT).toService(fT),dp(t,dT)})),SB=new Zf((t=>{t(rS).toSelf().inSingletonScope(),t(qb).toService(rS),t(jA).toSelf().inSingletonScope(),t(IA).toService(jA),dp(t,IA),t(NA).toSelf().inSingletonScope(),t(LA).toService(NA),dp(t,LA),t(FA).toSelf().inSingletonScope(),t(UA).toService(FA),dp(t,UA),t(VA).toSelf().inSingletonScope(),t(HA).toService(VA),dp(t,HA),t(YA).toSelf().inSingletonScope(),t(XA).toService(YA),dp(t,XA),t(Kb).toConstantValue(hS)}));const _B=Symbol.for("AutoEnablePlugins"),TB=Symbol.for("PluginService");var BB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PB=function(t,e){return function(n,i){e(n,i,t)}};let RB=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:n}=e;n&&ly.isBound(_B)&&this.autoEnablePlugins.getContributions().forEach((t=>{n.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((n=>{n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((n=>{n.name===t&&e.push(n)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};RB=BB([np(),PB(0,sp(cp)),PB(0,ip(_B)),CB("design:paramtypes",[Object])],RB);var OB=new Zf((t=>{t(RB).toSelf(),t(TB).toService(RB),function(t,e){t(cp).toDynamicValue((t=>{let{container:n}=t;return new up(e,n)})).whenTargetNamed(e)}(t,_B)})),MB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let EB=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new V}removeDom(t){return!1}createDom(t){return null}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};EB=MB([np()],EB);var kB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},IB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class jB{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function DB(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(n.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let LB=class extends EB{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 n;if(e){const{clientX:i,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let a,l;return o&&(a=s.width/o.offsetWidth,l=s.height/o.offsetHeight),{x:(i-s.left)/(y(a)?a:1),y:(r-s.top)/(y(l)?a:1)}}return{x:t.offsetX,y:t.offsetY}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/xml").firstChild),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new jB(t)}return new V}removeDom(t){return t.parentElement.removeChild(t),!0}createDom(t){const{tagName:e="div",width:n,height:i,style:r,parent:s}=t,o=document.createElement(e);if(r&&(u(r)?o.setAttribute("style",r):Object.keys(r).forEach((t=>{o.setAttribute(t,r[t])}))),null!=n&&(o.style.width=`${n}px`),null!=i&&(o.style.height=`${i}px`),s){const t=u(s)?this.getElementById(s):s;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return DB(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return DB(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:nv.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}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,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}};function NB(){ly.rebind(mT).toService(wB)}LB=kB([np(),IB("design:paramtypes",[])],LB);var WB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},UB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let FB=class extends EB{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,n,i,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 l={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})};n.set(e,l),o>=i&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),NB())}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 Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};FB=WB([np(),UB("design:paramtypes",[])],FB);var zB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},HB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let VB=class extends EB{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 n,i,r,s,o,a,l;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,l=e.pixelRatio,i.forEach(((t,e)=>{const i=a.createCanvasContext(t);i.canvas={width:n.width*l,height:n.height*l},i.createRadialGradient||(i.createRadialGradient=function(){return i.createCircularGradient(...arguments)}),!i.getImageData&&a.canvasGetImageData&&(i.getImageData=(e,n,i,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:n,width:i,height:r,success(t){s(t)}})}catch(t){o(t)}})));const h={id:t,width:n.width*l,height:n.height*l,offsetWidth:n.width,offsetHeight:n.height,getContext:()=>i,getBoundingClientRect:()=>({height:n.height,width:n.width})};return r.set(t,h),e>=s&&o.push(h),h})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,ly.rebind(mT).toService(wB))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const n=new e.Blob([t],{type:"image/svg+xml"}),i=e.URL.createObjectURL(n);return Promise.resolve({data:i,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,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};VB=zB([np(),HB("design:paramtypes",[])],VB);var GB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},XB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let YB=!1;try{YB=!!lynx.createCanvasNG}catch(t){}let qB=class extends EB{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,n,i,r){const s=SystemInfo.pixelRatio;e.forEach(((e,o)=>{const a=YB?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,YB&&a.attachToCanvasView(e);const l=a.getContext("2d");l.draw=(t,e)=>{e()};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>l,getBoundingClientRect:()=>({height:t.height,width:t.width})};n.set(e,h),o>=i&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),NB())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,n)=>{e.onload=()=>{t(e)},e.onerror=()=>{n(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};qB=GB([np(),XB("design:paramtypes",[])],qB);var KB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let $B=class extends EB{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){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const n=new e(t).render().asPng();return this.loadImage(n)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){}removeEventListener(t,e,n){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};$B=KB([np()],$B);var ZB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},JB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},QB=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};let tC=class extends EB{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,n,i,r,s){return QB(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=wx.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const l=s[0].node,h=s[0].width,c=s[0].height;l.width=h*t,l.height=c*t,n.set(a,l),o>=i&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{NB()}))}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 Iv.call(t)}}getCancelAnimationFrame(){return t=>{Iv.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};tC=ZB([np(),JB("design:paramtypes",[])],tC);var eC=new Zf((t=>{t(LB).toSelf().inSingletonScope(),t(gp).toService(LB),t(FB).toSelf().inSingletonScope(),t(gp).toService(FB),t(VB).toSelf().inSingletonScope(),t(gp).toService(VB),t(qB).toSelf().inSingletonScope(),t(gp).toService(qB),t(tC).toSelf().inSingletonScope(),t(gp).toService(tC),t($B).toSelf().inSingletonScope(),t(gp).toService($B),dp(t,gp)})),nC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},iC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let rC=class{constructor(){this._uid=nv.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}};rC=nC([np(),iC("design:paramtypes",[])],rC);var sC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aC=function(t,e){return function(n,i){e(n,i,t)}};let lC=class extends rC{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser",this._canvasIsIntersecting=!0}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),this.postInit()}postInit(){try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>n||e.top>i)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let n;if(n="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");t.offscreen?n=null:n.appendChild(e);const i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:n,id:nv.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new IT(i)}createWindowByCanvas(t){var e;let n;if("string"==typeof t.canvas){if(n=this.global.getElementById(t.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){const t=n.getBoundingClientRect();i=t.width,r=t.height}let s=t.dpr;!1===t.canvasControled&&(s&&console.warn("canvasControled为false后,dpr参数将无效"),s=null),null==s&&(s=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new IT({width:i,height:r,dpr:s,nativeCanvas:n,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}removeEventListener(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};lC.env="browser",lC=sC([np(),aC(0,sp(yp)),oC("design:paramtypes",[Object])],lC);var hC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let cC=class extends OT{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,n,i){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:n,height:i,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}};cC.env="feishu",cC=hC([np()],cC);var uC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},dC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const fC={WIDTH:500,HEIGHT:500,DPR:1};let pC=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:n=fC.WIDTH,height:i=fC.HEIGHT,dpr:r=fC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new cC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};pC.env="feishu",pC=uC([np(),dC("design:paramtypes",[Object])],pC);var gC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vC=function(t,e){return function(n,i){e(n,i,t)}};let mC=class extends rC{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new pC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new pC({width:n,height:i,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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};mC.env="feishu",mC=gC([np(),vC(0,sp(yp)),yC("design:paramtypes",[Object])],mC);var bC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let xC=class extends OT{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,n){}_setCommonStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(T_(this,l,t,n,i)))}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(__(this,l,this.dpr)),s.setStrokeStyle(T_(this,h,t,n,i)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(f)}}setTextStyleWithoutAlignBaseline(t,e){var n;const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Zx(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}setTextStyle(t,e){var n,i;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Zx(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}createConicGradient(t,e,n,i){return null}createPattern(t,e){return null}};xC.env="taro",xC=bC([np()],xC);var wC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},AC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const SC={WIDTH:500,HEIGHT:500,DPR:1};let _C=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:n=SC.WIDTH,height:i=SC.HEIGHT,dpr:r=SC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new xC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};_C.env="taro",_C=wC([np(),AC("design:paramtypes",[Object])],_C);var TC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},BC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},CC=function(t,e){return function(n,i){e(n,i,t)}};let PC=class extends rC{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new _C(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new _C({width:n,height:i,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,n)=>{t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,n)=>{t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};PC.env="taro",PC=TC([np(),CC(0,sp(yp)),BC("design:paramtypes",[Object])],PC);var RC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let OC=class extends OT{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,n=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;n.setLineDash(t)}}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=__(this,l,this.dpr),s.strokeStyle=T_(this,h,t,n,i),s.lineJoin=c,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=f}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};OC.env="lynx",OC=RC([np()],OC);var MC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},EC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const kC={WIDTH:500,HEIGHT:500,DPR:1};let IC=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:n=kC.WIDTH,height:i=kC.HEIGHT,dpr:r=kC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new OC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};IC.env="lynx",IC=MC([np(),EC("design:paramtypes",[Object])],IC);var jC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},DC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},LC=function(t,e){return function(n,i){e(n,i,t)}};let NC=class extends rC{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new IC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new IC({width:n,height:i,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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};NC.env="lynx",NC=jC([np(),LC(0,sp(yp)),DC("design:paramtypes",[Object])],NC);var WC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},UC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let FC=class extends OT{constructor(t,e){super(t,e);const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new Y(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};FC.env="node",FC=WC([np(),UC("design:paramtypes",[Object,Number])],FC);var zC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},HC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const VC={WIDTH:500,HEIGHT:500,DPR:1};let GC=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:n=VC.WIDTH,height:i=VC.HEIGHT,canvasControled:r=!0,dpr:s=VC.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=n*s,this._pixelHeight=i*s,this._displayWidth=n,this._displayHeight=i,this._nativeCanvas=e,this._context=new FC(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,n,i){return this._context.getImageData(t,e,n,i)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this._nativeCanvas.release&&a(this._nativeCanvas.release)&&this._nativeCanvas.release()}};GC.env="node",GC=zC([np(),HC("design:paramtypes",[Object])],GC);var XC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},YC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qC=function(t,e){return function(n,i){e(n,i,t)}};let KC=class extends rC{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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new GC(n)}createWindowByCanvas(t){const e=t.canvas;let n=t.width,i=t.height;null!=n&&null!=i&&t.canvasControled||(n=e.width,i=e.height),this.canvas=new GC({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,n){}dispatchEvent(t){return!0}removeEventListener(t,e,n){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t,e){}};KC.env="node",KC=XC([np(),qC(0,sp(yp)),YC("design:paramtypes",[Object])],KC);var $C=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let ZC=class extends OT{draw(){}createPattern(t,e){return null}};ZC.env="wx",ZC=$C([np()],ZC);var JC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},QC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const tP={WIDTH:500,HEIGHT:500,DPR:1};let eP=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:n=tP.WIDTH,height:i=tP.HEIGHT,dpr:r=tP.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new ZC(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,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};eP.env="wx",eP=JC([np(),QC("design:paramtypes",[Object])],eP);var nP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},iP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rP=function(t,e){return function(n,i){e(n,i,t)}};class sP{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 n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,1)}cleanEvent(){this.cache={}}}let oP=class extends rC{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new sP}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}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:nv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new eP(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new eP({width:n,height:i,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,n,i,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!==(n=t.changedTouches[0].x)&&void 0!==n?n:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(i=t.changedTouches[0].y)&&void 0!==i?i:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},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 n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};oP.env="wx",oP=nP([np(),rP(0,sp(yp)),iP("design:paramtypes",[Object])],oP);var aP=new Zf((t=>{t(lC).toSelf(),t(cx).toDynamicValue((t=>t.container.get(lC))).whenTargetNamed(lC.env),t(mC).toSelf(),t(cx).toDynamicValue((t=>t.container.get(mC))).whenTargetNamed(mC.env),t(PC).toSelf(),t(cx).toDynamicValue((t=>t.container.get(PC))).whenTargetNamed(PC.env),t(NC).toSelf(),t(cx).toDynamicValue((t=>t.container.get(NC))).whenTargetNamed(NC.env),t(oP).toSelf(),t(cx).toDynamicValue((t=>t.container.get(oP))).whenTargetNamed(oP.env),t(KC).toSelf(),t(cx).toDynamicValue((t=>t.container.get(KC))).whenTargetNamed(KC.env)})),lP=new Zf((t=>{t(ay).toSelf().inSingletonScope(),t(oy).toService(ay),dp(t,oy)})),hP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uP=function(t,e){return function(n,i){e(n,i,t)}};let dP=class{constructor(t){this.global=t,this.offscreen=!1}setDpr(t){this.canvas.dpr=t}init(t,e,n){if(this.layer=t,this.window=e,n.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=n.canvasId?this.global.getElementById(n.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const i=e.getContext().getCanvas().nativeCanvas,r=uy({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:i.offsetLeft,y:i.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,n){var i;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,n){var i;const r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};dP=hP([np(),uP(0,sp(yp)),cP("design:paramtypes",[Object])],dP);var fP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gP=function(t,e){return function(n,i){e(n,i,t)}};let yP=class{constructor(t){this.global=t,this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,n){this.layer=t;const i=uy({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var n;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,n){const i=t.getContext(),r=t.dpr,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:l=this.layer.viewHeight}=n;i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(s,o,a,l),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,l),i.nativeContext.restore()}merge(t){}};yP=fP([np(),gP(0,sp(yp)),pP("design:paramtypes",[Object])],yP);var vP=new Zf((t=>{t(dP).toSelf(),t(yP).toSelf(),t(tx).toService(dP)}));var mP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const bP=Symbol.for("DrawItemInterceptor"),xP=new V;let wP=class{constructor(){this.order=1}afterDrawItem(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,n,i,r),!1}beforeDrawItem(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,n,i,r),!1}drawItem(t,e,n,i,r){if(!t.shadowRoot)return!1;const{context:s}=n;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){xP.copy(i.dirtyBounds);const e=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(e)}return i.renderGroup(t.shadowRoot,n),s.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&i.dirtyBounds.copy(xP),!0}};wP=mP([np()],wP);let AP=class{constructor(){this.order=1}beforeDrawItem(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const l=$A.allocate();eS(l,a);const h=s.modelMatrix;if(h){if(l){const t=$A.allocate();s.modelMatrix=nS(t,h,l)}}else s.modelMatrix=l;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===kb,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var n,i,r,s;let o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i: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+=P;for(;a<0;)a+=P;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",i.renderGroup(t,n),n.hack_pieFace="inside",i.renderGroup(t,n),n.hack_pieFace="top",i.renderGroup(t,n),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 n;return s.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n: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)})),i.renderGroup(t,n,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else i.renderGroup(t,n)}else i.renderItem(t,n);return s.camera=null,s.restore(),s.modelMatrix!==h&&$A.free(s.modelMatrix),s.modelMatrix=h,n.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};AP=mP([np()],AP);var SP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},_P=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},TP=function(t,e){return function(n,i){e(n,i,t)}};let BP=class{constructor(t,e,n,i){this.contributions=t,this.renderSelector=e,this.layerService=n,this.drawItemInterceptorContributions=i,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new H,this.backupDirtyBounds=new H}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:n,stage:i,x:r=0,y:s=0,width:o,height:a}=e;if(!n)return;const l=this.dirtyBounds.setValue(0,0,o,a);if(i.dirtyBounds&&!i.dirtyBounds.empty()){const t=(h=l,c=i.dirtyBounds,u=!1,null===h?c:null===c?h:(q=h.x1,K=h.x2,$=h.y1,Z=h.y2,J=c.x1,Q=c.x2,et=c.y1,nt=c.y2,u&&(q>K&&([q,K]=[K,q]),$>Z&&([$,Z]=[Z,$]),J>Q&&([J,Q]=[Q,J]),et>nt&&([et,nt]=[nt,et])),q>=Q||K<=J||$>=nt||Z<=et?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(q,J),y1:Math.max($,et),x2:Math.min(K,Q),y2:Math.min(Z,nt)}));l.x1=Math.floor(t.x1),l.y1=Math.floor(t.y1),l.x2=Math.ceil(t.x2),l.y2=Math.ceil(t.y2)}var h,c,u;this.backupDirtyBounds.copy(l),n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0);const d=l.width()*n.dpr!==n.canvas.width||l.height()*n.dpr!==n.canvas.height;n.save(),n.translate(r,s,!0),d&&(n.beginPath(),n.rect(l.x1,l.y1,l.width(),l.height()),n.clip()),i.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,n,e),n.save(),t.renderTreeRoots.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Mg.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Mg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),n.restore(),n.restore(),n.draw(),n.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,n=t._uid;for(;e;){const t=cT(e,n,Mg.zIndex);if(t)return t;n=e._uid,e=e.parent}return null}renderGroup(t,e,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!rt(t.AABBBounds,this.dirtyBounds,!1))return;const i=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):lT(t,Mg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.dirtyBounds.copy(i)}_increaseRender(t,e){const{layer:n,stage:i}=e,{subLayers:r}=n;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||ly.get(r_);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=r.get(l._uid);t||(t={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(l._uid,t));const n=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:t.layer,context:n,startAtId:l._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,n){if(this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}const i=this.getRenderContribution(t);if(!i)return;if(!t.isContainer&&!rt(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=r),r?t.isContainer&&i.draw(t,this.currentRenderService,e,n):i.draw(t,this.currentRenderService,e,n),this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const i=this.InterceptorContributions[n];if(i.afterDrawItem&&i.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,n){const{clear:i}=n;if(i){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=n,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=T_(e,i,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};SP([sp(yp),_P("design:type",Object)],BP.prototype,"global",void 0),SP([hp(),_P("design:type",Function),_P("design:paramtypes",[]),_P("design:returntype",void 0)],BP.prototype,"init",null),BP=SP([np(),TP(0,op(h_)),TP(1,sp(A_)),TP(2,sp(px)),TP(3,sp(cp)),TP(3,ip(bP)),_P("design:paramtypes",[Array,Object,Object,Object])],BP);var CP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let PP=class{selector(t){return null}};PP=CP([np()],PP);var RP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},OP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},MP=function(t,e){return function(n,i){e(n,i,t)}};let EP=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Lb}drawShape(t,e,n,i,r,s,o,a){const l=ev(t,null==s?void 0:s.theme).group,{fill:h=l.fill,background:c,stroke:u=l.stroke,opacity:f=l.opacity,width:p=l.width,height:g=l.height,clip:y=l.clip,fillOpacity:v=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:A=l.visible}=t.attribute,S=bx(f,v,p,g,h),_=Ax(f,m,p,g),T=yx(h,c),B=vx(u,w);if(!t.valid||!A)return;if(!y){if(!T&&!B)return;if(!(S||_||o||a||c))return}if(x&&x.length&&r.drawContribution){const t=e.disableFill,n=e.disableStroke,i=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,x.forEach((t=>{r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,s)})),e.disableFill=t,e.disableStroke=n,e.disableBeginPath=i}else 0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(n,i,p,g)):(e.beginPath(),MS(e,n,i,p,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const C={doFill:T,doStroke:B};this._groupRenderContribitions.forEach((s=>{s.time===Fp.beforeFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,l,r,o,a,C)})),y&&e.clip(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),C.doFill&&(o?o(e,t.attribute,l):S&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),C.doStroke&&(a?a(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._groupRenderContribitions.forEach((s=>{s.time===Fp.afterFillStroke&&s.drawShape(t,e,n,i,T,B,S,_,l,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=ev(t,null==i?void 0:i.theme).group,a=r.modelMatrix;if(r.camera){const e=$A.allocate(),n=$A.allocate();iS(n,t,o),nS(e,a||e,n),r.modelMatrix=e,$A.free(n),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,n);const{scrollX:l=o.scrollX,scrollY:h=o.scrollY}=t.attribute;let c;(l||h)&&r.translate(l,h),i&&i.drawingCb&&(c=i.drawingCb()),r.modelMatrix!==a&&$A.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};EP=RP([np(),MP(0,sp(cp)),MP(0,ip(kx)),OP("design:paramtypes",[Object])],EP);var kP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let IP=class extends vS{constructor(){super(...arguments),this.numberType=Wb}drawShape(t,e,n,i,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=ev(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:y=h.visible}=t.attribute,v=mx(d,f,c),m=xx(d,p),b=yx(c),x=vx(u,g);if(!t.valid||!y)return;if(!b&&!x)return;if(!(v||m||o||a))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],n,i)}else super.drawShape(t,e,n,i,r,s,o,a)}drawIncreaseSegment(t,e,n,i,r,s,o,a){i&&(e.beginPath(),function(t,e,n,i){const{offsetX:r=0,offsetY:s=0}=i||{},o=e?e.points[e.points.length-1]:n.points[0];t.moveTo(o.x+r,o.y+s),n.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}(e.nativeContext,n,i,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};IP=kP([np()],IP);var jP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let DP=class extends TS{constructor(){super(...arguments),this.numberType=Ib}drawShape(t,e,n,i,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(s>l.length)return;const h=ev(t).area,{fill:c=h.fill,fillOpacity:u=h.fillOpacity,opacity:d=h.opacity,visible:f=h.visible}=t.attribute,p=mx(d,u,c),g=yx(c);if(!t.valid||!f)return;if(!g)return;if(!p&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],n,i)}else super.drawShape(t,e,n,i,r,s,o)}drawIncreaseSegment(t,e,n,i,r,s,o,a){i&&(e.beginPath(),function(t,e,n,i){const{offsetX:r=0,offsetY:s=0}=i||{},{points:o}=n,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((n,i)=>{var o,a,l,h;const c=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(c.x+r,c.y+s),n.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=n.length-1;e>=0;e--){const i=n[e];t.lineTo(null!==(o=i.x1)&&void 0!==o?o:i.x,null!==(a=i.y1)&&void 0!==a?a:i.y)}t.lineTo(null!==(l=c.x1)&&void 0!==l?l:c.x,null!==(h=c.y1)&&void 0!==h?h:c.y),t.closePath()}))}(e.camera?e:e.nativeContext,n,i,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};DP=jP([np()],DP);var LP,NP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},WP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},UP=function(t,e){return function(n,i){e(n,i,t)}},FP=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(LP||(LP={}));let zP=class extends BP{constructor(t,e,n,i,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=n,this.areaRender=i,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=LP.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new pp([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return FP(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const n=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,n)return;this.currentRenderService=t;const{context:i,x:r=0,y:s=0}=e;i&&(i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0),i.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,i,e),i.translate(r,s,!0),i.save(),t.renderTreeRoots.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Mg.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Mg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{i.restore(),i.restore(),i.draw(),i.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return FP(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return FP(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((n=>{this.renderItem(t,e,{drawingCb:()=>FP(this,void 0,void 0,(function*(){if(2!==t.count)yield hT(t,Mg.zIndex,((n,i)=>{if(this.status===LP.STOP)return!0;if(n.isContainer)return!1;if(i<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return i<r&&(this.currentIdx=i+1,this.renderItem(n,e)),i===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),n(!1);else{const i=t.getChildAt(0);if(i.incremental&&i.attribute.segments)for(i.incrementalAt||(i.incrementalAt=0);i.incrementalAt<i.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:i.incrementalAt,length:i.incremental},this.renderItem(i,e),i.incrementalAt+=i.incremental,yield this.waitToNextFrame();else this.renderItem(i,e);n(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return FP(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return FP(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return FP(this,void 0,void 0,(function*(){this.rendering&&(this.status=LP.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=LP.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return FP(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((n=>{this.renderItem(t,e,{drawingCb:()=>FP(this,void 0,void 0,(function*(){yield hT(t,Mg.zIndex,(t=>FP(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),n(!1)}))})})))}))}};NP([sp(yp),WP("design:type",Object)],zP.prototype,"global",void 0),zP=NP([np(),UP(0,op(h_)),UP(1,sp(A_)),UP(2,sp(IP)),UP(3,sp(DP)),UP(4,sp(px)),UP(5,sp(cp)),UP(5,ip(bP)),WP("design:paramtypes",[Array,Object,Object,Object,Object,Object])],zP);var HP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let VP=class extends fS{constructor(){super(...arguments),this.type="rect3d",this.numberType=Vb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).rect3d,{fill:c=h.fill,stroke:u=h.stroke,width:d=h.width,height:f=h.height,opacity:p=h.opacity,fillOpacity:g=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:m=h.visible}=t.attribute,b=null!==(l=this.z)&&void 0!==l?l:0,x=bx(p,g,d,f,c),w=Ax(p,v,d,f),A=yx(c),S=vx(u,y);if(!t.valid||!m)return;if(!A&&!S)return;if(!(x||w||o||a))return;const{light:_,camera:T}=r.stage||{},B=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,n,i,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(n,i,b,B,r,e,_,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,b,B,e))}stroke(t,e,n,i,r){const s=i.vertices;i.edges.forEach((i=>{const o=s[i[0]],a={x:t+o[0],y:e+o[1],z:n+o[2]},l=s[i[1]],h={x:t+l[0],y:e+l[1],z:n+l[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(t,e,n,i,r,s,o,a){const l=Fv.get(r).value,h=i.vertices,c=h.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];i.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:n,normal:i}=t,r=c[n[0]],s=c[n[1]],o=c[n[2]],a=c[n[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((i=>{const{polygon:c,normal:u}=i.polygon,d=h[c[0]],f=h[c[1]],p=h[c[2]],g=h[c[3]],y={x:t+d[0],y:e+d[1],z:n+d[2]},v={x:t+f[0],y:e+f[1],z:n+f[2]},m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]};s.beginPath(),s.moveTo(y.x,y.y,y.z),s.lineTo(v.x,v.y,v.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,l):r,s.fill())}))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=ev(t).rect,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;this.z=l,this.drawShape(t,i,o,a,n),this.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}};VP=HP([np()],VP);var GP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let XP=class{constructor(){this.numberType=Gb}drawShape(t,e,n,i,r){const s=ev(t).richtext,{width:o=s.width,height:a=s.height,opacity:l=s.opacity,fillOpacity:h=s.fillOpacity,visible:c=s.visible}=t.attribute;t.valid&&c&&mx(l,h,!0)&&(e.translate(n,i),t.getFrameCache().draw(e,this.drawIcon))}drawIcon(t,e,n,i,r){var s;const o=ev(t).richtextIcon,{width:a=o.width,height:l=o.height,opacity:h=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:f=o.backgroundStroke,backgroundStrokeOpacity:p=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:y}=t.attribute,{backgroundWidth:v=a,backgroundHeight:m=l}=t.attribute;if(y&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(v-a)/2,r=(m-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,v,m)):(e.beginPath(),MS(e,n-t,i-r,v,m,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=h,e.drawImage(b.data,n,i,a,l))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=ev(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,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,o,n),i.highPerformanceRestore()}};XP=GP([np()],XP);var YP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let qP=class{constructor(){this.numberType=Db}drawShape(t,e,n,i,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,n,i,r,s,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;if(r.highPerformanceSave(),!n.drawContribution)return;const s=ev(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{n.drawContribution.renderItem(t,n,{theme:s})})),r.highPerformanceRestore()}};qP=YP([np()],qP);var KP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let $P=class extends fS{constructor(){super(...arguments),this.numberType=kb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).arc,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible}=t.attribute,m=mx(f,p,c),b=xx(f,y),x=yx(c,u),w=vx(d,g),A=null!==(l=this.z)&&void 0!==l?l:0;if(!t.valid||!v)return;if(!x&&!w)return;if(!(m||b||o||a||u))return;const{outerRadius:S=h.outerRadius,innerRadius:T=h.innerRadius,height:B=10}=t.attribute,C=Fv.get(c).value,{light:O}=r.stage||{},E=r.hack_pieFace,k={top:A,bottom:A+B},j={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===E||"top"===E?(e.beginPath(),function(t,e,n,i,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=R(l-a),c=l>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=_)e.moveTo(n,i,r);else if(h>=P-_)e.moveTo(n+s*M(a),i+s*I(a),r),e.arc(n,i,s,a,l,!c,r),o>_&&(e.moveTo(n+o*M(l),i+o*I(l),r),e.arc(n,i,o,l,a,c,r));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:f,outerEndAngle:p,innerEndAngle:g,innerStartAngle:y}=t.getParsePadAngle(a,l),v=s*M(f),m=s*I(f),b=o*M(g),x=o*I(g);h<.001?u=!0:(e.moveTo(n+v,i+m,r),e.arc(n,i,s,f,p,!c,r)),!(o>_)||d<.001?(e.lineTo(n+b,i+x,r),u=!0):(e.lineTo(n+b,i+x,r),e.arc(n,i,o,g,y,c,r))}e.closePath()}(t,e,n,i,k[E],S,T),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),x&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=O?O.computeColor(j[E],C):c,e.fill())),w&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))):"outside"!==E&&"inside"!==E||("inside"===E&&(e.save(),e.beginPath(),e.arc(n,i,T,0,P,!0,k.top),e.clip()),e.beginPath(),function(t,e,n,i,r,s,o,a){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=R(h-l),u=h>l;let d=!1;if(o<=_)e.moveTo(n,i,r);else if(c>=P-_)e.moveTo(n+o*M(l),i+o*I(l),r),e.arc(n,i,o,l,h,!u,r),e.lineTo(n+o*M(h),i+o*I(h),s),e.arc(n,i,o,h,l,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:f}=a(l,h),p=o*M(c),g=o*I(c),y=o*M(f),v=o*I(f);t<.001?d=!0:(e.moveTo(n+p,i+g,r),e.arc(n,i,o,c,f,!u,r),e.lineTo(n+y,i+v,s),e.arc(n,i,o,f,c,u,s))}e.closePath()}(t,e,n,i,k.top,k.bottom,"outside"===E?S:T,((e,n)=>{const{outerDeltaAngle:i,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:l}=t.getParsePadAngle(e,n);return"outside"===E?{innerouterDeltaAngle:i,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:l}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),x&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=O?O.computeColor(j[E],C):c,e.fill())),w&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())),"inside"===E&&e.restore())}draw(t,e,n,i){const{context:r}=n;if(!r)return;const s=ev(t,null==i?void 0:i.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,Sx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&$A.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};$P=KP([np()],$P);var ZP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let JP=class extends fS{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=zb}drawShape(t,e,n,i,r,s,o,a){var l;const h=ev(t,null==s?void 0:s.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:y=h.visible,points:v,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(l=this.z)&&void 0!==l?l:0,x=mx(d,f,c),w=xx(d,g),A=yx(c),S=vx(u,p);if(!t.valid||!y||4!==v.length)return;if(!A&&!S)return;if(!(x||w||o||a))return;const{light:_,camera:T}=r.stage||{},B=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,n,i,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(n,i,b,B,m,r,e,_,T,t,h,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,b,B,e))}stroke(t,e,n,i,r){const s=i.vertices;i.edges.forEach((i=>{const o=s[i[0]],a=s[i[1]],l={x:t+o[0],y:e+o[1],z:n+o[2]},h={x:t+a[0],y:e+a[1],z:n+a[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(t,e,n,i,r,s,o,a,l,h,c,u){const d=Fv.get(s).value,f=i.vertices,p=f.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];i.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:n,normal:i}=t,s=p[n[0]],o=p[n[1]],a=p[n[2]],l=p[n[3]];t.ave_z=s+o+a+l})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((i=>{const{polygon:r,normal:l}=i.polygon,p=f[r[0]],g=f[r[1]],y=f[r[2]],v=f[r[3]],m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]},x={x:t+y[0],y:e+y[1],z:n+y[2]},w={x:t+v[0],y:e+v[1],z:n+v[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,h.attribute,c):(o.fillStyle=a?a.computeColor(l,d):s,o.fill())}))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=ev(t).polygon,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;this.z=l,this.drawShape(t,i,o,a,n),this.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}};JP=ZP([np()],JP);var QP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let tR=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}};tR=QP([np()],tR);let eR=class extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}};eR=QP([np()],eR);var nR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let iR=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}};iR=nR([np()],iR);let rR=class extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}};rR=nR([np()],rR);var sR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let oR=class extends O_{constructor(){super(...arguments),this.time=Fp.beforeFillStroke}};oR=sR([np()],oR);let aR=class extends E_{constructor(){super(...arguments),this.time=Fp.afterFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){var f,p,g,y;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:v=t.attribute}=d||{},{texture:m=(null!==(f=t.attribute.texture)&&void 0!==f?f:Ev(l,"texture")),textureColor:b=(null!==(p=t.attribute.textureColor)&&void 0!==p?p:Ev(l,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:Ev(l,"textureSize")),texturePadding:w=(null!==(y=t.attribute.texturePadding)&&void 0!==y?y:Ev(l,"texturePadding"))}=v;if(!m)return;let A=this.textureMap.get(m);if(!A)switch(m){case"circle":A=this.createCirclePattern(x,w,b,e);break;case"diamond":A=this.createDiamondPattern(x,w,b,e);break;case"rect":A=this.createRectPattern(x,w,b,e);break;case"vertical-line":A=this.createVerticalLinePattern(x,w,b,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(x,w,b,e);break;case"bias-lr":A=this.createBiasLRLinePattern(x,w,b,e);break;case"bias-rl":A=this.createBiasRLLinePattern(x,w,b,e);break;case"grid":A=this.createGridPattern(x,w,b,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}};aR=sR([np()],aR);var lR=new Zf((t=>{t(BP).toSelf(),t(S_).toService(BP),t(zP).toSelf(),t(r_).toService(zP),t(PP).toSelf(),t(A_).toService(PP),t(qx).toSelf().inSingletonScope(),t(l_).to(qx),t(h_).to(qx),t(N_).toSelf().inSingletonScope(),t(W_).toSelf().inSingletonScope(),t(U_).toSelf().inSingletonScope(),t(Ex).toService(N_),t(Ex).toService(W_),t(Ex).toService(U_),dp(t,Ex),t(jS).toSelf().inSingletonScope(),t(p_).to(jS),t(h_).to(jS),t(VP).toSelf().inSingletonScope(),t(g_).toService(VP),t(h_).toService(g_),t(X_).toSelf().inSingletonScope(),t(Y_).toSelf().inSingletonScope(),t(q_).toSelf().inSingletonScope(),t(K_).toSelf().inSingletonScope(),t($_).toSelf().inSingletonScope(),t(Lx).toService(X_),t(Lx).toService(Y_),t(Lx).toService(q_),t(Lx).toService(K_),t(Lx).toService($_),dp(t,Lx),t(HS).toSelf().inSingletonScope(),t(v_).to(HS),t(h_).to(HS),dp(t,Wx),t(RS).toSelf().inSingletonScope(),t(d_).to(RS),t(h_).to(RS),t(iR).toSelf().inSingletonScope(),t(rR).toSelf().inSingletonScope(),t(jx).toService(iR),t(jx).toService(rR),dp(t,jx),t(WS).toSelf().inSingletonScope(),t(y_).to(WS),t(h_).to(WS),t(J_).toSelf().inSingletonScope(),t(Q_).toSelf().inSingletonScope(),t(tT).toSelf().inSingletonScope(),t(Nx).toService(J_),t(Nx).toService(Q_),t(Nx).toService(tT),dp(t,Nx),t(Vx).toSelf().inSingletonScope(),t(s_).to(Vx),t(h_).to(Vx),t($P).toSelf().inSingletonScope(),t(o_).toService($P),t(h_).toService(o_),t(I_).toSelf().inSingletonScope(),t(j_).toSelf().inSingletonScope(),t(D_).toSelf().inSingletonScope(),t(Ox).toService(I_),t(Ox).toService(j_),t(Ox).toService(D_),dp(t,Ox),t(vS).toSelf().inSingletonScope(),t(u_).to(vS),t(h_).to(vS),t(IP).toSelf().inSingletonScope(),t(DP).toSelf().inSingletonScope(),t(TS).toSelf().inSingletonScope(),t(a_).to(TS),t(h_).to(TS),t(oR).toSelf().inSingletonScope(),t(aR).toSelf().inSingletonScope(),t(Mx).toService(oR),t(Mx).toService(aR),dp(t,Mx),t(EP).toSelf().inSingletonScope(),t(c_).to(EP),t(h_).to(EP),t(z_).toSelf().inSingletonScope(),t(kx).toService(z_),dp(t,kx),t(JS).toSelf().inSingletonScope(),t(f_).to(JS),t(h_).to(JS),t(tR).toSelf().inSingletonScope(),t(eR).toSelf().inSingletonScope(),t(Dx).toService(tR),t(Dx).toService(eR),dp(t,Dx),t(qP).toSelf().inSingletonScope(),t(x_).toService(qP),t(h_).toService(x_),t(i_).toSelf().inSingletonScope(),t(w_).toService(i_),t(h_).toService(w_),t(V_).toSelf().inSingletonScope(),t(Ix).toService(V_),dp(t,Ix),t(XP).toSelf().inSingletonScope(),t(m_).toService(XP),t(h_).toService(m_),t(JP).toSelf().inSingletonScope(),t(b_).toService(JP),t(h_).toService(b_),t(M_).toSelf().inSingletonScope(),t(Wx).toService(M_),t(Ox).toService(M_),t(jx).toService(M_),t(Nx).toService(M_),t(Lx).toService(M_),t(Ix).toService(M_),t(Ex).toService(M_),t(Mx).toService(M_),t(Dx).toService(M_),dp(t,Ux),dp(t,h_),t(wP).toSelf().inSingletonScope(),t(bP).toService(wP),t(AP).toSelf().inSingletonScope(),t(bP).toService(AP),dp(t,bP)}));var hR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uR=function(t,e){return function(n,i){e(n,i,t)}};let dR=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=jb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=__(i,s,i.dpr),a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};dR=hR([np(),uR(0,sp(l_)),cR("design:paramtypes",[Object])],dR);var fR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gR=function(t,e){return function(n,i){e(n,i,t)}};const yR=new V;let vR=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Hb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,i.setTransformForCurrent()}else o=0,a=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||g(s,!0)&&0!==s||d(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=__(i,s,i.dpr),h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;yR.setValue(n.x1,n.y1,n.x2,n.y2),yR.expand(-s/2),h=!yR.containsPoint(e)}}return i.highPerformanceRestore(),h}};vR=fR([np(),gR(0,sp(p_)),pR("design:paramtypes",[Object])],vR);var mR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xR=function(t,e){return function(n,i){e(n,i,t)}};let wR=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Eb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).arc;i.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,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=__(i,s,i.dpr),a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};wR=mR([np(),xR(0,sp(s_)),bR("design:paramtypes",[Object])],wR);var AR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},SR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_R=function(t,e){return function(n,i){e(n,i,t)}};let TR=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Ib}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),i.highPerformanceRestore(),a}};TR=AR([np(),_R(0,sp(a_)),SR("design:paramtypes",[Object])],TR);var BR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let CR=class{constructor(){this.type="image",this.numberType=Nb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};CR=BR([np()],CR);var PR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let RR=class extends fS{};RR=PR([np()],RR);var OR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},MR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ER=function(t,e){return function(n,i){e(n,i,t)}};let kR=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Wb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;i.highPerformanceSave();const r=ev(t).line,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>{if(u)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=__(i,r,i.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};kR=OR([np(),ER(0,sp(u_)),MR("design:paramtypes",[Object])],kR);var IR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},DR=function(t,e){return function(n,i){e(n,i,t)}};let LR=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Ub}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).path;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>{if(u)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=__(i,r,i.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};LR=IR([np(),DR(0,sp(d_)),jR("design:paramtypes",[Object])],LR);var NR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},WR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},UR=function(t,e){return function(n,i){e(n,i,t)}};oS({});let FR=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Xb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=ev(t).symbol,o=this.transform(t,s,i),{x:a,y:l,z:h,lastModelMatrix:c}=o;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,i,a,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=__(i,r,i.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==c&&$A.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),d}};FR=NR([np(),UR(0,sp(y_)),WR("design:paramtypes",[Object])],FR);var zR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},HR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},VR=function(t,e){return function(n,i){e(n,i,t)}};let GR=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Yb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=ev(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,i,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,h,c,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),y=Qx(o,d,r),v=Jx(a,g);return e.rect(v+h,y+c,g,d,u),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&$A.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};GR=zR([np(),VR(0,sp(v_)),HR("design:paramtypes",[Object])],GR);var XR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},YR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qR=function(t,e){return function(n,i){e(n,i,t)}};let KR=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Fb}contains(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};KR=XR([np(),qR(0,sp(f_)),YR("design:paramtypes",[Object])],KR);var $R=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ZR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JR=function(t,e){return function(n,i){e(n,i,t)}};new V;let QR=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Gb}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};QR=$R([np(),JR(0,sp(m_)),ZR("design:paramtypes",[Object])],QR);var tO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},eO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nO=function(t,e){return function(n,i){e(n,i,t)}};let iO=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Db}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=null==n?void 0:n.pickerService;if(r){let i=!1;return t.getSubGraphic().forEach((t=>{i||(i=!!r.pickItem(t,e,null,n))})),i}return!1}};iO=tO([np(),nO(0,sp(x_)),eO("design:paramtypes",[Object])],iO);var rO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},sO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oO=function(t,e){return function(n,i){e(n,i,t)}};new V;let aO=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Vb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).rect;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,n,null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};aO=rO([np(),oO(0,sp(g_)),sO("design:paramtypes",[Object])],aO);var lO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},hO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cO=function(t,e){return function(n,i){e(n,i,t)}};new V;let uO=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=zb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).polygon;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>!1)),this.canvasRenderer.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};uO=lO([np(),cO(0,sp(b_)),hO("design:paramtypes",[Object])],uO);var dO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pO=function(t,e){return function(n,i){e(n,i,t)}};new V;let gO=class extends RR{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=kb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).arc;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,n,null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,i.modelMatrix!==h&&$A.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};gO=dO([np(),pO(0,sp(o_)),fO("design:paramtypes",[Object])],gO);var yO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let vO=class{constructor(){this.type="group",this.numberType=Lb}contains(t,e,n){return!1}};vO=yO([np()],vO);var mO=new Zf(((t,e,n,i)=>{t(dR).toSelf().inSingletonScope(),t(NT).toService(dR),t(ZT).toService(NT),t(vR).toSelf().inSingletonScope(),t(zT).toService(vR),t(ZT).toService(zT),t(aO).toSelf().inSingletonScope(),t(HT).toService(aO),t(ZT).toService(HT),t(wR).toSelf().inSingletonScope(),t(jT).toService(wR),t(ZT).toService(jT),t(TR).toSelf().inSingletonScope(),t(LT).toService(TR),t(ZT).toService(LT),t(CR).toSelf().inSingletonScope(),t(WT).toService(CR),t(ZT).toService(WT),t(kR).toSelf().inSingletonScope(),t(UT).toService(kR),t(ZT).toService(UT),t(LR).toSelf().inSingletonScope(),t(FT).toService(LR),t(ZT).toService(FT),t(FR).toSelf().inSingletonScope(),t(VT).toService(FR),t(ZT).toService(VT),t(GR).toSelf().inSingletonScope(),t(GT).toService(GR),t(ZT).toService(GT),t(KR).toSelf().inSingletonScope(),t(XT).toService(KR),t(ZT).toService(XT),t(uO).toSelf().inSingletonScope(),t(YT).toService(uO),t(ZT).toService(YT),t(gO).toSelf().inSingletonScope(),t(DT).toService(gO),t(ZT).toService(DT),t(QR).toSelf().inSingletonScope(),t(qT).toService(QR),t(ZT).toService(qT),t(iO).toSelf().inSingletonScope(),t(KT).toService(iO),t(ZT).toService(KT),t(vO).toSelf().inSingletonScope(),t($T).toService(vO),t(ZT).toService($T),dp(t,ZT)})),bO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wO=function(t,e){return function(n,i){e(n,i,t)}};let AO=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=Ub}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};AO=bO([np(),wO(0,sp(d_)),xO("design:paramtypes",[Object])],AO);var SO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},_O=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},TO=function(t,e){return function(n,i){e(n,i,t)}};let BO=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=jb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};BO=SO([np(),TO(0,sp(l_)),_O("design:paramtypes",[Object])],BO);var CO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},PO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},RO=function(t,e){return function(n,i){e(n,i,t)}};const OO=new V;let MO=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Hb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,i.setTransformForCurrent()}else o=0,a=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||g(s,!0)&&0!==s||d(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;OO.setValue(n.x1,n.y1,n.x2,n.y2),OO.expand(-s/2),h=!OO.containsPoint(e)}}return i.highPerformanceRestore(),h}};MO=CO([np(),RO(0,sp(p_)),PO("design:paramtypes",[Object])],MO);var EO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IO=function(t,e){return function(n,i){e(n,i,t)}};let jO=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Eb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).arc;i.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,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};jO=EO([np(),IO(0,sp(s_)),kO("design:paramtypes",[Object])],jO);var DO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NO=function(t,e){return function(n,i){e(n,i,t)}};let WO=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Ib}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),i.highPerformanceRestore(),a}};WO=DO([np(),NO(0,sp(a_)),LO("design:paramtypes",[Object])],WO);var UO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},FO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zO=function(t,e){return function(n,i){e(n,i,t)}};let HO=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=Wb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};HO=UO([np(),zO(0,sp(u_)),FO("design:paramtypes",[Object])],HO);var VO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},GO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XO=function(t,e){return function(n,i){e(n,i,t)}};let YO=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=Xb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};YO=VO([np(),XO(0,sp(y_)),GO("design:paramtypes",[Object])],YO);var qO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let KO=class{constructor(){this.type="text",this.numberType=Yb}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};KO=qO([np()],KO);var $O=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ZO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JO=function(t,e){return function(n,i){e(n,i,t)}};let QO=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Fb}contains(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=ev(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};QO=$O([np(),JO(0,sp(f_)),ZO("design:paramtypes",[Object])],QO);var tM=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},eM=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nM=function(t,e){return function(n,i){e(n,i,t)}};let iM=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=Db}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=null==n?void 0:n.pickerService;if(r){let i=!1;return t.getSubGraphic().forEach((t=>{i||(i=!!r.pickItem(t,e,null,n))})),i}return!1}};iM=tM([np(),nM(0,sp(x_)),eM("design:paramtypes",[Object])],iM);var rM=new Zf((t=>{t(BO).toSelf().inSingletonScope(),t(tB).toService(BO),t(lB).toService(tB),t(MO).toSelf().inSingletonScope(),t(iB).toService(MO),t(lB).toService(iB),t(jO).toSelf().inSingletonScope(),t(JT).toService(jO),t(lB).toService(JT),t(WO).toSelf().inSingletonScope(),t(QT).toService(WO),t(lB).toService(QT),t(HO).toSelf().inSingletonScope(),t(eB).toService(HO),t(lB).toService(eB),t(AO).toSelf().inSingletonScope(),t(nB).toService(AO),t(lB).toService(nB),t(YO).toSelf().inSingletonScope(),t(rB).toService(YO),t(lB).toService(rB),t(KO).toSelf().inSingletonScope(),t(sB).toService(KO),t(lB).toService(sB),t(QO).toSelf().inSingletonScope(),t(oB).toService(QO),t(lB).toService(oB),t(iM).toSelf().inSingletonScope(),t(aB).toService(iM),t(iM).toService(aB),dp(t,lB)}));var sM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new IT(t))).whenTargetNamed(IT.env),t(cy).toDynamicValue((()=>(t,e)=>new OT(t,e))).whenTargetNamed(OT.env)})),oM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new _C(t))).whenTargetNamed(_C.env),t(cy).toDynamicValue((()=>(t,e)=>new xC(t,e))).whenTargetNamed(xC.env)})),aM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new pC(t))).whenTargetNamed(pC.env),t(cy).toDynamicValue((()=>(t,e)=>new cC(t,e))).whenTargetNamed(cC.env)})),lM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new IC(t))).whenTargetNamed(IC.env),t(cy).toDynamicValue((()=>(t,e)=>new OC(t,e))).whenTargetNamed(OC.env)})),hM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new eP(t))).whenTargetNamed(eP.env),t(cy).toDynamicValue((()=>(t,e)=>new ZC(t,e))).whenTargetNamed(ZC.env)})),cM=new Zf((t=>{t(hy).toDynamicValue((()=>t=>new GC(t))).whenTargetNamed(GC.env),t(cy).toDynamicValue((()=>(t,e)=>new FC(t,e))).whenTargetNamed(FC.env)}));ly.load(gx),ly.load(SB),ly.load(oT),ly.load(AB),ly.load(OB),function(t){t.load(eC),t.load(aP),t.load(lP),t.load(vP)}(ly),function(t){t.load(lR)}(ly),function(t){t.load(mO),t.load(rM)}(ly),function(t){t.load(sM),t.load(aM),t.load(oM),t.load(lM),t.load(hM),t.load(cM)}(ly);const uM=ly.get(yp);Yg.global=uM;const dM=ly.get(fx);Yg.graphicUtil=dM;const fM=ly.get(dx);Yg.transformUtil=fM;const pM=ly.get(qb);Yg.graphicService=pM,ly.get(ST);const gM=ly.get(px);Yg.layerService=gM,new V;const yM=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.handleTick=(t,e)=>{const{once:n=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),n||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let n=0;this.lastFrameTime>=0&&(n=e-this.lastFrameTime),this.lastFrameTime=e,this.status===fv.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(n)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=fv.INITIAL,Yg.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),Yg.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:dv},{mode:"timeout",cons:uv},{mode:"manual",cons:cv}];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 dv;break;case"timeout":t=new uv;break;case"manual":t=new cv;break;default:console.warn("非法的计时器模式"),t=new dv}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!==fv.INITIAL&&(this.status=fv.PAUSE,!0)}resume(){return this.status!==fv.INITIAL&&(this.status=fv.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===fv.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===fv.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=fv.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=fv.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};var vM;yM.addTimeline(gv),yM.setFPS(60),function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(vM||(vM={}));const mM=(t,e,n,i)=>new ot(Object.assign({defaultFontParams:Object.assign({fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14},i),getTextBounds:n?void 0:uS,specialCharSet:"-/: .,@%'\"~"+ot.ALPHABET_CHAR_SET+ot.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function bM(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function xM(t){let e="center",n="middle";return e=(t=bM(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",n=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:n}}const wM=t=>t.map(((t,e)=>({index:e,value:t}))),AM=(t,e,n=0)=>{const i=new V(t).expand(n/2),r=new V(e).expand(n/2);return i.intersects(r)},SM=(t,e)=>{let n=0;t.x2<e.x1?n=e.x1-t.x2:e.x2<t.x1&&(n=t.x1-e.x2);let i=0;return t.y2<e.y1?i=e.y1-t.y2:e.y2<t.y1&&(i=t.y1-e.y2),[n,i]};function _M(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function TM(t,e){for(let n,i=1,r=t.length,s=t[0];i<r;s=n,++i)if(n=t[i],_M(s.AABBBounds,n.AABBBounds,e))return!0;return!1}const BM=(t,e,n)=>{var i;const{labelStyle:r,axisOrientType:s,labelFlush:o,labelFormatter:a,startAngle:l=0}=n,h=null!==(i=r.angle)&&void 0!==i?i:0,c=["bottom","top"].includes(s),u=["left","right"].includes(s);let d=l;c?d=0:u&&(d=G(-90));const f=mM(r),p=e.map(((n,i)=>{var s,l;const p=a?a(n):`${n}`,{width:g,height:y}=f.quickMeasure(p),v=Math.max(g,12),m=Math.max(y,12),b=t.scale(n);let x,w,A=Math.cos(d)*b,S=-Math.sin(d)*b;x=o&&c&&0===i?"left":o&&c&&i===e.length-1?"right":null!==(s=r.textAlign)&&void 0!==s?s:"center","right"===x?A-=v:"center"===x&&(A-=v/2),w=o&&u&&0===i?"top":o&&u&&i===e.length-1?"bottom":null!==(l=r.textBaseline)&&void 0!==l?l:"middle","bottom"===w?S-=m:"middle"===w&&(S-=m/2);return(new V).set(A,S,A+v,S+m).rotate(h,A+v/2,S+m/2)}));return p},CM=(t,e,n)=>{var i;const{labelStyle:r,getRadius:s,labelOffset:o,labelFormatter:a}=n,l=null==s?void 0:s(),h=null!==(i=r.angle)&&void 0!==i?i:0,c=mM(r),u=e.map((e=>{const n=a?a(e):`${e}`,{width:i,height:r}=c.quickMeasure(n),s=Math.max(i,12),u=Math.max(r,12),d=t.scale(e);let f=0,p=0;const g=xM(d),{x:y,y:v}=function(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}({x:0,y:0},l+o,d);f=y+("right"===g.align?-s:"center"===g.align?-s/2:0),p=v+("bottom"===g.baseline?-u:"middle"===g.baseline?-u/2:0);return(new V).set(f,p,f+s,p+u).rotate(h,f+s/2,p+u/2)}));return u},PM={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let n;return t.filter(((t,i)=>(!i||!_M(n.AABBBounds,t.AABBBounds,e))&&(n=t,!0)))}},RM=(t,e,n,i,r,s)=>{let o=s,a=0,l=0,h=0,c=-1,u=Number.MAX_VALUE;do{let s=!0;o++;let d=0;do{d+o<t.length&&AM(e[d],e[d+o],n)&&(s=!1),d+=o}while(s&&d<t.length);if(s){if(!i){h=o;break}{const i=t.length-1;a=0;do{if(d-=o,d!==i&&!AM(e[d],e[i],n))break;a++}while(d>0);if(d===i){h=o,l=a;break}{const n=Math.floor(t.length/o)-a+1;if(n<c)break;{c=n;const t=r?0:1,s=SM(e[d],e[i])[t],f=d-o>=0?SM(e[d-o],e[d])[t]:s,p=Math.abs(s-f);p<u&&(u=p,h=o,l=a)}}}}}while(o<=t.length);return{step:h,delCount:l}},OM=(t,e,n,i)=>{let r=i;do{let i=!0;r++;let s=0;do{s+r<t.length&&AM(e[s],e[s+r],n)&&(i=!1),s+=r}while(i&&s<t.length);if(i)break}while(r<=t.length);let s=0;if(t.length>2){let n=t.length-t.length%r;for(n>=t.length&&(n-=r);n>0&&AM(e[0],e[n]);)s++,n-=r}return{step:r,delCount:s}};t.angleLabelOrientAttribute=xM,t.binaryFuzzySearch=(t,e)=>{let n=0,i=t.length;for(;n<i;){const r=Math.floor((n+i)/2);e(t[r])>=0?i=r:n=r+1}return n},t.convertDomainToTickData=wM,t.initTextMeasure=mM,t.normalizeAngle=bM,t.ticks=(t,e)=>{if(lt(t.type))return((t,e)=>{if(!lt(t.type))return wM(t.domain());const n=t.range();if(Math.abs(n[n.length-1]-n[0])<2)return wM([t.domain()[0]]);const{tickCount:i,forceTickCount:r,tickStep:s,noDecimals:o=!1}=e;let a;if(a=h(s)?t.stepTicks(s):h(r)?t.forceTicks(r):"d3"===e.tickMode?t.d3Ticks(null!=i?i:5,{noDecimals:o}):t.ticks(null!=i?i:5,{noDecimals:o}),e.sampling&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:n=4,labelFlush:i}=e;let r=BM(t,a,e).map(((t,e)=>({AABBBounds:t,value:a[e]})));for(;r.length>=3&&TM(r,n);)r=PM.parity(r);const s=r.map((t=>t.value));s.length<3&&i&&(s.length>1&&s.pop(),A(s)!==A(a)&&s.push(A(a))),a=s}return wM(a)})(t,e);if(function(t){switch(t){case at.Ordinal:case at.Point:case at.Band:return!0;default:return!1}}(t.type)){if("cartesian"===e.coordinateType)return((t,e)=>{var n;const i=t.domain();if(!i.length)return[];const{tickCount:r,forceTickCount:s,tickStep:o,labelGap:a=4,axisOrientType:l}=e,c=["bottom","top"].includes(l),u=t.range(),d=t.calculateWholeRangeSize();if(d<2)return e.labelLastVisible?wM([i[i.length-1]]):wM([i[0]]);let f;if(h(o))f=t.stepTicks(o);else if(h(s))f=t.forceTicks(s);else if(h(r))f=t.ticks(r);else if(e.sampling){let r;const s=(null!==(n=e.labelStyle.fontSize)&&void 0!==n?n:12)+2;if(i.length<=d/s)r=BM(t,i,e);else{const n=[i[0],i[Math.floor(i.length/2)],i[i.length-1]],s=BM(t,n,e);let o=null,a=0;s.forEach(((t,e)=>{if(!o)return o=t,void(a=e);c?o.width()<t.width()&&(o=t,a=e):o.height()<t.height()&&(o=t,a=e)}));const l=0===a?0:2===a?i.length-1:Math.floor(i.length/2),h=t.scale(i[l]);r=new Array(i.length);for(let e=0;e<r.length;e++){r[e]=o.clone();const n=t.scale(i[e]);c?r[e].translate(n-h,0):r[e].translate(0,n-h)}}const o=r.map((t=>c?t.width():t.height())),l=Math.min(...u),h=(Math.max(...u)-l)/i.length,p=RM(i,r,a,e.labelLastVisible,c,Math.floor(Math.min(...o)/h));f=t.stepTicks(p.step),e.labelLastVisible&&(f=f.slice(0,f.length-p.delCount),f.push(i[i.length-1]))}else f=t.domain();return wM(f)})(t,e);if("polar"===e.coordinateType&&"angle"===e.axisOrientType)return((t,e)=>{const{tickCount:n,forceTickCount:i,tickStep:r,getRadius:s,labelOffset:o,labelGap:a=0}=e,l=null==s?void 0:s();if(!l)return wM(t.domain());let c;if(h(r))c=t.stepTicks(r);else if(h(i))c=t.forceTicks(i);else if(h(n))c=t.ticks(n);else if(e.sampling){const n=t.domain(),i=t.range(),r=CM(t,n,e),s=Math.min(...i),h=Math.max(...i),u=Math.abs(h-s)*(l+o)/n.length,{step:d,delCount:f}=OM(n,r,a,Math.floor(r.reduce(((t,e)=>Math.min(t,e.width(),e.height())),Number.MAX_VALUE)/u));c=t.stepTicks(d),c=c.slice(0,c.length-f)}else c=t.domain();return wM(c)})(t,e)}return wM(t.domain())}}));