@visactor/vchart-extension 2.0.1-alpha.2 → 2.0.1-alpha.3

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.
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart)}(this,(function(t,e){"use strict";function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new s(n,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,a=new Array(r);s<r;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,s,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,a),!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,p=c.length;for(h=0;h<p;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,n);break;case 4:c[h].fn.call(c[h].context,e,n,s);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},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||s&&!o.once||n&&o.context!==n||a(this,r);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||s&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(n);var s=i(n.exports);var r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var a=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean");var o=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=t=>"object"==typeof t&&null!==t;var d=function(t){if(!u(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var p=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||r(t,"String")};var g=t=>Array.isArray?Array.isArray(t):r(t,"Array");var f=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var m=t=>r(t,"Date");var y=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||r(t,"Number")};var b=t=>y(t)&&Number.isFinite(t);var v=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var x=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var _=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var S=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function w(t){if(l(t))return!0;if(f(t))return!t.length;const e=_(t);if("Map"===e||"Set"===e)return!t.size;if(S(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}var M=(t,e,i)=>{const n=p(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?i:t};function B(t,e,i){let n;if(!h(t)||"object"!=typeof t||e&&e(t))return t;const s=g(t),r=t.length;n=s?new Array(r):"object"==typeof t?{}:a(t)||y(t)||p(t)?t:m(t)?new Date(+t):void 0;const o=s?void 0:Object.keys(Object(t));let l=-1;if(n)for(;++l<(o||t).length;){const s=o?o[l]:l,r=t[s];i&&i.includes(s.toString())?n[s]=r:n[s]=B(r,e,i)}return n}function C(t,e,i=!1,n=!1){if(e){if(t===e)return;if(h(e)&&"object"==typeof e){const s=Object(e),r=[];for(const t in s)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!h(s[a])||"object"!=typeof s[a]||n&&g(t[a])?P(t,a,s[a]):k(t,e,a,i,n)}}}}function k(t,e,i,n=!1,s=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(g(a)){if(n)o=[];else if(g(r))o=r;else if(f(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else d(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):l=!1;l&&C(o,a,n,s),P(t,i,o)}function P(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function O(t,...e){let i=-1;const n=e.length;for(;++i<n;)C(t,e[i],!0);return t}function R(t,e){if(!t||!d(t))return t;const i={};return Object.keys(t).forEach((n=>{const s=t[n];let r=!1;e.forEach((t=>{(p(t)&&t===n||t instanceof RegExp&&n.match(t))&&(r=!0)})),r||(i[n]=s)})),i}function L(t){return Object.prototype.toString.call(t)}function I(t){return Object.keys(t)}function E(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(L(t)!==L(e))return!1;if(o(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let n=t.length-1;n>=0;n--)if(!E(t[n],e[n],i))return!1;return!0}if(!d(t))return!1;const n=I(t),s=I(e);if(n.length!==s.length)return!1;n.sort(),s.sort();for(let t=n.length-1;t>=0;t--)if(n[t]!=s[t])return!1;for(let s=n.length-1;s>=0;s--){const r=n[s];if(!E(t[r],e[r],i))return!1}return!0}function D(t,e,i){const n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e);for(let s=0;s<n.length;s++){const r=n[s];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function F(t,e,i=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(e);for(let s=0;s<n.length;s++){const r=n[s];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else D(t,e,i)}function j(t){return h(t)?g(t)?t:[t]:[]}const U=(t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)<0&&(n=r)}return n};function N(t,e){if(!g(t)||!g(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function W(t){if(!g(t))return[t];const e=[];for(const i of t)e.push(...W(i));return e}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function G(t){return Number(t)}const V="undefined"!=typeof console;function H(t,e,i){const n=[e].concat([].slice.call(i));V&&console[t].apply(console,n)}var X;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(X||(X={}));class ${static getInstance(t,e){return $._instance&&y(t)?$._instance.level(t):$._instance||($._instance=new $(t,e)),$._instance}static setInstance(t){return $._instance=t}static setInstanceLevel(t){$._instance?$._instance.level(t):$._instance=new $(t)}static clearInstance(){$._instance=null}constructor(t=X.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=X.Info}canLogDebug(){return this._level>=X.Debug}canLogError(){return this._level>=X.Error}canLogWarn(){return this._level>=X.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=X.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):H(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=X.Warn&&H(this._method||"warn","WARN",t),this}info(...t){return this._level>=X.Info&&H(this._method||"log","INFO",t),this}debug(...t){return this._level>=X.Debug&&H(this._method||"log","DEBUG",t),this}}$._instance=null;const Y=t=>{let e=null,i=null;return(...n)=>(e&&n.every(((t,i)=>t===e[i]))||(e=n,i=t(...n)),i)};var q=function(t,e,i){return t<e?e:t>i?i:t};function K(t,e){return i=>t*(1-i)+e*i}function Z(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const J=t=>e=>M(e,t),Q=(t,e={})=>{if(o(t))return t;const i=[t];return(e&&e.get||J)(i)},tt=t=>t?"string"==typeof t||"number"==typeof t?()=>t:o(t)?t:e=>e[t.field]:null,et=(t,e)=>{const i=o(e)?e:t=>t;let n,s;if(t&&t.length){const e=t.length;for(let r=0;r<e;r+=1){let e=i(t[r]);l(e)||!y(e=+e)||Number.isNaN(e)||(l(n)?(n=e,s=e):(n=Math.min(n,e),s=Math.max(s,e)))}return[n,s]}return[n,s]},it=1e-12,nt=Math.PI,st=nt/2,rt=2*nt,at=2*Math.PI,ot=Math.abs,lt=Math.atan2,ht=Math.cos,ct=Math.max,ut=Math.min,dt=Math.sin,pt=Math.sqrt,gt=Math.pow;function ft(t){return t>=1?st:t<=-1?-st:Math.asin(t)}function mt(t,e,i,n,s){let r=i,a=n;return"number"==typeof t&&"number"==typeof i&&(r=(1-s)*t+s*i),"number"==typeof e&&"number"==typeof n&&(a=(1-s)*e+s*n),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}class bt{constructor(t=0,e=0,i,n){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new bt(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 y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(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 vt{static distancePP(t,e){return pt(gt(t.x-e.x,2)+gt(t.y-e.y,2))}static distanceNN(t,e,i,n){return pt(gt(t-i,2)+gt(e-n,2))}static distancePN(t,e,i){return pt(gt(e-t.x,2)+gt(i-t.y,2))}static pointAtPP(t,e,i){return new bt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function xt(t){return t*(Math.PI/180)}function _t(t){return 180*t/Math.PI}const At=(t=0)=>{if(t<0)for(;t<-rt;)t+=rt;else if(t>0)for(;t>rt;)t-=rt;return t};function St(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Tt(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function wt(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Mt(t,e,i,n){if(!function(t,e,i,n){let s=t[0],r=e[0],a=i[0],o=n[0];return r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),!(r<a||o<s||(s=t[1],r=e[1],a=i[1],o=n[1],r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),r<a||o<s))}(t,e,i,n))return!1;const s=[0,0],r=[0,0],a=[0,0];if(wt(s,e,t),wt(r,n,i),ot((o=s)[0]-(l=r)[0])+ot(o[1]-l[1])<1e-12)return!0;var o,l;wt(a,i,t);const h=yt(a,r)/yt(s,r);return h>=0&&h<=1&&[t[0]+s[0]*h,t[1]+s[1]*h]}var Bt;function Ct(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function kt({x:t,y:e},i,n={x:0,y:0}){return{x:(t-n.x)*Math.cos(i)-(e-n.y)*Math.sin(i)+n.x,y:(t-n.x)*Math.sin(i)+(e-n.y)*Math.cos(i)+n.y}}function Pt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ot(t,e){const i=e?xt(t.angle):t.angle,n=Pt(t);return[kt({x:t.x1,y:t.y1},i,n),kt({x:t.x2,y:t.y1},i,n),kt({x:t.x2,y:t.y2},i,n),kt({x:t.x1,y:t.y2},i,n)]}let Rt,Lt,It,Et;function Dt(t){return Rt=1/0,Lt=1/0,It=-1/0,Et=-1/0,t.forEach((t=>{Rt>t.x&&(Rt=t.x),It<t.x&&(It=t.x),Lt>t.y&&(Lt=t.y),Et<t.y&&(Et=t.y)})),{x1:Rt,y1:Lt,x2:It,y2:Et}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Bt||(Bt={}));const Ft=1e-8;function jt(t,e,i){let n=0,s=t[0];if(!s)return!1;for(let r=1;r<t.length;r++){const a=t[r];n+=Ut(s.x,s.y,a.x,a.y,e,i),s=a}const r=t[0];return Nt(s.x,r.x)&&Nt(s.y,r.y)||(n+=Ut(s.x,s.y,r.x,r.y,e,i)),0!==n}function Ut(t,e,i,n,s,r){if(r>e&&r>n||r<e&&r<n)return 0;if(n===e)return 0;const a=(r-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const l=a*(i-t)+t;return l===s?1/0:l>s?o:0}function Nt(t,e){return Math.abs(t-e)<Ft}const Wt=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function zt(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Gt{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&&globalThis&&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=zt(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:g,limit:f}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(p(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:s,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:g,limit:f,lineHeight:m}}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:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!a,maxLineWidth:o||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){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let s=this._measureSpecialChar(n);l(s)&&Gt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),l(s)&&["F","W"].includes(Wt(n))&&(s=this._measureFullSizeChar()),l(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!l(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!l(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(Wt(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(g(t)){const a=t.filter(h).map((t=>t.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(Gt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Gt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Gt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(Gt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Gt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}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)}}function Vt(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}Gt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Gt.NUMBERS_CHAR_SET="0123456789",Gt.FULL_SIZE_CHAR="字";class Ht{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Ht(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(t=0,e=0,i=0,n=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(t=0,e=0,i=0,n=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(t=0,e=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(t=0){return g(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(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(t=0,e=0,i=0,n=0){const s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[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(t=0,e=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(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Vt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,c=i-e*l-i*o;return[o*n-l*s+h,l*n+o*s+c,o*n-l*a+h,l*n+o*a+c,o*r-l*s+h,l*r+o*s+c,o*r-l*a+h,l*r+o*a+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:a,y2:o}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class Xt extends Ht{}class $t extends Ht{constructor(t,e=0){var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e,i=!1){const n=Ot(t,i),s=Ot(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(Pt(t),Pt(e)),o=r(n[0],n[1]),l=r(n[1],n[2]),h=r(s[0],s[1]),c=r(s[1],s[2]),u=i?xt(t.angle):t.angle;let d=i?xt(90-t.angle):t.angle+st;const p=i?xt(e.angle):e.angle;let g=i?xt(90-e.angle):e.angle+st;d>at&&(d-=at),g>at&&(g-=at);const f=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(Ct(s,i)+Ct(s,n))/2>Ct(s,a)};return f((t.x2-t.x1)/2,u,h,c)&&f((t.y2-t.y1)/2,d,h,c)&&f((e.x2-e.x1)/2,p,o,l)&&f((e.y2-e.y1)/2,g,o,l)}(this,t)}setValue(t=0,e=0,i=0,n=0,s=0){return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new $t(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[kt({x:this.x1,y:this.y1},this.angle,t),kt({x:this.x2,y:this.y1},this.angle,t),kt({x:this.x1,y:this.y2},this.angle,t),kt({x:this.x2,y:this.y2},this.angle,t)]}}class Yt{constructor(t=1,e=0,i=0,n=1,s=0,r=0){this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.e,r=this.f,a=new Yt,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-n*s)/o,a.f=-(t*r-e*s)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,a=(1-n)*i-s*e,o=n*this.a-s*this.b,l=s*this.a+n*this.b,h=n*this.c-s*this.d,c=s*this.c+n*this.d,u=n*this.e-s*this.f+r,d=s*this.e+n*this.f+a;return this.a=o,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,i,n,s,r){return this.multiply(t,e,i,n,s,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const a=this.a,o=this.b,l=this.c,h=this.d,c=a*t+l*e,u=o*t+h*e,d=a*i+l*n,p=o*i+h*n,g=a*s+l*r+this.e,f=o*s+h*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Yt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:s,d:r,e:a,f:o}=this,l=i*r-n*s,h=r/l,c=-n/l,u=-s/l,d=i/l,p=(s*o-r*a)/l,g=-(i*o-n*a)/l,{x:f,y:m}=t;e.x=f*h+m*u+p,e.y=f*c+m*d+g}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Yt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=s/a,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=s/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=_t(r.rotateDeg),r}}function qt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=n,o=s,l=0):60<=t&&t<120?(a=s,o=n,l=0):120<=t&&t<180?(a=0,o=n,l=s):180<=t&&t<240?(a=0,o=s,l=n):240<=t&&t<300?(a=s,o=0,l=n):300<=t&&t<360&&(a=n,o=0,l=s),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Kt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let a=0,o=0,l=0;return a=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(s+n)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const Zt=/^#([0-9a-f]{3,8})$/,Jt={transparent:4294967040},Qt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function te(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ee(t){return y(t)?new ae(t>>16,t>>8&255,255&t,1):g(t)?new ae(t[0],t[1],t[2]):new ae(255,255,255)}function ie(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ne(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const se=(t,e)=>{const i=Zt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new ae((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ee(t):8===e?new ae(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class re{static Brighter(t,e=1){return 1===e?t:new re(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new re(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof re?t:new re(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(h(Jt[t]))return function(t){return y(t)?new ae(t>>>24,t>>>16&255,t>>>8&255,255&t):g(t)?new ae(t[0],t[1],t[2],t[3]):new ae(255,255,255,1)}(Jt[t]);if(h(Qt[t]))return ee(Qt[t]);const e=`${t}`.trim().toLowerCase(),i=se(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new ae(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=qt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new ae(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=re.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new ae(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,s=Kt(this.color.r,this.color.g,this.color.b),r=qt(l(t)?s.h:q(t,0,360),l(e)?s.s:e>=0&&e<=1?100*e:e,l(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new ae(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!l(t)&&(this.color.r=t),!l(e)&&(this.color.g=e),!l(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=se(e,!0);return null!=i?i:this}setColorName(t){const e=Qt[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new re(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ie(t.color.r),this.color.g=ie(t.color.g),this.color.b=ie(t.color.b),this}copyLinearToSRGB(t){return this.color.r=ne(t.color.r),this.color.g=ne(t.color.g),this.color.b=ne(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class ae{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),h(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${te(this.r)+te(this.g)+te(this.b)+(1===this.opacity?"":te(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Kt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var oe=Object.freeze({__proto__:null,Color:re,DEFAULT_COLORS:Qt,RGB:ae,hexToRgb:function(t){let e="",i="",n="";const s="#"===t[0]?1:0;for(let r=s;r<t.length;r++)"#"!==t[r]&&(r<s+2?e+=t[r]:r<s+4?i+=t[r]:r<s+6&&(n+=t[r]));return[parseInt(e,16),parseInt(i,16),parseInt(n,16)]},hslToRgb:qt,interpolateRgb:function(t,e){const i=t.r,n=e.r,s=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+n*t),c=Math.round(s*(1-t)+r*t),u=Math.round(a*(1-t)+o*t);return new ae(e,c,u,l*(1-t)+h*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:Kt});function le(t){return t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()))}var he=6371008.8,ce={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*he,kilometers:6371.0088,kilometres:6371.0088,meters:he,metres:he,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:he/1852,radians:1,yards:6967335.223679999};function ue(t,e){if(!t)return!1;if(!e)return!1;const i="Feature"===(r=e).type?r.geometry:r,n=i.type,s=e.bbox;var r;let a=i.coordinates;if(s&&!0===function(t,e,i){if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let n=e.x1,s=e.x2,r=e.y1,a=e.y2;return n>s&&([n,s]=[s,n]),r>a&&([r,a]=[a,r]),t.x>=n&&t.x<=s&&t.y>=r&&t.y<=a}(t,{x1:s[0],x2:s[1],y1:s[1],y2:s[3]},!0))return!1;"Polygon"===n&&(a=[a]);let o=!1;for(let e=0;e<a.length;++e)for(let i=0;i<a[e].length;++i)if(jt(a[e][i].map((t=>({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function de(t,e,i,n={}){const s=xt(t[0]),r=xt(t[1]),a=xt(i),o=function(t,e){void 0===e&&(e="kilometers");var i=ce[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,n.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:_t(s+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:_t(l)}}class pe extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:i}=function(t){const{xField:e,yField:i,timeField:n,data:s,topN:r=10,icon:a}=t,o=new Set,l=new Map;return s.sort(((t,i)=>Number(i[e])-Number(t[e]))),s.forEach((t=>{const e=t[n];h(e)&&o.add(e),l.has(e)||l.set(e,[]);const s=l.get(e);if(s.length<r){const e=Object.assign({},t);a&&a[e[i]]&&(e.icon=a[e[i]]),s.push(e)}})),{timeData:l,timeNodes:Array.from(o).sort()}}(t),{interval:n,xField:s,yField:r,color:a,icon:o,iconPosition:l,iconShape:c,timeLabel:u,label:d,nameLabel:p,xAxis:g,yAxis:f}=t,m=n||1e3,y=Math.min(m,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(i[0])},{id:"time",values:[{time:i[0]}]}],t.color={specified:Object.assign({},a)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:r,xField:s,seriesField:r,extensionMark:[],label:ge(d,Object.assign(Object.assign({},p),{yField:r}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(n.label=t.label);return[i,n]}(g,f),t.player={type:"continuous",auto:!0,loop:!1,interval:m,specs:i.map((t=>({data:[{id:"timeData",values:e.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:m,exchangeDuration:y}),u&&!1===u.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(u.style)),o){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:fe(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(l,c,{interval:m,exchangeDuration:y});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function ge(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function fe(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class me extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=pe}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}me.type="rankingBar",me.view="singleDefault",me.transformerConstructor=pe;const ye=1e3,be="#21252c",ve={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:be,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:ye,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:ye,easing:"linear"},animationNormal:{interval:ye}},xe="dataKey",_e="VCHART_ORDER",Ae="SUPPLY_DATA_KEY";class Se extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Ae]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[_e]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Ae]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[xe]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.length)}transformSpec(t){var e;super.transformSpec(t),this.isSpecValid(t)?(this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),null===(e=t.customTransformSpec)||void 0===e||e.call(t,t),super.transformSpec(t)):t.series=[]}normalizeSpec(t){(function t(e,i){for(const n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,ve),((t,e)=>{e.forEach((e=>{var i,n,s,r,a,o,l;g(t[e])?null===(i=t[e])||void 0===i||i.forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(n=t[e])||void 0===n?void 0:n.style),{visible:null===(l=null!==(a=null===(r=null===(s=t[e])||void 0===s?void 0:s.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null===(o=t[e])||void 0===o?void 0:o.visible)||void 0===l||l})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,i,n,s,r,a,o,l,h;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(i=this.valueLabelTextMeasure)||void 0===i||i.release(),null===(n=this.orderLabelTextMeasure)||void 0===n||n.release(),this.nameLabelTextMeasure=new Gt({defaultFontParams:null!==(r=null===(s=t.nameLabel)||void 0===s?void 0:s.style)&&void 0!==r?r:{}}),this.valueLabelTextMeasure=new Gt({defaultFontParams:null!==(o=null===(a=t.valueLabel)||void 0===a?void 0:a.style)&&void 0!==o?o:{}}),this.orderLabelTextMeasure=new Gt({defaultFontParams:null!==(h=null===(l=t.orderLabel)||void 0===l?void 0:l.style)&&void 0!==h?h:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[_e]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=B(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=xe,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[Ae]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(n=t.animationUpdate.duration)&&void 0!==n?n:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:xe,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[Ae]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:xe,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[Ae]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:xe,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(_e,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(_e,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[Ae]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:xe,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,_e,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Ae]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:xe,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(_e,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Ae]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:xe,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Ae]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,_e,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const n=this.originalData.map((t=>t[Ae]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["y"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,o,l,h,c,u,d,p,g;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicAttribute("x")}},duration:null!==(l=null===(o=t.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(h=t.animationAppear)||void 0===h?void 0:h.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(d=null===(u=t.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==d?d:1e3,easing:null!==(g=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"linear"})}getAnimationUpdate(t){var e,i,n,s;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class Te extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=Se}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Te.type="rankingList",Te.view="singleDefault",Te.transformerConstructor=Se;const we=(t,e)=>{var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const s=e.fields,r=t[0],a={},o=[];for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const l=s[e];if(l.sort&&(b(l.sortIndex)||(l.sortIndex=0),h(l.sortReverse)||(l.sortReverse="desc"===l.sort)),!l.type){let n=r;e in r||(n=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof n[e]?"linear":"ordinal"}let c;if("number"==typeof l.sortIndex&&(c={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(c)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),c&&(c.sortIndex=t,c.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};const Me={svg:"group",rect:"rect",line:"rule",polygon:"polygon",path:"path",polyline:"line",g:"group",circle:"arc",ellipse:"arc"},Be=Object.keys(Me),Ce=["g","svg","text","tspan","switch"],ke=["font-size","font-family","font-weight","font-style","text-align","text-anchor"],Pe=["visibility","x","y","width","height","d","points","stroke","stroke-width","fill","fill-opacity","stroke-opacity",...ke,"cx","cy","r","cx","cy","rx","ry","x1","x2","y1","y2"],Oe=["visible","fill","stroke","stroke-width","fill-opacity","stroke-opacity",...ke],Re=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;const Le=(t,e={},i)=>{let n=e.customDOMParser;if(n||(null===window||void 0===window?void 0:window.DOMParser)&&(n=t=>(new DOMParser).parseFromString(t,"text/xml")),!n)throw new Error("No Available DOMParser!");const s=n(t);let r=9===s.nodeType?s.firstChild:s;for(;r&&("svg"!==r.nodeName.toLowerCase()||1!==r.nodeType);)r=r.nextSibling;return r?function(t,e={}){const i=[],n=Fe(t,null);let s=parseFloat(t.getAttribute("width")||e.width),r=parseFloat(t.getAttribute("height")||e.height);!b(s)&&(s=null),!b(r)&&(r=null);const a=t.getAttribute("viewBox");let o;if(a){const t=a.match(Re)||[];if(t.length>=4&&(o={x:parseFloat(t[0]||0),y:parseFloat(t[1]||0),width:parseFloat(t[2]),height:parseFloat(t[3])},s||r)){const t={x:0,y:0,width:s,height:r},e=t.width/o.width,i=t.height/o.height,a=Math.min(e,i),l=-(o.x+o.width/2)*a+(t.x+t.width/2),h=-(o.y+o.height/2)*a+(t.y+t.height/2),c=(new Yt).translate(l,h).scale(a,a);n.transform=c}}return Ue(t,n,i),{root:n,width:s,height:r,elements:i,viewBoxRect:o}}(r):null};let Ie=0;function Ee(t){let e;const{parent:i,attributes:n}=t,s=t=>t?Oe.reduce(((e,i)=>{const n=le(i);return h(t[n])&&(e[n]=t[n]),e}),{}):{};return i?(i._inheritStyle||(i._inheritStyle=s(i.attributes)),e=O({},i._inheritStyle,s(n))):e=s(n),e}function De(t){var e,i,n;const s={},r=null!==(e=t.attributes)&&void 0!==e?e:{},a=null!==(i=t.style)&&void 0!==i?i:{};for(let t=0;t<Pe.length;t++){const e=Pe[t],i=h(a[e])&&""!==a[e]?a[e]:null===(n=r[e])||void 0===n?void 0:n.value;h(i)&&(s[le(e)]=isNaN(+i)?i:parseFloat(i))}return"none"===a.display&&(s.visible=!1),["fontSize","strokeWidth","width","height"].forEach((t=>{const e=s[t];p(s[t])&&(s[t]=parseFloat(e))})),s}function Fe(t,e){var i,n,s,r,a;const o=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase();if(3===t.nodeType||"text"===o||"tspan"===o)return function(t,e){var i,n,s,r,a,o;if(!e)return null;const l=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase();if(!l&&"group"!==e.graphicType)return null;const c="text"===l||"tspan"===l,u=c?"group":"text",d=c||null===(n=t.textContent)||void 0===n?void 0:n.replace(/\n/g," ").replace(/\s+/g," ");if(" "===d)return null;let p;return p=c?{tagName:l,graphicType:u,attributes:De(t),parent:e,name:t.getAttribute("name"),id:null!==(s=t.getAttribute("id"))&&void 0!==s?s:`${l}-${Ie++}`,transform:je(t),value:d}:{tagName:l,graphicType:"text",attributes:De(t),parent:e,name:null==e?void 0:e.name,id:null!==(a=null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"id"))&&void 0!==a?a:`${l}-${Ie++}`,value:d},p._inheritStyle=Ee(p),h(p.name)||(p._nameFromParent=null!==(o=e.name)&&void 0!==o?o:e._nameFromParent),c?e._textGroupStyle?p._textGroupStyle=O({},e._textGroupStyle,De(t)):p._textGroupStyle=De(t):p.attributes=p._inheritStyle,p}(t,e);if(!Be.includes(o))return null;const l={tagName:o,graphicType:Me[o],attributes:De(t),parent:e,name:null!==(n=t.getAttribute("name"))&&void 0!==n?n:null===(s=null==e?void 0:e.attributes)||void 0===s?void 0:s.name,id:null!==(r=t.getAttribute("id"))&&void 0!==r?r:`${o}-${Ie++}`,transform:je(t)};return l._inheritStyle=Ee(l),e&&!h(l.name)&&(l._nameFromParent=null!==(a=e.name)&&void 0!==a?a:e._nameFromParent),l}function je(t){var e,i;const n=null===(e=t.transform)||void 0===e?void 0:e.baseVal;if(!n)return null;const s=null===(i=n.consolidate())||void 0===i?void 0:i.matrix;if(!s)return null;const{a:r,b:a,c:o,d:l,e:h,f:c}=s;return new Yt(r,a,o,l,h,c)}function Ue(t,e,i=[]){var n;if(!t)return;let s;"svg"!==t.nodeName&&(s=Fe(t,e)),s&&i.push(s);let r=Ce.includes(null===(n=t.tagName)||void 0===n?void 0:n.toLocaleLowerCase())?t.firstChild:null;for(;r;)Ue(r,null!=s?s:e,i),r=r.nextSibling}let Ne=0;function We(t="dataset"){return Ne>1e8&&(Ne=0),t+"_"+Ne++}class ze{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new s,i=(null==t?void 0:t.name)?t.name:We("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:$.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let n=this._callMap.get(i);n||(n=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,n)})),this._callMap.set(i,n)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const n=this._callMap.get(i);n&&t.forEach((t=>{t.target.removeListener(e,n)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}class Ge{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new s,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(t={})=>{const e=this.latestData;return this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})})),this.isRunning=!1,!1===t.emitMessage||t.skipEqual&&E(e,this.latestData)||this.target.emit("change",{latestData:this.latestData}),this},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:We("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t,e={}){const{pushHistory:i,emitMessage:n,skipEqual:s}=e,r=this.dataSet.getTransform(t.type),a=this.latestData,o=r(a,t.options);this.history&&!1!==i&&this.historyData.push(o),this.latestData=o,!1===n||s&&E(a,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let i=!1;return t instanceof Ge||!0!==(null==e?void 0:e.clone)||(i=!0),i?B(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?O({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!l(this._fields)&&l(i)?(this.dataSet.registerTransform("fields",we),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart)}(this,(function(t,e){"use strict";function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new s(n,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,a=new Array(r);s<r;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,s,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,a),!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,p=c.length;for(h=0;h<p;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,n);break;case 4:c[h].fn.call(c[h].context,e,n,s);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},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||s&&!o.once||n&&o.context!==n||a(this,r);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||s&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(n);var s=i(n.exports);var r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var a=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean");var o=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=t=>"object"==typeof t&&null!==t;var d=function(t){if(!u(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var p=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||r(t,"String")};var g=t=>Array.isArray?Array.isArray(t):r(t,"Array");var f=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var m=t=>r(t,"Date");var y=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||r(t,"Number")};var b=t=>y(t)&&Number.isFinite(t);var v=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var x=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var _=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var S=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function w(t){if(l(t))return!0;if(f(t))return!t.length;const e=_(t);if("Map"===e||"Set"===e)return!t.size;if(S(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}var M=(t,e,i)=>{const n=p(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?i:t};function B(t,e,i){let n;if(!h(t)||"object"!=typeof t||e&&e(t))return t;const s=g(t),r=t.length;n=s?new Array(r):"object"==typeof t?{}:a(t)||y(t)||p(t)?t:m(t)?new Date(+t):void 0;const o=s?void 0:Object.keys(Object(t));let l=-1;if(n)for(;++l<(o||t).length;){const s=o?o[l]:l,r=t[s];i&&i.includes(s.toString())?n[s]=r:n[s]=B(r,e,i)}return n}function C(t,e,i=!1,n=!1){if(e){if(t===e)return;if(h(e)&&"object"==typeof e){const s=Object(e),r=[];for(const t in s)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!h(s[a])||"object"!=typeof s[a]||n&&g(t[a])?P(t,a,s[a]):k(t,e,a,i,n)}}}}function k(t,e,i,n=!1,s=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(g(a)){if(n)o=[];else if(g(r))o=r;else if(f(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else d(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):l=!1;l&&C(o,a,n,s),P(t,i,o)}function P(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function O(t,...e){let i=-1;const n=e.length;for(;++i<n;)C(t,e[i],!0);return t}function R(t,e){if(!t||!d(t))return t;const i={};return Object.keys(t).forEach((n=>{const s=t[n];let r=!1;e.forEach((t=>{(p(t)&&t===n||t instanceof RegExp&&n.match(t))&&(r=!0)})),r||(i[n]=s)})),i}function L(t){return Object.prototype.toString.call(t)}function I(t){return Object.keys(t)}function E(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(L(t)!==L(e))return!1;if(o(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let n=t.length-1;n>=0;n--)if(!E(t[n],e[n],i))return!1;return!0}if(!d(t))return!1;const n=I(t),s=I(e);if(n.length!==s.length)return!1;n.sort(),s.sort();for(let t=n.length-1;t>=0;t--)if(n[t]!=s[t])return!1;for(let s=n.length-1;s>=0;s--){const r=n[s];if(!E(t[r],e[r],i))return!1}return!0}function D(t,e,i){const n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e);for(let s=0;s<n.length;s++){const r=n[s];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function F(t,e,i=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const n=Object.getOwnPropertyNames(e);for(let s=0;s<n.length;s++){const r=n[s];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else D(t,e,i)}function j(t){return h(t)?g(t)?t:[t]:[]}const U=(t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)<0&&(n=r)}return n};function N(t,e){if(!g(t)||!g(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function W(t){if(!g(t))return[t];const e=[];for(const i of t)e.push(...W(i));return e}function z(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function G(t){return Number(t)}const V="undefined"!=typeof console;function H(t,e,i){const n=[e].concat([].slice.call(i));V&&console[t].apply(console,n)}var X;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(X||(X={}));class ${static getInstance(t,e){return $._instance&&y(t)?$._instance.level(t):$._instance||($._instance=new $(t,e)),$._instance}static setInstance(t){return $._instance=t}static setInstanceLevel(t){$._instance?$._instance.level(t):$._instance=new $(t)}static clearInstance(){$._instance=null}constructor(t=X.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=X.Info}canLogDebug(){return this._level>=X.Debug}canLogError(){return this._level>=X.Error}canLogWarn(){return this._level>=X.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=X.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):H(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=X.Warn&&H(this._method||"warn","WARN",t),this}info(...t){return this._level>=X.Info&&H(this._method||"log","INFO",t),this}debug(...t){return this._level>=X.Debug&&H(this._method||"log","DEBUG",t),this}}$._instance=null;const Y=t=>{let e=null,i=null;return(...n)=>(e&&n.every(((t,i)=>t===e[i]))||(e=n,i=t(...n)),i)};var q=function(t,e,i){return t<e?e:t>i?i:t};function K(t,e){return i=>t*(1-i)+e*i}function Z(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const J=t=>e=>M(e,t),Q=(t,e={})=>{if(o(t))return t;const i=[t];return(e&&e.get||J)(i)},tt=t=>t?"string"==typeof t||"number"==typeof t?()=>t:o(t)?t:e=>e[t.field]:null,et=(t,e)=>{const i=o(e)?e:t=>t;let n,s;if(t&&t.length){const e=t.length;for(let r=0;r<e;r+=1){let e=i(t[r]);l(e)||!y(e=+e)||Number.isNaN(e)||(l(n)?(n=e,s=e):(n=Math.min(n,e),s=Math.max(s,e)))}return[n,s]}return[n,s]},it=1e-12,nt=Math.PI,st=nt/2,rt=2*nt,at=2*Math.PI,ot=Math.abs,lt=Math.atan2,ht=Math.cos,ct=Math.max,ut=Math.min,dt=Math.sin,pt=Math.sqrt,gt=Math.pow;function ft(t){return t>=1?st:t<=-1?-st:Math.asin(t)}function mt(t,e,i,n,s){let r=i,a=n;return"number"==typeof t&&"number"==typeof i&&(r=(1-s)*t+s*i),"number"==typeof e&&"number"==typeof n&&(a=(1-s)*e+s*n),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}class bt{constructor(t=0,e=0,i,n){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new bt(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 y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(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 vt{static distancePP(t,e){return pt(gt(t.x-e.x,2)+gt(t.y-e.y,2))}static distanceNN(t,e,i,n){return pt(gt(t-i,2)+gt(e-n,2))}static distancePN(t,e,i){return pt(gt(e-t.x,2)+gt(i-t.y,2))}static pointAtPP(t,e,i){return new bt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function xt(t){return t*(Math.PI/180)}function _t(t){return 180*t/Math.PI}const At=(t=0)=>{if(t<0)for(;t<-rt;)t+=rt;else if(t>0)for(;t>rt;)t-=rt;return t};function St(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Tt(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function wt(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function Mt(t,e,i,n){if(!function(t,e,i,n){let s=t[0],r=e[0],a=i[0],o=n[0];return r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),!(r<a||o<s||(s=t[1],r=e[1],a=i[1],o=n[1],r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),r<a||o<s))}(t,e,i,n))return!1;const s=[0,0],r=[0,0],a=[0,0];if(wt(s,e,t),wt(r,n,i),ot((o=s)[0]-(l=r)[0])+ot(o[1]-l[1])<1e-12)return!0;var o,l;wt(a,i,t);const h=yt(a,r)/yt(s,r);return h>=0&&h<=1&&[t[0]+s[0]*h,t[1]+s[1]*h]}var Bt;function Ct(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function kt({x:t,y:e},i,n={x:0,y:0}){return{x:(t-n.x)*Math.cos(i)-(e-n.y)*Math.sin(i)+n.x,y:(t-n.x)*Math.sin(i)+(e-n.y)*Math.cos(i)+n.y}}function Pt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ot(t,e){const i=e?xt(t.angle):t.angle,n=Pt(t);return[kt({x:t.x1,y:t.y1},i,n),kt({x:t.x2,y:t.y1},i,n),kt({x:t.x2,y:t.y2},i,n),kt({x:t.x1,y:t.y2},i,n)]}let Rt,Lt,It,Et;function Dt(t){return Rt=1/0,Lt=1/0,It=-1/0,Et=-1/0,t.forEach((t=>{Rt>t.x&&(Rt=t.x),It<t.x&&(It=t.x),Lt>t.y&&(Lt=t.y),Et<t.y&&(Et=t.y)})),{x1:Rt,y1:Lt,x2:It,y2:Et}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Bt||(Bt={}));const Ft=1e-8;function jt(t,e,i){let n=0,s=t[0];if(!s)return!1;for(let r=1;r<t.length;r++){const a=t[r];n+=Ut(s.x,s.y,a.x,a.y,e,i),s=a}const r=t[0];return Nt(s.x,r.x)&&Nt(s.y,r.y)||(n+=Ut(s.x,s.y,r.x,r.y,e,i)),0!==n}function Ut(t,e,i,n,s,r){if(r>e&&r>n||r<e&&r<n)return 0;if(n===e)return 0;const a=(r-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const l=a*(i-t)+t;return l===s?1/0:l>s?o:0}function Nt(t,e){return Math.abs(t-e)<Ft}const Wt=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function zt(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Gt{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&&globalThis&&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=zt(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:g,limit:f}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(p(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:s,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:g,limit:f,lineHeight:m}}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:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!a,maxLineWidth:o||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){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let s=this._measureSpecialChar(n);l(s)&&Gt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),l(s)&&["F","W"].includes(Wt(n))&&(s=this._measureFullSizeChar()),l(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!l(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!l(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(Wt(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(g(t)){const a=t.filter(h).map((t=>t.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(Gt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Gt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Gt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(Gt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Gt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}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)}}function Vt(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}Gt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Gt.NUMBERS_CHAR_SET="0123456789",Gt.FULL_SIZE_CHAR="字";class Ht{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Ht(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(t=0,e=0,i=0,n=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(t=0,e=0,i=0,n=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(t=0,e=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(t=0){return g(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(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(t=0,e=0,i=0,n=0){const s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[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(t=0,e=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(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Vt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,c=i-e*l-i*o;return[o*n-l*s+h,l*n+o*s+c,o*n-l*a+h,l*n+o*a+c,o*r-l*s+h,l*r+o*s+c,o*r-l*a+h,l*r+o*a+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:a,y2:o}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class Xt extends Ht{}class $t extends Ht{constructor(t,e=0){var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e,i=!1){const n=Ot(t,i),s=Ot(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(Pt(t),Pt(e)),o=r(n[0],n[1]),l=r(n[1],n[2]),h=r(s[0],s[1]),c=r(s[1],s[2]),u=i?xt(t.angle):t.angle;let d=i?xt(90-t.angle):t.angle+st;const p=i?xt(e.angle):e.angle;let g=i?xt(90-e.angle):e.angle+st;d>at&&(d-=at),g>at&&(g-=at);const f=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(Ct(s,i)+Ct(s,n))/2>Ct(s,a)};return f((t.x2-t.x1)/2,u,h,c)&&f((t.y2-t.y1)/2,d,h,c)&&f((e.x2-e.x1)/2,p,o,l)&&f((e.y2-e.y1)/2,g,o,l)}(this,t)}setValue(t=0,e=0,i=0,n=0,s=0){return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new $t(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[kt({x:this.x1,y:this.y1},this.angle,t),kt({x:this.x2,y:this.y1},this.angle,t),kt({x:this.x1,y:this.y2},this.angle,t),kt({x:this.x2,y:this.y2},this.angle,t)]}}class Yt{constructor(t=1,e=0,i=0,n=1,s=0,r=0){this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.e,r=this.f,a=new Yt,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-n*s)/o,a.f=-(t*r-e*s)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,a=(1-n)*i-s*e,o=n*this.a-s*this.b,l=s*this.a+n*this.b,h=n*this.c-s*this.d,c=s*this.c+n*this.d,u=n*this.e-s*this.f+r,d=s*this.e+n*this.f+a;return this.a=o,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,i,n,s,r){return this.multiply(t,e,i,n,s,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const a=this.a,o=this.b,l=this.c,h=this.d,c=a*t+l*e,u=o*t+h*e,d=a*i+l*n,p=o*i+h*n,g=a*s+l*r+this.e,f=o*s+h*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Yt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:s,d:r,e:a,f:o}=this,l=i*r-n*s,h=r/l,c=-n/l,u=-s/l,d=i/l,p=(s*o-r*a)/l,g=-(i*o-n*a)/l,{x:f,y:m}=t;e.x=f*h+m*u+p,e.y=f*c+m*d+g}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Yt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=s/a,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=s/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=_t(r.rotateDeg),r}}function qt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=n,o=s,l=0):60<=t&&t<120?(a=s,o=n,l=0):120<=t&&t<180?(a=0,o=n,l=s):180<=t&&t<240?(a=0,o=s,l=n):240<=t&&t<300?(a=s,o=0,l=n):300<=t&&t<360&&(a=n,o=0,l=s),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Kt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let a=0,o=0,l=0;return a=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(s+n)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const Zt=/^#([0-9a-f]{3,8})$/,Jt={transparent:4294967040},Qt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function te(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ee(t){return y(t)?new ae(t>>16,t>>8&255,255&t,1):g(t)?new ae(t[0],t[1],t[2]):new ae(255,255,255)}function ie(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ne(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const se=(t,e)=>{const i=Zt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new ae((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ee(t):8===e?new ae(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class re{static Brighter(t,e=1){return 1===e?t:new re(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new re(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof re?t:new re(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(h(Jt[t]))return function(t){return y(t)?new ae(t>>>24,t>>>16&255,t>>>8&255,255&t):g(t)?new ae(t[0],t[1],t[2],t[3]):new ae(255,255,255,1)}(Jt[t]);if(h(Qt[t]))return ee(Qt[t]);const e=`${t}`.trim().toLowerCase(),i=se(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new ae(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=qt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new ae(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=re.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new ae(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,s=Kt(this.color.r,this.color.g,this.color.b),r=qt(l(t)?s.h:q(t,0,360),l(e)?s.s:e>=0&&e<=1?100*e:e,l(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new ae(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!l(t)&&(this.color.r=t),!l(e)&&(this.color.g=e),!l(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=se(e,!0);return null!=i?i:this}setColorName(t){const e=Qt[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new re(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ie(t.color.r),this.color.g=ie(t.color.g),this.color.b=ie(t.color.b),this}copyLinearToSRGB(t){return this.color.r=ne(t.color.r),this.color.g=ne(t.color.g),this.color.b=ne(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class ae{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),h(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${te(this.r)+te(this.g)+te(this.b)+(1===this.opacity?"":te(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Kt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var oe=Object.freeze({__proto__:null,Color:re,DEFAULT_COLORS:Qt,RGB:ae,hexToRgb:function(t){let e="",i="",n="";const s="#"===t[0]?1:0;for(let r=s;r<t.length;r++)"#"!==t[r]&&(r<s+2?e+=t[r]:r<s+4?i+=t[r]:r<s+6&&(n+=t[r]));return[parseInt(e,16),parseInt(i,16),parseInt(n,16)]},hslToRgb:qt,interpolateRgb:function(t,e){const i=t.r,n=e.r,s=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+n*t),c=Math.round(s*(1-t)+r*t),u=Math.round(a*(1-t)+o*t);return new ae(e,c,u,l*(1-t)+h*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:Kt});function le(t){return t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()))}var he=6371008.8,ce={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*he,kilometers:6371.0088,kilometres:6371.0088,meters:he,metres:he,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:he/1852,radians:1,yards:6967335.223679999};function ue(t,e){if(!t)return!1;if(!e)return!1;const i="Feature"===(r=e).type?r.geometry:r,n=i.type,s=e.bbox;var r;let a=i.coordinates;if(s&&!0===function(t,e,i){if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let n=e.x1,s=e.x2,r=e.y1,a=e.y2;return n>s&&([n,s]=[s,n]),r>a&&([r,a]=[a,r]),t.x>=n&&t.x<=s&&t.y>=r&&t.y<=a}(t,{x1:s[0],x2:s[1],y1:s[1],y2:s[3]},!0))return!1;"Polygon"===n&&(a=[a]);let o=!1;for(let e=0;e<a.length;++e)for(let i=0;i<a[e].length;++i)if(jt(a[e][i].map((t=>({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function de(t,e,i,n={}){const s=xt(t[0]),r=xt(t[1]),a=xt(i),o=function(t,e){void 0===e&&(e="kilometers");var i=ce[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,n.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:_t(s+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:_t(l)}}class pe extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:i}=function(t){const{xField:e,yField:i,timeField:n,data:s,topN:r=10,icon:a}=t,o=new Set,l=new Map;return s.sort(((t,i)=>Number(i[e])-Number(t[e]))),s.forEach((t=>{const e=t[n];h(e)&&o.add(e),l.has(e)||l.set(e,[]);const s=l.get(e);if(s.length<r){const e=Object.assign({},t);a&&a[e[i]]&&(e.icon=a[e[i]]),s.push(e)}})),{timeData:l,timeNodes:Array.from(o).sort()}}(t),{interval:n,xField:s,yField:r,color:a,icon:o,iconPosition:l,iconShape:c,timeLabel:u,label:d,nameLabel:p,xAxis:g,yAxis:f}=t,m=n||1e3,y=Math.min(m,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(i[0])},{id:"time",values:[{time:i[0]}]}],t.color={specified:Object.assign({},a)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:r,xField:s,seriesField:r,extensionMark:[],label:ge(d,Object.assign(Object.assign({},p),{yField:r}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(n.label=t.label);return[i,n]}(g,f),t.player={type:"continuous",auto:!0,loop:!1,interval:m,specs:i.map((t=>({data:[{id:"timeData",values:e.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:m,exchangeDuration:y}),u&&!1===u.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(u.style)),o){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:fe(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(l,c,{interval:m,exchangeDuration:y});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function ge(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function fe(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class me extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=pe}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}me.type="rankingBar",me.view="singleDefault",me.transformerConstructor=pe;const ye=1e3,be="#21252c",ve={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:be,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:be,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:ye,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:ye,easing:"linear"},animationNormal:{interval:ye}},xe="dataKey",_e="VCHART_ORDER",Ae="SUPPLY_DATA_KEY";class Se extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Ae]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[_e]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Ae]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[xe]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.length)}transformSpec(t){var e;super.transformSpec(t),this.isSpecValid(t)?(this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),null===(e=t.customTransformSpec)||void 0===e||e.call(t,t),super.transformSpec(t)):t.series=[]}normalizeSpec(t){(function t(e,i){for(const n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,ve),((t,e)=>{e.forEach((e=>{var i,n,s,r,a,o,l;g(t[e])?null===(i=t[e])||void 0===i||i.forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(n=t[e])||void 0===n?void 0:n.style),{visible:null===(l=null!==(a=null===(r=null===(s=t[e])||void 0===s?void 0:s.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null===(o=t[e])||void 0===o?void 0:o.visible)||void 0===l||l})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,i,n,s,r,a,o,l,h;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(i=this.valueLabelTextMeasure)||void 0===i||i.release(),null===(n=this.orderLabelTextMeasure)||void 0===n||n.release(),this.nameLabelTextMeasure=new Gt({defaultFontParams:null!==(r=null===(s=t.nameLabel)||void 0===s?void 0:s.style)&&void 0!==r?r:{}}),this.valueLabelTextMeasure=new Gt({defaultFontParams:null!==(o=null===(a=t.valueLabel)||void 0===a?void 0:a.style)&&void 0!==o?o:{}}),this.orderLabelTextMeasure=new Gt({defaultFontParams:null!==(h=null===(l=t.orderLabel)||void 0===l?void 0:l.style)&&void 0!==h?h:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[_e]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=B(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=xe,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[Ae]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(n=t.animationUpdate.duration)&&void 0!==n?n:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:xe,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[Ae]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:xe,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[Ae]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:xe,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(_e,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(_e,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[Ae]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:xe,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,_e,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Ae]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:xe,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(_e,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Ae]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:xe,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Ae]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,_e,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const n=this.originalData.map((t=>t[Ae]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,o,l,h,c,u,d,p,g;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicAttribute("x")}},duration:null!==(l=null===(o=t.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(h=t.animationAppear)||void 0===h?void 0:h.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(d=null===(u=t.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==d?d:1e3,easing:null!==(g=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"linear"})}getAnimationUpdate(t){var e,i,n,s;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class Te extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=Se}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Te.type="rankingList",Te.view="singleDefault",Te.transformerConstructor=Se;const we=(t,e)=>{var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const s=e.fields,r=t[0],a={},o=[];for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const l=s[e];if(l.sort&&(b(l.sortIndex)||(l.sortIndex=0),h(l.sortReverse)||(l.sortReverse="desc"===l.sort)),!l.type){let n=r;e in r||(n=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof n[e]?"linear":"ordinal"}let c;if("number"==typeof l.sortIndex&&(c={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(c)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),c&&(c.sortIndex=t,c.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};const Me={svg:"group",rect:"rect",line:"rule",polygon:"polygon",path:"path",polyline:"line",g:"group",circle:"arc",ellipse:"arc"},Be=Object.keys(Me),Ce=["g","svg","text","tspan","switch"],ke=["font-size","font-family","font-weight","font-style","text-align","text-anchor"],Pe=["visibility","x","y","width","height","d","points","stroke","stroke-width","fill","fill-opacity","stroke-opacity",...ke,"cx","cy","r","cx","cy","rx","ry","x1","x2","y1","y2"],Oe=["visible","fill","stroke","stroke-width","fill-opacity","stroke-opacity",...ke],Re=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;const Le=(t,e={},i)=>{let n=e.customDOMParser;if(n||(null===window||void 0===window?void 0:window.DOMParser)&&(n=t=>(new DOMParser).parseFromString(t,"text/xml")),!n)throw new Error("No Available DOMParser!");const s=n(t);let r=9===s.nodeType?s.firstChild:s;for(;r&&("svg"!==r.nodeName.toLowerCase()||1!==r.nodeType);)r=r.nextSibling;return r?function(t,e={}){const i=[],n=Fe(t,null);let s=parseFloat(t.getAttribute("width")||e.width),r=parseFloat(t.getAttribute("height")||e.height);!b(s)&&(s=null),!b(r)&&(r=null);const a=t.getAttribute("viewBox");let o;if(a){const t=a.match(Re)||[];if(t.length>=4&&(o={x:parseFloat(t[0]||0),y:parseFloat(t[1]||0),width:parseFloat(t[2]),height:parseFloat(t[3])},s||r)){const t={x:0,y:0,width:s,height:r},e=t.width/o.width,i=t.height/o.height,a=Math.min(e,i),l=-(o.x+o.width/2)*a+(t.x+t.width/2),h=-(o.y+o.height/2)*a+(t.y+t.height/2),c=(new Yt).translate(l,h).scale(a,a);n.transform=c}}return Ue(t,n,i),{root:n,width:s,height:r,elements:i,viewBoxRect:o}}(r):null};let Ie=0;function Ee(t){let e;const{parent:i,attributes:n}=t,s=t=>t?Oe.reduce(((e,i)=>{const n=le(i);return h(t[n])&&(e[n]=t[n]),e}),{}):{};return i?(i._inheritStyle||(i._inheritStyle=s(i.attributes)),e=O({},i._inheritStyle,s(n))):e=s(n),e}function De(t){var e,i,n;const s={},r=null!==(e=t.attributes)&&void 0!==e?e:{},a=null!==(i=t.style)&&void 0!==i?i:{};for(let t=0;t<Pe.length;t++){const e=Pe[t],i=h(a[e])&&""!==a[e]?a[e]:null===(n=r[e])||void 0===n?void 0:n.value;h(i)&&(s[le(e)]=isNaN(+i)?i:parseFloat(i))}return"none"===a.display&&(s.visible=!1),["fontSize","strokeWidth","width","height"].forEach((t=>{const e=s[t];p(s[t])&&(s[t]=parseFloat(e))})),s}function Fe(t,e){var i,n,s,r,a;const o=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase();if(3===t.nodeType||"text"===o||"tspan"===o)return function(t,e){var i,n,s,r,a,o;if(!e)return null;const l=null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase();if(!l&&"group"!==e.graphicType)return null;const c="text"===l||"tspan"===l,u=c?"group":"text",d=c||null===(n=t.textContent)||void 0===n?void 0:n.replace(/\n/g," ").replace(/\s+/g," ");if(" "===d)return null;let p;return p=c?{tagName:l,graphicType:u,attributes:De(t),parent:e,name:t.getAttribute("name"),id:null!==(s=t.getAttribute("id"))&&void 0!==s?s:`${l}-${Ie++}`,transform:je(t),value:d}:{tagName:l,graphicType:"text",attributes:De(t),parent:e,name:null==e?void 0:e.name,id:null!==(a=null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"id"))&&void 0!==a?a:`${l}-${Ie++}`,value:d},p._inheritStyle=Ee(p),h(p.name)||(p._nameFromParent=null!==(o=e.name)&&void 0!==o?o:e._nameFromParent),c?e._textGroupStyle?p._textGroupStyle=O({},e._textGroupStyle,De(t)):p._textGroupStyle=De(t):p.attributes=p._inheritStyle,p}(t,e);if(!Be.includes(o))return null;const l={tagName:o,graphicType:Me[o],attributes:De(t),parent:e,name:null!==(n=t.getAttribute("name"))&&void 0!==n?n:null===(s=null==e?void 0:e.attributes)||void 0===s?void 0:s.name,id:null!==(r=t.getAttribute("id"))&&void 0!==r?r:`${o}-${Ie++}`,transform:je(t)};return l._inheritStyle=Ee(l),e&&!h(l.name)&&(l._nameFromParent=null!==(a=e.name)&&void 0!==a?a:e._nameFromParent),l}function je(t){var e,i;const n=null===(e=t.transform)||void 0===e?void 0:e.baseVal;if(!n)return null;const s=null===(i=n.consolidate())||void 0===i?void 0:i.matrix;if(!s)return null;const{a:r,b:a,c:o,d:l,e:h,f:c}=s;return new Yt(r,a,o,l,h,c)}function Ue(t,e,i=[]){var n;if(!t)return;let s;"svg"!==t.nodeName&&(s=Fe(t,e)),s&&i.push(s);let r=Ce.includes(null===(n=t.tagName)||void 0===n?void 0:n.toLocaleLowerCase())?t.firstChild:null;for(;r;)Ue(r,null!=s?s:e,i),r=r.nextSibling}let Ne=0;function We(t="dataset"){return Ne>1e8&&(Ne=0),t+"_"+Ne++}class ze{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new s,i=(null==t?void 0:t.name)?t.name:We("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:$.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let n=this._callMap.get(i);n||(n=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,n)})),this._callMap.set(i,n)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const n=this._callMap.get(i);n&&t.forEach((t=>{t.target.removeListener(e,n)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}class Ge{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new s,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(t={})=>{const e=this.latestData;return this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})})),this.isRunning=!1,!1===t.emitMessage||t.skipEqual&&E(e,this.latestData)||this.target.emit("change",{latestData:this.latestData}),this},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:We("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t,e={}){const{pushHistory:i,emitMessage:n,skipEqual:s}=e,r=this.dataSet.getTransform(t.type),a=this.latestData,o=r(a,t.options);this.history&&!1!==i&&this.historyData.push(o),this.latestData=o,!1===n||s&&E(a,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let i=!1;return t instanceof Ge||!0!==(null==e?void 0:e.clone)||(i=!0),i?B(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?O({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!l(this._fields)&&l(i)?(this.dataSet.registerTransform("fields",we),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Ve(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}const He={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},Xe={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},$e={fill:"#606773",fontSize:12},Ye={fill:"#eff1f9"};class qe extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Ve(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=Ke(s,i),a=Ke(n,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=Ve(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},Ye),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function Ke(t,i){if(0===(null==t?void 0:t.length))return null;const{line:n,symbol:s,text:r,margin:a}=i,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,n=Ve(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},He),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=Ze(t,i,e),n}})})}(n,a);c&&l.push(c);const u=function(t={},e){const{style:i={}}=t,n=Ve(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},Xe),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=Ze(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=Ze(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(s,a);u&&l.push(u);const d=function(t={},e){const{style:i={},formatMethod:n,textMargin:s=4}=t,r=Ve(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},$e),{text:(t,e)=>{var i,s,r,a,l,h,c;const{text:u}=t;let d=u;if(o(n)){const{vchart:o}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(r=null===(s=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==r?r:[],y=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));d=n(u,{arrow:t,from:b,to:v})}return d},x:(t,i)=>{var n,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-s:s))&&void 0!==r?r:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(r,a);return d&&l.push(d),h.children=l,h}function Ze(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(d&&d.length){const n=p.find((t=>t[u]===d[h][u])),s=p.find((t=>t[u]===d[c][u])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?n[1]:n[0],_=m/(u+1),A=v/(d+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-s*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:T},{x:y.x-s*w,y:T}];return M}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function Je(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function Qe(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const ti=(t,e)=>{var i,n,s;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>b(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(n=ei(o))&&void 0!==n?n:[],...null!==(s=ei(l))&&void 0!==s?s:[]]};function ei(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(h(n)){const e=n.toArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((i=>{var n;const s=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)>0&&(n=r)}return n})(s,((t,e)=>t.layout.level-e.layout.level));let a=null!==(n=null==r?void 0:r.layout.level)&&void 0!==n?n:0;for(;a>=0;){if(s.some((t=>t.layout.level===a&&Je(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ii(i,e.get(i.from).totalArrows),i.layout.toIndex=ii(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ii(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class ni extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=qe}}ni.type="conversionFunnel",ni.transformerConstructor=qe;class si extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new Ge(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",ti),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const ri="dataKey";class ai extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[ri]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=ri,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"==t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class oi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=ai}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}oi.type="sequenceScatterLink",oi.view="singleDefault",oi.transformerConstructor=ai;const li=.2;function hi(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const ci="dataKey";class ui extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[ci]:e}))),s=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),s=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),o=n.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*li,p=c-(u-c)*li;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=hi(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=n.length*r*r,s.push({x:e,y:o,kde:l,label:t})}})),s}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:s}]})})),e}(t);t.type="common",t.dataKey=ci,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class di extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=ui}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}di.type="sequenceScatterKDE",di.view="singleDefault",di.transformerConstructor=ui;const pi="dataKey";function gi(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");if(!s)throw new Error("Failed to get 2D rendering context from canvas");const r=s.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const s=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*s[0]),r.data[a+1]=Math.round(255*s[1]),r.data[a+2]=Math.round(255*s[2]),r.data[a+3]=255}return s.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[pi]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class fi extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=gi(t);t.type="common",t.dataKey=pi,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class mi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=fi}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}mi.type="sequenceScatterPixel",mi.view="singleDefault",mi.transformerConstructor=fi;class yi extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var bi,vi,xi,_i,Ai;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(bi||(bi={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(vi||(vi={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(xi||(xi={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(_i||(_i={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(Ai||(Ai={}));class Si{static GenAutoIncrementId(){return Si.auto_increment_id++}}Si.auto_increment_id=0;class Ti{constructor(t){this.id=Si.GenAutoIncrementId(),this.registry=t}}const wi="named",Mi="inject",Bi="inversify:tagged",Ci="inversify:paramtypes";class ki{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===wi?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Pi=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=f(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function Oi(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};Pi.hasOwnMetadata(t,e)&&(r=Pi.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,Pi.defineMetadata(t,r,e)}(Bi,t,i.toString(),n)}function Ri(t){return(e,i,n)=>{Oi(e,0,n,t)}}const Li=(Ii=Mi,t=>(e,i,n)=>Ri(new ki(Ii,t))(e,i,n));var Ii;function Ei(){return function(t){return Pi.defineMetadata(Ci,null,t),t}}function Di(t){return Ri(new ki(wi,t))}const Fi="Singleton",ji="Transient",Ui="ConstantValue",Ni="DynamicValue",Wi="Factory",zi="Function",Gi="Instance",Vi="Invalid";class Hi{constructor(t,e){this.id=Si.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Vi,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Fi&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class Xi{getConstructorMetadata(t){return{compilerGeneratedMetadata:Pi.getMetadata(Ci,t),userGeneratedMetadata:Pi.getMetadata(Bi,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const $i=(Yi=wi,t=>{const e=e=>{if(null==e)return!1;if(e.key===Yi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===Yi&&i[e].value===t)return!0;return!1};return e.metaData=new ki(Yi,t),e});var Yi;class qi{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Fi,this}inTransientScope(){return this._binding.scope=ji,this}whenTargetNamed(t){return this._binding.constraint=$i(t),this}}class Ki{constructor(t){this._binding=t}to(t){return this._binding.type=Gi,this._binding.implementationType=t,new qi(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Ni,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new qi(this._binding)}toConstantValue(t){return this._binding.type=Ui,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Fi,new qi(this._binding)}toFactory(t){return this._binding.type=Wi,this._binding.factory=t,this._binding.scope=Fi,new qi(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Zi=Symbol("ContributionProvider");class Ji{constructor(t,e){this.serviceIdentifier=t,this.container=e,tn.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function Qi(t,e){t(Zi).toDynamicValue((({container:t})=>new Ji(e,t))).inSingletonScope().whenTargetNamed(e)}class tn{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}tn.store=new Map;class en{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class nn extends en{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const sn=new class{};let rn=0;var an,on,ln,hn;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(an||(an={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(on||(on={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(ln||(ln={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(hn||(hn={}));const cn=rt-1e-8;class un{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>cn)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(g(n),g(s),s!==n)if((n%=rt)<0&&(n+=rt),(s%=rt)<0&&(s+=rt),s<n&&(r=!r,a=n,n=s,s=a),r)for(s-=rt,a=n-n%st,o=0;o<4&&a>s;++o,a-=st)g(a);else for(a=n-n%st+st,o=0;o<4&&a<s;++o,a+=st)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class dn{constructor(){this._curves=[],this.bounds=new Xt}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const pn=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,gn={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},fn={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let mn,yn,bn,vn,xn,_n;var An,Sn,Tn,wn,Mn,Bn;function Cn(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),y=.5*(s-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,u*x+d*_,h*T+c*w,u*T+d*w,h*A+c*S,u*A+d*S]}function kn(t,e,i,n){const s=function(t,e,i,n,s,r,a,o,l){const h=xt(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let g=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),i*=g,n*=g);const f=u/i,m=c/i,y=-c/n,b=u/n,v=f*o+m*l,x=y*o+b*l,_=f*t+m*e,A=y*t+b*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===s&&(T=-T);const w=.5*(v+_)-T*(A-x),M=.5*(x+A)+T*(_-v),B=Math.atan2(x-M,v-w);let C=Math.atan2(A-M,_-w)-B;C<0&&1===r?C+=rt:C>0&&0===r&&(C-=rt);const k=Math.ceil(Math.abs(C/(st+.001))),P=[];for(let t=0;t<k;++t){const e=B+t*C/k,s=B+(t+1)*C/k;P[t]=[w,M,e,s,i,n,c,u]}return P}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=Cn(s[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[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"}(An||(An={})),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"}(Sn||(Sn={})),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"}(Tn||(Tn={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(wn||(wn={})),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"}(Mn||(Mn={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Bn||(Bn={}));const Pn=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function On(t,e,i=0,n=0,s=1,r=1,a){for(let o=0;o<t.length;o++){const l=t[o];Pn[l[0]](l,e,i,n,s,r,a)}}class Rn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ln(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],a=e[s],o=t[(s+1)%n],l=e[(s+1)%n];i+=vt.distanceNN(r,a,o,l)}return i/2}function In(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function En(t,e,i,n,s){const r=In(t.x,e.x,i.x,n.x,s),a=In(t.y,e.y,i.y,n.y,s);return new bt(r,a)}function Dn(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function Fn(t,e,i,n){const s=Dn(t.x,e.x,i.x,n),r=Dn(t.y,e.y,i.y,n);return new bt(s,r)}function jn(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,a=En(i,n,s,r,e),o=vt.pointAtPP(i,n,e),l=vt.pointAtPP(n,s,e),h=vt.pointAtPP(s,r,e),c=vt.pointAtPP(o,l,e),u=vt.pointAtPP(l,h,e);return[new Un(i,o,c,a),new Un(a,u,h,r)]}class Un extends Rn{constructor(t,e,i,n){super(),this.type=Mn.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_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 En(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,n=this.p3,Ln([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===wn.ROW?ot(this.p0.x-this.p3.x):t===wn.COLUMN?ot(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return lt(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[a]=jn(this,r);t.bezierCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i,a.p3.x*n+e,a.p3.y*s+i)}}includeX(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Nn extends Rn{constructor(t,e){super(),this.type=Mn.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return vt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=lt(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()?vt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===wn.ROW?ot(this.p0.x-this.p1.x):t===wn.COLUMN?ot(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*n+e,a.y*s+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class Wn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,s,r,a,o){const l=new Un(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n),new bt(s,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=s,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,s){const r=new Nn(new bt(this._lastX,this._lastY),new bt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===wn.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return ot(t.p0.y-n.y)}if(t===wn.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return ot(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class zn extends Wn{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Gn(t,e,i=1){let n=!1;for(let i=0,s=e.length;i<=s;i++)i>=s===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function Vn(t,e,i){const n=null!=e?e:ot(i[i.length-1].x-i[0].x)>ot(i[i.length-1].y-i[0].y)?wn.ROW:wn.COLUMN;return"monotoneY"===t?new zn(t,n):new Wn(t,n)}class Hn{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Xn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Vn("linear",i,t);return function(t,e){Gn(t,e,1)}(new Hn(s,n),t),s}function $n(t,e,i,n,s){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class Yn{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&&$n(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:$n(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function qn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Xn(t,e);const s=Vn("basis",i,t);return function(t,e){Gn(t,e,2)}(new Yn(s,n),t),s}function Kn(t){return t<0?-1:1}function Zn(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(Kn(r)+Kn(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Jn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Qn(t,e,i,n,s){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,n,t.lastPoint1)}class ts{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._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Qn(this,this._t0,Jn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Qn(this,Jn(this,e=Zn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Qn(this,this._t0,e=Zn(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class es extends ts{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function is(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Xn(t,e);const s=Vn("monotoneX",i,t);return function(t,e){Gn(t,e,2)}(new ts(s,n),t),s}function ns(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Xn(t,e);const s=Vn("monotoneY",i,t);return function(t,e){Gn(t,e,2)}(new es(s,n),t),s}let ss=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class rs extends ss{lineEnd(){this.context.closePath()}}function as(t,e,i={}){const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Wn("step",null!=n?n:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?wn.ROW:wn.COLUMN);return os(new ss(r,e,s),t),r}function os(t,e){return Gn(t,e,1)}class ls extends Hn{lineEnd(){this.context.closePath()}}function hs(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Vn("linear",i,t);return function(t,e){Gn(t,e,1)}(new ls(s,n),t),s}function cs(t,e,i,n,s){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>it){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>it){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/s,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,n,t.lastPoint1)}function us(t,e){return function(i,n,s={}){const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Xn(i,s);const o=Vn(t,r,i);return Gn(new e(o,n,a),i,2),o}}const ds=us("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:cs(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const ps=us("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:cs(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class gs extends Rn{constructor(t,e,i){super(),this.type=Mn.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Fn(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Ln([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===wn.ROW?ot(this.p0.x-this.p2.x):t===wn.COLUMN?ot(this.p0.y-this.p2.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return lt(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=Fn(i,n,s,e),a=vt.pointAtPP(i,n,e),o=vt.pointAtPP(n,s,e);return[new gs(i,a,r),new gs(r,o,s)]}(this,r);t.quadraticCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class fs{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Nn(new bt(this._lastX,this._lastY),new bt(t,e))}quadraticCurveTo(t,e,i,n){const s=new gs(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const a=new Un(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n),new bt(s,r));this.path.addCurve(a),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function ms(t,e,i){var n,s;switch(e){case"linear":default:return Xn(t,i);case"basis":return qn(t,i);case"monotoneX":return is(t,i);case"monotoneY":return ns(t,i);case"step":return as(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Wn("step",null!=n?n:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?wn.ROW:wn.COLUMN);return os(new rs(r,e,s),t),r}(t,.5,i);case"stepBefore":return as(t,0,i);case"stepAfter":return as(t,1,i);case"catmullRom":return ds(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return ps(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return hs(t,i)}}class ys extends dn{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new un(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([fn.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([fn.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([fn.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([fn.C,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([fn.AT,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([fn.E,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([fn.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([fn.A,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([fn.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new fs(this);On(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[fn.M]=t=>`M${t[1]} ${t[2]}`,t[fn.L]=t=>`L${t[1]} ${t[2]}`,t[fn.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[fn.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[fn.A]=t=>{const e=[],i=t[1],n=t[2],s=t[3];((t,e,i,n,s,r,a,o=!1)=>{const l=2*Math.PI,h=(e%l+l)%l;let c,u=(i%l+l)%l;o?(u>=h&&(u-=l),c=u-h):(u<=h&&(u+=l),c=u-h);const d=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/d;for(let e=0;e<d;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),u=Math.cos(i),d=Math.sin(i),g=Math.cos(l),f=Math.sin(l),m=u*r+n,y=d*a+s,b=g*r+n,v=f*a+s,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*d,y+A*u,b+_*f,v-A*g,b,v)}})(e,t[4],t[5],i,n,s,s,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[fn.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[fn.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(mn=e[t],yn=mn.slice(1),bn=mn[0],i=[bn],n=yn.match(pn),null!==n){for(let t=0,e=n.length;t<e;t++)vn=n[t],xn=parseFloat(vn),Number.isNaN(xn)||i.push(xn);if(_n=gn[bn],i.length-1>_n){let t,e=bn;for(let n=1,r=i.length;n<r;n+=_n){t=[e];for(let e=n,s=n+_n;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=ms(e,i);"x"===n?this.direction=wn.ROW:"y"===n?this.direction=wn.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[fn.M]=this.moveToTransform,t[fn.L]=this.lineToTransform,t[fn.Q]=this.quadraticCurveToTransform,t[fn.C]=this.bezierCurveToTransform,t[fn.AT]=this.arcToTransform,t[fn.E]=this.ellipseTransform,t[fn.R]=this.rectTransform,t[fn.A]=this.arcTransform,t[fn.Z]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,s=1){let r,a,o,l,h,c=null,u=0,d=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(r=t[f],1===n&&1===s||(r=vs(r,n,s)),r[0]){case"l":u+=r[1],d+=r[2],this.lineTo(u+e,d+i);break;case"L":u=r[1],d=r[2],this.lineTo(u+e,d+i);break;case"h":u+=r[1],this.lineTo(u+e,d+i);break;case"H":u=r[1],this.lineTo(u+e,d+i);break;case"v":d+=r[1],this.lineTo(u+e,d+i);break;case"V":d=r[1],this.lineTo(u+e,d+i);break;case"m":u+=r[1],d+=r[2],this.moveTo(u+e,d+i);break;case"M":u=r[1],d=r[2],this.moveTo(u+e,d+i);break;case"c":a=u+r[5],o=d+r[6],p=u+r[3],g=d+r[4],this.bezierCurveTo(u+r[1]+e,d+r[2]+i,p+e,g+i,a+e,o+i),u=a,d=o;break;case"C":u=r[5],d=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,u+e,d+i);break;case"s":a=u+r[3],o=d+r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=u+r[1],h=d+r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"S":a=r[3],o=r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=r[1],h=r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"q":a=u+r[3],o=d+r[4],p=u+r[1],g=d+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),u=a,d=o,p=r[1],g=r[2];break;case"t":a=u+r[1],o=d+r[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-l,g=2*d-h):"q"===c[0]&&(p=2*u-p,g=2*d-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o,p=u+r[1],g=d+r[2];break;case"T":a=r[1],o=r[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"a":kn(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+u+e,r[7]+d+i]),u+=r[6],d+=r[7];break;case"A":kn(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),u=r[6],d=r[7];break;case"z":case"Z":this.closePath()}c=r}}_runCommandList(t,e=0,i=0,n=1,s=1){if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case fn.L:this.lineToTransform(a,e,i,n,s);break;case fn.M:this.moveToTransform(a,e,i,n,s);break;case fn.C:this.bezierCurveToTransform(a,e,i,n,s);break;case fn.Q:this.quadraticCurveToTransform(a,e,i,n,s);break;case fn.A:this.arcToTransform(a,e,i,n,s);break;case fn.E:this.ellipseTransform(a,e,i,n,s);break;case fn.R:this.rectTransform(a,e,i,n,s);break;case fn.AT:this.arcToTransform(a,e,i,n,s);break;case fn.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),On(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===wn.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.y-e.p1.y)}if(this.direction===wn.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this._curves.length;n++){e=this._curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let a=0;for(let s=0;s<this._curves.length;s++){const o=this._curves[s],l=o.getLength(this.direction);if(!(a+l<=r)){const s=1-(a+l-r)/l;o.draw(t,i,n,e,e,s);break}o.draw(t,i,n,e,e,1),a+=l}}}const bs=["l",0,0,0,0,0,0,0];function vs(t,e,i){const n=bs[0]=t[0];if("a"===n||"A"===n)bs[1]=e*t[1],bs[2]=i*t[2],bs[3]=t[3],bs[4]=t[4],bs[5]=t[5],bs[6]=e*t[6],bs[7]=i*t[7];else if("h"===n||"H"===n)bs[1]=e*t[1];else if("v"===n||"V"===n)bs[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)bs[n]=(n%2==1?e:i)*t[n];return bs}const xs={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 Yt},_s={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},As=Object.assign({outerBorder:Object.assign(Object.assign({},_s),{distance:0}),innerBorder:Object.assign(Object.assign({},_s),{distance:0})},_s),Ss={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:an.fontBounding,keepCenterInLine:!1},Ts=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),As),{alignSelf:"auto"}),{pickStrokeBuffer:0}),ws={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ms=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Ts),xs),Bs=Object.assign(Object.assign({},Ms),{startAngle:0,endAngle:at,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Cs=Object.assign(Object.assign(Object.assign({},Ms),ws),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),ks=Object.assign(Object.assign({},Ms),{radius:1,startAngle:0,endAngle:at}),Ps=Object.assign(Object.assign({},Ms),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),Os=Object.assign(Object.assign({},Ms),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Rs=Object.assign(Object.assign(Object.assign({},Ms),ws),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Ls=Object.assign(Object.assign({},Ms),{path:new ys,fillStrokeOrder:1,clipRange:1,customPath:()=>{$.getInstance().warn("空函数")}}),Is=Object.assign(Object.assign({},Ms),{points:[],cornerRadius:0,closePath:!0}),Es=Object.assign(Object.assign({},Ms),{width:100,height:100,spikes:5,thickness:.5}),Ds=Object.assign(Object.assign({},Ms),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Ms),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Fs=Object.assign(Object.assign({},Ms),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),js=Object.assign(Object.assign(Object.assign({},Ms),Ss),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Us=Object.assign(Object.assign(Object.assign({},Ms),Ss),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ns=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Ms),{fill:!0,cornerRadius:0,cornerType:"round"}),Ws=Object.assign(Object.assign({},Ns),{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}),zs=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return s("linear",t.linearGradient,r)||s("radial",t.radialGradient,o)||s("conic",t.conicGradient,a)}function s(e,n,s){return function(n,r){const a=y(n);if(a){y(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:d(p)}}();return y(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,n,s=l();return s&&(i=[],i.push(s),n=e,y(t.comma)&&(s=l(),s?i.push(s):e=n)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const s=[];if(n)for(s.push(n);y(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=y(e);if(n)return{type:t,value:n[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const n=t.exec(e);return n&&b(n[0].length),n}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Gs{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Gs.IsGradientStr(t))try{const e=zs(t)[0];if(e){if("linear"===e.type)return Gs.ParseLinear(e);if("radial"===e.type)return Gs.ParseRadial(e);if("conic"===e.type)return Gs.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=nt/2,s=parseFloat(e.value)/180*nt-n;return{gradient:"conical",x:.5,y:.5,startAngle:s,endAngle:s+at,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=nt/2;let s="angular"===e.type?parseFloat(e.value)/180*nt:0;for(;s<0;)s+=at;for(;s>=at;)s-=at;let r=0,a=0,o=0,l=0;return s<n?(r=0,a=1,o=Math.sin(s),l=a-Math.cos(s)):s<nt?(r=0,a=0,o=Math.cos(s-n),l=Math.sin(s-n)):s<nt+n?(r=1,a=0,o=r-Math.sin(s-nt),l=Math.cos(s-nt)):(r=1,o=r-Math.cos(s-n-nt),l-=Math.sin(s-n-nt)),{gradient:"linear",x0:r,y0:a,x1:o,y1:l,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Vs(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}function Hs(t,e,i,n=0,s=0){var r,a,o,l;if(!e||!0===e)return"black";let h,c;if(g(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=Gs.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let u=e.x2-e.x1,d=e.y2-e.y1,p=e.x1-n,g=e.y1-s;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:n=0}=i.attribute;u/=t,d/=e,p/=t,g/=e,(n||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(a=i.y1WithoutTransform)&&void 0!==a?a:0,u=null!==(o=i.widthWithoutTransform)&&void 0!==o?o:u,d=null!==(l=i.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===c.gradient?h=function(t,e,i,n,s,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*s,n+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*s,n+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,u,d):"conical"===c.gradient?h=function(t,e,i,n,s,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*s,n+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(s+i,r+n,void 0):l}(t,c,p,g,u,d):"radial"===c.gradient&&(h=function(t,e,i,n,s,r){var a,o,l,h,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*s,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(s,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,c,p,g,u,d))}return h||"orange"}const Xs={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"}},$s=!0,Ys=!1,qs=/\w|\(|\)|-/,Ks=/[.?!,;:/,。?!、;:]/,Zs=/\S/,Js=(t,e)=>{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})};function Qs(t,e,i,n,s){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=sn.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return s&&(a=function(t,e,i=!1){let n=e;for(;qs.test(t[n-1])&&qs.test(t[n])||Ks.test(t[n]);)if(n--,n<=0)return i?tr(t,e):e;return n}(t,a)),a}function tr(t,e){let i=e;for(;qs.test(t[i+1])&&qs.test(t[i])||Ks.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function er(t,e,i="actual"){var n;if(""===t)return{ascent:0,height:0,descent:0,width:0};const s=sn.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?s.actualBoundingBoxAscent:s.fontBoundingBoxAscent,o="actual"===i?s.actualBoundingBoxDescent:s.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(s.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(s.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(n=e.space)&&void 0!==n?n:0;return r.width+=l,r}const ir=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=Si.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Xi}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,wi,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Hi(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new Ki(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[Mi],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Ui:case zi:e=t.cache;break;case Gi:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Fi&&(t.cache=e,t.activated=!0)}},nr=Symbol.for("CanvasFactory");function sr(t){return ir.getNamed(nr,sn.global.env)(t)}const rr=1e-4,ar=Math.sqrt(3),or=1/3;function lr(t){return t>-_r&&t<_r}function hr(t){return t>_r||t<-_r}const cr=[0,0],ur=[0,0],dr=[0,0];function pr(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function gr(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function fr(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function mr(t){return(t%=at)<0&&(t+=at),t}function yr(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>n+h&&l>r+h||l<e-h&&l<n-h&&l<r-h||o>t+h&&o>i+h&&o>s+h||o<t-h&&o<i-h&&o<s-h)&&function(t,e,i,n,s,r,a,o,l){let h=0,c=.005,u=1/0;cr[0]=a,cr[1]=o;for(let a=0;a<1;a+=.05){ur[0]=gr(t,i,s,a),ur[1]=gr(e,n,r,a);const o=pr(cr,ur);o<u&&(h=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<rr);a++){const a=h-c,o=h+c;ur[0]=gr(t,i,s,a),ur[1]=gr(e,n,r,a);const l=pr(ur,cr);if(a>=0&&l<u)h=a,u=l;else{dr[0]=gr(t,i,s,o),dr[1]=gr(e,n,r,o);const a=pr(dr,cr);o<=1&&a<u?(h=o,u=a):c*=.5}}return l&&(l[0]=gr(t,i,s,h),l[1]=gr(e,n,r,h)),Math.sqrt(u)}(t,e,i,n,s,r,o,l,null)<=h/2}function br(t,e,i,n,s,r,a,o,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>n+u&&c>r+u&&c>o+u||c<e-u&&c<n-u&&c<r-u&&c<o-u||h>t+u&&h>i+u&&h>s+u&&h>a+u||h<t-u&&h<i-u&&h<s-u&&h<a-u)&&function(t,e,i,n,s,r,a,o,l,h,c){let u,d,p,g,f=0,m=.005,y=1/0;cr[0]=l,cr[1]=h;for(let l=0;l<1;l+=.05)ur[0]=fr(t,i,s,a,l),ur[1]=fr(e,n,r,o,l),p=pr(cr,ur),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<rr);l++)u=f-m,d=f+m,ur[0]=fr(t,i,s,a,u),ur[1]=fr(e,n,r,o,u),p=pr(ur,cr),u>=0&&p<y?(f=u,y=p):(dr[0]=fr(t,i,s,a,d),dr[1]=fr(e,n,r,o,d),g=pr(dr,cr),d<=1&&g<y?(f=d,y=g):m*=.5);return c&&(c[0]=fr(t,i,s,a,f),c[1]=fr(e,n,r,o,f)),Math.sqrt(y)}(t,e,i,n,s,r,a,o,h,c,null)<=u/2}function vr(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;o-=t,l-=e;const c=Math.sqrt(o*o+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(n-s)%at<1e-4)return!0;if(r){const t=n;n=mr(s),s=mr(t)}else n=mr(n),s=mr(s);n>s&&(s+=at);let u=Math.atan2(l,o);return u<0&&(u+=at),u>=n&&u<=s||u+at>=n&&u+at<=s}function xr(t,e,i,n,s,r,a){if(0===s)return!1;const o=s,l=s/2;let h=0,c=t;if(a>e+l&&a>n+l||a<e-l&&a<n-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=h*r-a+c;return u*u/(h*h+1)<=o/2*o/2}const _r=1e-4;function Ar(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let l=0;if(lr(a)){if(hr(r)){const t=-o/r;t>=0&&t<=1&&(s[l++]=t)}}else{const t=r*r-4*a*o;if(lr(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}const Sr=[-1,-1,-1],Tr=[-1,-1];function wr(){const t=Tr[0];Tr[0]=Tr[1],Tr[1]=t}function Mr(t,e,i,n,s,r,a,o,l,h){if(h>e&&h>n&&h>r&&h>o||h<e&&h<n&&h<r&&h<o)return 0;const c=function(t,e,i,n,s,r){const a=n+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-s,c=o*o-3*a*l,u=o*l-9*a*h,d=l*l-3*o*h;let p=0;if(lr(c)&&lr(u))if(lr(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=u*u-4*c*d;if(lr(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),n=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,or):Math.pow(i,or),n=n<0?-Math.pow(-n,or):Math.pow(n,or);const s=(-o-(i+n))/(3*a);s>=0&&s<=1&&(r[p++]=s)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),s=(-o-2*i*n)/(3*a),l=(-o+i*(n+ar*Math.sin(e)))/(3*a),h=(-o+i*(n-ar*Math.sin(e)))/(3*a);s>=0&&s<=1&&(r[p++]=s),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,n,r,o,h,Sr);if(0===c)return 0;let u=0,d=-1,p=0,g=0;for(let h=0;h<c;h++){const c=Sr[h],f=0===c||1===c?.5:1;fr(t,i,s,a,c)<l||(d<0&&(d=Ar(e,n,r,o,Tr),Tr[1]<Tr[0]&&d>1&&wr(),p=fr(e,n,r,o,Tr[0]),d>1&&(g=fr(e,n,r,o,Tr[1]))),2===d?c<Tr[0]?u+=p<e?f:-f:c<Tr[1]?u+=g<p?f:-f:u+=o<g?f:-f:c<Tr[0]?u+=p<e?f:-f:u+=o<p?f:-f)}return u}function Br(t,e,i,n,s,r,a,o){if(o>e&&o>n&&o>r||o<e&&o<n&&o<r)return 0;const l=function(t,e,i,n,s){const r=t-2*e+i,a=2*(e-t),o=t-n;let l=0;if(lr(r)){if(hr(a)){const t=-o/a;t>=0&&t<=1&&(s[l++]=t)}}else{const t=a*a-4*r*o;if(lr(t)){const t=-a/(2*r);t>=0&&t<=1&&(s[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),n=(-a-e)/(2*r);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}(e,n,r,o,Sr);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,r);if(h>=0&&h<=1){let o=0;const c=gr(e,n,r,h);for(let n=0;n<l;n++){const l=0===Sr[n]||1===Sr[n]?.5:1;gr(t,i,s,Sr[n])<a||(Sr[n]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===Sr[0]||1===Sr[0]?.5:1;return gr(t,i,s,Sr[0])<a?0:r<e?c:-c}function Cr(t,e,i,n,s,r,a,o){if((o-=e)>i||o<-i)return 0;const l=Math.sqrt(i*i-o*o);Sr[0]=-l,Sr[1]=l;const h=Math.abs(n-s);if(h<1e-4)return 0;if(h>=at-1e-4){n=0,s=at;const e=r?1:-1;return a>=Sr[0]+t&&a<=Sr[1]+t?e:0}if(n>s){const t=n;n=s,s=t}n<0&&(n+=at,s+=at);let c=0;for(let e=0;e<2;e++){const i=Sr[e];if(i+t>a){let t=Math.atan2(o,i),e=r?1:-1;t<0&&(t=at+t),(t>=n&&t<=s||t+at>=n&&t+at<=s)&&(t>nt/2&&t<1.5*nt&&(e=-e),c+=e)}}return c}function kr(t){return Math.round(t/nt*1e8)/1e8%2*nt}function Pr(t,e){let i=kr(t[0]);i<0&&(i+=at);const n=i-t[0];let s=t[1];s+=n,!e&&s-i>=at?s=i+at:e&&i-s>=at?s=i-at:!e&&i>s?s=i+(at-kr(i-s)):e&&i<s&&(s=i-(at-kr(s-i))),t[0]=i,t[1]=s}const Or=[0,0];function Rr(t,e,i,n,s){const r=t,a=t.length;let o,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=r[t],g=0===t;a[0]===fn.M&&t>1&&(i||(h+=Ut(c,u,d,p,n,s))),g&&(c=a[1],u=a[2],d=c,p=u);const f=a[0],m=a[1],y=a[2],b=a[3],v=a[4],x=a[5],_=a[6];let A=v,S=x;Or[0]=A,Or[1]=S,Pr(Or,Boolean(a[6])),A=Or[0],S=Or[1];const T=A,w=S-A,M=!!(1-(a[6]?0:1)),B=(n-m)*b/b+m;switch(f){case fn.M:d=m,p=y,c=d,u=p;break;case fn.L:if(i){if(xr(c,u,m,y,e,n,s))return!0}else h+=Ut(c,u,m,y,n,s)||0;c=m,u=y;break;case fn.C:if(i){if(br(c,u,m,y,b,v,x,_,e,n,s))return!0}else h+=Mr(c,u,m,y,b,v,x,_,n,s)||0;c=x,u=_;break;case fn.Q:if(i){if(yr(c,u,m,y,b,v,e,n,s))return!0}else h+=Br(c,u,m,y,b,v,n,s)||0;c=b,u=v;break;case fn.A:if(o=Math.cos(T)*b+m,l=Math.sin(T)*b+y,g?(d=o,p=l):h+=Ut(c,u,o,l,n,s),i){if(vr(m,y,b,T,T+w,M,e,B,s))return!0}else h+=Cr(m,y,b,T,T+w,M,B,s);c=Math.cos(T+w)*b+m,u=Math.sin(T+w)*b+y;break;case fn.R:if(d=c=m,p=u=y,o=d+b,l=p+v,i){if(xr(d,p,o,p,e,n,s)||xr(o,p,o,l,e,n,s)||xr(o,l,d,l,e,n,s)||xr(d,l,d,p,e,n,s))return!0}else h+=Ut(o,p,o,l,n,s),h+=Ut(d,l,d,p,n,s);break;case fn.Z:if(i){if(xr(c,u,d,p,e,n,s))return!0}else h+=Ut(c,u,d,p,n,s);c=d,u=p}}return i||(g=u,f=p,Math.abs(g-f)<_r)||(h+=Ut(c,u,d,p,n,s)||0),0!==h;var g,f}const Lr=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=sr(Object.assign({nativeCanvas:sn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=sr(Object.assign({nativeCanvas:sn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Ir={arc:Bs,area:Cs,circle:ks,line:Rs,path:Ls,symbol:Fs,text:js,rect:Ds,polygon:Is,star:Es,richtext:Us,richtextIcon:Ws,image:Ns,group:Ps,glyph:Os},Er=Object.keys(Ir);function Dr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Fr={arc:Object.assign({},Ir.arc),area:Object.assign({},Ir.area),circle:Object.assign({},Ir.circle),line:Object.assign({},Ir.line),path:Object.assign({},Ir.path),symbol:Object.assign({},Ir.symbol),text:Object.assign({},Ir.text),rect:Object.assign({},Ir.rect),polygon:Object.assign({},Ir.polygon),star:Object.assign({},Ir.star),richtext:Object.assign({},Ir.richtext),richtextIcon:Object.assign({},Ir.richtextIcon),image:Object.assign({},Ir.image),group:Object.assign({},Ir.group),glyph:Object.assign({},Ir.glyph)};class jr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Er.forEach((t=>{this._defaultTheme[t]=Object.create(Fr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,$.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Er.forEach((n=>{const s=Object.create(Fr[n]);t&&t[n]&&Dr(s,t[n]),i[n]&&Dr(s,i[n]),e[n]&&Dr(s,e[n]),this.combinedTheme[n]=s})),e.common&&Er.forEach((t=>{Dr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Ur=new jr;function Nr(t,e){return t.glyphHost?Nr(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)):Ur.getTheme()}return null}(t)||t.attachedThemeGraphic&&Nr(t.attachedThemeGraphic)||Ur.getTheme()}var Wr=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class zr extends s{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=Si.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Wr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)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===t||t===e)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&&$.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=c(i)&&i.once,r=o(e)?void 0:e;return t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=o(e)?void 0:e;t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Gr{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=Gr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&o(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Vr extends Gr{constructor(t,e){super(),this.type=t,this.detail=e}}const Hr={dispatchEvent(t){var e;if(!(t instanceof Gr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Vr(t,e))}};class Xr{static GetImage(t,e){var i;const n=Xr.cache.get(t);n?"fail"===n.loadState?sn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Xr.loadImage(t,e)}static GetSvg(t,e){var i;let n=Xr.cache.get(t);n?"fail"===n.loadState?sn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Xr.cache.set(t,n),n.dataPromise=sn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Xr.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Xr.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=sn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=sn.global.loadBlob(t):"json"===e&&(i.dataPromise=sn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Xr.isLoading&&Xr.toLoadAueue.length){Xr.isLoading=!0;const t=Xr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(Xr.cache.set(i,s),s.dataPromise=sn.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()})).catch((t=>{console.error(t),Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()}))}}),0)}static loadImage(t,e){const i=$r(t,Xr.toLoadAueue);if(-1!==i)return Xr.toLoadAueue[i].marks.push(e),void Xr.loading();Xr.toLoadAueue.push({url:t,marks:[e]}),Xr.loading()}static improveImageLoading(t){const e=$r(t,Xr.toLoadAueue);if(-1!==e){const t=Xr.toLoadAueue.splice(e,1);Xr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function $r(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var Yr;Xr.cache=new Map,Xr.isLoading=!1,Xr.toLoadAueue=[],Xr.onLoadSuccessCb=[],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"}(Yr||(Yr={}));const qr=[!1,!1,!1,!1],Kr=[0,0,0,0],Zr=t=>t?g(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Kr[0]=t[0],Kr[2]=t[0],Kr[1]=t[1],Kr[3]=t[1],Kr):t:t:0,Jr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qr=[1,2,3,0,1,2,3,0];function ta(t,e,i,n){for(;t>=at;)t-=at;for(;t<0;)t+=at;for(;t>e;)e+=at;Jr[0].x=i,Jr[1].y=i,Jr[2].x=-i,Jr[3].y=-i;const s=Math.ceil(t/st)%4,r=Math.ceil(e/st)%4;if(n.add(ht(t)*i,dt(t)*i),n.add(ht(e)*i,dt(e)*i),s!==r||e-t>nt){let t=!1;for(let e=0;e<Qr.length;e++)if(t||s!==Qr[e]){if(t&&r===Qr[e])break;if(t){const t=Jr[Qr[e]];n.add(t.x,t.y)}}else{t=!0;const e=Jr[s];n.add(e.x,e.y)}}}function ea(t,e,i){const{x:n,y:s}=mt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=mt(t.x1,t.y1,e.x1,e.y1,i),o=new bt(n,s,r,a);return o.defined=e.defined,o}function ia(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<e.length;s++)n[s]=ea(t[s],e[s],i)}else{n=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<t.length;s++)n[s]=ea(t[s],e[s],i)}return n}const na=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};class sa{bounds(t,e){if(y(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}}function ra(t,e,i,n,s){return s?t.arc(i,n,e,0,rt,!1,s):t.arc(i,n,e,0,rt),!1}var aa=new class extends sa{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,s){return ra(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return ra(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var oa=new class extends sa{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function la(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var ha=new class extends sa{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return la(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return la(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return la(t,this.parseSize(e)/2+s,i,n,r)}};function ca(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var ua=new class extends sa{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return ca(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ca(t,this.parseSize(e)/2+s,i,n)}};function da(t,e,i,n,s=0){return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class pa extends sa{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return da(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return da(t,this.parseSize(e)/2,i,n,s)}}var ga=new pa;var fa=new class extends pa{constructor(){super(...arguments),this.type="triangle"}};const ma=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ya=Math.sin(rt/10)*ma,ba=-Math.cos(rt/10)*ma;function va(t,e,i,n){const s=ya*e,r=ba*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let a=1;a<5;++a){const o=rt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*s-h*r+i,h*s+l*r+n)}return t.closePath(),!0}var xa=new class extends sa{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return va(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return va(t,this.parseSize(e)/2+s,i,n)}};const _a=pt(3);function Aa(t,e,i,n){const s=e,r=s/_a,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var Sa=new class extends sa{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Aa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Aa(t,this.parseSize(e)/2+s,i,n)}};function Ta(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var wa=new class extends sa{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Ta(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ta(t,this.parseSize(e)/2+s,i,n)}};function Ma(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Ba=new class extends sa{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Ma(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ma(t,this.parseSize(e)/2+s,i,n)}};const Ca=-.5,ka=pt(3)/2,Pa=1/pt(12);function Oa(t,e,i,n){const s=e/2,r=e*Pa,a=s,o=e*Pa+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(Ca*s-ka*r+i,ka*s+Ca*r+n),t.lineTo(Ca*a-ka*o+i,ka*a+Ca*o+n),t.lineTo(Ca*l-ka*h+i,ka*l+Ca*h+n),t.lineTo(Ca*s+ka*r+i,Ca*r-ka*s+n),t.lineTo(Ca*a+ka*o+i,Ca*o-ka*a+n),t.lineTo(Ca*l+ka*h+i,Ca*h-ka*l+n),t.closePath(),!1}var Ra=new class extends sa{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return Oa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Oa(t,this.parseSize(e)/2+s,i,n)}};function La(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Ia=new class extends sa{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return La(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return La(t,this.parseSize(e)/2,i,n,s)}};function Ea(t,e,i,n,s=0){return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var Da=new class extends sa{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Ea(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ea(t,this.parseSize(e)/2,i,n,s)}};function Fa(t,e,i,n,s=0){return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var ja=new class extends sa{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return Fa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Fa(t,this.parseSize(e)/2,i,n,s)}};const Ua=pt(3);function Na(t,e,i,n){const s=e*Ua;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Wa=new class extends sa{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Na(t,this.parseSize(e)/2/Ua,i,n)}drawOffset(t,e,i,n,s){return Na(t,this.parseSize(e)/2/Ua+s,i,n)}};function za(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Ga=new class extends sa{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return za(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return za(t,this.parseSize(e)/4+s,i,n)}};function Va(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var Ha=new class extends sa{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return Va(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Va(t,this.parseSize(e)/4+s,i,n)}};function Xa(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var $a=new class extends sa{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Xa(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Xa(t,this.parseSize(e)/4+s,i,n)}};function Ya(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var qa=new class extends sa{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return Ya(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ya(t,this.parseSize(e)/4+s,i,n)}};function Ka(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Za=new class extends sa{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return Ka(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Ka(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function Ja(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Qa=new class extends sa{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return Ja(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Ja(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function to(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var eo=new class extends sa{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return to(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return to(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function io(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function no(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var so=new class extends sa{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return y(e)?no(t,e,i,n):io(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,a){y(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*s,l=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+n>o){const e=(i.x-c.x)*(o-h)/n,s=(i.y-c.y)*(o-h)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,h+=n}return!1}drawOffset(t,e,i,n,s){return y(e)?no(t,e+2*s,i,n):io(t,[e[0]+2*s,e[1]+2*s],i,n)}};const ro=new Xt;class ao{constructor(t,e,i=!1){this.pathStr="",this.type=t,g(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),On(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(On(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{ro.x1=i.bounds.x1*t,ro.y1=i.bounds.y1*t,ro.x2=i.bounds.x2*t,ro.y2=i.bounds.y2*t,e.union(ro)}))}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 oo={};[aa,oa,ha,ua,Wa,fa,xa,Sa,wa,Ba,Ra,Ia,Da,ga,ja,Ga,Ha,$a,qa,so,Za,Qa,eo].forEach((t=>{oo[t.type]=t}));const lo={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class ho{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function co(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function uo(t,e,i,n=">"){const s=function(t,e,i=">"){let n,s="";for(let r=e;r<t.length;r++){let e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:s,index:r};if(t[r+1]===i[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,n);if(!s)return;let r=s.data;const a=s.index,o=r.search(/\s/);let l=r,h=!0;-1!==o&&(l=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),h=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:a,attrExpPresent:h,rawTagName:c}}const po=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class go{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,po),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new ho("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=co(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=uo(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=co(t,"--\x3e",r+4,"Comment is not closed.");else{const a=uo(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new ho(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new ho(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function fo(t,e){return mo(t)}function mo(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=yo(s);if(void 0!==r&&s[r]){const t=mo(s[r]);n=t,Object.keys(n).length,s[":@"]&&bo(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function yo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function bo(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class vo{constructor(t){this.options=Object.assign({},vo.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return fo(new go(this.options).parseXml(t),this.options)}}function xo(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}vo.defaultOptions={};let _o=0;function Ao(){return _o++}var So;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(So||(So={}));const To=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>To.set(t,!0)));const wo=new Map;function Mo(t){if(To.has(t))return!0;if(wo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>wo.set(t,!0)));const Bo=Ao(),Co=Ao(),ko=Ao();Ao(),Ao();const Po=Ao(),Oo=Ao(),Ro=Ao(),Lo=Ao(),Io=Ao(),Eo=Ao(),Do=Ao(),Fo=Ao(),jo=Ao();Ao();const Uo=Ao(),No=Ao(),Wo=Symbol.for("GraphicCreator"),zo={"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"},Go=Object.keys(zo),Vo={duration:200,easing:"cubicOut"};function Ho(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}function Xo(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,u,d,p,g,f,m,y;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*n+c*s+g*r+e[12],t[13]=o*n+u*s+f*r+e[13],t[14]=l*n+d*s+m*r+e[14],t[15]=h*n+p*s+y*r+e[15]),t}function $o(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*n+x*o+_*u+A*f,t[1]=v*s+x*l+_*d+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*n+x*o+_*u+A*f,t[5]=v*s+x*l+_*d+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*n+x*o+_*u+A*f,t[9]=v*s+x*l+_*d+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*n+x*o+_*u+A*f,t[13]=v*s+x*l+_*d+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function Yo(t,e,i){const n=e[0],s=e[1],r=e[2];let a=i[3]*n+i[7]*s+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/a,t[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/a,t[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/a,t}class qo{constructor(){this.pools=[]}static identity(t){return Ho(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 qo.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Ko=new class{constructor(){this.pools=[]}allocate(t,e,i,n,s,r){if(!this.pools.length)return new Yt(t,e,i,n,s,r);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=s,a.f=r,a}allocateByObj(t){if(!this.pools.length)return new Yt(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Zo=new qo;var Jo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const tl=new Yt(1,0,0,1,0,0),el={x:0,y:0};let il=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Yt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Yt(1,0,0,1,0,0),this.path=new ys,this._clearMatrix=new Yt(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ko.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Yt(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,s=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),s&&this.setTransformForCurrent()}setTransform(t,e,i,n,s,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*s,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,s,r,a=!0){this.matrix.multiply(t,e,i,n,s,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,s,r){this.path.arc(t,e,i,n,s,r)}arcTo(t,e,i,n,s){this.path.arcTo(t,e,i,n,s)}bezierCurveTo(t,e,i,n,s,r){this.path.bezierCurveTo(t,e,i,n,s,r)}closePath(){this.path.closePath()}ellipse(t,e,i,n,s,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,s,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},el),function(t,e,i){return Rr(t,0,!1,e,i)}(this.path.commandList,el.x,el.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},el);const i=Vs(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Rr(t,e,!0,i,n)}(this.path.commandList,i,el.x,el.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,s){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,s){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(tl,t,e)}setClearMatrix(t,e,i,n,s,r){this._clearMatrix.setValue(t,e,i,n,s,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Ko.free(t))),this.stack.length=0}};var nl;il=Jo([Ei(),Qo("design:paramtypes",[Object,Number])],il),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(nl||(nl={}));class sl{static Get(t,e=nl.Color1,i=[0,0,0,1]){if(e===nl.Color1){const e=sl.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=re.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];sl.store1[t]=e,sl.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=sl.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=re.parseColorString(t);return s&&(sl.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],sl.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===nl.Color1){if(sl.store1[t])return;sl.store1[t]=i,sl.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(sl.store255[t])return;sl.store255[t]=i,sl.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function rl(t,e=!1){return Array.isArray(t)&&y(t[0])?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 al(t,e,i,n,s){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((s,r)=>{var a,o;return ol(g(t)?null!==(a=t[r])&&void 0!==a?a:t[0]:t,g(e)?null!==(o=e[r])&&void 0!==o?o:e[0]:e,i,n)})):ol(t,e,i,n,s)}function ol(t,e,i,n,s){if(!t||!e)return t&&rl(t)||e&&rl(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=sl.Get(t,nl.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=sl.Get(e,nl.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:rl(a)})))});return o?al(r,l,i,n,s):al(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ul(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ul(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ul(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),rl(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),n)}function ll(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}sl.store255={},sl.store1={};const hl=[0,0,0,0],cl=[0,0,0,0];function ul(t,e,i){return sl.Get(t,nl.Color255,hl),sl.Get(e,nl.Color255,cl),`rgba(${Math.round(hl[0]+(cl[0]-hl[0])*i)},${Math.round(hl[1]+(cl[1]-hl[1])*i)},${Math.round(hl[2]+(cl[2]-hl[2])*i)},${hl[3]+(cl[3]-hl[3])*i})`}const dl=new Xt,pl=new Yt;new Xt;const gl=["lineWidth","scaleX","scaleY","angle","anchor","visible"],fl=["x","y"],ml=["scaleX","scaleY"],yl=["angle"],bl=new bt,vl={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class xl extends zr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(xl.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Xt,this._updateTag=An.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:sn.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;bl.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),bl.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else bl.x=s,bl.y=r;return bl}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new $t),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=oo[t];if(e)return e;if(e=xl.userSymbolMap[t],e)return e;if(!0===((i=t=lo[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new vo,{svg:i}=e.parse(t);if(!i)return null;const n=g(i.path)?i.path:[i.path];dl.clear();const s=[];n.forEach((t=>{const e=(new ys).fromString(t.d),i={};Go.forEach((e=>{t[e]&&(i[zo[e]]=t[e])})),s.push({path:e,attribute:i}),dl.union(e.bounds)}));const r=dl.width(),a=dl.height(),o=1/ct(r,a);s.forEach((t=>t.path.transform(0,0,o,o)));const l=new ao(t,s,!0);return xl.userSymbolMap[t]=l,l}var i;const n=(new ys).fromString(t),s=n.bounds.width(),r=n.bounds.height(),a=1/ct(s,r);n.transform(0,0,a,a);const o=new ao(t,n);return xl.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=Zr(s);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new un(t);return On(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Yt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&An.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&An.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&An.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&An.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&An.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&An.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=An.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===Sn.GLOBAL){const i=new bt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,n){this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||n)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):l(null===(s=this.normalAttrs)||void 0===s?void 0:s[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=gl){for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t,e=gl){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Tn.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=An.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Tn.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?sn.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:xs.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:xs.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Tn.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Tn.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,ml,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new Yt,o.postMatrix=n),sn.transformUtil.fromMatrix(n,n).scale(t,e,i)}else o.scaleX=(null!==(n=o.scaleX)&&void 0!==n?n:xs.scaleX)*t,o.scaleY=(null!==(s=o.scaleY)&&void 0!==s?s:xs.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Tn.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ml,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Tn.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,yl,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Yt,r.postMatrix=i),sn.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:xs.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Tn.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,yl,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),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,i,n){var s,r;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(s=this.context&&this.context.stateAnimateConfig)&&void 0!==s?s:this.stateAnimateConfig)&&void 0!==r?r:Vo;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Tn.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Tn.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:Tn.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const n=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=n?n:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=g(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&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 i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=An.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=An.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=An.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&An.UPDATE_SHAPE_AND_BOUNDS)===An.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=An.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=An.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=An.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=An.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=An.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=An.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=An.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&An.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=xs.x,y:e=xs.y,scaleX:i=xs.scaleX,scaleY:n=xs.scaleY,angle:s=xs.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&s&&(l=this.getAnchor(a,h)),!r||1===i&&1===n)!function(t,e,i,n,s,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=ht(a),f=dt(a);let m,y;o?(m=o[0],y=o[1]):(m=i,y=n);const b=m-i,v=y-n,x=l*g+c*f,_=h*g+u*f,A=c*g-l*f,S=u*g-h*f;t.a=s*x,t.b=s*_,t.c=r*A,t.d=r*S,t.e=d+l*m+c*y-x*b-A*v,t.f=p+h*m+u*y-_*b-S*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(s),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),sn.transformUtil.fromMatrix(a,a).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(xs);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=pl.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){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.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Tn.ANIMATE_END})}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:sn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),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 p(t,!0)?this.pathProxy=(new ys).fromString(t):this.pathProxy=new ys,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Xr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(v(t)||t.includes("/")||x(t))&&(Xr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),sn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Vr(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}toCustomPath(){var t,e,i;const n=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||sn.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(n){const t=new il(null,1);return n.drawShape(this,t,0,0,{},{}),t.path}return null}}var _l;xl.userSymbolMap={},xl.mixin(Hr),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(_l||(_l={}));class Al extends xl{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Po,this._childUpdateTag=An.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 jr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new jr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===Sn.GLOBAL){const i=new bt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&An.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=xs.x,y:e=xs.y,dx:i=xs.dx,dy:n=xs.dy,scaleX:s=xs.scaleX,scaleY:r=xs.scaleY,angle:a=xs.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Nr(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=An.CLEAR_BOUNDS,this._childUpdateTag&=An.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=An.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&An.UPDATE_BOUNDS||(this._childUpdateTag|=An.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(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,this.getGraphicService().onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&An.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=sn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Al(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Al.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Sl(t){return new Al(t)}function Tl(t,e){return!(!t&&!e)}function wl(t,e){let i;return i=g(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Ml(t,e,i){return i&&t*e>0}function Bl(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}function Cl(t,e){return t*e>0}function kl(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Pl(t,e,i,n,s,r,a){const o=t-i,l=e-n,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,u=-h*o,d=t+c,p=e+u,g=i+c,f=n+u,m=(d+g)/2,y=(p+f)/2,b=g-d,v=f-p,x=b*b+v*v,_=s-r,A=d*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-u,x11:T*(s/_-1),y11:w*(s/_-1)}}function Ol(t,e,i,n,s){const r=ot(i-e),a=t.getParsedCornerRadius(),o=g(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,m=o?a[1]:a,y=o?a[2]:a,b=o?a[3]:a,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=s*ht(c),T=s*dt(c),w=n*ht(d),M=n*dt(d);let B,C,k,P;if((x>it||v>it)&&(B=s*ht(u),C=s*dt(u),k=n*ht(p),P=n*dt(p),r<nt)){const t=function(t,e,i,n,s,r,a,o){const l=i-t,h=n-e,c=a-s,u=o-r;let d=u*l-c*h;return d*d<it?[]:(d=(c*(e-r)-u*(t-s))/d,[t+d*l,e+d*h])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],i=T-t[1],r=B-t[0],a=C-t[1],o=1/dt(((O=(e*r+i*a)/(pt(e*e+i*i)*pt(r*r+a*a)))>1?0:O<-1?nt:Math.acos(O))/2),l=pt(t[0]*t[0]+t[1]*t[1]);A=ut(x,(n-l)/(o-1)),_=ut(v,(s-l)/(o+1))}}var O;return{outerDeltaAngle:l,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function Rl(t,e,i,n,s,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(s<r){const t=s;s=r,r=t}if(s<=it)e.moveTo(i,n);else if(h>=at-it)e.moveTo(i+s*ht(o),n+s*dt(o)),e.arc(i,n,s,o,l,!c),r>it&&(e.moveTo(i+r*ht(l),n+r*dt(l)),e.arc(i,n,r,l,o,c));else{const{outerDeltaAngle:h,xors:d,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:y,outerCornerRadiusEnd:b,maxOuterCornerRadius:v,xore:x,yore:_,xire:A,yire:S,outerStartAngle:T,outerEndAngle:w,limitedIcr:M,innerDeltaAngle:B,innerEndAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,o,l,r,s);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,n+p),u=!0;else if(m>it){const t=ut(y,m),r=ut(b,m),o=Pl(g,f,d,p,s,t,Number(c)),l=Pl(x,_,A,S,s,r,Number(c));m<v&&t===r?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,m,lt(o.y01,o.x01),lt(l.y01,l.x01),!c)):e.moveTo(i+o.cx+m*ht(lt(l.y01,l.x01)),n+o.cy+m*dt(lt(l.y01,l.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,n,s,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),!c),r>0&&e.arc(i+l.cx,n+l.cy,r,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):r>0?e.moveTo(i+l.cx+r*ht(lt(l.y01,l.x01)),n+l.cy+r*dt(lt(l.y01,l.x01))):e.moveTo(i+x,n+s*dt(w))}else!a||a[0]?(e.moveTo(i+d,n+p),e.arc(i,n,s,T,w,!c)):e.moveTo(i+s*ht(w),n+s*dt(w));if(!(r>it)||B<.001)!a||a[1]?e.lineTo(i+A,n+S):e.moveTo(i+A,n+S),u=!0;else if(M>it){const t=ut(P,M),s=ut(O,M),o=Pl(A,S,x,_,r,-s,Number(c)),l=Pl(d,p,g,f,r,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),M<R&&t===s){const t=lt(l.y01,l.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,M,lt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+ht(t),n+o.cy+dt(t))}else!a||a[2]?(s>0&&e.arc(i+o.cx,n+o.cy,s,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,n,r,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,n+l.cy,t,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*ht(lt(l.y01,l.x01)),n+l.cy+t*dt(lt(l.y01,l.x01))):e.moveTo(i+g,n+f)}else!a||a[1]?e.lineTo(i+A,n+S):e.moveTo(i+A,n+S),!a||a[2]?e.arc(i,n,r,C,k,c):e.moveTo(i+r*ht(k),n+r*dt(k))}return a?a[3]&&e.lineTo(i+s*ht(o),n+s*dt(o)):e.closePath(),u}Al.NOWORK_ANIMATE_ATTR=vl;const Ll=Symbol.for("ArcRenderContribution"),Il=Symbol.for("ImageRenderContribution"),El=Symbol.for("PolygonRenderContribution"),Dl=Symbol.for("RectRenderContribution"),Fl=Symbol.for("SymbolRenderContribution"),jl=Symbol.for("TextRenderContribution"),Ul=Symbol.for("InteractiveSubRenderContribution");function Nl(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Wl(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var zl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vl=function(t,e){return function(i,n){e(i,n,t)}};function Hl(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(n=m[2])&&void 0!==n?n:0}if(Ho(t),Xo(t,t,[s+o,r+l,a+h]),Xo(t,t,[b[0],b[1],b[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=e[5],o=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]=r*s+h*n,t[5]=a*s+c*n,t[6]=o*s+u*n,t[7]=l*s+d*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=u*s-o*n,t[11]=d*s-l*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=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]=r*s-h*n,t[1]=a*s-c*n,t[2]=o*s-u*n,t[3]=l*s-d*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+u*s,t[11]=l*n+d*s}(t,t,p),Xo(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=Zo.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Xo(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=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]=r*s+h*n,t[1]=a*s+c*n,t[2]=o*s+u*n,t[3]=l*s+d*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=u*s-o*n,t[7]=d*s-l*n}(i,i,f),Xo(i,i,[-n[0],-n[1],0]),$o(t,t,i)}}let Xl=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new nn(["graphic"]),onSetStage:new nn(["graphic","stage"]),onRemove:new nn(["graphic"]),onRelease:new nn(["graphic"]),onAddIncremental:new nn(["graphic","group","stage"]),onClearIncremental:new nn(["graphic","group","stage"]),beforeUpdateAABBBounds:new nn(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new nn(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new nn(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Xt,this.tempAABBBounds2=new Xt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new un(t);return On(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=Wl(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=Nl(s,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){xo(u,(l+h)/Math.abs(s+r),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;xo(u,o/Math.abs(s+r)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const a=s.transMatrix;s&&s.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Vt(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),this.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};Xl=zl([Ei(),Vl(0,Li(Wo)),Gl("design:paramtypes",[Object])],Xl);const $l=(t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}return i};class Yl{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n,s="",r,a){const{lineWidth:o,suffixPosition:l="end",measureMode:h=an.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;u.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=n}d[1]=u.length*n,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const ql=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...gl];class Kl extends xl{get font(){const t=this.getGraphicTheme();return this._font||(this._font=zt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))return!1;const{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=No,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return g(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Nr(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Kl({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:s,y:r}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=kt(a,i,{x:s,y:r});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:s}=sn.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){xo(s,o/Math.abs(r+a),!0,l),i.union(s)}return sn.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||sn.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Vt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=n,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===f||d)return this.updateWrapAABBBounds(t);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),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=sn.graphicUtil.textMeasure,A=new Yl(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const s=this.getGraphicTheme(),{fontFamily:r=s.fontFamily,textAlign:a=s.textAlign,textBaseline:o=s.textBaseline,fontSize:l=s.fontSize,ellipsis:h=s.ellipsis,maxLineWidth:c,stroke:u=s.stroke,lineWidth:d=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:m=s.ignoreBuf,measureMode:y=s.measureMode,suffixPosition:b=s.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,s,A);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),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const T=sn.graphicUtil.textMeasure,w={fontSize:l,fontWeight:f,fontFamily:r,lineHeight:S},M=new Yl(r,w,T),B=g(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/S),1)),x&&(P=Math.min(P,x)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<B.length;t++){const e=B[t];let s=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,c,h,!1,b,t!==B.length-1),n=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,w,c,h,!1,b);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;s=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(s=!0,o=r.wordBreaked),r.str.length===e.length);else if(s){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let n=0,s=B.length;n<s;n++){if(n===P-1){const t=T.clipTextWithSuffix(B[n],w,c,h,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[n],t=T.measureTextWidth(e,w),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,a,o,C);const R=M.layoutWithBBox(O,C,a,o,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const n=this.getGraphicTheme(),s=sn.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=n.maxLineWidth,ellipsis:l=n.ellipsis,fontFamily:h=n.fontFamily,fontSize:c=n.fontSize,fontWeight:u=n.fontWeight,stroke:d=n.stroke,lineWidth:p=n.lineWidth,verticalMode:g=n.verticalMode,suffixPosition:f=n.suffixPosition}=a,m=this.getLineHeight(a,n,0);let{textAlign:y=n.textAlign,textBaseline:b=n.textBaseline}=a;if(!g){const t=y;y=null!==(e=Kl.baselineMapAlign[b])&&void 0!==e?e:"left",b=null!==(i=Kl.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const t=Nl(y,r),e=this.cache.verticalList.length*m,i=Wl(b,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)Mo(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:So.VERTICAL}),n="",i=0),e.push({text:t[s],direction:So.HORIZONTAL}));return n&&e.push({text:n,direction:So.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?n.ellipsis:l,a=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,f);v[e]=a.verticalList,r=a.width}else{const i=s.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);v[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===So.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=v,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const x=Nl(y,r),_=this.cache.verticalList.length*m,A=Wl(b,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=na(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=ql){return super.needUpdateTags(t,e)}needUpdateTag(t,e=ql){return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new Kl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Kl.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Kl.baselineMapAlign}getAlignMapBaseline(){return Kl.alignMapBaseline}}function Zl(t){return new Kl(t)}Kl.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},vl),Kl.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Kl.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Jl=["symbolType","size",...gl];let Ql=class t extends xl{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Uo}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return g(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Nr(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=sn.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;xo(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(g(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,Jl)}needUpdateTag(t){return super.needUpdateTag(t,Jl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=g(e)?e:[e,e];return t.path?(new ys).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new ys).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function th(t){return new Ql(t)}Ql.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},vl);const eh=["segments","points","curveType","curveTension",...gl];let ih=class t extends xl{constructor(t={}){super(t),this.type="line",this.numberType=Ro}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ia(i,n,e))}getGraphicTheme(){return Nr(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),sn.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,eh)}needUpdateTag(t){return super.needUpdateTag(t,eh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new ys;const i=e.segments,n=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):e.points&&n(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function nh(t){return new ih(t)}ih.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const sh=["width","x1","y1","height","cornerRadius",...gl];class rh extends xl{constructor(t){super(t),this.type="rect",this.numberType=Do}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Nr(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:a,y:o}=t;e=null!=e?e:s-a,n=null!=n?n:r-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);return $l(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,sh)}needUpdateTag(t){return super.needUpdateTag(t,sh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:i,y:n,width:s,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=l(t.width)?t.x1-t.x:t.width,i=l(t.height)?t.y1-t.y:t.height,n=0,s=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(s=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:s,width:e,height:i}})(e);return t=new ys,t.moveTo(i,n),t.rect(i,n,s,r),t}clone(){return new rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rh.NOWORK_ANIMATE_ATTR}}function ah(t){return new rh(t)}rh.NOWORK_ANIMATE_ATTR=vl;const oh=[[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 lh extends rh{constructor(t){super(t),this.type="rect3d",this.numberType=Fo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:n,x:s,y:r,length:a=ut(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-s,l=null!=l?l:n-r;for(let e=0;e<oh.length;e++){const i=oh[e];t.vertices.push([i[0]*o,i[1]*l,i[2]*a])}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 lh.NOWORK_ANIMATE_ATTR}}function hh(t){return new lh(t)}lh.NOWORK_ANIMATE_ATTR=vl;class ch{constructor(t,e,i,n,s,r,a,o,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=s,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Xs[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),s=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,n):this.height||n||0;r=Math.min(r,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-s:"center"===this.globalAlign&&(o=-s/2);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 i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+s>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:s}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let s=this[this.directionKey.height];if(this.singleLine&&(s=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=s&&0!==s)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((s-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],a=s-this.lines[i].top-this.lines[i].height;if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+s||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function uh(t,e,i,n){const s=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(n);return{left:t>s?s:s-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>n?o:o+.5}}class dh{constructor(t,e,i,n){var s,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=n;const a=na(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=er(t,i,this.ascentDescentMode);let u=0,d=0,p=0;this.height>l&&(u=(this.height-l)/2,d=Math.ceil(u),p=Math.floor(u)),"top"===this.textBaseline?(this.ascent=u,this.descent=l-u):"bottom"===this.textBaseline?(this.ascent=l-u,this.descent=u):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(s=i.dx)&&void 0!==s?s:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=er(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,n,s,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+n;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qs(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const u=uh(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},u),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,n,s,r,a){var o;let l=e+i,h=this.text,c=this.left+n+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let u=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,u="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qs(h,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===u);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===u&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===u&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Qs(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=er(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-n}return i}}const ph=["width","height","image",...gl];class gh extends xl{constructor(t){super(t),this.type="image",this.numberType=Oo,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Nr(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:n=e.maxWidth,maxHeight:s=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>n/s?(r=n,a=n/t):(a=s,r=s*t)}}else r=n,a=s}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);return $l(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Ns[t]}needUpdateTags(t){return super.needUpdateTags(t,ph)}needUpdateTag(t){return super.needUpdateTag(t,ph)}clone(){return new gh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gh.NOWORK_ANIMATE_ATTR}}function fh(t){return new gh(t)}gh.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},vl);class mh extends gh{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=Zr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(g(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zr(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){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=Ns.width,height:e=Ns.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,s=(i-t)/2,r=(n-e)/2;return this._AABBBounds.expand([0,2*s,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class yh{constructor(t,e,i,n,s,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=s,this.top=i-n,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof mh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Xs[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof dh){const e=Zs.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let s=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?s=t-this.actualWidth:"center"===this.textAlign?s=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?s=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof mh?(t["_"+i.x]=s,s+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=s,s+=t[i.width]+r)}))}draw(t,e,i,n,s,r){if(s&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof mh)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===s?"...":s||"";i.ellipsisStr=r;const{width:a}=er(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,s)=>{if(e instanceof mh)return;const r=e.drawBackground(t,n,this.ascent,i,0===s,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],n=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,n.right-i.left,n.bottom-i.top)})),this.paragraphs.forEach(((e,s)=>{if(e instanceof mh)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Ys;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:s=1}=e;t.globalAlpha=n*s,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Js(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||$s;if(!n)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:r=1}=e;t.globalAlpha=s*r,t.fillStyle=i?Hs(t,n,{AABBBounds:i}):n,Js(t,e)}(t,e.character,a),e.draw(t,n,this.ascent,i,0===s,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof mh)break;const{width:s}=er(t,n.character,n.ascentDescentMode),r=s||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof mh?t.width:t.getWidthWithEllips(this.direction)})),i}}class bh{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=Xs[this.direction]}store(t){if(t instanceof mh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new yh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof mh?"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||this.newLine)&&("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,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,s=Qs(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==s){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new dh(i,t.newLine,t.character,t.ascentDescentMode),new dh(n,!0,t.character,t.ascentDescentMode)]}(t,s);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let vh=!1;try{vh=Intl&&"function"==typeof Intl.Segmenter}catch(t){vh=!1}const xh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...gl];class _h extends xl{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=jo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Us.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:Us.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:Us.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:Us.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:Us.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:Us.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:Us.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:Us.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Nr(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&p(t.text)&&_h.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&p(t.text)&&_h.splitText(t.text).length>1)))}static splitText(t){if(vh){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:n}of e.segment(t))i.push(n);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const i=_h.splitText(t.text.toString());if(p(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const s=i[n];e.push(Object.assign(Object.assign({},t),{text:s}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var n,s,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:u=e.textAlign,textBaseline:d=(null!==(s=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)&&void 0!==s?s:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:n}=t.getActualSize();let s=o||e||0,r=l||n||0;r="number"==typeof c&&r>c?c:r||0,s="number"==typeof h&&s>h?h:s||0,i.set(0,0,s,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(d){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(u){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return i.translate(f,g),sn.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||sn.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,xh)}needUpdateTag(t){return super.needUpdateTag(t,xh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:u,upgradeAttrs:d}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:u},t);return(null==d?void 0:d.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:i,maxHeight:n,width:s,height:r,ellipsis:a,wordBreak:o,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d,disableAutoWrapLine:p,editable:g,ascentDescentMode:f,upgradeAttrs:m}=this.attribute,b=m&&m.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!_h.AllSingleCharacter(v)&&(v=_h.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new mh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let n=0;n<i.length;n++)if(0===n)x.push(new dh(i[n],!1,e,f));else if(i[n]||t===_.length-1)x.push(new dh(i[n],!0,e,f));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new dh(i[n],!0,e,f))}}else e.text&&x.push(new dh(e.text,!1,e,f))}const A="number"==typeof i&&Number.isFinite(i)&&i>0,S="number"==typeof n&&Number.isFinite(n)&&n>0,T="number"==typeof s&&Number.isFinite(s)&&s>0&&(!A||s<=i),w="number"==typeof r&&Number.isFinite(r)&&r>0&&(!S||r<=n),M=new ch(0,0,(T?s:A?i:0)||0,(w?r:S?n:0)||0,a,o,l,h,c,u||"horizontal",!T&&A,!w&&S,d||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new bh(M);if(B.newLine=b,p){let t=0,e=!1;for(let i=0;i<x.length;i++){const n=x[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&M.lines[M.lines.length-1].paragraphs.push(n)):B.deal(n,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,M.lines[M.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?i:n)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new _h(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,s,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(s=this.stage)||void 0===s||s.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let s;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-n})&&(s=e,s.globalX=(null!==(a=s.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],s.globalY=(null!==(o=s.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),s}getNoWorkAnimateAttr(){return _h.NOWORK_ANIMATE_ATTR}}function Ah(t){return new _h(t)}_h.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},vl);const Sh=["path","customPath",...gl];class Th extends xl{constructor(t){super(t),this.type="path",this.numberType=Lo}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=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof ys?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ys?this.cache:t.path)}getGraphicTheme(){return Nr(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);$l(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new ys).fromString(t.path):t.customPath&&(this.cache=new ys,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Sh)}needUpdateTag(t){return super.needUpdateTag(t,Sh)}toCustomPath(){return(new ys).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Th(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Th.NOWORK_ANIMATE_ATTR}}function wh(t){return new Th(t)}Th.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},vl);const Mh=["segments","points","curveType","curveTension",...gl];class Bh extends xl{constructor(t){super(t),this.type="area",this.numberType=ko}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Nr(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),sn.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments}=t,r=i;return s.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ia(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Mh)}needUpdateTag(t){return super.needUpdateTag(t,Mh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new ys;const e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Bh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bh.NOWORK_ANIMATE_ATTR}}Bh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const Ch=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...gl];class kh extends xl{constructor(t){super(t),this.type="arc",this.numberType=Bo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:s=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(s+=n,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(s-r),o=t=>Math.min(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(g(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,s=i-e>=0?1:-1,r=i-e;if(e=At(e),i=e+r,n&&ot(r)<at-it){let r=1,a=1;n.length&&(r=Number(n[0]),a=Number(n[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=h,l-=c;const u=Math.abs(o-l)/2,d=u/o;if(u>it&&o>it)return{startAngle:e-s*d*r,endAngle:i+s*d*a,sc:s*d*r,ec:s*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:n=i.innerPadding,outerPadding:s=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=s,o-=n;const{padRadius:l=pt(a*a+o*o)}=this.attribute,h=ot(e-t);let c=t,u=e,d=t,p=e;const g=r/2;let f=h,m=h;if(g>it&&l>it){const i=e>t?1:-1;let n=ft(Number(l)/o*dt(g)),s=ft(Number(l)/a*dt(g));return(f-=2*n)>it?(n*=i,d+=n,p-=n):(f=0,d=p=(t+e)/2),(m-=2*s)>it?(s*=i,c+=s,u-=s):(m=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return Nr(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=sn.graphicService.updateTempAABBBounds(i);$l(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=r,s-=a,n<s&&(n=s),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(n+=r,s-=a,n<s){const t=n;n=s,s=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return n<=it?i.set(0,0,0,0):Math.abs(o-l)>at-it?i.set(-n,-n,n,n):(ta(l,o,n,i),ta(l,o,s,i)),i}needUpdateTags(t){return super.needUpdateTags(t,Ch)}needUpdateTag(t){return super.needUpdateTag(t,Ch)}toCustomPath(){var t,e,i,n;let s=super.toCustomPath();if(s)return s;const r=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(n=r.outerPadding)&&void 0!==n?n:0);const c=ot(o-a),u=o>a;if(h<l){const t=h;h=l,l=t}if(s=new ys,h<=it)s.moveTo(0,0);else if(c>=at-it)s.moveTo(0+h*ht(a),0+h*dt(a)),s.arc(0,0,h,a,o,!u),l>it&&(s.moveTo(0+l*ht(o),0+l*dt(o)),s.arc(0,0,l,o,a,u));else{const t=h*ht(a),e=h*dt(a),i=l*ht(o),n=l*dt(o);s.moveTo(0+t,0+e),s.arc(0,0,h,a,o,!u),s.lineTo(0+i,0+n),s.arc(0,0,l,o,a,u),s.closePath()}return s}clone(){return new kh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return kh.NOWORK_ANIMATE_ATTR}}function Ph(t){return new kh(t)}kh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);class Oh extends kh{constructor(t){super(t),this.type="arc3d",this.numberType=Co}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:s=e.outerRadius,height:r=0}=t,a=s+r;return i.setValue(-a,-a,a,a),sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Oh.NOWORK_ANIMATE_ATTR}}function Rh(t){return new Oh(t)}Oh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);const Lh=["points","cornerRadius",...gl];class Ih extends xl{constructor(t){super(t),this.type="polygon",this.numberType=Io}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Nr(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),sn.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ia(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Lh)}needUpdateTag(t){return super.needUpdateTag(t,Lh)}toCustomPath(){const t=this.attribute.points,e=new ys;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Ih(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ih.NOWORK_ANIMATE_ATTR}}function Eh(t){return new Ih(t)}Ih.NOWORK_ANIMATE_ATTR=vl;class Dh extends Ih{constructor(t){super(t),this.type="pyramid3d",this.numberType=Eo}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],s=e.x-n.x;return 0===s?0:(e.y-n.y)/s})),i=t.map((t=>({p:t,d:0})));let n=!1,s=0;for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){if(e[t]===e[r]){n=!0;const e=vt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,s=ct(s,e);const a=vt.distancePP(i[r].p,i[r+1].p);i[r].d=a,i[r+1].d=a,s=ct(s,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(s-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const r={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.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]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return Dh.NOWORK_ANIMATE_ATTR}}function Fh(t){return new Dh(t)}Dh.NOWORK_ANIMATE_ATTR=vl;class jh extends Al{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Uh(t){return new jh(t)}const Nh=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Wh;function zh(t){return Wh||(Wh=Nh.CreateGraphic("text",{})),Wh.initAttributes(t),Wh.AABBBounds}var Gh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Vh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hh=function(t,e){return function(i,n){e(i,n,t)}};class Xh{constructor(){this.time=Bn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Nr(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:y,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=n,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*n*o,e.height*n*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*o,s=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(d=i*(u/n),p=u):"repeat-y"===s&&(p=n*(c/i),d=c);const r=t.dpr,a=Lr.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),Lr.free(a)}const n=t.dpr,a=t.createPattern(e,s);a.setTransform&&a.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}}const $h=new Xh;let Yh=class{constructor(t){this.subRenderContribitions=t,this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}};Yh=Gh([Ei(),Hh(0,Li(Zi)),Hh(0,Di(Ul)),Vh("design:paramtypes",[Object])],Yh);const qh=new class{constructor(){this.time=Bn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||u),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const Kh=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const Zh=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=Lr.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Lr.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,at),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,g,f,m)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=Lr.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(y/x),A=d.rows?d.rows:Math.ceil(b/x),S=d.gutterColumn?d.gutterColumn:2*v,T=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=th({}));const w=d.columns?y/d.columns:x,M=d.rows?b/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=n+x/2+r*x,l=s+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=s;let{amplitude:d=10}=s;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=d*Math.sin((e+m+u)/y+u);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,n+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const Jh=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=w?o:Vs(e,o,e.dpr),c=o/B,d="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+d*h,innerRadius:M-d*h,startAngle:b-d*c,endAngle:v+d*c}),e.beginPath(),Rl(t,e,i,n,B+d*h,M-d*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,s,(_-i)/S,(A-n)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(d,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Qh=Zh,tc=$h,ec=nt/2;function ic(t,e,i,n,s,r,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),n<0&&(e+=n,n=-n),s<0&&(i+=s,s=-s),y(r,!0))l=[r=ot(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=ot(t[0]),l=[e,e,e,e];break;case 2:case 3:e=ot(t[0]),i=ot(t[1]),l=[e,i,e,i];break;default:l=t,l[0]=ot(l[0]),l[1]=ot(l[1]),l[2]=ot(l[2]),l[3]=ot(l[3])}}else l=[0,0,0,0];if(n<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,i,n,s);const[h,c,u,d]=[[e,i],[e+n,i],[e+n,i+s],[e,i+s]],p=Math.min(n/2,s/2),g=[Math.min(p,l[0]),Math.min(p,l[1]),Math.min(p,l[2]),Math.min(p,l[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],b=[c[0]-g[1],c[1]],v=[c[0],c[1]+g[1]],x=[u[0]-g[2],u[1]],_=[u[0],u[1]-g[2]],A=[d[0]+g[3],d[1]],S=[d[0],d[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!N(b,v)){o&&o[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-ec,0,!1)}if(o&&o[1]?o[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!N(x,_)){const e=_[0]-g[2],i=_[1];o&&o[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,g[2],0,ec,!1)}if(o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!N(A,S)){const e=A[0],i=A[1]-g[3];o&&o[2]&&t.moveTo(A[0],A[1]),t.arc(e,i,g[3],ec,nt,!1)}if(o&&o[3]?o[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!N(f,m)){const e=f[0],i=f[1]+g[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],nt,nt+ec,!1)}}else o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),o&&o[1]?o[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),o&&o[2]?o[2](A[0],A[1],f[0],f[1]):t.lineTo(f[0],f[1]);return!o&&t.closePath(),t}var nc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class sc{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,m=p&&!1!==p.visible;if(!f&&!m)return;const{cornerRadius:y=l.cornerRadius,cornerType:b=l.cornerType,opacity:v=l.opacity,x:x=l.x,y:_=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY,x1:T,y1:w,keepStrokeScale:M=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-i)||0,C=(null!=C?C:w-n)||0;const k=(s,r)=>{const a=!(!s||!s.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=s,c=M?h:Vs(e,h,e.dpr),d=i+o*c,p=n+o*c,f=2*c;if(0===y||g(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(d,p,B-o*f,C-o*f)):(e.beginPath(),ic(e,d,p,B-o*f,C-o*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,s,(x-i)/A,(_-n)/S,l[r]),l[r].opacity=a,e.stroke()}};f&&k(d,"outerBorder"),m&&k(p,"innerBorder")}}let rc=class{constructor(){this.time=Bn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}};rc=nc([Ei()],rc);let ac=class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:m=l.y,stroke:y=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:v=l.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:d-f)||0,_=(null!=_?_:p-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,l),!(0===b||g(b)&&b.every((t=>0===t)))){let s,r=0;return ic(e,i,n,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,h,c,u)=>{y[o]&&(r===o-1&&y[o]===s||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),i,n,l),e.beginPath(),e.moveTo(a,h),s=y[o]),r=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),y[0]?e.lineTo(i+x,n):e.moveTo(i+x,n),y[1]?e.lineTo(i+x,n+_):e.moveTo(i+x,n+_),y[2]?e.lineTo(i,n+_):e.moveTo(i,n+_),y[3]){const t=y[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}};ac=nc([Ei()],ac);const oc=new sc,lc=Zh,hc=$h;const cc=new class extends sc{constructor(){super(...arguments),this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){return super.drawShape(t,e,i,n,s,r,a,o,l,h,c,u)}},uc=$h;const dc=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=S?o:Vs(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,y,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,s,(v-i)/_,(x-n)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},pc=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,y,i,n,p,m,((s,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-n)/v,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-n)/v,l),e.stroke())))}},gc=Zh,fc=$h,mc={x:0,y:0,z:0,lastModelMatrix:null};class yc{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(qh),this.builtinContributions.push(Kh),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Bn.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Bn.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=Nr(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=Ml(u,d,h),v=Cl(u,g),x=Tl(h),_=wl(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return On(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,n-y,l),e.fill())),this.afterRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Ml(o,l,s),p=Cl(o,c),g=Tl(s,r),f=wl(a,h);return!(!t.valid||!u)&&!(!g&&!f)&&!!(d||p||i||n||r)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i,n=!1){const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;mc.x=s,mc.y=r,mc.z=a,mc.lastModelMatrix=u;const p=d&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const n=Zo.allocate(),s=Zo.allocate();Hl(s,t,e),$o(n,u||n,s),mc.x=0,mc.y=0,mc.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Zo.free(s)}if(g&&!u){const n=t.getOffsetXY(e);mc.x+=n.x,mc.y+=n.y,mc.z=a,i.setTransformForCurrent()}else if(p)mc.x=0,mc.y=0,mc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);mc.x+=n.x,mc.y+=n.y,this.transformWithoutTranslate(i,mc.x,mc.y,mc.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),mc.x=0,mc.y=0,mc.z=0;return mc}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},c={x:s,y:0},u={x:s,y:r};n.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),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,m=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,y=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s,r){const{context:a}=n;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawPathProxy(t,a,h,c,n,s)||(this.drawShape(t,a,h,c,n,s,null,null,r),this.z=0,a.modelMatrix!==d&&Zo.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var bc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},vc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,n){e(i,n,t)}};let _c=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Bo,this.builtinContributions=[Jh,tc,Qh],this.init(t)}drawArcTailCapPath(t,e,i,n,s,r,a,o){const l=o-a,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=o;const d=u>c;let p=!1;if(s<r){const t=s;s=r,r=t}const{outerDeltaAngle:g,xors:f,yors:m,xirs:y,yirs:b,limitedOcr:v,outerCornerRadiusStart:x,outerCornerRadiusEnd:_,maxOuterCornerRadius:A,xore:S,yore:T,xire:w,yire:M,limitedIcr:B,innerDeltaAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,c,u,r,s);if(v>it){const t=ut(x,v),r=ut(_,v),a=Pl(y,b,f,m,s,t,Number(d)),o=Pl(S,T,w,M,s,r,Number(d));if(v<A&&t===r)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,v,lt(a.y01,a.x01),lt(o.y01,o.x01),!d);else{const t=u-l-.03,a=lt(o.y11,o.x11);e.arc(i,n,s,t,a,!d),r>0&&e.arc(i+o.cx,n+o.cy,r,lt(o.y11,o.x11),lt(o.y01,o.x01),!d)}}else e.moveTo(i+f,n+m);if(!(r>it)||C<.001)e.lineTo(i+w,n+M),p=!0;else if(B>it){const t=ut(P,B),s=ut(O,B),a=Pl(w,M,S,T,r,-s,Number(d)),o=Pl(f,m,y,b,r,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),B<R&&t===s){const t=lt(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,B,lt(a.y01,a.x01),t,!d)}else{s>0&&e.arc(i+a.cx,n+a.cy,s,lt(a.y01,a.x01),lt(a.y11,a.x11),!d);const t=lt(a.cy+a.y11,a.cx+a.x11),o=u-l-.03;e.arc(i,n,r,t,o,d)}}else e.lineTo(i+r*ht(k),n+r*dt(k));return p}drawShape(t,e,i,n,s,r,o,l,h){h=null!=h?h:Nr(t,null==r?void 0:r.theme).arc;const{fill:c=h.fill,stroke:u=h.stroke,x:d=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(a(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();ot(n-i)<at-it&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let i=!0;if(a(t,!0)){for(let n=0;n<4;n++)qr[n]=t,i&&(i=!(null!==(e=qr[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)qr[e]=!!t[e],i&&(i=!!qr[e]);else qr[0]=!1,qr[1]=!1,qr[2]=!1,qr[3]=!1;return{isFullStroke:i,stroke:qr}})(u);if((b||k)&&(e.beginPath(),Rl(t,e,i,n,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),g?(this._runStroke(t,e,i,n,h,v,k,y,l),this._runFill(t,e,i,n,h,b,m,d,p,o)):(this._runFill(t,e,i,n,h,b,m,d,p,o),this._runStroke(t,e,i,n,h,v,k,y,l))),!k&&v&&(e.beginPath(),Rl(t,e,i,n,T,w,P),C||this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(a(A)&&A||A[1])&&S){const{startAngle:r,endAngle:a}=t.getParsedAngle();if(ot(a-r)>=at-it){e.beginPath();const r=Math.abs(T-w)/2/T,{endAngle:a=h.endAngle,fill:c=h.fill}=t.attribute,u=a;this.drawArcTailCapPath(t,e,i,n,T,w,u,u+r),C||this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l);const d=()=>{if(b){const s=c;if("conical"===s.gradient){const r=function(t,e,i,n){const{stops:s,startAngle:r,endAngle:a}=n;for(;i<0;)i+=at;for(;i>at;)i-=at;if(i<r)return s[0].color;if(i>a)return s[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t<s.length;t++)if(s[t].offset>=h){o=s[t-1],l=s[t];break}return h=(h-o.offset)/(l.offset-o.offset),al(o.color,l.color,h,!1)}(0,0,a,s);o||Ml&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=r,e.fill())}}},p=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))};d(),p()}}this.afterRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,n,s,r,a,o,l,h){r&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,n,s),e.stroke()))}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n,s)}};function Ac(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,a):t.lineTo(s+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[n]=jn(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,a)}}function Sc(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+s,o+r,a)}else d&&(h=!n,t.lineTo(d.x+s,d.y+r,a))}return h}_c=bc([Ei(),xc(0,Li(Zi)),xc(0,Di(Ll)),vc("design:paramtypes",[Object])],_c);var Tc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let wc=class extends yc{constructor(){super(...arguments),this.numberType=Ro}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,a,o,l,h,c,u,d,p,f){var m;if(!e)return;t.beginPath();(function(t,e,i,n,s){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=s||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Sc(t,n,e,i,r,a,o),e=n):e=n}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),Ac(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===n?d=wn.ROW:"y"===n?d=wn.COLUMN:"auto"===n&&(d=e.direction);const p=i*e.tryUpdateLength(d);let g=0,f=!0,m=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],n=i.getLength(d),l=(p-g)/n;if(g+=n,l<0)break;if(h){if(i.originP1===i.originP2){m=i;continue}f=Sc(t,i,m,f,r,a,o),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),Ac(t,i,ut(l,1),s),c=!1}}})(t,e,l,h,{offsetX:c,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),d.cache&&!g(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:y=0,x:b=0}=a;return!1!==i&&(p?p(t,a,o):s&&(t.setCommonStyle(d,a,y-c,b-u,o),t.fill())),!1!==n&&(f?f(t,a,o):r&&(t.setStrokeStyle(d,a,y-c,b-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,i,n,s,r,a,o){const l=Nr(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=l.curveTension,connectedType:y=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:b=l.curveType}=t.attribute;f&&"linear"===b&&(b="linearClosed");const{clipRange:v=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===b)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,s,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=ms(_(t.points,y),b,{startPoint:e,curveTension:m});return n=s,s})).filter((t=>!!t)),"linearClosed"===b){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ms(_(n,y),b,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,s[g],[l,t.attribute],v,x,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const y=r.getLength(),b=(p-g)/y;g+=y,b>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,u,d,s[m],[l,t.attribute],ut(b,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,v,x,i,n,t,a,o)}};wc=Tc([Ei()],wc);var Mc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cc=function(t,e){return function(i,n){e(i,n,t)}};let kc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=Do,this.builtinContributions=[oc,hc,lc],this.init(t)}drawShape(t,e,i,n,s,r,a,o,l){l=null!=l?l:Nr(t,null==r?void 0:r.theme).rect;const{fill:h=l.fill,background:c,stroke:u=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:p=l.cornerType,opacity:f=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:v=l.visible,x1:x,y1:_,x:A=l.x,y:S=l.y,fillStrokeOrder:T=l.fillStrokeOrder}=t.attribute;let{width:w,height:M}=t.attribute;w=(null!=w?w:x-A)||0,M=(null!=M?M:_-S)||0;const B=Bl(f,m,w,M,h),C=kl(f,b,w,M),k=Tl(h,c),P=wl(u,y);if(!t.valid||!v)return;if(!k&&!P)return;if(!(B||C||a||o||c))return;0===d||g(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(i,n,w,M)):(e.beginPath(),ic(e,i,n,w,M,d,"bevel"!==p));const O={doFill:k,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,k,P,B,C,l,s,a,o,O),T?(this._runStroke(t,e,i,n,l,O,C,A,S,o),this._runFill(t,e,i,n,l,O,B,A,S,a)):(this._runFill(t,e,i,n,l,O,B,A,S,a),this._runStroke(t,e,i,n,l,O,C,A,S,o)),this.afterRenderStep(t,e,i,n,k,P,B,C,l,s,a,o)}_runFill(t,e,i,n,s,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,s):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-n,s),e.stroke()))}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).rect;this._draw(t,s,!1,i,n,s)}};kc=Mc([Ei(),Cc(0,Li(Zi)),Cc(0,Di(Dl)),Bc("design:paramtypes",[Object])],kc);var Pc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Oc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rc=function(t,e){return function(i,n){e(i,n,t)}};let Lc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Uo,this.builtinContributions=[dc,fc,gc,pc],this.init(t)}drawShape(t,e,i,n,s,r,a,o,l){var h;l=null!=l?l:Nr(t,null==r?void 0:r.theme).symbol;const{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:m=l.fillStrokeOrder,clipRange:y=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=l.keepDirIn3d}=t.attribute,w=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();let M=i,B=n,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(i,n,w);e.camera=null,g(c)&&(c[0],c[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,c,M,B,C,((s,r)=>{var h,c,g,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(h=r.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=r.stroke)&&void 0!==g?g:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,r,u-i,d-n,l),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,l):x&&y>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-n)/f,l),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,_,A,v,x,l,s,a,o),m?(this._runStroke(t,e,i,n,l,A,x,u,d,S,y,p,f,o),this._runFill(t,e,i,n,l,_,v,u,d,S,a)):(this._runFill(t,e,i,n,l,_,v,u,d,S,a),this._runStroke(t,e,i,n,l,A,x,u,d,S,y,p,f,o)),this.afterRenderStep(t,e,i,n,_,A,v,x,l,s,a,o)}_runFill(t,e,i,n,s,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h,c,u,d,p){r&&!h.isSvg&&(p?p(e,t.attribute,s):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/u,(l-n)/d,s),e.stroke()))}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};Lc=Pc([Ei(),Rc(0,Li(Zi)),Rc(0,Di(Fl)),Oc("design:paramtypes",[Object])],Lc);const Ic=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Xt)}allocate(t,e,i,n){if(!this.pools.length)return(new Xt).setValue(t,e,i,n);const s=this.pools.pop();return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s}allocateByObj(t){if(!this.pools.length)return new Xt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Ec=new class extends Xh{constructor(){super(...arguments),this.time=Bn.beforeFillStroke}drawShape(t,e,i,n,s,r,a,o,l,h,u,d){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=l.backgroundMode,backgroundFit:T=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=c(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),n=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),s=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Ic.allocate(i,n,i+s,n+r),B=B.background,!O){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(A=B.dy)&&void 0!==A?A:0),t,e)}}else k=t.AABBBounds,O||(k=zh(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const s=t.resources.get(B);if("success"!==s.state||!s.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,s.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:s}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=B,s?(ic(e,k.x1,k.y1,k.width(),k.height(),s,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Ic.free(k),C()}};var Dc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(i,n){e(i,n,t)}};let Uc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=No,this.builtinContributions=[Ec],this.init(t)}drawShape(t,e,i,n,s,r,a,o){var l,h,c;const u=Nr(t,null==r?void 0:r.theme).text,{text:d,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:m=u.direction,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:v=u.x,y:x=u.y}=t.attribute,_=null!==(l=na(t.attribute.lineHeight,y))&&void 0!==l?l:y,A=this.valid(t,u,a,o);if(!A)return;const{fVisible:S,sVisible:T,doFill:w,doStroke:M}=A,B=!f,C=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,w,M,S,T,u,s,a,o),B&&this.transformUseContext2d(t,u,C,e);const k=(s,r,l,h)=>{let c=i+r;const d=n+l;if(h){e.highPerformanceSave(),c+=y;const t=Ko.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Ko.free(t)}M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-n,u),e.strokeText(s,c,d,C))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-n,u),e.fillText(s,c,d,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,C),"horizontal"===m){const{multilineLayout:s}=t;if(!s)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=s.bbox;M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-n,u),s.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+n,C)})))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-n,u),s.lines.forEach((s=>{e.fillText(s.str,(s.leftOffset||0)+r+i,(s.topOffset||0)+l+n,C),this.drawUnderLine(p,g,t,(s.leftOffset||0)+r+i,(s.topOffset||0)+l+n,s.descent,(s.descent-s.ascent)/2,C,u,e,{width:s.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:n=u.textBaseline}=t.attribute;if(!b){const e=i;i=null!==(h=t.getBaselineMapAlign()[n])&&void 0!==h?h:"left",n=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const s=t.cache,{verticalList:r}=s;e.textAlign="left",e.textBaseline="top";const a=_*r.length;let o=0;r.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=ct(e,o)}));let l=0,d=0;"bottom"===n?d=-a:"middle"===n&&(d=-a/2),"center"===i?l-=o/2:"right"===i&&(l-=o),r.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),s=o-n;let r=l;"center"===i?r+=s/2:"right"===i&&(r+=s),t.forEach((t=>{const{text:i,width:n,direction:s}=t;k(i,a-(e+1)*_+d,r,s),r+=n}))}))}B&&this.restoreTransformUseContext2d(t,u,C,e),this.afterRenderStep(t,e,i,n,w,M,S,T,u,s,a,o)}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).text,{keepDirIn3d:r=s.keepDirIn3d}=t.attribute,a=!r;this._draw(t,s,a,i,n)}drawUnderLine(t,e,i,n,s,r,a,o,h,c,u){if(e+t<=0)return;const{textAlign:d=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=i.attribute,b=!l(u),v=b?u.width:i.clipedWidth,x=b?0:Nl(d,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(i,_,n,s,h),m&&c.setLineDash(m),c.beginPath();const e=s+r+f;c.moveTo(n+x,e,o),c.lineTo(n+x+v,e,o),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(i,_,n,s,h),c.beginPath();const t=s+a;c.moveTo(n+x,t,o),c.lineTo(n+x+v,t,o),c.stroke()}}};function Nc(t,e,i,n){if(e&&e.length){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}}function Wc(t,e){return Math.sqrt(t*t+e*e)}function zc(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}Uc=Dc([Ei(),jc(0,Li(Zi)),jc(0,Di(jl)),Fc("design:paramtypes",[Object])],Uc);const Gc=Zh,Vc=$h;var Hc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$c=function(t,e){return function(i,n){e(i,n,t)}};let Yc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Io,this.builtinContributions=[Vc,Gc],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Nr(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:f=l.fillStrokeOrder}=t.attribute,m=this.valid(t,l,a,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),c<=0||g(c)&&c.every((t=>0===t))?Nc(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,s,r=!0){var a;if(e.length<3)return void Nc(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=y/m;const v=Wc(u,d),x=Wc(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=zc(h,b,v,u,d),S=zc(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=Wc(T,w),B=zc(h,Wc(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),P&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,y),t.lineTo(S.x+i,S.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,v,x,y,b,l,s,a,o);const _=()=>{v&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,n,v,x,y,b,l,s,a,o)}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};Yc=Hc([Ei(),$c(0,Li(Zi)),$c(0,Di(El)),Xc("design:paramtypes",[Object])],Yc);var qc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zc=function(t,e){return function(i,n){e(i,n,t)}};const Jc=["","repeat-x","repeat-y","repeat"];let Qc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Oo,this.builtinContributions=[cc,uc],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Nr(t).image,{repeatX:h=l.repeatX,repeatY:c=l.repeatY,x:u=l.x,y:d=l.y,cornerRadius:p=l.cornerRadius,fillStrokeOrder:f=l.fillStrokeOrder,cornerType:m=l.cornerType,image:y}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===p||g(p)&&p.every((t=>0===t))?e.rect(i,n,T,w):(ic(e,i,n,T,w,p,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(_)if(a)a(e,t.attribute,l);else if(v){e.setCommonStyle(t,t.attribute,i,n,l);let s=0;if("repeat"===h&&(s|=1),"repeat"===c&&(s|=2),s){const t=e.createPattern(S.data,Jc[s]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,T,w),e.translate(-i,-n,!0)}else e.drawImage(S.data,i,n,T,w)}},C=()=>{A&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,_,!1,v,!1,l,s,a),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,_,!1,v,!1,l,s,a),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,i,n,_,!1,v,!1,l,s,a)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const s=t.resources.get(n);if("loading"===s.state&&p(n))return void Xr.improveImageLoading(n);if("success"!==s.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Nr(t).image;this._draw(t,a,!1,i)}};Qc=qc([Ei(),Zc(0,Li(Zi)),Zc(0,Di(Il)),Kc("design:paramtypes",[Object])],Qc);const tu=Symbol.for("ArcRender"),eu=Symbol.for("Arc3dRender"),iu=Symbol.for("GraphicRender"),nu=Symbol.for("LineRender"),su=Symbol.for("PolygonRender"),ru=Symbol.for("RectRender"),au=Symbol.for("Rect3DRender"),ou=Symbol.for("SymbolRender"),lu=Symbol.for("TextRender"),hu=Symbol.for("RichTextRender"),cu=Symbol.for("Pyramid3dRender"),uu=Symbol.for("ImageRender");var du=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let pu,gu=class extends wc{constructor(){super(...arguments),this.numberType=Ro}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Nr(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=Ml(d,p,c),b=Cl(d,g),v=Tl(c),x=wl(u,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:_}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,_,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};gu=du([Ei()],gu);class fu{static registerPlugin(t,e){fu._pluginClasses[t]=e}static getPlugin(t){return fu._pluginClasses[t]}}fu._pluginClasses={};class mu{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=sl.Get(e,nl.Color1),this.ambient=i;const n=pt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=ut(ct((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=p(e)?sl.Get(e,nl.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*s[0]*n}, ${r[1]*s[1]*n}, ${r[2]*s[2]*n})`}}const yu=()=>{fu.registerPlugin("DirectionalLight",mu)};class bu{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let s,r,a,o,l,h,c,u,d,p;const g=e[0],f=e[1],m=e[2],y=n[0],b=n[1],v=n[2],x=i[0],_=i[1],A=i[2];Math.abs(g-x)<it&&Math.abs(f-_)<it&&Math.abs(m-A)<it?Ho(t):(c=g-x,u=f-_,d=m-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,s=b*d-v*u,r=v*c-y*d,a=y*u-b*c,p=Math.hypot(s,r,a),p?(p=1/p,s*=p,r*=p,a*=p):(s=0,r=0,a=0),o=u*a-d*r,l=d*s-c*a,h=c*r-u*s,p=Math.hypot(o,l,h),p?(p=1/p,o*=p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=s,t[1]=o,t[2]=c,t[3]=0,t[4]=r,t[5]=l,t[6]=u,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(s*g+r*f+a*m),t[13]=-(o*g+l*f+h*m),t[14]=-(c*g+u*f+d*m),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,s,r,a){const o=1/(e-i),l=1/(n-s),h=1/(r-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(s+n)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Yo(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:s}=this._params.viewParams;Yo(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const r=this.getProjectionScale(i);return{x:t*r+s[0],y:e*r+s[1]}}}const vu=()=>{fu.registerPlugin("OrthoCamera",bu)};let xu=!1;const _u=new Ti((t=>{xu||(xu=!0,t(_c).toSelf().inSingletonScope(),t(tu).to(_c).inSingletonScope(),t(iu).toService(tu),t(Ll).toService(Yh),Qi(t,Ll))}));let Au=!1;const Su=new Ti((t=>{Au||(Au=!0,t(kc).toSelf().inSingletonScope(),t(ru).to(kc).inSingletonScope(),t(iu).toService(ru),t(ac).toSelf(),t(rc).toSelf(),t(Dl).toService(ac),t(Dl).toService(rc),t(Dl).toService(Yh),Qi(t,Dl))}));let Tu=!1;const wu=new Ti((t=>{Tu||(Tu=!0,t(wc).toSelf().inSingletonScope(),t(gu).toSelf().inSingletonScope(),t(nu).to(wc).inSingletonScope(),t(iu).toService(nu))}));let Mu=!1;const Bu=new Ti((t=>{Mu||(Mu=!0,t(Lc).toSelf().inSingletonScope(),t(ou).to(Lc).inSingletonScope(),t(iu).toService(ou),t(Fl).toService(Yh),Qi(t,Fl))}));let Cu=!1;const ku=new Ti((t=>{Cu||(Cu=!0,t(lu).to(Uc).inSingletonScope(),t(iu).toService(lu),t(jl).toService(Yh),Qi(t,jl))}));let Pu=!1;const Ou=new Ti((t=>{Pu||(Pu=!0,t(su).to(Yc).inSingletonScope(),t(iu).toService(su),t(El).toService(Yh),Qi(t,El))}));var Ru=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Lu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Iu=class extends yc{constructor(){super(),this.numberType=jo,this.builtinContributions=[Ec],this.init()}drawShape(t,e,i,n,s){const r=Nr(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=Ml(o,l,!0),u=Ml(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,r,s),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,r,s))}drawIcon(t,e,i,n,s){var r;const a=Nr(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-o)/2,s=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,n-s,y,b)):(e.beginPath(),ic(e,i-t,n-s,y,b,f,!0)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,o,l))}draw(t,e,i){const n=Nr(t).richtext;this._draw(t,n,!1,i)}};Iu=Ru([Ei(),Lu("design:paramtypes",[])],Iu);let Eu=!1;const Du=new Ti((t=>{Eu||(Eu=!0,t(hu).to(Iu).inSingletonScope(),t(iu).toService(hu))}));let Fu=!1;const ju=new Ti((t=>{Fu||(Fu=!0,t(uu).to(Qc).inSingletonScope(),t(iu).toService(uu),t(Il).toService(Yh),Qi(t,Il))}));class Uu extends yc{stroke(t,e,i,n,s){const r=n.vertices;n.edges.forEach((n=>{const a=r[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};s.beginPath(),s.moveTo(o.x,o.y,o.z),s.lineTo(h.x,h.y,h.z),s.stroke()}))}fill(t,e,i,n,s,r,a,o,l,h,c){const u=sl.Get(r,nl.Color255),d=n.vertices,p=d.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:s,normal:p}=n.polygon,g=d[s[0]],f=d[s[1]],m=d[s[2]],y=d[s[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,u):r,a.fill())}))}}var Nu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Wu=class extends Uu{constructor(){super(...arguments),this.type="rect3d",this.numberType=Fo}drawShape(t,e,i,n,s,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).rect,{fill:c=h.fill,stroke:u=h.stroke,x1:d,y1:p,x:g,y:f,opacity:m=h.opacity,fillOpacity:y=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:_,height:A}=t.attribute;_=(null!=_?_:d-g)||0,A=(null!=A?A:p-f)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=Bl(m,y,_,A,c),w=kl(m,v,_,A),M=Tl(c),B=wl(u,b);if(!t.valid||!x)return;if(!M&&!B)return;if(!(T||w||a||o))return;const{light:C}=s.stage||{},k=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,S,k,null,s,e,C,null,null,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,k,e))}draw(t,e,i){const n=Nr(t).rect;this._draw(t,n,!1,i)}};Wu=Nu([Ei()],Wu);let zu=!1;const Gu=new Ti((t=>{zu||(zu=!0,t(au).to(Wu).inSingletonScope(),t(iu).toService(au))}));var Vu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Hu=class extends yc{constructor(){super(...arguments),this.numberType=Co}drawShape(t,e,i,n,s,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).arc,{fill:c=h.fill}=t.attribute,u=this.valid(t,h,a,o);if(!u)return;const{fVisible:d,sVisible:p,doFill:g,doStroke:f}=u,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=h.outerPadding,innerPadding:b=h.innerPadding,height:v=10}=t.attribute;let{outerRadius:x=h.outerRadius,innerRadius:_=h.innerRadius}=t.attribute;x+=y,_-=b;const A=sl.Get(c,nl.Color255),{light:S}=s.stage||{},T=s.hack_pieFace,w={top:m,bottom:m+v},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===T||"top"===T?(e.beginPath(),function(t,e,i,n,s,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=it)e.moveTo(i,n,s);else if(h>=at-it)e.moveTo(i+r*ht(o),n+r*dt(o),s),e.arc(i,n,r,o,l,!c,s),a>it&&(e.moveTo(i+a*ht(l),n+a*dt(l),s),e.arc(i,n,a,l,o,c,s));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:g,innerEndAngle:f,innerStartAngle:m}=t.getParsePadAngle(o,l),y=r*ht(p),b=r*dt(p),v=a*ht(f),x=a*dt(f);h<.001?u=!0:(e.moveTo(i+y,n+b,s),e.arc(i,n,r,p,g,!c,s)),!(a>it)||d<.001?(e.lineTo(i+v,n+x,s),u=!0):(e.lineTo(i+v,n+x,s),e.arc(i,n,a,f,m,c,s))}e.closePath()}(t,e,i,n,w[T],x,_),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))):"outside"!==T&&"inside"!==T||("inside"===T&&(e.save(),e.beginPath(),e.arc(i,n,_,0,at,!0,w.top),e.clip()),e.beginPath(),function(t,e,i,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=ot(h-l),u=h>l;let d=!1;if(a<=it)e.moveTo(i,n,s);else if(c>=at-it)e.moveTo(i+a*ht(l),n+a*dt(l),s),e.arc(i,n,a,l,h,!u,s),e.lineTo(i+a*ht(h),n+a*dt(h),r),e.arc(i,n,a,h,l,u,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(l,h),g=a*ht(c),f=a*dt(c),m=a*ht(p),y=a*dt(p);t<.001?d=!0:(e.moveTo(i+g,n+f,s),e.arc(i,n,a,c,p,!u,s),e.lineTo(i+m,n+y,r),e.arc(i,n,a,p,c,u,r))}e.closePath()}(t,e,i,n,w.top,w.bottom,"outside"===T?x:_,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:s,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===T?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:s,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),"inside"===T&&e.restore())}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n)}};Hu=Vu([Ei()],Hu);let Xu=!1;const $u=new Ti((t=>{Xu||(Xu=!0,t(eu).to(Hu).inSingletonScope(),t(iu).toService(eu))}));var Yu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let qu=class extends Uu{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Eo}drawShape(t,e,i,n,s,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=s.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,p,f,d,s,e,g,t,h,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,f,e))}draw(t,e,i){const n=Nr(t).polygon;this._draw(t,n,!1,i)}};qu=Yu([Ei()],qu);let Ku=!1;const Zu=new Ti((t=>{Ku||(Ku=!0,t(cu).to(qu).inSingletonScope(),t(iu).toService(cu))}));class Ju{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Si.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const s=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=s/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Qu=t=>t.zField||t.series&&t.series.some((t=>t.zField));class td extends e.BasePlugin{constructor(){super(td.type),this.type="VChart3dPlugin"}onInit(t,e){var i,n;if(this._is3d=!!(n=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(n.type)||Qu(n),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&Qu(e)&&(e.layout={type:"layout3d"})}}td.pluginType="chart",td.type="VChart3dPlugin";const ed=()=>{e.registerChartPlugin(td),yu(),vu(),fu.registerPlugin("ViewTransform3dPlugin",Ju)},id={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class nd extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const sd=Symbol.for("MathPickerContribution"),rd=Symbol.for("MathArcPicker"),ad=Symbol.for("MathImagePicker"),od=Symbol.for("MathLinePicker"),ld=Symbol.for("MathRectPicker"),hd=Symbol.for("MathSymbolPicker"),cd=Symbol.for("MathTextPicker"),ud=Symbol.for("MathPolygonPicker"),dd=Symbol.for("CanvasArcPicker"),pd=Symbol.for("CanvasArc3dPicker"),gd=Symbol.for("CanvasImagePicker"),fd=Symbol.for("CanvasLinePicker"),md=Symbol.for("CanvasRectPicker"),yd=Symbol.for("CanvasRect3dPicker"),bd=Symbol.for("CanvasSymbolPicker"),vd=Symbol.for("CanvasTextPicker"),xd=Symbol.for("CanvasPolygonPicker"),_d=Symbol.for("CanvasPyramid3dPicker"),Ad=Symbol.for("CanvasRichTextPicker"),Sd=Symbol.for("CanvasPickerContribution");class Td{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n,s)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=s||l,o)),((t,i,s,r)=>{if(o||l)return!0;const a=i.lineWidth||s.lineWidth,h=i.pickStrokeBuffer||s.pickStrokeBuffer,c=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=c?a+h:Vs(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var wd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Md=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bd=function(t,e){return function(i,n){e(i,n,t)}};let Cd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};Cd=wd([Ei(),Bd(0,Li(tu)),Md("design:paramtypes",[Object])],Cd);let kd=!1;const Pd=new Ti(((t,e,i,n)=>{kd||(kd=!0,t(rd).to(Cd).inSingletonScope(),t(sd).toService(rd))}));var Od=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Rd=class{constructor(){this.type="image",this.numberType=Oo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};Rd=Od([Ei()],Rd);let Ld=!1;const Id=new Ti(((t,e,i,n)=>{Ld||(Ld=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var Ed=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Dd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fd=function(t,e){return function(i,n){e(i,n,t)}};let jd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};jd=Ed([Ei(),Fd(0,Li(nu)),Dd("design:paramtypes",[Object])],jd);let Ud=!1;const Nd=new Ti(((t,e,i,n)=>{Ud||(Ud=!0,t(od).to(jd).inSingletonScope(),t(sd).toService(od))}));var Wd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gd=function(t,e){return function(i,n){e(i,n,t)}};let Vd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Io}};Vd=Wd([Ei(),Gd(0,Li(su)),zd("design:paramtypes",[Object])],Vd);let Hd=!1;const Xd=new Ti(((t,e,i,n)=>{Hd||(Hd=!0,t(ud).to(Vd).inSingletonScope(),t(sd).toService(ud))})),$d=new Xt;class Yd{constructor(){this.type="rect",this.numberType=Do}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme(),{cornerRadius:r=s.cornerRadius}=t.attribute;let{x:a=s.x,y:o=s.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||y(r,!0)&&0!==r||g(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,s)=>{if(h)return!0;const r=i.lineWidth||s.lineWidth,a=i.pickStrokeBuffer||s.pickStrokeBuffer,o=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=o?r+a:Vs(n,r+a,n.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=s.fill,stroke:n=s.stroke,lineWidth:r=s.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;$d.setValue(i.x1,i.y1,i.x2,i.y2),$d.expand(-r/2),h=!$d.containsPoint(e)}}return n.highPerformanceRestore(),h}}var qd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zd=function(t,e){return function(i,n){e(i,n,t)}};let Jd=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Jd=qd([Ei(),Zd(0,Li(ru)),Kd("design:paramtypes",[Object])],Jd);let Qd=!1;const tp=new Ti(((t,e,i,n)=>{Qd||(Qd=!0,t(ld).to(Jd).inSingletonScope(),t(sd).toService(ld))}));let ep=!1;const ip=new Ti(((t,e,i,n)=>{ep||(ep=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var np=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rp=function(t,e){return function(i,n){e(i,n,t)}};let ap=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}};ap=np([Ei(),rp(0,Li(ou)),sp("design:paramtypes",[Object])],ap);let op=!1;const lp=new Ti(((t,e,i,n)=>{op||(op=!0,t(hd).to(ap).inSingletonScope(),t(sd).toService(hd))}));var hp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let cp=class{constructor(){this.type="text",this.numberType=No}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};cp=hp([Ei()],cp);let up=!1;const dp=new Ti(((t,e,i,n)=>{up||(up=!0,t(cd).to(cp).inSingletonScope(),t(sd).toService(cd))}));var pp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},gp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fp=function(t,e){return function(i,n){e(i,n,t)}};let mp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};mp=pp([Ei(),fp(0,Li(tu)),gp("design:paramtypes",[Object])],mp);let yp=!1;const bp=new Ti(((t,e,i,n)=>{yp||(yp=!0,t(dd).to(mp).inSingletonScope(),t(Sd).toService(dd))}));var vp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_p=function(t,e){return function(i,n){e(i,n,t)}};let Ap=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Ap=vp([Ei(),_p(0,Li(ru)),xp("design:paramtypes",[Object])],Ap);let Sp=!1;const Tp=new Ti(((t,e,i,n)=>{Sp||(Sp=!0,t(md).to(Ap).inSingletonScope(),t(Sd).toService(md))}));class wp extends yc{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Vs(n,s+r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&Zo.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Mp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cp=function(t,e){return function(i,n){e(i,n,t)}};let kp=class extends wp{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};kp=Mp([Ei(),Cp(0,Li(nu)),Bp("design:paramtypes",[Object])],kp);let Pp=!1;const Op=new Ti(((t,e,i,n)=>{Pp||(Pp=!0,t(fd).to(kp).inSingletonScope(),t(Sd).toService(fd))}));class Rp extends yc{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&Zo.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Lp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ip=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ep=function(t,e){return function(i,n){e(i,n,t)}};let Dp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Vs(n,s+r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Zo.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};Dp=Lp([Ei(),Ep(0,Li(ou)),Ip("design:paramtypes",[Object])],Dp);let Fp=!1;const jp=new Ti(((t,e,i,n)=>{Fp||(Fp=!0,t(bd).to(Dp).inSingletonScope(),t(Sd).toService(bd))}));var Up=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wp=function(t,e){return function(i,n){e(i,n,t)}};let zp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=No}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.AABBBounds;if(!n.camera)return!!s.containsPoint(e);n.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,n,o),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(g)return!0;const{fontSize:s=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),f=l.width(),m=Wl(a,d,s),y=Nl(o,f);return e.rect(y+h,m+c,f,d,u),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Zo.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),g}};zp=Up([Ei(),Wp(0,Li(lu)),Np("design:paramtypes",[Object])],zp);let Gp=!1;const Vp=new Ti(((t,e,i,n)=>{Gp||(Gp=!0,t(vd).to(zp).inSingletonScope(),t(Sd).toService(vd))}));var Hp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=function(t,e){return function(i,n){e(i,n,t)}};let Yp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Io}};Yp=Hp([Ei(),$p(0,Li(su)),Xp("design:paramtypes",[Object])],Yp);let qp=!1;const Kp=new Ti(((t,e,i,n)=>{qp||(qp=!0,t(xd).to(Yp).inSingletonScope(),t(Sd).toService(xd))}));var Zp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qp=function(t,e){return function(i,n){e(i,n,t)}};let tg=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=jo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};tg=Zp([Ei(),Qp(0,Li(hu)),Jp("design:paramtypes",[Object])],tg);let eg=!1;const ig=new Ti(((t,e,i,n)=>{eg||(eg=!0,t(Ad).to(tg).inSingletonScope(),t(Sd).toService(Ad))}));var ng=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},sg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rg=function(t,e){return function(i,n){e(i,n,t)}};let ag=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Oo}};ag=ng([Ei(),rg(0,Li(uu)),sg("design:paramtypes",[Object])],ag);let og=!1;const lg=new Ti(((t,e,i,n)=>{og||(og=!0,t(gd).to(ag).inSingletonScope(),t(Sd).toService(gd))}));var hg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},cg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ug=function(t,e){return function(i,n){e(i,n,t)}};let dg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Fo,this.themeType="rect"}};dg=hg([Ei(),ug(0,Li(au)),cg("design:paramtypes",[Object])],dg);let pg=!1;const gg=new Ti(((t,e,i,n)=>{pg||(pg=!0,t(yd).to(dg).inSingletonScope(),t(Sd).toService(yd))}));var fg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},mg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yg=function(t,e){return function(i,n){e(i,n,t)}};let bg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Co,this.themeType="arc"}};bg=fg([Ei(),yg(0,Li(eu)),mg("design:paramtypes",[Object])],bg);let vg=!1;const xg=new Ti(((t,e,i,n)=>{vg||(vg=!0,t(pd).to(bg).inSingletonScope(),t(Sd).toService(pd))}));var _g=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ag=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sg=function(t,e){return function(i,n){e(i,n,t)}};let Tg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Eo,this.themeType="polygon"}};Tg=_g([Ei(),Sg(0,Li(cu)),Ag("design:paramtypes",[Object])],Tg);let wg=!1;const Mg=new Ti(((t,e,i,n)=>{wg||(wg=!0,t(_d).to(Tg).inSingletonScope(),t(Sd).toService(_d))})),Bg=function(){!function(){if(null==pu)try{const t=document.createElement("canvas"),e=t.getContext("2d");pu=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),pu&&(pu=!!document.createElement)}catch(t){pu=!1}}();const t=sn.global&&sn.global.env;return t?"browser"===t:pu}();function Cg(){Cg.__loaded||(Cg.__loaded=!0,Nh.RegisterGraphicCreator("arc",Ph),ir.load(_u),ir.load(Bg?bp:Pd))}Cg.__loaded=!1;const kg=Cg;function Pg(){Pg.__loaded||(Pg.__loaded=!0,Nh.RegisterGraphicCreator("arc3d",Rh),yu(),vu(),ir.load($u),ir.load(xg))}Pg.__loaded=!1;const Og=Pg;function Rg(){Rg.__loaded||(Rg.__loaded=!0,Nh.RegisterGraphicCreator("group",Sl))}Rg.__loaded=!1;const Lg=Rg;function Ig(){Ig.__loaded||(Ig.__loaded=!0,Nh.RegisterGraphicCreator("image",fh),ir.load(ju),ir.load(Bg?lg:Id))}Ig.__loaded=!1;const Eg=Ig;function Dg(){Dg.__loaded||(Dg.__loaded=!0,Nh.RegisterGraphicCreator("line",nh),ir.load(wu),ir.load(Bg?Op:Nd))}Dg.__loaded=!1;const Fg=Dg;function jg(){jg.__loaded||(jg.__loaded=!0,Nh.RegisterGraphicCreator("polygon",Eh),ir.load(Ou),ir.load(Bg?Kp:Xd))}jg.__loaded=!1;const Ug=jg;function Ng(){Ng.__loaded||(Ng.__loaded=!0,Nh.RegisterGraphicCreator("pyramid3d",Fh),yu(),vu(),ir.load(Zu),ir.load(Mg))}Ng.__loaded=!1;const Wg=Ng;function zg(){zg.__loaded||(zg.__loaded=!0,Nh.RegisterGraphicCreator("rect",ah),ir.load(Su),ir.load(Bg?Tp:tp))}zg.__loaded=!1;const Gg=zg;function Vg(){Vg.__loaded||(Vg.__loaded=!0,Nh.RegisterGraphicCreator("rect3d",hh),ir.load(Gu),ir.load(gg))}Vg.__loaded=!1;const Hg=Vg;function Xg(){Xg.__loaded||(Xg.__loaded=!0,Nh.RegisterGraphicCreator("richtext",Ah),ir.load(Du),ir.load(Bg?ig:ip))}Xg.__loaded=!1;const $g=Xg;function Yg(){Yg.__loaded||(Yg.__loaded=!0,Nh.RegisterGraphicCreator("shadowRoot",Uh))}Yg.__loaded=!1;const qg=Yg;function Kg(){Kg.__loaded||(Kg.__loaded=!0,Nh.RegisterGraphicCreator("symbol",th),ir.load(Bu),ir.load(Bg?jp:lp))}Kg.__loaded=!1;const Zg=Kg;function Jg(){Jg.__loaded||(Jg.__loaded=!0,Nh.RegisterGraphicCreator("text",Zl),ir.load(ku),ir.load(Bg?Vp:dp))}Jg.__loaded=!1;const Qg=Jg;class tf extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=tf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}tf.type="rect3d";const ef=()=>{e.Factory.registerMark(tf.type,tf),qg(),Hg(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",hh)};class nf extends e.BarSeries{constructor(){super(...arguments),this.type=xi.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=nd}}nf.type=xi.bar3d,nf.mark=id,nf.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},nf.transformerConstructor=nd;const sf=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(nf.type,nf)};class rf extends e.Layout{layoutItems(t,i,n,s){this._layoutInit(t,i,n,s);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((t=>"absolute"===t.layoutType)),l=o.filter((t=>"z"===t.layoutOrient));let h={width:0,height:0};if(l.length){h=l[0].getLayoutRect()}this.leftCurrent+=h.width/8,this.rightCurrent-=h.width/8,this.topCurrent+=h.height/8,this.bottomCurrent-=h.height/8;const{regionItems:c,relativeItems:u,relativeOverlapItems:d,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,u,d,g,r),this._processAutoIndent(c,u,d,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=u.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=u.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(m&&l.length){const t=m.getLayoutStartPoint(),e=m.getLayoutRect(),i={x:"left"===y.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===y.layoutOrient?"r2l":"l2r";const n=m.getLayoutRect(),s=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:n.width,height:s.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();s?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-n)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}rf.type="layout3d";const af=()=>{e.Factory.registerLayout(rf.type,rf)};class of extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=yi,this.type="bar3d",this.seriesType=xi.bar3d}}of.type="bar3d",of.seriesType=xi.bar3d,of.transformerConstructor=yi;const lf=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class hf extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class cf extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=cf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}cf.type="pyramid3d";const uf=e.getFunnelTheme(!0);class df extends e.FunnelSeries{constructor(){super(...arguments),this.type=xi.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=hf}initMark(){var t,e,i,n,s,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},df.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},df.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){const{line:t}=null!==(s=this._spec.outerLabel)&&void 0!==s?s:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(df.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(df.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,n;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(n=this._funnelOuterLabelMark)||void 0===n||n.line}}df.type=xi.funnel3d,df.mark=lf,df.builtInTheme={funnel3d:uf},df.transformerConstructor=hf;const pf=()=>{e.Factory.registerMark(cf.type,cf),qg(),Wg(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",Fh),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(df.type,df)};class gf extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=xi.funnel3d}}gf.type="funnel3d",gf.seriesType=xi.funnel3d,gf.transformerConstructor=e.FunnelChartSpecTransformer;class ff extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=xi.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ff.type="histogram3d",ff.seriesType=xi.bar3d,ff.transformerConstructor=e.HistogramChartSpecTransformer;class mf extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class yf extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=yf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}yf.type="arc3d";const bf=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class vf extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class xf extends e.BasePieSeries{constructor(){super(...arguments),this.type=xi.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=vf}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}xf.type=xi.pie3d,xf.mark=bf,xf.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},xf.transformerConstructor=vf;const _f=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),qg(),Og(),e.Factory.registerGraphicComponent("arc3d",Rh),e.Factory.registerMark("arc3d",yf),e.Factory.registerSeries(xf.type,xf)};class Af extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=mf,this.type="pie3d",this.seriesType=xi.pie3d}}Af.type="pie3d",Af.seriesType=xi.pie3d,Af.transformerConstructor=mf;class Sf{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-Sf.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Sf.bounceIn(2*t):.5*Sf.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/at*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*at/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/at*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*at/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/at*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*at/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*at/e)*.5+1}}static registerFunc(t,e){Sf[t]=e}}function Tf(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}Sf.quadIn=Sf.getPowIn(2),Sf.quadOut=Sf.getPowOut(2),Sf.quadInOut=Sf.getPowInOut(2),Sf.cubicIn=Sf.getPowIn(3),Sf.cubicOut=Sf.getPowOut(3),Sf.cubicInOut=Sf.getPowInOut(3),Sf.quartIn=Sf.getPowIn(4),Sf.quartOut=Sf.getPowOut(4),Sf.quartInOut=Sf.getPowInOut(4),Sf.quintIn=Sf.getPowIn(5),Sf.quintOut=Sf.getPowOut(5),Sf.quintInOut=Sf.getPowInOut(5),Sf.backIn=Sf.getBackIn(1.7),Sf.backOut=Sf.getBackOut(1.7),Sf.backInOut=Sf.getBackInOut(1.7),Sf.elasticIn=Sf.getElasticIn(1,.3),Sf.elasticOut=Sf.getElasticOut(1,.3),Sf.elasticInOut=Sf.getElasticInOut(1,.3*1.5),Sf.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Sf.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Sf.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Sf[`flicker${t}`]=e=>Tf(e,t);for(let t=2;t<10;t++)Sf[`aIn${t}`]=e=>t*e*e+(1-t)*e;function wf(t,e,i){return t+(e-t)*i}const Mf=new class{constructor(){this.opacity=(t,e,i,n,s,r)=>{r.attribute.opacity=wf(e,i,n)},this.baseOpacity=(t,e,i,n,s,r)=>{r.attribute.baseOpacity=wf(e,i,n)},this.fillOpacity=(t,e,i,n,s,r)=>{r.attribute.fillOpacity=wf(e,i,n)},this.strokeOpacity=(t,e,i,n,s,r)=>{r.attribute.strokeOpacity=wf(e,i,n)},this.zIndex=(t,e,i,n,s,r)=>{r.attribute.zIndex=wf(e,i,n)},this.backgroundOpacity=(t,e,i,n,s,r)=>{r.attribute.backgroundOpacity=wf(e,i,n)},this.shadowOffsetX=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetX=wf(e,i,n)},this.shadowOffsetY=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetY=wf(e,i,n)},this.shadowBlur=(t,e,i,n,s,r)=>{r.attribute.shadowBlur=wf(e,i,n)},this.fill=(t,e,i,n,s,r)=>{r.attribute.fill=al(e,i,n,!1)},this.fillPure=(t,e,i,n,s,r)=>{r.attribute.fill=s.fromParsedProps.fill?ll(s.fromParsedProps.fill,s.toParsedProps.fill,n):s.toParsedProps.fill},this.stroke=(t,e,i,n,s,r)=>{r.attribute.stroke=al(e,i,n,!1)},this.strokePure=(t,e,i,n,s,r)=>{r.attribute.stroke=s.fromParsedProps.stroke?ll(s.fromParsedProps.stroke,s.toParsedProps.stroke,n):s.toParsedProps.stroke},this.width=(t,e,i,n,s,r)=>{r.attribute.width=wf(e,i,n),r.addUpdateBoundTag()},this.height=(t,e,i,n,s,r)=>{r.attribute.height=wf(e,i,n),r.addUpdateBoundTag()},this.x=(t,e,i,n,s,r)=>{r.attribute.x=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,n,s,r)=>{r.attribute.y=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dx=(t,e,i,n,s,r)=>{r.attribute.dx=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dy=(t,e,i,n,s,r)=>{r.attribute.dy=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,n,s,r)=>{r.attribute.angle=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,n,s,r)=>{r.attribute.scaleX=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,n,s,r)=>{r.attribute.scaleY=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,n,s,r)=>{r.attribute.lineWidth=wf(e,i,n),r.addUpdateBoundTag()},this.startAngle=(t,e,i,n,s,r)=>{r.attribute.startAngle=wf(e,i,n),r.addUpdateBoundTag()},this.endAngle=(t,e,i,n,s,r)=>{r.attribute.endAngle=wf(e,i,n),r.addUpdateBoundTag()},this.radius=(t,e,i,n,s,r)=>{r.attribute.radius=wf(e,i,n),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,n,s,r)=>{r.attribute.outerRadius=wf(e,i,n),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,n,s,r)=>{r.attribute.innerRadius=wf(e,i,n),r.addUpdateBoundTag()},this.size=(t,e,i,n,s,r)=>{r.attribute.size=wf(e,i,n),r.addUpdateBoundTag()},this.points=(t,e,i,n,s,r)=>{r.attribute.points=ia(e,i,n),r.addUpdateBoundTag()}}};function Bf(t,e,i,n,s,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*n,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const s=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*n;if(!Number.isFinite(o)){a=!1;break}s.push(o)}return a&&(r.attribute[t]=s),!0}return!1}function Cf(){}class kf{constructor(t,e,i,n){var s;this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=n?"function"==typeof n?n:null!==(s=Sf[n])&&void 0!==s?s:Sf.linear:Sf.linear,"wait"===t&&(this.onUpdate=Cf),this.id=Si.GenAutoIncrementId(),this.syncAttributeUpdate=Cf}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t,e=!0){this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const i=this.fromProps[e],n=this.props[e];if(p(i)&&p(n)){const s=sl.Get(i,nl.Color255),r=sl.Get(n,nl.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=s,this.toParsedProps[e]=r,t.push(Mf["fill"===e?"fillPure":"strokePure"])}else Mf[e]?t.push(Mf[e]):t.push(Bf)}else Mf[e]?t.push(Mf[e]):t.push(Bf)})),this.interpolateUpdateFunctions=t}setStartTime(t,e=!0){this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,n,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],n,this,this.target)})),this.onUpdate(t,n,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}}class Pf extends kf{constructor(t,e,i,n){super(t,e,i,n)}onStart(){super.onStart()}onFirstRun(){const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class Of extends s{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this._animationEndFlag=!0,this.id=Si.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const n=e.next;t(e.animate,i),i++,e=n}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;this._animationEndFlag&&(this._animationEndFlag=!1,this.emit("animationStart"));const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===hn.END?this.removeAnimate(t,!0):t.status!==hn.RUNNING&&t.status!==hn.INITIAL||t.advance(e)})),0===this._animateCount&&(this._animationEndFlag=!0,this.emit("animationEnd"))}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t,e=!0){const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const Rf=new Of;Rf.isGlobal=!0;class Lf{constructor(t=Si.GenAutoIncrementId(),e=Rf,i){this.id=t,this.status=hn.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.animates||(this.target.animates=new Map),this.target.animates.set(this.id,this),this.onRemove((()=>{this.stop(),this.target.animates.delete(this.id)})),this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t,e=300,i="linear"){const n=new kf(ln.to,t,e,i);return n.bind(this.target,this),this.updateStepAfterAppend(n),this}wait(t){const e=new Pf(ln.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t,e=300,i="linear"){const n=new kf(ln.from,t,e,i);return this._firstStep?(this._lastStep.append(n),this._lastStep=n):(this._firstStep=n,this._lastStep=n),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===hn.RUNNING&&(this.status=hn.PAUSED)}resume(){this.status===hn.PAUSED&&(this.status=hn.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,n,s,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==hn.END&&this.onEnd(),this.status=hn.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=hn.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[]}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,n;if(this.status===hn.END)return void console.warn("aaa 动画已经结束,不能推进");const s=this.currentTime+t;if(s<this._startTime)return void(this.currentTime=s);if(s>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=hn.END);this.status=hn.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=s;let r=s-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(s-this._startTime)%this._duration;const t=Math.floor((s-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(n=this.lastRunStep)||void 0===n||n.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}}const If=new class{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach((e=>e(t)))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=sn.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++rn,t),this.tryRunAnimationFrameNextFrame(),rn}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}};class Ef{constructor(){this.released=!1}tick(t,e){If.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Df extends s{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const n=t.getTime();this._lastTickTime=n,this.lastFrameTime<0&&(this.lastFrameTime=n-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const s=n-this.lastFrameTime,r=this.checkSkip(s);return r||(this._handlerTick(s),this.lastFrameTime=n,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===on.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=on.INITIAL,sn.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler(!1)})),sn.global.env&&this.initHandler(!1)}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(t=!1){this.setupTickHandler(t)}setupTickHandler(t=!1){if(!t&&this.tickerHandler)return!0;const e=new Ef;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=e,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(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!==on.INITIAL&&(this.status=on.PAUSE,!0)}resume(){return this.status!==on.INITIAL&&(this.status=on.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(t=!1){if(this.status===on.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===on.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=on.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=on.INITIAL,this.setupTickHandler(!0),this.lastFrameTime=-1}trySyncTickStatus(){this.status===on.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===on.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){var e,i,n;return"performance"!==(null===(n=null===(i=null===(e=this.stage)||void 0===e?void 0:e.params)||void 0===i?void 0:i.optimize)||void 0===n?void 0:n.tickRenderMode)&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Ff{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Ff.instance||(Ff.instance=new Ff),Ff.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var n,s,r,a;let o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get(e);return o?o(i,t):(o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let n=this.transitions.get(t);n||(n=new Map,this.transitions.set(t,n)),n.set(e,i)}}Ff.getInstance();class jf{static registerBuiltInAnimate(t,e){jf.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,i){var n,s;const r=this.resolveValue(t.totalTime,void 0,void 0),a=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=a,l.totalTime=r;const h=this.resolveValue(t.oneByOne,i,!1);if(e){const t=l.timeSlices;g(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const n=this.resolveValue(t.delay,i,0),s=this.resolveValue(t.delayAfter,i,0),r=this.resolveValue(t.duration,i,300);return e+=n+r+s,Object.assign(Object.assign({},t),{delay:n,delayAfter:s,duration:r})}));let n=0;h&&(n="number"==typeof h?h:h?e:0),l.oneByOneDelay=n;let s=1;if(r){const t=e+n*(this._target.count-2);s=r?r/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*s,delayAfter:t.delayAfter*s,duration:t.duration*s,effects:e.map((t=>{var e,i;const n=null!==(e=t.custom)&&void 0!==e?e:jf.builtInAnimateMap[null!==(i=t.type)&&void 0!==i?i:"fromTo"],s=n&&o(n)?/^class\s/.test(Function.prototype.toString.call(n))?1:2:0;return Object.assign(Object.assign({},t),{custom:n,customType:s})}))})})),l.oneByOneDelay=n*s,l.startTime=a*s}else{const e=this.resolveValue(t.delay,i,0),c=this.resolveValue(t.delayAfter,i,0),u=this.resolveValue(t.duration,i,300);let d=0;h&&(d="number"==typeof h?h:h?e+c+u:0),l.oneByOneDelay=d,l.custom=null!==(n=t.custom)&&void 0!==n?n:jf.builtInAnimateMap[null!==(s=t.type)&&void 0!==s?s:"fromTo"];const p=l.custom&&o(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,r){const t=e+c+u+d*(this._target.count-2),i=r?r/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=u*i,l.oneByOneDelay=d*i,l.startTime=a}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,n;return t.partitioner(null===(n=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===n?void 0:n[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var n,s,r,a;return t.sort(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const n=e?(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,n,s);a&&this._trackAnimation(a)}:(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,n,s);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>n(t,e,i.length))):this._target.count<=1?n(this._target,0,1):this._target.forEachChildren(((t,e)=>n(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,i,n){var s,r,a,l,h,c,u,d;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=o(y)?y(null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],e,{}):y,O=null===(l=null===(a=e.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(i=null!==(c=O[R])&&void 0!==c?c:i),k.startAt(x);const L=i*_+P;L>0&&k.wait(L);let I=null,E=t.to,D=t.from;E||(I||(I=this.createPropsFromChannel(g,e)),E=I.props),D||(I||(I=this.createPropsFromChannel(g,e)),D=I.from),this._handleRunAnimate(k,M,B,D,E,v,m,f,C,w,p,e);let F=0;_&&(F=_*(n-i-1));const j=o(b)?b(null===(d=null===(u=e.context)||void 0===u?void 0:u.data)||void 0===d?void 0:d[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,i,n,s,r,a,l,h,c,u,d){var p,g,f,m;if(e&&i){const u=Object.assign({width:d.stage.width,height:d.stage.height,group:this._target.parent},this.resolveValue(l,d)),y=o(c)?c.call(null,null!==(g=u&&(null===(p=u.data)||void 0===p?void 0:p[0]))&&void 0!==g?g:null===(m=null===(f=d.context)||void 0===f?void 0:f.data)||void 0===m?void 0:m[0],d,u):c;u.options=y,u.controlOptions=h,1===i?this.createCustomAnimation(t,e,n,s,r,a,u):2===i&&this.createCustomInterpolatorAnimation(t,e,s,r,a,u)}else"to"===u?t.to(s,r,a):"from"===u&&t.from(s,r,a)}executeTimelineItem(t,e,i,n){var s,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:u,oneByOneDelay:d,priority:p,controlOptions:g}=t,f=null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*d),c&&c>0&&y.loop(c),u&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),d&&y.wait(d*(n-i-1)),y}applyTimeSliceToAnimate(t,e,i,n){var s,r,a,l;const{effects:h,duration:c=300,delay:u=0,delayAfter:d=0}=t,p=o(u)?u(null===(r=null===(s=i.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],i,{}):u,g=o(d)?d(null===(l=null===(a=i.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],i,{}):d;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var s;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let u=null,d=t.to,p=t.from;d||(u||(u=this.createPropsFromChannel(a,i)),d=u.props),p||(u||(u=this.createPropsFromChannel(a,i)),p=u.from);const g=null!==(s=t.custom)&&void 0!==s?s:jf.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,d,c,l,o,n,h,r,i)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,n,s,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,n,s,a,o)=>{e(s,i,n,a,o,t.target,r)},t.to(i,n,s)}createCustomAnimation(t,e,i,n,s,r,a){const o=new e(i,n,s,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let n=null;return t?(Array.isArray(t)?t.forEach((t=>{var n,s;const r=null===(s=null===(n=e.context)||void 0===n?void 0:n.diffAttrs)||void 0===s?void 0:s[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((s=>{var r,a,o,l;const h=t[s];void 0!==h.to&&("function"==typeof h.to?i[s]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[s]=h.to),void 0!==h.from&&(n||(n={}),"function"==typeof h.from?n[s]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):n[s]=h.from)})),{from:n,props:i}):{from:n,props:i}}resolveValue(t,e,i){var n,s;return void 0===t?i:"function"==typeof t&&e?t(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],e,{}):t}executeItem(t,e,i=0,n=1){return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,n))).filter(Boolean):[this._executeItem(t,e,i,n)].filter(Boolean)}_executeItem(t,e,i=0,n=1){if(!e)return null;const s="timeSlices"in t;let r=null;const a=this.parseParams(t,s);return r=s?this.executeTimelineItem(a,e,i,n):this.executeTypeConfigItem(a,e,i,n),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}jf.builtInAnimateMap={};const Uf="appear",Nf="disappear",Wf="update",zf="highlight",Gf="unhighlight";class Vf{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Hf{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,i){const n=Ff.getInstance(),s=[],r=[];if(this.stateList&&this.stateList.length?t.forEach(((t,i)=>{const a={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=n.isTransitionAllowed(e.state,t,this.graphic);a.allowTransition=a.allowTransition&&i.allowTransition})),a.allowTransition&&(r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)}),this.stateList.forEach((e=>{n.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&s.push(e)})))})):t.forEach(((t,i)=>{r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)})})),s.forEach((t=>{t.executor.stop()})),r.length){r[0].executor.execute(r[0].animationConfig);for(let t=0;t<r.length;t++){const e=r[t+1],n=r[t];n.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==n)),t===r.length-1&&i&&i(!1)}))}}else i&&i(!0);this.stateList?this.stateList=this.stateList.filter((t=>!s.includes(t))):this.stateList=[],this.stateList.push(...r)}applyAppearState(t,e){this.applyState([Uf],[{name:Uf,animation:t}],e)}applyDisappearState(t,e){this.applyState([Nf],[{name:Nf,animation:t}],e)}applyUpdateState(t,e){this.applyState([Wf],[{name:Wf,animation:t}],e)}applyHighlightState(t,e){this.applyState([zf],[{name:zf,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([Gf],[{name:Gf,animation:t}],e)}stopState(t,e){var i;const n=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));n&&n.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}}class Xf{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Hf(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Vf(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e){return this._getAnimationStateManager(this).stopState(t,e),this}clearAnimationStates(){return this._getAnimationStateManager(this).clearState(),this}static extend(t){return(new Xf)._getAnimationStateManager(t),t}}class $f{getAttributes(t=!1){return t&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,n;const s=new Lf(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:Rf,null==t?void 0:t.slience);if(s.bind(this),t){const{onStart:e,onEnd:i,onRemove:n}=t;null!=e&&s.onStart(e),null!=i&&s.onEnd(i),null!=n&&s.onRemove(n)}return null===(n=this.stage)||void 0===n||n.ticker.start(),s}createTimeline(){return new Of}createTicker(t){return new Df(t)}setFinalAttributes(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttributes(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new jf(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t,e=!1){return!e&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}}function Yf(){F(xl,Xf),F(xl,$f)}class qf extends kf{constructor(t,e,i,n,s){super("customAnimate",e,i,n),this.type="customAnimate",this.customFrom=t,this.params=s,this.from=t,this.to=e}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.onUpdate(t,n,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class Kf extends qf{onBind(){super.onBind(),this.propKeys=["x","y","z","alpha","zIndex"]}onFirstRun(){super.onFirstRun();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t)}onStart(){super.onStart();const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.finalAttribute.x,n=this.target.finalAttribute.y,s=this.target.finalAttribute.z,r=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));s-t.z<0&&(a=at-a),this.theta=a,this.phi=r}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const n=this.target,{center:s,r:r,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,c=r*Math.sin(h)*Math.cos(l)+s.x,u=r*Math.cos(h)+s.y,d=r*Math.sin(h)*Math.sin(l)+s.z;for(n.attribute.x=c,n.attribute.y=u,n.attribute.z=d,n.attribute.alpha=l+nt/2;n.attribute.alpha>at;)n.attribute.alpha-=at;n.attribute.alpha=at-n.attribute.alpha,n.attribute.zIndex=-1e4*n.attribute.z,a&&a(i)}}const Zf=t=>({custom:Kf,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Jf extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=xi.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const n=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-n.left||0-n.right||0,s=e.height-n.top||0-n.bottom||0,r=Math.max(i,s)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Jf.type=xi.wordCloud3d,Jf.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Qf=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({appear:Zf(t)}))),e.Factory.registerSeries(Jf.type,Jf)},tm=()=>{Qf()};class em extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class im extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=em,this.type="wordCloud3d",this.seriesType=xi.wordCloud3d}}im.type="wordCloud3d",im.seriesType=xi.wordCloud3d,im.transformerConstructor=em;const nm=()=>{ed(),Qf(),e.Factory.registerChart(im.type,im)},sm={label:{space:0}};class rm{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,i){return e.isZAxis(this._orient)?((t,i)=>{var n;const s=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),u={start:{x:0,y:0},end:h,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()};i||(u.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:s.height});const d=null!==(n=t.directionStr)&&void 0!==n?n:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===d&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),u.z=f,u.alpha=g,u.anchor3d=p,u})(this,i):t}}const am=Object.assign(Object.assign({},id),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class om extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=xi.rangeColumn3d,this._barMarkType="rect3d",this._barName=xi.bar3d}}om.type=xi.rangeColumn3d,om.mark=am;const lm=()=>{ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(om.type,om)};class hm extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class cm extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?n.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:n.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],n}}class um extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=cm,this.type="rangeColumn3d",this.seriesType=xi.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}um.type="rangeColumn3d",um.seriesType=xi.rangeColumn3d,um.transformerConstructor=cm;const dm="pictogram",pm="pictogram";var gm;!function(t){t.pictogram="pictogram"}(gm||(gm={}));const fm=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class mm extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===pm}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const ym=new Map;let bm;function vm(t,i){ym.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),bm||(bm=new ze,e.registerDataSetInstanceParser(bm,"svg",Le));const n=new Ge(bm);n.parse(i,{type:"svg"}),ym.set(t,n)}function xm(t){ym.has(t)?ym.delete(t):e.warn(`map type of '${t}' does not exists.`)}function _m(t){return ym.get(t)}class Am extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,i,n;const s=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(n=null===(i=ym.get(r))||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.elements;if(a&&a.length){a.map((t=>t.name)).filter((t=>h(t))).forEach((e=>{t[e]&&(s[e]=t[e])}))}return s}}class Sm extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const Tm="element-highlight-by-graphic-name";class wm extends e.ElementHighlight{constructor(){super(...arguments),this.type=Tm,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(l(t))return;const{interaction:e,highlightState:i,blurState:n}=this.options,s=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,s,i,n),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}wm.type=Tm;const Mm="element-select-by-graphic-name";class Bm extends e.ElementSelect{constructor(){super(...arguments),this.type=Mm}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}Bm.type=Mm;function Cm(t){var e;return h(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const km=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&Cm(i)?1:0},Pm=(t,e)=>{var i;const n=null!==(i=t.fill)&&void 0!==i?i:e;return n&&Cm(n)?n:void 0},Om=(t,e)=>{var i;const n=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!n||!Cm(n))&&n},Rm=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Pm(t),lineWidth:km(t),stroke:Om(t)}),Lm={group:t=>{const e=Rm(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Rm(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},Rm(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},Rm(t)),{path:t.d,fillStrokeOrder:!1,fill:Pm(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Rm(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:Pm(t,"#000")})},text:(t,e)=>{var i,n;return Object.assign(Object.assign({},Rm(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(n=t.textAnchor)&&void 0!==n?n:"middle",anchor:[0,0],fill:Pm(t,"#000")})}},Im=t=>{var i,n;if(!t||!t[0])return{};const{elements:s}=t[0].latestData;if(s&&s.length){s.forEach(((t,i)=>{var n;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:s,transform:r}=t,a={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?O(a,t._inheritStyle,null===(n=t.parent)||void 0===n?void 0:n._textGroupStyle,t.attributes):"group"!==t.graphicType&&O(a,t._inheritStyle,t.attributes),Lm[s]?t._finalAttributes=Lm[s](a,t.value):t._finalAttributes=a,r&&(t._finalAttributes.postMatrix=Object.assign({},r))}));const t=s.filter((t=>"text"===t.tagName));for(let r=0;r<t.length;r++){const a=t[r]._uniqueId,o=s.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const s=null!==(n=null===(i=t[r]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==n?n:0;let a=s;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=s;else if(i.value&&void 0===i.parent._textGroupStyle.x){const n=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(n){a+=e.measureText(n.value,n._finalAttributes).width}i._finalAttributes.x=a}}}}}return s};class Em extends e.GeoSeries{constructor(){super(...arguments),this.type=pm,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=_m(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const i="multiple"===t.mode,n=h(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:n,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var t;if(this._pictogramMark=this._createMark(Em.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Em.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Em.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:n,name:s,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:n,name:null!=s?s:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Em.mark.pictogram.name)});h&&(h.setData(this._mapViewData),h.setUserId(l),this._idToMark.set(l,h),"group"!==h.type&&h.setMarkConfig({graphicName:h.name}),h.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(Em.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t,viewBoxRect:i}=this._parsedSvgResult,n=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,Lm.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[ah(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of n){const{_uniqueId:i,_finalAttributes:n}=t,s=this._idToMark.get(i),r=this._validElement(t);s&&(this.setMarkStyle(s,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),r?(this.initMarkStyleWithSpec(s,O({},this._spec.pictogram,this._spec[s.name])),this.setMarkStyle(s,n,"normal",e.AttributeLevel.Series),s.setPostProcess("fill",((t,e)=>h(t)?t:this._spec.defaultFillColor))):(s.setMarkConfig({interactive:!1}),this.setMarkStyle(s,n,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new Sm(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const n=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!n||0===n.length)return null;let s=new Ht;e?n.forEach((t=>{s=s.union(t.getGraphics()[0].globalAABBBounds)})):n.forEach((t=>{s=s.union(t.getProduct().AABBBounds)}));const r={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,n=this.getRootMatrix();if(!n)return null;const s={};return n.getInverse().transformPoint({x:e,y:i},s),s}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const n=ym.get(this.svg);n||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new Ge(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Im),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),s.parse([n],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,n=e/2,s=this.getPictogramRootGraphic();if(s){const r=s.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=s.AABBBounds,c=(a+o)/2,u=(l+h)/2,d=t/r.width(),p=e/r.height(),g=Math.min(d,p);s.scale(g,g,{x:c,y:u}),s.translate(i-c,n-u)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const n=this.getPictogramRootGraphic();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new Yt}),n.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new Yt}),i.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}Em.type=pm,Em.mark=fm,Em.transformerConstructor=Am;const Dm=()=>{e.Factory.registerSeries(Em.type,Em),e.Factory.registerImplement("registerSVG",vm),e.Factory.registerImplement("unregisterSVG",xm),e.Factory.registerInteractionTrigger(wm.type,wm),e.Factory.registerInteractionTrigger(Bm.type,Bm)};class Fm extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=mm,this.type=dm,this.seriesType=pm}}Fm.type=pm,Fm.seriesType=dm,Fm.transformerConstructor=mm;class jm extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Um="imageCloud",Nm="imageCloud";var Wm;!function(t){t.image="image",t.imageMask="imageMask"}(Wm||(Wm={}));const zm=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),Gm={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Vm,triangle:Vm,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Vm(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const Hm={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,n=0;return t=>{const s=t<0?-1:1;switch(Math.sqrt(1+4*s*t)-s&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}};const Xm=(t,e,i)=>{const{threshold:n,invert:s=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,i)=>{const r=t.width;if(0===t.data[e*r*4+4*i+3])return!s;const a=t.data[e*r*4+4*i+0],o=t.data[e*r*4+4*i+1],l=t.data[e*r*4+4*i+2];if(255===a&&255===o&&255===l)return!s;if(b(n)){const t=.3*a+.59*o+.11*l;return s?t<=n:t>=n}return!1};const r=i({width:1,height:1}).getContext("2d",{willReadFrequently:!0});r.fillStyle=t,r.fillRect(0,0,1,1);const a=r.getImageData(0,0,1,1).data;return(t,e,i)=>{const n=t.width;return[0,1,2,3].every((r=>s?t.data[4*(e*n+i)+r]!==a[r]:t.data[4*(e*n+i)+r]===a[r]))}},$m=(t,e,i,n,s)=>{const{fontFamily:r="sans-serif",fontWeight:a="normal",fontStyle:o="normal",fontVariant:l="normal",text:c,hollow:u}=t;let d=12;s.font=`${o} ${l} ${a} ${d}px ${r}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=e;const p=s.measureText(c),g="normal"!==o?1.1:1,f=h(p.actualBoundingBoxRight)&&h(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,d);if(u&&(s.globalCompositeOperation="xor"),m>i){const t=Math.min(i/m,n/d);s.fillText(c,i/2,n/2),s.scale(t,t)}else d=Math.floor(d*i/m),d=Math.min(d,n),s.font=`${o} ${l} ${a} ${d}px ${r}`,s.fillText(c,Math.floor(i/2),Math.floor(n/2))},Ym=(t,e,i=0,n)=>{const s=2*Math.PI/n;return new Array(n).fill(0).map(((n,r)=>St(t,e,i+r*s)))},qm=(t,e,i=0,n)=>{const s=2*Math.PI/n,r=(t=>Gm[t]?Gm[t]():Gm.circle())("cardioid");return new Array(n).fill(0).map(((n,a)=>{const o=i+a*s,l=e*r(o);return St(t,l,o)}))},Km=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},Zm=(t,e,i,n,s)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],n=e[1];let s=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(n/2.7*.4),s=Math.floor(Math.min(i/2.3,n/2.6));break;case"triangleForward":s=n/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(n/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(n/1.5),s=Math.floor(Math.min(n/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":s=Math.floor(Math.min(i/2,n/2));break;default:s=Math.floor(Math.max(i/2,n/2))}return{maxRadius:s,center:r}}(t.shape,[i,n]);s.fillStyle=e,r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,n)=>{0===n?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,qm({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)Km(s,Ym({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)Km(s,Ym({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)Km(s,Ym({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)Km(s,Ym({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)Km(s,Ym({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Ym({x:l,y:h},o,-Math.PI/2,5),e=Ym({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let n=0;n<5;n++)i.push(t[n]),i.push(e[n]);Km(s,i)}else s.fillRect(0,0,i,n)};function Jm(t){const{size:e,maskCanvas:i}=t,n=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),s=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===s[i*e[0]+l]&&!t.isEmptyPixel(n,i,l)){s[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==s[h*e[0]+c]||t.isEmptyPixel(n,h,c)||(s[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},u={},d={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const n=s[t*e[0]+i];0!==n&&(T(t,i)&&(f.push([t,i]),l[n]=l[n]||[],l[n].push([i,t]),u[n]||(u[n]=[1/0,-1/0,1/0,-1/0]),t<u[n][0]&&(u[n][0]=t),t>u[n][1]&&(u[n][1]=t),i<u[n][2]&&(u[n][2]=i),i>u[n][3]&&(u[n][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[n]=(h[n]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),n=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,n],m.push(...e);const[s,r,a,o]=u[t];d[t]=~~Math.max(Math.sqrt((i-a)**2+(n-s)**2),Math.sqrt((i-o)**2+(n-r)**2),Math.sqrt((i-a)**2+(n-r)**2),Math.sqrt((i-o)**2+(n-s)**2)),p[t]=(o-a)/(r-s)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:u[t],maxR:d[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:s,labelNumber:r-1};if(t.blur){const i=t.blur,n=function(t,e,i,n){const s=n/3,r=Math.ceil(n/2),a=function(t,e){const i=new Array(2*t+1).fill(0),n=t;let s=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+n]=t,s+=t}for(let t=0;t<i.length;t++)i[t]/=s;return i}(r,s),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let n=0;n<i;n++)for(let i=0;i<e;i++){let s=0;for(let o=-r;o<=r;o++)s+=t[n*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[n*e+i]=s}for(let t=0;t<e;t++)for(let n=0;n<i;n++){let s=0;for(let l=-r;l<=r;l++)s+=o[Math.min(Math.max(n+l,0),i-1)*e+t]*a[l+r];l[n*e+t]=Math.max(0,Math.min(1,s))}return l}(s,e[0],e[1],i);(function(t,e,i,n,s=1){const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,s>1)for(let e=1-s;e<=s-1;e++)for(let o=1-s;o<=s-1;o++)if(Math.sqrt(e*e+o*o)<s){const s=t+e,l=a+o;s>=0&&s<n&&l>=0&&l<i&&(r[s*i+l]=1)}return r})(s,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(s[e]=n[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const n=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+n[r][0],o=i+n[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===s[a*e[0]+o])return!0}return!1}}function Qm(t,e,i){e.width=t.width,e.height=t.height;const n=e.getContext("2d",{willReadFrequently:!0});n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);const s=e.width,r=n.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let n=0;n<t;++n)if(!i(r,e,n))return!1;return!0},u=(t,e,n)=>{for(let s=e;s<n;++s)if(!i(r,s,t))return!1;return!0};for(;a<o&&c(s,a);)++a;for(;o-1>a&&c(s,o-1);)--o;for(;l<h&&u(l,a,o);)++l;for(;h-1>l&&u(h-1,a,o);)--h;const d=n.getImageData(l,a,h-l,o-a);return e.width=d.width,e.height=d.height,n.clearRect(0,0,e.width,e.height),n.putImageData(d,0,0),e}function ty(t,e){return t&&(v(t)||x(t)||t.startsWith("<svg"))?new Promise(((i,n)=>{var s;const r=e({image:t}),a=null===(s=r.resources)||void 0===s?void 0:s.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const s=null===(e=r.resources)||void 0===e?void 0:e.get(t);s&&"success"===s.state&&s.data?i(s.data):n(new Error("image load failed: "+t))}else n(new Error("image load failed: "+t))},r.failCallback=()=>{n(new Error("image load failed: "+t))})})):null}var ey;function iy(t){return t}!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"}(ey||(ey={})),Object.values(ey).forEach((t=>{}));const ny=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),sy=t=>t<0?-t*t:t*t;function ry(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function ay(t,e,i){const n=t[0],s=t[1],r=e[0],a=e[1];let o,l;return s<n?(o=ry(s,n),l=i(a,r)):(o=ry(n,s),l=i(r,a)),t=>l(o(t))}function oy(t,e,i){const n=Math.min(t.length,e.length)-1,s=new Array(n),r=new Array(n);let a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)s[a]=ry(t[a],t[a+1]),r[a]=i(e[a],e[a+1]);return function(e){const i=function(t,e,i=0,n){for(l(n)&&(n=t.length);i<n;){const s=i+n>>>1;z(t[s],e)>0?n=s:i=s+1}return i}(t,e,1,n)-1;return r[i](s[i](e))}}class ly{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),n=t[0]-i*e[0];return[n,i+n]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):h(this._rangeFactorStart)&&h(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return l(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return l(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:n}=this._fishEyeOptions,s=this.range(),r=s[0],a=s[s.length-1],o=Math.min(r,a),h=Math.max(r,a),c=q(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,h),u=l(n)?(h-o)*i:n;let d=Math.exp(e);d=d/(d-1)*u;const p=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const i=d*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:hy}=oe;function cy(t,e){const i=typeof e;let n;if(l(e)||"boolean"===i)return()=>e;if("number"===i)return K(t,e);if("string"===i){if(n=re.parseColorString(e)){const e=hy(re.parseColorString(t),n);return t=>e(t).formatRgb()}return K(Number(t),Number(e))}return e instanceof ae?hy(t,e):e instanceof re?hy(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),n=e.valueOf(),s=new Date;return t=>(s.setTime(i*(1-t)+n*t),s)}(t,e):K(Number(t),Number(e))}class uy extends ly{constructor(t=iy,e=iy){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=iy,this._piecewise=ay,this._interpolate=cy}calculateVisibleDomain(t){var e;return h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),K)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const n=Array.from(t,G);return this._domain=n,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Z,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,n=i.length,s=this._range.length;let r=Math.min(n,s);if(n&&n<s&&this._forceAlign){const t=s-n+1,e=i[n-1],a=n>=2?(e-i[n-2])/t:0;for(let s=1;s<=t;s++)i[n-2+s]=e-a*(t-s);r=s}return this._autoClamp&&(this._clamp=function(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}(i[0],i[r-1])),this._piecewise=r>2?oy:ay,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:iy),this.rescale(i)):this._clamp!==iy}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return l(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return l(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const dy=Math.sqrt(50),py=Math.sqrt(10),gy=Math.sqrt(2),fy=[1,2,5,10],my=(t,e,i)=>{let n=1,s=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?s=0:t<0&&t>=-Number.MIN_VALUE?s=-(e-1):!i&&a<1?n=xy(a).step:(i||a>1)&&(s=Math.floor(t)-r*n),n>0?(t>0?s=Math.max(s,0):t<0&&(s=Math.min(s,-(e-1)*n)),function(t,e,i){h(e)||(e=t,t=0),h(i)||(i=1);let n=-1;const s=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(s);for(;++n<s;)r[n]=t+n*i;return r}(0,e).map((t=>s+t*n))):t>0?by(0,-(e-1)/n,n):by((e-1)/n,0,n)},yy=Y(((t,e,i,n)=>{let s,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((s=e<t)&&(r=t,t=e,e=r),o=_y(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),n=Math.round(e/o);for(i*o<t&&++i,n*o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==n?void 0:n.noDecimals)){o=1;const i=Math.ceil(t),n=Math.floor(e);if(!(i<=n))return[];for(a=new Array(r=n-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),n=Math.round(e*o);for(i/o<t&&++i,n/o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)/o}return s&&a.reverse(),a})),by=(t,e,i)=>{let n,s,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)/i}return s},vy=Y(((t,e,i,n)=>{let s,r,a;if(i=+i,(t=+t)==(e=+e))return my(t,i,null==n?void 0:n.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return my(t,i,null==n?void 0:n.noDecimals);(s=e<t)&&(a=t,t=e,e=a);const o=_y(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let n=1;const{power:s,gap:a}=o,h=10===a?2*10**s:1*10**s;for(;n<=5&&(r=by(t,e,l),r.length>i+1)&&i>2;)l+=h,n+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let n;const s=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(n=a;n>=1;n--)e.push(s-n*i);return e.concat(t)}if(s>=0){for(n=1;n<=a;n++)t.push(r+n*i);return t}let o=[];const l=[];for(n=1;n<=a;n++)n%2==0?o=[s-Math.floor(n/2)*i].concat(o):l.push(r+Math.ceil(n/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==n?void 0:n.noDecimals)&&l<0&&(l=1),r=by(t,e,l);return s&&r.reverse(),r})),xy=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let n=fy[0];return i>=dy?n=fy[3]:i>=py?n=fy[2]:i>=gy&&(n=fy[1]),e>=0?{step:n*10**e,gap:n,power:e}:{step:-(10**-e)/n,gap:n,power:e}};function _y(t,e,i){const n=(e-t)/Math.max(0,i);return xy(n)}function Ay(t,e,i){let n;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(n=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(n))return[];const s=new Array(i);for(let e=0;e<i;e++)s[e]=t+e*n;return s}function Sy(t,e=10){let i,n,s=0,r=t.length-1,a=t[s],o=t[r],l=10;for(o<a&&(n=a,a=o,o=n,n=s,s=r,r=n);l-- >0;){if(n=_y(a,o,e).step,n===i)return t[s]=a,t[r]=o,t;if(n>0)a=Math.floor(a/n)*n,o=Math.ceil(o/n)*n;else{if(!(n<0))break;a=Math.ceil(a*n)/n,o=Math.floor(o*n)/n}i=n}}class Ty extends uy{constructor(){super(...arguments),this.type=ey.Linear}clone(){var t;const e=new Ty;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return yy(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(o(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const n=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,s=this._domain,r=n[0],a=n[n.length-1];let l=vy(s[0],s[s.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==a)&&this._niceType){const t=n.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==a&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ay(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let n,s,r=-1;if(i=+i,(s=(e=+e)<(t=+t))&&(n=t,t=e,e=n),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return s&&o.reverse(),o}(e[0],e[e.length-1],t)}nice(t=10,e){var i,n;const s=this._domain;let r=[];if(e){const t=function(t,e){const i=y(e.forceMin),n=y(e.forceMax);let s=null;const r=[];let a=null;const o=i&&n?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:n?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:y(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),n?r[1]=e.forceMax:y(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),y(r[0])&&y(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):s=y(r[0])||y(r[1])?y(r[0])?"max":"min":"all",{niceType:s,niceDomain:a,niceMinMax:r,domainValidator:o}}(s,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Sy(s.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(n=r[0])&&void 0!==n?n:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Sy(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Sy(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class wy extends Ty{constructor(){super(ny,sy),this.type=ey.Sqrt}clone(){return(new wy).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var My;function By(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(My||(My={}));class Cy{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:i=0}=t;let n=this.imageCollageList;return n.forEach(((t,n)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=i,t.weight=tt(e)(this.data[n]),t.datum=this.data[n])})),n=n.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),n}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:n,height:s}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:n/s}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,i,n,s,r;const a=this.options,o=a.size,l={shapeUrl:null!==(t=a.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:o,ratio:a.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=a.maskConfig)||void 0===e?void 0:e.edgeBlur},h=this.options.createCanvas({width:o[0],height:o[1]}),c=h.getContext("2d",{willReadFrequently:!0});c.textAlign="center",c.textBaseline="middle",l.tempCanvas=h;const u=o[0]+31>>5<<5;if(l.boardSize=[u,o[1]],l.random?l.randomGenerator=Math.random:l.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=l,p(l.shapeUrl)){l.isEmptyPixel=Xm(void 0,{threshold:null!==(n=null===(i=a.maskConfig)||void 0===i?void 0:i.threshold)&&void 0!==n?n:200,invert:null===(s=a.maskConfig)||void 0===s?void 0:s.invert},this.options.createCanvas);const t=ty(l.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const n=a.size,s=this.options.createCanvas({width:n[0],height:n[1],dpr:1});l.maskCanvas=s;const r=s.getContext("2d");(null===(e=a.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&Qm(t,s,l.isEmptyPixel);const o=function(t,e){const i=t.width,n=t.height;let s=e[0]/i;n*s>e[1]&&(s=e[1]/n);const r=Math.floor(s*i),a=Math.floor(s*n);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:s}}(t,n);let h;r.clearRect(0,0,n[0],n[1]),r.drawImage(t,o.x,o.y,o.width,o.height),this.segmentationOutput=Jm(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(h=this.generateTransparentMaskCanvas(t,n)),this.segmentationOutput.transparentMaskCanvas=h,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(s,h)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(l.shapeUrl&&("text"===l.shapeUrl.type||"geometric"===l.shapeUrl.type)){l.isEmptyPixel=Xm(l.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==l.shapeUrl.type&&"geometric"!==l.shapeUrl.type||l.shapeUrl.backgroundColor||(l.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=((t,e,i,n,s=!1,r)=>{let{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;s&&([a,o]=[o,a]);const l=n||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(n){const t=n.width,s=n.height;h.clearRect(0,0,t,s),n.style.width=`${e}px`,n.style.height=`${i}px`,n.width=e,n.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?$m(t,o,l.width,l.height,h):"geometric"===t.type&&Zm(t,o,l.width,l.height,h),l})(l.shapeUrl,o[0],o[1],void 0,null===(r=a.maskConfig)||void 0===r?void 0:r.invert,this.options.createCanvas);l.maskCanvas=t,this.segmentationOutput=Jm(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>ty(t,e))))}(this.data.map((t=>tt(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,$.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t,e={},i=.45){const{imageSizeRange:n,padding:s=0}=e,r=y(e.imageSize)?e.imageSize:((t,e={})=>{if(g(t)){const i=t.map((t=>Q(t,e)));return t=>i.map((e=>e(t)))}return Q(t,e)})(e.imageSize),a=this.options.size;if(r||n)if(r&&!o(r))t.forEach((t=>By(t,r)));else if(n){const e=(new wy).domain(et(t,(t=>t.weight))).range(n);t.forEach((t=>By(t,~~e.scale(t.weight))))}else if(r&&o(r)&&!n){const e=.5,[n,r]=et(t,(t=>t.weight)),o=t.reduce(((t,i)=>{const s=i.aspectRatio,a=(i.weight-n)/(r-n);return t+(s>1?1/s:s)*(e+(1-e)*a)**2}),0),l=~~Math.sqrt(i*a[0]*a[1]/o),h=[~~(e*l)-2*s<0?1:~~(e*l)-2*s,~~l-2*s<0?1:~~l-2*s],c=(new wy).domain(et(t,(t=>t.weight))).range(h);t.forEach((t=>By(t,~~c.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let n=~~Math.sqrt(i*a[0]*a[1]/e);n=n-2*s<0?1:n-2*s,t.forEach((t=>By(t,n)))}return t}generateTransparentMaskCanvas(t,e){var i;const n=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),s=n.getContext("2d");this.segmentationOutput.transparentMaskCanvas=n,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&Qm(t,n,this.segmentationInput.isEmptyPixel);const r=s.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],n=4*t;r.data[n]=e,r.data[n+1]=e,r.data[n+2]=e,r.data[n+3]=i}return s.clearRect(0,0,e[0],e[1]),s.fillStyle="rgba(255,255,255,0)",s.fillRect(0,0,e[0],e[1]),s.putImageData(r,0,0),n}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class ky extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,n,s,r=1){const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),u=Hm[i](e);let d,p,g=-r;const{segmentation:f}=n,{labels:m}=f;for(;([d,p]=u(g+=r))&&!(Math.min(Math.abs(d),Math.abs(p))>=c);)if(d-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+d),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Py(t,s)){const{x:e,y:i,width:n,height:s}=t;let r=!1;for(let t=0;t<n;t++){for(let n=0;n<s&&i+t<=o;n++)if(!(e+n>a||m[(i+t)*a+(e+n)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:i}=this,{layoutConfig:n={}}=this.options,s=this.options.size,{spiralType:r="archimedean",fillingTimes:a=4,minFillingImageSize:o=10}=n,l=[],h=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,s,r,i,l)&&l.push(e);const c=U(l,((t,e)=>t.width-e.width)).width,u=U(l,((t,e)=>t.height-e.height)).height,d=[];for(let n=0;n<a;n++){const a=.5*c-1*n,p=.5*u-1*n;for(const n of t){const t=Object.assign({},n,{visible:!0});By(t,Math.max(o,t.aspectRatio>1?a:p)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,s,r,i,[...d,...l],.5)&&(n._tempFrequency=(null!==(e=n._tempFrequency)&&void 0!==e?e:n.frequency)+1,t.frequency=n._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-s[0]/2,2)+Math.pow(t.y-s[1]/2,2)),t[h]=`${t[h]}_${t.frequency}`,d.push(t))}}return[...l,...d].filter((t=>t.visible))}}function Py(t,e){for(let s=0;s<e.length;s++)if(i=t,n=e[s],!(i._leftWithoutPadding+i._widthWithPadding<n._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<n._topWithoutPadding||i._leftWithoutPadding>n._leftWithoutPadding+n._widthWithPadding||i._topWithoutPadding>n._topWithoutPadding+n._heightWithPadding))return!1;var i,n;return!0}function Oy(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*n-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=s;let u,d;c>1?(u=h,d=h/c):(d=h,u=h*c);const p=Math.ceil(l/(d+r)),g=Math.ceil(o/(u+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(u+r)+u/2,n=t*(d+r)+d/2;y[t*g+e]={centerX:i,centerY:n,x:i-u/2,y:n-d/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(n-m,2))}}return{context:Object.assign({},s,{cellWidth:u,cellHeight:d,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:u*d,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<u;t++)for(let s=0;s<d&&n+t<=l;s++)i+s>o||e((~~n+t)*o+(~~i+s))},clipPath:`M${-u/2} ${-d/2} L${u/2} ${-d/2} L${u/2} ${d/2} L${-u/2} ${d/2} Z`}),imageLength:h}}const Ry={rect:Oy,circle:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let u=0;u=a?a/2:Math.min(o,l)*n/2,u-r<=0&&(u=r+1);const d=2*u,p=Math.sqrt(3)/2*d+r,g=[];let f=0;for(let t=0;t*p-u<l;t++){const e=t*p,i=t%2==0?0:u;for(let n=-1;n*(d+r)+i-u<o;n++){const s=n*(d+r)+i+u;g[f++]={centerX:s,centerY:e,x:s-u,y:e-u,row:t,col:n,distance:Math.sqrt(Math.pow(s-h,2)+Math.pow(e-c,2))}}}let m=0;const y=u*u;for(let t=0;t<d;t++)for(let e=0;e<d;e++){const i=t-u,n=e-u;i*i+n*n<=y&&m++}return{context:Object.assign({},s,{cellWidth:d,cellHeight:d,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<d;t++)for(let s=0;s<d;s++){if(t+i<0||t+i>o||s+n>l||s+n<0)continue;const r=t-u,a=s-u;r*r+a*a<=y&&e((~~n+t)*o+(~~i+s))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:d}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let u;u=a?a/2:Math.min(o,l)*n/2,u-r<=0&&(u=r+1);const d=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;d.push({x:(u-r/2)*Math.cos(e),y:(u-r/2)*Math.sin(e)})}const g=2*u,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,n=t*b+(e%2?v:0);A.push({centerX:i,centerY:n,x:i-f,y:n-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(n-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,n=t-m/2,s=Math.abs(i),r=Math.abs(n);s<=f&&r<=m/2&&2*r+s*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},s,{cellHexSideLength:f,cellHexPoints:d,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:n}=t;let s=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[s++]&&e((~~n+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class Ly extends Cy{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:n="rect"}=i,s=(null!==(t=Ry[n])&&void 0!==t?t:Ry.rect)(this.options),{context:r,imageLength:a}=s;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:i,cellInfo:n,cellCount:s,clipPath:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===s||0===e||0===i||0===n.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:l}=this,{layoutConfig:h={}}=this.options,{placement:c="default"}=h;if("edge"===c||"default"===c){const{segmentation:t}=l,{labels:e}=t;n.forEach((t=>{let i=0;a(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,d=t=>{const{intersectPixels:e}=t;return"default"===c?e>=.45*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],s=n[e];s&&(i.x=s.centerX-i.width/2,i.y=s.centerY-i.height/2,i.clipConfig={shape:r},i.frequency=1,i.visible=d(s),i.cell=R(s,["image"]),i.distance=s.distance,s.image=i)}const p=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<s)for(let e=u;e<s;e++){const i=t[e-u],s=n[e];if(s){const e=Object.assign({},i);e.x=s.centerX-e.width/2,e.y=s.centerY-e.height/2,e.frequency+=1,e[p]=`${e[p]}_${e.frequency}`,e.visible=d(s),e.distance=s.distance,e.cell=R(s,["image"]),s.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class Iy extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,n=Oy;return this.layoutContext=n(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:n,cellInfo:s,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:u=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;s.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const d=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<d;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.visible=g(n),i.cell=`${n.row}_${n.col}`,i.angle=Math.random()*(2*u)-u,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-n.distance,i.distance=n.distance,i.frequency=1,n.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(d<r)for(let e=d;e<r;e++){const i=t[e-d],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*u)-u,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(n),e.cell=`${n.row}_${n.col}`,e.distance=n.distance,e.zIndex=p-n.distance,n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Ey=(t,e,i)=>{var n,s;const r=o(t.size)?t.size():t.size;if(t.size=r,!r||l(r[0])||l(r[1])||r[0]<=0||r[1]<=0)return $.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(r[0]),Math.ceil(r[1])],t.image||$.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let a;switch(null!==(s=null===(n=t.layoutConfig)||void 0===n?void 0:n.layoutMode)&&void 0!==s?s:"spiral"){case"grid":a=Ly;break;case"stack":a=Iy;break;default:a=ky}const h=new a(t);return h.layout(e),h.unfinished()?{progressive:h}:h.output()};class Dy extends qf{constructor(t,e,i,n,s){var r;super(t,e,i,n,s),this._rotations=null!==(r=null==s?void 0:s.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,b(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var n;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const s=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(s))*(null!==(n=this._scaleX)&&void 0!==n?n:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Fy(t,i){switch(i){case"axialRotate":return[{custom:Dy,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class jy extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:n}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(n[0]&&s)return null!==(i=s[n[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&n)return n[i[0]]}}get defaultShapeType(){return"square"}}class Uy extends e.BaseSeries{constructor(){super(...arguments),this.type=Nm}setValueField(t){h(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(zm.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(zm.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new jy(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:fh,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,n;if(t){const s=null===(n=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===n?void 0:n.preset,r={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(r,s),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Uy.type=Nm,Uy.mark=zm;const Ny=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Fy(t,e),enter:Fy(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Uy.type,Uy),e.Factory.registerGrammarTransform("imagecloud",{transform:Ey})};class Wy extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Wy.transformerConstructor,this.type=Um,this.seriesType=Nm}}Wy.type=Um,Wy.seriesType=Nm,Wy.transformerConstructor=jm;const zy=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Gy extends Al{constructor(t,e){super(t),this._skipRenderAttributes=zy,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,n){const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(s)return this._setAttributes(s,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?O(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const n=e[i];!d(this.attribute[n])||o(this.attribute[n])||o(t[n])?this.attribute[n]=t[n]:O(this.attribute[n],t[n])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new Vr(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}eventPosToStagePos(t){var e,i;const n={x:0,y:0},s=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==i?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(s,n),n}}var Vy;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Vy||(Vy={}));const Hy={[Vy.selectedReverse]:{},[Vy.selected]:{},[Vy.hover]:{},[Vy.hoverReverse]:{}};function Xy(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&Xy(t,e)}))}function $y(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function Yy(t,e,i){return Math.abs(t-e)<i}function qy(t,e="type"){return"rich"===function(t,e="type"){var i,n;return c(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(n=t[e])&&void 0!==n?n:"text"}(t,e)}const Ky=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function Zy(){Lg(),Gg(),Zg(),$g(),Qg()}var Jy=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};Zy();class Qy extends Gy{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},Qy.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:n="",textStyle:s={},shape:r={},panel:o={},space:u=4,minWidth:d,maxWidth:p,padding:f=4,visible:m,state:v,type:x,textAlwaysCenter:_,containerTextAlign:A}=this.attribute,S=function(t){if(b(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,n]=t;return[e,i,n,i]}if(4===e)return t}if(c(t)){const{top:e=0,right:i=0,bottom:n=0,left:s=0}=t;return[e,i,n,s]}return[0,0,0,0]}(f),T=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let M,B=-S[3],C=-S[0],k=S[1]+S[3],P=S[0]+S[2],O=0,R=0;const{visible:L}=r,I=Jy(r,["visible"]);if(a(L)){const t=(null==I?void 0:I.size)||10,e=y(t)?t:Math.max(t[0],t[1]);M=T.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},I),{visible:L,x:e/2,y:e/2}),"symbol"),w(null==v?void 0:v.shape)||(M.states=v.shape),L&&(R=e+u)}let E,D,F;if(k+=R,O+=R,qy({text:n})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,i;return h(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:x,text:n},s))),s),{visible:h(n)&&!1!==m,x:O,y:0});l(t.lineHeight)&&(t.lineHeight=s.fontSize),E=T.createOrUpdateChild("tag-text",t,"richtext"),D=E.AABBBounds.width(),F=E.AABBBounds.height()}else{const i=Object.assign(Object.assign({text:c(n)&&"type"in n&&"text"===n.type?n.text:n,visible:h(n)&&!1!==m,lineHeight:null==s?void 0:s.fontSize},s),{x:O,y:0});l(i.lineHeight)&&(i.lineHeight=s.fontSize),E=T.createOrUpdateChild("tag-text",i,"text");const r=function(t,e,i={}){if(!t)return{width:0,height:0};const n=zh({text:t,fontFamily:e.fontFamily||i.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:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:n.width(),height:n.height()}}(i.text,s,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);D=r.width,F=r.height}k+=D;const U=null!==(i=r.size)&&void 0!==i?i:10,N=y(U)?U:Math.max(U[0],U[1]);P+=Math.max(F,r.visible?N:0);const{textAlign:W,textBaseline:z}=s;(h(d)||h(p))&&(h(d)&&k<d&&(k=d),h(p)&&k>p&&(k=p,E.setAttribute("maxLineWidth",p-S[1]-S[2]))),B=0,C=0;let G=0;"left"===W||"start"===W?G=1:"right"===W||"end"===W?G=-1:"center"===W&&(G=0),G?G<0?(B-=k,M&&M.setAttribute("x",(M.attribute.x||0)-D),T.setAttribute("x",-S[1]-R)):G>0&&T.setAttribute("x",S[3]):(B-=k/2,M&&M.setAttribute("x",(M.attribute.x||0)-D/2),T.setAttribute("x",-R/2));const V="right"===A||"end"===A,H="left"===A||"start"===A,X=(t,e)=>{"richtext"===E.type?E.setAttributes({x:t,textAlign:e,textConfig:j(E.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):E.setAttributes({x:t,textAlign:e})};if((A?"center"===A:_)&&G){const t=k-S[1]-S[3],e=D+R,i=1===G?(t-e)/2+R+D/2:S[0]+R-(k/2+e/2-R)+D/2;if(X(i,"center"),M){const t=i-D/2-R+N/2;M.setAttributes({x:t})}}if(H&&1!==G){const t=k-S[1]-S[3],e=0===G?-t/2+R/2:-k+S[3]+S[1]+R;if(X(e+R,"left"),M){const t=e+N/2;M.setAttributes({x:t})}}if(V&&-1!==G){const t=k-S[1]-S[3],e=0===G?t/2+R/2:t;if(X(e,"right"),M){const t=e-D-R+N/2;M.setAttributes({x:t})}}"middle"===z?(C-=P/2,M&&M.setAttribute("y",0)):"bottom"===z?(C-=P,M&&M.setAttribute("y",-F/2),T.setAttribute("y",-S[2])):"top"===z&&(T.setAttribute("y",S[0]),M&&M.setAttribute("y",F/2)),w(null==v?void 0:v.text)||(E.states=v.text);const{visible:$}=o,Y=Jy(o,["visible"]);if(m&&a($)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},Y),{visible:$&&!!n,width:k,height:P,x:B,y:C}),"rect");if(w(null==v?void 0:v.panel)||(t.states=v.panel),Y.customShape){const e=Y.customShape;t.pathProxy=t=>e(this,t,new ys)}this._bgRect=t}this._textShape=E,this._symbol=M,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:O({},Qy.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,n,s,r,a,o,l,h,c,u,d,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(s=null===(n=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===n?void 0:n.slice())&&void 0!==s?s:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(u=this._bgRect)||void 0===u||u.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function tb(){Lg(),Fg(),Ug(),Zg()}function eb(){Lg(),Fg(),kg(),Zg()}Qy.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},tb();class ib extends Gy{getStartAngle(){return Tt(this._startAngle)}getEndAngle(){return Tt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},ib.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!s)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(b(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(W(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var s,r;const a=Nh.line(Object.assign(Object.assign({points:t},g(i)?null!==(s=i[e])&&void 0!==s?s:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),w(null==n?void 0:n.line)||(a.states=g(n.line)?null!==(r=n.line[e])&&void 0!==r?r:n.line[n.line.length-1]:n.line),this.add(a),this.lines.push(a)}))}else{let t=Nh.line;j(i)[0].cornerRadius&&(t=Nh.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},j(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),w(null==n?void 0:n.line)||(e.states=[].concat(n.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:n=!0}=t;let s;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:g,size:f=12}=t;let m,y;"start"===i?(m={x:l.x+(b(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(b(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},y=this._computeStartRotate(this._startAngle)):(m={x:h.x+(b(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(b(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},y=this._computeEndRotate(this._endAngle)),s=Nh.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:g,size:f,angle:n?y+d:0,strokeBoundsBuffer:0}),p)),s.name=`${this.name}-${i}-symbol`,s.id=this._getNodeId(`${i}-symbol`),w(null==o?void 0:o.symbol)||(s.states=o.symbol),"start"===i?w(null==o?void 0:o.startSymbol)||(s.states=o.startSymbol):w(null==o?void 0:o.endSymbol)||(s.states=o.endSymbol),this.add(s)}return s}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let n;return n=e?b(i)?t[i]:W(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}ib.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},eb();class nb extends ib{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},ib.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!s)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},c={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,c];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),d=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=d;const p=Nh.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),w(null==n?void 0:n.line)||(p.states=[].concat(n.line)[0]),this.add(p),this.line=p}}var sb,rb,ab,ob;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(sb||(sb={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(rb||(rb={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(ab||(ab={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(ob||(ob={}));class lb extends Gy{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,i)=>{const n=t.target;return n!==i&&n.name&&!w(n.states)?(n.addState(Vy.hover,!0),Xy(e,(t=>{t!==n&&t.name&&!w(t.states)&&t.addState(Vy.hoverReverse,!0)})),n):i})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(Xy(e,(t=>{t.name&&!w(t.states)&&(t.removeState(Vy.hoverReverse),t.removeState(Vy.hover))})),null):i)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const n=t.target;return i===n&&n.hasState(Vy.selected)?(Xy(e,(t=>{t.name&&!w(t.states)&&(t.removeState(Vy.selectedReverse),t.removeState(Vy.selected))})),null):n.name&&!w(n.states)?(n.addState(Vy.selected,!0),Xy(e,(t=>{t!==n&&t.name&&!w(t.states)&&t.addState(Vy.selectedReverse,!0)})),n):i})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const n=c(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:O({},this.defaultUpdateAnimation,n,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:O({},this.defaultExitAnimation,n,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:O({},this.defaultUpdateAnimation,n,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:n,select:s}=this.attribute;n&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),s&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let s;if(n){const n=Nh.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));s=Nh.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(s),this._containerClip=n,this.add(n)}else s=Nh.group({x:0,y:0,pickable:!1}),this.add(s);s.name="marker-container",this._container=s}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const hb={type:"callIn",duration:500,easing:"linear",delay:0},cb={type:"fadeOut",duration:500,easing:"linear",delay:0},ub=.001;sb.end,ab.arcOuterMiddle,rb.right,ab.arcOuterMiddle;const db={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};Lg(),Zy(),Yf(),tb(),eb(),Zg(),Eg(),Fg(),Yf();class pb extends lb{markerAnimate(t){pb._animate&&this._animationConfig&&pb._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},pb.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=hb,this.defaultExitAnimation=cb,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,n,s){return Yy(Math.abs(n),Math.PI/2,ub)||Yy(Math.abs(n),3*Math.PI/2,ub)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,n,s):$y(n)?db.postiveXAxis[s]:db.negativeXAxis[s]}setItemAttributes(t,e,i,n,s){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:c=0,style:u,position:d=ob.middle}=e,{state:p}=this.attribute,g=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(g)+h*Math.cos(g-Math.PI/2),m=l*Math.sin(g)+h*Math.sin(g-Math.PI/2);if("text"===s){const s=n.x-i.x,r=n.y-i.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,s,r,g,null!==(a=e.position)&&void 0!==a?a:"end")),u.textStyle),state:{panel:O({},Hy,null==p?void 0:p.textBackground),text:O({},Hy,null==p?void 0:p.itemContent)}}))}else("richText"===s||"image"===s)&&(t.setAttributes({dx:this.getItemDx(t,d,u)+(u.dx||0),dy:this.getItemDy(t,d,u)+(u.dy||0)}),t.states=O({},Hy,null==p?void 0:p.itemContent));const y=$y(g)?g:g-Math.PI;t.setAttributes({x:n.x+(f||0),y:n.y+(m||0),angle:o&&y+c})}getItemDx(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==s?s:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==s?s:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:n}=this.attribute,{type:s="text",style:r,renderCustomCallback:a}=t;let o;return"symbol"===s?(o=Nh.symbol(Object.assign(Object.assign({},i),r)),o.states=O({},Hy,null==n?void 0:n.itemContent)):"text"===s?o=new Qy(Object.assign(Object.assign({},i),{state:{panel:O({},Hy,null==n?void 0:n.textBackground),text:O({},Hy,null==n?void 0:n.itemContent)}})):"richText"===s?(o=Nh.richtext(Object.assign(Object.assign({},i),r)),o.states=O({},Hy,null==n?void 0:n.itemContent)):"image"===s?(o=Nh.image(Object.assign(Object.assign({},i),r)),o.states=O({},Hy,null==n?void 0:n.itemContent)):"custom"===s&&a&&(o=a(),o.states=O({},Hy,null==n?void 0:n.itemContent)),o.name=`mark-point-${s}`,this.setItemAttributes(o,t,e,i,s),o}getItemLineAttr(t,e,i){let n=[],s={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,u=i.y-e.y;if(this._isStraightLine=Yy(c,0,ub)||Yy(u,0,ub),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:n,y:l}=i,c=(t+n)/2,u=c+h*(l>e?-1:1)*c,d=(e===l?0:-(t-n)/(e-l))*(u-c)+(e+l)/2;a=Ky(e-d,t-u),o=Ky(l-d,n-u),s={x:u,y:d};const p=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e))}else n="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return n=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(n),{points:n,center:s,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:i,endSymbol:n,lineStyle:s,type:r="type-s"}=t,{state:a}=this.attribute,o=this._isArcLine?nb:ib;this._container.removeChild(this._line),this._line=new o(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:i,endSymbol:n,lineStyle:s,visible:t.visible,state:{line:O({},Hy,null==a?void 0:a.line),startSymbol:O({},Hy,null==a?void 0:a.lineStartSymbol),endSymbol:O({},Hy,null==a?void 0:a.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,i){if(this._line){const{startSymbol:n,endSymbol:s,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this.getItemLineAttr(t,e,i);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},l),{startSymbol:n,endSymbol:s,lineStyle:r,visible:t.visible,state:{line:O({},Hy,null==o?void 0:o.line),startSymbol:O({},Hy,null==o?void 0:o.lineStartSymbol),endSymbol:O({},Hy,null==o?void 0:o.lineEndSymbol)}})):this.reDrawLine(t,l)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,n=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(n-Math.PI/2),startPointOffsetY:i/2*Math.sin(n-Math.PI/2),endPointOffsetX:-i/2*Math.cos(n-Math.PI/2),endPointOffsetY:-i/2*Math.sin(n-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var n;if(this._decorativeLine){const{lineStyle:s}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+o,y:e.y+l}]},s),{visible:i})),this._decorativeLine.states=O({},Hy,null===(n=this.attribute.state)||void 0===n?void 0:n.line)}}setTargetItemAttributes(t,e){var i,n;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(i=t.visible)&&void 0!==i&&i,size:t.size},t.style)),this._targetItem.states=O({},Hy,null===(n=this.attribute.state)||void 0===n?void 0:n.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:n,itemLine:s={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:n,height:s}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:n,x2:s,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,u=0;return a<i&&(c=i-a),o<n&&(u=n-o),l>s&&(c=s-l),h>r&&(u=r-h),{dx:c,dy:u}}(this._item,{x1:t,y1:i,x2:t+n,y2:i+s});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,n),this.setItemLineAttr(s,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(s,e,null===(i=s.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:n={},targetSymbol:s,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=n,{offset:l=0,style:h,visible:c=!1,size:u}=s,d=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:u)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?Ky(o,a/2):"type-po"===r.type?Ky(0,a):"type-op"===r.type?Ky(o,0):Ky(o,a),{newPosition:{x:t.x+(d/2+l)*Math.cos(p),y:t.y+(d/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(d/2+l)*Math.cos(p)+a,y:t.y+(d/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:n}=this.attribute,{type:s="type-s",arcRatio:r=.8}=n,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=Yy(a,0,ub)||Yy(o,0,ub),this._isArcLine="type-arc"===s&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?nb:ib)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const u=Nh.line({points:[]});u.name="mark-point-decorativeLine",this._decorativeLine=u,t.add(u);const d=Nh.symbol({});d.name="mark-point-targetItem",this._targetItem=d,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:n="text"}=e,{type:s="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=Yy(a,0,ub)||Yy(o,0,ub);const l="type-arc"===s&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,n),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!b(t.x)||!b(t.y))}}pb.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const gb="seriesBreak";function fb(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*n,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?d:-d):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}const mb=(t,e)=>{const{start:i,end:n}=e,s=i.x===n.x,r=s?"x":"y",a=s?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e,i=1e-10,n=1e-10){const s=n,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(s,r)}(t.start[r],i[r])){const e=Math.min(i[a],n[a]),s=Math.max(i[a],n[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(s<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,s),void(o=!1)}})),o&&t.push(e)};class yb extends Gy{constructor(){super(...arguments),this.name=gb}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(w(t))return;const e=[],i=[];t.forEach((t=>{const{start:n,end:s}=t,r=n.x===s.x;mb(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:n,end:s,size:r=4,gap:a=5,style:o={}}=t,l=Ve(t,["start","end","size","gap","style"]),c=Sl({}),u=n.x===s.x;let d,p,g,f;u?(d={x:n.x-a/2,y:n.y},p={x:s.x-a/2,y:s.y},g={x:n.x+a/2,y:n.y},f={x:s.x+a/2,y:s.y}):(d={x:n.x,y:n.y-a/2},p={x:s.x,y:s.y-a/2},g={x:n.x,y:n.y+a/2},f={x:s.x,y:s.y+a/2});const m=fb(d,p,r,u?75:15,u),y=fb(n,s,r,u?75:15,u),b=fb(g,f,r,u?75:15,u);c.add(wh(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh({path:y,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function bb(t,e,i=1){return Math.abs(t-e)<i}function vb(t,e){return{type:"component",componentType:gb,interactive:!0,zIndex:500,style:{data:(i,n)=>{const s=[],r=n.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var n,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(n=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}return{x1:e,y1:i,x2:n,y2:s}}(c.getRegions());j(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const r=t.AABBBounds;let c,p,g,f,m=!1;a?(m=r.x1<(o+l-n)/2&&r.x2>(o+l+n)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),g=h,f=Math.min(r.y2+d.y1+2,d.y2)):(m=r.y1<(o+l-n)/2&&r.y2>(o+l+n)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,g=Math.min(r.x2+d.x1+2,d.x2),f=h),m&&s.push({start:{x:c,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{_b(t,"line").forEach((t=>{xb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),s.push({start:r,end:o,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{_b(t,"area").forEach((t=>{const r=xb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Ab(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),s.push({start:t,end:r,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),s}}}}function xb(t,e){const i=[];for(let n=1;n<e.length;n++){const s=Mt([t.start.x,t.start.y],[t.end.x,t.end.y],[e[n].x,e[n].y],[e[n-1].x,e[n-1].y]);s&&!i.find((t=>bb(vt.distancePP({x:t[0],y:t[1]},{x:s[0],y:s[1]}),0)))&&i.push(s)}return i}function _b(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function Ab(t,e){const{x:i,y:n}=t;let s=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const Sb="barLink";class Tb extends Gy{constructor(){super(...arguments),this.name=Sb}render(){const{data:t,linkStyle:i,areaStyle:n,styleMap:s,label:r,linkType:a="total"}=this.attribute;w(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:g,id:f=o,color:m,data:y}=t;if(g&&!1!==(null===(l=null==s?void 0:s[`area-${f}`])||void 0===l?void 0:l.visible)){const t=(b=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:m,zIndex:0},n),null==s?void 0:s[`area-${f}`]),new Bh(b));t.name="bar-link-area",t.id=`area-${f}`,this.add(t)}var b;if(p&&!1!==(null===(h=null==s?void 0:s[`line-${f}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==s?void 0:s[`line-${f}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=i||{},r=B(t),a=B(e);(null==s?void 0:s[`line-${f}`])&&s[`line-${f}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:s[`line-${f}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:s[`line-${f}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new ib({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==s?void 0:s[`line-${f}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${f}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==s?void 0:s[`label-${f}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[n,o]=y;let l=n[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=Zl(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,y):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==s?void 0:s[`label-${f}`]));d.name="bar-link-label",d.id=`label-${f}`,this.add(d)}})))}}function wb(t,i,n){const{isHorizontal:s,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=n,u=t.AABBBounds,d=i.AABBBounds;let p,g;return s?(p=[{x:(u.x1+u.x2)/2+h,y:u.y1+c},{x:(d.x1+d.x2)/2+h,y:d.y2+c}],r?("total"===o&&(p=[{x:u.x1+h,y:u.y1+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x1+h,x1:u.x2+h,y:u.y1+c},{x:d.x1+h,x1:d.x2+h,y:d.y2+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x2+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,x1:u.x1+h,y:u.y1+c},{x:d.x2+h,x1:d.x1+h,y:d.y2+c}]))):(p=[{x:u.x2+h,y:(u.y1+u.y2)/2+c},{x:d.x1+h,y:(d.y1+d.y2)/2+c}],a?("total"===o&&(p=[{x:u.x2+h,y:u.y2+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,y:u.y2+c,y1:u.y1+c},{x:d.x1+h,y:d.y2+c,y1:d.y1+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x1+h,y:d.y1+c}]),l&&(g=[{x:u.x2+h,y:u.y1+c,y1:u.y2+c},{x:d.x1+h,y:d.y1+c,y1:d.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function Mb(t={},i){const{linkType:n="total",doFill:s}=t,r=Ve(t,["linkType","doFill"]);return{type:"component",componentType:Sb,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const h=function(t,i){const n={};for(let s=0;s<t.length;s++){const r=t[s],a=e.getDatumOfGraphic(r),o=i.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(u){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=wb(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=wb(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Bb="seriesLabel";function Cb(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function kb(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Pb(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(kb(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function Ob(t,e){const{label:i,line:n}=e;return{type:"component",componentType:Bb,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(e,i)=>{var n;const s=i.vchart.getChart(),r=s.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(n=o.getScale)||void 0===n?void 0:n.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=s.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(f(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:n,y:o}=i.getLayoutStartPoint();let g=0;s.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getGraphics().forEach((s=>{var r;const l=s.context.data.find((t=>t[c]===e));if(l){const e=s.AABBBounds;let f,m,y,b;"bar"===d[0]||"waterfall"===d[0]?(f="end"===t?{x:a?(e.x1+e.x2)/2:h?e.x1:e.x2,y:a?h?e.y2:e.y1:(e.y1+e.y2)/2}:{x:a?(e.x1+e.x2)/2:h?e.x2:e.x1,y:a?h?e.y1:e.y2:(e.y1+e.y2)/2},m=s.attribute.fill):(f=i.dataToPosition(l),m=s.attribute.stroke||s.attribute.fill),"end"===t?(y=a?"center":h?"end":"start",b=a?h?"top":"bottom":"middle"):(y=a?"center":h?"start":"end",b=a?h?"bottom":"top":"middle");const v=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:f.x+n,y:f.y+o},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:l,id:`${t}-${g}`,position:t}),g++}}))}))}))}return p},line:n,label:Object.assign({space:12},i)}}}class Rb extends Gy{constructor(){super(...arguments),this.name=Bb}render(){var t,e,i,n;this.removeAllChild();const{data:s,layout:r,label:a,line:o={}}=this.attribute;if(w(s))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=s.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),n=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:g,id:f}=t,m=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),s=Cb(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:s[e]};n(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var n,s,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(s=null===(n=l[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==a?void 0:a.formatMethod,v=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),y),{textAlign:p,textBaseline:g,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[f])||void 0===h?void 0:h.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&Pb(t,4,10),e.length&&Pb(e,4,10);const i=null!==(n=null==a?void 0:a.space)&&void 0!==n?n:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,n,s,a,c;const{point:u,color:d,id:p}=t,g={x:h[p].x+(null!==(n=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:h[p].y+(null!==(c=null===(a=null===(s=l[p])||void 0===s?void 0:s.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==g.y||"horizontal"===r&&u.x!==g.x){const t=nh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=nh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}function Lb(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function Ib(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Eb(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:Ib(t.rect),anchorCandidates:Wb(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),n=[];n.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const s=i[t],r=s.bound;let a=n.some((t=>Lb(t,r)));if(s.anchorCandidates)if(a&&(null===(e=s.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<s.anchorCandidates.length;t++){const e=s.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!n.some((t=>Lb(t,i)))){n.push(i),a=!1;break}}a&&n.push(s.bound)}else n.push(s.bound)}return n.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Db(t,e,i){const n=t.map((t=>t.pointCoord)),{x1:s,x2:r,y1:a,y2:o}=Dt(n),l=i([(s+r)/2,(a+o)/2]);if(!l)return[];const h=t.map((t=>{const n=t.rect,s=Ub(e,t.pointCoord)?i(function(t,e,i,n=200){const s=5621/n;let r=e;for(let e=1;e<=s;e++){const e=de(r,n,i);if(!Ub(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Fb(jb(t.point,l)))):t.point;s&&(n.x=s.x,n.y=s.y);const r=Fb(jb(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=Nb(t.rect,a,0),t}));return Eb(h)}function Fb(t){return t>180?t-360:t}function jb(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Ub(t,e){for(let i=0;i<t.length;i++){if(ue(e,t[i]))return!0}return!1}function Nb(t,e,i=0){const n=Object.assign({},t);return"top"===e?(n.x-=t.width/2,n.y-=i+t.height/2):"bottom"===e?(n.x-=t.width/2,n.y+=i-t.height/2):"left"===e?(n.x-=i+t.width,n.y-=t.height/2):"right"===e&&(n.x+=i,n.y-=t.height/2),n}function Wb(t,e,i,n=0){const s=[];return t.forEach((t=>{const{x:r,y:a}=Nb(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,n);s.push({x:r,y:a})})),s}const zb={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class Gb extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return zb}}class Vb extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=Gb,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&h(t.seriesId)))}setAttrFromSpec(){var t,e,i,n;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(n=this._series)||void 0===n?void 0:n.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,s,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(s=null===(n=(i=this._regions[0]).getSpec)||void 0===n?void 0:n.call(i))||void 0===s?void 0:s.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new Ge(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const n=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(n)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const n=new pb({position:void 0,animation:!1});return n&&(n.name=`${this.name}_marker_${e}`,n.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,n.setAttribute("zIndex",this.layoutZIndex)),n})));this._markerComponents.forEach(((t,n)=>{const{pairInfo:s,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[n],n);s&&e.push(s),r&&i.push(r)}));const n=this._layoutLabels(e);this._layoutMarkers(n,i),this._renderMarkers()}_evaluateMarker(t,i){var n,s,r,a,o,l,c,u,d,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Nh.group({});if(k.name=`${this.name}_marker_itemContainer_${i}`,B.container=k,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=Nh.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(r=this._spec.icon)||void 0===r?void 0:r.visible){const t=Nh.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(o=null===(a=this._spec.icon.style)||void 0===a?void 0:a.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,n=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,s=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;B.icon=t,k.appendChild(t),A=n,_+=s,b++}if(null===(d=this._spec.nameLabel)||void 0===d?void 0:d.visible){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const n=i.AABBBounds,s=null!==(p=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==p?p:0,r=null!==(g=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&h(t[this.valueField])){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const n=i.AABBBounds,s=null!==(m=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==m?m:0,r=null!==(y=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:i};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Nb(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var n,s,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:u}=i[a],d=t[a],p=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),g=this._spec.space||0,f=d.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,n;if(t){const s=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=s.x2-s.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(n=s.x2-s.x1)&&void 0!==n?n:0,2!==e&&(m+=g)}})),null==c||c.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==u||u.setAttributes({dx:-d.width/2,dy:-d.height/2});const y=this._data.getLatestData()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:d.x+d.width/2-b.x,offsetY:d.y+d.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Db(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Eb(t)}_isRelativeModel(t){var e,i,n;const s=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(n=this._series.getCoordinateHelper())||void 0===n?void 0:n.getCoordinateId();return(null==t?void 0:t.id)===s}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}Vb.type="mapLabel",Vb.specKey="mapLabel",Vb.transformerConstructor=Gb;t.BAR_LINK=Sb,t.Bar3dChart=of,t.Bar3dChartSpecTransformer=yi,t.Bar3dSeries=nf,t.Bar3dSeriesSpecTransformer=nd,t.BarLinkComponent=Tb,t.ConversionFunnelChart=ni,t.ConversionFunnelSeries=si,t.DefaultBandWidth=6,t.Funnel3dChart=gf,t.Funnel3dSeries=df,t.Funnel3dSeriesSpecTransformer=hf,t.Histogram3dChart=ff,t.ImageCloudChart=Wy,t.MapLabelComponent=Vb,t.PictogramChart=Fm,t.PictogramChartSpecTransformer=mm,t.PictogramSeries=Em,t.Pie3dChart=Af,t.Pie3dChartSpecTransformer=mf,t.Pie3dSeries=xf,t.Pie3dSeriesSpecTransformer=vf,t.RangeColumn3dChart=um,t.RangeColumn3dChartSpecTransformer=cm,t.RangeColumn3dSeries=om,t.RangeColumn3dSeriesSpecTransformer=hm,t.RankingBar=me,t.RankingList=Te,t.SERIES_BREAK=gb,t.SequenceScatterKDE=di,t.SequenceScatterLink=oi,t.SequenceScatterPixel=mi,t.SeriesBreakComponent=yb,t.SeriesLabelComponent=Rb,t.WordCloud3dChart=im,t.WordCloud3dChartSpecTransformer=em,t.WordCloud3dSeries=Jf,t.appendBarLinkConfig=function(t,e){t.customMark=j(t.customMark).filter((t=>t.componentType!==Sb)),t.customMark.push(Mb(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=j(t.customMark).filter((t=>t.componentType!==gb)),t.customMark.push(vb(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,n,s;if(t.customMark=j(t.customMark).filter((t=>t.componentType!==Bb)),e||(e=null!==(s=null!==(i=M(t,Bb))&&void 0!==i?i:M(null===(n=t.series)||void 0===n?void 0:n[0],Bb))&&void 0!==s?s:{}),e.visible){const{position:i="end"}=e,n=Ve(e,["position"]);t.customMark.push(Ob(i,n))}},t.clearSVGSource=function(){ym.clear(),bm=null},t.getBarLinkConfig=Mb,t.getSVGSource=_m,t.getSeriesBreakConfig=vb,t.getSeriesLabelConfig=Ob,t.register3DPlugin=ed,t.registerAxis3dPlugin=()=>{ed(),af(),(()=>{e.registerCartesianBandAxis();const t=e.Factory.getComponentInKey(e.CartesianBandAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianLinearAxis();const t=e.Factory.getComponentInKey(e.CartesianLinearAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianTimeAxis();const t=e.Factory.getComponentInKey(e.CartesianTimeAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianSymlogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianLogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),sm)}),F(t,rm)})()},t.registerBar3dChart=()=>{ed(),af(),sf(),e.Factory.registerChart(of.type,of)},t.registerBar3dSeries=sf,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(Sb,(t=>new Tb(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([ni]),i.useSeries([si]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),pf(),e.Factory.registerChart(gf.type,gf)},t.registerFunnel3dSeries=pf,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),sf(),e.Factory.registerChart(ff.type,ff)},t.registerImageCloudChart=()=>{Ny(),e.Factory.registerChart(Wy.type,Wy)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([Vb])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Dm(),e.Factory.registerChart(Fm.type,Fm)},t.registerPictogramSeries=Dm,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),_f(),e.Factory.registerChart(Af.type,Af)},t.registerPie3dSeries=_f,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),lm(),e.Factory.registerChart(um.type,um)},t.registerRangeColumn3dSeries=lm,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([me])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.BarChart])},t.registerSVGSource=vm,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([di,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([oi,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([mi,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new yb(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Rb(t)))},t.registerWordCloud3dChart=nm,t.registerWordCloud3dSeries=Qf,t.registerWordCloudShape3dChart=()=>{ed(),tm(),nm()},t.registerWordCloudShape3dSeries=tm,t.svgSourceMap=ym,t.unregisterSVGSource=xm}));
15
+ ***************************************************************************** */function Ve(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}const He={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},Xe={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},$e={fill:"#606773",fontSize:12},Ye={fill:"#eff1f9"};class qe extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Ve(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=Ke(s,i),a=Ke(n,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=Ve(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},Ye),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function Ke(t,i){if(0===(null==t?void 0:t.length))return null;const{line:n,symbol:s,text:r,margin:a}=i,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,n=Ve(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},He),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=Ze(t,i,e),n}})})}(n,a);c&&l.push(c);const u=function(t={},e){const{style:i={}}=t,n=Ve(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},Xe),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=Ze(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=Ze(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(s,a);u&&l.push(u);const d=function(t={},e){const{style:i={},formatMethod:n,textMargin:s=4}=t,r=Ve(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},$e),{text:(t,e)=>{var i,s,r,a,l,h,c;const{text:u}=t;let d=u;if(o(n)){const{vchart:o}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(r=null===(s=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==r?r:[],y=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));d=n(u,{arrow:t,from:b,to:v})}return d},x:(t,i)=>{var n,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-s:s))&&void 0!==r?r:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(r,a);return d&&l.push(d),h.children=l,h}function Ze(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(d&&d.length){const n=p.find((t=>t[u]===d[h][u])),s=p.find((t=>t[u]===d[c][u])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?n[1]:n[0],_=m/(u+1),A=v/(d+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-s*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:T},{x:y.x-s*w,y:T}];return M}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function Je(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function Qe(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const ti=(t,e)=>{var i,n,s;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>b(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(n=ei(o))&&void 0!==n?n:[],...null!==(s=ei(l))&&void 0!==s?s:[]]};function ei(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(h(n)){const e=n.toArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((i=>{var n;const s=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)>0&&(n=r)}return n})(s,((t,e)=>t.layout.level-e.layout.level));let a=null!==(n=null==r?void 0:r.layout.level)&&void 0!==n?n:0;for(;a>=0;){if(s.some((t=>t.layout.level===a&&Je(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ii(i,e.get(i.from).totalArrows),i.layout.toIndex=ii(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ii(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class ni extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=qe}}ni.type="conversionFunnel",ni.transformerConstructor=qe;class si extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new Ge(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",ti),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const ri="dataKey";class ai extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[ri]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=ri,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"==t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class oi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=ai}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}oi.type="sequenceScatterLink",oi.view="singleDefault",oi.transformerConstructor=ai;const li=.2;function hi(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const ci="dataKey";class ui extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[ci]:e}))),s=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),s=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),o=n.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*li,p=c-(u-c)*li;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=hi(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=n.length*r*r,s.push({x:e,y:o,kde:l,label:t})}})),s}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:s}]})})),e}(t);t.type="common",t.dataKey=ci,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class di extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=ui}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}di.type="sequenceScatterKDE",di.view="singleDefault",di.transformerConstructor=ui;const pi="dataKey";function gi(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");if(!s)throw new Error("Failed to get 2D rendering context from canvas");const r=s.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const s=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*s[0]),r.data[a+1]=Math.round(255*s[1]),r.data[a+2]=Math.round(255*s[2]),r.data[a+3]=255}return s.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[pi]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class fi extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=gi(t);t.type="common",t.dataKey=pi,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class mi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=fi}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}mi.type="sequenceScatterPixel",mi.view="singleDefault",mi.transformerConstructor=fi;class yi extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var bi,vi,xi,_i,Ai;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(bi||(bi={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(vi||(vi={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(xi||(xi={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(_i||(_i={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(Ai||(Ai={}));class Si{static GenAutoIncrementId(){return Si.auto_increment_id++}}Si.auto_increment_id=0;class Ti{constructor(t){this.id=Si.GenAutoIncrementId(),this.registry=t}}const wi="named",Mi="inject",Bi="inversify:tagged",Ci="inversify:paramtypes";class ki{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===wi?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Pi=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=f(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function Oi(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};Pi.hasOwnMetadata(t,e)&&(r=Pi.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,Pi.defineMetadata(t,r,e)}(Bi,t,i.toString(),n)}function Ri(t){return(e,i,n)=>{Oi(e,0,n,t)}}const Li=(Ii=Mi,t=>(e,i,n)=>Ri(new ki(Ii,t))(e,i,n));var Ii;function Ei(){return function(t){return Pi.defineMetadata(Ci,null,t),t}}function Di(t){return Ri(new ki(wi,t))}const Fi="Singleton",ji="Transient",Ui="ConstantValue",Ni="DynamicValue",Wi="Factory",zi="Function",Gi="Instance",Vi="Invalid";class Hi{constructor(t,e){this.id=Si.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Vi,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Fi&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class Xi{getConstructorMetadata(t){return{compilerGeneratedMetadata:Pi.getMetadata(Ci,t),userGeneratedMetadata:Pi.getMetadata(Bi,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const $i=(Yi=wi,t=>{const e=e=>{if(null==e)return!1;if(e.key===Yi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===Yi&&i[e].value===t)return!0;return!1};return e.metaData=new ki(Yi,t),e});var Yi;class qi{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Fi,this}inTransientScope(){return this._binding.scope=ji,this}whenTargetNamed(t){return this._binding.constraint=$i(t),this}}class Ki{constructor(t){this._binding=t}to(t){return this._binding.type=Gi,this._binding.implementationType=t,new qi(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Ni,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new qi(this._binding)}toConstantValue(t){return this._binding.type=Ui,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Fi,new qi(this._binding)}toFactory(t){return this._binding.type=Wi,this._binding.factory=t,this._binding.scope=Fi,new qi(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Zi=Symbol("ContributionProvider");class Ji{constructor(t,e){this.serviceIdentifier=t,this.container=e,tn.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function Qi(t,e){t(Zi).toDynamicValue((({container:t})=>new Ji(e,t))).inSingletonScope().whenTargetNamed(e)}class tn{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}tn.store=new Map;class en{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class nn extends en{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const sn=new class{};let rn=0;var an,on,ln,hn;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(an||(an={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(on||(on={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(ln||(ln={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(hn||(hn={}));const cn=rt-1e-8;class un{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>cn)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(g(n),g(s),s!==n)if((n%=rt)<0&&(n+=rt),(s%=rt)<0&&(s+=rt),s<n&&(r=!r,a=n,n=s,s=a),r)for(s-=rt,a=n-n%st,o=0;o<4&&a>s;++o,a-=st)g(a);else for(a=n-n%st+st,o=0;o<4&&a<s;++o,a+=st)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class dn{constructor(){this._curves=[],this.bounds=new Xt}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const pn=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,gn={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},fn={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let mn,yn,bn,vn,xn,_n;var An,Sn,Tn,wn,Mn,Bn;function Cn(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),y=.5*(s-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,u*x+d*_,h*T+c*w,u*T+d*w,h*A+c*S,u*A+d*S]}function kn(t,e,i,n){const s=function(t,e,i,n,s,r,a,o,l){const h=xt(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let g=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),i*=g,n*=g);const f=u/i,m=c/i,y=-c/n,b=u/n,v=f*o+m*l,x=y*o+b*l,_=f*t+m*e,A=y*t+b*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===s&&(T=-T);const w=.5*(v+_)-T*(A-x),M=.5*(x+A)+T*(_-v),B=Math.atan2(x-M,v-w);let C=Math.atan2(A-M,_-w)-B;C<0&&1===r?C+=rt:C>0&&0===r&&(C-=rt);const k=Math.ceil(Math.abs(C/(st+.001))),P=[];for(let t=0;t<k;++t){const e=B+t*C/k,s=B+(t+1)*C/k;P[t]=[w,M,e,s,i,n,c,u]}return P}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=Cn(s[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[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"}(An||(An={})),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"}(Sn||(Sn={})),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"}(Tn||(Tn={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(wn||(wn={})),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"}(Mn||(Mn={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Bn||(Bn={}));const Pn=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function On(t,e,i=0,n=0,s=1,r=1,a){for(let o=0;o<t.length;o++){const l=t[o];Pn[l[0]](l,e,i,n,s,r,a)}}class Rn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ln(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],a=e[s],o=t[(s+1)%n],l=e[(s+1)%n];i+=vt.distanceNN(r,a,o,l)}return i/2}function In(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function En(t,e,i,n,s){const r=In(t.x,e.x,i.x,n.x,s),a=In(t.y,e.y,i.y,n.y,s);return new bt(r,a)}function Dn(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function Fn(t,e,i,n){const s=Dn(t.x,e.x,i.x,n),r=Dn(t.y,e.y,i.y,n);return new bt(s,r)}function jn(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,a=En(i,n,s,r,e),o=vt.pointAtPP(i,n,e),l=vt.pointAtPP(n,s,e),h=vt.pointAtPP(s,r,e),c=vt.pointAtPP(o,l,e),u=vt.pointAtPP(l,h,e);return[new Un(i,o,c,a),new Un(a,u,h,r)]}class Un extends Rn{constructor(t,e,i,n){super(),this.type=Mn.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_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 En(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,n=this.p3,Ln([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===wn.ROW?ot(this.p0.x-this.p3.x):t===wn.COLUMN?ot(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return lt(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[a]=jn(this,r);t.bezierCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i,a.p3.x*n+e,a.p3.y*s+i)}}includeX(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Nn extends Rn{constructor(t,e){super(),this.type=Mn.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return vt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=lt(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()?vt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===wn.ROW?ot(this.p0.x-this.p1.x):t===wn.COLUMN?ot(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*n+e,a.y*s+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class Wn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,s,r,a,o){const l=new Un(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n),new bt(s,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=s,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,s){const r=new Nn(new bt(this._lastX,this._lastY),new bt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===wn.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return ot(t.p0.y-n.y)}if(t===wn.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return ot(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class zn extends Wn{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Gn(t,e,i=1){let n=!1;for(let i=0,s=e.length;i<=s;i++)i>=s===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function Vn(t,e,i){const n=null!=e?e:ot(i[i.length-1].x-i[0].x)>ot(i[i.length-1].y-i[0].y)?wn.ROW:wn.COLUMN;return"monotoneY"===t?new zn(t,n):new Wn(t,n)}class Hn{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Xn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Vn("linear",i,t);return function(t,e){Gn(t,e,1)}(new Hn(s,n),t),s}function $n(t,e,i,n,s){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class Yn{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&&$n(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:$n(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function qn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Xn(t,e);const s=Vn("basis",i,t);return function(t,e){Gn(t,e,2)}(new Yn(s,n),t),s}function Kn(t){return t<0?-1:1}function Zn(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(Kn(r)+Kn(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Jn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Qn(t,e,i,n,s){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,n,t.lastPoint1)}class ts{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._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Qn(this,this._t0,Jn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Qn(this,Jn(this,e=Zn(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Qn(this,this._t0,e=Zn(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class es extends ts{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function is(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Xn(t,e);const s=Vn("monotoneX",i,t);return function(t,e){Gn(t,e,2)}(new ts(s,n),t),s}function ns(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Xn(t,e);const s=Vn("monotoneY",i,t);return function(t,e){Gn(t,e,2)}(new es(s,n),t),s}let ss=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class rs extends ss{lineEnd(){this.context.closePath()}}function as(t,e,i={}){const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Wn("step",null!=n?n:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?wn.ROW:wn.COLUMN);return os(new ss(r,e,s),t),r}function os(t,e){return Gn(t,e,1)}class ls extends Hn{lineEnd(){this.context.closePath()}}function hs(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Vn("linear",i,t);return function(t,e){Gn(t,e,1)}(new ls(s,n),t),s}function cs(t,e,i,n,s){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>it){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>it){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/s,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,n,t.lastPoint1)}function us(t,e){return function(i,n,s={}){const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Xn(i,s);const o=Vn(t,r,i);return Gn(new e(o,n,a),i,2),o}}const ds=us("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:cs(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const ps=us("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:cs(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class gs extends Rn{constructor(t,e,i){super(),this.type=Mn.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Fn(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Ln([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===wn.ROW?ot(this.p0.x-this.p2.x):t===wn.COLUMN?ot(this.p0.y-this.p2.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return lt(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=Fn(i,n,s,e),a=vt.pointAtPP(i,n,e),o=vt.pointAtPP(n,s,e);return[new gs(i,a,r),new gs(r,o,s)]}(this,r);t.quadraticCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class fs{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Nn(new bt(this._lastX,this._lastY),new bt(t,e))}quadraticCurveTo(t,e,i,n){const s=new gs(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const a=new Un(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,n),new bt(s,r));this.path.addCurve(a),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function ms(t,e,i){var n,s;switch(e){case"linear":default:return Xn(t,i);case"basis":return qn(t,i);case"monotoneX":return is(t,i);case"monotoneY":return ns(t,i);case"step":return as(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Wn("step",null!=n?n:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?wn.ROW:wn.COLUMN);return os(new rs(r,e,s),t),r}(t,.5,i);case"stepBefore":return as(t,0,i);case"stepAfter":return as(t,1,i);case"catmullRom":return ds(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return ps(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return hs(t,i)}}class ys extends dn{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new un(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([fn.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([fn.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([fn.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([fn.C,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([fn.AT,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([fn.E,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([fn.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([fn.A,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([fn.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new fs(this);On(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[fn.M]=t=>`M${t[1]} ${t[2]}`,t[fn.L]=t=>`L${t[1]} ${t[2]}`,t[fn.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[fn.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[fn.A]=t=>{const e=[],i=t[1],n=t[2],s=t[3];((t,e,i,n,s,r,a,o=!1)=>{const l=2*Math.PI,h=(e%l+l)%l;let c,u=(i%l+l)%l;o?(u>=h&&(u-=l),c=u-h):(u<=h&&(u+=l),c=u-h);const d=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/d;for(let e=0;e<d;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),u=Math.cos(i),d=Math.sin(i),g=Math.cos(l),f=Math.sin(l),m=u*r+n,y=d*a+s,b=g*r+n,v=f*a+s,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*d,y+A*u,b+_*f,v-A*g,b,v)}})(e,t[4],t[5],i,n,s,s,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[fn.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[fn.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(mn=e[t],yn=mn.slice(1),bn=mn[0],i=[bn],n=yn.match(pn),null!==n){for(let t=0,e=n.length;t<e;t++)vn=n[t],xn=parseFloat(vn),Number.isNaN(xn)||i.push(xn);if(_n=gn[bn],i.length-1>_n){let t,e=bn;for(let n=1,r=i.length;n<r;n+=_n){t=[e];for(let e=n,s=n+_n;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=ms(e,i);"x"===n?this.direction=wn.ROW:"y"===n?this.direction=wn.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[fn.M]=this.moveToTransform,t[fn.L]=this.lineToTransform,t[fn.Q]=this.quadraticCurveToTransform,t[fn.C]=this.bezierCurveToTransform,t[fn.AT]=this.arcToTransform,t[fn.E]=this.ellipseTransform,t[fn.R]=this.rectTransform,t[fn.A]=this.arcTransform,t[fn.Z]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,s=1){let r,a,o,l,h,c=null,u=0,d=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(r=t[f],1===n&&1===s||(r=vs(r,n,s)),r[0]){case"l":u+=r[1],d+=r[2],this.lineTo(u+e,d+i);break;case"L":u=r[1],d=r[2],this.lineTo(u+e,d+i);break;case"h":u+=r[1],this.lineTo(u+e,d+i);break;case"H":u=r[1],this.lineTo(u+e,d+i);break;case"v":d+=r[1],this.lineTo(u+e,d+i);break;case"V":d=r[1],this.lineTo(u+e,d+i);break;case"m":u+=r[1],d+=r[2],this.moveTo(u+e,d+i);break;case"M":u=r[1],d=r[2],this.moveTo(u+e,d+i);break;case"c":a=u+r[5],o=d+r[6],p=u+r[3],g=d+r[4],this.bezierCurveTo(u+r[1]+e,d+r[2]+i,p+e,g+i,a+e,o+i),u=a,d=o;break;case"C":u=r[5],d=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,u+e,d+i);break;case"s":a=u+r[3],o=d+r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=u+r[1],h=d+r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"S":a=r[3],o=r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=r[1],h=r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"q":a=u+r[3],o=d+r[4],p=u+r[1],g=d+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),u=a,d=o,p=r[1],g=r[2];break;case"t":a=u+r[1],o=d+r[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-l,g=2*d-h):"q"===c[0]&&(p=2*u-p,g=2*d-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o,p=u+r[1],g=d+r[2];break;case"T":a=r[1],o=r[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"a":kn(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+u+e,r[7]+d+i]),u+=r[6],d+=r[7];break;case"A":kn(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),u=r[6],d=r[7];break;case"z":case"Z":this.closePath()}c=r}}_runCommandList(t,e=0,i=0,n=1,s=1){if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case fn.L:this.lineToTransform(a,e,i,n,s);break;case fn.M:this.moveToTransform(a,e,i,n,s);break;case fn.C:this.bezierCurveToTransform(a,e,i,n,s);break;case fn.Q:this.quadraticCurveToTransform(a,e,i,n,s);break;case fn.A:this.arcToTransform(a,e,i,n,s);break;case fn.E:this.ellipseTransform(a,e,i,n,s);break;case fn.R:this.rectTransform(a,e,i,n,s);break;case fn.AT:this.arcToTransform(a,e,i,n,s);break;case fn.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),On(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===wn.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.y-e.p1.y)}if(this.direction===wn.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this._curves.length;n++){e=this._curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let a=0;for(let s=0;s<this._curves.length;s++){const o=this._curves[s],l=o.getLength(this.direction);if(!(a+l<=r)){const s=1-(a+l-r)/l;o.draw(t,i,n,e,e,s);break}o.draw(t,i,n,e,e,1),a+=l}}}const bs=["l",0,0,0,0,0,0,0];function vs(t,e,i){const n=bs[0]=t[0];if("a"===n||"A"===n)bs[1]=e*t[1],bs[2]=i*t[2],bs[3]=t[3],bs[4]=t[4],bs[5]=t[5],bs[6]=e*t[6],bs[7]=i*t[7];else if("h"===n||"H"===n)bs[1]=e*t[1];else if("v"===n||"V"===n)bs[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)bs[n]=(n%2==1?e:i)*t[n];return bs}const xs={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 Yt},_s={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},As=Object.assign({outerBorder:Object.assign(Object.assign({},_s),{distance:0}),innerBorder:Object.assign(Object.assign({},_s),{distance:0})},_s),Ss={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:an.fontBounding,keepCenterInLine:!1},Ts=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),As),{alignSelf:"auto"}),{pickStrokeBuffer:0}),ws={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ms=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Ts),xs),Bs=Object.assign(Object.assign({},Ms),{startAngle:0,endAngle:at,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Cs=Object.assign(Object.assign(Object.assign({},Ms),ws),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),ks=Object.assign(Object.assign({},Ms),{radius:1,startAngle:0,endAngle:at}),Ps=Object.assign(Object.assign({},Ms),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),Os=Object.assign(Object.assign({},Ms),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Rs=Object.assign(Object.assign(Object.assign({},Ms),ws),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Ls=Object.assign(Object.assign({},Ms),{path:new ys,fillStrokeOrder:1,clipRange:1,customPath:()=>{$.getInstance().warn("空函数")}}),Is=Object.assign(Object.assign({},Ms),{points:[],cornerRadius:0,closePath:!0}),Es=Object.assign(Object.assign({},Ms),{width:100,height:100,spikes:5,thickness:.5}),Ds=Object.assign(Object.assign({},Ms),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Ms),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Fs=Object.assign(Object.assign({},Ms),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),js=Object.assign(Object.assign(Object.assign({},Ms),Ss),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Us=Object.assign(Object.assign(Object.assign({},Ms),Ss),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ns=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Ms),{fill:!0,cornerRadius:0,cornerType:"round"}),Ws=Object.assign(Object.assign({},Ns),{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}),zs=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return s("linear",t.linearGradient,r)||s("radial",t.radialGradient,o)||s("conic",t.conicGradient,a)}function s(e,n,s){return function(n,r){const a=y(n);if(a){y(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:d(p)}}();return y(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,n,s=l();return s&&(i=[],i.push(s),n=e,y(t.comma)&&(s=l(),s?i.push(s):e=n)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const s=[];if(n)for(s.push(n);y(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=y(e);if(n)return{type:t,value:n[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const n=t.exec(e);return n&&b(n[0].length),n}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Gs{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Gs.IsGradientStr(t))try{const e=zs(t)[0];if(e){if("linear"===e.type)return Gs.ParseLinear(e);if("radial"===e.type)return Gs.ParseRadial(e);if("conic"===e.type)return Gs.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=nt/2,s=parseFloat(e.value)/180*nt-n;return{gradient:"conical",x:.5,y:.5,startAngle:s,endAngle:s+at,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=nt/2;let s="angular"===e.type?parseFloat(e.value)/180*nt:0;for(;s<0;)s+=at;for(;s>=at;)s-=at;let r=0,a=0,o=0,l=0;return s<n?(r=0,a=1,o=Math.sin(s),l=a-Math.cos(s)):s<nt?(r=0,a=0,o=Math.cos(s-n),l=Math.sin(s-n)):s<nt+n?(r=1,a=0,o=r-Math.sin(s-nt),l=Math.cos(s-nt)):(r=1,o=r-Math.cos(s-n-nt),l-=Math.sin(s-n-nt)),{gradient:"linear",x0:r,y0:a,x1:o,y1:l,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Vs(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}function Hs(t,e,i,n=0,s=0){var r,a,o,l;if(!e||!0===e)return"black";let h,c;if(g(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=Gs.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let u=e.x2-e.x1,d=e.y2-e.y1,p=e.x1-n,g=e.y1-s;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:n=0}=i.attribute;u/=t,d/=e,p/=t,g/=e,(n||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(a=i.y1WithoutTransform)&&void 0!==a?a:0,u=null!==(o=i.widthWithoutTransform)&&void 0!==o?o:u,d=null!==(l=i.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===c.gradient?h=function(t,e,i,n,s,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*s,n+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*s,n+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,u,d):"conical"===c.gradient?h=function(t,e,i,n,s,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*s,n+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(s+i,r+n,void 0):l}(t,c,p,g,u,d):"radial"===c.gradient&&(h=function(t,e,i,n,s,r){var a,o,l,h,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*s,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(s,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,c,p,g,u,d))}return h||"orange"}const Xs={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"}},$s=!0,Ys=!1,qs=/\w|\(|\)|-/,Ks=/[.?!,;:/,。?!、;:]/,Zs=/\S/,Js=(t,e)=>{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})};function Qs(t,e,i,n,s){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=sn.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return s&&(a=function(t,e,i=!1){let n=e;for(;qs.test(t[n-1])&&qs.test(t[n])||Ks.test(t[n]);)if(n--,n<=0)return i?tr(t,e):e;return n}(t,a)),a}function tr(t,e){let i=e;for(;qs.test(t[i+1])&&qs.test(t[i])||Ks.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function er(t,e,i="actual"){var n;if(""===t)return{ascent:0,height:0,descent:0,width:0};const s=sn.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?s.actualBoundingBoxAscent:s.fontBoundingBoxAscent,o="actual"===i?s.actualBoundingBoxDescent:s.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(s.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(s.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(n=e.space)&&void 0!==n?n:0;return r.width+=l,r}const ir=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=Si.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Xi}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,wi,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Hi(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new Ki(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[Mi],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Ui:case zi:e=t.cache;break;case Gi:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Fi&&(t.cache=e,t.activated=!0)}},nr=Symbol.for("CanvasFactory");function sr(t){return ir.getNamed(nr,sn.global.env)(t)}const rr=1e-4,ar=Math.sqrt(3),or=1/3;function lr(t){return t>-_r&&t<_r}function hr(t){return t>_r||t<-_r}const cr=[0,0],ur=[0,0],dr=[0,0];function pr(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function gr(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function fr(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function mr(t){return(t%=at)<0&&(t+=at),t}function yr(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>n+h&&l>r+h||l<e-h&&l<n-h&&l<r-h||o>t+h&&o>i+h&&o>s+h||o<t-h&&o<i-h&&o<s-h)&&function(t,e,i,n,s,r,a,o,l){let h=0,c=.005,u=1/0;cr[0]=a,cr[1]=o;for(let a=0;a<1;a+=.05){ur[0]=gr(t,i,s,a),ur[1]=gr(e,n,r,a);const o=pr(cr,ur);o<u&&(h=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<rr);a++){const a=h-c,o=h+c;ur[0]=gr(t,i,s,a),ur[1]=gr(e,n,r,a);const l=pr(ur,cr);if(a>=0&&l<u)h=a,u=l;else{dr[0]=gr(t,i,s,o),dr[1]=gr(e,n,r,o);const a=pr(dr,cr);o<=1&&a<u?(h=o,u=a):c*=.5}}return l&&(l[0]=gr(t,i,s,h),l[1]=gr(e,n,r,h)),Math.sqrt(u)}(t,e,i,n,s,r,o,l,null)<=h/2}function br(t,e,i,n,s,r,a,o,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>n+u&&c>r+u&&c>o+u||c<e-u&&c<n-u&&c<r-u&&c<o-u||h>t+u&&h>i+u&&h>s+u&&h>a+u||h<t-u&&h<i-u&&h<s-u&&h<a-u)&&function(t,e,i,n,s,r,a,o,l,h,c){let u,d,p,g,f=0,m=.005,y=1/0;cr[0]=l,cr[1]=h;for(let l=0;l<1;l+=.05)ur[0]=fr(t,i,s,a,l),ur[1]=fr(e,n,r,o,l),p=pr(cr,ur),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<rr);l++)u=f-m,d=f+m,ur[0]=fr(t,i,s,a,u),ur[1]=fr(e,n,r,o,u),p=pr(ur,cr),u>=0&&p<y?(f=u,y=p):(dr[0]=fr(t,i,s,a,d),dr[1]=fr(e,n,r,o,d),g=pr(dr,cr),d<=1&&g<y?(f=d,y=g):m*=.5);return c&&(c[0]=fr(t,i,s,a,f),c[1]=fr(e,n,r,o,f)),Math.sqrt(y)}(t,e,i,n,s,r,a,o,h,c,null)<=u/2}function vr(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;o-=t,l-=e;const c=Math.sqrt(o*o+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(n-s)%at<1e-4)return!0;if(r){const t=n;n=mr(s),s=mr(t)}else n=mr(n),s=mr(s);n>s&&(s+=at);let u=Math.atan2(l,o);return u<0&&(u+=at),u>=n&&u<=s||u+at>=n&&u+at<=s}function xr(t,e,i,n,s,r,a){if(0===s)return!1;const o=s,l=s/2;let h=0,c=t;if(a>e+l&&a>n+l||a<e-l&&a<n-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=h*r-a+c;return u*u/(h*h+1)<=o/2*o/2}const _r=1e-4;function Ar(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let l=0;if(lr(a)){if(hr(r)){const t=-o/r;t>=0&&t<=1&&(s[l++]=t)}}else{const t=r*r-4*a*o;if(lr(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}const Sr=[-1,-1,-1],Tr=[-1,-1];function wr(){const t=Tr[0];Tr[0]=Tr[1],Tr[1]=t}function Mr(t,e,i,n,s,r,a,o,l,h){if(h>e&&h>n&&h>r&&h>o||h<e&&h<n&&h<r&&h<o)return 0;const c=function(t,e,i,n,s,r){const a=n+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-s,c=o*o-3*a*l,u=o*l-9*a*h,d=l*l-3*o*h;let p=0;if(lr(c)&&lr(u))if(lr(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=u*u-4*c*d;if(lr(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),n=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,or):Math.pow(i,or),n=n<0?-Math.pow(-n,or):Math.pow(n,or);const s=(-o-(i+n))/(3*a);s>=0&&s<=1&&(r[p++]=s)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),s=(-o-2*i*n)/(3*a),l=(-o+i*(n+ar*Math.sin(e)))/(3*a),h=(-o+i*(n-ar*Math.sin(e)))/(3*a);s>=0&&s<=1&&(r[p++]=s),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,n,r,o,h,Sr);if(0===c)return 0;let u=0,d=-1,p=0,g=0;for(let h=0;h<c;h++){const c=Sr[h],f=0===c||1===c?.5:1;fr(t,i,s,a,c)<l||(d<0&&(d=Ar(e,n,r,o,Tr),Tr[1]<Tr[0]&&d>1&&wr(),p=fr(e,n,r,o,Tr[0]),d>1&&(g=fr(e,n,r,o,Tr[1]))),2===d?c<Tr[0]?u+=p<e?f:-f:c<Tr[1]?u+=g<p?f:-f:u+=o<g?f:-f:c<Tr[0]?u+=p<e?f:-f:u+=o<p?f:-f)}return u}function Br(t,e,i,n,s,r,a,o){if(o>e&&o>n&&o>r||o<e&&o<n&&o<r)return 0;const l=function(t,e,i,n,s){const r=t-2*e+i,a=2*(e-t),o=t-n;let l=0;if(lr(r)){if(hr(a)){const t=-o/a;t>=0&&t<=1&&(s[l++]=t)}}else{const t=a*a-4*r*o;if(lr(t)){const t=-a/(2*r);t>=0&&t<=1&&(s[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),n=(-a-e)/(2*r);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}(e,n,r,o,Sr);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,r);if(h>=0&&h<=1){let o=0;const c=gr(e,n,r,h);for(let n=0;n<l;n++){const l=0===Sr[n]||1===Sr[n]?.5:1;gr(t,i,s,Sr[n])<a||(Sr[n]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===Sr[0]||1===Sr[0]?.5:1;return gr(t,i,s,Sr[0])<a?0:r<e?c:-c}function Cr(t,e,i,n,s,r,a,o){if((o-=e)>i||o<-i)return 0;const l=Math.sqrt(i*i-o*o);Sr[0]=-l,Sr[1]=l;const h=Math.abs(n-s);if(h<1e-4)return 0;if(h>=at-1e-4){n=0,s=at;const e=r?1:-1;return a>=Sr[0]+t&&a<=Sr[1]+t?e:0}if(n>s){const t=n;n=s,s=t}n<0&&(n+=at,s+=at);let c=0;for(let e=0;e<2;e++){const i=Sr[e];if(i+t>a){let t=Math.atan2(o,i),e=r?1:-1;t<0&&(t=at+t),(t>=n&&t<=s||t+at>=n&&t+at<=s)&&(t>nt/2&&t<1.5*nt&&(e=-e),c+=e)}}return c}function kr(t){return Math.round(t/nt*1e8)/1e8%2*nt}function Pr(t,e){let i=kr(t[0]);i<0&&(i+=at);const n=i-t[0];let s=t[1];s+=n,!e&&s-i>=at?s=i+at:e&&i-s>=at?s=i-at:!e&&i>s?s=i+(at-kr(i-s)):e&&i<s&&(s=i-(at-kr(s-i))),t[0]=i,t[1]=s}const Or=[0,0];function Rr(t,e,i,n,s){const r=t,a=t.length;let o,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=r[t],g=0===t;a[0]===fn.M&&t>1&&(i||(h+=Ut(c,u,d,p,n,s))),g&&(c=a[1],u=a[2],d=c,p=u);const f=a[0],m=a[1],y=a[2],b=a[3],v=a[4],x=a[5],_=a[6];let A=v,S=x;Or[0]=A,Or[1]=S,Pr(Or,Boolean(a[6])),A=Or[0],S=Or[1];const T=A,w=S-A,M=!!(1-(a[6]?0:1)),B=(n-m)*b/b+m;switch(f){case fn.M:d=m,p=y,c=d,u=p;break;case fn.L:if(i){if(xr(c,u,m,y,e,n,s))return!0}else h+=Ut(c,u,m,y,n,s)||0;c=m,u=y;break;case fn.C:if(i){if(br(c,u,m,y,b,v,x,_,e,n,s))return!0}else h+=Mr(c,u,m,y,b,v,x,_,n,s)||0;c=x,u=_;break;case fn.Q:if(i){if(yr(c,u,m,y,b,v,e,n,s))return!0}else h+=Br(c,u,m,y,b,v,n,s)||0;c=b,u=v;break;case fn.A:if(o=Math.cos(T)*b+m,l=Math.sin(T)*b+y,g?(d=o,p=l):h+=Ut(c,u,o,l,n,s),i){if(vr(m,y,b,T,T+w,M,e,B,s))return!0}else h+=Cr(m,y,b,T,T+w,M,B,s);c=Math.cos(T+w)*b+m,u=Math.sin(T+w)*b+y;break;case fn.R:if(d=c=m,p=u=y,o=d+b,l=p+v,i){if(xr(d,p,o,p,e,n,s)||xr(o,p,o,l,e,n,s)||xr(o,l,d,l,e,n,s)||xr(d,l,d,p,e,n,s))return!0}else h+=Ut(o,p,o,l,n,s),h+=Ut(d,l,d,p,n,s);break;case fn.Z:if(i){if(xr(c,u,d,p,e,n,s))return!0}else h+=Ut(c,u,d,p,n,s);c=d,u=p}}return i||(g=u,f=p,Math.abs(g-f)<_r)||(h+=Ut(c,u,d,p,n,s)||0),0!==h;var g,f}const Lr=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=sr(Object.assign({nativeCanvas:sn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=sr(Object.assign({nativeCanvas:sn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Ir={arc:Bs,area:Cs,circle:ks,line:Rs,path:Ls,symbol:Fs,text:js,rect:Ds,polygon:Is,star:Es,richtext:Us,richtextIcon:Ws,image:Ns,group:Ps,glyph:Os},Er=Object.keys(Ir);function Dr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Fr={arc:Object.assign({},Ir.arc),area:Object.assign({},Ir.area),circle:Object.assign({},Ir.circle),line:Object.assign({},Ir.line),path:Object.assign({},Ir.path),symbol:Object.assign({},Ir.symbol),text:Object.assign({},Ir.text),rect:Object.assign({},Ir.rect),polygon:Object.assign({},Ir.polygon),star:Object.assign({},Ir.star),richtext:Object.assign({},Ir.richtext),richtextIcon:Object.assign({},Ir.richtextIcon),image:Object.assign({},Ir.image),group:Object.assign({},Ir.group),glyph:Object.assign({},Ir.glyph)};class jr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Er.forEach((t=>{this._defaultTheme[t]=Object.create(Fr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,$.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Er.forEach((n=>{const s=Object.create(Fr[n]);t&&t[n]&&Dr(s,t[n]),i[n]&&Dr(s,i[n]),e[n]&&Dr(s,e[n]),this.combinedTheme[n]=s})),e.common&&Er.forEach((t=>{Dr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Ur=new jr;function Nr(t,e){return t.glyphHost?Nr(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)):Ur.getTheme()}return null}(t)||t.attachedThemeGraphic&&Nr(t.attachedThemeGraphic)||Ur.getTheme()}var Wr=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class zr extends s{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=Si.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Wr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)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===t||t===e)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&&$.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=c(i)&&i.once,r=o(e)?void 0:e;return t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=o(e)?void 0:e;t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Gr{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=Gr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&o(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Vr extends Gr{constructor(t,e){super(),this.type=t,this.detail=e}}const Hr={dispatchEvent(t){var e;if(!(t instanceof Gr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Vr(t,e))}};class Xr{static GetImage(t,e){var i;const n=Xr.cache.get(t);n?"fail"===n.loadState?sn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Xr.loadImage(t,e)}static GetSvg(t,e){var i;let n=Xr.cache.get(t);n?"fail"===n.loadState?sn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Xr.cache.set(t,n),n.dataPromise=sn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Xr.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Xr.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=sn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=sn.global.loadBlob(t):"json"===e&&(i.dataPromise=sn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Xr.isLoading&&Xr.toLoadAueue.length){Xr.isLoading=!0;const t=Xr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(Xr.cache.set(i,s),s.dataPromise=sn.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()})).catch((t=>{console.error(t),Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()}))}}),0)}static loadImage(t,e){const i=$r(t,Xr.toLoadAueue);if(-1!==i)return Xr.toLoadAueue[i].marks.push(e),void Xr.loading();Xr.toLoadAueue.push({url:t,marks:[e]}),Xr.loading()}static improveImageLoading(t){const e=$r(t,Xr.toLoadAueue);if(-1!==e){const t=Xr.toLoadAueue.splice(e,1);Xr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function $r(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var Yr;Xr.cache=new Map,Xr.isLoading=!1,Xr.toLoadAueue=[],Xr.onLoadSuccessCb=[],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"}(Yr||(Yr={}));const qr=[!1,!1,!1,!1],Kr=[0,0,0,0],Zr=t=>t?g(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Kr[0]=t[0],Kr[2]=t[0],Kr[1]=t[1],Kr[3]=t[1],Kr):t:t:0,Jr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qr=[1,2,3,0,1,2,3,0];function ta(t,e,i,n){for(;t>=at;)t-=at;for(;t<0;)t+=at;for(;t>e;)e+=at;Jr[0].x=i,Jr[1].y=i,Jr[2].x=-i,Jr[3].y=-i;const s=Math.ceil(t/st)%4,r=Math.ceil(e/st)%4;if(n.add(ht(t)*i,dt(t)*i),n.add(ht(e)*i,dt(e)*i),s!==r||e-t>nt){let t=!1;for(let e=0;e<Qr.length;e++)if(t||s!==Qr[e]){if(t&&r===Qr[e])break;if(t){const t=Jr[Qr[e]];n.add(t.x,t.y)}}else{t=!0;const e=Jr[s];n.add(e.x,e.y)}}}function ea(t,e,i){const{x:n,y:s}=mt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=mt(t.x1,t.y1,e.x1,e.y1,i),o=new bt(n,s,r,a);return o.defined=e.defined,o}function ia(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<e.length;s++)n[s]=ea(t[s],e[s],i)}else{n=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<t.length;s++)n[s]=ea(t[s],e[s],i)}return n}const na=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};class sa{bounds(t,e){if(y(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}}function ra(t,e,i,n,s){return s?t.arc(i,n,e,0,rt,!1,s):t.arc(i,n,e,0,rt),!1}var aa=new class extends sa{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,s){return ra(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return ra(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var oa=new class extends sa{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function la(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var ha=new class extends sa{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return la(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return la(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return la(t,this.parseSize(e)/2+s,i,n,r)}};function ca(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var ua=new class extends sa{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return ca(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ca(t,this.parseSize(e)/2+s,i,n)}};function da(t,e,i,n,s=0){return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class pa extends sa{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return da(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return da(t,this.parseSize(e)/2,i,n,s)}}var ga=new pa;var fa=new class extends pa{constructor(){super(...arguments),this.type="triangle"}};const ma=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ya=Math.sin(rt/10)*ma,ba=-Math.cos(rt/10)*ma;function va(t,e,i,n){const s=ya*e,r=ba*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let a=1;a<5;++a){const o=rt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*s-h*r+i,h*s+l*r+n)}return t.closePath(),!0}var xa=new class extends sa{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return va(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return va(t,this.parseSize(e)/2+s,i,n)}};const _a=pt(3);function Aa(t,e,i,n){const s=e,r=s/_a,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var Sa=new class extends sa{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return Aa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Aa(t,this.parseSize(e)/2+s,i,n)}};function Ta(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var wa=new class extends sa{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Ta(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ta(t,this.parseSize(e)/2+s,i,n)}};function Ma(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Ba=new class extends sa{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Ma(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ma(t,this.parseSize(e)/2+s,i,n)}};const Ca=-.5,ka=pt(3)/2,Pa=1/pt(12);function Oa(t,e,i,n){const s=e/2,r=e*Pa,a=s,o=e*Pa+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(Ca*s-ka*r+i,ka*s+Ca*r+n),t.lineTo(Ca*a-ka*o+i,ka*a+Ca*o+n),t.lineTo(Ca*l-ka*h+i,ka*l+Ca*h+n),t.lineTo(Ca*s+ka*r+i,Ca*r-ka*s+n),t.lineTo(Ca*a+ka*o+i,Ca*o-ka*a+n),t.lineTo(Ca*l+ka*h+i,Ca*h-ka*l+n),t.closePath(),!1}var Ra=new class extends sa{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return Oa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Oa(t,this.parseSize(e)/2+s,i,n)}};function La(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Ia=new class extends sa{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return La(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return La(t,this.parseSize(e)/2,i,n,s)}};function Ea(t,e,i,n,s=0){return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var Da=new class extends sa{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Ea(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ea(t,this.parseSize(e)/2,i,n,s)}};function Fa(t,e,i,n,s=0){return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var ja=new class extends sa{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return Fa(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Fa(t,this.parseSize(e)/2,i,n,s)}};const Ua=pt(3);function Na(t,e,i,n){const s=e*Ua;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Wa=new class extends sa{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Na(t,this.parseSize(e)/2/Ua,i,n)}drawOffset(t,e,i,n,s){return Na(t,this.parseSize(e)/2/Ua+s,i,n)}};function za(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Ga=new class extends sa{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return za(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return za(t,this.parseSize(e)/4+s,i,n)}};function Va(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var Ha=new class extends sa{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return Va(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Va(t,this.parseSize(e)/4+s,i,n)}};function Xa(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var $a=new class extends sa{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Xa(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Xa(t,this.parseSize(e)/4+s,i,n)}};function Ya(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var qa=new class extends sa{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return Ya(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ya(t,this.parseSize(e)/4+s,i,n)}};function Ka(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Za=new class extends sa{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return Ka(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Ka(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function Ja(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Qa=new class extends sa{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return Ja(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Ja(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function to(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var eo=new class extends sa{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return to(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return to(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function io(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function no(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var so=new class extends sa{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return y(e)?no(t,e,i,n):io(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,a){y(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*s,l=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+n>o){const e=(i.x-c.x)*(o-h)/n,s=(i.y-c.y)*(o-h)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,h+=n}return!1}drawOffset(t,e,i,n,s){return y(e)?no(t,e+2*s,i,n):io(t,[e[0]+2*s,e[1]+2*s],i,n)}};const ro=new Xt;class ao{constructor(t,e,i=!1){this.pathStr="",this.type=t,g(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),On(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(On(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{ro.x1=i.bounds.x1*t,ro.y1=i.bounds.y1*t,ro.x2=i.bounds.x2*t,ro.y2=i.bounds.y2*t,e.union(ro)}))}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 oo={};[aa,oa,ha,ua,Wa,fa,xa,Sa,wa,Ba,Ra,Ia,Da,ga,ja,Ga,Ha,$a,qa,so,Za,Qa,eo].forEach((t=>{oo[t.type]=t}));const lo={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class ho{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function co(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function uo(t,e,i,n=">"){const s=function(t,e,i=">"){let n,s="";for(let r=e;r<t.length;r++){let e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:s,index:r};if(t[r+1]===i[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,n);if(!s)return;let r=s.data;const a=s.index,o=r.search(/\s/);let l=r,h=!0;-1!==o&&(l=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),h=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:a,attrExpPresent:h,rawTagName:c}}const po=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class go{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,po),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new ho("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=co(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=uo(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=co(t,"--\x3e",r+4,"Comment is not closed.");else{const a=uo(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new ho(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new ho(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function fo(t,e){return mo(t)}function mo(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=yo(s);if(void 0!==r&&s[r]){const t=mo(s[r]);n=t,Object.keys(n).length,s[":@"]&&bo(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function yo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function bo(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class vo{constructor(t){this.options=Object.assign({},vo.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return fo(new go(this.options).parseXml(t),this.options)}}function xo(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}vo.defaultOptions={};let _o=0;function Ao(){return _o++}var So;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(So||(So={}));const To=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>To.set(t,!0)));const wo=new Map;function Mo(t){if(To.has(t))return!0;if(wo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>wo.set(t,!0)));const Bo=Ao(),Co=Ao(),ko=Ao();Ao(),Ao();const Po=Ao(),Oo=Ao(),Ro=Ao(),Lo=Ao(),Io=Ao(),Eo=Ao(),Do=Ao(),Fo=Ao(),jo=Ao();Ao();const Uo=Ao(),No=Ao(),Wo=Symbol.for("GraphicCreator"),zo={"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"},Go=Object.keys(zo),Vo={duration:200,easing:"cubicOut"};function Ho(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}function Xo(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,u,d,p,g,f,m,y;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*n+c*s+g*r+e[12],t[13]=o*n+u*s+f*r+e[13],t[14]=l*n+d*s+m*r+e[14],t[15]=h*n+p*s+y*r+e[15]),t}function $o(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*n+x*o+_*u+A*f,t[1]=v*s+x*l+_*d+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*n+x*o+_*u+A*f,t[5]=v*s+x*l+_*d+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*n+x*o+_*u+A*f,t[9]=v*s+x*l+_*d+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*n+x*o+_*u+A*f,t[13]=v*s+x*l+_*d+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function Yo(t,e,i){const n=e[0],s=e[1],r=e[2];let a=i[3]*n+i[7]*s+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/a,t[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/a,t[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/a,t}class qo{constructor(){this.pools=[]}static identity(t){return Ho(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 qo.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Ko=new class{constructor(){this.pools=[]}allocate(t,e,i,n,s,r){if(!this.pools.length)return new Yt(t,e,i,n,s,r);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=s,a.f=r,a}allocateByObj(t){if(!this.pools.length)return new Yt(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Zo=new qo;var Jo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const tl=new Yt(1,0,0,1,0,0),el={x:0,y:0};let il=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Yt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Yt(1,0,0,1,0,0),this.path=new ys,this._clearMatrix=new Yt(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ko.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Yt(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n,s=!0){this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),s&&this.setTransformForCurrent()}setTransform(t,e,i,n,s,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*n,o*s,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,s,r,a=!0){this.matrix.multiply(t,e,i,n,s,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,n=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,s,r){this.path.arc(t,e,i,n,s,r)}arcTo(t,e,i,n,s){this.path.arcTo(t,e,i,n,s)}bezierCurveTo(t,e,i,n,s,r){this.path.bezierCurveTo(t,e,i,n,s,r)}closePath(){this.path.closePath()}ellipse(t,e,i,n,s,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,s,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},el),function(t,e,i){return Rr(t,0,!1,e,i)}(this.path.commandList,el.x,el.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},el);const i=Vs(this,this.lineWidth,this.dpr);return function(t,e,i,n){return Rr(t,e,!0,i,n)}(this.path.commandList,i,el.x,el.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,s){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,s){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(tl,t,e)}setClearMatrix(t,e,i,n,s,r){this._clearMatrix.setValue(t,e,i,n,s,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Ko.free(t))),this.stack.length=0}};var nl;il=Jo([Ei(),Qo("design:paramtypes",[Object,Number])],il),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(nl||(nl={}));class sl{static Get(t,e=nl.Color1,i=[0,0,0,1]){if(e===nl.Color1){const e=sl.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=re.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];sl.store1[t]=e,sl.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=sl.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=re.parseColorString(t);return s&&(sl.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],sl.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===nl.Color1){if(sl.store1[t])return;sl.store1[t]=i,sl.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(sl.store255[t])return;sl.store255[t]=i,sl.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function rl(t,e=!1){return Array.isArray(t)&&y(t[0])?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 al(t,e,i,n,s){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((s,r)=>{var a,o;return ol(g(t)?null!==(a=t[r])&&void 0!==a?a:t[0]:t,g(e)?null!==(o=e[r])&&void 0!==o?o:e[0]:e,i,n)})):ol(t,e,i,n,s)}function ol(t,e,i,n,s){if(!t||!e)return t&&rl(t)||e&&rl(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=sl.Get(t,nl.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=sl.Get(e,nl.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:rl(a)})))});return o?al(r,l,i,n,s):al(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ul(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ul(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ul(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),rl(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),n)}function ll(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}sl.store255={},sl.store1={};const hl=[0,0,0,0],cl=[0,0,0,0];function ul(t,e,i){return sl.Get(t,nl.Color255,hl),sl.Get(e,nl.Color255,cl),`rgba(${Math.round(hl[0]+(cl[0]-hl[0])*i)},${Math.round(hl[1]+(cl[1]-hl[1])*i)},${Math.round(hl[2]+(cl[2]-hl[2])*i)},${hl[3]+(cl[3]-hl[3])*i})`}const dl=new Xt,pl=new Yt;new Xt;const gl=["lineWidth","scaleX","scaleY","angle","anchor","visible"],fl=["x","y"],ml=["scaleX","scaleY"],yl=["angle"],bl=new bt,vl={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class xl extends zr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(xl.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Xt,this._updateTag=An.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:sn.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;bl.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),bl.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else bl.x=s,bl.y=r;return bl}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new $t),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=oo[t];if(e)return e;if(e=xl.userSymbolMap[t],e)return e;if(!0===((i=t=lo[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new vo,{svg:i}=e.parse(t);if(!i)return null;const n=g(i.path)?i.path:[i.path];dl.clear();const s=[];n.forEach((t=>{const e=(new ys).fromString(t.d),i={};Go.forEach((e=>{t[e]&&(i[zo[e]]=t[e])})),s.push({path:e,attribute:i}),dl.union(e.bounds)}));const r=dl.width(),a=dl.height(),o=1/ct(r,a);s.forEach((t=>t.path.transform(0,0,o,o)));const l=new ao(t,s,!0);return xl.userSymbolMap[t]=l,l}var i;const n=(new ys).fromString(t),s=n.bounds.width(),r=n.bounds.height(),a=1/ct(s,r);n.transform(0,0,a,a);const o=new ao(t,n);return xl.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=Zr(s);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new un(t);return On(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new Yt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&An.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&An.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&An.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&An.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&An.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&An.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=An.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===Sn.GLOBAL){const i=new bt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,n){this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||n)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):l(null===(s=this.normalAttrs)||void 0===s?void 0:s[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=gl){for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t,e=gl){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Tn.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=An.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Tn.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?sn.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:xs.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:xs.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Tn.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Tn.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,ml,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new Yt,o.postMatrix=n),sn.transformUtil.fromMatrix(n,n).scale(t,e,i)}else o.scaleX=(null!==(n=o.scaleX)&&void 0!==n?n:xs.scaleX)*t,o.scaleY=(null!==(s=o.scaleY)&&void 0!==s?s:xs.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Tn.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ml,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Tn.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,yl,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Yt,r.postMatrix=i),sn.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:xs.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Tn.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,yl,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),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,i,n){var s,r;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(s=this.context&&this.context.stateAnimateConfig)&&void 0!==s?s:this.stateAnimateConfig)&&void 0!==r?r:Vo;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Tn.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Tn.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:Tn.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const n=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=n?n:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=g(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&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 i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=An.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=An.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=An.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&An.UPDATE_SHAPE_AND_BOUNDS)===An.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=An.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=An.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=An.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=An.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=An.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=An.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=An.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&An.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=xs.x,y:e=xs.y,scaleX:i=xs.scaleX,scaleY:n=xs.scaleY,angle:s=xs.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&s&&(l=this.getAnchor(a,h)),!r||1===i&&1===n)!function(t,e,i,n,s,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=ht(a),f=dt(a);let m,y;o?(m=o[0],y=o[1]):(m=i,y=n);const b=m-i,v=y-n,x=l*g+c*f,_=h*g+u*f,A=c*g-l*f,S=u*g-h*f;t.a=s*x,t.b=s*_,t.c=r*A,t.d=r*S,t.e=d+l*m+c*y-x*b-A*v,t.f=p+h*m+u*y-_*b-S*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(s),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),sn.transformUtil.fromMatrix(a,a).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(xs);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=pl.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){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.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Tn.ANIMATE_END})}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:sn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),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 p(t,!0)?this.pathProxy=(new ys).fromString(t):this.pathProxy=new ys,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Xr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(v(t)||t.includes("/")||x(t))&&(Xr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),sn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Vr(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}toCustomPath(){var t,e,i;const n=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||sn.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(n){const t=new il(null,1);return n.drawShape(this,t,0,0,{},{}),t.path}return null}}var _l;xl.userSymbolMap={},xl.mixin(Hr),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(_l||(_l={}));class Al extends xl{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Po,this._childUpdateTag=An.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 jr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new jr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===Sn.GLOBAL){const i=new bt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&An.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=xs.x,y:e=xs.y,dx:i=xs.dx,dy:n=xs.dy,scaleX:s=xs.scaleX,scaleY:r=xs.scaleY,angle:a=xs.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Nr(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=An.CLEAR_BOUNDS,this._childUpdateTag&=An.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=An.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&An.UPDATE_BOUNDS||(this._childUpdateTag|=An.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(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return this.getGraphicService().onRemove(t),t.stage=null,this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&An.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=sn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Al(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Al.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Sl(t){return new Al(t)}function Tl(t,e){return!(!t&&!e)}function wl(t,e){let i;return i=g(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Ml(t,e,i){return i&&t*e>0}function Bl(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}function Cl(t,e){return t*e>0}function kl(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Pl(t,e,i,n,s,r,a){const o=t-i,l=e-n,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,u=-h*o,d=t+c,p=e+u,g=i+c,f=n+u,m=(d+g)/2,y=(p+f)/2,b=g-d,v=f-p,x=b*b+v*v,_=s-r,A=d*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-u,x11:T*(s/_-1),y11:w*(s/_-1)}}function Ol(t,e,i,n,s){const r=ot(i-e),a=t.getParsedCornerRadius(),o=g(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,m=o?a[1]:a,y=o?a[2]:a,b=o?a[3]:a,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=s*ht(c),T=s*dt(c),w=n*ht(d),M=n*dt(d);let B,C,k,P;if((x>it||v>it)&&(B=s*ht(u),C=s*dt(u),k=n*ht(p),P=n*dt(p),r<nt)){const t=function(t,e,i,n,s,r,a,o){const l=i-t,h=n-e,c=a-s,u=o-r;let d=u*l-c*h;return d*d<it?[]:(d=(c*(e-r)-u*(t-s))/d,[t+d*l,e+d*h])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],i=T-t[1],r=B-t[0],a=C-t[1],o=1/dt(((O=(e*r+i*a)/(pt(e*e+i*i)*pt(r*r+a*a)))>1?0:O<-1?nt:Math.acos(O))/2),l=pt(t[0]*t[0]+t[1]*t[1]);A=ut(x,(n-l)/(o-1)),_=ut(v,(s-l)/(o+1))}}var O;return{outerDeltaAngle:l,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function Rl(t,e,i,n,s,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(s<r){const t=s;s=r,r=t}if(s<=it)e.moveTo(i,n);else if(h>=at-it)e.moveTo(i+s*ht(o),n+s*dt(o)),e.arc(i,n,s,o,l,!c),r>it&&(e.moveTo(i+r*ht(l),n+r*dt(l)),e.arc(i,n,r,l,o,c));else{const{outerDeltaAngle:h,xors:d,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:y,outerCornerRadiusEnd:b,maxOuterCornerRadius:v,xore:x,yore:_,xire:A,yire:S,outerStartAngle:T,outerEndAngle:w,limitedIcr:M,innerDeltaAngle:B,innerEndAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,o,l,r,s);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,n+p),u=!0;else if(m>it){const t=ut(y,m),r=ut(b,m),o=Pl(g,f,d,p,s,t,Number(c)),l=Pl(x,_,A,S,s,r,Number(c));m<v&&t===r?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,m,lt(o.y01,o.x01),lt(l.y01,l.x01),!c)):e.moveTo(i+o.cx+m*ht(lt(l.y01,l.x01)),n+o.cy+m*dt(lt(l.y01,l.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,n,s,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),!c),r>0&&e.arc(i+l.cx,n+l.cy,r,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):r>0?e.moveTo(i+l.cx+r*ht(lt(l.y01,l.x01)),n+l.cy+r*dt(lt(l.y01,l.x01))):e.moveTo(i+x,n+s*dt(w))}else!a||a[0]?(e.moveTo(i+d,n+p),e.arc(i,n,s,T,w,!c)):e.moveTo(i+s*ht(w),n+s*dt(w));if(!(r>it)||B<.001)!a||a[1]?e.lineTo(i+A,n+S):e.moveTo(i+A,n+S),u=!0;else if(M>it){const t=ut(P,M),s=ut(O,M),o=Pl(A,S,x,_,r,-s,Number(c)),l=Pl(d,p,g,f,r,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),M<R&&t===s){const t=lt(l.y01,l.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,M,lt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+ht(t),n+o.cy+dt(t))}else!a||a[2]?(s>0&&e.arc(i+o.cx,n+o.cy,s,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,n,r,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,n+l.cy,t,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*ht(lt(l.y01,l.x01)),n+l.cy+t*dt(lt(l.y01,l.x01))):e.moveTo(i+g,n+f)}else!a||a[1]?e.lineTo(i+A,n+S):e.moveTo(i+A,n+S),!a||a[2]?e.arc(i,n,r,C,k,c):e.moveTo(i+r*ht(k),n+r*dt(k))}return a?a[3]&&e.lineTo(i+s*ht(o),n+s*dt(o)):e.closePath(),u}Al.NOWORK_ANIMATE_ATTR=vl;const Ll=Symbol.for("ArcRenderContribution"),Il=Symbol.for("ImageRenderContribution"),El=Symbol.for("PolygonRenderContribution"),Dl=Symbol.for("RectRenderContribution"),Fl=Symbol.for("SymbolRenderContribution"),jl=Symbol.for("TextRenderContribution"),Ul=Symbol.for("InteractiveSubRenderContribution");function Nl(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Wl(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var zl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vl=function(t,e){return function(i,n){e(i,n,t)}};function Hl(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(n=m[2])&&void 0!==n?n:0}if(Ho(t),Xo(t,t,[s+o,r+l,a+h]),Xo(t,t,[b[0],b[1],b[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=e[5],o=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]=r*s+h*n,t[5]=a*s+c*n,t[6]=o*s+u*n,t[7]=l*s+d*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=u*s-o*n,t[11]=d*s-l*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=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]=r*s-h*n,t[1]=a*s-c*n,t[2]=o*s-u*n,t[3]=l*s-d*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+u*s,t[11]=l*n+d*s}(t,t,p),Xo(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=Zo.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Xo(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=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]=r*s+h*n,t[1]=a*s+c*n,t[2]=o*s+u*n,t[3]=l*s+d*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=u*s-o*n,t[7]=d*s-l*n}(i,i,f),Xo(i,i,[-n[0],-n[1],0]),$o(t,t,i)}}let Xl=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new nn(["graphic"]),onSetStage:new nn(["graphic","stage"]),onRemove:new nn(["graphic"]),onRelease:new nn(["graphic"]),onAddIncremental:new nn(["graphic","group","stage"]),onClearIncremental:new nn(["graphic","group","stage"]),beforeUpdateAABBBounds:new nn(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new nn(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new nn(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Xt,this.tempAABBBounds2=new Xt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new un(t);return On(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=Wl(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=Nl(s,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){xo(u,(l+h)/Math.abs(s+r),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;xo(u,o/Math.abs(s+r)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const a=s.transMatrix;s&&s.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Vt(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),this.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};Xl=zl([Ei(),Vl(0,Li(Wo)),Gl("design:paramtypes",[Object])],Xl);const $l=(t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}return i};class Yl{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n,s="",r,a){const{lineWidth:o,suffixPosition:l="end",measureMode:h=an.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;u.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=n}d[1]=u.length*n,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const ql=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...gl];class Kl extends xl{get font(){const t=this.getGraphicTheme();return this._font||(this._font=zt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))return!1;const{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=No,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return g(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Nr(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Kl({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:s,y:r}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=kt(a,i,{x:s,y:r});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:s}=sn.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){xo(s,o/Math.abs(r+a),!0,l),i.union(s)}return sn.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||sn.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Vt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=n,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===f||d)return this.updateWrapAABBBounds(t);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),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=sn.graphicUtil.textMeasure,A=new Yl(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const s=this.getGraphicTheme(),{fontFamily:r=s.fontFamily,textAlign:a=s.textAlign,textBaseline:o=s.textBaseline,fontSize:l=s.fontSize,ellipsis:h=s.ellipsis,maxLineWidth:c,stroke:u=s.stroke,lineWidth:d=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:f=s.fontWeight,ignoreBuf:m=s.ignoreBuf,measureMode:y=s.measureMode,suffixPosition:b=s.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,s,A);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),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const T=sn.graphicUtil.textMeasure,w={fontSize:l,fontWeight:f,fontFamily:r,lineHeight:S},M=new Yl(r,w,T),B=g(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/S),1)),x&&(P=Math.min(P,x)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<B.length;t++){const e=B[t];let s=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,c,h,!1,b,t!==B.length-1),n=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,w,c,h,!1,b);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;s=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(s=!0,o=r.wordBreaked),r.str.length===e.length);else if(s){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let n=0,s=B.length;n<s;n++){if(n===P-1){const t=T.clipTextWithSuffix(B[n],w,c,h,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[n],t=T.measureTextWidth(e,w),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,a,o,C);const R=M.layoutWithBBox(O,C,a,o,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const n=this.getGraphicTheme(),s=sn.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=n.maxLineWidth,ellipsis:l=n.ellipsis,fontFamily:h=n.fontFamily,fontSize:c=n.fontSize,fontWeight:u=n.fontWeight,stroke:d=n.stroke,lineWidth:p=n.lineWidth,verticalMode:g=n.verticalMode,suffixPosition:f=n.suffixPosition}=a,m=this.getLineHeight(a,n,0);let{textAlign:y=n.textAlign,textBaseline:b=n.textBaseline}=a;if(!g){const t=y;y=null!==(e=Kl.baselineMapAlign[b])&&void 0!==e?e:"left",b=null!==(i=Kl.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const t=Nl(y,r),e=this.cache.verticalList.length*m,i=Wl(b,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)Mo(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:So.VERTICAL}),n="",i=0),e.push({text:t[s],direction:So.HORIZONTAL}));return n&&e.push({text:n,direction:So.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?n.ellipsis:l,a=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,f);v[e]=a.verticalList,r=a.width}else{const i=s.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);v[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===So.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=v,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const x=Nl(y,r),_=this.cache.verticalList.length*m,A=Wl(b,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=na(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=ql){return super.needUpdateTags(t,e)}needUpdateTag(t,e=ql){return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new Kl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Kl.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Kl.baselineMapAlign}getAlignMapBaseline(){return Kl.alignMapBaseline}}function Zl(t){return new Kl(t)}Kl.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},vl),Kl.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Kl.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Jl=["symbolType","size",...gl];let Ql=class t extends xl{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Uo}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return g(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Nr(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=sn.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;xo(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(g(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,Jl)}needUpdateTag(t){return super.needUpdateTag(t,Jl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=g(e)?e:[e,e];return t.path?(new ys).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new ys).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function th(t){return new Ql(t)}Ql.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},vl);const eh=["segments","points","curveType","curveTension",...gl];let ih=class t extends xl{constructor(t={}){super(t),this.type="line",this.numberType=Ro}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ia(i,n,e))}getGraphicTheme(){return Nr(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),sn.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,eh)}needUpdateTag(t){return super.needUpdateTag(t,eh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new ys;const i=e.segments,n=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):e.points&&n(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function nh(t){return new ih(t)}ih.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const sh=["width","x1","y1","height","cornerRadius",...gl];class rh extends xl{constructor(t){super(t),this.type="rect",this.numberType=Do}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Nr(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:a,y:o}=t;e=null!=e?e:s-a,n=null!=n?n:r-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);return $l(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,sh)}needUpdateTag(t){return super.needUpdateTag(t,sh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:i,y:n,width:s,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=l(t.width)?t.x1-t.x:t.width,i=l(t.height)?t.y1-t.y:t.height,n=0,s=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(s=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:s,width:e,height:i}})(e);return t=new ys,t.moveTo(i,n),t.rect(i,n,s,r),t}clone(){return new rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rh.NOWORK_ANIMATE_ATTR}}function ah(t){return new rh(t)}rh.NOWORK_ANIMATE_ATTR=vl;const oh=[[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 lh extends rh{constructor(t){super(t),this.type="rect3d",this.numberType=Fo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:n,x:s,y:r,length:a=ut(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-s,l=null!=l?l:n-r;for(let e=0;e<oh.length;e++){const i=oh[e];t.vertices.push([i[0]*o,i[1]*l,i[2]*a])}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 lh.NOWORK_ANIMATE_ATTR}}function hh(t){return new lh(t)}lh.NOWORK_ANIMATE_ATTR=vl;class ch{constructor(t,e,i,n,s,r,a,o,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=s,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Xs[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),s=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,n):this.height||n||0;r=Math.min(r,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-s:"center"===this.globalAlign&&(o=-s/2);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 i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+s>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:s}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let s=this[this.directionKey.height];if(this.singleLine&&(s=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=s&&0!==s)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((s-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],a=s-this.lines[i].top-this.lines[i].height;if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+s||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function uh(t,e,i,n){const s=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(n);return{left:t>s?s:s-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>n?o:o+.5}}class dh{constructor(t,e,i,n){var s,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=n;const a=na(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=er(t,i,this.ascentDescentMode);let u=0,d=0,p=0;this.height>l&&(u=(this.height-l)/2,d=Math.ceil(u),p=Math.floor(u)),"top"===this.textBaseline?(this.ascent=u,this.descent=l-u):"bottom"===this.textBaseline?(this.ascent=l-u,this.descent=u):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(s=i.dx)&&void 0!==s?s:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=er(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,n,s,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+n;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qs(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const u=uh(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},u),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,n,s,r,a){var o;let l=e+i,h=this.text,c=this.left+n+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let u=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,u="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qs(h,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===u);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===u&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===u&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Qs(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=er(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-n}return i}}const ph=["width","height","image",...gl];class gh extends xl{constructor(t){super(t),this.type="image",this.numberType=Oo,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Nr(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:n=e.maxWidth,maxHeight:s=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>n/s?(r=n,a=n/t):(a=s,r=s*t)}}else r=n,a=s}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);return $l(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Ns[t]}needUpdateTags(t){return super.needUpdateTags(t,ph)}needUpdateTag(t){return super.needUpdateTag(t,ph)}clone(){return new gh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gh.NOWORK_ANIMATE_ATTR}}function fh(t){return new gh(t)}gh.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},vl);class mh extends gh{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=Zr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(g(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zr(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){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=Ns.width,height:e=Ns.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,s=(i-t)/2,r=(n-e)/2;return this._AABBBounds.expand([0,2*s,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class yh{constructor(t,e,i,n,s,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=s,this.top=i-n,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof mh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Xs[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof dh){const e=Zs.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let s=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?s=t-this.actualWidth:"center"===this.textAlign?s=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?s=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof mh?(t["_"+i.x]=s,s+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=s,s+=t[i.width]+r)}))}draw(t,e,i,n,s,r){if(s&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof mh)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===s?"...":s||"";i.ellipsisStr=r;const{width:a}=er(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,s)=>{if(e instanceof mh)return;const r=e.drawBackground(t,n,this.ascent,i,0===s,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],n=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,n.right-i.left,n.bottom-i.top)})),this.paragraphs.forEach(((e,s)=>{if(e instanceof mh)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Ys;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:s=1}=e;t.globalAlpha=n*s,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Js(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||$s;if(!n)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:r=1}=e;t.globalAlpha=s*r,t.fillStyle=i?Hs(t,n,{AABBBounds:i}):n,Js(t,e)}(t,e.character,a),e.draw(t,n,this.ascent,i,0===s,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof mh)break;const{width:s}=er(t,n.character,n.ascentDescentMode),r=s||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof mh?t.width:t.getWidthWithEllips(this.direction)})),i}}class bh{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=Xs[this.direction]}store(t){if(t instanceof mh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new yh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof mh?"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||this.newLine)&&("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,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,s=Qs(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==s){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new dh(i,t.newLine,t.character,t.ascentDescentMode),new dh(n,!0,t.character,t.ascentDescentMode)]}(t,s);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let vh=!1;try{vh=Intl&&"function"==typeof Intl.Segmenter}catch(t){vh=!1}const xh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...gl];class _h extends xl{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=jo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Us.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:Us.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:Us.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:Us.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:Us.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:Us.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:Us.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:Us.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Nr(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&p(t.text)&&_h.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&p(t.text)&&_h.splitText(t.text).length>1)))}static splitText(t){if(vh){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:n}of e.segment(t))i.push(n);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const i=_h.splitText(t.text.toString());if(p(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const s=i[n];e.push(Object.assign(Object.assign({},t),{text:s}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var n,s,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:u=e.textAlign,textBaseline:d=(null!==(s=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)&&void 0!==s?s:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:n}=t.getActualSize();let s=o||e||0,r=l||n||0;r="number"==typeof c&&r>c?c:r||0,s="number"==typeof h&&s>h?h:s||0,i.set(0,0,s,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(d){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(u){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return i.translate(f,g),sn.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||sn.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,sn.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,xh)}needUpdateTag(t){return super.needUpdateTag(t,xh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:u,upgradeAttrs:d}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:u},t);return(null==d?void 0:d.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:i,maxHeight:n,width:s,height:r,ellipsis:a,wordBreak:o,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d,disableAutoWrapLine:p,editable:g,ascentDescentMode:f,upgradeAttrs:m}=this.attribute,b=m&&m.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!_h.AllSingleCharacter(v)&&(v=_h.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new mh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let n=0;n<i.length;n++)if(0===n)x.push(new dh(i[n],!1,e,f));else if(i[n]||t===_.length-1)x.push(new dh(i[n],!0,e,f));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new dh(i[n],!0,e,f))}}else e.text&&x.push(new dh(e.text,!1,e,f))}const A="number"==typeof i&&Number.isFinite(i)&&i>0,S="number"==typeof n&&Number.isFinite(n)&&n>0,T="number"==typeof s&&Number.isFinite(s)&&s>0&&(!A||s<=i),w="number"==typeof r&&Number.isFinite(r)&&r>0&&(!S||r<=n),M=new ch(0,0,(T?s:A?i:0)||0,(w?r:S?n:0)||0,a,o,l,h,c,u||"horizontal",!T&&A,!w&&S,d||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new bh(M);if(B.newLine=b,p){let t=0,e=!1;for(let i=0;i<x.length;i++){const n=x[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&M.lines[M.lines.length-1].paragraphs.push(n)):B.deal(n,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,M.lines[M.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?i:n)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new _h(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,s,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(s=this.stage)||void 0===s||s.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let s;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-n})&&(s=e,s.globalX=(null!==(a=s.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],s.globalY=(null!==(o=s.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),s}getNoWorkAnimateAttr(){return _h.NOWORK_ANIMATE_ATTR}}function Ah(t){return new _h(t)}_h.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},vl);const Sh=["path","customPath",...gl];class Th extends xl{constructor(t){super(t),this.type="path",this.numberType=Lo}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=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof ys?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ys?this.cache:t.path)}getGraphicTheme(){return Nr(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=sn.graphicService.updateTempAABBBounds(i);$l(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new ys).fromString(t.path):t.customPath&&(this.cache=new ys,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Sh)}needUpdateTag(t){return super.needUpdateTag(t,Sh)}toCustomPath(){return(new ys).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Th(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Th.NOWORK_ANIMATE_ATTR}}function wh(t){return new Th(t)}Th.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},vl);const Mh=["segments","points","curveType","curveTension",...gl];class Bh extends xl{constructor(t){super(t),this.type="area",this.numberType=ko}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Nr(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),sn.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments}=t,r=i;return s.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ia(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Mh)}needUpdateTag(t){return super.needUpdateTag(t,Mh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new ys;const e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Bh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bh.NOWORK_ANIMATE_ATTR}}Bh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const Ch=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...gl];class kh extends xl{constructor(t){super(t),this.type="arc",this.numberType=Bo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:s=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(s+=n,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(s-r),o=t=>Math.min(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(g(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,s=i-e>=0?1:-1,r=i-e;if(e=At(e),i=e+r,n&&ot(r)<at-it){let r=1,a=1;n.length&&(r=Number(n[0]),a=Number(n[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=h,l-=c;const u=Math.abs(o-l)/2,d=u/o;if(u>it&&o>it)return{startAngle:e-s*d*r,endAngle:i+s*d*a,sc:s*d*r,ec:s*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:n=i.innerPadding,outerPadding:s=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=s,o-=n;const{padRadius:l=pt(a*a+o*o)}=this.attribute,h=ot(e-t);let c=t,u=e,d=t,p=e;const g=r/2;let f=h,m=h;if(g>it&&l>it){const i=e>t?1:-1;let n=ft(Number(l)/o*dt(g)),s=ft(Number(l)/a*dt(g));return(f-=2*n)>it?(n*=i,d+=n,p-=n):(f=0,d=p=(t+e)/2),(m-=2*s)>it?(s*=i,c+=s,u-=s):(m=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return Nr(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=sn.graphicService.updateTempAABBBounds(i);$l(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=r,s-=a,n<s&&(n=s),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(n+=r,s-=a,n<s){const t=n;n=s,s=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return n<=it?i.set(0,0,0,0):Math.abs(o-l)>at-it?i.set(-n,-n,n,n):(ta(l,o,n,i),ta(l,o,s,i)),i}needUpdateTags(t){return super.needUpdateTags(t,Ch)}needUpdateTag(t){return super.needUpdateTag(t,Ch)}toCustomPath(){var t,e,i,n;let s=super.toCustomPath();if(s)return s;const r=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(n=r.outerPadding)&&void 0!==n?n:0);const c=ot(o-a),u=o>a;if(h<l){const t=h;h=l,l=t}if(s=new ys,h<=it)s.moveTo(0,0);else if(c>=at-it)s.moveTo(0+h*ht(a),0+h*dt(a)),s.arc(0,0,h,a,o,!u),l>it&&(s.moveTo(0+l*ht(o),0+l*dt(o)),s.arc(0,0,l,o,a,u));else{const t=h*ht(a),e=h*dt(a),i=l*ht(o),n=l*dt(o);s.moveTo(0+t,0+e),s.arc(0,0,h,a,o,!u),s.lineTo(0+i,0+n),s.arc(0,0,l,o,a,u),s.closePath()}return s}clone(){return new kh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return kh.NOWORK_ANIMATE_ATTR}}function Ph(t){return new kh(t)}kh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);class Oh extends kh{constructor(t){super(t),this.type="arc3d",this.numberType=Co}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:s=e.outerRadius,height:r=0}=t,a=s+r;return i.setValue(-a,-a,a,a),sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Oh.NOWORK_ANIMATE_ATTR}}function Rh(t){return new Oh(t)}Oh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);const Lh=["points","cornerRadius",...gl];class Ih extends xl{constructor(t){super(t),this.type="polygon",this.numberType=Io}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Nr(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),sn.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return sn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=ia(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Lh)}needUpdateTag(t){return super.needUpdateTag(t,Lh)}toCustomPath(){const t=this.attribute.points,e=new ys;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Ih(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ih.NOWORK_ANIMATE_ATTR}}function Eh(t){return new Ih(t)}Ih.NOWORK_ANIMATE_ATTR=vl;class Dh extends Ih{constructor(t){super(t),this.type="pyramid3d",this.numberType=Eo}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),sn.graphicService.updateTempAABBBounds(i),sn.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],s=e.x-n.x;return 0===s?0:(e.y-n.y)/s})),i=t.map((t=>({p:t,d:0})));let n=!1,s=0;for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){if(e[t]===e[r]){n=!0;const e=vt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,s=ct(s,e);const a=vt.distancePP(i[r].p,i[r+1].p);i[r].d=a,i[r+1].d=a,s=ct(s,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(s-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const r={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.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]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return Dh.NOWORK_ANIMATE_ATTR}}function Fh(t){return new Dh(t)}Dh.NOWORK_ANIMATE_ATTR=vl;class jh extends Al{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Uh(t){return new jh(t)}const Nh=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Wh;function zh(t){return Wh||(Wh=Nh.CreateGraphic("text",{})),Wh.initAttributes(t),Wh.AABBBounds}var Gh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Vh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hh=function(t,e){return function(i,n){e(i,n,t)}};class Xh{constructor(){this.time=Bn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Nr(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:y,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=n,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*n*o,e.height*n*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*o,s=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(d=i*(u/n),p=u):"repeat-y"===s&&(p=n*(c/i),d=c);const r=t.dpr,a=Lr.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),Lr.free(a)}const n=t.dpr,a=t.createPattern(e,s);a.setTransform&&a.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}}const $h=new Xh;let Yh=class{constructor(t){this.subRenderContribitions=t,this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}};Yh=Gh([Ei(),Hh(0,Li(Zi)),Hh(0,Di(Ul)),Vh("design:paramtypes",[Object])],Yh);const qh=new class{constructor(){this.time=Bn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||u),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const Kh=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const Zh=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=Lr.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Lr.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,at),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,g,f,m)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=Lr.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(y/x),A=d.rows?d.rows:Math.ceil(b/x),S=d.gutterColumn?d.gutterColumn:2*v,T=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=th({}));const w=d.columns?y/d.columns:x,M=d.rows?b/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=n+x/2+r*x,l=s+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=s;let{amplitude:d=10}=s;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=d*Math.sin((e+m+u)/y+u);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,n+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const Jh=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=w?o:Vs(e,o,e.dpr),c=o/B,d="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+d*h,innerRadius:M-d*h,startAngle:b-d*c,endAngle:v+d*c}),e.beginPath(),Rl(t,e,i,n,B+d*h,M-d*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,s,(_-i)/S,(A-n)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(d,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Qh=Zh,tc=$h,ec=nt/2;function ic(t,e,i,n,s,r,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),n<0&&(e+=n,n=-n),s<0&&(i+=s,s=-s),y(r,!0))l=[r=ot(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=ot(t[0]),l=[e,e,e,e];break;case 2:case 3:e=ot(t[0]),i=ot(t[1]),l=[e,i,e,i];break;default:l=t,l[0]=ot(l[0]),l[1]=ot(l[1]),l[2]=ot(l[2]),l[3]=ot(l[3])}}else l=[0,0,0,0];if(n<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,i,n,s);const[h,c,u,d]=[[e,i],[e+n,i],[e+n,i+s],[e,i+s]],p=Math.min(n/2,s/2),g=[Math.min(p,l[0]),Math.min(p,l[1]),Math.min(p,l[2]),Math.min(p,l[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],b=[c[0]-g[1],c[1]],v=[c[0],c[1]+g[1]],x=[u[0]-g[2],u[1]],_=[u[0],u[1]-g[2]],A=[d[0]+g[3],d[1]],S=[d[0],d[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!N(b,v)){o&&o[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-ec,0,!1)}if(o&&o[1]?o[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!N(x,_)){const e=_[0]-g[2],i=_[1];o&&o[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,g[2],0,ec,!1)}if(o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!N(A,S)){const e=A[0],i=A[1]-g[3];o&&o[2]&&t.moveTo(A[0],A[1]),t.arc(e,i,g[3],ec,nt,!1)}if(o&&o[3]?o[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!N(f,m)){const e=f[0],i=f[1]+g[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],nt,nt+ec,!1)}}else o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),o&&o[1]?o[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),o&&o[2]?o[2](A[0],A[1],f[0],f[1]):t.lineTo(f[0],f[1]);return!o&&t.closePath(),t}var nc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class sc{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,m=p&&!1!==p.visible;if(!f&&!m)return;const{cornerRadius:y=l.cornerRadius,cornerType:b=l.cornerType,opacity:v=l.opacity,x:x=l.x,y:_=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY,x1:T,y1:w,keepStrokeScale:M=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-i)||0,C=(null!=C?C:w-n)||0;const k=(s,r)=>{const a=!(!s||!s.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=s,c=M?h:Vs(e,h,e.dpr),d=i+o*c,p=n+o*c,f=2*c;if(0===y||g(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(d,p,B-o*f,C-o*f)):(e.beginPath(),ic(e,d,p,B-o*f,C-o*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,s,(x-i)/A,(_-n)/S,l[r]),l[r].opacity=a,e.stroke()}};f&&k(d,"outerBorder"),m&&k(p,"innerBorder")}}let rc=class{constructor(){this.time=Bn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}};rc=nc([Ei()],rc);let ac=class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:m=l.y,stroke:y=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:v=l.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:d-f)||0,_=(null!=_?_:p-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,l),!(0===b||g(b)&&b.every((t=>0===t)))){let s,r=0;return ic(e,i,n,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,h,c,u)=>{y[o]&&(r===o-1&&y[o]===s||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),i,n,l),e.beginPath(),e.moveTo(a,h),s=y[o]),r=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),y[0]?e.lineTo(i+x,n):e.moveTo(i+x,n),y[1]?e.lineTo(i+x,n+_):e.moveTo(i+x,n+_),y[2]?e.lineTo(i,n+_):e.moveTo(i,n+_),y[3]){const t=y[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}};ac=nc([Ei()],ac);const oc=new sc,lc=Zh,hc=$h;const cc=new class extends sc{constructor(){super(...arguments),this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){return super.drawShape(t,e,i,n,s,r,a,o,l,h,c,u)}},uc=$h;const dc=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=S?o:Vs(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,y,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,s,(v-i)/_,(x-n)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},pc=new class{constructor(){this.time=Bn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,y,i,n,p,m,((s,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-n)/v,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-n)/v,l),e.stroke())))}},gc=Zh,fc=$h,mc={x:0,y:0,z:0,lastModelMatrix:null};class yc{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(qh),this.builtinContributions.push(Kh),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Bn.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Bn.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=Nr(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=Ml(u,d,h),v=Cl(u,g),x=Tl(h),_=wl(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return On(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,n-y,l),e.fill())),this.afterRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Ml(o,l,s),p=Cl(o,c),g=Tl(s,r),f=wl(a,h);return!(!t.valid||!u)&&!(!g&&!f)&&!!(d||p||i||n||r)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i,n=!1){const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;mc.x=s,mc.y=r,mc.z=a,mc.lastModelMatrix=u;const p=d&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const n=Zo.allocate(),s=Zo.allocate();Hl(s,t,e),$o(n,u||n,s),mc.x=0,mc.y=0,mc.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Zo.free(s)}if(g&&!u){const n=t.getOffsetXY(e);mc.x+=n.x,mc.y+=n.y,mc.z=a,i.setTransformForCurrent()}else if(p)mc.x=0,mc.y=0,mc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);mc.x+=n.x,mc.y+=n.y,this.transformWithoutTranslate(i,mc.x,mc.y,mc.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),mc.x=0,mc.y=0,mc.z=0;return mc}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},c={x:s,y:0},u={x:s,y:r};n.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),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,m=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,y=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s,r){const{context:a}=n;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawPathProxy(t,a,h,c,n,s)||(this.drawShape(t,a,h,c,n,s,null,null,r),this.z=0,a.modelMatrix!==d&&Zo.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var bc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},vc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,n){e(i,n,t)}};let _c=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Bo,this.builtinContributions=[Jh,tc,Qh],this.init(t)}drawArcTailCapPath(t,e,i,n,s,r,a,o){const l=o-a,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=o;const d=u>c;let p=!1;if(s<r){const t=s;s=r,r=t}const{outerDeltaAngle:g,xors:f,yors:m,xirs:y,yirs:b,limitedOcr:v,outerCornerRadiusStart:x,outerCornerRadiusEnd:_,maxOuterCornerRadius:A,xore:S,yore:T,xire:w,yire:M,limitedIcr:B,innerDeltaAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,c,u,r,s);if(v>it){const t=ut(x,v),r=ut(_,v),a=Pl(y,b,f,m,s,t,Number(d)),o=Pl(S,T,w,M,s,r,Number(d));if(v<A&&t===r)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,v,lt(a.y01,a.x01),lt(o.y01,o.x01),!d);else{const t=u-l-.03,a=lt(o.y11,o.x11);e.arc(i,n,s,t,a,!d),r>0&&e.arc(i+o.cx,n+o.cy,r,lt(o.y11,o.x11),lt(o.y01,o.x01),!d)}}else e.moveTo(i+f,n+m);if(!(r>it)||C<.001)e.lineTo(i+w,n+M),p=!0;else if(B>it){const t=ut(P,B),s=ut(O,B),a=Pl(w,M,S,T,r,-s,Number(d)),o=Pl(f,m,y,b,r,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),B<R&&t===s){const t=lt(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,B,lt(a.y01,a.x01),t,!d)}else{s>0&&e.arc(i+a.cx,n+a.cy,s,lt(a.y01,a.x01),lt(a.y11,a.x11),!d);const t=lt(a.cy+a.y11,a.cx+a.x11),o=u-l-.03;e.arc(i,n,r,t,o,d)}}else e.lineTo(i+r*ht(k),n+r*dt(k));return p}drawShape(t,e,i,n,s,r,o,l,h){h=null!=h?h:Nr(t,null==r?void 0:r.theme).arc;const{fill:c=h.fill,stroke:u=h.stroke,x:d=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(a(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();ot(n-i)<at-it&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let i=!0;if(a(t,!0)){for(let n=0;n<4;n++)qr[n]=t,i&&(i=!(null!==(e=qr[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)qr[e]=!!t[e],i&&(i=!!qr[e]);else qr[0]=!1,qr[1]=!1,qr[2]=!1,qr[3]=!1;return{isFullStroke:i,stroke:qr}})(u);if((b||k)&&(e.beginPath(),Rl(t,e,i,n,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),g?(this._runStroke(t,e,i,n,h,v,k,y,l),this._runFill(t,e,i,n,h,b,m,d,p,o)):(this._runFill(t,e,i,n,h,b,m,d,p,o),this._runStroke(t,e,i,n,h,v,k,y,l))),!k&&v&&(e.beginPath(),Rl(t,e,i,n,T,w,P),C||this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(a(A)&&A||A[1])&&S){const{startAngle:r,endAngle:a}=t.getParsedAngle();if(ot(a-r)>=at-it){e.beginPath();const r=Math.abs(T-w)/2/T,{endAngle:a=h.endAngle,fill:c=h.fill}=t.attribute,u=a;this.drawArcTailCapPath(t,e,i,n,T,w,u,u+r),C||this.beforeRenderStep(t,e,i,n,b,v,m,y,h,s,o,l);const d=()=>{if(b){const s=c;if("conical"===s.gradient){const r=function(t,e,i,n){const{stops:s,startAngle:r,endAngle:a}=n;for(;i<0;)i+=at;for(;i>at;)i-=at;if(i<r)return s[0].color;if(i>a)return s[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t<s.length;t++)if(s[t].offset>=h){o=s[t-1],l=s[t];break}return h=(h-o.offset)/(l.offset-o.offset),al(o.color,l.color,h,!1)}(0,0,a,s);o||Ml&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=r,e.fill())}}},p=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))};d(),p()}}this.afterRenderStep(t,e,i,n,b,v,m,y,h,s,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,n,s,r,a,o,l,h){r&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,n,s),e.stroke()))}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n,s)}};function Ac(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,a):t.lineTo(s+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[n]=jn(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,a)}}function Sc(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+s,o+r,a)}else d&&(h=!n,t.lineTo(d.x+s,d.y+r,a))}return h}_c=bc([Ei(),xc(0,Li(Zi)),xc(0,Di(Ll)),vc("design:paramtypes",[Object])],_c);var Tc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let wc=class extends yc{constructor(){super(...arguments),this.numberType=Ro}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,a,o,l,h,c,u,d,p,f){var m;if(!e)return;t.beginPath();(function(t,e,i,n,s){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=s||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Sc(t,n,e,i,r,a,o),e=n):e=n}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),Ac(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===n?d=wn.ROW:"y"===n?d=wn.COLUMN:"auto"===n&&(d=e.direction);const p=i*e.tryUpdateLength(d);let g=0,f=!0,m=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],n=i.getLength(d),l=(p-g)/n;if(g+=n,l<0)break;if(h){if(i.originP1===i.originP2){m=i;continue}f=Sc(t,i,m,f,r,a,o),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),Ac(t,i,ut(l,1),s),c=!1}}})(t,e,l,h,{offsetX:c,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),d.cache&&!g(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:y=0,x:b=0}=a;return!1!==i&&(p?p(t,a,o):s&&(t.setCommonStyle(d,a,y-c,b-u,o),t.fill())),!1!==n&&(f?f(t,a,o):r&&(t.setStrokeStyle(d,a,y-c,b-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,i,n,s,r,a,o){const l=Nr(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=l.curveTension,connectedType:y=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:b=l.curveType}=t.attribute;f&&"linear"===b&&(b="linearClosed");const{clipRange:v=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===b)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,s,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=ms(_(t.points,y),b,{startPoint:e,curveTension:m});return n=s,s})).filter((t=>!!t)),"linearClosed"===b){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ms(_(n,y),b,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,s[g],[l,t.attribute],v,x,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const y=r.getLength(),b=(p-g)/y;g+=y,b>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,u,d,s[m],[l,t.attribute],ut(b,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,v,x,i,n,t,a,o)}};wc=Tc([Ei()],wc);var Mc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cc=function(t,e){return function(i,n){e(i,n,t)}};let kc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=Do,this.builtinContributions=[oc,hc,lc],this.init(t)}drawShape(t,e,i,n,s,r,a,o,l){l=null!=l?l:Nr(t,null==r?void 0:r.theme).rect;const{fill:h=l.fill,background:c,stroke:u=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:p=l.cornerType,opacity:f=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:v=l.visible,x1:x,y1:_,x:A=l.x,y:S=l.y,fillStrokeOrder:T=l.fillStrokeOrder}=t.attribute;let{width:w,height:M}=t.attribute;w=(null!=w?w:x-A)||0,M=(null!=M?M:_-S)||0;const B=Bl(f,m,w,M,h),C=kl(f,b,w,M),k=Tl(h,c),P=wl(u,y);if(!t.valid||!v)return;if(!k&&!P)return;if(!(B||C||a||o||c))return;0===d||g(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(i,n,w,M)):(e.beginPath(),ic(e,i,n,w,M,d,"bevel"!==p));const O={doFill:k,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,k,P,B,C,l,s,a,o,O),T?(this._runStroke(t,e,i,n,l,O,C,A,S,o),this._runFill(t,e,i,n,l,O,B,A,S,a)):(this._runFill(t,e,i,n,l,O,B,A,S,a),this._runStroke(t,e,i,n,l,O,C,A,S,o)),this.afterRenderStep(t,e,i,n,k,P,B,C,l,s,a,o)}_runFill(t,e,i,n,s,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,s):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-n,s),e.stroke()))}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).rect;this._draw(t,s,!1,i,n,s)}};kc=Mc([Ei(),Cc(0,Li(Zi)),Cc(0,Di(Dl)),Bc("design:paramtypes",[Object])],kc);var Pc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Oc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rc=function(t,e){return function(i,n){e(i,n,t)}};let Lc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Uo,this.builtinContributions=[dc,fc,gc,pc],this.init(t)}drawShape(t,e,i,n,s,r,a,o,l){var h;l=null!=l?l:Nr(t,null==r?void 0:r.theme).symbol;const{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:m=l.fillStrokeOrder,clipRange:y=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=l.keepDirIn3d}=t.attribute,w=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();let M=i,B=n,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(i,n,w);e.camera=null,g(c)&&(c[0],c[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,c,M,B,C,((s,r)=>{var h,c,g,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(h=r.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=r.stroke)&&void 0!==g?g:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,r,u-i,d-n,l),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,l):x&&y>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-n)/f,l),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,_,A,v,x,l,s,a,o),m?(this._runStroke(t,e,i,n,l,A,x,u,d,S,y,p,f,o),this._runFill(t,e,i,n,l,_,v,u,d,S,a)):(this._runFill(t,e,i,n,l,_,v,u,d,S,a),this._runStroke(t,e,i,n,l,A,x,u,d,S,y,p,f,o)),this.afterRenderStep(t,e,i,n,_,A,v,x,l,s,a,o)}_runFill(t,e,i,n,s,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h,c,u,d,p){r&&!h.isSvg&&(p?p(e,t.attribute,s):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/u,(l-n)/d,s),e.stroke()))}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};Lc=Pc([Ei(),Rc(0,Li(Zi)),Rc(0,Di(Fl)),Oc("design:paramtypes",[Object])],Lc);const Ic=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Xt)}allocate(t,e,i,n){if(!this.pools.length)return(new Xt).setValue(t,e,i,n);const s=this.pools.pop();return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s}allocateByObj(t){if(!this.pools.length)return new Xt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Ec=new class extends Xh{constructor(){super(...arguments),this.time=Bn.beforeFillStroke}drawShape(t,e,i,n,s,r,a,o,l,h,u,d){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=l.backgroundMode,backgroundFit:T=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=c(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),n=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),s=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Ic.allocate(i,n,i+s,n+r),B=B.background,!O){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(A=B.dy)&&void 0!==A?A:0),t,e)}}else k=t.AABBBounds,O||(k=zh(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const s=t.resources.get(B);if("success"!==s.state||!s.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,s.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:s}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=B,s?(ic(e,k.x1,k.y1,k.width(),k.height(),s,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Ic.free(k),C()}};var Dc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(i,n){e(i,n,t)}};let Uc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=No,this.builtinContributions=[Ec],this.init(t)}drawShape(t,e,i,n,s,r,a,o){var l,h,c;const u=Nr(t,null==r?void 0:r.theme).text,{text:d,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:m=u.direction,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:v=u.x,y:x=u.y}=t.attribute,_=null!==(l=na(t.attribute.lineHeight,y))&&void 0!==l?l:y,A=this.valid(t,u,a,o);if(!A)return;const{fVisible:S,sVisible:T,doFill:w,doStroke:M}=A,B=!f,C=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,w,M,S,T,u,s,a,o),B&&this.transformUseContext2d(t,u,C,e);const k=(s,r,l,h)=>{let c=i+r;const d=n+l;if(h){e.highPerformanceSave(),c+=y;const t=Ko.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Ko.free(t)}M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-n,u),e.strokeText(s,c,d,C))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-n,u),e.fillText(s,c,d,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,C),"horizontal"===m){const{multilineLayout:s}=t;if(!s)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=s.bbox;M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-n,u),s.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+n,C)})))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-n,u),s.lines.forEach((s=>{e.fillText(s.str,(s.leftOffset||0)+r+i,(s.topOffset||0)+l+n,C),this.drawUnderLine(p,g,t,(s.leftOffset||0)+r+i,(s.topOffset||0)+l+n,s.descent,(s.descent-s.ascent)/2,C,u,e,{width:s.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:n=u.textBaseline}=t.attribute;if(!b){const e=i;i=null!==(h=t.getBaselineMapAlign()[n])&&void 0!==h?h:"left",n=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const s=t.cache,{verticalList:r}=s;e.textAlign="left",e.textBaseline="top";const a=_*r.length;let o=0;r.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=ct(e,o)}));let l=0,d=0;"bottom"===n?d=-a:"middle"===n&&(d=-a/2),"center"===i?l-=o/2:"right"===i&&(l-=o),r.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),s=o-n;let r=l;"center"===i?r+=s/2:"right"===i&&(r+=s),t.forEach((t=>{const{text:i,width:n,direction:s}=t;k(i,a-(e+1)*_+d,r,s),r+=n}))}))}B&&this.restoreTransformUseContext2d(t,u,C,e),this.afterRenderStep(t,e,i,n,w,M,S,T,u,s,a,o)}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).text,{keepDirIn3d:r=s.keepDirIn3d}=t.attribute,a=!r;this._draw(t,s,a,i,n)}drawUnderLine(t,e,i,n,s,r,a,o,h,c,u){if(e+t<=0)return;const{textAlign:d=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=i.attribute,b=!l(u),v=b?u.width:i.clipedWidth,x=b?0:Nl(d,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(i,_,n,s,h),m&&c.setLineDash(m),c.beginPath();const e=s+r+f;c.moveTo(n+x,e,o),c.lineTo(n+x+v,e,o),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(i,_,n,s,h),c.beginPath();const t=s+a;c.moveTo(n+x,t,o),c.lineTo(n+x+v,t,o),c.stroke()}}};function Nc(t,e,i,n){if(e&&e.length){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}}function Wc(t,e){return Math.sqrt(t*t+e*e)}function zc(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}Uc=Dc([Ei(),jc(0,Li(Zi)),jc(0,Di(jl)),Fc("design:paramtypes",[Object])],Uc);const Gc=Zh,Vc=$h;var Hc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$c=function(t,e){return function(i,n){e(i,n,t)}};let Yc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Io,this.builtinContributions=[Vc,Gc],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Nr(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:f=l.fillStrokeOrder}=t.attribute,m=this.valid(t,l,a,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),c<=0||g(c)&&c.every((t=>0===t))?Nc(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,s,r=!0){var a;if(e.length<3)return void Nc(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=y/m;const v=Wc(u,d),x=Wc(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=zc(h,b,v,u,d),S=zc(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=Wc(T,w),B=zc(h,Wc(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),P&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,y),t.lineTo(S.x+i,S.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,v,x,y,b,l,s,a,o);const _=()=>{v&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,n,v,x,y,b,l,s,a,o)}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};Yc=Hc([Ei(),$c(0,Li(Zi)),$c(0,Di(El)),Xc("design:paramtypes",[Object])],Yc);var qc=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zc=function(t,e){return function(i,n){e(i,n,t)}};const Jc=["","repeat-x","repeat-y","repeat"];let Qc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Oo,this.builtinContributions=[cc,uc],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Nr(t).image,{repeatX:h=l.repeatX,repeatY:c=l.repeatY,x:u=l.x,y:d=l.y,cornerRadius:p=l.cornerRadius,fillStrokeOrder:f=l.fillStrokeOrder,cornerType:m=l.cornerType,image:y}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===p||g(p)&&p.every((t=>0===t))?e.rect(i,n,T,w):(ic(e,i,n,T,w,p,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(_)if(a)a(e,t.attribute,l);else if(v){e.setCommonStyle(t,t.attribute,i,n,l);let s=0;if("repeat"===h&&(s|=1),"repeat"===c&&(s|=2),s){const t=e.createPattern(S.data,Jc[s]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,T,w),e.translate(-i,-n,!0)}else e.drawImage(S.data,i,n,T,w)}},C=()=>{A&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,_,!1,v,!1,l,s,a),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,_,!1,v,!1,l,s,a),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,i,n,_,!1,v,!1,l,s,a)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const s=t.resources.get(n);if("loading"===s.state&&p(n))return void Xr.improveImageLoading(n);if("success"!==s.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Nr(t).image;this._draw(t,a,!1,i)}};Qc=qc([Ei(),Zc(0,Li(Zi)),Zc(0,Di(Il)),Kc("design:paramtypes",[Object])],Qc);const tu=Symbol.for("ArcRender"),eu=Symbol.for("Arc3dRender"),iu=Symbol.for("GraphicRender"),nu=Symbol.for("LineRender"),su=Symbol.for("PolygonRender"),ru=Symbol.for("RectRender"),au=Symbol.for("Rect3DRender"),ou=Symbol.for("SymbolRender"),lu=Symbol.for("TextRender"),hu=Symbol.for("RichTextRender"),cu=Symbol.for("Pyramid3dRender"),uu=Symbol.for("ImageRender");var du=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let pu,gu=class extends wc{constructor(){super(...arguments),this.numberType=Ro}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Nr(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=Ml(d,p,c),b=Cl(d,g),v=Tl(c),x=wl(u,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:_}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,_,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};gu=du([Ei()],gu);class fu{static registerPlugin(t,e){fu._pluginClasses[t]=e}static getPlugin(t){return fu._pluginClasses[t]}}fu._pluginClasses={};class mu{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=sl.Get(e,nl.Color1),this.ambient=i;const n=pt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/n,t[1]/n,t[2]/n]}computeColor(t,e){const i=this.formatedDir,n=ut(ct((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=p(e)?sl.Get(e,nl.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*s[0]*n}, ${r[1]*s[1]*n}, ${r[2]*s[2]*n})`}}const yu=()=>{fu.registerPlugin("DirectionalLight",mu)};class bu{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,n){let s,r,a,o,l,h,c,u,d,p;const g=e[0],f=e[1],m=e[2],y=n[0],b=n[1],v=n[2],x=i[0],_=i[1],A=i[2];Math.abs(g-x)<it&&Math.abs(f-_)<it&&Math.abs(m-A)<it?Ho(t):(c=g-x,u=f-_,d=m-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,s=b*d-v*u,r=v*c-y*d,a=y*u-b*c,p=Math.hypot(s,r,a),p?(p=1/p,s*=p,r*=p,a*=p):(s=0,r=0,a=0),o=u*a-d*r,l=d*s-c*a,h=c*r-u*s,p=Math.hypot(o,l,h),p?(p=1/p,o*=p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=s,t[1]=o,t[2]=c,t[3]=0,t[4]=r,t[5]=l,t[6]=u,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(s*g+r*f+a*m),t[13]=-(o*g+l*f+h*m),t[14]=-(c*g+u*f+d*m),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,s,r,a){const o=1/(e-i),l=1/(n-s),h=1/(r-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(s+n)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Yo(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:s}=this._params.viewParams;Yo(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const r=this.getProjectionScale(i);return{x:t*r+s[0],y:e*r+s[1]}}}const vu=()=>{fu.registerPlugin("OrthoCamera",bu)};let xu=!1;const _u=new Ti((t=>{xu||(xu=!0,t(_c).toSelf().inSingletonScope(),t(tu).to(_c).inSingletonScope(),t(iu).toService(tu),t(Ll).toService(Yh),Qi(t,Ll))}));let Au=!1;const Su=new Ti((t=>{Au||(Au=!0,t(kc).toSelf().inSingletonScope(),t(ru).to(kc).inSingletonScope(),t(iu).toService(ru),t(ac).toSelf(),t(rc).toSelf(),t(Dl).toService(ac),t(Dl).toService(rc),t(Dl).toService(Yh),Qi(t,Dl))}));let Tu=!1;const wu=new Ti((t=>{Tu||(Tu=!0,t(wc).toSelf().inSingletonScope(),t(gu).toSelf().inSingletonScope(),t(nu).to(wc).inSingletonScope(),t(iu).toService(nu))}));let Mu=!1;const Bu=new Ti((t=>{Mu||(Mu=!0,t(Lc).toSelf().inSingletonScope(),t(ou).to(Lc).inSingletonScope(),t(iu).toService(ou),t(Fl).toService(Yh),Qi(t,Fl))}));let Cu=!1;const ku=new Ti((t=>{Cu||(Cu=!0,t(lu).to(Uc).inSingletonScope(),t(iu).toService(lu),t(jl).toService(Yh),Qi(t,jl))}));let Pu=!1;const Ou=new Ti((t=>{Pu||(Pu=!0,t(su).to(Yc).inSingletonScope(),t(iu).toService(su),t(El).toService(Yh),Qi(t,El))}));var Ru=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Lu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Iu=class extends yc{constructor(){super(),this.numberType=jo,this.builtinContributions=[Ec],this.init()}drawShape(t,e,i,n,s){const r=Nr(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=Ml(o,l,!0),u=Ml(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,r,s),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,r,s))}drawIcon(t,e,i,n,s){var r;const a=Nr(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-o)/2,s=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,n-s,y,b)):(e.beginPath(),ic(e,i-t,n-s,y,b,f,!0)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,o,l))}draw(t,e,i){const n=Nr(t).richtext;this._draw(t,n,!1,i)}};Iu=Ru([Ei(),Lu("design:paramtypes",[])],Iu);let Eu=!1;const Du=new Ti((t=>{Eu||(Eu=!0,t(hu).to(Iu).inSingletonScope(),t(iu).toService(hu))}));let Fu=!1;const ju=new Ti((t=>{Fu||(Fu=!0,t(uu).to(Qc).inSingletonScope(),t(iu).toService(uu),t(Il).toService(Yh),Qi(t,Il))}));class Uu extends yc{stroke(t,e,i,n,s){const r=n.vertices;n.edges.forEach((n=>{const a=r[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};s.beginPath(),s.moveTo(o.x,o.y,o.z),s.lineTo(h.x,h.y,h.z),s.stroke()}))}fill(t,e,i,n,s,r,a,o,l,h,c){const u=sl.Get(r,nl.Color255),d=n.vertices,p=d.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:s,normal:p}=n.polygon,g=d[s[0]],f=d[s[1]],m=d[s[2]],y=d[s[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,u):r,a.fill())}))}}var Nu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Wu=class extends Uu{constructor(){super(...arguments),this.type="rect3d",this.numberType=Fo}drawShape(t,e,i,n,s,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).rect,{fill:c=h.fill,stroke:u=h.stroke,x1:d,y1:p,x:g,y:f,opacity:m=h.opacity,fillOpacity:y=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:_,height:A}=t.attribute;_=(null!=_?_:d-g)||0,A=(null!=A?A:p-f)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=Bl(m,y,_,A,c),w=kl(m,v,_,A),M=Tl(c),B=wl(u,b);if(!t.valid||!x)return;if(!M&&!B)return;if(!(T||w||a||o))return;const{light:C}=s.stage||{},k=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,S,k,null,s,e,C,null,null,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,k,e))}draw(t,e,i){const n=Nr(t).rect;this._draw(t,n,!1,i)}};Wu=Nu([Ei()],Wu);let zu=!1;const Gu=new Ti((t=>{zu||(zu=!0,t(au).to(Wu).inSingletonScope(),t(iu).toService(au))}));var Vu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Hu=class extends yc{constructor(){super(...arguments),this.numberType=Co}drawShape(t,e,i,n,s,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).arc,{fill:c=h.fill}=t.attribute,u=this.valid(t,h,a,o);if(!u)return;const{fVisible:d,sVisible:p,doFill:g,doStroke:f}=u,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=h.outerPadding,innerPadding:b=h.innerPadding,height:v=10}=t.attribute;let{outerRadius:x=h.outerRadius,innerRadius:_=h.innerRadius}=t.attribute;x+=y,_-=b;const A=sl.Get(c,nl.Color255),{light:S}=s.stage||{},T=s.hack_pieFace,w={top:m,bottom:m+v},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===T||"top"===T?(e.beginPath(),function(t,e,i,n,s,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=it)e.moveTo(i,n,s);else if(h>=at-it)e.moveTo(i+r*ht(o),n+r*dt(o),s),e.arc(i,n,r,o,l,!c,s),a>it&&(e.moveTo(i+a*ht(l),n+a*dt(l),s),e.arc(i,n,a,l,o,c,s));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:g,innerEndAngle:f,innerStartAngle:m}=t.getParsePadAngle(o,l),y=r*ht(p),b=r*dt(p),v=a*ht(f),x=a*dt(f);h<.001?u=!0:(e.moveTo(i+y,n+b,s),e.arc(i,n,r,p,g,!c,s)),!(a>it)||d<.001?(e.lineTo(i+v,n+x,s),u=!0):(e.lineTo(i+v,n+x,s),e.arc(i,n,a,f,m,c,s))}e.closePath()}(t,e,i,n,w[T],x,_),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))):"outside"!==T&&"inside"!==T||("inside"===T&&(e.save(),e.beginPath(),e.arc(i,n,_,0,at,!0,w.top),e.clip()),e.beginPath(),function(t,e,i,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=ot(h-l),u=h>l;let d=!1;if(a<=it)e.moveTo(i,n,s);else if(c>=at-it)e.moveTo(i+a*ht(l),n+a*dt(l),s),e.arc(i,n,a,l,h,!u,s),e.lineTo(i+a*ht(h),n+a*dt(h),r),e.arc(i,n,a,h,l,u,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(l,h),g=a*ht(c),f=a*dt(c),m=a*ht(p),y=a*dt(p);t<.001?d=!0:(e.moveTo(i+g,n+f,s),e.arc(i,n,a,c,p,!u,s),e.lineTo(i+m,n+y,r),e.arc(i,n,a,p,c,u,r))}e.closePath()}(t,e,i,n,w.top,w.bottom,"outside"===T?x:_,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:s,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===T?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:s,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),"inside"===T&&e.restore())}draw(t,e,i,n){const s=Nr(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n)}};Hu=Vu([Ei()],Hu);let Xu=!1;const $u=new Ti((t=>{Xu||(Xu=!0,t(eu).to(Hu).inSingletonScope(),t(iu).toService(eu))}));var Yu=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let qu=class extends Uu{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Eo}drawShape(t,e,i,n,s,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=s.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,p,f,d,s,e,g,t,h,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,f,e))}draw(t,e,i){const n=Nr(t).polygon;this._draw(t,n,!1,i)}};qu=Yu([Ei()],qu);let Ku=!1;const Zu=new Ti((t=>{Ku||(Ku=!0,t(cu).to(qu).inSingletonScope(),t(iu).toService(cu))}));class Ju{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Si.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const s=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=s/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Qu=t=>t.zField||t.series&&t.series.some((t=>t.zField));class td extends e.BasePlugin{constructor(){super(td.type),this.type="VChart3dPlugin"}onInit(t,e){var i,n;if(this._is3d=!!(n=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(n.type)||Qu(n),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&Qu(e)&&(e.layout={type:"layout3d"})}}td.pluginType="chart",td.type="VChart3dPlugin";const ed=()=>{e.registerChartPlugin(td),yu(),vu(),fu.registerPlugin("ViewTransform3dPlugin",Ju)},id={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class nd extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const sd=Symbol.for("MathPickerContribution"),rd=Symbol.for("MathArcPicker"),ad=Symbol.for("MathImagePicker"),od=Symbol.for("MathLinePicker"),ld=Symbol.for("MathRectPicker"),hd=Symbol.for("MathSymbolPicker"),cd=Symbol.for("MathTextPicker"),ud=Symbol.for("MathPolygonPicker"),dd=Symbol.for("CanvasArcPicker"),pd=Symbol.for("CanvasArc3dPicker"),gd=Symbol.for("CanvasImagePicker"),fd=Symbol.for("CanvasLinePicker"),md=Symbol.for("CanvasRectPicker"),yd=Symbol.for("CanvasRect3dPicker"),bd=Symbol.for("CanvasSymbolPicker"),vd=Symbol.for("CanvasTextPicker"),xd=Symbol.for("CanvasPolygonPicker"),_d=Symbol.for("CanvasPyramid3dPicker"),Ad=Symbol.for("CanvasRichTextPicker"),Sd=Symbol.for("CanvasPickerContribution");class Td{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n,s)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=s||l,o)),((t,i,s,r)=>{if(o||l)return!0;const a=i.lineWidth||s.lineWidth,h=i.pickStrokeBuffer||s.pickStrokeBuffer,c=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=c?a+h:Vs(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var wd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Md=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bd=function(t,e){return function(i,n){e(i,n,t)}};let Cd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};Cd=wd([Ei(),Bd(0,Li(tu)),Md("design:paramtypes",[Object])],Cd);let kd=!1;const Pd=new Ti(((t,e,i,n)=>{kd||(kd=!0,t(rd).to(Cd).inSingletonScope(),t(sd).toService(rd))}));var Od=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Rd=class{constructor(){this.type="image",this.numberType=Oo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};Rd=Od([Ei()],Rd);let Ld=!1;const Id=new Ti(((t,e,i,n)=>{Ld||(Ld=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var Ed=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Dd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fd=function(t,e){return function(i,n){e(i,n,t)}};let jd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};jd=Ed([Ei(),Fd(0,Li(nu)),Dd("design:paramtypes",[Object])],jd);let Ud=!1;const Nd=new Ti(((t,e,i,n)=>{Ud||(Ud=!0,t(od).to(jd).inSingletonScope(),t(sd).toService(od))}));var Wd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gd=function(t,e){return function(i,n){e(i,n,t)}};let Vd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Io}};Vd=Wd([Ei(),Gd(0,Li(su)),zd("design:paramtypes",[Object])],Vd);let Hd=!1;const Xd=new Ti(((t,e,i,n)=>{Hd||(Hd=!0,t(ud).to(Vd).inSingletonScope(),t(sd).toService(ud))})),$d=new Xt;class Yd{constructor(){this.type="rect",this.numberType=Do}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme(),{cornerRadius:r=s.cornerRadius}=t.attribute;let{x:a=s.x,y:o=s.y}=t.attribute;n.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,l=!1,n.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||y(r,!0)&&0!==r||g(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,s)=>{if(h)return!0;const r=i.lineWidth||s.lineWidth,a=i.pickStrokeBuffer||s.pickStrokeBuffer,o=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=o?r+a:Vs(n,r+a,n.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=s.fill,stroke:n=s.stroke,lineWidth:r=s.lineWidth}=t.attribute;if(i)h=!0;else if(n){const i=t.AABBBounds;$d.setValue(i.x1,i.y1,i.x2,i.y2),$d.expand(-r/2),h=!$d.containsPoint(e)}}return n.highPerformanceRestore(),h}}var qd=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zd=function(t,e){return function(i,n){e(i,n,t)}};let Jd=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Jd=qd([Ei(),Zd(0,Li(ru)),Kd("design:paramtypes",[Object])],Jd);let Qd=!1;const tp=new Ti(((t,e,i,n)=>{Qd||(Qd=!0,t(ld).to(Jd).inSingletonScope(),t(sd).toService(ld))}));let ep=!1;const ip=new Ti(((t,e,i,n)=>{ep||(ep=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var np=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rp=function(t,e){return function(i,n){e(i,n,t)}};let ap=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}};ap=np([Ei(),rp(0,Li(ou)),sp("design:paramtypes",[Object])],ap);let op=!1;const lp=new Ti(((t,e,i,n)=>{op||(op=!0,t(hd).to(ap).inSingletonScope(),t(sd).toService(hd))}));var hp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let cp=class{constructor(){this.type="text",this.numberType=No}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};cp=hp([Ei()],cp);let up=!1;const dp=new Ti(((t,e,i,n)=>{up||(up=!0,t(cd).to(cp).inSingletonScope(),t(sd).toService(cd))}));var pp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},gp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fp=function(t,e){return function(i,n){e(i,n,t)}};let mp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};mp=pp([Ei(),fp(0,Li(tu)),gp("design:paramtypes",[Object])],mp);let yp=!1;const bp=new Ti(((t,e,i,n)=>{yp||(yp=!0,t(dd).to(mp).inSingletonScope(),t(Sd).toService(dd))}));var vp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_p=function(t,e){return function(i,n){e(i,n,t)}};let Ap=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Ap=vp([Ei(),_p(0,Li(ru)),xp("design:paramtypes",[Object])],Ap);let Sp=!1;const Tp=new Ti(((t,e,i,n)=>{Sp||(Sp=!0,t(md).to(Ap).inSingletonScope(),t(Sd).toService(md))}));class wp extends yc{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Vs(n,s+r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&Zo.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Mp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cp=function(t,e){return function(i,n){e(i,n,t)}};let kp=class extends wp{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};kp=Mp([Ei(),Cp(0,Li(nu)),Bp("design:paramtypes",[Object])],kp);let Pp=!1;const Op=new Ti(((t,e,i,n)=>{Pp||(Pp=!0,t(fd).to(kp).inSingletonScope(),t(Sd).toService(fd))}));class Rp extends yc{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&Zo.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Lp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ip=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ep=function(t,e){return function(i,n){e(i,n,t)}};let Dp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:Vs(n,s+r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Zo.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};Dp=Lp([Ei(),Ep(0,Li(ou)),Ip("design:paramtypes",[Object])],Dp);let Fp=!1;const jp=new Ti(((t,e,i,n)=>{Fp||(Fp=!0,t(bd).to(Dp).inSingletonScope(),t(Sd).toService(bd))}));var Up=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wp=function(t,e){return function(i,n){e(i,n,t)}};let zp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=No}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.AABBBounds;if(!n.camera)return!!s.containsPoint(e);n.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,n,o),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(g)return!0;const{fontSize:s=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),f=l.width(),m=Wl(a,d,s),y=Nl(o,f);return e.rect(y+h,m+c,f,d,u),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Zo.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),g}};zp=Up([Ei(),Wp(0,Li(lu)),Np("design:paramtypes",[Object])],zp);let Gp=!1;const Vp=new Ti(((t,e,i,n)=>{Gp||(Gp=!0,t(vd).to(zp).inSingletonScope(),t(Sd).toService(vd))}));var Hp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=function(t,e){return function(i,n){e(i,n,t)}};let Yp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Io}};Yp=Hp([Ei(),$p(0,Li(su)),Xp("design:paramtypes",[Object])],Yp);let qp=!1;const Kp=new Ti(((t,e,i,n)=>{qp||(qp=!0,t(xd).to(Yp).inSingletonScope(),t(Sd).toService(xd))}));var Zp=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qp=function(t,e){return function(i,n){e(i,n,t)}};let tg=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=jo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};tg=Zp([Ei(),Qp(0,Li(hu)),Jp("design:paramtypes",[Object])],tg);let eg=!1;const ig=new Ti(((t,e,i,n)=>{eg||(eg=!0,t(Ad).to(tg).inSingletonScope(),t(Sd).toService(Ad))}));var ng=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},sg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rg=function(t,e){return function(i,n){e(i,n,t)}};let ag=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Oo}};ag=ng([Ei(),rg(0,Li(uu)),sg("design:paramtypes",[Object])],ag);let og=!1;const lg=new Ti(((t,e,i,n)=>{og||(og=!0,t(gd).to(ag).inSingletonScope(),t(Sd).toService(gd))}));var hg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},cg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ug=function(t,e){return function(i,n){e(i,n,t)}};let dg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Fo,this.themeType="rect"}};dg=hg([Ei(),ug(0,Li(au)),cg("design:paramtypes",[Object])],dg);let pg=!1;const gg=new Ti(((t,e,i,n)=>{pg||(pg=!0,t(yd).to(dg).inSingletonScope(),t(Sd).toService(yd))}));var fg=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},mg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yg=function(t,e){return function(i,n){e(i,n,t)}};let bg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Co,this.themeType="arc"}};bg=fg([Ei(),yg(0,Li(eu)),mg("design:paramtypes",[Object])],bg);let vg=!1;const xg=new Ti(((t,e,i,n)=>{vg||(vg=!0,t(pd).to(bg).inSingletonScope(),t(Sd).toService(pd))}));var _g=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ag=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sg=function(t,e){return function(i,n){e(i,n,t)}};let Tg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Eo,this.themeType="polygon"}};Tg=_g([Ei(),Sg(0,Li(cu)),Ag("design:paramtypes",[Object])],Tg);let wg=!1;const Mg=new Ti(((t,e,i,n)=>{wg||(wg=!0,t(_d).to(Tg).inSingletonScope(),t(Sd).toService(_d))})),Bg=function(){!function(){if(null==pu)try{const t=document.createElement("canvas"),e=t.getContext("2d");pu=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),pu&&(pu=!!document.createElement)}catch(t){pu=!1}}();const t=sn.global&&sn.global.env;return t?"browser"===t:pu}();function Cg(){Cg.__loaded||(Cg.__loaded=!0,Nh.RegisterGraphicCreator("arc",Ph),ir.load(_u),ir.load(Bg?bp:Pd))}Cg.__loaded=!1;const kg=Cg;function Pg(){Pg.__loaded||(Pg.__loaded=!0,Nh.RegisterGraphicCreator("arc3d",Rh),yu(),vu(),ir.load($u),ir.load(xg))}Pg.__loaded=!1;const Og=Pg;function Rg(){Rg.__loaded||(Rg.__loaded=!0,Nh.RegisterGraphicCreator("group",Sl))}Rg.__loaded=!1;const Lg=Rg;function Ig(){Ig.__loaded||(Ig.__loaded=!0,Nh.RegisterGraphicCreator("image",fh),ir.load(ju),ir.load(Bg?lg:Id))}Ig.__loaded=!1;const Eg=Ig;function Dg(){Dg.__loaded||(Dg.__loaded=!0,Nh.RegisterGraphicCreator("line",nh),ir.load(wu),ir.load(Bg?Op:Nd))}Dg.__loaded=!1;const Fg=Dg;function jg(){jg.__loaded||(jg.__loaded=!0,Nh.RegisterGraphicCreator("polygon",Eh),ir.load(Ou),ir.load(Bg?Kp:Xd))}jg.__loaded=!1;const Ug=jg;function Ng(){Ng.__loaded||(Ng.__loaded=!0,Nh.RegisterGraphicCreator("pyramid3d",Fh),yu(),vu(),ir.load(Zu),ir.load(Mg))}Ng.__loaded=!1;const Wg=Ng;function zg(){zg.__loaded||(zg.__loaded=!0,Nh.RegisterGraphicCreator("rect",ah),ir.load(Su),ir.load(Bg?Tp:tp))}zg.__loaded=!1;const Gg=zg;function Vg(){Vg.__loaded||(Vg.__loaded=!0,Nh.RegisterGraphicCreator("rect3d",hh),ir.load(Gu),ir.load(gg))}Vg.__loaded=!1;const Hg=Vg;function Xg(){Xg.__loaded||(Xg.__loaded=!0,Nh.RegisterGraphicCreator("richtext",Ah),ir.load(Du),ir.load(Bg?ig:ip))}Xg.__loaded=!1;const $g=Xg;function Yg(){Yg.__loaded||(Yg.__loaded=!0,Nh.RegisterGraphicCreator("shadowRoot",Uh))}Yg.__loaded=!1;const qg=Yg;function Kg(){Kg.__loaded||(Kg.__loaded=!0,Nh.RegisterGraphicCreator("symbol",th),ir.load(Bu),ir.load(Bg?jp:lp))}Kg.__loaded=!1;const Zg=Kg;function Jg(){Jg.__loaded||(Jg.__loaded=!0,Nh.RegisterGraphicCreator("text",Zl),ir.load(ku),ir.load(Bg?Vp:dp))}Jg.__loaded=!1;const Qg=Jg;class tf extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=tf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}tf.type="rect3d";const ef=()=>{e.Factory.registerMark(tf.type,tf),qg(),Hg(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",hh)};class nf extends e.BarSeries{constructor(){super(...arguments),this.type=xi.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=nd}}nf.type=xi.bar3d,nf.mark=id,nf.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},nf.transformerConstructor=nd;const sf=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(nf.type,nf)};class rf extends e.Layout{layoutItems(t,i,n,s){this._layoutInit(t,i,n,s);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((t=>"absolute"===t.layoutType)),l=o.filter((t=>"z"===t.layoutOrient));let h={width:0,height:0};if(l.length){h=l[0].getLayoutRect()}this.leftCurrent+=h.width/8,this.rightCurrent-=h.width/8,this.topCurrent+=h.height/8,this.bottomCurrent-=h.height/8;const{regionItems:c,relativeItems:u,relativeOverlapItems:d,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,u,d,g,r),this._processAutoIndent(c,u,d,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=u.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=u.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(m&&l.length){const t=m.getLayoutStartPoint(),e=m.getLayoutRect(),i={x:"left"===y.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===y.layoutOrient?"r2l":"l2r";const n=m.getLayoutRect(),s=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:n.width,height:s.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();s?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-n)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}rf.type="layout3d";const af=()=>{e.Factory.registerLayout(rf.type,rf)};class of extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=yi,this.type="bar3d",this.seriesType=xi.bar3d}}of.type="bar3d",of.seriesType=xi.bar3d,of.transformerConstructor=yi;const lf=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class hf extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class cf extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=cf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}cf.type="pyramid3d";const uf=e.getFunnelTheme(!0);class df extends e.FunnelSeries{constructor(){super(...arguments),this.type=xi.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=hf}initMark(){var t,e,i,n,s,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},df.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},df.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){const{line:t}=null!==(s=this._spec.outerLabel)&&void 0!==s?s:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(df.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(df.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,n;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(n=this._funnelOuterLabelMark)||void 0===n||n.line}}df.type=xi.funnel3d,df.mark=lf,df.builtInTheme={funnel3d:uf},df.transformerConstructor=hf;const pf=()=>{e.Factory.registerMark(cf.type,cf),qg(),Wg(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",Fh),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(df.type,df)};class gf extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=xi.funnel3d}}gf.type="funnel3d",gf.seriesType=xi.funnel3d,gf.transformerConstructor=e.FunnelChartSpecTransformer;class ff extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=xi.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ff.type="histogram3d",ff.seriesType=xi.bar3d,ff.transformerConstructor=e.HistogramChartSpecTransformer;class mf extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class yf extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=yf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}yf.type="arc3d";const bf=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class vf extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class xf extends e.BasePieSeries{constructor(){super(...arguments),this.type=xi.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=vf}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}xf.type=xi.pie3d,xf.mark=bf,xf.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},xf.transformerConstructor=vf;const _f=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),qg(),Og(),e.Factory.registerGraphicComponent("arc3d",Rh),e.Factory.registerMark("arc3d",yf),e.Factory.registerSeries(xf.type,xf)};class Af extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=mf,this.type="pie3d",this.seriesType=xi.pie3d}}Af.type="pie3d",Af.seriesType=xi.pie3d,Af.transformerConstructor=mf;class Sf{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-Sf.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Sf.bounceIn(2*t):.5*Sf.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/at*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*at/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/at*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*at/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/at*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*at/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*at/e)*.5+1}}static registerFunc(t,e){Sf[t]=e}}function Tf(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}Sf.quadIn=Sf.getPowIn(2),Sf.quadOut=Sf.getPowOut(2),Sf.quadInOut=Sf.getPowInOut(2),Sf.cubicIn=Sf.getPowIn(3),Sf.cubicOut=Sf.getPowOut(3),Sf.cubicInOut=Sf.getPowInOut(3),Sf.quartIn=Sf.getPowIn(4),Sf.quartOut=Sf.getPowOut(4),Sf.quartInOut=Sf.getPowInOut(4),Sf.quintIn=Sf.getPowIn(5),Sf.quintOut=Sf.getPowOut(5),Sf.quintInOut=Sf.getPowInOut(5),Sf.backIn=Sf.getBackIn(1.7),Sf.backOut=Sf.getBackOut(1.7),Sf.backInOut=Sf.getBackInOut(1.7),Sf.elasticIn=Sf.getElasticIn(1,.3),Sf.elasticOut=Sf.getElasticOut(1,.3),Sf.elasticInOut=Sf.getElasticInOut(1,.3*1.5),Sf.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Sf.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Sf.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Sf[`flicker${t}`]=e=>Tf(e,t);for(let t=2;t<10;t++)Sf[`aIn${t}`]=e=>t*e*e+(1-t)*e;function wf(t,e,i){return t+(e-t)*i}const Mf=new class{constructor(){this.opacity=(t,e,i,n,s,r)=>{r.attribute.opacity=wf(e,i,n)},this.baseOpacity=(t,e,i,n,s,r)=>{r.attribute.baseOpacity=wf(e,i,n)},this.fillOpacity=(t,e,i,n,s,r)=>{r.attribute.fillOpacity=wf(e,i,n)},this.strokeOpacity=(t,e,i,n,s,r)=>{r.attribute.strokeOpacity=wf(e,i,n)},this.zIndex=(t,e,i,n,s,r)=>{r.attribute.zIndex=wf(e,i,n)},this.backgroundOpacity=(t,e,i,n,s,r)=>{r.attribute.backgroundOpacity=wf(e,i,n)},this.shadowOffsetX=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetX=wf(e,i,n)},this.shadowOffsetY=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetY=wf(e,i,n)},this.shadowBlur=(t,e,i,n,s,r)=>{r.attribute.shadowBlur=wf(e,i,n)},this.fill=(t,e,i,n,s,r)=>{r.attribute.fill=al(e,i,n,!1)},this.fillPure=(t,e,i,n,s,r)=>{r.attribute.fill=s.fromParsedProps.fill?ll(s.fromParsedProps.fill,s.toParsedProps.fill,n):s.toParsedProps.fill},this.stroke=(t,e,i,n,s,r)=>{r.attribute.stroke=al(e,i,n,!1)},this.strokePure=(t,e,i,n,s,r)=>{r.attribute.stroke=s.fromParsedProps.stroke?ll(s.fromParsedProps.stroke,s.toParsedProps.stroke,n):s.toParsedProps.stroke},this.width=(t,e,i,n,s,r)=>{r.attribute.width=wf(e,i,n),r.addUpdateBoundTag()},this.height=(t,e,i,n,s,r)=>{r.attribute.height=wf(e,i,n),r.addUpdateBoundTag()},this.x=(t,e,i,n,s,r)=>{r.attribute.x=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,n,s,r)=>{r.attribute.y=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dx=(t,e,i,n,s,r)=>{r.attribute.dx=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dy=(t,e,i,n,s,r)=>{r.attribute.dy=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,n,s,r)=>{r.attribute.angle=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,n,s,r)=>{r.attribute.scaleX=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,n,s,r)=>{r.attribute.scaleY=wf(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,n,s,r)=>{r.attribute.lineWidth=wf(e,i,n),r.addUpdateBoundTag()},this.startAngle=(t,e,i,n,s,r)=>{r.attribute.startAngle=wf(e,i,n),r.addUpdateBoundTag()},this.endAngle=(t,e,i,n,s,r)=>{r.attribute.endAngle=wf(e,i,n),r.addUpdateBoundTag()},this.radius=(t,e,i,n,s,r)=>{r.attribute.radius=wf(e,i,n),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,n,s,r)=>{r.attribute.outerRadius=wf(e,i,n),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,n,s,r)=>{r.attribute.innerRadius=wf(e,i,n),r.addUpdateBoundTag()},this.size=(t,e,i,n,s,r)=>{r.attribute.size=wf(e,i,n),r.addUpdateBoundTag()},this.points=(t,e,i,n,s,r)=>{r.attribute.points=ia(e,i,n),r.addUpdateBoundTag()}}};function Bf(t,e,i,n,s,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*n,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const s=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*n;if(!Number.isFinite(o)){a=!1;break}s.push(o)}return a&&(r.attribute[t]=s),!0}return!1}function Cf(){}class kf{constructor(t,e,i,n){var s;this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=n?"function"==typeof n?n:null!==(s=Sf[n])&&void 0!==s?s:Sf.linear:Sf.linear,"wait"===t&&(this.onUpdate=Cf),this.id=Si.GenAutoIncrementId(),this.syncAttributeUpdate=Cf}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t,e=!0){this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const i=this.fromProps[e],n=this.props[e];if(p(i)&&p(n)){const s=sl.Get(i,nl.Color255),r=sl.Get(n,nl.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=s,this.toParsedProps[e]=r,t.push(Mf["fill"===e?"fillPure":"strokePure"])}else Mf[e]?t.push(Mf[e]):t.push(Bf)}else Mf[e]?t.push(Mf[e]):t.push(Bf)})),this.interpolateUpdateFunctions=t}setStartTime(t,e=!0){this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,n,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],n,this,this.target)})),this.onUpdate(t,n,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}}class Pf extends kf{constructor(t,e,i,n){super(t,e,i,n)}onStart(){super.onStart()}onFirstRun(){const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class Of extends s{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this._animationEndFlag=!0,this.id=Si.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const n=e.next;t(e.animate,i),i++,e=n}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;this._animationEndFlag&&(this._animationEndFlag=!1,this.emit("animationStart"));const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===hn.END?this.removeAnimate(t,!0):t.status!==hn.RUNNING&&t.status!==hn.INITIAL||t.advance(e)})),0===this._animateCount&&(this._animationEndFlag=!0,this.emit("animationEnd"))}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t,e=!0){const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const Rf=new Of;Rf.isGlobal=!0;class Lf{constructor(t=Si.GenAutoIncrementId(),e=Rf,i){this.id=t,this.status=hn.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.animates||(this.target.animates=new Map),this.target.animates.set(this.id,this),this.onRemove((()=>{this.stop(),this.target.animates.delete(this.id)})),this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t,e=300,i="linear"){const n=new kf(ln.to,t,e,i);return n.bind(this.target,this),this.updateStepAfterAppend(n),this}wait(t){const e=new Pf(ln.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t,e=300,i="linear"){const n=new kf(ln.from,t,e,i);return this._firstStep?(this._lastStep.append(n),this._lastStep=n):(this._firstStep=n,this._lastStep=n),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===hn.RUNNING&&(this.status=hn.PAUSED)}resume(){this.status===hn.PAUSED&&(this.status=hn.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,n,s,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==hn.END&&this.onEnd(),this.status=hn.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=hn.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[]}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,n;if(this.status===hn.END)return void console.warn("aaa 动画已经结束,不能推进");const s=this.currentTime+t;if(s<this._startTime)return void(this.currentTime=s);if(s>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=hn.END);this.status=hn.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=s;let r=s-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(s-this._startTime)%this._duration;const t=Math.floor((s-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(n=this.lastRunStep)||void 0===n||n.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}}const If=new class{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach((e=>e(t)))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=sn.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++rn,t),this.tryRunAnimationFrameNextFrame(),rn}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}};class Ef{constructor(){this.released=!1}tick(t,e){If.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Df extends s{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const n=t.getTime();this._lastTickTime=n,this.lastFrameTime<0&&(this.lastFrameTime=n-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const s=n-this.lastFrameTime,r=this.checkSkip(s);return r||(this._handlerTick(s),this.lastFrameTime=n,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===on.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=on.INITIAL,sn.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler(!1)})),sn.global.env&&this.initHandler(!1)}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(t=!1){this.setupTickHandler(t)}setupTickHandler(t=!1){if(!t&&this.tickerHandler)return!0;const e=new Ef;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=e,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(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!==on.INITIAL&&(this.status=on.PAUSE,!0)}resume(){return this.status!==on.INITIAL&&(this.status=on.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(t=!1){if(this.status===on.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===on.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=on.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=on.INITIAL,this.setupTickHandler(!0),this.lastFrameTime=-1}trySyncTickStatus(){this.status===on.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===on.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){var e,i,n;return"performance"!==(null===(n=null===(i=null===(e=this.stage)||void 0===e?void 0:e.params)||void 0===i?void 0:i.optimize)||void 0===n?void 0:n.tickRenderMode)&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Ff{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Ff.instance||(Ff.instance=new Ff),Ff.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var n,s,r,a;let o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get(e);return o?o(i,t):(o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let n=this.transitions.get(t);n||(n=new Map,this.transitions.set(t,n)),n.set(e,i)}}Ff.getInstance();class jf{static registerBuiltInAnimate(t,e){jf.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,i){var n,s;const r=this.resolveValue(t.totalTime,void 0,void 0),a=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=a,l.totalTime=r;const h=this.resolveValue(t.oneByOne,i,!1);if(e){const t=l.timeSlices;g(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const n=this.resolveValue(t.delay,i,0),s=this.resolveValue(t.delayAfter,i,0),r=this.resolveValue(t.duration,i,300);return e+=n+r+s,Object.assign(Object.assign({},t),{delay:n,delayAfter:s,duration:r})}));let n=0;h&&(n="number"==typeof h?h:h?e:0),l.oneByOneDelay=n;let s=1;if(r){const t=e+n*(this._target.count-2);s=r?r/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*s,delayAfter:t.delayAfter*s,duration:t.duration*s,effects:e.map((t=>{var e,i;const n=null!==(e=t.custom)&&void 0!==e?e:jf.builtInAnimateMap[null!==(i=t.type)&&void 0!==i?i:"fromTo"],s=n&&o(n)?/^class\s/.test(Function.prototype.toString.call(n))?1:2:0;return Object.assign(Object.assign({},t),{custom:n,customType:s})}))})})),l.oneByOneDelay=n*s,l.startTime=a*s}else{const e=this.resolveValue(t.delay,i,0),c=this.resolveValue(t.delayAfter,i,0),u=this.resolveValue(t.duration,i,300);let d=0;h&&(d="number"==typeof h?h:h?e+c+u:0),l.oneByOneDelay=d,l.custom=null!==(n=t.custom)&&void 0!==n?n:jf.builtInAnimateMap[null!==(s=t.type)&&void 0!==s?s:"fromTo"];const p=l.custom&&o(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,r){const t=e+c+u+d*(this._target.count-2),i=r?r/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=u*i,l.oneByOneDelay=d*i,l.startTime=a}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,n;return t.partitioner(null===(n=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===n?void 0:n[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var n,s,r,a;return t.sort(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const n=e?(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,n,s);a&&this._trackAnimation(a)}:(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,n,s);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>n(t,e,i.length))):this._target.count<=1?n(this._target,0,1):this._target.forEachChildren(((t,e)=>n(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,i,n){var s,r,a,l,h,c,u,d;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=o(y)?y(null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],e,{}):y,O=null===(l=null===(a=e.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(i=null!==(c=O[R])&&void 0!==c?c:i),k.startAt(x);const L=i*_+P;L>0&&k.wait(L);let I=null,E=t.to,D=t.from;E||(I||(I=this.createPropsFromChannel(g,e)),E=I.props),D||(I||(I=this.createPropsFromChannel(g,e)),D=I.from),this._handleRunAnimate(k,M,B,D,E,v,m,f,C,w,p,e);let F=0;_&&(F=_*(n-i-1));const j=o(b)?b(null===(d=null===(u=e.context)||void 0===u?void 0:u.data)||void 0===d?void 0:d[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,i,n,s,r,a,l,h,c,u,d){var p,g,f,m;if(e&&i){const u=Object.assign({width:d.stage.width,height:d.stage.height,group:this._target.parent},this.resolveValue(l,d)),y=o(c)?c.call(null,null!==(g=u&&(null===(p=u.data)||void 0===p?void 0:p[0]))&&void 0!==g?g:null===(m=null===(f=d.context)||void 0===f?void 0:f.data)||void 0===m?void 0:m[0],d,u):c;u.options=y,u.controlOptions=h,1===i?this.createCustomAnimation(t,e,n,s,r,a,u):2===i&&this.createCustomInterpolatorAnimation(t,e,s,r,a,u)}else"to"===u?t.to(s,r,a):"from"===u&&t.from(s,r,a)}executeTimelineItem(t,e,i,n){var s,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:u,oneByOneDelay:d,priority:p,controlOptions:g}=t,f=null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*d),c&&c>0&&y.loop(c),u&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),d&&y.wait(d*(n-i-1)),y}applyTimeSliceToAnimate(t,e,i,n){var s,r,a,l;const{effects:h,duration:c=300,delay:u=0,delayAfter:d=0}=t,p=o(u)?u(null===(r=null===(s=i.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],i,{}):u,g=o(d)?d(null===(l=null===(a=i.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],i,{}):d;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var s;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let u=null,d=t.to,p=t.from;d||(u||(u=this.createPropsFromChannel(a,i)),d=u.props),p||(u||(u=this.createPropsFromChannel(a,i)),p=u.from);const g=null!==(s=t.custom)&&void 0!==s?s:jf.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,d,c,l,o,n,h,r,i)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,n,s,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,n,s,a,o)=>{e(s,i,n,a,o,t.target,r)},t.to(i,n,s)}createCustomAnimation(t,e,i,n,s,r,a){const o=new e(i,n,s,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let n=null;return t?(Array.isArray(t)?t.forEach((t=>{var n,s;const r=null===(s=null===(n=e.context)||void 0===n?void 0:n.diffAttrs)||void 0===s?void 0:s[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((s=>{var r,a,o,l;const h=t[s];void 0!==h.to&&("function"==typeof h.to?i[s]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[s]=h.to),void 0!==h.from&&(n||(n={}),"function"==typeof h.from?n[s]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):n[s]=h.from)})),{from:n,props:i}):{from:n,props:i}}resolveValue(t,e,i){var n,s;return void 0===t?i:"function"==typeof t&&e?t(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],e,{}):t}executeItem(t,e,i=0,n=1){return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,n))).filter(Boolean):[this._executeItem(t,e,i,n)].filter(Boolean)}_executeItem(t,e,i=0,n=1){if(!e)return null;const s="timeSlices"in t;let r=null;const a=this.parseParams(t,s);return r=s?this.executeTimelineItem(a,e,i,n):this.executeTypeConfigItem(a,e,i,n),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}jf.builtInAnimateMap={};const Uf="appear",Nf="disappear",Wf="update",zf="highlight",Gf="unhighlight";class Vf{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Hf{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,i){const n=Ff.getInstance(),s=[],r=[];if(this.stateList&&this.stateList.length?t.forEach(((t,i)=>{const a={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=n.isTransitionAllowed(e.state,t,this.graphic);a.allowTransition=a.allowTransition&&i.allowTransition})),a.allowTransition&&(r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)}),this.stateList.forEach((e=>{n.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&s.push(e)})))})):t.forEach(((t,i)=>{r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)})})),s.forEach((t=>{t.executor.stop()})),r.length){r[0].executor.execute(r[0].animationConfig);for(let t=0;t<r.length;t++){const e=r[t+1],n=r[t];n.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==n)),t===r.length-1&&i&&i(!1)}))}}else i&&i(!0);this.stateList?this.stateList=this.stateList.filter((t=>!s.includes(t))):this.stateList=[],this.stateList.push(...r)}applyAppearState(t,e){this.applyState([Uf],[{name:Uf,animation:t}],e)}applyDisappearState(t,e){this.applyState([Nf],[{name:Nf,animation:t}],e)}applyUpdateState(t,e){this.applyState([Wf],[{name:Wf,animation:t}],e)}applyHighlightState(t,e){this.applyState([zf],[{name:zf,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([Gf],[{name:Gf,animation:t}],e)}stopState(t,e){var i;const n=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));n&&n.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}reApplyState(t){var e;const i=null===(e=this.stateList)||void 0===e?void 0:e.find((e=>e.state===t));i&&(i.executor.stop(),i.executor.execute(i.animationConfig))}}class Xf{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Hf(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Vf(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e,i=!1){return this._getAnimationStateManager(this).stopState(t,e),i&&this.isContainer&&this.forEachChildren((n=>{n.stopAnimationState(t,e,i)})),this}clearAnimationStates(){return this._getAnimationStateManager(this).clearState(),this}reApplyAnimationState(t,e=!1){return this._getAnimationStateManager(this).reApplyState(t),e&&this.isContainer&&this.forEachChildren((i=>{i.reApplyAnimationState(t,e)})),this}static extend(t){return(new Xf)._getAnimationStateManager(t),t}}class $f{getAttributes(t=!1){return t&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,n;const s=new Lf(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:Rf,null==t?void 0:t.slience);if(s.bind(this),t){const{onStart:e,onEnd:i,onRemove:n}=t;null!=e&&s.onStart(e),null!=i&&s.onEnd(i),null!=n&&s.onRemove(n)}return null===(n=this.stage)||void 0===n||n.ticker.start(),s}createTimeline(){return new Of}createTicker(t){return new Df(t)}setFinalAttributes(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttributes(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new jf(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t,e=!1){return!e&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}pauseAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.pause())),t&&this.isContainer&&this.forEachChildren((e=>{e.pauseAnimation(t)}))}resumeAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.resume())),t&&this.isContainer&&this.forEachChildren((e=>{e.resumeAnimation(t)}))}stopAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.stop())),t&&this.isContainer&&this.forEachChildren((e=>{e.stopAnimation(t)}))}}function Yf(){F(xl,Xf),F(xl,$f)}class qf extends kf{constructor(t,e,i,n,s){super("customAnimate",e,i,n),this.type="customAnimate",this.customFrom=t,this.params=s,this.from=t,this.to=e}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.onUpdate(t,n,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class Kf extends qf{onBind(){super.onBind(),this.propKeys=["x","y","z","alpha","zIndex"]}onFirstRun(){super.onFirstRun();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t)}onStart(){super.onStart();const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.finalAttribute.x,n=this.target.finalAttribute.y,s=this.target.finalAttribute.z,r=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));s-t.z<0&&(a=at-a),this.theta=a,this.phi=r}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const n=this.target,{center:s,r:r,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,c=r*Math.sin(h)*Math.cos(l)+s.x,u=r*Math.cos(h)+s.y,d=r*Math.sin(h)*Math.sin(l)+s.z;for(n.attribute.x=c,n.attribute.y=u,n.attribute.z=d,n.attribute.alpha=l+nt/2;n.attribute.alpha>at;)n.attribute.alpha-=at;n.attribute.alpha=at-n.attribute.alpha,n.attribute.zIndex=-1e4*n.attribute.z,a&&a(i)}}const Zf=t=>({custom:Kf,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Jf extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=xi.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const n=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-n.left||0-n.right||0,s=e.height-n.top||0-n.bottom||0,r=Math.max(i,s)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Jf.type=xi.wordCloud3d,Jf.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Qf=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({appear:Zf(t)}))),e.Factory.registerSeries(Jf.type,Jf)},tm=()=>{Qf()};class em extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class im extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=em,this.type="wordCloud3d",this.seriesType=xi.wordCloud3d}}im.type="wordCloud3d",im.seriesType=xi.wordCloud3d,im.transformerConstructor=em;const nm=()=>{ed(),Qf(),e.Factory.registerChart(im.type,im)},sm={label:{space:0}};class rm{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,i){const n=e.isZAxis(this._orient),s=e.isXAxis(this._orient),r=e.isYAxis(this._orient);let a=0,o=0;if(!i){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}a=Math.abs(s-i),o=Math.abs(n-e)}let l=0,h=0;const{width:c,height:u}=this.getLayoutRect();let d={x:0,y:0};s?(d={x:c,y:0},l=a,h=c):r&&(d={x:0,y:u},l=o,h=u);const p=this.layout3dBox?this.layout3dBox.length:0;if(!n){const e=this.getLabelItems(h);return t.grid={length:l},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(s),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:d,items:e[0],depth:p,length:l},t}return((t,i)=>{var n;const s=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),u={start:{x:0,y:0},end:h,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()},d=null!==(n=t.directionStr)&&void 0!==n?n:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===d&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),u.z=f,u.alpha=g,u.anchor3d=p,i||(u.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:s.height,alpha:g,z:f,anchor3d:p}),u})(this,i)}}const am=Object.assign(Object.assign({},id),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class om extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=xi.rangeColumn3d,this._barMarkType="rect3d",this._barName=xi.bar3d}}om.type=xi.rangeColumn3d,om.mark=am;const lm=()=>{ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(om.type,om)};class hm extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class cm extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?n.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:n.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],n}}class um extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=cm,this.type="rangeColumn3d",this.seriesType=xi.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}um.type="rangeColumn3d",um.seriesType=xi.rangeColumn3d,um.transformerConstructor=cm;const dm="pictogram",pm="pictogram";var gm;!function(t){t.pictogram="pictogram"}(gm||(gm={}));const fm=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class mm extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===pm}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const ym=new Map;let bm;function vm(t,i){ym.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),bm||(bm=new ze,e.registerDataSetInstanceParser(bm,"svg",Le));const n=new Ge(bm);n.parse(i,{type:"svg"}),ym.set(t,n)}function xm(t){ym.has(t)?ym.delete(t):e.warn(`map type of '${t}' does not exists.`)}function _m(t){return ym.get(t)}class Am extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,i,n;const s=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(n=null===(i=ym.get(r))||void 0===i?void 0:i.latestData)||void 0===n?void 0:n.elements;if(a&&a.length){a.map((t=>t.name)).filter((t=>h(t))).forEach((e=>{t[e]&&(s[e]=t[e])}))}return s}}class Sm extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const Tm="element-highlight-by-graphic-name";class wm extends e.ElementHighlight{constructor(){super(...arguments),this.type=Tm,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(l(t))return;const{interaction:e,highlightState:i,blurState:n}=this.options,s=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,s,i,n),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}wm.type=Tm;const Mm="element-select-by-graphic-name";class Bm extends e.ElementSelect{constructor(){super(...arguments),this.type=Mm}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}Bm.type=Mm;function Cm(t){var e;return h(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const km=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&Cm(i)?1:0},Pm=(t,e)=>{var i;const n=null!==(i=t.fill)&&void 0!==i?i:e;return n&&Cm(n)?n:void 0},Om=(t,e)=>{var i;const n=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!n||!Cm(n))&&n},Rm=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Pm(t),lineWidth:km(t),stroke:Om(t)}),Lm={group:t=>{const e=Rm(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Rm(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},Rm(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},Rm(t)),{path:t.d,fillStrokeOrder:!1,fill:Pm(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Rm(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:Pm(t,"#000")})},text:(t,e)=>{var i,n;return Object.assign(Object.assign({},Rm(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(n=t.textAnchor)&&void 0!==n?n:"middle",anchor:[0,0],fill:Pm(t,"#000")})}},Im=t=>{var i,n;if(!t||!t[0])return{};const{elements:s}=t[0].latestData;if(s&&s.length){s.forEach(((t,i)=>{var n;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:s,transform:r}=t,a={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?O(a,t._inheritStyle,null===(n=t.parent)||void 0===n?void 0:n._textGroupStyle,t.attributes):"group"!==t.graphicType&&O(a,t._inheritStyle,t.attributes),Lm[s]?t._finalAttributes=Lm[s](a,t.value):t._finalAttributes=a,r&&(t._finalAttributes.postMatrix=Object.assign({},r))}));const t=s.filter((t=>"text"===t.tagName));for(let r=0;r<t.length;r++){const a=t[r]._uniqueId,o=s.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const s=null!==(n=null===(i=t[r]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==n?n:0;let a=s;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=s;else if(i.value&&void 0===i.parent._textGroupStyle.x){const n=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(n){a+=e.measureText(n.value,n._finalAttributes).width}i._finalAttributes.x=a}}}}}return s};class Em extends e.GeoSeries{constructor(){super(...arguments),this.type=pm,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=_m(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const i="multiple"===t.mode,n=h(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:n,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var t;if(this._pictogramMark=this._createMark(Em.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Em.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Em.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:n,name:s,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:n,name:null!=s?s:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Em.mark.pictogram.name)});h&&(h.setData(this._mapViewData),h.setUserId(l),this._idToMark.set(l,h),"group"!==h.type&&h.setMarkConfig({graphicName:h.name}),h.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(Em.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t,viewBoxRect:i}=this._parsedSvgResult,n=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,Lm.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[ah(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of n){const{_uniqueId:i,_finalAttributes:n}=t,s=this._idToMark.get(i),r=this._validElement(t);s&&(this.setMarkStyle(s,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),r?(this.initMarkStyleWithSpec(s,O({},this._spec.pictogram,this._spec[s.name])),this.setMarkStyle(s,n,"normal",e.AttributeLevel.Series),s.setPostProcess("fill",((t,e)=>h(t)?t:this._spec.defaultFillColor))):(s.setMarkConfig({interactive:!1}),this.setMarkStyle(s,n,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new Sm(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const n=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!n||0===n.length)return null;let s=new Ht;e?n.forEach((t=>{s=s.union(t.getGraphics()[0].globalAABBBounds)})):n.forEach((t=>{s=s.union(t.getProduct().AABBBounds)}));const r={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,n=this.getRootMatrix();if(!n)return null;const s={};return n.getInverse().transformPoint({x:e,y:i},s),s}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const n=ym.get(this.svg);n||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new Ge(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Im),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),s.parse([n],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,n=e/2,s=this.getPictogramRootGraphic();if(s){const r=s.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=s.AABBBounds,c=(a+o)/2,u=(l+h)/2,d=t/r.width(),p=e/r.height(),g=Math.min(d,p);s.scale(g,g,{x:c,y:u}),s.translate(i-c,n-u)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const n=this.getPictogramRootGraphic();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new Yt}),n.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new Yt}),i.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}Em.type=pm,Em.mark=fm,Em.transformerConstructor=Am;const Dm=()=>{e.Factory.registerSeries(Em.type,Em),e.Factory.registerImplement("registerSVG",vm),e.Factory.registerImplement("unregisterSVG",xm),e.Factory.registerInteractionTrigger(wm.type,wm),e.Factory.registerInteractionTrigger(Bm.type,Bm)};class Fm extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=mm,this.type=dm,this.seriesType=pm}}Fm.type=pm,Fm.seriesType=dm,Fm.transformerConstructor=mm;class jm extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Um="imageCloud",Nm="imageCloud";var Wm;!function(t){t.image="image",t.imageMask="imageMask"}(Wm||(Wm={}));const zm=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),Gm={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Vm,triangle:Vm,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Vm(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const Hm={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,n=0;return t=>{const s=t<0?-1:1;switch(Math.sqrt(1+4*s*t)-s&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}};const Xm=(t,e,i)=>{const{threshold:n,invert:s=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,i)=>{const r=t.width;if(0===t.data[e*r*4+4*i+3])return!s;const a=t.data[e*r*4+4*i+0],o=t.data[e*r*4+4*i+1],l=t.data[e*r*4+4*i+2];if(255===a&&255===o&&255===l)return!s;if(b(n)){const t=.3*a+.59*o+.11*l;return s?t<=n:t>=n}return!1};const r=i({width:1,height:1}).getContext("2d",{willReadFrequently:!0});r.fillStyle=t,r.fillRect(0,0,1,1);const a=r.getImageData(0,0,1,1).data;return(t,e,i)=>{const n=t.width;return[0,1,2,3].every((r=>s?t.data[4*(e*n+i)+r]!==a[r]:t.data[4*(e*n+i)+r]===a[r]))}},$m=(t,e,i,n,s)=>{const{fontFamily:r="sans-serif",fontWeight:a="normal",fontStyle:o="normal",fontVariant:l="normal",text:c,hollow:u}=t;let d=12;s.font=`${o} ${l} ${a} ${d}px ${r}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=e;const p=s.measureText(c),g="normal"!==o?1.1:1,f=h(p.actualBoundingBoxRight)&&h(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,d);if(u&&(s.globalCompositeOperation="xor"),m>i){const t=Math.min(i/m,n/d);s.fillText(c,i/2,n/2),s.scale(t,t)}else d=Math.floor(d*i/m),d=Math.min(d,n),s.font=`${o} ${l} ${a} ${d}px ${r}`,s.fillText(c,Math.floor(i/2),Math.floor(n/2))},Ym=(t,e,i=0,n)=>{const s=2*Math.PI/n;return new Array(n).fill(0).map(((n,r)=>St(t,e,i+r*s)))},qm=(t,e,i=0,n)=>{const s=2*Math.PI/n,r=(t=>Gm[t]?Gm[t]():Gm.circle())("cardioid");return new Array(n).fill(0).map(((n,a)=>{const o=i+a*s,l=e*r(o);return St(t,l,o)}))},Km=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},Zm=(t,e,i,n,s)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],n=e[1];let s=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(n/2.7*.4),s=Math.floor(Math.min(i/2.3,n/2.6));break;case"triangleForward":s=n/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(n/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(n/1.5),s=Math.floor(Math.min(n/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":s=Math.floor(Math.min(i/2,n/2));break;default:s=Math.floor(Math.max(i/2,n/2))}return{maxRadius:s,center:r}}(t.shape,[i,n]);s.fillStyle=e,r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,n)=>{0===n?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,qm({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)Km(s,Ym({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)Km(s,Ym({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)Km(s,Ym({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)Km(s,Ym({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)Km(s,Ym({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Ym({x:l,y:h},o,-Math.PI/2,5),e=Ym({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let n=0;n<5;n++)i.push(t[n]),i.push(e[n]);Km(s,i)}else s.fillRect(0,0,i,n)};function Jm(t){const{size:e,maskCanvas:i}=t,n=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),s=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===s[i*e[0]+l]&&!t.isEmptyPixel(n,i,l)){s[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==s[h*e[0]+c]||t.isEmptyPixel(n,h,c)||(s[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},u={},d={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const n=s[t*e[0]+i];0!==n&&(T(t,i)&&(f.push([t,i]),l[n]=l[n]||[],l[n].push([i,t]),u[n]||(u[n]=[1/0,-1/0,1/0,-1/0]),t<u[n][0]&&(u[n][0]=t),t>u[n][1]&&(u[n][1]=t),i<u[n][2]&&(u[n][2]=i),i>u[n][3]&&(u[n][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[n]=(h[n]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),n=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,n],m.push(...e);const[s,r,a,o]=u[t];d[t]=~~Math.max(Math.sqrt((i-a)**2+(n-s)**2),Math.sqrt((i-o)**2+(n-r)**2),Math.sqrt((i-a)**2+(n-r)**2),Math.sqrt((i-o)**2+(n-s)**2)),p[t]=(o-a)/(r-s)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:u[t],maxR:d[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:s,labelNumber:r-1};if(t.blur){const i=t.blur,n=function(t,e,i,n){const s=n/3,r=Math.ceil(n/2),a=function(t,e){const i=new Array(2*t+1).fill(0),n=t;let s=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+n]=t,s+=t}for(let t=0;t<i.length;t++)i[t]/=s;return i}(r,s),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let n=0;n<i;n++)for(let i=0;i<e;i++){let s=0;for(let o=-r;o<=r;o++)s+=t[n*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[n*e+i]=s}for(let t=0;t<e;t++)for(let n=0;n<i;n++){let s=0;for(let l=-r;l<=r;l++)s+=o[Math.min(Math.max(n+l,0),i-1)*e+t]*a[l+r];l[n*e+t]=Math.max(0,Math.min(1,s))}return l}(s,e[0],e[1],i);(function(t,e,i,n,s=1){const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,s>1)for(let e=1-s;e<=s-1;e++)for(let o=1-s;o<=s-1;o++)if(Math.sqrt(e*e+o*o)<s){const s=t+e,l=a+o;s>=0&&s<n&&l>=0&&l<i&&(r[s*i+l]=1)}return r})(s,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(s[e]=n[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const n=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+n[r][0],o=i+n[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===s[a*e[0]+o])return!0}return!1}}function Qm(t,e,i){e.width=t.width,e.height=t.height;const n=e.getContext("2d",{willReadFrequently:!0});n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);const s=e.width,r=n.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let n=0;n<t;++n)if(!i(r,e,n))return!1;return!0},u=(t,e,n)=>{for(let s=e;s<n;++s)if(!i(r,s,t))return!1;return!0};for(;a<o&&c(s,a);)++a;for(;o-1>a&&c(s,o-1);)--o;for(;l<h&&u(l,a,o);)++l;for(;h-1>l&&u(h-1,a,o);)--h;const d=n.getImageData(l,a,h-l,o-a);return e.width=d.width,e.height=d.height,n.clearRect(0,0,e.width,e.height),n.putImageData(d,0,0),e}function ty(t,e){return t&&(v(t)||x(t)||t.startsWith("<svg"))?new Promise(((i,n)=>{var s;const r=e({image:t}),a=null===(s=r.resources)||void 0===s?void 0:s.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const s=null===(e=r.resources)||void 0===e?void 0:e.get(t);s&&"success"===s.state&&s.data?i(s.data):n(new Error("image load failed: "+t))}else n(new Error("image load failed: "+t))},r.failCallback=()=>{n(new Error("image load failed: "+t))})})):null}var ey;function iy(t){return t}!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"}(ey||(ey={})),Object.values(ey).forEach((t=>{}));const ny=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),sy=t=>t<0?-t*t:t*t;function ry(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function ay(t,e,i){const n=t[0],s=t[1],r=e[0],a=e[1];let o,l;return s<n?(o=ry(s,n),l=i(a,r)):(o=ry(n,s),l=i(r,a)),t=>l(o(t))}function oy(t,e,i){const n=Math.min(t.length,e.length)-1,s=new Array(n),r=new Array(n);let a=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<n;)s[a]=ry(t[a],t[a+1]),r[a]=i(e[a],e[a+1]);return function(e){const i=function(t,e,i=0,n){for(l(n)&&(n=t.length);i<n;){const s=i+n>>>1;z(t[s],e)>0?n=s:i=s+1}return i}(t,e,1,n)-1;return r[i](s[i](e))}}class ly{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),n=t[0]-i*e[0];return[n,i+n]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):h(this._rangeFactorStart)&&h(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return l(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return l(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:n}=this._fishEyeOptions,s=this.range(),r=s[0],a=s[s.length-1],o=Math.min(r,a),h=Math.max(r,a),c=q(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,h),u=l(n)?(h-o)*i:n;let d=Math.exp(e);d=d/(d-1)*u;const p=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const i=d*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:hy}=oe;function cy(t,e){const i=typeof e;let n;if(l(e)||"boolean"===i)return()=>e;if("number"===i)return K(t,e);if("string"===i){if(n=re.parseColorString(e)){const e=hy(re.parseColorString(t),n);return t=>e(t).formatRgb()}return K(Number(t),Number(e))}return e instanceof ae?hy(t,e):e instanceof re?hy(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),n=e.valueOf(),s=new Date;return t=>(s.setTime(i*(1-t)+n*t),s)}(t,e):K(Number(t),Number(e))}class uy extends ly{constructor(t=iy,e=iy){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=iy,this._piecewise=ay,this._interpolate=cy}calculateVisibleDomain(t){var e;return h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),K)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const n=Array.from(t,G);return this._domain=n,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Z,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,n=i.length,s=this._range.length;let r=Math.min(n,s);if(n&&n<s&&this._forceAlign){const t=s-n+1,e=i[n-1],a=n>=2?(e-i[n-2])/t:0;for(let s=1;s<=t;s++)i[n-2+s]=e-a*(t-s);r=s}return this._autoClamp&&(this._clamp=function(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}(i[0],i[r-1])),this._piecewise=r>2?oy:ay,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:iy),this.rescale(i)):this._clamp!==iy}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return l(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return l(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const dy=Math.sqrt(50),py=Math.sqrt(10),gy=Math.sqrt(2),fy=[1,2,5,10],my=(t,e,i)=>{let n=1,s=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?s=0:t<0&&t>=-Number.MIN_VALUE?s=-(e-1):!i&&a<1?n=xy(a).step:(i||a>1)&&(s=Math.floor(t)-r*n),n>0?(t>0?s=Math.max(s,0):t<0&&(s=Math.min(s,-(e-1)*n)),function(t,e,i){h(e)||(e=t,t=0),h(i)||(i=1);let n=-1;const s=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(s);for(;++n<s;)r[n]=t+n*i;return r}(0,e).map((t=>s+t*n))):t>0?by(0,-(e-1)/n,n):by((e-1)/n,0,n)},yy=Y(((t,e,i,n)=>{let s,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((s=e<t)&&(r=t,t=e,e=r),o=_y(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),n=Math.round(e/o);for(i*o<t&&++i,n*o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==n?void 0:n.noDecimals)){o=1;const i=Math.ceil(t),n=Math.floor(e);if(!(i<=n))return[];for(a=new Array(r=n-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),n=Math.round(e*o);for(i/o<t&&++i,n/o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)/o}return s&&a.reverse(),a})),by=(t,e,i)=>{let n,s,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)/i}return s},vy=Y(((t,e,i,n)=>{let s,r,a;if(i=+i,(t=+t)==(e=+e))return my(t,i,null==n?void 0:n.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return my(t,i,null==n?void 0:n.noDecimals);(s=e<t)&&(a=t,t=e,e=a);const o=_y(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let n=1;const{power:s,gap:a}=o,h=10===a?2*10**s:1*10**s;for(;n<=5&&(r=by(t,e,l),r.length>i+1)&&i>2;)l+=h,n+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let n;const s=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(n=a;n>=1;n--)e.push(s-n*i);return e.concat(t)}if(s>=0){for(n=1;n<=a;n++)t.push(r+n*i);return t}let o=[];const l=[];for(n=1;n<=a;n++)n%2==0?o=[s-Math.floor(n/2)*i].concat(o):l.push(r+Math.ceil(n/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==n?void 0:n.noDecimals)&&l<0&&(l=1),r=by(t,e,l);return s&&r.reverse(),r})),xy=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let n=fy[0];return i>=dy?n=fy[3]:i>=py?n=fy[2]:i>=gy&&(n=fy[1]),e>=0?{step:n*10**e,gap:n,power:e}:{step:-(10**-e)/n,gap:n,power:e}};function _y(t,e,i){const n=(e-t)/Math.max(0,i);return xy(n)}function Ay(t,e,i){let n;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(n=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(n))return[];const s=new Array(i);for(let e=0;e<i;e++)s[e]=t+e*n;return s}function Sy(t,e=10){let i,n,s=0,r=t.length-1,a=t[s],o=t[r],l=10;for(o<a&&(n=a,a=o,o=n,n=s,s=r,r=n);l-- >0;){if(n=_y(a,o,e).step,n===i)return t[s]=a,t[r]=o,t;if(n>0)a=Math.floor(a/n)*n,o=Math.ceil(o/n)*n;else{if(!(n<0))break;a=Math.ceil(a*n)/n,o=Math.floor(o*n)/n}i=n}}class Ty extends uy{constructor(){super(...arguments),this.type=ey.Linear}clone(){var t;const e=new Ty;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return yy(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(o(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const n=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,s=this._domain,r=n[0],a=n[n.length-1];let l=vy(s[0],s[s.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==a)&&this._niceType){const t=n.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==a&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ay(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let n,s,r=-1;if(i=+i,(s=(e=+e)<(t=+t))&&(n=t,t=e,e=n),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return s&&o.reverse(),o}(e[0],e[e.length-1],t)}nice(t=10,e){var i,n;const s=this._domain;let r=[];if(e){const t=function(t,e){const i=y(e.forceMin),n=y(e.forceMax);let s=null;const r=[];let a=null;const o=i&&n?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:n?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:y(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),n?r[1]=e.forceMax:y(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),y(r[0])&&y(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):s=y(r[0])||y(r[1])?y(r[0])?"max":"min":"all",{niceType:s,niceDomain:a,niceMinMax:r,domainValidator:o}}(s,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Sy(s.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(n=r[0])&&void 0!==n?n:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Sy(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Sy(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class wy extends Ty{constructor(){super(ny,sy),this.type=ey.Sqrt}clone(){return(new wy).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var My;function By(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(My||(My={}));class Cy{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:i=0}=t;let n=this.imageCollageList;return n.forEach(((t,n)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=i,t.weight=tt(e)(this.data[n]),t.datum=this.data[n])})),n=n.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),n}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:n,height:s}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:n/s}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,i,n,s,r;const a=this.options,o=a.size,l={shapeUrl:null!==(t=a.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:o,ratio:a.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=a.maskConfig)||void 0===e?void 0:e.edgeBlur},h=this.options.createCanvas({width:o[0],height:o[1]}),c=h.getContext("2d",{willReadFrequently:!0});c.textAlign="center",c.textBaseline="middle",l.tempCanvas=h;const u=o[0]+31>>5<<5;if(l.boardSize=[u,o[1]],l.random?l.randomGenerator=Math.random:l.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=l,p(l.shapeUrl)){l.isEmptyPixel=Xm(void 0,{threshold:null!==(n=null===(i=a.maskConfig)||void 0===i?void 0:i.threshold)&&void 0!==n?n:200,invert:null===(s=a.maskConfig)||void 0===s?void 0:s.invert},this.options.createCanvas);const t=ty(l.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const n=a.size,s=this.options.createCanvas({width:n[0],height:n[1],dpr:1});l.maskCanvas=s;const r=s.getContext("2d");(null===(e=a.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&Qm(t,s,l.isEmptyPixel);const o=function(t,e){const i=t.width,n=t.height;let s=e[0]/i;n*s>e[1]&&(s=e[1]/n);const r=Math.floor(s*i),a=Math.floor(s*n);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:s}}(t,n);let h;r.clearRect(0,0,n[0],n[1]),r.drawImage(t,o.x,o.y,o.width,o.height),this.segmentationOutput=Jm(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(h=this.generateTransparentMaskCanvas(t,n)),this.segmentationOutput.transparentMaskCanvas=h,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(s,h)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(l.shapeUrl&&("text"===l.shapeUrl.type||"geometric"===l.shapeUrl.type)){l.isEmptyPixel=Xm(l.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==l.shapeUrl.type&&"geometric"!==l.shapeUrl.type||l.shapeUrl.backgroundColor||(l.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=((t,e,i,n,s=!1,r)=>{let{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;s&&([a,o]=[o,a]);const l=n||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(n){const t=n.width,s=n.height;h.clearRect(0,0,t,s),n.style.width=`${e}px`,n.style.height=`${i}px`,n.width=e,n.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?$m(t,o,l.width,l.height,h):"geometric"===t.type&&Zm(t,o,l.width,l.height,h),l})(l.shapeUrl,o[0],o[1],void 0,null===(r=a.maskConfig)||void 0===r?void 0:r.invert,this.options.createCanvas);l.maskCanvas=t,this.segmentationOutput=Jm(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>ty(t,e))))}(this.data.map((t=>tt(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,$.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t,e={},i=.45){const{imageSizeRange:n,padding:s=0}=e,r=y(e.imageSize)?e.imageSize:((t,e={})=>{if(g(t)){const i=t.map((t=>Q(t,e)));return t=>i.map((e=>e(t)))}return Q(t,e)})(e.imageSize),a=this.options.size;if(r||n)if(r&&!o(r))t.forEach((t=>By(t,r)));else if(n){const e=(new wy).domain(et(t,(t=>t.weight))).range(n);t.forEach((t=>By(t,~~e.scale(t.weight))))}else if(r&&o(r)&&!n){const e=.5,[n,r]=et(t,(t=>t.weight)),o=t.reduce(((t,i)=>{const s=i.aspectRatio,a=(i.weight-n)/(r-n);return t+(s>1?1/s:s)*(e+(1-e)*a)**2}),0),l=~~Math.sqrt(i*a[0]*a[1]/o),h=[~~(e*l)-2*s<0?1:~~(e*l)-2*s,~~l-2*s<0?1:~~l-2*s],c=(new wy).domain(et(t,(t=>t.weight))).range(h);t.forEach((t=>By(t,~~c.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let n=~~Math.sqrt(i*a[0]*a[1]/e);n=n-2*s<0?1:n-2*s,t.forEach((t=>By(t,n)))}return t}generateTransparentMaskCanvas(t,e){var i;const n=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),s=n.getContext("2d");this.segmentationOutput.transparentMaskCanvas=n,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&Qm(t,n,this.segmentationInput.isEmptyPixel);const r=s.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],n=4*t;r.data[n]=e,r.data[n+1]=e,r.data[n+2]=e,r.data[n+3]=i}return s.clearRect(0,0,e[0],e[1]),s.fillStyle="rgba(255,255,255,0)",s.fillRect(0,0,e[0],e[1]),s.putImageData(r,0,0),n}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class ky extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,n,s,r=1){const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),u=Hm[i](e);let d,p,g=-r;const{segmentation:f}=n,{labels:m}=f;for(;([d,p]=u(g+=r))&&!(Math.min(Math.abs(d),Math.abs(p))>=c);)if(d-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+d),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Py(t,s)){const{x:e,y:i,width:n,height:s}=t;let r=!1;for(let t=0;t<n;t++){for(let n=0;n<s&&i+t<=o;n++)if(!(e+n>a||m[(i+t)*a+(e+n)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:i}=this,{layoutConfig:n={}}=this.options,s=this.options.size,{spiralType:r="archimedean",fillingTimes:a=4,minFillingImageSize:o=10}=n,l=[],h=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,s,r,i,l)&&l.push(e);const c=U(l,((t,e)=>t.width-e.width)).width,u=U(l,((t,e)=>t.height-e.height)).height,d=[];for(let n=0;n<a;n++){const a=.5*c-1*n,p=.5*u-1*n;for(const n of t){const t=Object.assign({},n,{visible:!0});By(t,Math.max(o,t.aspectRatio>1?a:p)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,s,r,i,[...d,...l],.5)&&(n._tempFrequency=(null!==(e=n._tempFrequency)&&void 0!==e?e:n.frequency)+1,t.frequency=n._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-s[0]/2,2)+Math.pow(t.y-s[1]/2,2)),t[h]=`${t[h]}_${t.frequency}`,d.push(t))}}return[...l,...d].filter((t=>t.visible))}}function Py(t,e){for(let s=0;s<e.length;s++)if(i=t,n=e[s],!(i._leftWithoutPadding+i._widthWithPadding<n._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<n._topWithoutPadding||i._leftWithoutPadding>n._leftWithoutPadding+n._widthWithPadding||i._topWithoutPadding>n._topWithoutPadding+n._heightWithPadding))return!1;var i,n;return!0}function Oy(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*n-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=s;let u,d;c>1?(u=h,d=h/c):(d=h,u=h*c);const p=Math.ceil(l/(d+r)),g=Math.ceil(o/(u+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(u+r)+u/2,n=t*(d+r)+d/2;y[t*g+e]={centerX:i,centerY:n,x:i-u/2,y:n-d/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(n-m,2))}}return{context:Object.assign({},s,{cellWidth:u,cellHeight:d,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:u*d,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<u;t++)for(let s=0;s<d&&n+t<=l;s++)i+s>o||e((~~n+t)*o+(~~i+s))},clipPath:`M${-u/2} ${-d/2} L${u/2} ${-d/2} L${u/2} ${d/2} L${-u/2} ${d/2} Z`}),imageLength:h}}const Ry={rect:Oy,circle:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let u=0;u=a?a/2:Math.min(o,l)*n/2,u-r<=0&&(u=r+1);const d=2*u,p=Math.sqrt(3)/2*d+r,g=[];let f=0;for(let t=0;t*p-u<l;t++){const e=t*p,i=t%2==0?0:u;for(let n=-1;n*(d+r)+i-u<o;n++){const s=n*(d+r)+i+u;g[f++]={centerX:s,centerY:e,x:s-u,y:e-u,row:t,col:n,distance:Math.sqrt(Math.pow(s-h,2)+Math.pow(e-c,2))}}}let m=0;const y=u*u;for(let t=0;t<d;t++)for(let e=0;e<d;e++){const i=t-u,n=e-u;i*i+n*n<=y&&m++}return{context:Object.assign({},s,{cellWidth:d,cellHeight:d,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<d;t++)for(let s=0;s<d;s++){if(t+i<0||t+i>o||s+n>l||s+n<0)continue;const r=t-u,a=s-u;r*r+a*a<=y&&e((~~n+t)*o+(~~i+s))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:d}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let u;u=a?a/2:Math.min(o,l)*n/2,u-r<=0&&(u=r+1);const d=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;d.push({x:(u-r/2)*Math.cos(e),y:(u-r/2)*Math.sin(e)})}const g=2*u,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,n=t*b+(e%2?v:0);A.push({centerX:i,centerY:n,x:i-f,y:n-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(n-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,n=t-m/2,s=Math.abs(i),r=Math.abs(n);s<=f&&r<=m/2&&2*r+s*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},s,{cellHexSideLength:f,cellHexPoints:d,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:n}=t;let s=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[s++]&&e((~~n+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class Ly extends Cy{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:n="rect"}=i,s=(null!==(t=Ry[n])&&void 0!==t?t:Ry.rect)(this.options),{context:r,imageLength:a}=s;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:i,cellInfo:n,cellCount:s,clipPath:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===s||0===e||0===i||0===n.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:l}=this,{layoutConfig:h={}}=this.options,{placement:c="default"}=h;if("edge"===c||"default"===c){const{segmentation:t}=l,{labels:e}=t;n.forEach((t=>{let i=0;a(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,d=t=>{const{intersectPixels:e}=t;return"default"===c?e>=.45*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],s=n[e];s&&(i.x=s.centerX-i.width/2,i.y=s.centerY-i.height/2,i.clipConfig={shape:r},i.frequency=1,i.visible=d(s),i.cell=R(s,["image"]),i.distance=s.distance,s.image=i)}const p=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<s)for(let e=u;e<s;e++){const i=t[e-u],s=n[e];if(s){const e=Object.assign({},i);e.x=s.centerX-e.width/2,e.y=s.centerY-e.height/2,e.frequency+=1,e[p]=`${e[p]}_${e.frequency}`,e.visible=d(s),e.distance=s.distance,e.cell=R(s,["image"]),s.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class Iy extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,n=Oy;return this.layoutContext=n(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:n,cellInfo:s,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:u=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;s.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const d=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<d;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.visible=g(n),i.cell=`${n.row}_${n.col}`,i.angle=Math.random()*(2*u)-u,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-n.distance,i.distance=n.distance,i.frequency=1,n.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(d<r)for(let e=d;e<r;e++){const i=t[e-d],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*u)-u,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(n),e.cell=`${n.row}_${n.col}`,e.distance=n.distance,e.zIndex=p-n.distance,n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Ey=(t,e,i)=>{var n,s;const r=o(t.size)?t.size():t.size;if(t.size=r,!r||l(r[0])||l(r[1])||r[0]<=0||r[1]<=0)return $.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(r[0]),Math.ceil(r[1])],t.image||$.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let a;switch(null!==(s=null===(n=t.layoutConfig)||void 0===n?void 0:n.layoutMode)&&void 0!==s?s:"spiral"){case"grid":a=Ly;break;case"stack":a=Iy;break;default:a=ky}const h=new a(t);return h.layout(e),h.unfinished()?{progressive:h}:h.output()};class Dy extends qf{constructor(t,e,i,n,s){var r;super(t,e,i,n,s),this._rotations=null!==(r=null==s?void 0:s.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,b(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var n;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const s=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(s))*(null!==(n=this._scaleX)&&void 0!==n?n:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Fy(t,i){switch(i){case"axialRotate":return[{custom:Dy,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class jy extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:n}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(n[0]&&s)return null!==(i=s[n[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&n)return n[i[0]]}}get defaultShapeType(){return"square"}}class Uy extends e.BaseSeries{constructor(){super(...arguments),this.type=Nm}setValueField(t){h(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(zm.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(zm.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new jy(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:fh,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,n;if(t){const s=null===(n=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===n?void 0:n.preset,r={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(r,s),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Uy.type=Nm,Uy.mark=zm;const Ny=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Fy(t,e),enter:Fy(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Uy.type,Uy),e.Factory.registerGrammarTransform("imagecloud",{transform:Ey})};class Wy extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Wy.transformerConstructor,this.type=Um,this.seriesType=Nm}}Wy.type=Um,Wy.seriesType=Nm,Wy.transformerConstructor=jm;const zy=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Gy extends Al{constructor(t,e){super(t),this._skipRenderAttributes=zy,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,n){const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(s)return this._setAttributes(s,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?O(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const n=e[i];!d(this.attribute[n])||o(this.attribute[n])||o(t[n])?this.attribute[n]=t[n]:O(this.attribute[n],t[n])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new Vr(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}eventPosToStagePos(t){var e,i;const n={x:0,y:0},s=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==i?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(s,n),n}}var Vy;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Vy||(Vy={}));const Hy={[Vy.selectedReverse]:{},[Vy.selected]:{},[Vy.hover]:{},[Vy.hoverReverse]:{}};function Xy(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&Xy(t,e)}))}function $y(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function Yy(t,e,i){return Math.abs(t-e)<i}function qy(t,e="type"){return"rich"===function(t,e="type"){var i,n;return c(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(n=t[e])&&void 0!==n?n:"text"}(t,e)}const Ky=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function Zy(){Lg(),Gg(),Zg(),$g(),Qg()}var Jy=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};Zy();class Qy extends Gy{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},Qy.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:n="",textStyle:s={},shape:r={},panel:o={},space:u=4,minWidth:d,maxWidth:p,padding:f=4,visible:m,state:v,type:x,textAlwaysCenter:_,containerTextAlign:A}=this.attribute,S=function(t){if(b(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,n]=t;return[e,i,n,i]}if(4===e)return t}if(c(t)){const{top:e=0,right:i=0,bottom:n=0,left:s=0}=t;return[e,i,n,s]}return[0,0,0,0]}(f),T=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let M,B=-S[3],C=-S[0],k=S[1]+S[3],P=S[0]+S[2],O=0,R=0;const{visible:L}=r,I=Jy(r,["visible"]);if(a(L)){const t=(null==I?void 0:I.size)||10,e=y(t)?t:Math.max(t[0],t[1]);M=T.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},I),{visible:L,x:e/2,y:e/2}),"symbol"),w(null==v?void 0:v.shape)||(M.states=v.shape),L&&(R=e+u)}let E,D,F;if(k+=R,O+=R,qy({text:n})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,i;return h(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:x,text:n},s))),s),{visible:h(n)&&!1!==m,x:O,y:0});l(t.lineHeight)&&(t.lineHeight=s.fontSize),E=T.createOrUpdateChild("tag-text",t,"richtext"),D=E.AABBBounds.width(),F=E.AABBBounds.height()}else{const i=Object.assign(Object.assign({text:c(n)&&"type"in n&&"text"===n.type?n.text:n,visible:h(n)&&!1!==m,lineHeight:null==s?void 0:s.fontSize},s),{x:O,y:0});l(i.lineHeight)&&(i.lineHeight=s.fontSize),E=T.createOrUpdateChild("tag-text",i,"text");const r=function(t,e,i={}){if(!t)return{width:0,height:0};const n=zh({text:t,fontFamily:e.fontFamily||i.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:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:n.width(),height:n.height()}}(i.text,s,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);D=r.width,F=r.height}k+=D;const U=null!==(i=r.size)&&void 0!==i?i:10,N=y(U)?U:Math.max(U[0],U[1]);P+=Math.max(F,r.visible?N:0);const{textAlign:W,textBaseline:z}=s;(h(d)||h(p))&&(h(d)&&k<d&&(k=d),h(p)&&k>p&&(k=p,E.setAttribute("maxLineWidth",p-S[1]-S[2]))),B=0,C=0;let G=0;"left"===W||"start"===W?G=1:"right"===W||"end"===W?G=-1:"center"===W&&(G=0),G?G<0?(B-=k,M&&M.setAttribute("x",(M.attribute.x||0)-D),T.setAttribute("x",-S[1]-R)):G>0&&T.setAttribute("x",S[3]):(B-=k/2,M&&M.setAttribute("x",(M.attribute.x||0)-D/2),T.setAttribute("x",-R/2));const V="right"===A||"end"===A,H="left"===A||"start"===A,X=(t,e)=>{"richtext"===E.type?E.setAttributes({x:t,textAlign:e,textConfig:j(E.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):E.setAttributes({x:t,textAlign:e})};if((A?"center"===A:_)&&G){const t=k-S[1]-S[3],e=D+R,i=1===G?(t-e)/2+R+D/2:S[0]+R-(k/2+e/2-R)+D/2;if(X(i,"center"),M){const t=i-D/2-R+N/2;M.setAttributes({x:t})}}if(H&&1!==G){const t=k-S[1]-S[3],e=0===G?-t/2+R/2:-k+S[3]+S[1]+R;if(X(e+R,"left"),M){const t=e+N/2;M.setAttributes({x:t})}}if(V&&-1!==G){const t=k-S[1]-S[3],e=0===G?t/2+R/2:t;if(X(e,"right"),M){const t=e-D-R+N/2;M.setAttributes({x:t})}}"middle"===z?(C-=P/2,M&&M.setAttribute("y",0)):"bottom"===z?(C-=P,M&&M.setAttribute("y",-F/2),T.setAttribute("y",-S[2])):"top"===z&&(T.setAttribute("y",S[0]),M&&M.setAttribute("y",F/2)),w(null==v?void 0:v.text)||(E.states=v.text);const{visible:$}=o,Y=Jy(o,["visible"]);if(m&&a($)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},Y),{visible:$&&!!n,width:k,height:P,x:B,y:C}),"rect");if(w(null==v?void 0:v.panel)||(t.states=v.panel),Y.customShape){const e=Y.customShape;t.pathProxy=t=>e(this,t,new ys)}this._bgRect=t}this._textShape=E,this._symbol=M,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:O({},Qy.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,n,s,r,a,o,l,h,c,u,d,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(s=null===(n=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===n?void 0:n.slice())&&void 0!==s?s:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(u=this._bgRect)||void 0===u||u.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function tb(){Lg(),Fg(),Ug(),Zg()}function eb(){Lg(),Fg(),kg(),Zg()}Qy.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},tb();class ib extends Gy{getStartAngle(){return Tt(this._startAngle)}getEndAngle(){return Tt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},ib.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!s)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(b(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(W(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var s,r;const a=Nh.line(Object.assign(Object.assign({points:t},g(i)?null!==(s=i[e])&&void 0!==s?s:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),w(null==n?void 0:n.line)||(a.states=g(n.line)?null!==(r=n.line[e])&&void 0!==r?r:n.line[n.line.length-1]:n.line),this.add(a),this.lines.push(a)}))}else{let t=Nh.line;j(i)[0].cornerRadius&&(t=Nh.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},j(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),w(null==n?void 0:n.line)||(e.states=[].concat(n.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:n=!0}=t;let s;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:g,size:f=12}=t;let m,y;"start"===i?(m={x:l.x+(b(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(b(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},y=this._computeStartRotate(this._startAngle)):(m={x:h.x+(b(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(b(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},y=this._computeEndRotate(this._endAngle)),s=Nh.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:g,size:f,angle:n?y+d:0,strokeBoundsBuffer:0}),p)),s.name=`${this.name}-${i}-symbol`,s.id=this._getNodeId(`${i}-symbol`),w(null==o?void 0:o.symbol)||(s.states=o.symbol),"start"===i?w(null==o?void 0:o.startSymbol)||(s.states=o.startSymbol):w(null==o?void 0:o.endSymbol)||(s.states=o.endSymbol),this.add(s)}return s}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let n;return n=e?b(i)?t[i]:W(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}ib.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},eb();class nb extends ib{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},ib.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!s)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},c={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,c];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),d=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=d;const p=Nh.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),w(null==n?void 0:n.line)||(p.states=[].concat(n.line)[0]),this.add(p),this.line=p}}var sb,rb,ab,ob;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(sb||(sb={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(rb||(rb={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(ab||(ab={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(ob||(ob={}));class lb extends Gy{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,i)=>{const n=t.target;return n!==i&&n.name&&!w(n.states)?(n.addState(Vy.hover,!0),Xy(e,(t=>{t!==n&&t.name&&!w(t.states)&&t.addState(Vy.hoverReverse,!0)})),n):i})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(Xy(e,(t=>{t.name&&!w(t.states)&&(t.removeState(Vy.hoverReverse),t.removeState(Vy.hover))})),null):i)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const n=t.target;return i===n&&n.hasState(Vy.selected)?(Xy(e,(t=>{t.name&&!w(t.states)&&(t.removeState(Vy.selectedReverse),t.removeState(Vy.selected))})),null):n.name&&!w(n.states)?(n.addState(Vy.selected,!0),Xy(e,(t=>{t!==n&&t.name&&!w(t.states)&&t.addState(Vy.selectedReverse,!0)})),n):i})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const n=c(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:O({},this.defaultUpdateAnimation,n,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:O({},this.defaultExitAnimation,n,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:O({},this.defaultUpdateAnimation,n,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:n,select:s}=this.attribute;n&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),s&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let s;if(n){const n=Nh.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));s=Nh.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(s),this._containerClip=n,this.add(n)}else s=Nh.group({x:0,y:0,pickable:!1}),this.add(s);s.name="marker-container",this._container=s}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const hb={type:"callIn",duration:500,easing:"linear",delay:0},cb={type:"fadeOut",duration:500,easing:"linear",delay:0},ub=.001;sb.end,ab.arcOuterMiddle,rb.right,ab.arcOuterMiddle;const db={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};Lg(),Zy(),Yf(),tb(),eb(),Zg(),Eg(),Fg(),Yf();class pb extends lb{markerAnimate(t){pb._animate&&this._animationConfig&&pb._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},pb.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=hb,this.defaultExitAnimation=cb,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,n,s){return Yy(Math.abs(n),Math.PI/2,ub)||Yy(Math.abs(n),3*Math.PI/2,ub)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,n,s):$y(n)?db.postiveXAxis[s]:db.negativeXAxis[s]}setItemAttributes(t,e,i,n,s){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:c=0,style:u,position:d=ob.middle}=e,{state:p}=this.attribute,g=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(g)+h*Math.cos(g-Math.PI/2),m=l*Math.sin(g)+h*Math.sin(g-Math.PI/2);if("text"===s){const s=n.x-i.x,r=n.y-i.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,s,r,g,null!==(a=e.position)&&void 0!==a?a:"end")),u.textStyle),state:{panel:O({},Hy,null==p?void 0:p.textBackground),text:O({},Hy,null==p?void 0:p.itemContent)}}))}else("richText"===s||"image"===s)&&(t.setAttributes({dx:this.getItemDx(t,d,u)+(u.dx||0),dy:this.getItemDy(t,d,u)+(u.dy||0)}),t.states=O({},Hy,null==p?void 0:p.itemContent));const y=$y(g)?g:g-Math.PI;t.setAttributes({x:n.x+(f||0),y:n.y+(m||0),angle:o&&y+c})}getItemDx(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==s?s:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==s?s:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:n}=this.attribute,{type:s="text",style:r,renderCustomCallback:a}=t;let o;return"symbol"===s?(o=Nh.symbol(Object.assign(Object.assign({},i),r)),o.states=O({},Hy,null==n?void 0:n.itemContent)):"text"===s?o=new Qy(Object.assign(Object.assign({},i),{state:{panel:O({},Hy,null==n?void 0:n.textBackground),text:O({},Hy,null==n?void 0:n.itemContent)}})):"richText"===s?(o=Nh.richtext(Object.assign(Object.assign({},i),r)),o.states=O({},Hy,null==n?void 0:n.itemContent)):"image"===s?(o=Nh.image(Object.assign(Object.assign({},i),r)),o.states=O({},Hy,null==n?void 0:n.itemContent)):"custom"===s&&a&&(o=a(),o.states=O({},Hy,null==n?void 0:n.itemContent)),o.name=`mark-point-${s}`,this.setItemAttributes(o,t,e,i,s),o}getItemLineAttr(t,e,i){let n=[],s={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,u=i.y-e.y;if(this._isStraightLine=Yy(c,0,ub)||Yy(u,0,ub),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:n,y:l}=i,c=(t+n)/2,u=c+h*(l>e?-1:1)*c,d=(e===l?0:-(t-n)/(e-l))*(u-c)+(e+l)/2;a=Ky(e-d,t-u),o=Ky(l-d,n-u),s={x:u,y:d};const p=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e))}else n="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return n=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(n),{points:n,center:s,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:i,endSymbol:n,lineStyle:s,type:r="type-s"}=t,{state:a}=this.attribute,o=this._isArcLine?nb:ib;this._container.removeChild(this._line),this._line=new o(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:i,endSymbol:n,lineStyle:s,visible:t.visible,state:{line:O({},Hy,null==a?void 0:a.line),startSymbol:O({},Hy,null==a?void 0:a.lineStartSymbol),endSymbol:O({},Hy,null==a?void 0:a.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,i){if(this._line){const{startSymbol:n,endSymbol:s,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this.getItemLineAttr(t,e,i);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},l),{startSymbol:n,endSymbol:s,lineStyle:r,visible:t.visible,state:{line:O({},Hy,null==o?void 0:o.line),startSymbol:O({},Hy,null==o?void 0:o.lineStartSymbol),endSymbol:O({},Hy,null==o?void 0:o.lineEndSymbol)}})):this.reDrawLine(t,l)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,n=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(n-Math.PI/2),startPointOffsetY:i/2*Math.sin(n-Math.PI/2),endPointOffsetX:-i/2*Math.cos(n-Math.PI/2),endPointOffsetY:-i/2*Math.sin(n-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var n;if(this._decorativeLine){const{lineStyle:s}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+o,y:e.y+l}]},s),{visible:i})),this._decorativeLine.states=O({},Hy,null===(n=this.attribute.state)||void 0===n?void 0:n.line)}}setTargetItemAttributes(t,e){var i,n;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(i=t.visible)&&void 0!==i&&i,size:t.size},t.style)),this._targetItem.states=O({},Hy,null===(n=this.attribute.state)||void 0===n?void 0:n.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:n,itemLine:s={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:n,height:s}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:n,x2:s,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,u=0;return a<i&&(c=i-a),o<n&&(u=n-o),l>s&&(c=s-l),h>r&&(u=r-h),{dx:c,dy:u}}(this._item,{x1:t,y1:i,x2:t+n,y2:i+s});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,n),this.setItemLineAttr(s,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(s,e,null===(i=s.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:n={},targetSymbol:s,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=n,{offset:l=0,style:h,visible:c=!1,size:u}=s,d=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:u)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?Ky(o,a/2):"type-po"===r.type?Ky(0,a):"type-op"===r.type?Ky(o,0):Ky(o,a),{newPosition:{x:t.x+(d/2+l)*Math.cos(p),y:t.y+(d/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(d/2+l)*Math.cos(p)+a,y:t.y+(d/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:n}=this.attribute,{type:s="type-s",arcRatio:r=.8}=n,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=Yy(a,0,ub)||Yy(o,0,ub),this._isArcLine="type-arc"===s&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?nb:ib)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const u=Nh.line({points:[]});u.name="mark-point-decorativeLine",this._decorativeLine=u,t.add(u);const d=Nh.symbol({});d.name="mark-point-targetItem",this._targetItem=d,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:n="text"}=e,{type:s="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=Yy(a,0,ub)||Yy(o,0,ub);const l="type-arc"===s&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,n),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!b(t.x)||!b(t.y))}}pb.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const gb="seriesBreak";function fb(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*n,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?d:-d):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}const mb=(t,e)=>{const{start:i,end:n}=e,s=i.x===n.x,r=s?"x":"y",a=s?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e,i=1e-10,n=1e-10){const s=n,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(s,r)}(t.start[r],i[r])){const e=Math.min(i[a],n[a]),s=Math.max(i[a],n[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(s<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,s),void(o=!1)}})),o&&t.push(e)};class yb extends Gy{constructor(){super(...arguments),this.name=gb}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(w(t))return;const e=[],i=[];t.forEach((t=>{const{start:n,end:s}=t,r=n.x===s.x;mb(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:n,end:s,size:r=4,gap:a=5,style:o={}}=t,l=Ve(t,["start","end","size","gap","style"]),c=Sl({}),u=n.x===s.x;let d,p,g,f;u?(d={x:n.x-a/2,y:n.y},p={x:s.x-a/2,y:s.y},g={x:n.x+a/2,y:n.y},f={x:s.x+a/2,y:s.y}):(d={x:n.x,y:n.y-a/2},p={x:s.x,y:s.y-a/2},g={x:n.x,y:n.y+a/2},f={x:s.x,y:s.y+a/2});const m=fb(d,p,r,u?75:15,u),y=fb(n,s,r,u?75:15,u),b=fb(g,f,r,u?75:15,u);c.add(wh(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh({path:y,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function bb(t,e,i=1){return Math.abs(t-e)<i}function vb(t,e){return{type:"component",componentType:gb,interactive:!0,zIndex:500,style:{data:(i,n)=>{const s=[],r=n.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var n,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(n=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}return{x1:e,y1:i,x2:n,y2:s}}(c.getRegions());j(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const r=t.AABBBounds;let c,p,g,f,m=!1;a?(m=r.x1<(o+l-n)/2&&r.x2>(o+l+n)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),g=h,f=Math.min(r.y2+d.y1+2,d.y2)):(m=r.y1<(o+l-n)/2&&r.y2>(o+l+n)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,g=Math.min(r.x2+d.x1+2,d.x2),f=h),m&&s.push({start:{x:c,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{_b(t,"line").forEach((t=>{xb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),s.push({start:r,end:o,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{_b(t,"area").forEach((t=>{const r=xb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Ab(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),s.push({start:t,end:r,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),s}}}}function xb(t,e){const i=[];for(let n=1;n<e.length;n++){const s=Mt([t.start.x,t.start.y],[t.end.x,t.end.y],[e[n].x,e[n].y],[e[n-1].x,e[n-1].y]);s&&!i.find((t=>bb(vt.distancePP({x:t[0],y:t[1]},{x:s[0],y:s[1]}),0)))&&i.push(s)}return i}function _b(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function Ab(t,e){const{x:i,y:n}=t;let s=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const Sb="barLink";class Tb extends Gy{constructor(){super(...arguments),this.name=Sb}render(){const{data:t,linkStyle:i,areaStyle:n,styleMap:s,label:r,linkType:a="total"}=this.attribute;w(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:g,id:f=o,color:m,data:y}=t;if(g&&!1!==(null===(l=null==s?void 0:s[`area-${f}`])||void 0===l?void 0:l.visible)){const t=(b=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:m,zIndex:0},n),null==s?void 0:s[`area-${f}`]),new Bh(b));t.name="bar-link-area",t.id=`area-${f}`,this.add(t)}var b;if(p&&!1!==(null===(h=null==s?void 0:s[`line-${f}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==s?void 0:s[`line-${f}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=i||{},r=B(t),a=B(e);(null==s?void 0:s[`line-${f}`])&&s[`line-${f}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:s[`line-${f}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:s[`line-${f}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new ib({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==s?void 0:s[`line-${f}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${f}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==s?void 0:s[`label-${f}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[n,o]=y;let l=n[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=Zl(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,y):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==s?void 0:s[`label-${f}`]));d.name="bar-link-label",d.id=`label-${f}`,this.add(d)}})))}}function wb(t,i,n){const{isHorizontal:s,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=n,u=t.AABBBounds,d=i.AABBBounds;let p,g;return s?(p=[{x:(u.x1+u.x2)/2+h,y:u.y1+c},{x:(d.x1+d.x2)/2+h,y:d.y2+c}],r?("total"===o&&(p=[{x:u.x1+h,y:u.y1+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x1+h,x1:u.x2+h,y:u.y1+c},{x:d.x1+h,x1:d.x2+h,y:d.y2+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x2+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,x1:u.x1+h,y:u.y1+c},{x:d.x2+h,x1:d.x1+h,y:d.y2+c}]))):(p=[{x:u.x2+h,y:(u.y1+u.y2)/2+c},{x:d.x1+h,y:(d.y1+d.y2)/2+c}],a?("total"===o&&(p=[{x:u.x2+h,y:u.y2+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,y:u.y2+c,y1:u.y1+c},{x:d.x1+h,y:d.y2+c,y1:d.y1+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x1+h,y:d.y1+c}]),l&&(g=[{x:u.x2+h,y:u.y1+c,y1:u.y2+c},{x:d.x1+h,y:d.y1+c,y1:d.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function Mb(t={},i){const{linkType:n="total",doFill:s}=t,r=Ve(t,["linkType","doFill"]);return{type:"component",componentType:Sb,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const h=function(t,i){const n={};for(let s=0;s<t.length;s++){const r=t[s],a=e.getDatumOfGraphic(r),o=i.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(u){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=wb(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=wb(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Bb="seriesLabel";function Cb(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function kb(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Pb(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(kb(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function Ob(t,e){const{label:i,line:n}=e;return{type:"component",componentType:Bb,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(e,i)=>{var n;const s=i.vchart.getChart(),r=s.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(n=o.getScale)||void 0===n?void 0:n.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=s.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(f(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:n,y:o}=i.getLayoutStartPoint();let g=0;s.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getGraphics().forEach((s=>{var r;const l=s.context.data.find((t=>t[c]===e));if(l){const e=s.AABBBounds;let f,m,y,b;"bar"===d[0]||"waterfall"===d[0]?(f="end"===t?{x:a?(e.x1+e.x2)/2:h?e.x1:e.x2,y:a?h?e.y2:e.y1:(e.y1+e.y2)/2}:{x:a?(e.x1+e.x2)/2:h?e.x2:e.x1,y:a?h?e.y1:e.y2:(e.y1+e.y2)/2},m=s.attribute.fill):(f=i.dataToPosition(l),m=s.attribute.stroke||s.attribute.fill),"end"===t?(y=a?"center":h?"end":"start",b=a?h?"top":"bottom":"middle"):(y=a?"center":h?"start":"end",b=a?h?"bottom":"top":"middle");const v=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:f.x+n,y:f.y+o},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:l,id:`${t}-${g}`,position:t}),g++}}))}))}))}return p},line:n,label:Object.assign({space:12},i)}}}class Rb extends Gy{constructor(){super(...arguments),this.name=Bb}render(){var t,e,i,n;this.removeAllChild();const{data:s,layout:r,label:a,line:o={}}=this.attribute;if(w(s))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=s.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),n=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:g,id:f}=t,m=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),s=Cb(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:s[e]};n(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var n,s,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(s=null===(n=l[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==a?void 0:a.formatMethod,v=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),y),{textAlign:p,textBaseline:g,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[f])||void 0===h?void 0:h.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&Pb(t,4,10),e.length&&Pb(e,4,10);const i=null!==(n=null==a?void 0:a.space)&&void 0!==n?n:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,n,s,a,c;const{point:u,color:d,id:p}=t,g={x:h[p].x+(null!==(n=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:h[p].y+(null!==(c=null===(a=null===(s=l[p])||void 0===s?void 0:s.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==g.y||"horizontal"===r&&u.x!==g.x){const t=nh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=nh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}function Lb(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function Ib(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Eb(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:Ib(t.rect),anchorCandidates:Wb(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),n=[];n.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const s=i[t],r=s.bound;let a=n.some((t=>Lb(t,r)));if(s.anchorCandidates)if(a&&(null===(e=s.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<s.anchorCandidates.length;t++){const e=s.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!n.some((t=>Lb(t,i)))){n.push(i),a=!1;break}}a&&n.push(s.bound)}else n.push(s.bound)}return n.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Db(t,e,i){const n=t.map((t=>t.pointCoord)),{x1:s,x2:r,y1:a,y2:o}=Dt(n),l=i([(s+r)/2,(a+o)/2]);if(!l)return[];const h=t.map((t=>{const n=t.rect,s=Ub(e,t.pointCoord)?i(function(t,e,i,n=200){const s=5621/n;let r=e;for(let e=1;e<=s;e++){const e=de(r,n,i);if(!Ub(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Fb(jb(t.point,l)))):t.point;s&&(n.x=s.x,n.y=s.y);const r=Fb(jb(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=Nb(t.rect,a,0),t}));return Eb(h)}function Fb(t){return t>180?t-360:t}function jb(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Ub(t,e){for(let i=0;i<t.length;i++){if(ue(e,t[i]))return!0}return!1}function Nb(t,e,i=0){const n=Object.assign({},t);return"top"===e?(n.x-=t.width/2,n.y-=i+t.height/2):"bottom"===e?(n.x-=t.width/2,n.y+=i-t.height/2):"left"===e?(n.x-=i+t.width,n.y-=t.height/2):"right"===e&&(n.x+=i,n.y-=t.height/2),n}function Wb(t,e,i,n=0){const s=[];return t.forEach((t=>{const{x:r,y:a}=Nb(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,n);s.push({x:r,y:a})})),s}const zb={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class Gb extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return zb}}class Vb extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=Gb,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&h(t.seriesId)))}setAttrFromSpec(){var t,e,i,n;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(n=this._series)||void 0===n?void 0:n.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,s,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(s=null===(n=(i=this._regions[0]).getSpec)||void 0===n?void 0:n.call(i))||void 0===s?void 0:s.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new Ge(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const n=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(n)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const n=new pb({position:void 0,animation:!1});return n&&(n.name=`${this.name}_marker_${e}`,n.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,n.setAttribute("zIndex",this.layoutZIndex)),n})));this._markerComponents.forEach(((t,n)=>{const{pairInfo:s,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[n],n);s&&e.push(s),r&&i.push(r)}));const n=this._layoutLabels(e);this._layoutMarkers(n,i),this._renderMarkers()}_evaluateMarker(t,i){var n,s,r,a,o,l,c,u,d,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Nh.group({});if(k.name=`${this.name}_marker_itemContainer_${i}`,B.container=k,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=Nh.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(r=this._spec.icon)||void 0===r?void 0:r.visible){const t=Nh.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(o=null===(a=this._spec.icon.style)||void 0===a?void 0:a.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,n=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,s=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;B.icon=t,k.appendChild(t),A=n,_+=s,b++}if(null===(d=this._spec.nameLabel)||void 0===d?void 0:d.visible){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const n=i.AABBBounds,s=null!==(p=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==p?p:0,r=null!==(g=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&h(t[this.valueField])){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const n=i.AABBBounds,s=null!==(m=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==m?m:0,r=null!==(y=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:i};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Nb(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var n,s,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:u}=i[a],d=t[a],p=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),g=this._spec.space||0,f=d.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,n;if(t){const s=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=s.x2-s.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(n=s.x2-s.x1)&&void 0!==n?n:0,2!==e&&(m+=g)}})),null==c||c.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==u||u.setAttributes({dx:-d.width/2,dy:-d.height/2});const y=this._data.getLatestData()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:d.x+d.width/2-b.x,offsetY:d.y+d.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Db(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Eb(t)}_isRelativeModel(t){var e,i,n;const s=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(n=this._series.getCoordinateHelper())||void 0===n?void 0:n.getCoordinateId();return(null==t?void 0:t.id)===s}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}Vb.type="mapLabel",Vb.specKey="mapLabel",Vb.transformerConstructor=Gb;t.BAR_LINK=Sb,t.Bar3dChart=of,t.Bar3dChartSpecTransformer=yi,t.Bar3dSeries=nf,t.Bar3dSeriesSpecTransformer=nd,t.BarLinkComponent=Tb,t.ConversionFunnelChart=ni,t.ConversionFunnelSeries=si,t.DefaultBandWidth=6,t.Funnel3dChart=gf,t.Funnel3dSeries=df,t.Funnel3dSeriesSpecTransformer=hf,t.Histogram3dChart=ff,t.ImageCloudChart=Wy,t.MapLabelComponent=Vb,t.PictogramChart=Fm,t.PictogramChartSpecTransformer=mm,t.PictogramSeries=Em,t.Pie3dChart=Af,t.Pie3dChartSpecTransformer=mf,t.Pie3dSeries=xf,t.Pie3dSeriesSpecTransformer=vf,t.RangeColumn3dChart=um,t.RangeColumn3dChartSpecTransformer=cm,t.RangeColumn3dSeries=om,t.RangeColumn3dSeriesSpecTransformer=hm,t.RankingBar=me,t.RankingList=Te,t.SERIES_BREAK=gb,t.SequenceScatterKDE=di,t.SequenceScatterLink=oi,t.SequenceScatterPixel=mi,t.SeriesBreakComponent=yb,t.SeriesLabelComponent=Rb,t.WordCloud3dChart=im,t.WordCloud3dChartSpecTransformer=em,t.WordCloud3dSeries=Jf,t.appendBarLinkConfig=function(t,e){t.customMark=j(t.customMark).filter((t=>t.componentType!==Sb)),t.customMark.push(Mb(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=j(t.customMark).filter((t=>t.componentType!==gb)),t.customMark.push(vb(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,n,s;if(t.customMark=j(t.customMark).filter((t=>t.componentType!==Bb)),e||(e=null!==(s=null!==(i=M(t,Bb))&&void 0!==i?i:M(null===(n=t.series)||void 0===n?void 0:n[0],Bb))&&void 0!==s?s:{}),e.visible){const{position:i="end"}=e,n=Ve(e,["position"]);t.customMark.push(Ob(i,n))}},t.clearSVGSource=function(){ym.clear(),bm=null},t.getBarLinkConfig=Mb,t.getSVGSource=_m,t.getSeriesBreakConfig=vb,t.getSeriesLabelConfig=Ob,t.register3DPlugin=ed,t.registerAxis3dPlugin=()=>{ed(),af(),(()=>{e.registerCartesianBandAxis();const t=e.Factory.getComponentInKey(e.CartesianBandAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianLinearAxis();const t=e.Factory.getComponentInKey(e.CartesianLinearAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianTimeAxis();const t=e.Factory.getComponentInKey(e.CartesianTimeAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianSymlogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),sm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianLogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),sm)}),F(t,rm)})()},t.registerBar3dChart=()=>{ed(),af(),sf(),e.Factory.registerChart(of.type,of)},t.registerBar3dSeries=sf,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(Sb,(t=>new Tb(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([ni]),i.useSeries([si]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),pf(),e.Factory.registerChart(gf.type,gf)},t.registerFunnel3dSeries=pf,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),sf(),e.Factory.registerChart(ff.type,ff)},t.registerImageCloudChart=()=>{Ny(),e.Factory.registerChart(Wy.type,Wy)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([Vb])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Dm(),e.Factory.registerChart(Fm.type,Fm)},t.registerPictogramSeries=Dm,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),_f(),e.Factory.registerChart(Af.type,Af)},t.registerPie3dSeries=_f,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),lm(),e.Factory.registerChart(um.type,um)},t.registerRangeColumn3dSeries=lm,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([me])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.BarChart])},t.registerSVGSource=vm,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([di,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([oi,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([mi,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new yb(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Rb(t)))},t.registerWordCloud3dChart=nm,t.registerWordCloud3dSeries=Qf,t.registerWordCloudShape3dChart=()=>{ed(),tm(),nm()},t.registerWordCloudShape3dSeries=tm,t.svgSourceMap=ym,t.unregisterSVGSource=xm}));