@ecan-bi/pivot-table 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/index.es.js +49016 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +307 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/style.css +2 -0
- package/package.json +78 -0
- package/types/components.d.ts +1 -0
- package/types/env.d.ts +9 -0
- package/types/index.d.ts +6 -0
- package/types/pivotTable/PivotTable.vue.d.ts +177 -0
- package/types/pivotTable/index.d.ts +177 -0
- package/types/pivotTable/props.d.ts +120 -0
- package/types/utils/util.d.ts +23 -0
- package/types/utils/withInstall.d.ts +5 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
/*! @ecan-bi/pivot-table@1.0.80 */
|
|
2
|
+
(function($n,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("vue"),require("dayjs"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es"],ft):($n=typeof globalThis<"u"?globalThis:$n||self,ft($n["@ecan-bi/pivot-table"]={},$n.Vue))})(this,function($n,ft){"use strict";const f1=(n,t)=>{if(n.install=e=>{for(const i of[n,...Object.values(t??{})])e.component(i.name,i)},t)for(const[e,i]of Object.entries(t))n[e]=i;return n},p1=(n=>{const t={};if(typeof n=="object"&&n!=null)for(const e in n){const i=n[e];t[e]={type:i==null?void 0:i.constructor,default:i}}return t})({id:"",name:"透视表",keyName:"透视表",width:"800px",height:"400px",type:"ecanPivotTable",graphicConfig:{},dataType:"indicator",data:[],position:"absolute",top:"0px",left:"0px",zIndex:1,events:[],dimensionList:[],indicatorList:[]}),yf=(n,t)=>Object.prototype.hasOwnProperty.call(n,t);class Te{static GenAutoIncrementId(){return Te.auto_increment_id++}}Te.auto_increment_id=0;class Bt{constructor(t){this.id=Te.GenAutoIncrementId(),this.registry=t}}const Tl="named",wf="inject",Sf="multi_inject",xf="inversify:tagged",Af="inversify:paramtypes";class Od{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Tl?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}const Qo=function(n){var t;return function(e){const i=typeof Symbol=="function",o=i&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:"@@toPrimitive",r=Object.getPrototypeOf(Function),s=(typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),l=new WeakMap;function a(B,H,E,F){if(!y(E))throw new TypeError;return m(B,H,E,F)}function h(B,H,E){if(!y(H))throw new TypeError;return w(E)||(E=T(E)),g(B,H,E)}function d(B,H,E){if(!y(H))throw new TypeError;return w(E)||(E=T(E)),f(B,H,E)}function u(B,H,E){if(!y(H))throw new TypeError;return w(E)||(E=T(E)),p(B,H,E)}function c(B,H,E){let F=l.get(B);if(w(F)){if(!E)return;F=new s,l.set(B,F)}let L=F.get(H);if(w(L)){if(!E)return;L=new s,F.set(H,L)}return L}function g(B,H,E){if(f(B,H,E))return!0;const F=k(H);return!C(F)&&g(B,F,E)}function f(B,H,E){const F=c(H,E,!1);return!w(F)&&A(F.has(B))}function p(B,H,E){if(f(B,H,E))return v(B,H,E);const F=k(H);return C(F)?void 0:p(B,F,E)}function v(B,H,E){const F=c(H,E,!1);if(!w(F))return F.get(B)}function m(B,H,E,F){c(E,F,!0).set(B,H)}function b(B){if(B===null)return 1;switch(typeof B){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return B===null?1:6;default:return 6}}function w(B){return B===void 0}function C(B){return B===null}function _(B){return typeof B=="symbol"}function y(B){return typeof B=="object"?B!==null:typeof B=="function"}function x(B,H){switch(b(B)){case 0:case 1:case 2:case 3:case 4:case 5:return B}const E=H===3?"string":H===5?"number":"default",F=P(B,o);if(F!==void 0){const L=F.call(B,E);if(y(L))throw new TypeError;return L}return S(B,E==="default"?"number":E)}function S(B,H){if(H==="string"){const E=B.toString;if(M(E)){const L=E.call(B);if(!y(L))return L}const F=B.valueOf;if(M(F)){const L=F.call(B);if(!y(L))return L}}else{const E=B.valueOf;if(M(E)){const L=E.call(B);if(!y(L))return L}const F=B.toString;if(M(F)){const L=F.call(B);if(!y(L))return L}}throw new TypeError}function A(B){return!!B}function R(B){return""+B}function T(B){const H=x(B,3);return _(H)?H:R(H)}function M(B){return typeof B=="function"}function P(B,H){const E=B[H];if(E!=null){if(!M(E))throw new TypeError;return E}}function k(B){const H=Object.getPrototypeOf(B);if(typeof B!="function"||B===r||H!==r)return H;const E=B.prototype,F=E&&Object.getPrototypeOf(E);if(F==null||F===Object.prototype)return H;const L=F.constructor;return typeof L!="function"||L===B?H:L}e("defineMetadata",a),e("hasMetadata",h),e("hasOwnMetadata",d),e("getMetadata",u)}((t=n,function(e,i){typeof t[e]!="function"&&Object.defineProperty(t,e,{configurable:!0,writable:!0,value:i})})),n}({});function v1(n,t,e,i){const o=[i];let r={};Qo.hasOwnMetadata(n,t)&&(r=Qo.getMetadata(n,t));let s=r[e];s===void 0&&(s=[]),s.push(...o),r[e]=s,Qo.defineMetadata(n,r,t)}function m1(n,t,e,i){v1(xf,n,e.toString(),i)}function Rf(n){return(t,e,i)=>{m1(t,e,i,n)}}function Tf(n){return t=>(e,i,o)=>Rf(new Od(n,t))(e,i,o)}const Ot=Tf(wf),Mf=Tf(Sf);function st(){return function(n){return Qo.defineMetadata(Af,null,n),n}}function Ie(n){return Rf(new Od(Tl,n))}const Co={Singleton:"Singleton",Transient:"Transient"},Yn={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};class Wd{constructor(t,e){this.id=Te.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Yn.Invalid,this.constraint=i=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Wd(this.serviceIdentifier,this.scope);return t.activated=t.scope===Co.Singleton&&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 b1{getConstructorMetadata(t){return{compilerGeneratedMetadata:Qo.getMetadata(Af,t),userGeneratedMetadata:Qo.getMetadata(xf,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const C1=(n=>t=>{const e=i=>{if(i==null)return!1;if(i.key===n&&i.value===t)return!0;if(i.constructorArgsMetadata==null)return!1;const o=i.constructorArgsMetadata;for(let r=0;r<o.length;r++)if(o[r].key===n&&o[r].value===t)return!0;return!1};return e.metaData=new Od(n,t),e})(Tl);class Ml{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Co.Singleton,this}inTransientScope(){return this._binding.scope=Co.Transient,this}whenTargetNamed(t){return this._binding.constraint=C1(t),this}}class _1{constructor(t){this._binding=t}to(t){return this._binding.type=Yn.Instance,this._binding.implementationType=t,new Ml(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Yn.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ml(this._binding)}toConstantValue(t){return this._binding.type=Yn.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Co.Singleton,new Ml(this._binding)}toFactory(t){return this._binding.type=Yn.Factory,this._binding.factory=t,this._binding.scope=Co.Singleton,new Ml(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}let y1=class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Co.Transient,this.options=e,this.id=Te.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new b1}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 o=this._getNotAllArgs(t,!1,e,i);return this._get(o)}getNamed(t,e){return this.getTagged(t,Tl,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Wd(t,e),o=this._bindingDictionary.get(t)||[];return o.push(i),this._bindingDictionary.set(t,o),new _1(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(s,l)=>{s._binding.moduleId=l},e=s=>l=>{const a=this.bind(l);return t(a,s),a},i=()=>s=>this.unbind(s),o=()=>s=>this.isBound(s),r=s=>l=>{const a=this.rebind(l);return t(a,s),a};return s=>({bindFunction:e(s),isboundFunction:o(),rebindFunction:r(s),unbindFunction:i(),unbindAsyncFunction:l=>null})}_getNotAllArgs(t,e,i,o){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:o}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter(i=>i.constraint(t)).forEach(i=>{e.push(this._resolveFromBinding(i))}),t.isMultiInject||e.length!==1?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),o=Object.keys(i),r=[];for(let s=0;s<o.length;s++){const l=i[s],a={};l.forEach(g=>{a[g.key]=g.value});const h={inject:a[wf],multiInject:a[Sf]},d=h.inject||h.multiInject,u={serviceIdentifier:d,constructorArgsMetadata:l},c={injectIdentifier:d,metadata:l,bindings:this._bindingDictionary.get(d).filter(g=>g.constraint(u))};r.push(c)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Yn.ConstantValue:case Yn.Function:e=t.cache;break;case Yn.Instance: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(e=>e.bindings.length>1?e.bindings.map(i=>this._resolveFromBinding(i)):this._resolveFromBinding(e.bindings[0]))}_saveToScope(t,e){t.scope===Co.Singleton&&(t.cache=e,t.activated=!0)}};const Me=Symbol("ContributionProvider");class Bf{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function ei(n,t){n(Me).toDynamicValue(({container:e})=>new Bf(t,e)).inSingletonScope().whenTargetNamed(t)}function w1(n,t){n(Me).toDynamicValue(({container:e})=>new Bf(t,e)).whenTargetNamed(t)}class S1{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i=typeof t=="string"?t.trim():t.name;i&&(this.taps=this.taps.filter(o=>!(o.name===i&&(!e||o.fn===e))))}_parseOptions(t,e,i){let o;if(typeof e=="string")o={name:e.trim()};else if(typeof e!="object"||e===null)throw new Error("Invalid tap options");if(typeof o.name!="string"||o.name==="")throw new Error("Missing name for tap");return o=Object.assign({type:t,fn:i},o),o}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;typeof t.before=="string"?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;typeof t.stage=="number"&&(i=t.stage);let o=this.taps.length;for(;o>0;){o--;const r=this.taps[o];this.taps[o+1]=r;const s=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(s>i)){o++;break}}this.taps[o]=t}}class gi extends S1{call(...t){this.taps.map(e=>e.fn).forEach(e=>e(...t))}}const Bl=Symbol.for("EnvContribution"),Nd=Symbol.for("VGlobal");var x1=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},A1=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},Pf=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Vd=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(n){this._env||this.setEnv("browser"),this.envContribution.supportEvent=n}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(n){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=n}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(n){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=n}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(n){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=n}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(n){this._env||this.setEnv("browser"),this.envContribution.applyStyles=n}constructor(n){this.contributions=n,this.id=Te.GenAutoIncrementId(),this.hooks={onSetEnv:new gi(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(n){const t=[];if(this.contributions.getContributions().forEach(e=>{const i=e.configure(this,n);i&&i.then&&t.push(i)}),t.length)return Promise.all(t)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(n,t){if(t&&t.force===!0||this._env!==n)return this.deactiveCurrentEnv(),this.activeEnv(n,t)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(n,t){const e=this._env;this._env=n;const i=this.bindContribution(t);if(i&&i.then)return i.then(()=>{this.envParams=t,this.hooks.onSetEnv.call(e,n,this)});this.envParams=t,this.hooks.onSetEnv.call(e,n,this)}setActiveEnvContribution(n){this.envContribution=n}createCanvas(n){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(n)}createOffscreenCanvas(n){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(n)}releaseCanvas(n){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(n)}addEventListener(n,t,e){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(n,t,e)}removeEventListener(n,t,e){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(n,t,e)}dispatchEvent(n){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(n)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(n){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(n):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(n,t){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(n,t):null}loadImage(n){return this._env||this.setEnv("browser"),this.envContribution.loadImage(n)}loadSvg(n){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(n)}loadJson(n){return this._env||this.setEnv("browser"),this.envContribution.loadJson(n)}loadArrayBuffer(n){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(n)}loadBlob(n){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(n)}isChrome(){return this._isChrome!=null||(this._env||this.setEnv("browser"),this._isChrome=this._env==="browser"&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return this._isSafari!=null||(this._env||this.setEnv("browser"),this._isSafari=this._env==="browser"&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(n){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(n)}removeDom(n){return this._env||this.setEnv("browser"),this.envContribution.removeDom(n)}createDom(n){return this._env||this.setEnv("browser"),this.envContribution.createDom(n)}updateDom(n,t){return this._env||this.setEnv("browser"),this.envContribution.updateDom(n,t)}getElementTop(n,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(n,t)}getElementLeft(n,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(n,t)}getElementTopLeft(n,t=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(n,t)}};Vd=x1([st(),Pf(0,Ot(Me)),Pf(0,Ie(Bl)),A1("design:paramtypes",[Object])],Vd);var _o={},R1={get exports(){return _o},set exports(n){_o=n}};(function(n){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function o(a,h,d){this.fn=a,this.context=h,this.once=d||!1}function r(a,h,d,u,c){if(typeof d!="function")throw new TypeError("The listener must be a function");var g=new o(d,u||a,c),f=e?e+h:h;return a._events[f]?a._events[f].fn?a._events[f]=[a._events[f],g]:a._events[f].push(g):(a._events[f]=g,a._eventsCount++),a}function s(a,h){--a._eventsCount===0?a._events=new i:delete a._events[h]}function l(){this._events=new i,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],d,u;if(this._eventsCount===0)return h;for(u in d=this._events)t.call(d,u)&&h.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(d)):h},l.prototype.listeners=function(h){var d=e?e+h:h,u=this._events[d];if(!u)return[];if(u.fn)return[u.fn];for(var c=0,g=u.length,f=new Array(g);c<g;c++)f[c]=u[c].fn;return f},l.prototype.listenerCount=function(h){var d=e?e+h:h,u=this._events[d];return u?u.fn?1:u.length:0},l.prototype.emit=function(h,d,u,c,g,f){var p=e?e+h:h;if(!this._events[p])return!1;var v=this._events[p],m=arguments.length,b,w;if(v.fn){switch(v.once&&this.removeListener(h,v.fn,void 0,!0),m){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,u),!0;case 4:return v.fn.call(v.context,d,u,c),!0;case 5:return v.fn.call(v.context,d,u,c,g),!0;case 6:return v.fn.call(v.context,d,u,c,g,f),!0}for(w=1,b=new Array(m-1);w<m;w++)b[w-1]=arguments[w];v.fn.apply(v.context,b)}else{var C=v.length,_;for(w=0;w<C;w++)switch(v[w].once&&this.removeListener(h,v[w].fn,void 0,!0),m){case 1:v[w].fn.call(v[w].context);break;case 2:v[w].fn.call(v[w].context,d);break;case 3:v[w].fn.call(v[w].context,d,u);break;case 4:v[w].fn.call(v[w].context,d,u,c);break;default:if(!b)for(_=1,b=new Array(m-1);_<m;_++)b[_-1]=arguments[_];v[w].fn.apply(v[w].context,b)}}return!0},l.prototype.on=function(h,d,u){return r(this,h,d,u,!1)},l.prototype.once=function(h,d,u){return r(this,h,d,u,!0)},l.prototype.removeListener=function(h,d,u,c){var g=e?e+h:h;if(!this._events[g])return this;if(!d)return s(this,g),this;var f=this._events[g];if(f.fn)f.fn===d&&(!c||f.once)&&(!u||f.context===u)&&s(this,g);else{for(var p=0,v=[],m=f.length;p<m;p++)(f[p].fn!==d||c&&!f[p].once||u&&f[p].context!==u)&&v.push(f[p]);v.length?this._events[g]=v.length===1?v[0]:v:s(this,g)}return this},l.prototype.removeAllListeners=function(h){var d;return h?(d=e?e+h:h,this._events[d]&&s(this,d)):(this._events=new i,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=e,l.EventEmitter=l,n.exports=l})(R1);const tr=(n,t)=>Object.prototype.toString.call(n)===`[object ${t}]`,ze=(n,t=!1)=>t?typeof n=="boolean":n===!0||n===!1||tr(n,"Boolean"),jt=n=>typeof n=="function",ct=n=>n==null,I=n=>n!=null,$t=n=>{const t=typeof n;return n!==null&&t==="object"||t==="function"},T1=n=>typeof n=="object"&&n!==null,er=function(n){if(!T1(n)||!tr(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;let t=n;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t},be=n=>n===void 0,Qt=(n,t=!1)=>{const e=typeof n;return t?e==="string":e==="string"||tr(n,"String")},it=n=>Array.isArray?Array.isArray(n):tr(n,"Array"),jd=function(n){return n!==null&&typeof n!="function"&&Number.isFinite(n.length)},Hf=n=>tr(n,"Date"),nt=(n,t=!1)=>{const e=typeof n;return t?e==="number":e==="number"||tr(n,"Number")},ie=n=>nt(n)&&Number.isFinite(n),M1=n=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(n),B1=n=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(n),P1=n=>({}).toString.call(n).replace(/^\[object /,"").replace(/]$/,""),H1=Object.prototype,E1=function(n){const t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||H1)},L1=Object.prototype.hasOwnProperty;function Et(n){if(ct(n))return!0;if(jd(n))return!n.length;const t=P1(n);if(t==="Map"||t==="Set")return!n.size;if(E1(n))return!Object.keys(n).length;for(const e in n)if(L1.call(n,e))return!1;return!0}const De=(n,t,e)=>{const i=Qt(t)?t.split("."):t;for(let o=0;o<i.length;o++)n=n?n[i[o]]:void 0;return n===void 0?e:n},F1=Object.prototype.hasOwnProperty,Ef=(n,t)=>n!=null&&F1.call(n,t);function Be(n,t,e){let i;if(!I(n)||typeof n!="object"||t&&t(n))return n;const o=it(n),r=n.length;i=o?new Array(r):typeof n=="object"?{}:ze(n)||nt(n)||Qt(n)?n:Hf(n)?new Date(+n):void 0;const s=o?void 0:Object.keys(Object(n));let l=-1;if(i)for(;++l<(s||n).length;){const a=s?s[l]:l,h=n[a];e&&e.includes(a.toString())?i[a]=h:i[a]=Be(h,t,e)}return i}function Lf(n,t,e=!1,i=!1){if(t){if(n===t)return;if(I(t)&&typeof t=="object"){const o=Object(t),r=[];for(const a in o)r.push(a);let{length:s}=r,l=-1;for(;s--;){const a=r[++l];!I(o[a])||typeof o[a]!="object"||i&&it(n[a])?Ff(n,a,o[a]):k1(n,t,a,e,i)}}}}function k1(n,t,e,i=!1,o=!1){const r=n[e],s=t[e];let l=t[e],a=!0;if(it(s)){if(i)l=[];else if(it(r))l=r;else if(jd(r)){l=new Array(r.length);let h=-1;const d=r.length;for(;++h<d;)l[h]=r[h]}}else er(s)?(l=r??{},typeof r!="function"&&typeof r=="object"||(l={})):a=!1;a&&Lf(l,s,i,o),Ff(n,e,l)}function Ff(n,t,e){(e!==void 0&&!I1(n[t],e)||e===void 0&&!(t in n))&&(n[t]=e)}function I1(n,t){return n===t||Number.isNaN(n)&&Number.isNaN(t)}function dt(n,...t){let e=-1;const i=t.length;for(;++e<i;)Lf(n,t[e],!0);return n}function z1(n,t){if(!n||!er(n))return n;const e={};return Object.keys(n).forEach(i=>{const o=n[i];let r=!1;t.forEach(s=>{(Qt(s)&&s===i||s instanceof RegExp&&i.match(s))&&(r=!0)}),r||(e[i]=o)}),e}function kf(n){return Object.prototype.toString.call(n)}function If(n){return Object.keys(n)}function es(n,t,e){if(n===t)return!0;if(typeof n!=typeof t||n==null||t==null)return!1;if(Number.isNaN(n)&&Number.isNaN(t))return!0;if(kf(n)!==kf(t))return!1;if(jt(n))return!!(e!=null&&e.skipFunction);if(typeof n!="object")return!1;if(it(n)){if(n.length!==t.length)return!1;for(let r=n.length-1;r>=0;r--)if(!es(n[r],t[r],e))return!1;return!0}if(!er(n))return!1;const i=If(n),o=If(t);if(i.length!==o.length)return!1;i.sort(),o.sort();for(let r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(let r=i.length-1;r>=0;r--){const s=i[r];if(!es(n[s],t[s],e))return!1}return!0}function D1(n){if(!n)return[];if(Object.keys)return Object.keys(n);const t=[];for(const e in n)n.hasOwnProperty(e)&&t.push(e);return t}function O1(n,t,e){const i=D1(t);for(let o=0;o<i.length;o++){const r=i[o];(e?t[r]!=null:n[r]==null)&&(n[r]=t[r])}return n}function Gd(n,t,e=!0){if(n="prototype"in n?n.prototype:n,t="prototype"in t?t.prototype:t,Object.getOwnPropertyNames){const i=Object.getOwnPropertyNames(t);for(let o=0;o<i.length;o++){const r=i[o];r!=="constructor"&&(e?t[r]!=null:n[r]==null)&&(n[r]=t[r])}}else O1(n,t,e)}function Ud(n){return I(n)?it(n)?n:[n]:[]}function yo(n){if(jd(n))return n[n.length-1]}const Kd=(n,t)=>{var e;if(n.length===0)return;let i=n[0];for(let o=1;o<n.length;o++){const r=n[o];((e=t==null?void 0:t(r,i))!==null&&e!==void 0?e:r-i>0)&&(i=r)}return i},Pl=(n,t)=>{var e;if(n.length===0)return;let i=n[0];for(let o=1;o<n.length;o++){const r=n[o];((e=t==null?void 0:t(r,i))!==null&&e!==void 0?e:r-i<0)&&(i=r)}return i};function is(n,t){if(!it(n)||!it(t)||n.length!==t.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==t[e])return!1;return!0}function $d(n){if(!it(n))return[n];const t=[];for(const e of n)t.push(...$d(e));return t}function W1(n,t,e){I(t)||(t=n,n=0),I(e)||(e=1);let i=-1;const o=0|Math.max(0,Math.ceil((t-n)/e)),r=new Array(o);for(;++i<o;)r[i]=n+i*e;return r}function N1(n,t){return n<t?-1:n>t?1:n>=t?0:NaN}function ns(n){return Number(n)}const V1=typeof console<"u";function Hl(n,t,e){const i=[t].concat([].slice.call(e));V1&&console[n].apply(console,i)}var Xi;(function(n){n[n.None=0]="None",n[n.Error=1]="Error",n[n.Warn=2]="Warn",n[n.Info=3]="Info",n[n.Debug=4]="Debug"})(Xi||(Xi={}));class ne{static getInstance(t,e){return ne._instance&&nt(t)?ne._instance.level(t):ne._instance||(ne._instance=new ne(t,e)),ne._instance}static setInstance(t){return ne._instance=t}static setInstanceLevel(t){ne._instance?ne._instance.level(t):ne._instance=new ne(t)}static clearInstance(){ne._instance=null}constructor(t=Xi.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(i=>i===t);e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach(e=>e(...t))}canLogInfo(){return this._level>=Xi.Info}canLogDebug(){return this._level>=Xi.Debug}canLogError(){return this._level>=Xi.Error}canLogWarn(){return this._level>=Xi.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=Xi.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):Hl((e=this._method)!==null&&e!==void 0?e:"error","ERROR",t)),this}warn(...t){return this._level>=Xi.Warn&&Hl(this._method||"warn","WARN",t),this}info(...t){return this._level>=Xi.Info&&Hl(this._method||"log","INFO",t),this}debug(...t){return this._level>=Xi.Debug&&Hl(this._method||"log","DEBUG",t),this}}ne._instance=null;function j1(n,t,e=0,i){for(ct(i)&&(i=n.length);e<i;){const o=e+i>>>1;N1(n[o],t)>0?i=o:e=o+1}return e}const G1=(n,t,e)=>{let i=n,o=t;for(;i<o;){const r=Math.floor((i+o)/2);e(r)>=0?o=r:i=r+1}return i},U1=1e-10,K1=1e-10;function qi(n,t,e=K1,i=U1){const o=i,r=e*Math.max(n,t);return Math.abs(n-t)<=Math.max(o,r)}function zf(n,t,e,i){return n>t&&!qi(n,t,e,i)}function Df(n,t,e,i){return n<t&&!qi(n,t,e,i)}const os=n=>{let t=null,e=null;return(...i)=>(t&&i.every((o,r)=>o===t[r])||(t=i,e=n(...i)),e)},bi=function(n,t,e){return n<t?t:n>e?e:n},wo=(n,t,e)=>{let[i,o]=n;o<i&&(i=n[1],o=n[0]);const r=o-i;return r>=e-t?[t,e]:(i=Math.min(Math.max(i,t),e-r),[i,i+r])};function Yd(n,t){let e;return n>t&&(e=n,n=t,t=e),i=>Math.max(n,Math.min(t,i))}let El=!1;try{El=typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"}catch{El=!1}function Of(n,t,e){let i,o,r,s,l,a,h=0,d=!1,u=!1,c=!0;const g=!t&&t!==0&&El;if(typeof n!="function")throw new TypeError("Expected a function");function f(C){const _=i,y=o;return i=o=void 0,h=C,s=n.apply(y,_),s}function p(C,_){return g?(cancelAnimationFrame(l),requestAnimationFrame(C)):setTimeout(C,_)}function v(C){const _=C-a;return a===void 0||_>=t||_<0||u&&C-h>=r}function m(){const C=Date.now();if(v(C))return b(C);l=p(m,function(_){const y=_-h,x=t-(_-a);return u?Math.min(x,r-y):x}(C))}function b(C){return l=void 0,c&&i?f(C):(i=o=void 0,s)}function w(...C){const _=Date.now(),y=v(_);if(i=C,o=this,a=_,y){if(l===void 0)return function(x){return h=x,l=p(m,t),d?f(x):s}(a);if(u)return l=p(m,t),f(a)}return l===void 0&&(l=p(m,t)),s}return t=+t||0,$t(e)&&(d=!!e.leading,u="maxWait"in e,u&&(r=Math.max(ie(e.maxWait)?e.maxWait:0,t)),c="trailing"in e?!!e.trailing:c),w.cancel=function(){l!==void 0&&function(C){if(g)return cancelAnimationFrame(C);clearTimeout(C)}(l),h=0,i=a=o=l=void 0},w.flush=function(){return l===void 0?s:b(Date.now())},w.pending=function(){return l!==void 0},w}El=!1;function Wf(n,t,e){let i=!0,o=!0;if(typeof n!="function")throw new TypeError("Expected a function");return $t(e)&&(i="leading"in e?!!e.leading:i,o="trailing"in e?!!e.trailing:o),Of(n,t,{leading:i,trailing:o,maxWait:t})}function Ll(n,t){return e=>n*(1-e)+t*e}function $1(n,t){return function(e){return Math.round(n*(1-e)+t*e)}}function Y1(n,t){const e=n.valueOf(),i=t.valueOf(),o=new Date;return r=>(o.setTime(e*(1-r)+i*r),o)}const ae=1e-12,oe=Math.PI,Ei=oe/2,Ye=2*oe,Gt=2*Math.PI,Jt=Math.abs,Xt=Math.atan2,Pe=Math.cos,Xn=Math.max,ii=Math.min,pe=Math.sin,Zi=Math.sqrt,ir=Math.pow;function X1(n){return n>1?0:n<-1?oe:Math.acos(n)}function Nf(n){return n>=1?Ei:n<=-1?-Ei:Math.asin(n)}function Vf(n,t,e,i,o){let r=e,s=i;return typeof n=="number"&&typeof e=="number"&&(r=(1-o)*n+o*e),typeof t=="number"&&typeof i=="number"&&(s=(1-o)*t+o*i),{x:r,y:s}}function q1(n,t){return n[0]*t[1]-n[1]*t[0]}class ye{constructor(t=0,e=0,i,o){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=o}clone(){return new ye(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 nt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return nt(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 Rn{static distancePP(t,e){return Zi(ir(t.x-e.x,2)+ir(t.y-e.y,2))}static distanceNN(t,e,i,o){return Zi(ir(t-i,2)+ir(e-o,2))}static distancePN(t,e,i){return Zi(ir(e-t.x,2)+ir(i-t.y,2))}static pointAtPP(t,e,i){return new ye((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Li(n){return n*(Math.PI/180)}function Z1(n){return 180*n/Math.PI}const J1=(n=0)=>{if(n<0)for(;n<-Ye;)n+=Ye;else if(n>0)for(;n>Ye;)n-=Ye;return n};function Q1(n,t,e){return t?{x:n.x+t*Math.cos(e),y:n.y+t*Math.sin(e)}:{x:n.x,y:n.y}}function jf(n){for(;n<0;)n+=2*Math.PI;for(;n>=2*Math.PI;)n-=2*Math.PI;return n}function Gf(n,t,e){if(n===null)return t;if(t===null)return n;const{x11:i,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=Xd(n,t,e);return i>=a||o<=l||r>=d||s<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(i,l),y1:Math.max(r,h),x2:Math.min(o,a),y2:Math.min(s,d)}}var nr;(function(n){n[n.NONE=0]="NONE",n[n.BBOX1=1]="BBOX1",n[n.BBOX2=2]="BBOX2"})(nr||(nr={}));const Xd=(n,t,e)=>{let i=n.x1,o=n.x2,r=n.y1,s=n.y2,l=t.x1,a=t.x2,h=t.y1,d=t.y2;return e&&(i>o&&([i,o]=[o,i]),r>s&&([r,s]=[s,r]),l>a&&([l,a]=[a,l]),h>d&&([h,d]=[d,h])),{x11:i,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}};function tw(n,t,e){if(!n||!t)return nr.NONE;const{x11:i,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=Xd(n,t,e);return i>l&&o<a&&r>h&&s<d?nr.BBOX1:l>i&&a<o&&h>r&&d<s?nr.BBOX2:nr.NONE}function qd(n,t,e){if(n&&t){if(!e)return!(n.x1>t.x2||n.x2<t.x1||n.y1>t.y2||n.y2<t.y1);const{x11:i,x12:o,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=Xd(n,t,!0);return!(i>a||o<l||r>d||s<h)}return!0}function Zd(n,t){return Math.abs(t[0]*n[0]+t[1]*n[1])}function or({x:n,y:t},e,i={x:0,y:0}){return{x:(n-i.x)*Math.cos(e)-(t-i.y)*Math.sin(e)+i.x,y:(n-i.x)*Math.sin(e)+(t-i.y)*Math.cos(e)+i.y}}function Jd(n){return{x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2}}function Uf(n,t){const e=t?Li(n.angle):n.angle,i=Jd(n);return[or({x:n.x1,y:n.y1},e,i),or({x:n.x2,y:n.y1},e,i),or({x:n.x2,y:n.y2},e,i),or({x:n.x1,y:n.y2},e,i)]}function Kf(n,t,e=!1,i){const o=Uf(n,e),r=Uf(t,e),s=(w,C)=>[C.x-w.x,C.y-w.y];i&&(i.save(),i.fillStyle="red",i.globalAlpha=.6,o.forEach((w,C)=>{C===0?i.moveTo(w.x,w.y):i.lineTo(w.x,w.y)}),i.fill(),i.restore(),i.save(),i.fillStyle="green",i.globalAlpha=.6,r.forEach((w,C)=>{C===0?i.moveTo(w.x,w.y):i.lineTo(w.x,w.y)}),i.fill(),i.restore());const l=Jd(n),a=Jd(t);i&&i.fillRect(l.x,l.y,2,2),i&&i.fillRect(a.x,a.y,2,2);const h=s(l,a),d=s(o[0],o[1]),u=s(o[1],o[2]),c=s(r[0],r[1]),g=s(r[1],r[2]),f=e?Li(n.angle):n.angle;let p=e?Li(90-n.angle):n.angle+Ei;const v=e?Li(t.angle):t.angle;let m=e?Li(90-t.angle):t.angle+Ei;p>Gt&&(p-=Gt),m>Gt&&(m-=Gt);const b=(w,C,_,y)=>{const x=[Math.cos(C),Math.sin(C)];return w+(Zd(x,_)+Zd(x,y))/2>Zd(x,h)};return b((n.x2-n.x1)/2,f,c,g)&&b((n.y2-n.y1)/2,p,c,g)&&b((t.x2-t.x1)/2,v,d,u)&&b((t.y2-t.y1)/2,m,d,u)}const $f=n=>{let t=n.charCodeAt(0),e=n.length===2?n.charCodeAt(1):0,i=t;return 55296<=t&&t<=56319&&56320<=e&&e<=57343&&(t&=1023,e&=1023,i=t<<10|e,i+=65536),i===12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i===8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i===172||i===175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i===161||i===164||167<=i&&i<=168||i===170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i===198||i===208||215<=i&&i<=216||222<=i&&i<=225||i===230||232<=i&&i<=234||236<=i&&i<=237||i===240||242<=i&&i<=243||247<=i&&i<=250||i===252||i===254||i===257||i===273||i===275||i===283||294<=i&&i<=295||i===299||305<=i&&i<=307||i===312||319<=i&&i<=322||i===324||328<=i&&i<=331||i===333||338<=i&&i<=339||358<=i&&i<=359||i===363||i===462||i===464||i===466||i===468||i===470||i===472||i===474||i===476||i===593||i===609||i===708||i===711||713<=i&&i<=715||i===717||i===720||728<=i&&i<=731||i===733||i===735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i===1025||1040<=i&&i<=1103||i===1105||i===8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i===8240||8242<=i&&i<=8243||i===8245||i===8251||i===8254||i===8308||i===8319||8321<=i&&i<=8324||i===8364||i===8451||i===8453||i===8457||i===8467||i===8470||8481<=i&&i<=8482||i===8486||i===8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i===8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i===8658||i===8660||i===8679||i===8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i===8715||i===8719||i===8721||i===8725||i===8730||8733<=i&&i<=8736||i===8739||i===8741||8743<=i&&i<=8748||i===8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i===8776||i===8780||i===8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i===8853||i===8857||i===8869||i===8895||i===8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i===9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i===9711||9733<=i&&i<=9734||i===9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i===9756||i===9758||i===9792||i===9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i===9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i===9955||9960<=i&&i<=9983||i===10045||i===10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i===65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};function Fl(n,t={},e){e||(e=1);const{fontStyle:i=t.fontStyle,fontVariant:o=t.fontVariant,fontWeight:r=t.fontWeight,fontSize:s=t.fontSize,fontFamily:l=t.fontFamily}=n;return(i?i+" ":"")+(o?o+" ":"")+(r?r+" ":"")+s*e+"px "+(l||"sans-serif")}class Oe{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=e??{},this.textSpec=this._initSpec(),I(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=I(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(ct(this._canvas)&&(I(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),ct(this._canvas)&&typeof window<"u"&&window.document!==void 0&&globalThis&&I(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),ct(this._context)&&I(this._canvas)){const t=this._canvas.getContext("2d");I(t)&&(t.save(),t.font=Fl(this.textSpec),this._contextSaved=!0,this._context=t)}return!ct(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:o={}}=this._option,{fontStyle:r=o.fontStyle,fontVariant:s=o.fontVariant,fontWeight:l=(t=o.fontWeight)!==null&&t!==void 0?t:"normal",fontSize:a=(e=o.fontSize)!==null&&e!==void 0?e:12,fontFamily:h=(i=o.fontFamily)!==null&&i!==void 0?i:"sans-serif",align:d,textAlign:u=d??"center",baseline:c,textBaseline:g=c??"middle",ellipsis:f,limit:p}=this._userSpec;let{lineHeight:v=a}=this._userSpec;if(Qt(v)&&v[v.length-1]==="%"){const m=Number.parseFloat(v.substring(0,v.length-1))/100;v=a*m}return{fontStyle:r,fontVariant:s,fontFamily:h,fontSize:a,fontWeight:l,textAlign:u,textBaseline:g,ellipsis:f,limit:p,lineHeight:v}}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(ct(t))return{width:0,height:0};if(ct(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:o,textAlign:r,textBaseline:s,ellipsis:l,limit:a,lineHeight:h}=this.textSpec;let d;try{const u=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:o,textAlign:r,textBaseline:s,ellipsis:!!l,maxLineWidth:a||1/0,lineHeight:h});d={width:u.width(),height:u.height()}}catch{this._notSupportVRender=!0,d=this.measureWithNaiveCanvas(t)}return d}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:o,lineHeight:r}=this.textSpec;return{width:i.width,height:(e=r)!==null&&e!==void 0?e:o}}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 o=t[i];let r=this._measureSpecialChar(o);ct(r)&&Oe.NUMBERS_CHAR_SET.includes(o)&&(r=this._measureNumberChar()),ct(r)&&["F","W"].includes($f(o))&&(r=this._measureFullSizeChar()),ct(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:o,lineHeight:r}=this.textSpec;for(let s=0;s<t.length;s++){const l=t[s],a=["F","W"].includes($f(l))?1:.53;i.width+=a*o}return i.height=(e=r)!==null&&e!==void 0?e:o,i}_measureReduce(t,e){var i;const{fontSize:o,lineHeight:r}=this.textSpec,s={width:0,height:0};if(ct(t))return s;if(it(t)){const l=t.filter(I).map(a=>a.toString());return l.length===0?s:l.length===1?e(l[0]):{width:l.reduce((a,h)=>Math.max(a,e(h).width),0),height:l.length*(((i=r)!==null&&i!==void 0?i:o)+1)+1}}return e(t.toString())}_measureNumberChar(){if(ct(this._numberCharSize)){const t=this._standardMethod(Oe.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Oe.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return ct(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Oe.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(ct(this._letterCharSize)){const t=this._standardMethod(Oe.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Oe.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return I(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){I(this._canvas)&&(this._canvas=null),I(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Oe.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Oe.NUMBERS_CHAR_SET="0123456789",Oe.FULL_SIZE_CHAR="字";function Qd(n,t,e){const{x1:i,y1:o,x2:r,y2:s}=t;return e.onlyTranslate()?(n!==t&&n.setValue(t.x1,t.y1,t.x2,t.y2),n.translate(e.e,e.f),t):(n.clear(),n.add(e.a*i+e.c*o+e.e,e.b*i+e.d*o+e.f),n.add(e.a*r+e.c*o+e.e,e.b*r+e.d*o+e.f),n.add(e.a*r+e.c*s+e.e,e.b*r+e.d*s+e.f),n.add(e.a*i+e.c*s+e.e,e.b*i+e.d*s+e.f),t)}class Ci{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Ci(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,o=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=o,this}set(t=0,e=0,i=0,o=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),o<e?(this.y2=e,this.y1=o):(this.y1=e,this.y2=o),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 it(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 o=this.rotatedPoints(t,e,i);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[7])}scale(t=0,e=0,i=0,o=0){const r=this.scalePoints(t,e,i,o);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(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 Qd(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:o,y1:r,x2:s,y2:l}=this,a=Math.cos(t),h=Math.sin(t),d=e-e*a+i*h,u=i-e*h-i*a;return[a*o-h*r+d,h*o+a*r+u,a*o-h*l+d,h*o+a*l+u,a*s-h*r+d,h*s+a*r+u,a*s-h*l+d,h*s+a*l+u]}scalePoints(t,e,i,o){const{x1:r,y1:s,x2:l,y2:a}=this;return[t*r+(1-t)*i,e*s+(1-e)*o,t*l+(1-t)*i,e*a+(1-e)*o]}}class he extends Ci{}class ew extends Ci{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return Kf(this,t)}setValue(t=0,e=0,i=0,o=0,r=0){return super.setValue(t,e,i,o),this.angle=r,this}}class He{constructor(t=1,e=0,i=0,o=1,r=0,s=0){this.a=t,this.b=e,this.c=i,this.d=o,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,o,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==o||this.b!==e||this.c!==i)}setValue(t,e,i,o,r,s){return this.a=t,this.b=e,this.c=i,this.d=o,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,o=this.d,r=this.e,s=this.f,l=new He,a=t*o-e*i;return l.a=o/a,l.b=-e/a,l.c=-i/a,l.d=t/a,l.e=(i*s-o*r)/a,l.f=-(t*s-e*r)/a,l}rotate(t){const e=Math.cos(t),i=Math.sin(t),o=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,l=this.b*-i+this.d*e;return this.a=o,this.b=r,this.c=s,this.d=l,this}rotateByCenter(t,e,i){const o=Math.cos(t),r=Math.sin(t),s=(1-o)*e+r*i,l=(1-o)*i-r*e,a=o*this.a-r*this.b,h=r*this.a+o*this.b,d=o*this.c-r*this.d,u=r*this.c+o*this.d,c=o*this.e-r*this.f+s,g=r*this.e+o*this.f+l;return this.a=a,this.b=h,this.c=d,this.d=u,this.e=c,this.f=g,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,o,r,s){return this.multiply(t,e,i,o,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:o,e:r,f:s}=this;return this.a=e,this.b=t,this.c=o,this.d=i,this.e=s,this.f=r,this}multiply(t,e,i,o,r,s){const l=this.a,a=this.b,h=this.c,d=this.d,u=l*t+h*e,c=a*t+d*e,g=l*i+h*o,f=a*i+d*o,p=l*r+h*s+this.e,v=a*r+d*s+this.f;return this.a=u,this.b=c,this.c=g,this.d=f,this.e=p,this.f=v,this}interpolate(t,e){const i=new He;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:o,c:r,d:s,e:l,f:a}=this,h=i*s-o*r,d=s/h,u=-o/h,c=-r/h,g=i/h,f=(r*a-s*l)/h,p=-(i*a-o*l)/h,{x:v,y:m}=t;e.x=v*d+m*c+f,e.y=v*u+m*g+p}onlyTranslate(t=1){return this.a===t&&this.b===0&&this.c===0&&this.d===t}clone(){return new He(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,o=this.d,r=t*o-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!==0||e!==0){const l=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/l):-Math.acos(t/l),s.scaleX=l,s.scaleY=r/l,s.skewX=(t*i+e*o)/r,s.skewY=0}else if(i!==0||o!==0){const l=Math.sqrt(i*i+o*o);s.rotateDeg=Math.PI/2-(o>0?Math.acos(-i/l):-Math.acos(i/l)),s.scaleX=r/l,s.scaleY=l,s.skewX=0,s.skewY=(t*i+e*o)/r}return s.rotateDeg=Z1(s.rotateDeg),s}}function iw(n,t,e,i,o,r,s,l){const a=t.a,h=t.b,d=t.c,u=t.d,c=t.e,g=t.f,f=Pe(s),p=pe(s);let v,m;l?(v=l[0],m=l[1]):(v=e,m=i);const b=v-e,w=m-i,C=a*f+d*p,_=h*f+u*p,y=d*f-a*p,x=u*f-h*p;n.a=o*C,n.b=o*_,n.c=r*y,n.d=r*x,n.e=c+a*v+d*m-C*b-y*w,n.f=g+h*v+u*m-_*b-x*w}class nw{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:o=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let s=0;const l=h=>{s++,t.delete(h)},a=Date.now();return t.forEach((h,d)=>{if(h.timestamp.length<r)return l(d);let u=0;for(;a-h.timestamp[h.timestamp.length-1-u]<o&&(u++,!(u>=r)););if(u<r)return l(d);for(;a-h.timestamp[0]>o;)h.timestamp.shift()}),s}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:o=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>o&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,o=Date.now();t.forEach(r=>{for(;o-r.timestamp[0]>i;)r.timestamp.shift()})}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,o=Date.now();for(;o-t.timestamp[0]>i;)t.timestamp.shift()}}function tu(n,t,e){t/=100,e/=100;const i=(1-Math.abs(2*e-1))*t,o=i*(1-Math.abs(n/60%2-1)),r=e-i/2;let s=0,l=0,a=0;return 0<=n&&n<60?(s=i,l=o,a=0):60<=n&&n<120?(s=o,l=i,a=0):120<=n&&n<180?(s=0,l=i,a=o):180<=n&&n<240?(s=0,l=o,a=i):240<=n&&n<300?(s=o,l=0,a=i):300<=n&&n<360&&(s=i,l=0,a=o),s=Math.round(255*(s+r)),l=Math.round(255*(l+r)),a=Math.round(255*(a+r)),{r:s,g:l,b:a}}function eu(n,t,e){n/=255,t/=255,e/=255;const i=Math.min(n,t,e),o=Math.max(n,t,e),r=o-i;let s=0,l=0,a=0;return s=r===0?0:o===n?(t-e)/r%6:o===t?(e-n)/r+2:(n-t)/r+4,s=Math.round(60*s),s<0&&(s+=360),a=(o+i)/2,l=r===0?0:r/(1-Math.abs(2*a-1)),l=+(100*l).toFixed(1),a=+(100*a).toFixed(1),{h:s,s:l,l:a}}const ow=/^#([0-9a-f]{3,8})$/,Yf={transparent:4294967040},kl={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 Il(n){return((n=Math.max(0,Math.min(255,Math.round(n)||0)))<16?"0":"")+n.toString(16)}function Xf(n){return nt(n)?new li(n>>16,n>>8&255,255&n,1):it(n)?new li(n[0],n[1],n[2]):new li(255,255,255)}function rw(n){return nt(n)?new li(n>>>24,n>>>16&255,n>>>8&255,255&n):it(n)?new li(n[0],n[1],n[2],n[3]):new li(255,255,255,1)}function iu(n){return n<.04045?.0773993808*n:Math.pow(.9478672986*n+.0521327014,2.4)}function nu(n){return n<.0031308?12.92*n:1.055*Math.pow(n,.41666)-.055}const qf=(n,t)=>{const e=ow.exec(n);if(t||e){const i=parseInt(e[1],16),o=e[1].length;return o===3?new li((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):o===6?Xf(i):o===8?new li(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):null}};class _i{static Brighter(t,e=1){return e===1?t:new _i(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return e===1?t:new _i(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof _i?t:new _i(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(I(Yf[t]))return rw(Yf[t]);if(I(kl[t]))return Xf(kl[t]);const e=`${t}`.trim().toLowerCase(),i=qf(e);if(i!==void 0)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const o=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new li(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10),parseFloat(o[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),r=tu(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new li(r.r,r.g,r.b,parseFloat(o[3]))}}constructor(t){const e=_i.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new li(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:o}=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(o*t))),this}add(t){const{r:e,g:i,b:o}=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,o+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:o}=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(o*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 o=this.color.opacity,r=eu(this.color.r,this.color.g,this.color.b),s=tu(ct(t)?r.h:bi(t,0,360),ct(e)?r.s:e>=0&&e<=1?100*e:e,ct(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new li(s.r,s.g,s.b,o),this}setRGB(t,e,i){return!ct(t)&&(this.color.r=t),!ct(e)&&(this.color.g=e),!ct(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=qf(e,!0);return i??this}setColorName(t){const e=kl[t.toLowerCase()];return e!==void 0?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}clone(){return new _i(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=iu(t.color.r),this.color.g=iu(t.color.g),this.color.b=iu(t.color.b),this}copyLinearToSRGB(t){return this.color.r=nu(t.color.r),this.color.g=nu(t.color.g),this.color.b=nu(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class li{constructor(t,e,i,o){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)),I(o)?this.opacity=isNaN(+o)?1:Math.max(0,Math.min(1,+o)):this.opacity=1}formatHex(){return`#${Il(this.r)+Il(this.g)+Il(this.b)+(this.opacity===1?"":Il(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${t===1?"rgb(":"rgba("}${this.r},${this.g},${this.b}${t===1?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:o}=eu(this.r,this.g,this.b);return`${t===1?"hsl(":"hsla("}${e},${i}%,${o}%${t===1?")":`,${t})`}`}toString(){return this.formatHex()}}function sw(n){let t="",e="",i="";const o=n[0]==="#"?1:0;for(let r=o;r<n.length;r++)n[r]!=="#"&&(r<o+2?t+=n[r]:r<o+4?e+=n[r]:r<o+6&&(i+=n[r]));return[parseInt(t,16),parseInt(e,16),parseInt(i,16)]}function lw(n,t,e){return Number((1<<24)+(n<<16)+(t<<8)+e).toString(16).slice(1)}function aw(n,t){const e=n.r,i=t.r,o=n.g,r=t.g,s=n.b,l=t.b,a=n.opacity,h=t.opacity;return d=>{const u=Math.round(e*(1-d)+i*d),c=Math.round(o*(1-d)+r*d),g=Math.round(s*(1-d)+l*d);return new li(u,c,g,a*(1-d)+h*d)}}const hw=Object.freeze(Object.defineProperty({__proto__:null,Color:_i,DEFAULT_COLORS:kl,RGB:li,hexToRgb:sw,hslToRgb:tu,interpolateRgb:aw,rgbToHex:lw,rgbToHsl:eu},Symbol.toStringTag,{value:"Module"}));function gn(n){if(ie(n))return[n,n,n,n];if(it(n)){const t=n.length;if(t===1){const e=n[0];return[e,e,e,e]}if(t===2){const[e,i]=n;return[e,i,e,i]}if(t===3){const[e,i,o]=n;return[e,i,o,i]}if(t===4)return n}if($t(n)){const{top:t=0,right:e=0,bottom:i=0,left:o=0}=n;return[t,e,i,o]}return[0,0,0,0]}function dw(n){try{return n instanceof Element}catch{const e=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],i=Object.keys(n);return e.every(o=>i.includes(o))}}const uw=Ye-1e-8;class ou{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,o,r,s){if(Math.abs(r-o)>uw)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let l,a,h,d,u=1/0,c=-1/0,g=1/0,f=-1/0;function p(v){h=i*Math.cos(v),d=i*Math.sin(v),h<u&&(u=h),h>c&&(c=h),d<g&&(g=d),d>f&&(f=d)}if(p(o),p(r),r!==o)if((o%=Ye)<0&&(o+=Ye),(r%=Ye)<0&&(r+=Ye),r<o&&(s=!s,l=o,o=r,r=l),s)for(r-=Ye,l=o-o%Ei,a=0;a<4&&l>r;++a,l-=Ei)p(l);else for(l=o-o%Ei+Ei,a=0;a<4&&l<r;++a,l+=Ei)p(l);this.bounds.add(t+u,e+g),this.bounds.add(t+c,e+f)}arcTo(t,e,i,o,r){this.bounds.add(t,e)}bezierCurveTo(t,e,i,o,r,s){this.bounds.add(t,e),this.bounds.add(i,o),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,o){this.bounds.add(t,e),this.bounds.add(i,o)}rect(t,e,i,o){this.bounds.add(t,e),this.bounds.add(t+i,e+o)}clear(){this.bounds.clear()}release(...t){}}class cw{constructor(){this.curves=[],this.bounds=new he}getCurveLengths(){return this.curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const gw=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,fw={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},qt={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let ru,Zf,zl,Jf,su,Dl;function pw(n){if(!n)return[];const t=n.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(t===null)return[];let e,i;const o=[];for(let r=0,s=t.length;r<s;r++)if(ru=t[r],Zf=ru.slice(1),zl=ru[0],e=[zl],i=Zf.match(gw),i!==null){for(let l=0,a=i.length;l<a;l++)Jf=i[l],su=parseFloat(Jf),Number.isNaN(su)||e.push(su);if(Dl=fw[zl],e.length-1>Dl){let l,a=zl;for(let h=1,d=e.length;h<d;h+=Dl){l=[a];for(let u=h,c=h+Dl;u<c;u++)l.push(e[u]);o.push(l),a==="m"?a="l":a==="M"&&(a="L")}}else o.push(e)}else o.push(e);return o}var te;(function(n){n[n.NONE=0]="NONE",n[n.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",n[n.UPDATE_SHAPE=2]="UPDATE_SHAPE",n[n.CLEAR_SHAPE=253]="CLEAR_SHAPE",n[n.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",n[n.INIT=179]="INIT",n[n.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",n[n.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",n[n.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",n[n.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",n[n.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",n[n.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",n[n.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",n[n.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"})(te||(te={}));var rs;(function(n){n[n.GLOBAL=1]="GLOBAL",n[n.LOCAL=16]="LOCAL",n[n.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",n[n.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"})(rs||(rs={}));var fi;(function(n){n[n.INIT=0]="INIT",n[n.DEFAULT=1]="DEFAULT",n[n.STATE=2]="STATE",n[n.ANIMATE_BIND=10]="ANIMATE_BIND",n[n.ANIMATE_PLAY=11]="ANIMATE_PLAY",n[n.ANIMATE_START=12]="ANIMATE_START",n[n.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",n[n.ANIMATE_END=14]="ANIMATE_END",n[n.TRANSLATE=20]="TRANSLATE",n[n.TRANSLATE_TO=21]="TRANSLATE_TO",n[n.SCALE=22]="SCALE",n[n.SCALE_TO=23]="SCALE_TO",n[n.ROTATE=24]="ROTATE",n[n.ROTATE_TO=25]="ROTATE_TO"})(fi||(fi={}));var ni;(function(n){n[n.INITIAL=0]="INITIAL",n[n.RUNNING=1]="RUNNING",n[n.PAUSED=2]="PAUSED",n[n.END=3]="END"})(ni||(ni={}));var Ol;(function(n){n[n.NORMAL=0]="NORMAL",n[n.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"})(Ol||(Ol={}));var rr;(function(n){n.wait="wait",n.from="from",n.to="to",n.customAnimate="customAnimate"})(rr||(rr={}));var re;(function(n){n[n.ROW=1]="ROW",n[n.COLUMN=2]="COLUMN"})(re||(re={}));var Wl;(function(n){n[n.CubicBezierCurve=0]="CubicBezierCurve",n[n.QuadraticBezierCurve=1]="QuadraticBezierCurve",n[n.ArcCurve=2]="ArcCurve",n[n.LineCurve=3]="LineCurve",n[n.EllipseCurve=4]="EllipseCurve",n[n.MoveCurve=5]="MoveCurve"})(Wl||(Wl={}));var Ut;(function(n){n[n.beforeFillStroke=0]="beforeFillStroke",n[n.afterFillStroke=1]="afterFillStroke"})(Ut||(Ut={}));function vw(n,t,e,i,o,r,s,l,a){const h=Li(s),d=Math.sin(h),u=Math.cos(h),c=u*(l-n)*.5+d*(a-t)*.5,g=u*(a-t)*.5-d*(l-n)*.5;let f=c*c/((e=Math.abs(e))*e)+g*g/((i=Math.abs(i))*i);f>1&&(f=Math.sqrt(f),e*=f,i*=f);const p=u/e,v=d/e,m=-d/i,b=u/i,w=p*l+v*a,C=m*l+b*a,_=p*n+v*t,y=m*n+b*t;let x=1/((_-w)*(_-w)+(y-C)*(y-C))-.25;x<0&&(x=0);let S=Math.sqrt(x);r===o&&(S=-S);const A=.5*(w+_)-S*(y-C),R=.5*(C+y)+S*(_-w),T=Math.atan2(C-R,w-A);let M=Math.atan2(y-R,_-A)-T;M<0&&r===1?M+=Ye:M>0&&r===0&&(M-=Ye);const P=Math.ceil(Math.abs(M/(Ei+.001))),k=[];for(let B=0;B<P;++B){const H=T+B*M/P,E=T+(B+1)*M/P;k[B]=[A,R,H,E,e,i,d,u]}return k}function mw(n){const t=n[0],e=n[1],i=n[2],o=n[3],r=n[4],s=n[5],l=n[6],a=n[7],h=a*r,d=-l*s,u=l*r,c=a*s,g=Math.cos(i),f=Math.sin(i),p=Math.cos(o),v=Math.sin(o),m=.5*(o-i),b=Math.sin(.5*m),w=8/3*b*b/Math.sin(m),C=t+g-w*f,_=e+f+w*g,y=t+p,x=e+v,S=y+w*v,A=x-w*p;return[h*C+d*_,u*C+c*_,h*S+d*A,u*S+c*A,h*y+d*x,u*y+c*x]}function Qf(n,t,e,i){const o=vw(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,e);for(let r=0;r<o.length;++r){const s=mw(o[r]);n.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const bw=(n,t,e,i,o,r,s)=>{const l=Math.abs(e-t),a=l>.5*Math.PI?Math.ceil(2*l/Math.PI):1,h=(e-t)/a;for(let d=0;d<a;d++){const u=t+h*d,c=t+h*(d+1),g=4*Math.tan(Math.abs(h)/4)/3,f=c<u?-1:1,p=Math.cos(u),v=Math.sin(u),m=Math.cos(c),b=Math.sin(c),w=p*r+i,C=v*s+o,_=m*r+i,y=b*s+o,x=r*g*f,S=s*g*f;n.push(w-x*v,C+S*p,_+x*b,y-S*m,_,y)}},Cw=[(n,t,e,i,o,r,s)=>t.arc(n[1]*o+e,n[2]*r+i,n[3]*(o+r)/2,n[4],n[5],n[6],s),(n,t,e,i,o,r,s)=>t.arcTo(n[1]*o+e,n[2]*r+i,n[3]*o+e,n[4]*r+i,n[5]*(o+r)/2,s),(n,t,e,i,o,r,s)=>t.bezierCurveTo(n[1]*o+e,n[2]*r+i,n[3]*o+e,n[4]*r+i,n[5]*o+e,n[6]*r+i,s),(n,t,e,i)=>t.closePath(),(n,t,e,i,o,r)=>t.ellipse(n[1]*o+e,n[2]*r+i,n[3]*o,n[4]*r,n[5],n[6],n[7],n[8]),(n,t,e,i,o,r,s)=>t.lineTo(n[1]*o+e,n[2]*r+i,s),(n,t,e,i,o,r,s)=>t.moveTo(n[1]*o+e,n[2]*r+i,s),(n,t,e,i,o,r,s)=>t.quadraticCurveTo(n[1]*o+e,n[2]*r+i,n[3]*o+e,n[4]*r+i,s),(n,t,e,i,o,r,s)=>t.rect(n[1]*o+e,n[2]*r+i,n[3]*o,n[4]*r,s)];function qn(n,t,e=0,i=0,o=1,r=1,s){for(let l=0;l<n.length;l++){const a=n[l];Cw[a[0]](a,t,e,i,o,r,s)}}class t0{getLength(t){return t!=null?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function _w(n,t){let e=0;const i=n.length;for(let o=0;o<i;o++){const r=n[o],s=t[o],l=n[(o+1)%i],a=t[(o+1)%i];e+=Rn.distanceNN(r,s,l,a)}return e/2}function yw(n,t,e,i,o){return _w([n.x,t.x,e.x,i.x],[n.y,t.y,e.y,i.y])}function e0(n,t,e,i,o){const r=1-o;return r*r*r*n+3*t*o*r*r+3*e*o*o*r+i*o*o*o}function i0(n,t,e,i,o){const r=e0(n.x,t.x,e.x,i.x,o),s=e0(n.y,t.y,e.y,i.y,o);return new ye(r,s)}function lu(n,t){const{p0:e,p1:i,p2:o,p3:r}=n,s=i0(e,i,o,r,t),l=Rn.pointAtPP(e,i,t),a=Rn.pointAtPP(i,o,t),h=Rn.pointAtPP(o,r,t),d=Rn.pointAtPP(l,a,t),u=Rn.pointAtPP(a,h,t);return[new au(e,l,d,s),new au(s,u,h,r)]}class au extends t0{constructor(t,e,i,o){super(),this.type=Wl.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=o}_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(this.defined!==!1)return i0(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?yw(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===re.ROW?Jt(this.p0.x-this.p3.x):t===re.COLUMN?Jt(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Xn(t-.01,0),i=ii(t+.01,1),o=this.getPointAt(e),r=this.getPointAt(i);return Xt(r.y-o.y,r.x-o.x)}}function n0(n,t){const{p0:e,p1:i}=n,o=Rn.pointAtPP(e,i,t);return[new hu(e,o),new hu(o,i)]}class hu extends t0{constructor(t,e){super(),this.type=Wl.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(this.defined!==!1)return Rn.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return this.angle==null&&(this.angle=Xt(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()?Rn.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===re.ROW?Jt(this.p0.x-this.p1.x):t===re.COLUMN?Jt(this.p0.y-this.p1.y):0}}class du{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,o,r,s,l,a){const h=new au(new ye(this._lastX,this._lastY),new ye(t,e),new ye(i,o),new ye(r,s));h.originP1=this._lastOriginP,h.originP2=a,h.defined=l,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,o){const r=this.addLinearCurve(t,e,i,this._lastOriginP,o);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=o}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,o){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,o,r){const s=new hu(new ye(this._lastX,this._lastY),new ye(t,e));return s.originP1=o,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===re.COLUMN){if(!this.curves.length)return 0;const o=this.curves[0],r=this.curves[this.curves.length-1],s=(e=r.p3)!==null&&e!==void 0?e:r.p1;return Jt(o.p0.y-s.y)}if(t===re.ROW){if(!this.curves.length)return 0;const o=this.curves[0],r=this.curves[this.curves.length-1],s=(i=r.p3)!==null&&i!==void 0?i:r.p1;return Jt(o.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((o,r)=>o+r.getLength(),0)),this.length}}class ww extends du{bezierCurveTo(t,e,i,o,r,s,l,a){return super.bezierCurveTo(e,t,o,i,s,r,l,a)}lineTo(t,e,i,o){return super.lineTo(e,t,i,o)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function So(n,t,e=1){let i=!1;for(let o=0,r=t.length;o<=r;o++)o>=r===i&&((i=!i)?n.lineStart():n.lineEnd()),i&&n.point(t[o])}function sr(n,t,e){const i=t??(Jt(e[e.length-1].x-e[0].x)>Jt(e[e.length-1].y-e[0].y)?re.ROW:re.COLUMN);return n==="monotoneY"?new ww(n,i):new du(n,i)}class o0{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||this._line!==0&&this._point===1)&&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,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,this._lastDefined!==!1&&t.defined!==!1,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function ss(n,t={}){const{direction:e,startPoint:i}=t;if(n.length<2-+!!i)return null;const o=sr("linear",e,n);return Sw(new o0(o,i),n),o}function Sw(n,t){return So(n,t,1)}function r0(n,t,e,i,o){n.context.bezierCurveTo((2*n._x0+n._x1)/3,(2*n._y0+n._y1)/3,(n._x0+2*n._x1)/3,(n._y0+2*n._y1)/3,(n._x0+4*n._x1+t)/6,(n._y0+4*n._y1+e)/6,i,n.lastPoint1)}class xw{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(){this._point===2&&r0(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1),(this._line||this._line!==0&&this._point===1)&&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,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:r0(this,e,i,this._lastDefined1!==!1&&this._lastDefined2!==!1)}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 Aw(n,t){return So(n,t,2)}function Rw(n,t={}){const{direction:e,startPoint:i}=t;if(n.length<2-+!!i)return null;if(n.length<3-+!!i)return ss(n,t);const o=sr("basis",e,n);return Aw(new xw(o,i),n),o}function s0(n){return n<0?-1:1}function l0(n,t,e){const i=n._x1-n._x0,o=t-n._x1,r=(n._y1-n._y0)/(i||Number(o<0&&-0)),s=(e-n._y1)/(o||Number(i<0&&-0)),l=(r*o+s*i)/(i+o);return(s0(r)+s0(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(l))||0}function a0(n,t){const e=n._x1-n._x0;return e?(3*(n._y1-n._y0)/e-t)/2:t}function uu(n,t,e,i,o){const r=n._x0,s=n._y0,l=n._x1,a=n._y1,h=(l-r)/3;n.context.bezierCurveTo(r+h,s+h*t,l-h,a-h*e,l,a,i,n.lastPoint1)}class h0{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:uu(this,this._t0,a0(this,this._t0),this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1)}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,o=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,o,this._lastDefined1!==!1&&this._lastDefined2!==!1,t):this.context.moveTo(i,o,t);break;case 1:this._point=2;break;case 2:this._point=3,uu(this,a0(this,e=l0(this,i,o)),e,this._lastDefined1!==!1&&this._lastDefined2!==!1);break;default:uu(this,this._t0,e=l0(this,i,o),this._lastDefined1!==!1&&this._lastDefined2!==!1)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=o,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined!==!1,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Tw extends h0{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Mw(n,t){return So(n,t,2)}function Bw(n,t={}){const{direction:e,startPoint:i}=t;if(n.length<2-+!!i)return null;if(n.length<3-+!!i)return ss(n,t);const o=sr("monotoneX",e,n);return Mw(new h0(o,i),n),o}function Pw(n,t){return So(n,t,2)}function Hw(n,t={}){const{direction:e,startPoint:i}=t;if(n.length<2-+!!i)return null;if(n.length<3-+!!i)return ss(n,t);const o=sr("monotoneY",e,n);return Pw(new Tw(o,i),n),o}let Ew=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&&this._point===2&&this.context.lineTo(this._x,this._y,this._lastDefined!==!1,this.lastPoint),(this._line||this._line!==0&&this._point===1)&&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,this._lastDefined!==!1&&t.defined!==!1,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(e,i,this._lastDefined!==!1&&t.defined!==!1,t);else{const o=this._x*(1-this._t)+e*this._t;this.context.lineTo(o,this._y,this._lastDefined!==!1&&t.defined!==!1,this.lastPoint),this.context.lineTo(o,i,this._lastDefined!==!1&&t.defined!==!1,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function cu(n,t,e={}){const{direction:i,startPoint:o}=e;if(n.length<2-+!!o)return null;const r=new du("step",i??(Jt(n[n.length-1].x-n[0].x)>Jt(n[n.length-1].y-n[0].y)?re.ROW:re.COLUMN));return Lw(new Ew(r,t,o),n),r}function Lw(n,t){return So(n,t,1)}class Fw extends o0{lineEnd(){this.context.closePath()}}function kw(n,t={}){const{direction:e,startPoint:i}=t;if(n.length<2-+!!i)return null;const o=sr("linear",e,n);return Iw(new Fw(o,i),n),o}function Iw(n,t){return So(n,t,1)}function d0(n,t,e,i,o){let r=n._x1,s=n._y1,l=n._x2,a=n._y2;if(n._l01_a>ae){const h=2*n._l01_2a+3*n._l01_a*n._l12_a+n._l12_2a,d=3*n._l01_a*(n._l01_a+n._l12_a);r=(r*h-n._x0*n._l12_2a+n._x2*n._l01_2a)/d,s=(s*h-n._y0*n._l12_2a+n._y2*n._l01_2a)/d}if(n._l23_a>ae){const h=2*n._l23_2a+3*n._l23_a*n._l12_a+n._l12_2a,d=3*n._l23_a*(n._l23_a+n._l12_a);l=(l*h+n._x1*n._l23_2a-t*n._l12_2a)/d,a=(a*h+n._y1*n._l23_2a-e*n._l12_2a)/d}n.context.bezierCurveTo(r,s,l,a,n._x2,n._y2,i,n.lastPoint1)}class zw{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||this._line!==0&&this._point===1)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const o=this._x2-e,r=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(o*o+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,this._lastDefined1!==!1&&this._lastDefined2!==!1):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:d0(this,e,i,this._lastDefined1!==!1&&this._lastDefined2!==!1)}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()}}function u0(n,t){return function(e,i,o={}){const{direction:r,startPoint:s}=o;if(e.length<2-+!!s)return null;if(e.length<3-+!!s)return ss(e,o);const l=sr(n,r,e),a=new t(l,i,s);return So(a,e,2),l}}const Dw=u0("catmullRom",zw);class Ow{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,this._lastDefined1!==!1&&this._lastDefined2!==!1,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 o=this._x2-e,r=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(o*o+r*r,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:d0(this,e,i,this._lastDefined1!==!1&&this._lastDefined2!==!1)}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 Ww=u0("catmullRomClosed",Ow);function xo(n,t,e){var i,o;switch(t){case"linear":default:return ss(n,e);case"basis":return Rw(n,e);case"monotoneX":return Bw(n,e);case"monotoneY":return Hw(n,e);case"step":return cu(n,.5,e);case"stepBefore":return cu(n,0,e);case"stepAfter":return cu(n,1,e);case"catmullRom":return Dw(n,(i=e==null?void 0:e.curveTension)!==null&&i!==void 0?i:.5,e);case"catmullRomClosed":return Ww(n,(o=e==null?void 0:e.curveTension)!==null&&o!==void 0?o:.5,e);case"linearClosed":return kw(n,e)}}class Ue extends cw{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ou(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([qt.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([qt.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,o){return this.commandList.push([qt.Q,t,e,i,o]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,o),this}bezierCurveTo(t,e,i,o,r,s){return this.commandList.push([qt.C,t,e,i,o,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,o,r,s),this}arcTo(t,e,i,o,r){return this.commandList.push([qt.AT,t,e,i,o,r]),this._ctx&&this._ctx.arcTo(t,e,i,o,r),this}ellipse(t,e,i,o,r,s,l,a){return this.commandList.push([qt.E,t,e,i,o,r,s,l,a]),this._ctx&&this._ctx.ellipse(t,e,i,o,r,s,l,a),this}rect(t,e,i,o){return this.commandList.push([qt.R,t,e,i,o]),this._ctx&&this._ctx.rect(t,e,i,o),this}arc(t,e,i,o,r,s){return this.commandList.push([qt.A,t,e,i,o,r,s]),this._ctx&&this._ctx.arc(t,e,i,o,r,s),this}closePath(){return this.commandList.push([qt.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const i=[];i[qt.M]=o=>`M${o[1]} ${o[2]}`,i[qt.L]=o=>`L${o[1]} ${o[2]}`,i[qt.Q]=o=>`Q${o[1]} ${o[2]} ${o[3]} ${o[4]}`,i[qt.C]=o=>`C${o[1]} ${o[2]} ${o[3]} ${o[4]} ${o[5]} ${o[6]}`,i[qt.A]=o=>{const r=[];bw(r,o[4],o[5],o[1],o[2],o[3],o[3]);let s="";for(let l=0;l<r.length;l+=6)s+=`C${r[l]} ${r[l+1]} ${r[l+2]} ${r[l+3]} ${r[l+4]} ${r[l+5]}`;return s},i[qt.R]=o=>`M${o[1]} ${o[2]} h${o[3]} v${o[4]} H${o[1]}Z`,i[qt.Z]=o=>"Z",this.toStringCbList=i}const t=this.toStringCbList;let e="";return this.commandList.forEach(i=>{e+=t[i[0]](i)}),e}fromString(t,e,i,o,r){this.clear();const s=pw(t);return this._runCommandStrList(s,e,i,o,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:o}=t.attribute;if(!e)return;const r=xo(e,i);o==="x"?this.direction=re.ROW:o==="y"?this.direction=re.COLUMN:o==="auto"&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,i,o,r){return this.clear(),this._runCommandList(t.commandList,e,i,o,r),this._updateBounds(),this}transform(t,e,i,o){const r=this.commandList;if(!this.transformCbList){const s=[];s[qt.M]=this.moveToTransform,s[qt.L]=this.lineToTransform,s[qt.Q]=this.quadraticCurveToTransform,s[qt.C]=this.bezierCurveToTransform,s[qt.AT]=this.arcToTransform,s[qt.E]=this.ellipseTransform,s[qt.R]=this.rectTransform,s[qt.A]=this.arcTransform,s[qt.Z]=this.closePathTransform,this.transformCbList=s}r.forEach(s=>{this.transformCbList[s[0]](s,t,e,i,o)}),this._updateBounds()}moveToTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i,t[3]=t[3]*o+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i,t[3]=t[3]*o+e,t[4]=t[4]*r+i,t[5]=t[5]*o+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i,t[3]=t[3]*o+e,t[4]=t[4]*r+i,t[5]=t[5]*(o+r)/2}ellipseTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i,t[3]=t[3]*o,t[4]=t[4]*r}rectTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i,t[3]=t[3]*o,t[4]=t[4]*r}arcTransform(t,e,i,o,r){t[1]=t[1]*o+e,t[2]=t[2]*r+i,t[3]=t[3]*(o+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,o=1,r=1){let s,l,a,h,d,u=null,c=0,g=0,f=0,p=0;for(let v=0,m=t.length;v<m;++v){switch(s=t[v],o===1&&r===1||(s=Nw(s,o,r)),s[0]){case"l":c+=s[1],g+=s[2],this.lineTo(c+e,g+i);break;case"L":c=s[1],g=s[2],this.lineTo(c+e,g+i);break;case"h":c+=s[1],this.lineTo(c+e,g+i);break;case"H":c=s[1],this.lineTo(c+e,g+i);break;case"v":g+=s[1],this.lineTo(c+e,g+i);break;case"V":g=s[1],this.lineTo(c+e,g+i);break;case"m":c+=s[1],g+=s[2],this.moveTo(c+e,g+i);break;case"M":c=s[1],g=s[2],this.moveTo(c+e,g+i);break;case"c":l=c+s[5],a=g+s[6],f=c+s[3],p=g+s[4],this.bezierCurveTo(c+s[1]+e,g+s[2]+i,f+e,p+i,l+e,a+i),c=l,g=a;break;case"C":c=s[5],g=s[6],f=s[3],p=s[4],this.bezierCurveTo(s[1]+e,s[2]+i,f+e,p+i,c+e,g+i);break;case"s":l=c+s[3],a=g+s[4],f=2*c-f,p=2*g-p,this.bezierCurveTo(f+e,p+i,c+s[1]+e,g+s[2]+i,l+e,a+i),f=c+s[1],p=g+s[2],c=l,g=a;break;case"S":l=s[3],a=s[4],f=2*c-f,p=2*g-p,this.bezierCurveTo(f+e,p+i,s[1]+e,s[2]+i,l+e,a+i),c=l,g=a,f=s[1],p=s[2];break;case"q":l=c+s[3],a=g+s[4],f=c+s[1],p=g+s[2],this.quadraticCurveTo(f+e,p+i,l+e,a+i),c=l,g=a;break;case"Q":l=s[3],a=s[4],this.quadraticCurveTo(s[1]+e,s[2]+i,l+e,a+i),c=l,g=a,f=s[1],p=s[2];break;case"t":l=c+s[1],a=g+s[2],u[0].match(/[QqTt]/)===null?(f=c,p=g):u[0]==="t"?(f=2*c-h,p=2*g-d):u[0]==="q"&&(f=2*c-f,p=2*g-p),h=f,d=p,this.quadraticCurveTo(f+e,p+i,l+e,a+i),c=l,g=a,f=c+s[1],p=g+s[2];break;case"T":l=s[1],a=s[2],f=2*c-f,p=2*g-p,this.quadraticCurveTo(f+e,p+i,l+e,a+i),c=l,g=a;break;case"a":Qf(this,c+e,g+i,[s[1],s[2],s[3],s[4],s[5],s[6]+c+e,s[7]+g+i]),c+=s[6],g+=s[7];break;case"A":Qf(this,c+e,g+i,[s[1],s[2],s[3],s[4],s[5],s[6]+e,s[7]+i]),c=s[6],g=s[7];break;case"z":case"Z":this.closePath()}u=s}}_runCommandList(t,e=0,i=0,o=1,r=1){if(e!==0||i!==0||o!==1||r!==1)for(let s=0,l=t.length;s<l;++s){const a=t[s].slice();switch(a[0]){case qt.L:this.lineToTransform(a,e,i,o,r);break;case qt.M:this.moveToTransform(a,e,i,o,r);break;case qt.C:this.bezierCurveToTransform(a,e,i,o,r);break;case qt.Q:this.quadraticCurveToTransform(a,e,i,o,r);break;case qt.A:this.arcToTransform(a,e,i,o,r);break;case qt.E:this.ellipseTransform(a,e,i,o,r);break;case qt.R:this.rectTransform(a,e,i,o,r);break;case qt.AT:this.arcToTransform(a,e,i,o,r);break;case qt.Z:this.closePath()}}else this.commandList=t.map(s=>s.slice())}_updateBounds(){this.bounds.clear(),qn(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===re.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Jt(t.p0.y-e.p1.y)}if(this.direction===re.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Jt(t.p0.x-e.p1.x)}return this.curves.reduce((t,e)=>t+e.getLength(),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let r=0;r<this.curves.length;r++){e=this.curves[r];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const o=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}const Fi=["l",0,0,0,0,0,0,0];function Nw(n,t,e){const i=Fi[0]=n[0];if(i==="a"||i==="A")Fi[1]=t*n[1],Fi[2]=e*n[2],Fi[3]=n[3],Fi[4]=n[4],Fi[5]=n[5],Fi[6]=t*n[6],Fi[7]=e*n[7];else if(i==="h"||i==="H")Fi[1]=t*n[1];else if(i==="v"||i==="V")Fi[1]=e*n[1];else for(let o=1,r=n.length;o<r;++o)Fi[o]=(o%2==1?t:e)*n[o];return Fi}const Vw={alignSelf:"auto"},We={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 He},c0={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},gu={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},g0=Object.assign({outerBorder:Object.assign(Object.assign({},gu),{distance:0}),innerBorder:Object.assign(Object.assign({},gu),{distance:0})},gu),ki={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:`PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,
|
|
3
|
+
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},jw={pickStrokeBuffer:0},Gw=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},c0),g0),Vw),jw),f0={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},_e=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"},{_debug_bounds:!1}),Gw),We),Uw=Object.assign(Object.assign({},_e),{startAngle:0,endAngle:Gt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Kw=Object.assign(Object.assign(Object.assign({},_e),f0),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),$w=Object.assign(Object.assign({},_e),{radius:1,startAngle:0,endAngle:Gt}),Yw=Object.assign(Object.assign({},_e),{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}),Xw=Object.assign(Object.assign({},_e),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),qw=Object.assign(Object.assign(Object.assign({},_e),f0),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Zw=Object.assign(Object.assign({},_e),{path:new Ue,fillStrokeOrder:1,customPath:()=>{ne.getInstance().warn("空函数")}}),Jw=Object.assign(Object.assign({},_e),{points:[],cornerRadius:0,closePath:!0}),Qw=Object.assign(Object.assign({},_e),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},_e),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const tS=Object.assign(Object.assign({},_e),{symbolType:"circle",size:10,keepDirIn3d:!0}),p0=Object.assign(Object.assign(Object.assign({},_e),ki),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Tn=Object.assign(Object.assign(Object.assign({},_e),ki),{editable:!1,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}),ls=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},_e),{fill:!0,cornerRadius:0}),eS=Object.assign(Object.assign({},ls),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class iS{}const X=new iS,fu={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"}},v0={fontSize:16,fontFamily:"sans-serif",fill:!0,stroke:!1,fontWeight:"normal",lineHeight:"normal",fontStyle:"normal",textDecoration:"none",textAlign:"left",script:"normal"},Nl=/\w|\(|\)|-/,m0=/[.?!,;:/,。?!、;:]/,nS=/\S/,b0=(n,t)=>{let e=t.fontSize||16;switch(t.script){case"super":case"sub":e*=.8}n.setTextStyle({textAlign:"left",textBaseline:t.textBaseline||"alphabetic",fontStyle:t.fontStyle||"",fontWeight:t.fontWeight||"",fontSize:e,fontFamily:t.fontFamily||"sans-serif"})};function oS(n,t){const e=t&&t.fill||v0.fill;if(!e)return void(n.globalAlpha=0);const{fillOpacity:i=1,opacity:o=1}=t;n.globalAlpha=i*o,n.fillStyle=e,b0(n,t)}function rS(n,t){const e=t&&t.stroke||v0.stroke;if(!e)return void(n.globalAlpha=0);const{strokeOpacity:i=1,opacity:o=1}=t;n.globalAlpha=i*o,n.lineWidth=t&&typeof t.lineWidth=="number"?t.lineWidth:1,n.strokeStyle=e,b0(n,t)}function pu(n,t,e,i,o){if(!t||t<=0)return 0;const r=X.graphicUtil.textMeasure;let s=i,l=n.slice(0,s),a=Math.floor(r.measureText(l,e).width),h=n.slice(0,s+1),d=Math.floor(r.measureText(h,e).width);for(;a>t||d<=t;){if(a>t?s--:s++,s>n.length){s=n.length;break}if(s<0){s=0;break}l=n.slice(0,s),a=Math.floor(r.measureText(l,e).width),h=n.slice(0,s+1),d=Math.floor(r.measureText(h,e).width)}return o&&(s=Vl(n,s)),s}function Vl(n,t,e=!1){let i=t;for(;Nl.test(n[i-1])&&Nl.test(n[i])||m0.test(n[i]);)if(i--,i<=0)return e?sS(n,t):t;return i}function sS(n,t){let e=t;for(;Nl.test(n[e-1])&&Nl.test(n[e])||m0.test(n[e]);)if(e++,e>=n.length)return e;return e}function lr(n,t){const e=X.graphicUtil.textMeasure.measureText(n,t),i={ascent:0,height:0,descent:0,width:0};return typeof e.actualBoundingBoxAscent!="number"||typeof e.actualBoundingBoxDescent!="number"?(i.width=Math.floor(e.width),i.height=t.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(e.width),i.height=Math.floor(e.actualBoundingBoxAscent+e.actualBoundingBoxDescent),i.ascent=Math.floor(e.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var lS=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let vu=class{configure(n,t){this.canvas=n.canvas,this.context=n.context,n.bindTextMeasure(this)}measureTextWidth(n,t){return this.context?(this.context.setTextStyleWithoutAlignBaseline(t),this.context.measureText(n).width):this.estimate(n,t).width}estimate(n,{fontSize:t=p0.fontSize}){let e=0,i=0;for(let o=0;o<n.length;o++)n.charCodeAt(o)<128?e++:i++;return{width:~~(.8*e*t+i*t),height:t}}measureTextPixelHeight(n,t){var e;if(!this.context)return(e=t.fontSize)!==null&&e!==void 0?e:ki.fontSize;this.context.setTextStyleWithoutAlignBaseline(t);const i=this.context.measureText(n);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(n,t){var e;if(!this.context)return(e=t.fontSize)!==null&&e!==void 0?e:ki.fontSize;this.context.setTextStyleWithoutAlignBaseline(t);const i=this.context.measureText(n);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(n,t){return this.context?(this.context.setTextStyleWithoutAlignBaseline(t),this.context.measureText(n)):this.estimate(n,t)}clipTextVertical(n,t,e,i){if(n.length===0)return{verticalList:n,width:0};const{fontSize:o=12}=t;n.forEach(a=>{a.width=a.direction===0?o:this.measureTextWidth(a.text,t)});const r=[];let s=0,l=0;for(;l<n.length&&s+n[l].width<e;l++)s+=n[l].width,r.push(n[l]);if(n[l]&&n[l].text.length>1){const a=this._clipText(n[l].text,t,e-s,0,n[l].text.length-1,"end",!1);if(i&&a.str!==n[l].text){let h="",d=0;for(let g=0;g<l;g++){const f=n[g];h+=f.text,d+=f.text.length}h+=n[l].text;const u=d+a.str.length;let c=Vl(h,u);c-=d,c!==a.str.length-1&&(a.str=a.str.substring(0,c),a.width=this.measureTextWidth(a.str,t))}r.push(Object.assign(Object.assign({},n[l]),{text:a.str,width:a.width})),s+=a.width}return{verticalList:r,width:s}}clipText(n,t,e,i,o){if(n.length===0)return{str:"",width:0};let r=this.measureTextWidth(n,t);if(r<=e)return{str:n,width:r};if(r=this.measureTextWidth(n[0],t),r>e)return{str:"",width:0};const s=this._clipText(n,t,e,0,n.length-1,"end",!1);if(i&&s.str!==n){let l=Vl(n,s.str.length,o);l!==s.str.length&&(l>s.str.length&&(s.wordBreaked=l,l=s.str.length),s.str=n.substring(0,l),s.width=this.measureTextWidth(s.str,t))}return s}_clipText(n,t,e,i,o,r,s){let l;if(r==="start")l=this._clipTextStart(n,t,e,i,o),s&&(l.result=s+l.str);else if(r==="middle"){const a=this._clipTextMiddle(n,t,e,"","",0,0,1);l={str:"none",width:a.width,result:a.left+s+a.right}}else l=this._clipTextEnd(n,t,e,i,o),s&&(l.result=l.str+s);return l}_clipTextEnd(n,t,e,i,o){if(i===o){ne.getInstance().warn(`【_clipTextEnd】不应该走到这里${n}, ${i}, ${o}`);const h=n.substring(0,o+1);return{str:h,width:this.measureTextWidth(h,t)}}const r=Math.floor((i+o)/2),s=n.substring(0,r+1),l=this.measureTextWidth(s,t);let a;if(l>e){if(s.length<=1)return{str:"",width:0};const h=n.substring(0,r);return a=this.measureTextWidth(h,t),a<=e?{str:h,width:a}:this._clipTextEnd(n,t,e,i,r)}if(l<e){if(r>=n.length-1)return{str:n,width:this.measureTextWidth(n,t)};const h=n.substring(0,r+2);return a=this.measureTextWidth(h,t),a>=e?{str:s,width:l}:this._clipTextEnd(n,t,e,r,o)}return{str:s,width:l}}_clipTextStart(n,t,e,i,o){const r=Math.ceil((i+o)/2),s=n.substring(r-1,n.length),l=this.measureTextWidth(s,t);let a;if(l>e){if(s.length<=1)return{str:"",width:0};const h=n.substring(r,n.length);return a=this.measureTextWidth(h,t),a<=e?{str:h,width:a}:this._clipTextStart(n,t,e,r,n.length)}if(l<e){if(r<=0)return{str:n,width:this.measureTextWidth(n,t)};const h=n.substring(r-2,n.length);return a=this.measureTextWidth(h,t),a>=e?{str:s,width:l}:this._clipTextStart(n,t,e,i,r)}return{str:s,width:l}}_clipTextMiddle(n,t,e,i,o,r,s,l){const a=n.substring(0,l),h=this.measureTextWidth(a,t);if(h+s>e)return{left:i,right:o,width:r+s};const d=n.substring(n.length-l,n.length),u=this.measureTextWidth(d,t);return h+u>e?{left:a,right:o,width:h+s}:this._clipTextMiddle(n,t,e,a,d,h,u,l+1)}clipTextWithSuffixVertical(n,t,e,i,o,r){if(i==="")return this.clipTextVertical(n,t,e,o);if(n.length===0)return{verticalList:n,width:0};const s=this.clipTextVertical(n,t,e,o);if(s.verticalList.length===n.length&&s.verticalList[s.verticalList.length-1].width===n[n.length-1].width)return s;const l=this.measureTextWidth(i,t);if(l>e)return s;let a;if(e-=l,r==="start"){const h=this.revertVerticalList(n);a=this.clipTextVertical(h,t,e,o);const d=this.revertVerticalList(a.verticalList);d.unshift({text:i,direction:1,width:l}),a.verticalList=d}else if(r==="middle"){const h=this.clipTextVertical(n,t,e/2,o),d=this.revertVerticalList(n),u=this.clipTextVertical(d,t,e/2,o);h.verticalList.push({text:i,direction:1,width:l}),this.revertVerticalList(u.verticalList).forEach(c=>h.verticalList.push(c)),a={verticalList:h.verticalList,width:h.width+u.width}}else a=this.clipTextVertical(n,t,e,o),a.verticalList.push({text:i,direction:1,width:l});return a.width+=l,a}revertVerticalList(n){return n.reverse().map(t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})})}clipTextWithSuffix(n,t,e,i,o,r,s=!1){if(i==="")return this.clipText(n,t,e,o);if(n.length===0)return{str:"",width:0};const l=this.measureTextWidth(n,t);if(!s&&l<=e)return{str:n,width:l};const a=this.measureTextWidth(i,t);if(a>e)return{str:"",width:0};if(s&&l+a<=e)return{str:n+i,width:l+a};e-=a;const h=this._clipText(n,t,e,0,n.length-1,r,i);if(o&&h.str!==n){const d=Vl(n,h.str.length);d!==h.str.length&&(h.result=n.substring(0,d),h.width=this.measureTextWidth(h.str,t))}else s&&h.str===n&&(h.result=n+i);return h.str=h.result,h.width+=a,h}};vu=lS([st()],vu);var aS=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};const Mn=Symbol.for("TextMeasureContribution");let ar=class extends vu{};ar=aS([st()],ar);const Tt=new y1,C0=Symbol.for("CanvasFactory"),hS=Symbol.for("Context2dFactory");function mu(n){return Tt.getNamed(C0,X.global.env)(n)}class dS{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 i=mu(Object.assign({nativeCanvas:X.global.createCanvas(t)},t));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const i={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},o=mu(Object.assign({nativeCanvas:X.global.createCanvas(i)},i));return this.allocatedCanvas.push(o),o}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=[]}}const hr=new dS;var uS=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},cS=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};const as=Symbol.for("VWindow"),bu=Symbol.for("WindowHandlerContribution");let Cu=class{get width(){if(this._handler){const n=this._handler.getWH();return this._width=n.width}return this._width}get height(){if(this._handler){const n=this._handler.getWH();return this._height=n.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new gi(["x","y","width","height"])},this.active=()=>{const n=this.global;!n.env||this.actived||(Tt.getNamed(bu,n.env).configure(this,n),this.actived=!0)},this._uid=Te.GenAutoIncrementId(),this.global=X.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var n;return(n=this._handler.getStyle())!==null&&n!==void 0?n:{}}set style(n){this._handler.setStyle(n)}create(n){var t,e;this._handler.createWindow(n);const i=this._handler.getWH();this._width=i.width,this._height=i.height,n.viewBox?this.setViewBox(n.viewBox):n.canvasControled!==!1?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:(t=n.width)!==null&&t!==void 0?t:this._width,y2:(e=n.height)!==null&&e!==void 0?e:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(n){this._handler=n}setDpr(n){return this._handler.setDpr(n)}resize(n,t){return this._handler.resizeWindow(n,t)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(n){return this._handler.getImageBuffer?this._handler.getImageBuffer(n):null}addEventListener(n,t,e){return this._handler.addEventListener(n,t,e)}removeEventListener(n,t,e){return this._handler.removeEventListener(n,t,e)}dispatchEvent(n){return this._handler.dispatchEvent(n)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(n){this._handler.clearViewBox(n)}setViewBox(n){this._handler.setViewBox(n)}setViewBoxTransform(n,t,e,i,o,r){this._handler.setViewBoxTransform(n,t,e,i,o,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(n,t){const e=this._handler.getViewBox(),i={x:n,y:t};return this._handler.getViewBoxTransform().transformPoint({x:n,y:t},i),i.x-=e.x1,i.y-=e.y1,i}hasSubView(){const n=this._handler.getViewBox();return!(n.x1===0&&n.y1===0&&qi(this.width,n.width())&&qi(this.height,n.height()))}isVisible(n){return this._handler.isVisible(n)}onVisibleChange(n){return this._handler.onVisibleChange(n)}getTopLeft(n){return this._handler.getTopLeft(n)}};Cu=uS([st(),cS("design:paramtypes",[])],Cu);var _0=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},y0=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},w0=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let _u=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(n){this.contributions=n,this.configured=!1,this.global=X.global,this.global.hooks.onSetEnv.tap("graphic-util",(t,e,i)=>{this.configured=!1,this.configure(i,e)})}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(n,t){this.configured||(this.contributions.getContributions().forEach(e=>{e.configure(this,t)}),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const n=hr.shareCanvas();this._canvas=n,this._context=n.getContext("2d")}}bindTextMeasure(n){this._textMeasure=n}measureText(n,t,e="native"){var i;this.configure(this.global,this.global.env);const o=this.global.measureTextMethod;this.global.measureTextMethod=e;const r={width:this._textMeasure.measureTextWidth(n,t),height:(i=t.fontSize)!==null&&i!==void 0?i:ki.fontSize};return this.global.measureTextMethod=o,r}createTextMeasureInstance(n,t,e){return this.configure(this.global,this.global.env),new Oe(Object.assign({defaultFontParams:{fontFamily:ki.fontFamily,fontSize:ki.fontSize},getCanvasForMeasure:e||(()=>this.canvas),getTextBounds:void 0,specialCharSet:`-/: .,@%'"~`+Oe.ALPHABET_CHAR_SET+Oe.ALPHABET_CHAR_SET.toUpperCase()},t??{}),n)}drawGraphicToCanvas(n,t,e){if(!t.defaultLayer)return null;const i=Tt.get(as),o=n.AABBBounds,r=o.width(),s=o.height(),l=-o.x1,a=-o.y1;i.create({viewBox:{x1:l,y1:a,x2:o.x2,y2:o.y2},width:r,height:s,canvas:e,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=t.params.optimize.disableCheckGraphicWidthOutRange;t.params.optimize.disableCheckGraphicWidthOutRange=!0,t.defaultLayer.getNativeHandler().drawTo(i,[n],{transMatrix:i.getViewBoxTransform(),viewBox:i.getViewBox(),stage:t,layer:t.defaultLayer,renderService:t.renderService,background:"transparent",clear:!0,updateBounds:!1}),t.params.optimize.disableCheckGraphicWidthOutRange=h;const d=i.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};_u=_0([st(),w0(0,Ot(Me)),w0(0,Ie(Mn)),y0("design:paramtypes",[Object])],_u);var Zn;(function(n){n[n.transform=0]="transform",n[n.matrix=1]="matrix"})(Zn||(Zn={}));const Ee=new He;let yu=class{constructor(){this.matrix=new He}init(n){return this.mode=Zn.transform,this.originTransform=n,this.matrix.reset(),this}fromMatrix(n,t){return this.mode=Zn.matrix,this.outSourceMatrix=n,this.outTargetMatrix=t,this}scaleMatrix(n,t,e){const i=this.outSourceMatrix;if(Ee.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:o,y:r}=e;this.outTargetMatrix.translate(o,r),this.outTargetMatrix.scale(n,t),this.outTargetMatrix.translate(-o,-r)}else this.outTargetMatrix.scale(n,t);return this.outTargetMatrix.multiply(Ee.a,Ee.b,Ee.c,Ee.d,Ee.e,Ee.f),this}rotateMatrix(n,t){const e=this.outSourceMatrix;if(Ee.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),t){const{x:i,y:o}=t;this.outTargetMatrix.translate(i,o),this.outTargetMatrix.rotate(n),this.outTargetMatrix.translate(-i,-o)}else this.outTargetMatrix.rotate(n);return this.outTargetMatrix.multiply(Ee.a,Ee.b,Ee.c,Ee.d,Ee.e,Ee.f),this}scale(n,t,e){return this.mode===Zn.matrix?this.scaleMatrix(n,t,e):this}rotate(n,t){return this.mode===Zn.matrix?this.rotateMatrix(n,t):this}translateMatrix(n,t){const e=this.outSourceMatrix;return Ee.setValue(e.a,e.b,e.c,e.d,e.e,e.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(n,t),this.outTargetMatrix.multiply(Ee.a,Ee.b,Ee.c,Ee.d,Ee.e,Ee.f),this}translate(n,t){return this.mode===Zn.matrix?this.translateMatrix(n,t):this}simplify(n){return this.mode===Zn.matrix?this.simplifyMatrix(n):this}simplifyMatrix(n){return this}};yu=_0([st(),y0("design:paramtypes",[])],yu);const ai={arc:Uw,area:Kw,circle:$w,line:qw,path:Zw,symbol:tS,text:p0,rect:Qw,polygon:Jw,richtext:Tn,richtextIcon:eS,image:ls,group:Yw,glyph:Xw},wu=Object.keys(ai);function gS(){return{arc:Object.assign({},ai.arc),area:Object.assign({},ai.area),circle:Object.assign({},ai.circle),line:Object.assign({},ai.line),path:Object.assign({},ai.path),symbol:Object.assign({},ai.symbol),text:Object.assign({},ai.text),rect:Object.assign({},ai.rect),polygon:Object.assign({},ai.polygon),richtext:Object.assign({},ai.richtext),richtextIcon:Object.assign({},ai.richtextIcon),image:Object.assign({},ai.image),group:Object.assign({},ai.group),glyph:Object.assign({},ai.glyph)}}function jl(n,t){Object.keys(t).forEach(e=>{n[e]=t[e]})}const S0=gS();class hs{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},wu.forEach(t=>{this._defaultTheme[t]=Object.create(S0[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 o=this.getParentWithTheme(t);if(o){const r=o.theme;(r.dirty||i)&&r.applyTheme(o,e,!0)}this.userTheme?this.doCombine(o&&o.theme.combinedTheme):(o?this.combinedTheme=o.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,ne.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;wu.forEach(o=>{const r=Object.create(S0[o]);t&&t[o]&&jl(r,t[o]),i[o]&&jl(r,i[o]),e[o]&&jl(r,e[o]),this.combinedTheme[o]=r}),e.common&&wu.forEach(o=>{jl(this.combinedTheme[o],e.common)}),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach(o=>{i[o]?Object.assign(i[o],t[o]):i[o]=Object.assign({},t[o])}):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(e=>{e.isContainer&&(e.theme&&(e.theme.dirty=!0),this.dirtyChildren(e))})}}const x0=new hs;function Ht(n,t){return n.glyphHost?Ht(n.glyphHost):t?(n.isContainer,t):fS(n)||n.attachedThemeGraphic&&Ht(n.attachedThemeGraphic)||x0.getTheme()}function fS(n){let t;if(t=n.isContainer?n:n.parent,t){for(;t&&!t.theme;)t=t.parent;return t?(t.theme||t.createTheme(),t.theme.getTheme(t)):x0.getTheme()}return null}var pS=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};class vS extends _o{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=Te.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let i=this._lastChild,o=0;for(;i;){if(t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(t(i,o++))return;i=i._next}}}forEachChildrenAsync(t,e=!1){return pS(this,void 0,void 0,function*(){if(e){let i=this._lastChild,o=0;for(;i;){let r=t(i,o++);if(r.then&&(r=yield r),r)return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){let r=t(i,o++);if(r.then&&(r=yield r),r)return;i=i._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._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&ne.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,e===0)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let o=0;o<e;o++){if(!i)return null;o>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 r=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,r)}let i;this._nodeList[e]=t;for(let r=e-1;r>=0&&(i=this._nodeList[r],!i);r--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const o=this.insertInto(t,0);return this._ignoreWarn=!1,o}removeChild(t){if(!this._idMap||!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex(i=>i===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 i=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=i}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((o,r)=>!(o===this||!t(o,r))&&(i=o,!0)),e&&this.forEachChildren(o=>{if(o.isContainer){const r=o.find(t,!0);if(r)return i=r,!0}return!1}),i}findAll(t,e=!1){let i=[];return this.forEachChildren((o,r)=>{o!==this&&t(o,r)&&i.push(o)}),e&&this.forEachChildren(o=>{if(o.isContainer){const r=o.findAll(t,!0);r.length&&(i=i.concat(r))}}),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(i=>i.name===t,e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;t!=null&&t.parent;)t=t.parent;return t||this}hasChildNodes(){return this._firstChild!==null}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(e!==null);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(e!==null)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const o=ze(i,!0)&&i||$t(i)&&i.capture,r=$t(i)&&i.once,s=jt(e)?void 0:e;return t=o?`${t}capture`:t,e=jt(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const o=ze(i,!0)&&i||$t(i)&&i.capture,r=jt(e)?void 0:e;t=o?`${t}capture`:t,e=jt(e)?e:e.handleEvent;const s=$t(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return $t(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 ds{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=ds.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=this.pickParams.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{this.nativeEvent.preventDefault&&jt(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{this.nativeEvent.stopPropagation&&jt(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Gl extends ds{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,o,r,s,l,a,h,d,u,c,g,f,p){throw new Error("Method not implemented.")}}class yi extends Gl{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const o=new yi(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,(t=this.manager)===null||t===void 0||t.copyPointerData(this,o),(e=this.manager)===null||e===void 0||e.copyMouseData(this,o),(i=this.manager)===null||i===void 0||i.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const r=this.composedDetailPath();return o.detailPath=r&&r.slice(),o.type=this.type,o}}class Jn extends Gl{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const o=new Jn(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,(t=this.manager)===null||t===void 0||t.copyWheelData(this,o),(e=this.manager)===null||e===void 0||e.copyMouseData(this,o),(i=this.manager)===null||i===void 0||i.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const r=this.composedDetailPath();return o.detailPath=r&&r.slice(),o.type=this.type,o}}Jn.DOM_DELTA_PIXEL=0,Jn.DOM_DELTA_LINE=1,Jn.DOM_DELTA_PAGE=2;class Su extends ds{constructor(t,e){super(),this.type=t,this.detail=e}}const A0="*",Ao=typeof performance=="object"&&performance.now?performance:Date;function Qn(n){return n==="mouse"||n==="pen"}let mS=class{constructor(t,e){this.dispatch=new _o,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(i,o)=>{if(!(i instanceof yi))return void ne.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(i,i.type,o);if(this.dispatchEvent(r,"pointerdown"),r.pointerType==="touch")this.dispatchEvent(r,"touchstart");else if(Qn(r.pointerType)){const s=r.button===2;this.dispatchEvent(r,s?"rightdown":"mousedown")}this.trackingData(i.pointerId).pressTargetsByButton[i.button]=r.composedPath(),this.freeEvent(r)},this.onPointerMove=(i,o)=>{var r,s;if(!(i instanceof yi))return void ne.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const l=this.createPointerEvent(i,i.type,o),a=Qn(l.pointerType),h=this.trackingData(i.pointerId),d=this.findMountedTarget(h.overTargets);if(h.overTargets&&d&&d!==this.rootTarget&&d!==l.target){const u=i.type==="mousemove"?"mouseout":"pointerout",c=this.createPointerEvent(i,u,d||void 0);if(this.dispatchEvent(c,"pointerout"),a&&this.dispatchEvent(c,"mouseout"),!l.composedPath().includes(d)){const g=this.createPointerEvent(i,"pointerleave",d||void 0);for(g.eventPhase=g.AT_TARGET;g.target&&!l.composedPath().includes(g.target);)g.currentTarget=g.target,this.notifyTarget(g),a&&this.notifyTarget(g,"mouseleave"),g.target=g.target.parent;this.freeEvent(g)}this.freeEvent(c)}if(d!==l.target){const u=i.type==="mousemove"?"mouseover":"pointerover",c=this.clonePointerEvent(l,u);this.dispatchEvent(c,"pointerover"),a&&this.dispatchEvent(c,"mouseover");let g=d==null?void 0:d.parent;for(;g&&g!==this.rootTarget.parent&&g!==l.target;)g=g.parent;if(!g||g===this.rootTarget.parent){const f=this.clonePointerEvent(l,"pointerenter");f.eventPhase=f.AT_TARGET;let p=f.target;const v=new Set;let m=d;for(;m&&m!==this.rootTarget;)v.add(m),m=m.parent;for(;p&&p!==d&&p!==this.rootTarget.parent;)v.has(p)||(f.currentTarget=p,this.notifyTarget(f),a&&this.notifyTarget(f,"mouseenter")),p=p.parent;this.freeEvent(f)}this.freeEvent(c)}this.dispatchEvent(l,"pointermove"),l.pointerType==="touch"&&this.dispatchEvent(l,"touchmove"),a&&(this.dispatchEvent(l,"mousemove"),this.cursorTarget=l.target,this.cursor=((s=(r=l.target)===null||r===void 0?void 0:r.attribute)===null||s===void 0?void 0:s.cursor)||this.rootTarget.getCursor()),h.overTargets=l.composedPath(),this.freeEvent(l)},this.onPointerOver=(i,o)=>{var r,s;if(!(i instanceof yi))return void ne.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const l=this.trackingData(i.pointerId),a=this.createPointerEvent(i,i.type,o),h=Qn(a.pointerType);this.dispatchEvent(a,"pointerover"),h&&this.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(this.cursorTarget=a.target,this.cursor=((s=(r=a.target)===null||r===void 0?void 0:r.attribute)===null||s===void 0?void 0:s.cursor)||this.rootTarget.getCursor());const d=this.clonePointerEvent(a,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),h&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;l.overTargets=a.composedPath(),this.freeEvent(a),this.freeEvent(d)},this.onPointerOut=(i,o)=>{if(!(i instanceof yi))return void ne.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(i.pointerId);if(r.overTargets){const s=Qn(i.pointerType),l=this.findMountedTarget(r.overTargets),a=this.createPointerEvent(i,"pointerout",l||void 0);this.dispatchEvent(a),s&&this.dispatchEvent(a,"mouseout");const h=this.createPointerEvent(i,"pointerleave",l||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==this.rootTarget.parent;)h.currentTarget=h.target,this.notifyTarget(h),s&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;r.overTargets=[],this.freeEvent(a),this.freeEvent(h)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(i,o)=>{var r;if(!(i instanceof yi))return void ne.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=Ao.now(),l=this.createPointerEvent(i,i.type,o);if(this.dispatchEvent(l,"pointerup"),l.pointerType==="touch")this.dispatchEvent(l,"touchend");else if(Qn(l.pointerType)){const u=l.button===2;this.dispatchEvent(l,u?"rightup":"mouseup")}const a=this.trackingData(i.pointerId),h=this.findMountedTarget(a.pressTargetsByButton[i.button]);let d=h;if(h&&!l.composedPath().includes(h)){let u=h;for(;u&&!l.composedPath().includes(u);){if(l.currentTarget=u,this.notifyTarget(l,"pointerupoutside"),l.pointerType==="touch")this.notifyTarget(l,"touchendoutside");else if(Qn(l.pointerType)){const c=l.button===2;this.notifyTarget(l,c?"rightupoutside":"mouseupoutside")}u=u.parent}delete a.pressTargetsByButton[i.button],d=u}if(d){const u=this.clonePointerEvent(l,"click");u.target=d,u.path=[],u.detailPath=[],a.clicksByButton[i.button]||(a.clicksByButton[i.button]={clickCount:0,target:u.target,timeStamp:s});const c=a.clicksByButton[i.button];c.target===u.target&&s-c.timeStamp<((r=this._config.clickInterval)!==null&&r!==void 0?r:200)?++c.clickCount:c.clickCount=1,c.target=u.target,c.timeStamp=s,u.detail=c.clickCount,Qn(u.pointerType)?(this.dispatchEvent(u,"click"),c.clickCount===2&&this.dispatchEvent(u,"dblclick")):u.pointerType==="touch"&&this._config.supportsTouchEvents&&(this.dispatchEvent(u,"tap"),c.clickCount===2&&this.dispatchEvent(u,"dbltap")),this.dispatchEvent(u,"pointertap"),this.freeEvent(u)}this.freeEvent(l)},this.onPointerUpOutside=(i,o)=>{if(!(i instanceof yi))return void ne.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(i.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[i.button]),l=this.createPointerEvent(i,i.type,o);if(s){let a=s;for(;a;)l.currentTarget=a,this.notifyTarget(l,"pointerupoutside"),l.pointerType==="touch"?this.notifyTarget(l,"touchendoutside"):Qn(l.pointerType)&&this.notifyTarget(l,l.button===2?"rightupoutside":"mouseupoutside"),a=a.parent;delete r.pressTargetsByButton[i.button]}this.freeEvent(l)},this.onWheel=(i,o)=>{if(!(i instanceof Jn))return void ne.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const r=this.createWheelEvent(i,o);this.dispatchEvent(r),this.freeEvent(r)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((i,o)=>i.priority-o.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,o,r,s,l,a;if(!this.rootTarget)return;const h=this.mappingTable[t.type];let d;const u=`${t.canvasX}-${t.canvasY}`;if(!((e=this._prePointTargetCache)===null||e===void 0)&&e[u]&&(!((o=(i=this._prePointTargetCache)===null||i===void 0?void 0:i[u])===null||o===void 0)&&o.stage)&&((s=(r=this._prePointTargetCache)===null||r===void 0?void 0:r[u])===null||s===void 0?void 0:s.stage.renderCount)===((l=this._prePointTargetCache)===null||l===void 0?void 0:l.stageRenderCount)?d=this._prePointTargetCache[u]:(d=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[u]:d,stageRenderCount:(a=d==null?void 0:d.stage.renderCount)!==null&&a!==void 0?a:-1})),h)for(let c=0,g=h.length;c<g;c++)h[c].fn(t,d);else ne.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let o=0,r=i.length-1;o<r;o++)if(t.currentTarget=i[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let o=i.length-2;o>=0;o--)if(t.currentTarget=i[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=e??t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var o,r;const s=this.allocateEvent(yi);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=i||this.pickTarget((o=s.viewX)!==null&&o!==void 0?o:s.global.x,(r=s.viewY)!==null&&r!==void 0?r:s.global.y,s),typeof e=="string"&&(s.type=e),s}createWheelEvent(t,e){var i,o;const r=this.allocateEvent(Jn);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget((i=r.viewX)!==null&&i!==void 0?i:r.global.x,(o=r.viewY)!==null&&o!==void 0?o:r.global.y,r),r}clonePointerEvent(t,e){const i=this.allocateEvent(yi);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();const o=t.composedDetailPath();return i.detailPath=o&&o.slice(),i.type=e??i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof yi&&e instanceof yi&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Gl&&e instanceof Gl&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach(i=>{e[i].x=t[i].x,e[i].y=t[i].y}))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Ao.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=((e=this.eventPool.get(t))===null||e===void 0?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),(e=this.eventPool.get(i))===null||e===void 0||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let o=0,r=i.length;o<r&&!t.propagationImmediatelyStopped;o++)i[o].once&&t.currentTarget.removeEventListener(e,i[o].fn,{once:!0}),i[o].fn.call(i[o].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events[A0];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let o=0,r=i.length;o<r&&!t.propagationImmediatelyStopped;o++)i[o].fn.call(i[o].context,t,e)}pickTarget(t,e,i){let o;const r=this.rootTarget.pick(t,e);return o=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),o}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}};const bS={dispatchEvent(n){var t;if(!(n instanceof ds))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return n.defaultPrevented=!1,n.path=[],n.detailPath&&(n.detailPath=[]),n.target=this,(t=n==null?void 0:n.manager)===null||t===void 0||t.dispatchEvent(n),!n.defaultPrevented},emit(n,t){return this.dispatchEvent(new Su(n,t))}},CS={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class _S{constructor(t){this.resolution=1,this.onPointerDown=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch")return;const u=this.normalizeToPointerData(d);this.autoPreventDefault&&u[0].isNormalized&&(d.cancelable||!("cancelable"in d))&&d.preventDefault();for(let c=0,g=u.length;c<g;c++){const f=u[c],p=this.bootstrapEvent(this.rootPointerEvent,f);this.manager.mapEvent(p)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerMove=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch"||this.isEventOutsideOfTargetElement(d))return;const u=this.normalizeToPointerData(d);for(let c=0,g=u.length;c<g;c++){const f=this.bootstrapEvent(this.rootPointerEvent,u[c]);this.manager.mapEvent(f)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerUp=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch")return;const u=this.isEventOutsideOfTargetViewPort(d)?"outside":"",c=this.normalizeToPointerData(d);for(let g=0,f=c.length;g<f;g++){const p=this.bootstrapEvent(this.rootPointerEvent,c[g]);p.type+=u,this.manager.mapEvent(p)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerOverOut=d=>{if(this.supportsTouchEvents&&d.pointerType==="touch")return;const u=this.normalizeToPointerData(d);for(let c=0,g=u.length;c<g;c++){const f=this.bootstrapEvent(this.rootPointerEvent,u[c]);this.manager.mapEvent(f)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onWheel=d=>{const u=this.normalizeWheelEvent(d);this.manager.mapEvent(u)};const{targetElement:e,resolution:i,rootNode:o,global:r,autoPreventDefault:s=!1,clickInterval:l,supportsTouchEvents:a=r.supportsTouchEvents,supportsPointerEvents:h=r.supportsPointerEvents}=t;this.manager=new mS(o,{clickInterval:l,supportsTouchEvents:a}),this.globalObj=r,this.supportsPointerEvents=h,this.supportsTouchEvents=a,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new yi,this.rootWheelEvent=new Jn,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:o}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?typeof r=="string"&&i?o.style.cursor=r:typeof r=="function"?r(t):typeof r=="object"&&i&&Object.assign(o.style,r):i&&Qt(t)&&!Ef(this.cursorStyles,t)&&(o.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const o=(e=this.globalObj)===null||e===void 0?void 0:e.mapToCanvasPoint(t,this.domElement);if(o)return o;let r=0,s=0;if(t.changedTouches){const a=(i=t.changedTouches[0])!==null&&i!==void 0?i:{};r=a.clientX||0,s=a.clientY||0}else r=t.clientX||0,s=t.clientY||0;const l=this.domElement.getBoundingClientRect();return{x:r-l.left,y:s-l.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,o=t.changedTouches.length;i<o;i++){const r=t.changedTouches[i];be(r.button)&&(r.button=0),be(r.buttons)&&(r.buttons=1),be(r.isPrimary)&&(r.isPrimary=t.touches.length===1&&t.type==="touchstart"),be(r.width)&&(r.width=r.radiusX||1),be(r.height)&&(r.height=r.radiusY||1),be(r.tiltX)&&(r.tiltX=0),be(r.tiltY)&&(r.tiltY=0),be(r.pointerType)&&(r.pointerType="touch"),be(r.pointerId)&&(r.pointerId=r.identifier||0),be(r.pressure)&&(r.pressure=r.force||.5),be(r.twist)&&(r.twist=0),be(r.tangentialPressure)&&(r.tangentialPressure=0),be(r.layerX)&&(r.layerX=r.offsetX=r.clientX),be(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent))e.push(t);else{const i=t;be(i.isPrimary)&&(i.isPrimary=!0),be(i.width)&&(i.width=1),be(i.height)&&(i.height=1),be(i.tiltX)&&(i.tiltX=0),be(i.tiltY)&&(i.tiltY=0),be(i.pointerType)&&(i.pointerType="mouse"),be(i.pointerId)&&(i.pointerId=1),be(i.pressure)&&(i.pressure=.5),be(i.twist)&&(i.twist=0),be(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:o}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=o,e.global.x=i,e.global.y=o,e.offset.x=i,e.offset.y=o;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:o}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=o,t.global.x=i,t.global.y=o,t.offset.x=i,t.offset.y=o;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=CS[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Ao.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),o=i.width(),r=i.height();return!(e.x<o&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}var Ii;(function(n){n[n.INITIAL=0]="INITIAL",n[n.RUNNING=1]="RUNNING",n[n.PAUSE=2]="PAUSE"})(Ii||(Ii={}));class us{static Avaliable(){return!!X.global.getRequestAnimationFrame()}avaliable(){return us.Avaliable()}tick(t,e){X.global.getRequestAnimationFrame()(()=>{this.released||e(this)})}release(){this.released=!0}getTime(){return Date.now()}}class Ul{static Avaliable(){return!0}avaliable(){return Ul.Avaliable()}tick(t,e){this.timerId=setTimeout(()=>{e(this)},t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class R0{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(e,i)=>{const{once:o=!1}=i??{};this.ifCanStop()?this.stop():(this._handlerTick(e),o||e.tick(this.interval,this.handleTick))},this._handlerTick=e=>{const i=this.tickerHandler.getTime();let o=0;this.lastFrameTime>=0&&(o=i-this.lastFrameTime),this.lastFrameTime=i,this.status===Ii.RUNNING&&(this.tickCounts++,this.timelines.forEach(r=>{r.tick(o)}))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Ii.INITIAL,X.global.hooks.onSetEnv.tap("default-ticker",()=>{this.initHandler()}),X.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter(e=>e!==t)}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:us},{mode:"timeout",cons:Ul}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new us;break;case"timeout":t=new Ul;break;default:ne.getInstance().warn("非法的计时器模式"),t=new us}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,e=>{this.handleTick(e,{once:!0})})}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,e=>{this.handleTick(e,{once:!0})})}pause(){return this.status!==Ii.INITIAL&&(this.status=Ii.PAUSE,!0)}resume(){return this.status!==Ii.INITIAL&&(this.status=Ii.RUNNING,!0)}ifCanStop(){return!!(this.autoStop&&(!this.timelines.length||this.timelines.reduce((t,e)=>t+e.animateCount,0)===0))}start(t=!1){return this.status===Ii.RUNNING||!this.tickerHandler||!t&&(this.status===Ii.PAUSE||!this.timelines.length||this.timelines.reduce((e,i)=>e+i.animateCount,0)===0)?!1:(this.status=Ii.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0)}stop(){this.status=Ii.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Dt{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 t===0?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 t===0?0:Math.pow(2,10*t-10)}static expoOut(t){return t===1?1:1-Math.pow(2,-10*t)}static expoInOut(t){return t===0?0:t===1?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-Dt.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Dt.bounceIn(2*t):.5*Dt.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(i===0||i===1)return i;const o=e/Gt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-o)*Gt/e)}}static getElasticOut(t,e){return function(i){if(i===0||i===1)return i;const o=e/Gt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-o)*Gt/e)+1}}static getElasticInOut(t,e){return function(i){const o=e/Gt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-o)*Gt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-o)*Gt/e)*.5+1}}}Dt.quadIn=Dt.getPowIn(2),Dt.quadOut=Dt.getPowOut(2),Dt.quadInOut=Dt.getPowInOut(2),Dt.cubicIn=Dt.getPowIn(3),Dt.cubicOut=Dt.getPowOut(3),Dt.cubicInOut=Dt.getPowInOut(3),Dt.quartIn=Dt.getPowIn(4),Dt.quartOut=Dt.getPowOut(4),Dt.quartInOut=Dt.getPowInOut(4),Dt.quintIn=Dt.getPowIn(5),Dt.quintOut=Dt.getPowOut(5),Dt.quintInOut=Dt.getPowInOut(5),Dt.backIn=Dt.getBackIn(1.7),Dt.backOut=Dt.getBackOut(1.7),Dt.backInOut=Dt.getBackInOut(1.7),Dt.elasticIn=Dt.getElasticIn(1,.3),Dt.elasticOut=Dt.getElasticOut(1,.3),Dt.elasticInOut=Dt.getElasticInOut(1,.3*1.5);class xu{constructor(){this.id=Te.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===ni.END?this.removeAnimate(e):e.status===ni.RUNNING||e.status===ni.INITIAL?(this.animateCount++,e.advance(t)):e.status===ni.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach(i=>i()),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const T0=new xu;class M0{constructor(t,e,i,o,r){this.from=t,this.to=e,this.duration=i,this.easing=o,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},(t=this.step.prev.getLastProps())!==null&&t!==void 0?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(this.updateCount===0){this.onFirstRun();const o=this.step.getLastProps();Object.keys(o).forEach(r=>{this.subAnimate.animate.validAttr(r)&&(i[r]=o[r])})}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class yS extends M0{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Bn{constructor(t=Te.GenAutoIncrementId(),e=T0,i){this.id=t,this.timeline=e,this.status=ni.INITIAL,this.tailAnimate=new B0(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce((t,e)=>t+e.totalDuration,0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach(i=>{e=Xn(i.getDuration(),e)}),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Bn.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this.subAnimates.length===1&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Bn.mode){t&&e&Ol.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:fi.ANIMATE_PLAY})}runCb(t){const e=new yS(()=>{t(this,e.step.prev)});return this.tailAnimate.play(e),this}customInterpolate(t,e,i,o,r,s){const l=Bn.interpolateMap.get(t)||Bn.interpolateMap.get("");return!!l&&l(t,e,i,o,r,s)}pause(){this.status===ni.RUNNING&&(this.status=ni.PAUSED)}resume(){this.status===ni.PAUSED&&(this.status=ni.RUNNING)}to(t,e,i,o){if(this.tailAnimate.to(t,e,i,o),this.target){const r=this.target.stage;r&&r.renderNextFrame()}return this}from(t,e,i,o){if(this.tailAnimate.from(t,e,i,o),this.target){const r=this.target.stage;r&&r.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const e=this.target.stage;e&&e.renderNextFrame()}return this}subAnimate(){const t=new B0(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach(e=>this.preventAttr(e))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach(e=>{e.bind(t)}),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===ni.INITIAL&&(this.status=ni.RUNNING,this._onStart&&this._onStart.forEach(e=>e())),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===ni.RUNNING&&(this.status=ni.END,this._onEnd&&this._onEnd.forEach(e=>e()))}setPosition(t){let e,i=0;const o=this.rawPosition,r=this.subAnimates.reduce((l,a)=>l+a.totalDuration,0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===o)return s;for(let l=0;l<this.subAnimates.length&&(e=this.subAnimates[l],!(i+e.totalDuration>=t));l++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=ni.END}stop(t){t||this.target.onStop(),t==="start"?this.target.onStop(this.getStartProps()):t==="end"?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}Bn.mode=Ol.NORMAL,Bn.interpolateMap=new Map;class B0{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new P0(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(e==null||e<0)&&(e=0);const i=t.easing,o=typeof i=="string"?Dt[i]:i,r=this._addStep(e,null,o);return r.type=rr.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,i,o){(e==null||e<0)&&(e=0);const r=typeof i=="string"?Dt[i]:i,s=this._addStep(e,null,r);return s.type=rr.to,this._appendProps(t,s,!!o&&o.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),o&&o.noPreventAttrs||this.target.animates.forEach(l=>{l.id!==this.animate.id&&l.preventAttrs(s.propKeys)}),this}from(t,e,i,o){this.to(t,0,i,o);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach(s=>{r[s]=this.getLastPropByName(s,this.stepTail)}),this.to(r,e,i,o),this.stepTail.type=rr.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return(t=this.stepHead)===null||t===void 0?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=rr.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const o=new P0(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(o),this.stepTail=o,o}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let o=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach(l=>{e.props[l]===void 0&&(e.props[l]=this.target.getDefaultAttribute(l))});o.prev;)o.props&&(o.propKeys||(o.propKeys=Object.keys(o.props)),o.propKeys.forEach(l=>{r[l]===void 0&&(r[l]=o.props[l])})),e.propKeys=Object.keys(e.props),o=o.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach(l=>{if(s[l]===void 0){const a=this.animate.getStartProps();s[l]=a[l]=this.target.getComputedAttribute(l)}}),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,o=this.loop,r=this.rawPosition;let s,l,a=!1;const h=(e=this._startAt)!==null&&e!==void 0?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0&&(a=!0,i<0)||(s=Math.floor(t/i),l=t-s*i,a=t>=o*i+i,a&&(l=i,s=o,t=l*s+i),t===r))return a;const d=!this.reversed!=!(this.bounce&&s%2);return d&&(l=i-l),this._deltaPosition=l-this.position,this.position=l,this.rawPosition=t+h,this.updatePosition(a,d),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const o=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=o;)i=s,s=i.next;let l=t?r===0?1:o/r:(o-i.position)/i.duration;i.easing&&(l=i.easing(l)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,l,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach(a=>a(i,l))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let o=e.prev;for(;o&&o!==t;)o.customAnimate&&(o.customAnimate.onStart&&o.customAnimate.onStart(),o.customAnimate.onEnd&&o.customAnimate.onEnd()),o=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let o=e.next;for(;o&&o!==t;)o.customAnimate&&(o.customAnimate.onStart&&o.customAnimate.onStart(),o.customAnimate.onEnd&&o.customAnimate.onEnd()),o=o.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&i.props[t]!==void 0)return i.props[t];if(i.customAnimate){const o=i.customAnimate.getEndProps()[t];if(o!==void 0)return o}i=i.prev}return ne.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){t.props==null&&t.customAnimate==null||this.target.onStep(this,this.animate,t,e,i)}}class P0{constructor(t,e,i,o){this.duration=e,this.position=t,this.props=i,this.easing=o}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const H0={duration:200,easing:"cubicOut"};var E0;(function(n){n[n.Top=1]="Top",n[n.Right=2]="Right",n[n.Bottom=4]="Bottom",n[n.Left=8]="Left",n[n.ALL=15]="ALL"})(E0||(E0={}));const Pn=[!1,!1,!1,!1],wS=n=>{var t;let e=!0;if(ze(n,!0)){for(let i=0;i<4;i++)Pn[i]=n,e&&(e=!((t=Pn[i])!==null&&t!==void 0&&!t));e=n}else if(Array.isArray(n))for(let i=0;i<4;i++)Pn[i]=!!n[i],e&&(e=!!Pn[i]);else Pn[0]=!1,Pn[1]=!1,Pn[2]=!1,Pn[3]=!1;return{isFullStroke:e,stroke:Pn}},cs=[0,0,0,0],gs=n=>n?it(n)?n.length===0?0:n.length===1?n[0]:n.length===2?(cs[0]=n[0],cs[2]=n[0],cs[1]=n[1],cs[3]=n[1],cs):n:n:0,dr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Kl=[1,2,3,0,1,2,3,0];function Au(n,t,e,i){for(;n>=Gt;)n-=Gt;for(;n<0;)n+=Gt;for(;n>t;)t+=Gt;dr[0].x=e,dr[1].y=e,dr[2].x=-e,dr[3].y=-e;const o=Math.ceil(n/Ei)%4,r=Math.ceil(t/Ei)%4;if(i.add(Pe(n)*e,pe(n)*e),i.add(Pe(t)*e,pe(t)*e),o!==r||t-n>oe){let s=!1;for(let l=0;l<Kl.length;l++)if(s||o!==Kl[l]){if(s&&r===Kl[l])break;if(s){const a=dr[Kl[l]];i.add(a.x,a.y)}}else{s=!0;const a=dr[o];i.add(a.x,a.y)}}}function L0(n,t,e){const{x:i,y:o}=Vf(n.x,n.y,t.x,t.y,e),{x:r,y:s}=Vf(n.x1,n.y1,t.x1,t.y1,e),l=new ye(i,o,r,s);return l.defined=t.defined,l}function F0(n,t,e){if(!n||!t)return[];Array.isArray(n)||(n=[n]),Array.isArray(t)||(t=[t]);let i=[];if(n.length>t.length){i=t.map(o=>{const r=new ye(o.x,o.y,o.x1,o.y1);return r.defined=o.defined,r});for(let o=0;o<t.length;o++)i[o]=L0(n[o],t[o],e)}else{i=t.map(o=>{const r=new ye(o.x,o.y,o.x1,o.y1);return r.defined=o.defined,r});for(let o=0;o<n.length;o++)i[o]=L0(n[o],t[o],e)}return i}function $l(n,t){if(it(n)){let e;for(let i=0;i<n.length&&e===void 0;i++)e=n[i][t];return e}return n[t]}class Yl{constructor(t=Yl.TimeOut){this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout(()=>{this.appendDuration(Date.now()-this.lastDate),t(0)},this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((e,i)=>e+i,0)/this.durations.length,1e3/60),1e3/30)}}Yl.TimeOut=1e3/60;const k0=new Yl,Hn=(n,t)=>Qt(n)&&n[n.length-1]==="%"?t*(Number.parseFloat(n.substring(0,n.length-1))/100):n,SS=n=>{if(!n)return{x:0,y:0,width:0,height:0};let t=ct(n.width)?n.x1-n.x:n.width,e=ct(n.height)?n.y1-n.y:n.height,i=0,o=0;return t<0?(i=t,t=-t):Number.isNaN(t)&&(t=0),e<0?(o=e,e=-e):Number.isNaN(e)&&(e=0),{x:i,y:o,width:t,height:e}};var En;(function(n){n[n.Color255=0]="Color255",n[n.Color1=1]="Color1"})(En||(En={}));class Ne{static Get(t,e=En.Color1,i=[0,0,0,1]){if(e===En.Color1){const s=Ne.store1[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const l=_i.parseColorString(t);if(l){const a=[l.r/255,l.g/255,l.b/255,l.opacity];Ne.store1[t]=a,Ne.store255[t]=[l.r,l.g,l.b,l.opacity],i[0]=a[0],i[1]=a[1],i[2]=a[2],i[3]=a[3]}return i}const o=Ne.store255[t];if(o)return i[0]=o[0],i[1]=o[1],i[2]=o[2],i[3]=o[3],i;const r=_i.parseColorString(t);return r&&(Ne.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Ne.store255[t]=[r.r,r.g,r.b,r.opacity],i[0]=r.r,i[1]=r.g,i[2]=r.b,i[3]=r.opacity),i}static Set(t,e,i){if(e===En.Color1){if(Ne.store1[t])return;Ne.store1[t]=i,Ne.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Ne.store255[t])return;Ne.store255[t]=i,Ne.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}Ne.store255={},Ne.store1={};function Xl(n,t=!1){return Array.isArray(n)&&nt(n[0])?t?`rgb(${Math.round(n[0])},${Math.round(n[1])},${Math.round(n[2])},${n[3].toFixed(2)})`:`rgb(${Math.round(n[0])},${Math.round(n[1])},${Math.round(n[2])})`:n}function ur(n,t,e,i,o){return Array.isArray(n)&&!nt(n[0])||Array.isArray(t)&&!nt(t[0])?new Array(4).fill(0).map((r,s)=>I0(it(n)?n[s]:n,it(t)?t[s]:t,e,i)):I0(n,t,e,i,o)}function I0(n,t,e,i,o){if(!n||!t)return n&&Xl(n)||t&&Xl(t)||!1;let r,s,l=!1,a=!1;if(Array.isArray(n)?r=n:typeof n=="string"?r=Ne.Get(n,En.Color255):l=!0,Array.isArray(t)?s=t:typeof t=="string"?s=Ne.Get(t,En.Color255):a=!0,l!==a){const h=l?n:t,d=l?t:n,u=Object.assign(Object.assign({},h),{stops:h.stops.map(c=>Object.assign(Object.assign({},c),{color:Xl(d)}))});return l?ur(h,u,e,i,o):ur(u,h,e,i,o)}if(l){if(n.gradient===t.gradient){const h=n,d=t,u=h.stops,c=d.stops;if(u.length!==c.length)return!1;if(h.gradient==="linear")return xS(h,d,e);if(h.gradient==="radial")return AS(h,d,e);if(h.gradient==="conical")return RS(h,d,e)}return!1}return o&&o(r,s),Xl(TS(r,s,e),i)}function xS(n,t,e){const i=n.stops,o=t.stops;return{gradient:"linear",x0:n.x0+(t.x0-n.x0)*e,x1:n.x1+(t.x1-n.x1)*e,y0:n.y0+(t.y0-n.y0)*e,y1:n.y1+(t.y1-n.y1)*e,stops:new Array(i.length).fill(0).map((r,s)=>({color:Ru(i[s].color,o[s].color,e),offset:i[s].offset+(o[s].offset-i[s].offset)*e}))}}function AS(n,t,e){const i=n.stops,o=t.stops;return{gradient:"radial",x0:n.x0+(t.x0-n.x0)*e,x1:n.x1+(t.x1-n.x1)*e,y0:n.y0+(t.y0-n.y0)*e,y1:n.y1+(t.y1-n.y1)*e,r0:n.r0+(t.r0-n.r0)*e,r1:n.r1+(t.r1-n.r1)*e,stops:new Array(i.length).fill(0).map((r,s)=>({color:Ru(i[s].color,o[s].color,e),offset:i[s].offset+(o[s].offset-i[s].offset)*e}))}}function RS(n,t,e){const i=n.stops,o=t.stops;return{gradient:"conical",startAngle:n.startAngle+(t.startAngle-n.startAngle)*e,endAngle:n.endAngle+(t.endAngle-n.endAngle)*e,x:n.x+(t.x-n.x)*e,y:n.y+(t.y-n.y)*e,stops:new Array(i.length).fill(0).map((r,s)=>({color:Ru(i[s].color,o[s].color,e),offset:i[s].offset+(o[s].offset-i[s].offset)*e}))}}function TS(n,t,e){return[n[0]+(t[0]-n[0])*e,n[1]+(t[1]-n[1])*e,n[2]+(t[2]-n[2])*e,n[3]+(t[3]-n[3])*e]}const Ln=[0,0,0,0],fs=[0,0,0,0];function Ru(n,t,e){return Ne.Get(n,En.Color255,Ln),Ne.Get(t,En.Color255,fs),`rgba(${Math.round(Ln[0]+(fs[0]-Ln[0])*e)},${Math.round(Ln[1]+(fs[1]-Ln[1])*e)},${Math.round(Ln[2]+(fs[2]-Ln[2])*e)},${Ln[3]+(fs[3]-Ln[3])*e})`}class ee{static GetImage(t,e){var i;const o=ee.cache.get(t);o?o.loadState==="fail"?X.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):o.loadState==="init"||o.loadState==="loading"?(i=o.waitingMark)===null||i===void 0||i.push(e):e&&e.imageLoadSuccess(t,o.data):ee.loadImage(t,e)}static GetSvg(t,e){var i;let o=ee.cache.get(t);o?o.loadState==="fail"?X.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):o.loadState==="init"||o.loadState==="loading"?(i=o.waitingMark)===null||i===void 0||i.push(e):e&&e.imageLoadSuccess(t,o.data):(o={type:"image",loadState:"init"},ee.cache.set(t,o),o.dataPromise=X.global.loadSvg(t),o.dataPromise?(o.waitingMark=[e],o.dataPromise.then(r=>{var s;o.loadState=r!=null&&r.data?"success":"fail",o.data=r==null?void 0:r.data,(s=o.waitingMark)===null||s===void 0||s.map((l,a)=>{r!=null&&r.data?(o.loadState="success",o.data=r.data,l.imageLoadSuccess(t,r.data)):(o.loadState="fail",l.imageLoadFail(t))}),o.waitingMark&&(o.waitingMark=[])})):(o.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=ee.cache.get(t);return i?i.loadState==="fail"?Promise.reject():i.loadState==="init"||i.loadState==="loading"?i.dataPromise.then(o=>o.data):Promise.resolve(i.data):(i={type:e,loadState:"init"},ee.cache.set(t,i),e==="arrayBuffer"?i.dataPromise=X.global.loadArrayBuffer(t):e==="blob"?i.dataPromise=X.global.loadBlob(t):e==="json"&&(i.dataPromise=X.global.loadJson(t)),i.dataPromise.then(o=>o.data))}static loading(){setTimeout(()=>{if(!ee.isLoading&&ee.toLoadAueue.length){ee.isLoading=!0;const t=ee.toLoadAueue.splice(0,10),e=[];t.forEach(i=>{const{url:o,marks:r}=i,s={type:"image",loadState:"init"};if(ee.cache.set(o,s),s.dataPromise=X.global.loadImage(o),s.dataPromise){s.waitingMark=r;const l=s.dataPromise.then(a=>{var h;s.loadState=a!=null&&a.data?"success":"fail",s.data=a==null?void 0:a.data,(h=s.waitingMark)===null||h===void 0||h.map((d,u)=>{a!=null&&a.data?(s.loadState="success",s.data=a.data,d.imageLoadSuccess(o,a.data)):(s.loadState="fail",d.imageLoadFail(o))}),s.waitingMark&&(s.waitingMark=[])});e.push(l)}else s.loadState="fail",r.forEach(l=>l.imageLoadFail(o))}),Promise.all(e).then(()=>{ee.isLoading=!1,this.onLoadSuccessCb.forEach(i=>i()),ee.loading()}).catch(i=>{console.error(i),ee.isLoading=!1,this.onLoadSuccessCb.forEach(o=>o()),ee.loading()})}},0)}static loadImage(t,e){const i=z0(t,ee.toLoadAueue);if(i!==-1)return ee.toLoadAueue[i].marks.push(e),void ee.loading();ee.toLoadAueue.push({url:t,marks:[e]}),ee.loading()}static improveImageLoading(t){const e=z0(t,ee.toLoadAueue);if(e!==-1){const i=ee.toLoadAueue.splice(e,1);ee.toLoadAueue.unshift(i[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function z0(n,t){for(let e=0;e<t.length;e++)if(t[e].url===n)return e;return-1}ee.cache=new Map,ee.isLoading=!1,ee.toLoadAueue=[],ee.onLoadSuccessCb=[];const MS=new He,D0=new he,zi=["lineWidth","scaleX","scaleY","angle","anchor","visible"],O0=["x","y"],W0=["scaleX","scaleY"],N0=["angle"],ps=new ye,Ji={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 pi extends vS{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const o=e[i];Object.defineProperty(pi.prototype,o,Object.getOwnPropertyDescriptor(t,o))}}get AABBBounds(){return this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise")}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 he,this._updateTag=te.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage((e=t.background.background)!==null&&e!==void 0?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){t==="3d"?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,o;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const l=this.parent.attribute;ps.x=r+((i=l.scrollX)!==null&&i!==void 0?i:0),ps.y=s+((o=l.scrollY)!==null&&o!==void 0?o:0)}else ps.x=r,ps.y=s;return ps}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;X.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return X.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new ew),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}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,o=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=i,s=gs(r);return s&&o.expand(s),this.clearUpdateBoundTag(),o}updatePathProxyAABBBounds(t){const e=typeof this.pathProxy=="function"?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ou(t);return qn(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 e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new He),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&te.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&X.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&te.UPDATE_BOUNDS)&&X.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&te.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&te.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&te.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite(((t=i.x)!==null&&t!==void 0?t:0)+((e=i.y)!==null&&e!==void 0?e:0))}_validNumber(t){return t==null||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&te.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=te.CLEAR_SHAPE}containsPoint(t,e,i,o){if(!o)return!1;if(i===rs.GLOBAL){const r=new ye(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),t=r.x,e=r.y}return o.containsPoint(this,{x:t,y:e})}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 o=Object.keys(t);for(let r=0;r<o.length;r++){const s=o[r];this.attribute[s]=t[s]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(o)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,o){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,o);s?this._setAttributes(s,i,o):ct((r=this.normalAttrs)===null||r===void 0?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o)):this.normalAttrs[t]=e,t==="background"?this.loadImage(e,!0):t==="shadowGraphic"&&this.setShadowGraphic(e)}needUpdateTags(t,e=zi){for(let i=0;i<e.length;i++){const o=e[i];if(t.indexOf(o)!==-1)return!0}return!1}needUpdateTag(t,e=zi){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:fi.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=te.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,o;if(t===0&&e===0)return this;const r={type:fi.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,O0,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const l=this.attribute,a=l.postMatrix;return a?X.transformUtil.fromMatrix(a,a).translate(t,e):(l.x=((i=l.x)!==null&&i!==void 0?i:We.x)+t,l.y=((o=l.y)!==null&&o!==void 0?o:We.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const o={type:fi.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,O0,o);return r?(this._setAttributes(r,!1,o),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}scale(t,e,i){var o,r;if(t===1&&e===1)return this;const s={type:fi.SCALE},l=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,W0,s);l&&(t=l.scaleX,e=l.scaleY,delete l.scaleX,delete l.scaleY,this._setAttributes(l));const a=this.attribute;if(i){let{postMatrix:h}=this.attribute;h||(h=new He,a.postMatrix=h),X.transformUtil.fromMatrix(h,h).scale(t,e,i)}else a.scaleX=((o=a.scaleX)!==null&&o!==void 0?o:We.scaleX)*t,a.scaleY=((r=a.scaleY)!==null&&r!==void 0?r:We.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const o={type:fi.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,W0,o);return r?(this._setAttributes(r,!1,o),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}rotate(t,e){var i;if(t===0)return this;const o={type:fi.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,N0,o);r&&(delete r.angle,this._setAttributes(r,!1,o));const s=this.attribute;if(e){let{postMatrix:l}=this.attribute;l||(l=new He,s.postMatrix=l),X.transformUtil.fromMatrix(l,l).rotate(t,e)}else s.angle=((i=s.angle)!==null&&i!==void 0?i:We.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:fi.ROTATE_TO},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,N0,i);return o?(this._setAttributes(o,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Bn(t==null?void 0:t.id,this.stage&&this.stage.getTimeline(),t==null?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:o,onEnd:r,onRemove:s}=t;i!=null&&e.onStart(i),o!=null&&e.onFrame(o),r!=null&&e.onEnd(r),s!=null&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove(()=>{this.animates.delete(e.id)}),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(X.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise"),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(this.attribute.boundsMode==="imprecise"),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!ct(t)||this.currentStates.includes(t))}getState(t){var e;return(e=this.states)===null||e===void 0?void 0:e[t]}applyStateAttrs(t,e,i,o){var r,s,l,a;if(i){const h=Object.keys(t),d=this.getNoWorkAnimateAttr(),u={};let c;h.forEach(f=>{d[f]?(c||(c={}),c[f]=t[f]):u[f]=o&&t[f]===void 0?this.getDefaultAttribute(f):t[f]});const g=this.animate({slience:!0});g.stateNames=e,g.to(u,(s=(r=this.stateAnimateConfig)===null||r===void 0?void 0:r.duration)!==null&&s!==void 0?s:H0.duration,(a=(l=this.stateAnimateConfig)===null||l===void 0?void 0:l.easing)!==null&&a!==void 0?a:H0.easing),c&&this.setAttributes(c,!1,{type:fi.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:fi.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach(i=>{i in this.normalAttrs?(e[i]=this.normalAttrs[i],delete this.normalAttrs[i]):e[i]=this.getNormalAttribute(i)}),Object.keys(this.normalAttrs).forEach(i=>{t[i]=this.normalAttrs[i]})):Object.keys(t).forEach(i=>{e[i]=this.getNormalAttribute(i)}),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach(e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))})}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach(i=>{if(i.stateNames){const o=i.getEndProps();Ef(o,t)&&(e=o[t])}}),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter(o=>o!==t);this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var o;if(this.currentStates&&this.currentStates.includes(t)&&(e||this.currentStates.length===1))return;const r=e&&(!((o=this.currentStates)===null||o===void 0)&&o.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!(((i=this.currentStates)===null||i===void 0?void 0:i.length)!==t.length||t.some((r,s)=>this.currentStates[s]!==r)))return;const o={};t.forEach(r=>{var s;const l=this.stateProxy?this.stateProxy(r,t):(s=this.states)===null||s===void 0?void 0:s[r];l&&Object.assign(o,l)}),this.updateNormalAttrs(o),this.currentStates=t,this.applyStateAttrs(o,t,e)}addUpdateBoundTag(){this._updateTag|=te.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=te.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=te.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&te.UPDATE_SHAPE_AND_BOUNDS)===te.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=te.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=te.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=te.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=te.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=te.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=te.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=te.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&te.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],o=()=>{if(e.b)return e.b;const{scaleX:r,scaleY:s,angle:l}=this.attribute;return D0.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(D0),this.setAttributes({scaleX:r,scaleY:s,angle:l}),e.b};if(typeof t[0]=="string"){const r=parseFloat(t[0])/100,s=o();i[0]=s.x1+(s.x2-s.x1)*r}else i[0]=t[0];if(typeof t[1]=="string"){const r=parseFloat(t[1])/100,s=o();i[1]=s.y1+(s.y2-s.y1)*r}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=We.x,y:e=We.y,scaleX:i=We.scaleX,scaleY:o=We.scaleY,angle:r=We.angle,scaleCenter:s,anchor:l,postMatrix:a}=this.attribute;let h=[0,0];const d={};if(l&&(h=this.getAnchor(l,d)),!s||i===1&&o===1)iw(this._transMatrix,this._transMatrix.reset(),t,e,i,o,r,l&&h);else{const c=this._transMatrix;c.reset(),c.translate(h[0],h[1]),c.rotate(r),c.translate(-h[0],-h[1]),c.translate(t,e),h=this.getAnchor(s,d),X.transformUtil.fromMatrix(c,c).scale(i,o,{x:h[0],y:h[1]})}const u=this.getOffsetXY(We);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,a){const c=MS.setValue(a.a,a.b,a.c,a.d,a.e,a.f),g=this._transMatrix;c.multiply(g.a,g.b,g.c,g.d,g.e,g.f),g.setValue(c.a,c.b,c.c,c.d,c.e,c.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 i=t.getTimeline();this.animates.forEach(o=>{o.setTimeline(i)})}this._onSetStage&&this._onSetStage(this,t,e),X.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:fi.ANIMATE_END})}onStep(t,e,i,o,r){const s={};if(i.customAnimate)i.customAnimate.update(r,o,s);else{const l=i.props,a=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,s,i,o,r,l,void 0,a,h)}this.setAttributes(s,!1,{type:fi.ANIMATE_UPDATE,animationState:{ratio:o,end:r,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,o,r,s,l,a,h,d){d||(d=Object.keys(l),o.propKeys=d),s?o.propKeys.forEach(u=>{e.validAttr(u)&&(i[u]=l[u])}):d.forEach(u=>{var c;if(!e.validAttr(u))return;const g=l[u],f=(c=a&&a[u])!==null&&c!==void 0?c:t.getLastPropByName(u,o);if(g==null||f==null||g===f)return void(i[u]=g);let p;p=e.interpolateFunc&&e.interpolateFunc(u,r,f,g,i),p||(p=e.customInterpolate(u,r,f,g,this,i),p||this.defaultInterpolate(g,f,u,i,h,r)||this._interpolate(u,r,f,g,i))}),o.parsedProps=h}defaultInterpolate(t,e,i,o,r,s){if(Number.isFinite(t))return o[i]=e+(t-e)*s,!0;if(i==="fill"){r||(r={});const l=r.fillColorArray,a=ur(e,l??t,s,!1,(h,d)=>{r.fillColorArray=d});return a&&(o[i]=a),!0}if(i==="stroke"){r||(r={});const l=r.strokeColorArray,a=ur(e,l??t,s,!1,(h,d)=>{r.strokeColorArray=d});return a&&(o[i]=a),!0}if(i==="shadowColor"){r||(r={});const l=r.shadowColorArray,a=ur(e,l??t,s,!0,(h,d)=>{r.shadowColorArray=d});return a&&(o[i]=a),!0}return!1}_interpolate(t,e,i,o,r){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return(e=this.attribute[t])!==null&&e!==void 0?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=t??X.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map(t=>t.toJson())}}createPathProxy(t){return Qt(t,!0)?this.pathProxy=new Ue().fromString(t):this.pathProxy=new Ue,this.pathProxy}loadImage(t,e=!1){if(!t||e&&BS(t))return;const i=t;this.resources||(this.resources=new Map);const o={data:"init",state:null};this.resources.set(i,o),typeof t=="string"?(o.state="loading",t.startsWith("<svg")?(ee.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(M1(t)||t.includes("/")||B1(t))&&(ee.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):$t(t)?(o.state="success",o.data=t,this.backgroundImg=this.backgroundImg||e):o.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const o=this.resources.get(t);o&&(o.state="success",o.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(e=>{e.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",X.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,o;if(this._events&&t in this._events){const r=new Su(t,e);r.bubbles=!1,r.manager=(o=(i=this.stage)===null||i===void 0?void 0:i.eventSystem)===null||o===void 0?void 0:o.manager,this.dispatchEvent(r)}}}function BS(n){return!(!n.fill&&!n.stroke)}pi.mixin(bS);function PS(n,t){const e=[];let i=t.exec(n);for(;i;){const o=[];o.startIndex=t.lastIndex-i[0].length;const r=i.length;for(let s=0;s<r;s++)o.push(i[s]);e.push(o),i=t.exec(n)}return e}class Tu{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){t.tagname==="__proto__"&&(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 V0(n,t,e,i){const o=n.indexOf(t,e);if(o===-1)throw new Error(i);return o+t.length-1}function HS(n,t,e=">"){let i,o="";for(let r=t;r<n.length;r++){let s=n[r];if(i)s===i&&(i="");else if(s==='"'||s==="'")i=s;else if(s===e[0]){if(!e[1])return{data:o,index:r};if(n[r+1]===e[1])return{data:o,index:r}}else s===" "&&(s=" ");o+=s}}function j0(n,t,e,i=">"){const o=HS(n,t+1,i);if(!o)return;let r=o.data;const s=o.index,l=r.search(/\s/);let a=r,h=!0;l!==-1&&(a=r.substr(0,l).replace(/\s\s*$/,""),r=r.substr(l+1));const d=a;if(e){const u=a.indexOf(":");u!==-1&&(a=a.substr(u+1),h=a!==o.data.substr(u+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:h,rawTagName:d}}const ES=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");class LS{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const o=e.tagname;typeof o=="string"&&(e.tagname=o),t.addChild(e)}buildAttributesMap(t,e,i){const o={};if(!t)return;const r=PS(t,ES),s=r.length;for(let l=0;l<s;l++){const a=r[l][1],h=r[l][4],d=a;a&&(o[d]=h===void 0||(isNaN(h)?h:Number(h)))}return o}parseXml(t){t=t.replace(/\r\n?/g,`
|
|
4
|
+
`);const e=new Tu("!xml");let i=e,o="",r="";for(let s=0;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="/"){const l=V0(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&o&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=o),o="",s=l}else if(t[s+1]==="?")s=j0(t,s,!1,"?>").closeIndex+1;else if(t.substr(s+1,3)==="!--")s=V0(t,"-->",s+4,"Comment is not closed.");else{const l=j0(t,s,!1);let a=l.tagName,h=l.tagExp;const d=l.attrExpPresent,u=l.closeIndex;if(a!==e.tagname&&(r+=r?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),h=a):h=h.substr(0,h.length-1);const c=new Tu(a);a!==h&&d&&(c[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,c,r),r=r.substr(0,r.lastIndexOf("."))}else{const c=new Tu(a);this.tagsNodeStack.push(i),a!==h&&d&&(c[":@"]=this.buildAttributesMap(h,r,a)),this.addChild(i,c,r),i=c}o="",s=u}else o+=t[s];return e.child}}function FS(n,t){return G0(n)}function G0(n,t){const e={};for(let i=0;i<n.length;i++){const o=n[i],r=kS(o);if(r!==void 0&&o[r]){const s=G0(o[r]);zS(s),o[":@"]&&IS(s,o[":@"]),e[r]!==void 0&&e.hasOwnProperty(r)?(Array.isArray(e[r])||(e[r]=[e[r]]),e[r].push(s)):e[r]=s}}return e}function kS(n){const t=Object.keys(n);for(let e=0;e<t.length;e++){const i=t[e];if(i!==":@")return i}}function IS(n,t,e){if(t){const i=Object.keys(t),o=i.length;for(let r=0;r<o;r++){const s=i[r];n[s]=t[s]}}}function zS(n){return Object.keys(n).length===0}class ql{constructor(t){this.options=Object.assign({},ql.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;const e=new LS(this.options).parseXml(t);return FS(e,this.options)}}ql.defaultOptions={};function DS(n){return n.startsWith("<svg")||n.startsWith("<?xml")}globalThis&&globalThis.__awaiter;function Zl(n,t,e,i=0){return n.expand(t+(i/2+(e?OS(e,t):0))),n}function OS(n,t){return n?t:0}let WS=0;function Xe(){return WS++}var Ro;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Ro||(Ro={}));function U0(n){const t=[];let e=0,i="";for(let o=0;o<n.length;o++)jS(n[o])?e?i+=n[o]:(e=1,i=n[o]):(e&&(t.push({text:i,direction:Ro.VERTICAL}),i="",e=0),t.push({text:n[o],direction:Ro.HORIZONTAL}));return i&&t.push({text:i,direction:Ro.VERTICAL}),t}const NS=["…","(",")","—","【","】","「","」","《","》"],K0=new Map;NS.forEach(n=>K0.set(n,!0));const VS=[""],$0=new Map;function jS(n){if(K0.has(n))return!0;if($0.has(n))return!1;let t=!1;return n.codePointAt(0)<256&&(t=!0),t}VS.forEach(n=>$0.set(n,!0));const Jl=Xe(),GS=Xe(),Y0=Xe(),Ql=Xe();Xe();const Mu=Xe(),ta=Xe(),vs=Xe(),ea=Xe(),ia=Xe();Xe();const Bu=Xe();Xe();const Pu=Xe(),na=Xe(),oa=Xe(),X0=Symbol.for("GraphicService"),q0=Symbol.for("GraphicCreator"),Z0={"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"},US=Object.keys(Z0);var J0;(function(n){n[n.LESS_GROUP=0]="LESS_GROUP",n[n.MORE_GROUP=1]="MORE_GROUP"})(J0||(J0={}));let Qi=class ff extends pi{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Mu,this._childUpdateTag=te.UPDATE_BOUNDS}setMode(t){t==="3d"?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new hs),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new hs)}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===rs.GLOBAL){const o=new ye(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(o,o),this.AABBBounds.contains(o.x,o.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&te.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;X.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),X.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=We.x,y:e=We.y,dx:i=We.dx,dy:o=We.dy,scaleX:r=We.scaleX,scaleY:s=We.scaleY,angle:l=We.angle,postMatrix:a}=this.attribute;if(t!==0||e!==0||i!==0||o!==0||r!==1||s!==1||l!==0||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Ht(this).group}updateAABBBounds(t,e,i){const o=i;i=i.clone();const{width:r,height:s,path:l,clip:a=e.clip,display:h}=t;return l&&l.length?l.forEach(d=>{i.union(d.AABBBounds)}):r!=null&&s!=null&&i.set(0,0,Math.max(0,r),Math.max(0,s)),a||this.forEachChildren(d=>{i.union(d.AABBBounds)}),X.graphicService.updateTempAABBBounds(i),X.graphicService.transformAABBBounds(t,i,e,!1,this),o.copy(i),o}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=te.CLEAR_BOUNDS,this._childUpdateTag&=te.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=te.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&te.UPDATE_BOUNDS||(this._childUpdateTag|=te.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(),X.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),X.graphicService.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,X.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren(e=>{X.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)}),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),X.graphicService.onSetStage(this,t),this.forEachChildren(i=>{i.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 e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&te.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find(i=>i.name===t,e)}createOrUpdateChild(t,e,i){let o=this._getChildByName(t);return o?o.setAttributes(e):(o=X.graphicService.creator[i](e),o.name=t,this.add(o)),o}clone(){return new ff(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ff.NOWORK_ANIMATE_ATTR}};Qi.NOWORK_ANIMATE_ATTR=Ji;function ra(n){return new Qi(n)}class KS extends Qi{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,o){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=o.main,this.layerHandler=o.layerHandler,this.layerHandler.init(this,i,{main:o.main,canvasId:o.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:(r=o.zIndex)!==null&&r!==void 0?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new hs,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort((i,o)=>i.zIndex-o.zIndex);this.layerHandler.merge(e.map(i=>(i.layer.subLayers.size&&i.layer.combineSubLayer(t),i.layer.getNativeHandler()))),t&&e.forEach(i=>{i.group&&(i.group.incremental=0)}),e.forEach(i=>{X.layerService.releaseLayer(this.stage,i.layer)}),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach(i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)})}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:(i=t.background)!==null&&i!==void 0?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach(o=>o(this)),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach(t=>{X.layerService.releaseLayer(this.stage,t.layer)})}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:(i=e.background)!==null&&i!==void 0?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach(o=>o(this))}}const Q0=Symbol.for("TransformUtil"),tp=Symbol.for("GraphicUtil"),Hu=Symbol.for("LayerService"),ep=Symbol.for("StaticLayerHandlerContribution"),$S=Symbol.for("DynamicLayerHandlerContribution"),YS=Symbol.for("VirtualLayerHandlerContribution");var ms,XS=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},qS=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let bs=ms=class{static GenerateLayerId(){return`${ms.idprefix}_${ms.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=X.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(n){return this.layerMap.get(n)}getRecommendedLayerType(n){return n||(this.staticLayerCountInEnv!==0?"static":this.dynamicLayerCountInEnv!==0?"dynamic":"virtual")}getLayerHandler(n){let t;return t=n==="static"?Tt.get(ep):n==="dynamic"?Tt.get($S):Tt.get(YS),t}createLayer(n,t={main:!1}){var e;this.tryInit();let i=this.getRecommendedLayerType(t.layerMode);i=t.main||t.canvasId?"static":i;const o=this.getLayerHandler(i),r=new KS(n,this.global,n.window,Object.assign(Object.assign({main:!1},t),{layerMode:i,canvasId:(e=t.canvasId)!==null&&e!==void 0?e:ms.GenerateLayerId(),layerHandler:o})),s=this.layerMap.get(n)||[];return s.push(r),this.layerMap.set(n,s),this.staticLayerCountInEnv--,r}prepareStageLayer(n){let t;n.forEachChildren(e=>{const i=e.getNativeHandler();i.type==="virtual"?(i.mainHandler=t,t.secondaryHandlers.push(i)):(t=i,t.secondaryHandlers=[])})}releaseLayer(n,t){t.release();const e=this.layerMap.get(n)||[];this.layerMap.set(n,e.filter(i=>i!==t))}layerCount(n){return(this.layerMap.get(n)||[]).length}restLayerCount(n){return this.global.env==="browser"?10:0}releaseStage(n){this.layerMap.delete(n)}};bs.idprefix="visactor_layer",bs.prefix_count=0,bs=ms=XS([st(),qS("design:paramtypes",[])],bs);const ZS=new Bt(n=>{n(Nd).to(Vd).inSingletonScope(),n(as).to(Cu),n(tp).to(_u).inSingletonScope(),n(Q0).to(yu).inSingletonScope(),n(Hu).to(bs).inSingletonScope()});function cr(n,t){return!(!n&&!t)}function Cs(n,t){let e;return e=it(n)?n.some(i=>i||i===void 0):!!n,e&&t>0}function To(n,t,e){return e&&n*t>0}function ip(n,t,e,i,o){return o&&n*t>0&&e!==0&&i!==0}function Eu(n,t){return n*t>0}function np(n,t,e,i){return n*t>0&&e!==0&&i!==0}function JS(n,t,e,i,o,r,s,l){if(!n.pathProxy)return!1;const a=Ht(n,r==null?void 0:r.theme)[n.type.replace("3d","")],{fill:h=a.fill,stroke:d=a.stroke,opacity:u=a.opacity,fillOpacity:c=a.fillOpacity,lineWidth:g=a.lineWidth,strokeOpacity:f=a.strokeOpacity,visible:p=a.visible,x:v=a.x,y:m=a.y}=n.attribute,b=To(u,c,h),w=Eu(u,f),C=cr(h),_=Cs(d,g);if(!p||!C&&!_||!(b||w||s||l))return!0;t.beginPath();const y=typeof n.pathProxy=="function"?n.pathProxy(n.attribute):n.pathProxy;return qn(y.commandList,t,e,i),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a),_&&(l?l(t,n.attribute,a):w&&(t.setStrokeStyle(n,n.attribute,e-v,i-m,a),t.stroke())),C&&(s?s(t,n.attribute,a):b&&(t.setCommonStyle(n,n.attribute,e-v,i-m,a),t.fill())),!0}function QS(n,t,e,i,o,r,s,l){const a=e-n,h=i-t,d=s-o,u=l-r;let c=u*a-d*h;return c*c<ae?[]:(c=(d*(t-r)-u*(n-o))/c,[n+c*a,t+c*h])}function to(n,t,e,i,o,r,s){const l=n-e,a=t-i,h=(s?r:-r)/Math.sqrt(l*l+a*a),d=h*a,u=-h*l,c=n+d,g=t+u,f=e+d,p=i+u,v=(c+f)/2,m=(g+p)/2,b=f-c,w=p-g,C=b*b+w*w,_=o-r,y=c*p-f*g,x=(w<0?-1:1)*Math.sqrt(Math.max(0,_*_*C-y*y));let S=(y*w-b*x)/C,A=(-y*b-w*x)/C;const R=(y*w+b*x)/C,T=(-y*b+w*x)/C,M=S-v,P=A-m,k=R-v,B=T-m;return M*M+P*P>k*k+B*B&&(S=R,A=T),{cx:S,cy:A,x01:-d,y01:-u,x11:S*(o/_-1),y11:A*(o/_-1)}}function op(n,t,e,i,o){const r=Jt(e-t),s=n.getParsedCornerRadius(),l=it(s),{outerDeltaAngle:a,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:u,innerEndAngle:c,innerStartAngle:g}=n.getParsePadAngle(t,e),f=l?s[0]:s,p=l?s[1]:s,v=l?s[2]:s,m=l?s[3]:s,b=Math.max(p,f),w=Math.max(v,m);let C=b,_=w;const y=o*Pe(d),x=o*pe(d),S=i*Pe(c),A=i*pe(c);let R,T,M,P;if((w>ae||b>ae)&&(R=o*Pe(u),T=o*pe(u),M=i*Pe(g),P=i*pe(g),r<oe)){const k=QS(y,x,M,P,R,T,S,A);if(k){const B=y-k[0],H=x-k[1],E=R-k[0],F=T-k[1],L=1/pe(X1((B*E+H*F)/(Zi(B*B+H*H)*Zi(E*E+F*F)))/2),z=Zi(k[0]*k[0]+k[1]*k[1]);_=ii(w,(i-z)/(L-1)),C=ii(b,(o-z)/(L+1))}}return{outerDeltaAngle:a,xors:y,yors:x,xirs:M,yirs:P,xore:R,yore:T,xire:S,yire:A,limitedOcr:C,limitedIcr:_,outerCornerRadiusStart:f,outerCornerRadiusEnd:p,maxOuterCornerRadius:b,maxInnerCornerRadius:w,outerStartAngle:d,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:c,innerStartAngle:g,innerCornerRadiusStart:m,innerCornerRadiusEnd:v}}function Lu(n,t,e,i,o,r,s){const{startAngle:l,endAngle:a}=n.getParsedAngle(),h=Jt(a-l),d=a>l;let u=!1;if(o<r){const c=o;o=r,r=c}if(o<=ae)t.moveTo(e,i);else if(h>=Gt-ae)t.moveTo(e+o*Pe(l),i+o*pe(l)),t.arc(e,i,o,l,a,!d),r>ae&&(t.moveTo(e+r*Pe(a),i+r*pe(a)),t.arc(e,i,r,a,l,d));else{const{outerDeltaAngle:c,xors:g,yors:f,xirs:p,yirs:v,limitedOcr:m,outerCornerRadiusStart:b,outerCornerRadiusEnd:w,maxOuterCornerRadius:C,xore:_,yore:y,xire:x,yire:S,outerStartAngle:A,outerEndAngle:R,limitedIcr:T,innerDeltaAngle:M,innerEndAngle:P,innerStartAngle:k,innerCornerRadiusStart:B,innerCornerRadiusEnd:H,maxInnerCornerRadius:E}=op(n,l,a,r,o);if(c<.001)s&&(s[3]||s[1])&&t.moveTo(e+g,i+f),u=!0;else if(m>ae){const F=ii(b,m),L=ii(w,m),z=to(p,v,g,f,o,F,Number(d)),D=to(_,y,x,S,o,L,Number(d));m<C&&F===L?!s||s[0]?(t.moveTo(e+z.cx+z.x01,i+z.cy+z.y01),t.arc(e+z.cx,i+z.cy,m,Xt(z.y01,z.x01),Xt(D.y01,D.x01),!d)):t.moveTo(e+z.cx+m*Pe(Xt(D.y01,D.x01)),i+z.cy+m*pe(Xt(D.y01,D.x01))):!s||s[0]?(t.moveTo(e+z.cx+z.x01,i+z.cy+z.y01),F>0&&t.arc(e+z.cx,i+z.cy,F,Xt(z.y01,z.x01),Xt(z.y11,z.x11),!d),t.arc(e,i,o,Xt(z.cy+z.y11,z.cx+z.x11),Xt(D.cy+D.y11,D.cx+D.x11),!d),L>0&&t.arc(e+D.cx,i+D.cy,L,Xt(D.y11,D.x11),Xt(D.y01,D.x01),!d)):L>0?t.moveTo(e+D.cx+L*Pe(Xt(D.y01,D.x01)),i+D.cy+L*pe(Xt(D.y01,D.x01))):t.moveTo(e+_,i+o*pe(R))}else!s||s[0]?(t.moveTo(e+g,i+f),t.arc(e,i,o,A,R,!d)):t.moveTo(e+o*Pe(R),i+o*pe(R));if(!(r>ae)||M<.001)!s||s[1]?t.lineTo(e+x,i+S):t.moveTo(e+x,i+S),u=!0;else if(T>ae){const F=ii(B,T),L=ii(H,T),z=to(x,S,_,y,r,-L,Number(d)),D=to(g,f,p,v,r,-F,Number(d));if(!s||s[1]?t.lineTo(e+z.cx+z.x01,i+z.cy+z.y01):t.moveTo(e+z.cx+z.x01,i+z.cy+z.y01),T<E&&F===L){const N=Xt(D.y01,D.x01);!s||s[2]?t.arc(e+z.cx,i+z.cy,T,Xt(z.y01,z.x01),N,!d):t.moveTo(e+z.cx+Pe(N),i+z.cy+pe(N))}else!s||s[2]?(L>0&&t.arc(e+z.cx,i+z.cy,L,Xt(z.y01,z.x01),Xt(z.y11,z.x11),!d),t.arc(e,i,r,Xt(z.cy+z.y11,z.cx+z.x11),Xt(D.cy+D.y11,D.cx+D.x11),d),F>0&&t.arc(e+D.cx,i+D.cy,F,Xt(D.y11,D.x11),Xt(D.y01,D.x01),!d)):F>0?t.moveTo(e+D.cx+F*Pe(Xt(D.y01,D.x01)),i+D.cy+F*pe(Xt(D.y01,D.x01))):t.moveTo(e+p,i+v)}else!s||s[1]?t.lineTo(e+x,i+S):t.moveTo(e+x,i+S),!s||s[2]?t.arc(e,i,r,P,k,d):t.moveTo(e+r*Pe(k),i+r*pe(k))}return s?s[3]&&t.lineTo(e+o*Pe(l),i+o*pe(l)):t.closePath(),u}class Di{static GetCanvas(){try{return Di.canvas||(Di.canvas=X.global.createCanvas({})),Di.canvas}catch{return null}}static GetCtx(){if(!Di.ctx){const t=Di.GetCanvas();Di.ctx=t.getContext("2d")}return Di.ctx}}class Mo extends nw{static getInstance(){return Mo._instance||(Mo._instance=new Mo),Mo._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Di.GetCanvas(),o=Di.GetCtx();if(i.width=e,i.height=1,!o)return;if(o.translate(0,0),!o)throw new Error("获取ctx发生错误");const r=o.createLinearGradient(0,0,e,0);t.forEach(s=>{r.addColorStop(s[0],s[1])}),o.fillStyle=r,o.fillRect(0,0,e,1),this.rgbaSet=o.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,o,r=[],s=100){let l=`${t}${e}${i}${o}`;r.forEach(h=>l+=h.join()),l+=s;let a=this.dataMap.get(l);return a||(a={data:new Mo(r,s),timestamp:[]},this.addLimitedTimestamp(a,Date.now(),{}),this.dataMap.set(l,a)),this.clearCache(this.dataMap,this.cacheParams),a.data}}class oi{static GetSize(t){for(let e=0;e<oi.ImageSize.length;e++)if(oi.ImageSize[e]>=t)return oi.ImageSize[e];return t}static Get(t,e,i,o,r,s,l){const a=oi.GenKey(t,e,i,o,r),h=oi.cache[a];if(!h||h.length===0)return null;for(let d=0;d<h.length;d++)if(h[d].width>=s&&h[d].height>=l)return h[d].pattern;return null}static Set(t,e,i,o,r,s,l,a){const h=oi.GenKey(t,e,i,o,r);oi.cache[h]?oi.cache[h].push({width:l,height:a,pattern:s}):oi.cache[h]=[{width:l,height:a,pattern:s}]}static GenKey(t,e,i,o,r){return`${e},${i},${o},${r},${t.join()}`}}oi.cache={},oi.ImageSize=[20,40,80,160,320,640,1280,2560];function tx(n,t,e,i){const{stops:o,startAngle:r,endAngle:s}=i;for(;e<0;)e+=Gt;for(;e>Gt;)e-=Gt;if(e<r||e>s)return o[0].color;let l,a,h=(e-r)/(s-r);for(let d=0;d<o.length;d++)if(o[d].offset>=h){l=o[d-1],a=o[d];break}return h=(h-l.offset)/(a.offset-l.offset),ur(l.color,a.color,h,!1)}function ex(n,t,e,i,o,r,s,l,a){const h=Math.floor(180*o/Math.PI),d=Di.GetCanvas(),u=Di.GetCtx();if(!u)return null;const c=oi.GetSize(l),g=oi.GetSize(a);let f=oi.Get(t,e,i,r,s,c,g);if(f)return f;const p=Math.sqrt(Math.max(Math.max(Math.pow(e,2)+Math.pow(i,2),Math.pow(c-e,2)+Math.pow(i,2)),Math.max(Math.pow(c-e,2)+Math.pow(g-i,2),Math.pow(e,2)+Math.pow(g-i,2)))),v=h+1,m=o/Math.max(1,v-1),b=Mo.getInstance().GetOrCreate(e,i,c,g,t,v),w=2*Math.PI*p/360;d.width=c,d.height=g,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,c,g),u.translate(e,i),u.rotate(r);for(let _=0,y=v-1;_<y&&!(r+_*m>s);_++){const x=b.getColor(_);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(p,-2*w),u.lineTo(p,0),u.fillStyle=x,u.closePath(),u.fill()}const C=u.getImageData(0,0,c,g);return d.width=C.width,d.height=C.height,u.putImageData(C,0,0),f=n.createPattern(d,"no-repeat"),f&&oi.Set(t,e,i,r,s,f,c,g),f}const Fu=Symbol.for("ArcRenderContribution"),ix=Symbol.for("AreaRenderContribution"),ku=Symbol.for("CircleRenderContribution"),tn=Symbol.for("GroupRenderContribution"),Bo=Symbol.for("ImageRenderContribution"),Iu=Symbol.for("PathRenderContribution"),zu=Symbol.for("PolygonRenderContribution"),Po=Symbol.for("RectRenderContribution"),Du=Symbol.for("SymbolRenderContribution"),sa=Symbol.for("TextRenderContribution"),Ou=Symbol.for("InteractiveSubRenderContribution");function nx(n,t){return n==="top"?Math.ceil(.79*t):n==="middle"?Math.round(.3*t):n==="bottom"?Math.round(-.21*t):0}function fn(n,t){return n==="end"||n==="right"?-t:n==="center"?-t/2:0}function pn(n,t,e,i=0){return n==="middle"?-t/2:n==="top"?0:n==="bottom"?i-t:n&&n!=="alphabetic"?0:(e||(e=t),-(t-e)/2-.79*e)}function rp(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function ox(n,t,e){const i=Math.sin(e),o=Math.cos(e),r=t[4],s=t[5],l=t[6],a=t[7],h=t[8],d=t[9],u=t[10],c=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=r*o+h*i,n[5]=s*o+d*i,n[6]=l*o+u*i,n[7]=a*o+c*i,n[8]=h*o-r*i,n[9]=d*o-s*i,n[10]=u*o-l*i,n[11]=c*o-a*i,n}function rx(n,t,e){const i=Math.sin(e),o=Math.cos(e),r=t[0],s=t[1],l=t[2],a=t[3],h=t[8],d=t[9],u=t[10],c=t[11];return t!==n&&(n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=r*o-h*i,n[1]=s*o-d*i,n[2]=l*o-u*i,n[3]=a*o-c*i,n[8]=r*i+h*o,n[9]=s*i+d*o,n[10]=l*i+u*o,n[11]=a*i+c*o,n}function sx(n,t,e){const i=Math.sin(e),o=Math.cos(e),r=t[0],s=t[1],l=t[2],a=t[3],h=t[4],d=t[5],u=t[6],c=t[7];return t!==n&&(n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=r*o+h*i,n[1]=s*o+d*i,n[2]=l*o+u*i,n[3]=a*o+c*i,n[4]=h*o-r*i,n[5]=d*o-s*i,n[6]=u*o-l*i,n[7]=c*o-a*i,n}function _s(n,t,e){const i=e[0],o=e[1],r=e[2];let s,l,a,h,d,u,c,g,f,p,v,m;return t===n?(n[12]=t[0]*i+t[4]*o+t[8]*r+t[12],n[13]=t[1]*i+t[5]*o+t[9]*r+t[13],n[14]=t[2]*i+t[6]*o+t[10]*r+t[14],n[15]=t[3]*i+t[7]*o+t[11]*r+t[15]):(s=t[0],l=t[1],a=t[2],h=t[3],d=t[4],u=t[5],c=t[6],g=t[7],f=t[8],p=t[9],v=t[10],m=t[11],n[0]=s,n[1]=l,n[2]=a,n[3]=h,n[4]=d,n[5]=u,n[6]=c,n[7]=g,n[8]=f,n[9]=p,n[10]=v,n[11]=m,n[12]=s*i+d*o+f*r+t[12],n[13]=l*i+u*o+p*r+t[13],n[14]=a*i+c*o+v*r+t[14],n[15]=h*i+g*o+m*r+t[15]),n}function Wu(n,t){n[0]=t.a,n[1]=t.b,n[2]=0,n[3]=0,n[4]=t.c,n[5]=t.d,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=t.e,n[13]=t.f,n[14]=0,n[15]=1}function lx(n,t,e){const i=e[0],o=e[1],r=e[2];return n[0]=t[0]*i,n[1]=t[1]*i,n[2]=t[2]*i,n[3]=t[3]*i,n[4]=t[4]*o,n[5]=t[5]*o,n[6]=t[6]*o,n[7]=t[7]*o,n[8]=t[8]*r,n[9]=t[9]*r,n[10]=t[10]*r,n[11]=t[11]*r,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function ys(n,t,e){const i=t[0],o=t[1],r=t[2],s=t[3],l=t[4],a=t[5],h=t[6],d=t[7],u=t[8],c=t[9],g=t[10],f=t[11],p=t[12],v=t[13],m=t[14],b=t[15];let w=e[0],C=e[1],_=e[2],y=e[3];return n[0]=w*i+C*l+_*u+y*p,n[1]=w*o+C*a+_*c+y*v,n[2]=w*r+C*h+_*g+y*m,n[3]=w*s+C*d+_*f+y*b,w=e[4],C=e[5],_=e[6],y=e[7],n[4]=w*i+C*l+_*u+y*p,n[5]=w*o+C*a+_*c+y*v,n[6]=w*r+C*h+_*g+y*m,n[7]=w*s+C*d+_*f+y*b,w=e[8],C=e[9],_=e[10],y=e[11],n[8]=w*i+C*l+_*u+y*p,n[9]=w*o+C*a+_*c+y*v,n[10]=w*r+C*h+_*g+y*m,n[11]=w*s+C*d+_*f+y*b,w=e[12],C=e[13],_=e[14],y=e[15],n[12]=w*i+C*l+_*u+y*p,n[13]=w*o+C*a+_*c+y*v,n[14]=w*r+C*h+_*g+y*m,n[15]=w*s+C*d+_*f+y*b,n}function en(n,t,e){const i=t[0],o=t[1],r=t[2];let s=e[3]*i+e[7]*o+e[11]*r+e[15];return s=s||1,n[0]=(e[0]*i+e[4]*o+e[8]*r+e[12])/s,n[1]=(e[1]*i+e[5]*o+e[9]*r+e[13])/s,n[2]=(e[2]*i+e[6]*o+e[10]*r+e[14])/s,n}function sp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class ax{constructor(){this.pools=[]}allocate(t,e,i,o,r,s){if(!this.pools.length)return new He(t,e,i,o,r,s);const l=this.pools.pop();return l.a=t,l.b=e,l.c=i,l.d=o,l.e=r,l.f=s,l}allocateByObj(t){if(!this.pools.length)return new He(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=[]}}class Nu{constructor(){this.pools=[]}static identity(t){return rp(t)}allocate(){if(!this.pools.length)return sp();const t=this.pools.pop();return Nu.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():sp();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 wi=new ax,Le=new Nu;var hx=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},dx=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},ux=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};function lp(n,t,e){var i;const{x:o=e.x,y:r=e.y,z:s=e.z,dx:l=e.dx,dy:a=e.dy,dz:h=e.dz,scaleX:d=e.scaleX,scaleY:u=e.scaleY,scaleZ:c=e.scaleZ,alpha:g=e.alpha,beta:f=e.beta,angle:p=e.angle,anchor3d:v=t.attribute.anchor,anchor:m}=t.attribute,b=[0,0,0];if(v){if(typeof v[0]=="string"){const w=parseFloat(v[0])/100,C=t.AABBBounds;b[0]=C.x1+(C.x2-C.x1)*w}else b[0]=v[0];if(typeof v[1]=="string"){const w=parseFloat(v[1])/100,C=t.AABBBounds;b[1]=C.x1+(C.x2-C.x1)*w}else b[1]=v[1];b[2]=(i=v[2])!==null&&i!==void 0?i:0}if(rp(n),_s(n,n,[o+l,r+a,s+h]),_s(n,n,[b[0],b[1],b[2]]),ox(n,n,f),rx(n,n,g),_s(n,n,[-b[0],-b[1],b[2]]),lx(n,n,[d,u,c]),p){const w=Le.allocate(),C=[0,0];if(m){if(typeof v[0]=="string"){const _=parseFloat(v[0])/100,y=t.AABBBounds;C[0]=y.x1+(y.x2-y.x1)*_}else C[0]=v[0];if(typeof v[1]=="string"){const _=parseFloat(v[1])/100,y=t.AABBBounds;C[1]=y.x1+(y.x2-y.x1)*_}else C[1]=v[1]}_s(w,w,[C[0],C[1],0]),sx(w,w,p),_s(w,w,[-C[0],-C[1],0]),ys(n,n,w)}}function cx(n){const{alpha:t,beta:e}=n.attribute;return t||e}let Vu=class{constructor(n){this.creator=n,this.hooks={onAttributeUpdate:new gi(["graphic"]),onSetStage:new gi(["graphic","stage"]),onRemove:new gi(["graphic"]),onRelease:new gi(["graphic"]),onAddIncremental:new gi(["graphic","group","stage"]),onClearIncremental:new gi(["graphic","group","stage"]),beforeUpdateAABBBounds:new gi(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new gi(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new gi(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new he,this.tempAABBBounds2=new he}onAttributeUpdate(n){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(n)}onSetStage(n,t){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(n,t)}onRemove(n){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(n)}onRelease(n){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(n)}onAddIncremental(n,t,e){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(n,t,e)}onClearIncremental(n,t){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(n,t)}beforeUpdateAABBBounds(n,t,e,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(n,t,e,i)}afterUpdateAABBBounds(n,t,e,i,o){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(n,t,e,i,o)}clearAABBBounds(n,t,e){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(n,t,e)}updatePathProxyAABBBounds(n,t){const e=typeof t.pathProxy=="function"?t.pathProxy(t.attribute):t.pathProxy;if(!e)return!1;const i=new ou(n);return qn(e.commandList,i,0,0),!0}updateHTMLTextAABBBounds(n,t,e,i){const{textAlign:o,textBaseline:r}=n;if(n.forceBoundsHeight!=null){const s=nt(n.forceBoundsHeight)?n.forceBoundsHeight:n.forceBoundsHeight(),l=pn(r,s,s);e.set(e.x1,l,e.x2,l+s)}if(n.forceBoundsWidth!=null){const s=nt(n.forceBoundsWidth)?n.forceBoundsWidth:n.forceBoundsWidth(),l=fn(o,s);e.set(l,e.y1,l+s,e.y2)}}combindShadowAABBBounds(n,t){if(t&&t.shadowRoot){const e=t.shadowRoot.AABBBounds;n.union(e)}}transformAABBBounds(n,t,e,i,o){if(!t.empty()){const{scaleX:l=e.scaleX,scaleY:a=e.scaleY,stroke:h=e.stroke,shadowBlur:d=e.shadowBlur,lineWidth:u=e.lineWidth,pickStrokeBuffer:c=e.pickStrokeBuffer,strokeBoundsBuffer:g=e.strokeBoundsBuffer}=n,f=this.tempAABBBounds1,p=this.tempAABBBounds2;if(h&&u){const v=(u+c)/Math.abs(l+a);Zl(f,v,i,g),t.union(f),f.setValue(p.x1,p.y1,p.x2,p.y2)}if(d){const{shadowOffsetX:v=e.shadowOffsetX,shadowOffsetY:m=e.shadowOffsetY}=n,b=d/Math.abs(l+a)*2;Zl(f,b,!1,g+1),f.translate(v,m),t.union(f)}}if(this.combindShadowAABBBounds(t,o),t.empty())return;let r=!0;const s=o.transMatrix;o&&o.isContainer&&(r=!(s.a===1&&s.b===0&&s.c===0&&s.d===1&&s.e===0&&s.f===0)),r&&Qd(t,t,s)}validCheck(n,t,e,i){if(!i||n.forceBoundsHeight!=null||n.forceBoundsWidth!=null||i.shadowRoot||i.isContainer)return!0;const{visible:o=t.visible}=n;return!(!i.valid||!o)||(e.empty()||(i.parent&&e.transformWithMatrix(i.parent.globalTransMatrix),X.graphicService.clearAABBBounds(i,i.stage,e),e.clear()),!1)}updateTempAABBBounds(n){const t=this.tempAABBBounds1,e=this.tempAABBBounds2;return t.setValue(n.x1,n.y1,n.x2,n.y2),e.setValue(n.x1,n.y1,n.x2,n.y2),{tb1:t,tb2:e}}};Vu=hx([st(),ux(0,Ot(q0)),dx("design:paramtypes",[Object])],Vu);const we={x:0,y:0,z:0,lastModelMatrix:null};class vi{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach(e=>this._renderContribitions.push(e)),this._renderContribitions.length&&(this._renderContribitions.sort((e,i)=>i.order-e.order),this._beforeRenderContribitions=this._renderContribitions.filter(e=>e.time===Ut.beforeFillStroke),this._afterRenderContribitions=this._renderContribitions.filter(e=>e.time===Ut.afterFillStroke))}beforeRenderStep(t,e,i,o,r,s,l,a,h,d,u,c,g){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach(f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,i,o,r,s,l,a,h,d,u,c,g)})}afterRenderStep(t,e,i,o,r,s,l,a,h,d,u,c,g){this._afterRenderContribitions&&this._afterRenderContribitions.forEach(f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,i,o,r,s,l,a,h,d,u,c,g)})}valid(t,e,i,o){const{fill:r=e.fill,background:s,stroke:l=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:d=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:c=e.visible}=t.attribute,g=To(a,h,r),f=Eu(a,u),p=cr(r,s),v=Cs(l,d);return!(!t.valid||!c)&&!(!p&&!v)&&!!(g||f||i||o||s)&&{fVisible:g,sVisible:f,doFill:p,doStroke:v}}transform(t,e,i,o=!1){const{x:r=e.x,y:s=e.y,z:l=e.z,scaleX:a=e.scaleX,scaleY:h=e.scaleY,angle:d=e.angle,postMatrix:u}=t.attribute,c=i.modelMatrix,g=i.camera;we.x=r,we.y=s,we.z=l,we.lastModelMatrix=c;const f=g&&(o||cx(t)),p=f?t.transMatrix.onlyTranslate()&&!u:a===1&&h===1&&d===0&&!u;if(f){const v=Le.allocate(),m=Le.allocate();lp(m,t,e),ys(v,c||v,m),we.x=0,we.y=0,we.z=0,i.modelMatrix=v,i.setTransform(1,0,0,1,0,0,!0),Le.free(m)}if(p&&!c){const v=t.getOffsetXY(e);we.x+=v.x,we.y+=v.y,we.z=l,i.setTransformForCurrent()}else if(f)we.x=0,we.y=0,we.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(g&&i.project){const v=t.getOffsetXY(e);we.x+=v.x,we.y+=v.y,this.transformWithoutTranslate(i,we.x,we.y,we.z,a,h,d)}else i.transformFromMatrix(t.transMatrix,!0),we.x=0,we.y=0,we.z=0;return we}transformUseContext2d(t,e,i,o){const r=o.camera;if(this.camera=r,r){const s=t.AABBBounds,l=s.x2-s.x1,a=s.y2-s.y1,h=o.project(0,0,i),d=o.project(l,0,i),u=o.project(l,a,i),c={x:0,y:0},g={x:l,y:0},f={x:l,y:a};o.camera=null;const p=1/(c.x*(f.y-g.y)-g.x*f.y+f.x*g.y+(g.x-f.x)*c.y),v=-(c.y*(u.x-d.x)-g.y*u.x+f.y*d.x+(g.y-f.y)*h.x)*p,m=(g.y*u.y+c.y*(d.y-u.y)-f.y*d.y+(f.y-g.y)*h.y)*p,b=(c.x*(u.x-d.x)-g.x*u.x+f.x*d.x+(g.x-f.x)*h.x)*p,w=-(g.x*u.y+c.x*(d.y-u.y)-f.x*d.y+(f.x-g.x)*h.y)*p,C=(c.x*(f.y*d.x-g.y*u.x)+c.y*(g.x*u.x-f.x*d.x)+(f.x*g.y-g.x*f.y)*h.x)*p,_=(c.x*(f.y*d.y-g.y*u.y)+c.y*(g.x*u.y-f.x*d.y)+(f.x*g.y-g.x*f.y)*h.y)*p;o.setTransform(v,m,b,w,C,_,!0)}}restoreTransformUseContext2d(t,e,i,o){this.camera&&(o.camera=this.camera)}transformWithoutTranslate(t,e,i,o,r,s,l){const a=t.project(e,i,o);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(l,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,i,o,r){const{context:s}=o;if(!s)return;const{renderable:l}=t.attribute;if(l===!1)return;s.highPerformanceSave();const a=this.transform(t,e,s,i),{x:h,y:d,z:u,lastModelMatrix:c}=a;this.z=u,JS(t,s,h,d,o,r)||(this.drawShape(t,s,h,d,o,r),this.z=0,s.modelMatrix!==c&&Le.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}const gx=function(){const n={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 t="";function e(C){const _=new Error(t+": "+C);throw _.source=t,_}function i(){const C=g(o);return t.length>0&&e("Invalid input not EOF"),C}function o(){return r("linear",n.linearGradient,s)||r("radial",n.radialGradient,a)||r("conic",n.conicGradient,l)}function r(C,_,y){return function(x,S){const A=b(x);if(A){b(n.startCall)||e("Missing (");const R=S(A);return b(n.endCall)||e("Missing )"),R}}(_,function(x){const S=y();return S&&(b(n.comma)||e("Missing comma before color stops")),{type:C,orientation:S,colorStops:g(f)}})}function s(){return m("directional",n.sideOrCorner,1)||m("angular",n.angleValue,1)}function l(){return m("angular",n.fromAngleValue,1)}function a(){let C,_,y=h();return y&&(C=[],C.push(y),_=t,b(n.comma)&&(y=h(),y?C.push(y):t=_)),C}function h(){let C=function(){const _=m("shape",/^(circle)/i,0);return _&&(_.style=v()||d()),_}()||function(){const _=m("shape",/^(ellipse)/i,0);return _&&(_.style=p()||d()),_}();if(C)C.at=u();else{const _=d();if(_){C=_;const y=u();y&&(C.at=y)}else{const y=c();y&&(C={type:"default-radial",at:y})}}return C}function d(){return m("extent-keyword",n.extentKeywords,1)}function u(){if(m("position",/^at/,0)){const C=c();return C||e("Missing positioning value"),C}}function c(){const C={x:p(),y:p()};if(C.x||C.y)return{type:"position",value:C}}function g(C){let _=C();const y=[];if(_)for(y.push(_);b(n.comma);)_=C(),_?y.push(_):e("One extra comma");return y}function f(){const C=m("hex",n.hexColor,1)||m("rgba",n.rgbaColor,1)||m("rgb",n.rgbColor,1)||m("literal",n.literalColor,0);return C||e("Expected color definition"),C.length=p(),C}function p(){return m("%",n.percentageValue,1)||m("position-keyword",n.positionKeywords,1)||v()}function v(){return m("px",n.pixelValue,1)||m("em",n.emValue,1)}function m(C,_,y){const x=b(_);if(x)return{type:C,value:x[y]}}function b(C){const _=/^[\n\r\t\s]+/.exec(t);_&&w(_[0].length);const y=C.exec(t);return y&&w(y[0].length),y}function w(C){t=t.substr(C)}return function(C){return t=C.toString(),i()}}();class gr{static IsGradient(t){return!(typeof t=="string"&&!t.includes("gradient"))}static IsGradientStr(t){return typeof t=="string"&&t.includes("gradient")}static Parse(t){if(gr.IsGradientStr(t))try{const e=gx(t)[0];if(e){if(e.type==="linear")return gr.ParseLinear(e);if(e.type==="radial")return gr.ParseRadial(e);if(e.type==="conic")return gr.ParseConic(e)}}catch{return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,o=oe/2,r=parseFloat(e.value)/180*oe-o;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+Gt,stops:i.map(s=>({color:s.value,offset:parseFloat(s.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(i=>({color:i.value,offset:parseFloat(i.length.value)/100}))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,o=oe/2;let r=e.type==="angular"?parseFloat(e.value)/180*oe:0;for(;r<0;)r+=Gt;for(;r>Gt;)r-=Gt;let s=0,l=0,a=0,h=0;return r<o?(s=0,l=1,a=Math.sin(r),h=Math.cos(r)):r<oe?(s=0,l=0,a=Math.cos(r-o),h=Math.sin(r-o)):r<oe+o?(s=1,l=0,a=s-Math.sin(r-oe),h=Math.cos(r-oe)):(s=1,a=s-Math.cos(r-o-oe),h-=Math.sin(r-o-oe)),{gradient:"linear",x0:s,y0:l,x1:a,y1:h,stops:i.map(d=>({color:d.value,offset:parseFloat(d.length.value)/100}))}}}function Fn(n,t,e){let i=t;const{a:o,b:r,c:s,d:l}=n.currentMatrix,a=Math.sign(o)*Math.sqrt(o*o+r*r),h=Math.sign(l)*Math.sqrt(s*s+l*l);return a+h===0?0:(i=i/Math.abs(a+h)*2*e,i)}function ju(n,t,e,i=0,o=0){if(!t||t===!0)return"black";let r,s;if(it(t))for(let l=0;l<t.length&&(s=t[l],!s);l++);else s=t;if(s=gr.Parse(s),typeof s=="string")return s;if(e.AABBBounds&&(!e.attribute||e.attribute.scaleX!==0||e.attribute.scaleY!==0)){const l=e.AABBBounds;let a=l.x2-l.x1,h=l.y2-l.y1,d=l.x1-i,u=l.y1-o;if(e.attribute){const{scaleX:c=1,scaleY:g=1}=e.attribute;a/=c,h/=g,d/=c,u/=g}s.gradient==="linear"?r=fx(n,s,d,u,a,h):s.gradient==="conical"?r=vx(n,s,d,u,a,h):s.gradient==="radial"&&(r=px(n,s,d,u,a,h))}return r||"orange"}function fx(n,t,e,i,o,r){var s,l,a,h;const d=n.createLinearGradient(e+((s=t.x0)!==null&&s!==void 0?s:0)*o,i+((l=t.y0)!==null&&l!==void 0?l:0)*r,e+((a=t.x1)!==null&&a!==void 0?a:1)*o,i+((h=t.y1)!==null&&h!==void 0?h:0)*r);return t.stops.forEach(u=>{d.addColorStop(u.offset,u.color)}),d}function px(n,t,e,i,o,r){var s,l,a,h,d,u;const c=n.createRadialGradient(e+((s=t.x0)!==null&&s!==void 0?s:.5)*o,i+((l=t.y0)!==null&&l!==void 0?l:.5)*r,Math.max(o,r)*((a=t.r0)!==null&&a!==void 0?a:0),e+((h=t.x1)!==null&&h!==void 0?h:.5)*o,i+((d=t.y1)!==null&&d!==void 0?d:.5)*r,Math.max(o,r)*((u=t.r1)!==null&&u!==void 0?u:.5));return t.stops.forEach(g=>{c.addColorStop(g.offset,g.color)}),c}function vx(n,t,e,i,o,r){var s,l;const a=n.createConicGradient(e+((s=t.x)!==null&&s!==void 0?s:0)*o,i+((l=t.y)!==null&&l!==void 0?l:0)*r,t.startAngle,t.endAngle);return t.stops.forEach(h=>{a.addColorStop(h.offset,h.color)}),a.GetPattern(o+e,r+i,void 0)}var mx=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},bx=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},ap=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};class ws{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c,g){var f;const{background:p,backgroundOpacity:v=(f=t.attribute.fillOpacity)!==null&&f!==void 0?f:h.backgroundOpacity,opacity:m=h.opacity,backgroundMode:b=h.backgroundMode,backgroundFit:w=h.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const C=t.resources.get(p);if(C.state!=="success"||!C.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const y=Ht(t.parent).group,{scrollX:x=y.scrollX,scrollY:S=y.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(x,S)}e.clip();const _=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,o,h),e.globalAlpha=v*m,this.doDrawImage(e,C.data,_,b,w),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,o,h),e.globalAlpha=v*m,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,o,r){if(o==="no-repeat")t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=i.width(),l=i.height();let a=s,h=l;if(r&&o!=="repeat"&&(e.width||e.height)){const c=e.width,g=e.height;o==="repeat-x"?(a=c*(l/g),h=l):o==="repeat-y"&&(h=g*(s/c),a=s);const f=t.dpr,p=hr.allocate({width:a,height:h,dpr:f}),v=p.getContext("2d");v&&(v.inuse=!0,v.clearMatrix(),v.setTransformForCurrent(!0),v.clearRect(0,0,a,h),v.drawImage(e,0,0,a,h),e=p.nativeCanvas),hr.free(p)}const d=t.dpr,u=t.createPattern(e,o);u.setTransform&&u.setTransform(new DOMMatrix([1/d,0,0,1/d,0,0])),t.fillStyle=u,t.translate(i.x1,i.y1),t.fillRect(0,0,s,l),t.translate(-i.x1,-i.y1)}}}const Ho=new ws;let nn=class{constructor(n){this.subRenderContribitions=n,this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach(g=>{g.render(n,t,e,i,o,r,s,l,a,h,d,u,c)})}};nn=mx([st(),ap(0,Ot(Me)),ap(0,Ie(Ou)),bx("design:paramtypes",[Object])],nn);class Gu{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,o,r){const s=(t-2*e)/2,l=o.dpr,a=hr.allocate({width:t,height:t,dpr:l}),h=a.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(s,h);const d=o.createPattern(a.nativeCanvas,"repeat");return d.setTransform&&d.setTransform(new DOMMatrix([1/l,0,0,1/l,0,0])),hr.free(a),d}createCirclePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{s.fillStyle=i,s.arc(r,r,r,0,Gt),s.fill()})}createDiamondPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{const l=t/2,a=l;s.fillStyle=i,s.moveTo(l,a-r),s.lineTo(r+l,a),s.lineTo(l,a+r),s.lineTo(l-r,a),s.closePath(),s.fill()})}createRectPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{const l=e,a=l;s.fillStyle=i,s.fillRect(l,a,2*r,2*r)})}createVerticalLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{const l=e;s.fillStyle=i,s.fillRect(l,0,2*r,t)})}createHorizontalLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{const l=e;s.fillStyle=i,s.fillRect(0,l,t,2*r)})}createBiasLRLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{s.strokeStyle=i,s.lineWidth=r,s.moveTo(0,0),s.lineTo(t,t);const l=t/2,a=-l;s.moveTo(l,a),s.lineTo(l+t,a+t),s.moveTo(-l,-a),s.lineTo(-l+t,-a+t),s.stroke()})}createBiasRLLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{s.strokeStyle=i,s.lineWidth=r,s.moveTo(t,0),s.lineTo(0,t);const l=t/2,a=l;s.moveTo(t+l,a),s.lineTo(l,a+t),s.moveTo(t-l,-a),s.lineTo(-l,-a+t),s.stroke()})}createGridPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,(r,s)=>{const l=e,a=l;s.fillStyle=i,s.fillRect(l,a,r,r),s.fillRect(l+r,a+r,r,r)})}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,o,r,s,l,a,h,d,u,c,g){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=h.texture,textureColor:p=h.textureColor,textureSize:v=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;f&&this.drawTexture(f,t,e,i,o,h,p,v,m)}drawTexture(t,e,i,o,r,s,l,a,h){let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(a,h,l,i);break;case"diamond":d=this.createDiamondPattern(a,h,l,i);break;case"rect":d=this.createRectPattern(a,h,l,i);break;case"vertical-line":d=this.createVerticalLinePattern(a,h,l,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(a,h,l,i);break;case"bias-lr":d=this.createBiasLRLinePattern(a,h,l,i);break;case"bias-rl":d=this.createBiasRLLinePattern(a,h,l,i);break;case"grid":d=this.createGridPattern(a,h,l,i)}d&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,o,r,s),i.fillStyle=d,i.fill(),i.highPerformanceRestore())}}const fr=new Gu;class Cx{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const{outerBorder:g,innerBorder:f}=t.attribute,p=g&&g.visible!==!1,v=f&&f.visible!==!1;if(!p&&!v)return;const{innerPadding:m=h.innerPadding,outerPadding:b=h.outerPadding,startAngle:w=h.startAngle,endAngle:C=h.endAngle,opacity:_=h.opacity,x:y=h.x,y:x=h.y,scaleX:S=h.scaleX,scaleY:A=h.scaleY}=t.attribute;let{innerRadius:R=h.innerRadius,outerRadius:T=h.outerRadius}=t.attribute;T+=b,R-=m;const M=(P,k)=>{const B=!(!P||!P.stroke),{distance:H=h[k].distance}=P,E=Fn(e,H,e.dpr),F=H/T,L=k==="outerBorder"?1:-1;if(t.setAttributes({outerRadius:T+L*E,innerRadius:R-L*E,startAngle:w-L*F,endAngle:C+L*F}),e.beginPath(),Lu(t,e,i,o,T+L*E,R-L*E),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,P,h[k]);else if(B){const z=h[k].opacity;h[k].opacity=_,e.setStrokeStyle(t,P,(y-i)/S,(x-o)/A,h[k]),h[k].opacity=z,e.stroke()}};p&&M(g,"outerBorder"),v&&M(f,"innerBorder"),t.setAttributes({outerRadius:T,innerRadius:R,startAngle:w,endAngle:C})}}const _x=new Cx,yx=fr,wx=Ho;class Sx{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const{outerBorder:g,innerBorder:f}=t.attribute,p=g&&g.visible!==!1,v=f&&f.visible!==!1;if(!p&&!v)return;const{radius:m=h.radius,startAngle:b=h.startAngle,endAngle:w=h.endAngle,opacity:C=h.opacity,x:_=h.x,y=h.y,scaleX:x=h.scaleX,scaleY:S=h.scaleY}=t.attribute,A=(R,T)=>{const M=!(!R||!R.stroke),{distance:P=h[T].distance}=R,k=Fn(e,P,e.dpr),B=T==="outerBorder"?1:-1;if(e.beginPath(),e.arc(i,o,m+B*k,b,w),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,R,h[T]);else if(M){const H=h[T].opacity;h[T].opacity=C,e.setStrokeStyle(t,R,(_-i)/x,(y-o)/S,h[T]),h[T].opacity=H,e.stroke()}};p&&A(g,"outerBorder"),v&&A(f,"innerBorder")}}const xx=new Sx,Ax=fr,Rx=Ho;class Tx extends ws{constructor(){super(...arguments),this.time=Ut.beforeFillStroke}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const{background:g,backgroundMode:f=h.backgroundMode,backgroundFit:p=h.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const v=t.resources.get(g);if(v.state!=="success"||!v.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const m=t.AABBBounds;this.doDrawImage(e,v.data,m,f,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=g,e.fill(),e.highPerformanceRestore()}}const Mx=new Tx,la=oe/2;function on(n,t,e,i,o,r,s){let l;if(i<0&&(t+=i,i=-i),o<0&&(e+=o,o=-o),nt(r,!0))l=[r=Jt(r),r,r,r];else if(Array.isArray(r)){const y=r;let x,S;switch(y.length){case 0:l=[0,0,0,0];break;case 1:x=Jt(y[0]),l=[x,x,x,x];break;case 2:case 3:x=Jt(y[0]),S=Jt(y[1]),l=[x,S,x,S];break;default:l=y,l[0]=Jt(l[0]),l[1]=Jt(l[1]),l[2]=Jt(l[2]),l[3]=Jt(l[3])}}else l=[0,0,0,0];if(i<0||l[0]+l[1]+l[2]+l[3]<1e-12)return n.rect(t,e,i,o);const[a,h,d,u]=[[t,e],[t+i,e],[t+i,e+o],[t,e+o]],c=Math.min(i/2,o/2),g=[Math.min(c,l[0]),Math.min(c,l[1]),Math.min(c,l[2]),Math.min(c,l[3])],f=[a[0]+g[0],a[1]],p=[a[0],a[1]+g[0]],v=[h[0]-g[1],h[1]],m=[h[0],h[1]+g[1]],b=[d[0]-g[2],d[1]],w=[d[0],d[1]-g[2]],C=[u[0]+g[3],u[1]],_=[u[0],u[1]-g[3]];if(n.moveTo(f[0],f[1]),s&&s[0]?s[0](f[0],f[1],v[0],v[1]):n.lineTo(v[0],v[1]),!is(v,m)){s&&s[0]&&n.moveTo(v[0],v[1]);const y=v[0],x=v[1]+g[1];n.arc(y,x,g[1],-la,0,!1)}if(s&&s[1]?s[1](m[0],m[1],w[0],w[1]):n.lineTo(w[0],w[1]),!is(b,w)){const y=w[0]-g[2],x=w[1];s&&s[1]&&n.moveTo(w[0],w[1]),n.arc(y,x,g[2],0,la,!1)}if(s&&s[2]?s[2](b[0],b[1],C[0],C[1]):n.lineTo(C[0],C[1]),!is(C,_)){const y=C[0],x=C[1]-g[3];s&&s[2]&&n.moveTo(C[0],C[1]),n.arc(y,x,g[3],la,oe,!1)}if(s&&s[3]?s[3](_[0],_[1],p[0],p[1]):n.lineTo(p[0],p[1]),!is(f,p)){const y=f[0],x=f[1]+g[0];s&&s[3]&&n.moveTo(p[0],p[1]),n.arc(y,x,g[0],oe,oe+la,!1)}return!s&&n.closePath(),n}var hp=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};class dp{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const{outerBorder:g,innerBorder:f}=t.attribute,p=g&&g.visible!==!1,v=f&&f.visible!==!1;if(!p&&!v)return;const{cornerRadius:m=h.cornerRadius,opacity:b=h.opacity,x:w=h.x,y:C=h.y,scaleX:_=h.scaleX,scaleY:y=h.scaleY,x1:x,y1:S}=t.attribute;let{width:A,height:R}=t.attribute;A=(A??x-i)||0,R=(R??S-o)||0;const T=(M,P)=>{const k=!(!M||!M.stroke),B=P==="outerBorder"?-1:1,{distance:H=h[P].distance}=M,E=Fn(e,H,e.dpr),F=i+B*E,L=o+B*E,z=2*E;if(m===0||it(m)&&m.every(D=>D===0)?(e.beginPath(),e.rect(F,L,A-B*z,R-B*z)):(e.beginPath(),on(e,F,L,A-B*z,R-B*z,m)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,M,h[P]);else if(k){const D=h[P].opacity;h[P].opacity=b,e.setStrokeStyle(t,M,(w-i)/_,(C-o)/y,h[P]),h[P].opacity=D,e.stroke()}};p&&T(g,"outerBorder"),v&&T(f,"innerBorder")}}let pr=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c,g){const{stroke:f=h.stroke}=t.attribute;Array.isArray(f)&&f.some(p=>p===!1)&&(g.doStroke=!1)}};pr=hp([st()],pr);let vr=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const{x1:g,y1:f,x:p=h.x,y:v=h.y,stroke:m=h.stroke,cornerRadius:b=h.cornerRadius}=t.attribute;let{width:w,height:C}=t.attribute;if(w=(w??g-p)||0,C=(C??f-v)||0,Array.isArray(m)&&m.some(_=>_===!1)){if(e.setStrokeStyle(t,t.attribute,i,o,h),!(b===0||it(b)&&b.every(_=>_===0))){let _,y=0;return on(e,i,o,w,C,b,new Array(4).fill(0).map((x,S)=>(A,R,T,M)=>{m[S]&&(y===S-1&&m[S]===_||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[S]}),i,o,h),e.beginPath(),e.moveTo(A,R),_=m[S]),y=S,e.lineTo(T,M),e.stroke(),S===3&&e.beginPath())})),void e.stroke()}if(e.beginPath(),e.moveTo(i,o),m[0]?e.lineTo(i+w,o):e.moveTo(i+w,o),m[1]?e.lineTo(i+w,o+C):e.moveTo(i+w,o+C),m[2]?e.lineTo(i,o+C):e.moveTo(i,o+C),m[3]){const _=m[0]?o-e.lineWidth/2:o;e.lineTo(i,_)}else e.moveTo(i,o);e.stroke()}}};vr=hp([st()],vr);const Bx=new dp,Px=fr,Hx=Ho;class Ex extends ws{constructor(){super(...arguments),this.time=Ut.beforeFillStroke}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const{background:g,backgroundMode:f=h.backgroundMode,backgroundFit:p=h.backgroundFit}=t.attribute;if(g)if(t.backgroundImg){const v=t.resources.get(g);if(v.state!=="success"||!v.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const b=Ht(t.parent).group,{scrollX:w=b.scrollX,scrollY:C=b.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(w,C)}const m=t.AABBBounds;this.doDrawImage(e,v.data,m,f,p),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if($t(g)){const{stroke:v,fill:m,lineWidth:b=1,cornerRadius:w=0,expandX:C=0,expandY:_=0}=g;if(!v&&!m)return;e.beginPath();const{x:y,y:x,width:S,height:A}=Lx(t);w?on(e,y-C,x-_,S+2*C,A+2*_,w):e.rect(y-C,x-_,S+2*C,A+2*_),e.globalAlpha=1,m&&(e.fillStyle=m,e.fill()),v&&b>0&&(e.lineWidth=b,e.strokeStyle=v,e.stroke())}else{e.beginPath();const v=t.AABBBounds;e.rect(i,o,v.width(),v.height()),e.fillStyle=g,e.globalAlpha=1,e.fill()}}}function Lx(n){const t=gs(n.attribute.boundsPadding),e=n.AABBBounds;let i=e.x1,o=e.y1,r=e.width(),s=e.height();return nt(t)?(i+=t,o+=t,r-=2*t,s-=2*t):(i+=t[3],o+=t[0],r-=t[1]+t[3],s-=t[0]+t[2]),{x:i,y:o,width:r,height:s}}class Fx extends dp{constructor(){super(...arguments),this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){if(!(t.isGifImage&&t.renderFrame&&t.playing))return super.drawShape(t,e,i,o,r,s,l,a,h,d,u,c);t.renderFrame(e,i,o)}}const kx=new Fx,Ix=new Ex;class zx{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){const g=t.getParsedPath();if(!g)return;const{outerBorder:f,innerBorder:p}=t.attribute,v=f&&f.visible!==!1,m=p&&p.visible!==!1;if(!v&&!m)return;const{size:b=h.size,opacity:w=h.opacity,x:C=h.x,y:_=h.y,scaleX:y=h.scaleX,scaleY:x=h.scaleY}=t.attribute,S=(A,R)=>{const T=!(!A||!A.stroke),{distance:M=h[R].distance}=A,P=Fn(e,M,e.dpr),k=R==="outerBorder"?1:-1;if(e.beginPath(),g.drawOffset(e,b,i,o,k*P)===!1&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),c)c(e,A,h[R]);else if(T){const B=h[R].opacity;h[R].opacity=w,e.setStrokeStyle(t,A,(C-i)/y,(_-o)/x,h[R]),h[R].opacity=B,e.stroke()}};v&&S(f,"outerBorder"),m&&S(p,"innerBorder")}}const Dx=new zx,Ox=fr,Wx=Ho;class Nx extends Gu{constructor(){super(...arguments),this.time=Ut.afterFillStroke}drawShape(t,e,i,o,r,s,l,a,h,d,u,c,g){var f,p,v,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:b=t.attribute}=g||{},{texture:w=(f=t.attribute.texture)!==null&&f!==void 0?f:$l(h,"texture"),textureColor:C=(p=t.attribute.textureColor)!==null&&p!==void 0?p:$l(h,"textureColor"),textureSize:_=(v=t.attribute.textureSize)!==null&&v!==void 0?v:$l(h,"textureSize"),texturePadding:y=(m=t.attribute.texturePadding)!==null&&m!==void 0?m:$l(h,"texturePadding")}=b;w&&this.drawTexture(w,t,e,i,o,h,C,_,y)}}var Vx=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},jx=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},up=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let aa=class extends vi{constructor(n){super(),this.arcRenderContribitions=n,this.numberType=Jl,this.builtinContributions=[_x,wx,yx],this.init(n)}drawArcTailCapPath(n,t,e,i,o,r,s,l){const a=l-s,h=n.getParsedAngle(),d=h.startAngle;let u=h.endAngle;u=l;const c=u>d;let g=!1;if(o<r){const E=o;o=r,r=E}const{outerDeltaAngle:f,xors:p,yors:v,xirs:m,yirs:b,limitedOcr:w,outerCornerRadiusStart:C,outerCornerRadiusEnd:_,maxOuterCornerRadius:y,xore:x,yore:S,xire:A,yire:R,limitedIcr:T,innerDeltaAngle:M,innerStartAngle:P,innerCornerRadiusStart:k,innerCornerRadiusEnd:B,maxInnerCornerRadius:H}=op(n,d,u,r,o);if(w>ae){const E=ii(C,w),F=ii(_,w),L=to(m,b,p,v,o,E,Number(c)),z=to(x,S,A,R,o,F,Number(c));if(w<y&&E===F)t.moveTo(e+L.cx+L.x01,i+L.cy+L.y01),t.arc(e+L.cx,i+L.cy,w,Xt(L.y01,L.x01),Xt(z.y01,z.x01),!c);else{const D=u-a-.03,N=Xt(z.y11,z.x11);t.arc(e,i,o,D,N,!c),F>0&&t.arc(e+z.cx,i+z.cy,F,Xt(z.y11,z.x11),Xt(z.y01,z.x01),!c)}}else t.moveTo(e+p,i+v);if(!(r>ae)||M<.001)t.lineTo(e+A,i+R),g=!0;else if(T>ae){const E=ii(k,T),F=ii(B,T),L=to(A,R,x,S,r,-F,Number(c)),z=to(p,v,m,b,r,-E,Number(c));if(t.lineTo(e+L.cx+L.x01,i+L.cy+L.y01),T<H&&E===F){const D=Xt(z.y01,z.x01);t.arc(e+L.cx,i+L.cy,T,Xt(L.y01,L.x01),D,!c)}else{F>0&&t.arc(e+L.cx,i+L.cy,F,Xt(L.y01,L.x01),Xt(L.y11,L.x11),!c);const D=Xt(L.cy+L.y11,L.cx+L.x11),N=u-a-.03;t.arc(e,i,r,D,N,c)}}else t.lineTo(e+r*Pe(P),i+r*pe(P));return g}drawShape(n,t,e,i,o,r,s,l){const a=Ht(n,r==null?void 0:r.theme).arc,{fill:h=a.fill,stroke:d=a.stroke,x:u=a.x,y:c=a.y,fillStrokeOrder:g=a.fillStrokeOrder}=n.attribute,f=this.valid(n,a,s,l);if(!f)return;const{fVisible:p,sVisible:v,doFill:m,doStroke:b}=f,{outerPadding:w=a.outerPadding,innerPadding:C=a.innerPadding,cap:_=a.cap,forceShowCap:y=a.forceShowCap}=n.attribute;let{outerRadius:x=a.outerRadius,innerRadius:S=a.innerRadius}=n.attribute;x+=w,S-=C;let A=0;const R=(ze(_)&&_||_[0])&&h.gradient==="conical";if(R){const{sc:k,startAngle:B,endAngle:H}=n.getParsedAngle();Jt(H-B)<Gt-ae&&(A=k||0,h.startAngle-=A,h.endAngle-=A)}let T=!1;const{isFullStroke:M,stroke:P}=wS(d);if(m||M){t.beginPath(),Lu(n,t,e,i,x,S),T=!0,t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a),this.beforeRenderStep(n,t,e,i,m,b,p,v,a,o,s,l);const k=()=>{m&&(s?s(t,n.attribute,a):p&&(t.setCommonStyle(n,n.attribute,u-e,c-i,a),t.fill()))},B=()=>{b&&M&&(l?l(t,n.attribute,a):v&&(t.setStrokeStyle(n,n.attribute,u-e,c-i,a),t.stroke()))};g?(B(),k()):(k(),B())}if(!M&&b&&(t.beginPath(),Lu(n,t,e,i,x,S,P),T||this.beforeRenderStep(n,t,e,i,m,b,p,v,a,o,s,l),l?l(t,n.attribute,a):v&&(t.setStrokeStyle(n,n.attribute,e,i,a),t.stroke())),(ze(_)&&_||_[1])&&y){const{startAngle:k,endAngle:B}=n.getParsedAngle();if(Jt(B-k)>=Gt-ae){t.beginPath();const H=Math.abs(x-S)/2/x,{endAngle:E=a.endAngle,fill:F=a.fill}=n.attribute,L=E;this.drawArcTailCapPath(n,t,e,i,x,S,L,L+H),T||this.beforeRenderStep(n,t,e,i,m,b,p,v,a,o,s,l);const z=()=>{if(m){const N=F;if(N.gradient==="conical"){const V=tx(0,0,E,N);s||To&&(t.setCommonStyle(n,n.attribute,e,i,a),t.fillStyle=V,t.fill())}}},D=()=>{b&&(l||v&&(t.setStrokeStyle(n,n.attribute,e,i,a),t.stroke()))};z(),D()}}this.afterRenderStep(n,t,e,i,m,b,p,v,a,o,s,l),R&&(h.startAngle+=A,h.endAngle+=A)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).arc;this._draw(n,o,!1,e,i)}};aa=Vx([st(),up(0,Ot(Me)),up(0,Ie(Fu)),jx("design:paramtypes",[Object])],aa);var Gx=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},Ux=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},cp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let ha=class extends vi{constructor(n){super(),this.circleRenderContribitions=n,this.numberType=Ql,this.builtinContributions=[xx,Rx,Ax],this.init(n)}drawShape(n,t,e,i,o,r,s,l){const a=Ht(n,r==null?void 0:r.theme).circle,{radius:h=a.radius,startAngle:d=a.startAngle,endAngle:u=a.endAngle,x:c=a.x,y:g=a.y,fillStrokeOrder:f=a.fillStrokeOrder}=n.attribute,p=this.valid(n,a,s,l);if(!p)return;const{fVisible:v,sVisible:m,doFill:b,doStroke:w}=p;t.beginPath(),t.arc(e,i,h,d,u),t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a),this.beforeRenderStep(n,t,e,i,b,w,v,m,a,o,s,l);const C=()=>{b&&(s?s(t,n.attribute,a):v&&(t.setCommonStyle(n,n.attribute,c-e,g-i,a),t.fill()))},_=()=>{w&&(l?l(t,n.attribute,a):m&&(t.setStrokeStyle(n,n.attribute,c-e,g-i,a),t.stroke()))};f?(_(),C()):(C(),_()),this.afterRenderStep(n,t,e,i,b,w,v,m,a,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).circle;this._draw(n,o,!1,e,i)}};ha=Gx([st(),cp(0,Ot(Me)),cp(0,Ie(ku)),Ux("design:paramtypes",[Object])],ha);function da(n,t,e,i){if(!t.p1)return;const{offsetX:o=0,offsetY:r=0,offsetZ:s=0}=i||{};if(e===1)t.p2&&t.p3?n.bezierCurveTo(o+t.p1.x,r+t.p1.y,o+t.p2.x,r+t.p2.y,o+t.p3.x,r+t.p3.y,s):n.lineTo(o+t.p1.x,r+t.p1.y,s);else if(t.p2&&t.p3){const[l]=lu(t,e);n.bezierCurveTo(o+l.p1.x,r+l.p1.y,o+l.p2.x,r+l.p2.y,o+l.p3.x,r+l.p3.y,s)}else{const l=t.getPointAt(e);n.lineTo(o+l.x,r+l.y,s)}}function gp(n,t,e,i,o,r,s){var l;let a=t.p0,h=i;if(e&&e.originP1===e.originP2&&(a=e.p0),t.defined)i||(n.lineTo(a.x+o,a.y+r,s),h=!i);else{const{originP1:d,originP2:u}=t;let c;if(d&&d.defined!==!1?c=a:d&&u.defined!==!1&&(c=(l=t.p3)!==null&&l!==void 0?l:t.p1),i){h=!i;const g=c?c.x:t.p0.x,f=c?c.y:t.p0.y;n.moveTo(g+o,f+r,s)}else c&&(h=!i,n.lineTo(c.x+o,c.y+r,s))}return h}function Uu(n,t,e,i,o){const{offsetX:r=0,offsetY:s=0,offsetZ:l=0,mode:a="none",drawConnect:h=!1}=o||{};if(h&&a==="none"||!t)return;let d=!0;const{curves:u}=t;if(e>=1){if(h){let m,b=!0;u.forEach((w,C)=>{w.originP1!==w.originP2&&(b=gp(n,w,m,b,r,s,l)),m=w})}else u.forEach(m=>{m.defined?(d&&n.moveTo(m.p0.x+r,m.p0.y+s,l),da(n,m,1,o),d=!1):d=!0});return}if(e<=0)return;let c;i==="x"?c=re.ROW:i==="y"?c=re.COLUMN:i==="auto"&&(c=t.direction);const g=e*t.tryUpdateLength(c);let f=0,p=!0,v=null;for(let m=0,b=u.length;m<b;m++){const w=u[m],C=w.getLength(c),_=(g-f)/C;if(f+=C,_<0)break;if(h){if(w.originP1===w.originP2){v=w;continue}p=gp(n,w,v,p,r,s,l),v=w}else{if(!w.defined){d=!0;continue}d&&n.moveTo(w.p0.x+r,w.p0.y+s,l),da(n,w,ii(_,1),o),d=!1}}}function Kx(n,t,e,i){const{offsetX:o=0,offsetY:r=0}=i||{},s=t?t.points[t.points.length-1]:e.points[0];n.moveTo(s.x+o,s.y+r),e.points.forEach(l=>{l.defined!==!1?n.lineTo(l.x+o,l.y+r):n.moveTo(l.x+o,l.y+r)})}function $x(n,t,e,i){const{offsetX:o=0,offsetY:r=0}=i||{},{points:s}=e,l=[];for(let a=0;a<s.length;a++)s[a].defined;l.push(s),l.forEach((a,h)=>{var d,u,c,g;const f=t&&h===0?t.points[t.points.length-1]:a[0];n.moveTo(f.x+o,f.y+r),a.forEach(p=>{p.defined!==!1?n.lineTo(p.x+o,p.y+r):n.moveTo(p.x+o,p.y+r)});for(let p=a.length-1;p>=0;p--){const v=a[p];n.lineTo((d=v.x1)!==null&&d!==void 0?d:v.x,(u=v.y1)!==null&&u!==void 0?u:v.y)}n.lineTo((c=f.x1)!==null&&c!==void 0?c:f.x,(g=f.y1)!==null&&g!==void 0?g:f.y),n.closePath()})}var Yx=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Ss=class extends vi{constructor(){super(...arguments),this.numberType=vs}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).line;this._draw(n,o,!1,e,i)}drawSegmentItem(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){var p,v,m,b,w;if(!t)return;n.beginPath();const C=(p=this.z)!==null&&p!==void 0?p:0;Uu(n.camera?n:n.nativeContext,t,a,h,{offsetX:d,offsetY:u,offsetZ:C}),c.cache&&!it(c.cache)&&c.cache.curves.every(T=>T.defined)&&c.attribute.curveType&&c.attribute.curveType.includes("Closed")&&n.closePath(),n.setShadowBlendStyle&&n.setShadowBlendStyle(c,s,l);const{x:_=0,x:y=0}=s;e!==!1&&(g?g(n,s,l):o&&(n.setCommonStyle(c,s,_-d,y-u,l),n.fill())),i!==!1&&(f?f(n,s,l):r&&(n.setStrokeStyle(c,s,_-d,y-u,l),n.stroke()));let{connectedType:x,connectedX:S,connectedY:A,connectedStyle:R}=s;if(it(l)?(x=(v=x??l[0].connectedType)!==null&&v!==void 0?v:l[1].connectedType,S=(m=S??l[0].connectedX)!==null&&m!==void 0?m:l[1].connectedX,A=(b=A??l[0].connectedY)!==null&&b!==void 0?b:l[1].connectedY,R=(w=R??l[0].connectedStyle)!==null&&w!==void 0?w:l[1].connectedStyle):(x=x??l.connectedType,S=S??l.connectedX,A=A??l.connectedY,R=R??l.connectedStyle),x!=="connect"&&x!=="zero"&&(x="none"),x!=="none"){n.beginPath(),Uu(n.camera?n:n.nativeContext,t,a,h,{offsetX:d,offsetY:u,offsetZ:C,drawConnect:!0,mode:x,zeroX:S,zeroY:A});const T=[];it(l)?l.forEach(M=>T.push(M)):T.push(l),T.push(s),e!==!1&&(g?g(n,s,l):o&&(n.setCommonStyle(c,R,_-d,y-u,T),n.fill())),i!==!1&&(f?f(n,s,l):r&&(n.setStrokeStyle(c,R,_-d,y-u,T),n.stroke()))}return!1}drawLinearLineHighPerformance(n,t,e,i,o,r,s,l,a,h,d,u,c){var g;t.beginPath();const f=(g=this.z)!==null&&g!==void 0?g:0,{points:p}=n.attribute,v=p[0];t.moveTo(v.x+s,v.y+l,f);for(let w=1;w<p.length;w++){const C=p[w];t.lineTo(C.x+s,C.y+l,f)}t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a);const{x:m=0,x:b=0}=n.attribute;e!==!1&&(u?u(t,n.attribute,a):o&&(t.setCommonStyle(n,n.attribute,m-s,b-l,a),t.fill())),i!==!1&&(c?c(t,n.attribute,a):r&&(t.setStrokeStyle(n,n.attribute,m-s,b-l,a),t.stroke()))}drawShape(n,t,e,i,o,r,s,l){const a=Ht(n,r==null?void 0:r.theme).line,{fill:h=a.fill,stroke:d=a.stroke,fillOpacity:u=a.fillOpacity,strokeOpacity:c=a.strokeOpacity,segments:g,points:f,closePath:p,curveTension:v=a.curveTension}=n.attribute;if(!this.valid(n,a,s,l))return;let{curveType:m=a.curveType}=n.attribute;p&&m==="linear"&&(m="linearClosed");const{clipRange:b=a.clipRange,clipRangeByDimension:w=a.clipRangeByDimension}=n.attribute;if(b===1&&!g&&!f.some(C=>C.defined===!1)&&m==="linear")return this.drawLinearLineHighPerformance(n,t,!!h,!!d,u,c,e,i,a,o,r,s,l);if(n.shouldUpdateShape()){const{points:C,segments:_}=n.attribute,y=C;if(_&&_.length){let x,S;if(n.cache=_.map((A,R)=>{if(A.points.length<=1&&R===0)return A.points[0]&&(S={endX:A.points[0].x,endY:A.points[0].y,curves:[{defined:A.points[0].defined!==!1}]}),null;R===1?x={x:S.endX,y:S.endY,defined:S.curves[S.curves.length-1].defined}:R>1&&(x.x=S.endX,x.y=S.endY,x.defined=S.curves[S.curves.length-1].defined);const T=xo(A.points,m,{startPoint:x,curveTension:v});return S=T,T}).filter(A=>!!A),m==="linearClosed"){let A;for(let R=0;R<n.cache.length;R++){const T=n.cache[R];for(let M=0;M<T.curves.length;M++)if(T.curves[M].defined){A=T.curves[M].p0;break}if(A)break}n.cache[n.cache.length-1]&&n.cache[n.cache.length-1].lineTo(A.x,A.y,!0)}}else{if(!C||!C.length)return n.cache=null,void n.clearUpdateShapeTag();n.cache=xo(y,m,{curveTension:v})}n.clearUpdateShapeTag()}if(Array.isArray(n.cache)){const C=n.attribute.segments.filter(_=>_.points.length);if(C[0].points.length===1&&C.shift(),b===1){let _=!1;n.cache.forEach((y,x)=>{_||(_=this.drawSegmentItem(t,y,!!h,!!d,u,c,C[x],[a,n.attribute],b,w,e,i,n,s,l))})}else{const _=n.cache.reduce((A,R)=>A+R.getLength(),0),y=b*_;let x=0,S=!1;n.cache.forEach((A,R)=>{if(S)return;const T=A.getLength(),M=(y-x)/T;x+=T,M>0&&(S=this.drawSegmentItem(t,A,!!h,!!d,u,c,C[R],[a,n.attribute],ii(M,1),w,e,i,n,s,l))})}}else this.drawSegmentItem(t,n.cache,!!h,!!d,u,c,n.attribute,a,b,w,e,i,n,s,l)}};Ss=Yx([st()],Ss);function Xx(n,t,e,i){var o;const{drawConnect:r=!1,mode:s="none"}=i||{};if(r&&s==="none")return;const{top:l,bottom:a}=t;if(l.curves.length!==a.curves.length)return;if(e>=1){const y=[],x=[];let S=!0;if(r){let A,R,T=!0;const M=l.curves.length;l.curves.forEach((P,k)=>{const B=a.curves[M-k-1];let H=P,E=B;if(P.originP1===P.originP2)return A=P,void(R=B);if(A&&A.originP1===A.originP2&&(H=A,E=R),P.defined)T||(y.push(H),x.push(E),mr(n,y,x,i),y.length=0,x.length=0,T=!T);else{const{originP1:F,originP2:L}=P;let z,D;F&&F.defined!==!1?(z=H,D=E):F&&L.defined!==!1&&(z=P,D=B),T?(T=!T,y.push(z||P),x.push(D||B)):z&&(T=!T,y.push(z||P),x.push(D||B),mr(n,y,x,i),y.length=0,x.length=0)}A=P}),mr(n,y,x,i)}else{for(let A=0,R=l.curves.length;A<R;A++){const T=l.curves[A];S!==T.defined?(S?(ua(n,y,x,i),y.length=0,x.length=0):(y.push(T),x.push(a.curves[R-A-1])),S=!S):S&&(y.push(T),x.push(a.curves[R-A-1]))}ua(n,y,x,i)}return}if(e<=0)return;let{direction:h}=i||{};const{curves:d}=l,u=(o=d[d.length-1].p3)!==null&&o!==void 0?o:d[d.length-1].p1,c=Jt(u.x-d[0].p0.x),g=Jt(u.y-d[0].p0.y);h=h??(c>g?re.ROW:re.COLUMN),Number.isFinite(c)||(h=re.COLUMN),Number.isFinite(g)||(h=re.ROW);const f=e*(h===re.ROW?c:g);let p=0,v=!0;const m=[],b=[];let w,C,_=!0;for(let y=0,x=l.curves.length;y<x;y++){const S=l.curves[y],A=S.getLength(h),R=(f-p)/A;if(R<0)break;if(p+=A,r){const T=a.curves[x-y-1];let M=S,P=T;if(S.originP1===S.originP2){w=S,C=T;continue}if(w&&w.originP1===w.originP2&&(M=w,P=C),S.defined)_||(m.push(M),b.push(P),mr(n,m,b,i),m.length=0,b.length=0,_=!_);else{const{originP1:k,originP2:B}=S;let H,E;k&&k.defined!==!1?(H=M,E=P):k&&B.defined!==!1&&(H=S,E=T),_?(_=!_,m.push(H||S),b.push(E||T)):H&&(_=!_,m.push(H||S),b.push(E||T),mr(n,m,b,i),m.length=0,b.length=0)}w=S}else{let T=null,M=null;v!==S.defined?(v?(ua(n,m,b,i),m.length=0,b.length=0):(T=S,M=a.curves[x-y-1]),v=!v):v&&(T=S,M=a.curves[x-y-1]),T&&M&&(R<1&&(T=T.p2&&T.p3?lu(T,R)[0]:n0(T,R)[0],M=M.p2&&M.p3?lu(M,1-R)[1]:n0(M,1-R)[1]),T.defined=v,M.defined=v,m.push(T),b.push(M)),T=null,M=null}}r?mr(n,m,b,i):ua(n,m,b,i)}function mr(n,t,e,i){if(t.length<2)return;const{offsetX:o=0,offsetY:r=0,offsetZ:s=0,mode:l}=i||{};let a=t[0];n.moveTo(a.p0.x+o,a.p0.y+r,s),a=t[t.length-1];let h=a.p3||a.p1;n.lineTo(h.x+o,h.y+r,s),a=e[e.length-1],n.lineTo(a.p0.x+o,a.p0.y+r,s),a=e[0],h=a.p3||a.p1,n.lineTo(h.x+o,h.y+r,s),n.closePath()}function ua(n,t,e,i){const{offsetX:o=0,offsetY:r=0,offsetZ:s=0}=i||{};let l=!0;t.forEach(a=>{a.defined?(l&&n.moveTo(a.p0.x+o,a.p0.y+r,s),da(n,a,1,i),l=!1):l=!0}),l=!0;for(let a=e.length-1;a>=0;a--){const h=e[a];h.defined?(l&&n.lineTo(h.p0.x+o,h.p0.y+r,s),da(n,h,1,i),l=!1):l=!0}n.closePath()}const qx=new Nx,Zx=Ho;var Jx=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},Qx=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},fp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Ku=class extends vi{constructor(n){super(),this.areaRenderContribitions=n,this.numberType=Y0,this.builtinContributions=[qx,Zx],this.init(n)}drawLinearAreaHighPerformance(n,t,e,i,o,r,s,l,a,h,d,u,c){var g,f,p;const{points:v}=n.attribute;if(v.length<2)return;t.beginPath();const m=(g=this.z)!==null&&g!==void 0?g:0,b=v[0];t.moveTo(b.x+s,b.y+l,m);for(let _=1;_<v.length;_++){const y=v[_];t.lineTo(y.x+s,y.y+l,m)}for(let _=v.length-1;_>=0;_--){const y=v[_];t.lineTo(((f=y.x1)!==null&&f!==void 0?f:y.x)+s,((p=y.y1)!==null&&p!==void 0?p:y.y)+l,m)}t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a),this.beforeRenderStep(n,t,s,l,!!o,!1,e,!1,a,h,u,null,{attribute:n.attribute});const{x:w=0,x:C=0}=n.attribute;e!==!1&&(u?u(t,n.attribute,a):o&&(t.setCommonStyle(n,n.attribute,w-s,C-l,a),t.fill())),this.afterRenderStep(n,t,s,l,!!o,!1,e,!1,a,h,u,null,{attribute:n.attribute}),(()=>{var _,y;if(i){const{stroke:x=a&&a.stroke}=n.attribute;if(it(x)&&(x[0]||x[2])&&x[1]===!1){if(t.beginPath(),x[0]){t.moveTo(b.x+s,b.y+l,m);for(let S=1;S<v.length;S++){const A=v[S];t.lineTo(A.x+s,A.y+l,m)}}else if(x[2]){const S=v[v.length-1];t.moveTo(S.x+s,S.y+l,m);for(let A=v.length-2;A>=0;A--){const R=v[A];t.lineTo(((_=R.x1)!==null&&_!==void 0?_:R.x)+s,((y=R.y1)!==null&&y!==void 0?y:R.y)+l,m)}}}c?c(t,n.attribute,a):(t.setStrokeStyle(n,n.attribute,w-s,C-l,a),t.stroke())}})()}drawShape(n,t,e,i,o,r,s,l){var a,h,d,u,c,g;const f=Ht(n,r==null?void 0:r.theme).area,{fill:p=f.fill,stroke:v=f.stroke,fillOpacity:m=f.fillOpacity,z:b=f.z,strokeOpacity:w=f.strokeOpacity,curveTension:C=f.curveTension}=n.attribute,_=this.valid(n,f,s,l);if(!_)return;const{doFill:y}=_,x=_.doStroke&&_.sVisible,{clipRange:S=f.clipRange,closePath:A,points:R,segments:T}=n.attribute;let{curveType:M=f.curveType}=n.attribute;if(A&&M==="linear"&&(M="linearClosed"),S===1&&!T&&!R.some(P=>P.defined===!1)&&M==="linear")return this.drawLinearAreaHighPerformance(n,t,!!p,x,m,w,e,i,f,o,r,s,l);if(n.shouldUpdateShape()){if(T&&T.length){let P,k;const B=T.map((F,L)=>{if(F.points.length<=1&&L===0)return F.points[0]&&(k={endX:F.points[0].x,endY:F.points[0].y}),null;L===1?P={x:k.endX,y:k.endY}:L>1&&(P.x=k.endX,P.y=k.endY);const z=xo(F.points,M,{startPoint:P,curveTension:C});return k=z,z}).filter(F=>!!F);let H;const E=[];for(let F=T.length-1;F>=0;F--){const L=T[F].points,z=[];for(let D=L.length-1;D>=0;D--)z.push({x:(a=L[D].x1)!==null&&a!==void 0?a:L[D].x,y:(h=L[D].y1)!==null&&h!==void 0?h:L[D].y});if(F!==0){const D=T[F-1].points,N=D[D.length-1];N&&z.push({x:(d=N.x1)!==null&&d!==void 0?d:N.x,y:(u=N.y1)!==null&&u!==void 0?u:N.y})}z.length>1&&(H=xo(z,M==="stepBefore"?"stepAfter":M==="stepAfter"?"stepBefore":M,{curveTension:C}),E.unshift(H))}n.cacheArea=E.map((F,L)=>({top:B[L],bottom:F}))}else{if(!R||!R.length)return n.cacheArea=null,void n.clearUpdateShapeTag();{const P=R,k=[];for(let E=R.length-1;E>=0;E--)k.push({x:(c=R[E].x1)!==null&&c!==void 0?c:R[E].x,y:(g=R[E].y1)!==null&&g!==void 0?g:R[E].y});const B=xo(P,M,{curveTension:C}),H=xo(k,M==="stepBefore"?"stepAfter":M==="stepAfter"?"stepBefore":M,{curveTension:C});n.cacheArea={top:B,bottom:H}}}n.clearUpdateShapeTag()}if(Array.isArray(n.cacheArea)){const P=n.attribute.segments.filter(k=>k.points.length);if(P[0].points.length===1&&P.shift(),S===1){let k=!1;n.cacheArea.forEach((B,H)=>{k||(k=this.drawSegmentItem(t,B,y,m,x,w,P[H],[f,n.attribute],S,e,i,b,n,o,s,l))})}else{const k=n.cacheArea.reduce((F,L)=>F+L.top.getLength(),0),B=S*k;let H=0,E=!1;n.cacheArea.forEach((F,L)=>{if(E)return;const z=F.top.getLength(),D=(B-H)/z;H+=z,D>0&&(E=this.drawSegmentItem(t,F,y,m,x,w,P[L],[f,n.attribute],ii(D,1),e,i,b,n,o,s,l))})}}else this.drawSegmentItem(t,n.cacheArea,y,m,x,w,n.attribute,f,S,e,i,b,n,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).area;this._draw(n,o,!1,e,i)}drawSegmentItem(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p){let v=!1;return v=v||this._drawSegmentItem(n,t,e,i,o,r,s,l,a,h,d,u,c,g,!1,f,p),v=v||this._drawSegmentItem(n,t,e,i,o,r,s,l,a,h,d,u,c,g,!0,f,p),v}_drawSegmentItem(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v){var m,b,w,C;if(!(t&&t.top&&t.bottom&&t.top.curves&&t.top.curves.length&&t.bottom.curves&&t.bottom.curves.length))return;let{connectedType:_,connectedX:y,connectedY:x,connectedStyle:S}=s;const A=[];if(f&&(it(l)?(_=(m=_??l[0].connectedType)!==null&&m!==void 0?m:l[1].connectedType,y=(b=y??l[0].connectedX)!==null&&b!==void 0?b:l[1].connectedX,x=(w=x??l[0].connectedY)!==null&&w!==void 0?w:l[1].connectedY,S=(C=S??l[0].connectedStyle)!==null&&C!==void 0?C:l[1].connectedStyle):(_=_??l.connectedType,y=y??l.connectedX,x=x??l.connectedY,S=S??l.connectedStyle),_!=="connect"&&_!=="zero"&&(_="none"),it(l)?l.forEach(L=>A.push(L)):A.push(l),A.push(s)),f&&_==="none")return!1;n.beginPath();const{points:R,segments:T}=c.attribute;let M,P,k=re.ROW;if(T){const L=T[T.length-1];P=T[0].points[0],M=L.points[L.points.length-1]}else P=R[0],M=R[R.length-1];const B=Jt(M.x-P.x),H=Jt(M.y-P.y);k=M.x1==null?re.ROW:M.y1==null?re.COLUMN:Number.isFinite(B+H)?B>H?re.ROW:re.COLUMN:re.ROW,Xx(n.camera?n:n.nativeContext,t,a,{offsetX:h,offsetY:d,offsetZ:u,direction:k,drawConnect:f,mode:_,zeroX:y,zeroY:x}),this.beforeRenderStep(c,n,h,d,!!i,!1,e,!1,l,g,p,null,{attribute:s}),n.setShadowBlendStyle&&n.setShadowBlendStyle(c,s,l);const{x:E=0,x:F=0}=s;return e!==!1&&(p?p(n,s,l):i&&(n.setCommonStyle(c,f?S:s,E-h,F-d,f?A:l),n.fill())),this.afterRenderStep(c,n,h,d,!!i,!1,e,!1,l,g,p,null,{attribute:s}),(()=>{if(o!==!1)if(v)v(n,s,l);else{const{stroke:L=l&&l[1]&&l[1].stroke}=s;it(L)&&(L[0]||L[2])&&L[1]===!1&&(n.beginPath(),Uu(n.camera?n:n.nativeContext,L[0]?t.top:t.bottom,a,k===re.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:u,drawConnect:f,mode:_,zeroX:y,zeroY:x})),n.setStrokeStyle(c,f?S:s,E-h,F-d,f?A:l),n.stroke()}})(),!1}};Ku=Jx([st(),fp(0,Ot(Me)),fp(0,Ie(ix)),Qx("design:paramtypes",[Object])],Ku);const tA=fr,eA=Ho;var iA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},nA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},pp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let ca=class extends vi{constructor(n){super(),this.pathRenderContribitions=n,this.numberType=ea,this.builtinContributions=[eA,tA],this.init(n)}drawShape(n,t,e,i,o,r,s,l){var a,h,d;const u=(a=this.tempTheme)!==null&&a!==void 0?a:Ht(n,r==null?void 0:r.theme).path,{x:c=u.x,y:g=u.y,fillStrokeOrder:f=u.fillStrokeOrder}=n.attribute,p=(h=this.z)!==null&&h!==void 0?h:0,v=this.valid(n,u,s,l);if(!v)return;const{fVisible:m,sVisible:b,doFill:w,doStroke:C}=v;if(t.beginPath(),n.pathShape)qn(n.pathShape.commandList,t,e,i,1,1,p);else{const x=(d=n.attribute.path)!==null&&d!==void 0?d:u.path;qn(x.commandList,t,e,i,1,1,p)}t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,u),this.beforeRenderStep(n,t,e,i,w,C,m,b,u,o,s,l);const _=()=>{C&&(l?l(t,n.attribute,u):b&&(t.setStrokeStyle(n,n.attribute,c-e,g-i,u),t.stroke()))},y=()=>{w&&(s?s(t,n.attribute,u):m&&(t.setCommonStyle(n,n.attribute,c-e,g-i,u),t.fill()))};f?(_(),y()):(y(),_()),this.afterRenderStep(n,t,e,i,w,C,m,b,u,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).path;this.tempTheme=o,this._draw(n,o,!1,e,i),this.tempTheme=null}};ca=iA([st(),pp(0,Ot(Me)),pp(0,Ie(Iu)),nA("design:paramtypes",[Object])],ca);var oA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},rA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},vp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let ga=class extends vi{constructor(n){super(),this.rectRenderContribitions=n,this.type="rect",this.numberType=Bu,this.builtinContributions=[Bx,Hx,Px],this.init(n)}drawShape(n,t,e,i,o,r,s,l){var a;const h=(a=this.tempTheme)!==null&&a!==void 0?a:Ht(n,r==null?void 0:r.theme).rect,{fill:d=h.fill,background:u,stroke:c=h.stroke,cornerRadius:g=h.cornerRadius,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:v=h.lineWidth,strokeOpacity:m=h.strokeOpacity,visible:b=h.visible,x1:w,y1:C,x:_=h.x,y=h.y,fillStrokeOrder:x=h.fillStrokeOrder}=n.attribute;let{width:S,height:A}=n.attribute;S=(S??w-_)||0,A=(A??C-y)||0;const R=ip(f,p,S,A,d),T=np(f,m,S,A),M=cr(d,u),P=Cs(c,v);if(!n.valid||!b||!M&&!P||!(R||T||s||l||u))return;g===0||it(g)&&g.every(E=>E===0)?(t.beginPath(),t.rect(e,i,S,A)):(t.beginPath(),on(t,e,i,S,A,g));const k={doFill:M,doStroke:P};t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,h),this.beforeRenderStep(n,t,e,i,M,P,R,T,h,o,s,l,k);const B=()=>{k.doFill&&(s?s(t,n.attribute,h):R&&(t.setCommonStyle(n,n.attribute,_-e,y-i,h),t.fill()))},H=()=>{k.doStroke&&(l?l(t,n.attribute,h):T&&(t.setStrokeStyle(n,n.attribute,_-e,y-i,h),t.stroke()))};x?(H(),B()):(B(),H()),this.afterRenderStep(n,t,e,i,M,P,R,T,h,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).rect;this.tempTheme=o,this._draw(n,o,!1,e,i),this.tempTheme=null}};ga=oA([st(),vp(0,Ot(Me)),vp(0,Ie(Po)),rA("design:paramtypes",[Object])],ga);var sA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},lA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},mp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let fa=class extends vi{constructor(n){super(),this.symbolRenderContribitions=n,this.numberType=na,this.builtinContributions=[Dx,Wx,Ox],this.init(n)}drawShape(n,t,e,i,o,r,s,l){var a;const h=Ht(n,r==null?void 0:r.theme).symbol,{size:d=h.size,x:u=h.x,y:c=h.y,scaleX:g=h.scaleX,scaleY:f=h.scaleY,fillStrokeOrder:p=h.fillStrokeOrder}=n.attribute,v=this.valid(n,h,s,l);if(!v)return;const{fVisible:m,sVisible:b,doFill:w,doStroke:C}=v,_=n.getParsedPath();if(!_)return;const{keepDirIn3d:y=h.keepDirIn3d}=n.attribute,x=(a=this.z)!==null&&a!==void 0?a:0;t.beginPath();const S=(T,M)=>{var P,k,B;if(n._parsedPath.svgCache){const F=Object.assign({},M);F.fill=(P=M.fill)!==null&&P!==void 0?P:n.attribute.fill,F.opacity=(k=M.opacity)!==null&&k!==void 0?k:n.attribute.opacity,F.fillOpacity=n.attribute.fillOpacity,F.stroke=(B=M.stroke)!==null&&B!==void 0?B:n.attribute.stroke,M=F}const H=()=>{M.fill&&(s?s(t,n.attribute,h):(t.setCommonStyle(n,M,u-e,c-i,h),t.fill()))},E=()=>{M.stroke&&(l?l(t,n.attribute,h):(t.setStrokeStyle(n,M,(u-e)/g,(c-i)/f,h),t.stroke()))};p?(E(),H()):(H(),E())};if(y&&t.camera&&t.project){const T=t.project(e,i,x),M=t.camera;t.camera=null,_.draw(t,it(d)?[d[0]*g,d[1]*f]:d*g,T.x,T.y,void 0,S)===!1&&t.closePath(),t.camera=M}else _.draw(t,d,e,i,x,S)===!1&&t.closePath();t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,h),this.beforeRenderStep(n,t,e,i,w,C,m,b,h,o,s,l);const A=()=>{w&&!_.isSvg&&(s?s(t,n.attribute,h):m&&(t.setCommonStyle(n,n.attribute,u-e,c-i,h),t.fill()))},R=()=>{C&&!_.isSvg&&(l?l(t,n.attribute,h):b&&(t.setStrokeStyle(n,n.attribute,(u-e)/g,(c-i)/f,h),t.stroke()))};p?(R(),A()):(A(),R()),this.afterRenderStep(n,t,e,i,w,C,m,b,h,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).symbol;this._draw(n,o,!1,e,i)}};fa=sA([st(),mp(0,Ot(Me)),mp(0,Ie(Du)),lA("design:paramtypes",[Object])],fa);class aA{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new he)}allocate(t,e,i,o){if(!this.pools.length)return new he().setValue(t,e,i,o);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=o,r}allocateByObj(t){if(!this.pools.length)return new he(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 pa=new aA;class hA{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}}const bt=new hA;let va;function ma(n){return va||(va=bt.CreateGraphic("text",{})),va.initAttributes(n),va.AABBBounds}class dA extends ws{constructor(){super(...arguments),this.time=Ut.beforeFillStroke}drawShape(t,e,i,o,r,s,l,a,h,d,u,c){var g,f,p,v,m,b,w,C,_,y;const{backgroundMode:x=h.backgroundMode,backgroundFit:S=h.backgroundFit}=t.attribute;let A,{background:R}=t.attribute;if(!R)return;const T=()=>{t.type==="richtext"&&(e.restore(),e.save(),A&&e.setTransformFromMatrix(A,!0,1))};let M;t.type==="richtext"&&(A=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=$t(R)&&R.background,k=t.transMatrix.onlyTranslate();if(P){const B=t.AABBBounds,H=((g=R.x)!==null&&g!==void 0?g:B.x1)+((f=R.dx)!==null&&f!==void 0?f:0),E=((p=R.y)!==null&&p!==void 0?p:B.y1)+((v=R.dy)!==null&&v!==void 0?v:0),F=(m=R.width)!==null&&m!==void 0?m:B.width(),L=(b=R.height)!==null&&b!==void 0?b:B.height();if(M=pa.allocate(H,E,H+F,E+L),R=R.background,!k){const z=M.width(),D=M.height();M.set(((w=R.x)!==null&&w!==void 0?w:0)+((C=R.dx)!==null&&C!==void 0?C:0),((_=R.y)!==null&&_!==void 0?_:0)+((y=R.dy)!==null&&y!==void 0?y:0),z,D)}}else M=t.AABBBounds,k||(M=ma(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 B=t.resources.get(R);if(B.state!=="success"||!B.data)return void T();e.highPerformanceSave(),k&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,o,h),this.doDrawImage(e,B.data,M,x,S),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:B}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,o,h),e.fillStyle=R,B?(on(e,M.x1,M.y1,M.width(),M.height(),B),e.fill()):e.fillRect(M.x1,M.y1,M.width(),M.height()),e.highPerformanceRestore()}P&&pa.free(M),T()}}const bp=new dA;var uA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},cA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},Cp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let $u=class extends vi{constructor(n){super(),this.textRenderContribitions=n,this.numberType=oa,this.builtinContributions=[bp],this.init(n)}drawShape(n,t,e,i,o,r,s,l){var a,h,d;const u=Ht(n,r==null?void 0:r.theme).text,{text:c,underline:g=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:p=u.keepDirIn3d,direction:v=u.direction,fontSize:m=u.fontSize,verticalMode:b=u.verticalMode,x:w=u.x,y:C=u.y}=n.attribute;let{textAlign:_=u.textAlign,textBaseline:y=u.textBaseline}=n.attribute;if(!b&&v==="vertical"){const H=_;_=(a=n.getBaselineMapAlign()[y])!==null&&a!==void 0?a:"left",y=(h=n.getAlignMapBaseline()[H])!==null&&h!==void 0?h:"top"}const x=(d=Hn(n.attribute.lineHeight,m))!==null&&d!==void 0?d:m,S=this.valid(n,u,s,l);if(!S)return;const{fVisible:A,sVisible:R,doFill:T,doStroke:M}=S,P=!p,k=this.z||0;t.beginPath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,u),this.beforeRenderStep(n,t,e,i,T,M,A,R,u,o,s,l),P&&this.transformUseContext2d(n,u,k,t);const B=(H,E,F,L)=>{let z=e+E;const D=i+F;if(L){t.highPerformanceSave(),z+=m;const N=wi.allocate(1,0,0,1,0,0);N.rotateByCenter(Math.PI/2,z,D),t.transformFromMatrix(N,!0),wi.free(N)}M&&(l?l(t,n.attribute,u):R&&(t.setStrokeStyle(n,n.attribute,w-e,C-i,u),t.strokeText(H,z,D,k))),T&&(s?s(t,n.attribute,u):A&&(t.setCommonStyle(n,n.attribute,w-e,C-i,u),t.fillText(H,z,D,k),this.drawUnderLine(g,f,n,z,D,k,u,t))),L&&(t.highPerformanceRestore(),t.setTransformForCurrent())};if(n.isMultiLine)if(t.setTextStyleWithoutAlignBaseline(n.attribute,u,k),v==="horizontal"){const{multilineLayout:H}=n;if(!H)return void t.highPerformanceRestore();const{xOffset:E,yOffset:F}=H.bbox;M&&(l?l(t,n.attribute,u):R&&(t.setStrokeStyle(n,n.attribute,w-e,C-i,u),H.lines.forEach(L=>{t.strokeText(L.str,(L.leftOffset||0)+E+e,(L.topOffset||0)+F+i,k)}))),T&&(s?s(t,n.attribute,u):A&&(t.setCommonStyle(n,n.attribute,w-e,C-i,u),H.lines.forEach(L=>{t.fillText(L.str,(L.leftOffset||0)+E+e,(L.topOffset||0)+F+i,k),this.drawUnderLine(g,f,n,(L.leftOffset||0)+E+e,(L.topOffset||0)+F+i-nx("bottom",m)-.05*m,k,u,t,{width:L.width})})))}else{n.tryUpdateAABBBounds();const H=n.cache,{verticalList:E}=H;t.textAlign="left",t.textBaseline="top";const F=x*E.length;let L=0;E.forEach(N=>{const V=N.reduce((G,U)=>G+(U.width||0),0);L=Xn(V,L)});let z=0,D=0;y==="bottom"?D=-F:y==="middle"&&(D=-F/2),_==="center"?z-=L/2:_==="right"&&(z-=L),E.forEach((N,V)=>{const G=N.reduce((q,j)=>q+(j.width||0),0),U=L-G;let Z=z;_==="center"?Z+=U/2:_==="right"&&(Z+=U),N.forEach(q=>{const{text:j,width:rt,direction:ht}=q;B(j,F-(V+1)*x+D,Z,ht),Z+=rt})})}else if(v==="horizontal"){t.setTextStyle(n.attribute,u,k);const H=n.clipedText;let E=0;x!==m&&(y==="top"?E=(x-m)/2:y==="middle"||y==="bottom"&&(E=-(x-m)/2)),B(H,0,E,0)}else{n.tryUpdateAABBBounds();const H=n.cache;if(H){t.setTextStyleWithoutAlignBaseline(n.attribute,u,k);const{verticalList:E}=H;let F=0;const L=E[0].reduce((D,N)=>D+(N.width||0),0);let z=0;y==="bottom"?z=-x:y==="middle"&&(z=-x/2),_==="center"?F-=L/2:_==="right"&&(F-=L),t.textAlign="left",t.textBaseline="top",E[0].forEach(D=>{const{text:N,width:V,direction:G}=D;B(N,z,F,G),F+=V})}}P&&this.restoreTransformUseContext2d(n,u,k,t),this.afterRenderStep(n,t,e,i,T,M,A,R,u,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).text,{keepDirIn3d:r=o.keepDirIn3d}=n.attribute,s=!r;this._draw(n,o,s,e,i)}drawUnderLine(n,t,e,i,o,r,s,l,a){if(t+n<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:u=s.fontSize,fill:c=s.fill,opacity:g=s.opacity,underlineOffset:f=s.underlineOffset,underlineDash:p=s.underlineDash,fillOpacity:v=s.fillOpacity}=e.attribute,m=!ct(a),b=m?a.width:e.clipedWidth,w=m?0:fn(h,b),C=pn(m?"alphabetic":d,u,u),_={lineWidth:0,stroke:c,opacity:g,strokeOpacity:v};let y=m?-3:0;if(n){_.lineWidth=n,l.setStrokeStyle(e,_,i,o,s),p&&l.setLineDash(p),l.beginPath();const x=o+C+u+f+y;l.moveTo(i+w,x,r),l.lineTo(i+w+b,x,r),l.stroke()}if(m&&(y=-1),t){_.lineWidth=t,l.setStrokeStyle(e,_,i,o,s),l.beginPath();const x=o+C+u/2+y;l.moveTo(i+w,x,r),l.lineTo(i+w+b,x,r),l.stroke()}}};$u=uA([st(),Cp(0,Ot(Me)),Cp(0,Ie(sa)),cA("design:paramtypes",[Object])],$u);function _p(n,t,e,i){n.moveTo(t[0].x+e,t[0].y+i);for(let o=1;o<t.length;o++)n.lineTo(t[o].x+e,t[o].y+i)}function gA(n,t,e,i,o,r=!0){var s;if(t.length<3)return void _p(n,t,e,i);let l=0,a=t.length-1;r||(l+=1,a-=1,n.moveTo(t[0].x+e,t[0].y+i));for(let h=l;h<=a;h++){const d=t[h===0?a:(h-1)%t.length],u=t[h%t.length],c=t[(h+1)%t.length],g=u.x-d.x,f=u.y-d.y,p=u.x-c.x,v=u.y-c.y,m=(Math.atan2(f,g)-Math.atan2(v,p))/2,b=Math.abs(Math.tan(m));let w=Array.isArray(o)?(s=o[h%t.length])!==null&&s!==void 0?s:0:o,C=w/b;const _=ba(g,f),y=ba(p,v),x=Math.min(_,y);C>x&&(C=x,w=x*b);const S=Yu(u,C,_,g,f),A=Yu(u,C,y,p,v),R=2*u.x-S.x-A.x,T=2*u.y-S.y-A.y,M=ba(R,T),P=Yu(u,ba(C,w),M,R,T);let k=Math.atan2(S.y-P.y,S.x-P.x);const B=Math.atan2(A.y-P.y,A.x-P.x);let H=B-k;H<0&&(k=B,H=-H),H>Math.PI&&(H-=Math.PI),h===0?n.moveTo(S.x+e,S.y+i):n.lineTo(S.x+e,S.y+i),H&&n.arcTo(u.x+e,u.y+i,A.x+e,A.y+i,w),n.lineTo(A.x+e,A.y+i)}r||n.lineTo(t[a+1].x+e,t[a+1].y+i)}function ba(n,t){return Math.sqrt(n*n+t*t)}function Yu(n,t,e,i,o){const r=t/e;return{x:n.x-i*r,y:n.y-o*r}}const fA=fr,pA=Ho;var vA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},mA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},yp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Xu=class extends vi{constructor(n){super(),this.polygonRenderContribitions=n,this.numberType=ia,this.builtinContributions=[pA,fA],this.init(n)}drawShape(n,t,e,i,o,r,s,l){const a=Ht(n,r==null?void 0:r.theme).polygon,{points:h=a.points,cornerRadius:d=a.cornerRadius,x:u=a.x,y:c=a.y,closePath:g=a.closePath,fillStrokeOrder:f=a.fillStrokeOrder}=n.attribute,p=this.valid(n,a,s,l);if(!p)return;const{fVisible:v,sVisible:m,doFill:b,doStroke:w}=p;t.beginPath(),d<=0||it(d)&&d.every(y=>y===0)?_p(t.camera?t:t.nativeContext,h,e,i):gA(t.camera?t:t.nativeContext,h,e,i,d,g),g&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a),this.beforeRenderStep(n,t,e,i,b,w,v,m,a,o,s,l);const C=()=>{b&&(s?s(t,n.attribute,a):v&&(t.setCommonStyle(n,n.attribute,u-e,c-i,a),t.fill()))},_=()=>{w&&(l?l(t,n.attribute,a):m&&(t.setStrokeStyle(n,n.attribute,u-e,c-i,a),t.stroke()))};f?(_(),C()):(C(),_()),this.afterRenderStep(n,t,e,i,b,w,v,m,a,o,s,l)}draw(n,t,e,i){const o=Ht(n,i==null?void 0:i.theme).polygon;this._draw(n,o,!1,e,i)}};Xu=vA([st(),yp(0,Ot(Me)),yp(0,Ie(zu)),mA("design:paramtypes",[Object])],Xu);var bA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},CA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},wp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let qu=class{constructor(n){this.groupRenderContribitions=n,this.numberType=Mu}drawShape(n,t,e,i,o,r,s,l){const a=Ht(n,r==null?void 0:r.theme).group,{fill:h=a.fill,background:d,stroke:u=a.stroke,opacity:c=a.opacity,width:g=a.width,height:f=a.height,clip:p=a.clip,fillOpacity:v=a.fillOpacity,strokeOpacity:m=a.strokeOpacity,cornerRadius:b=a.cornerRadius,path:w=a.path,lineWidth:C=a.lineWidth,visible:_=a.visible,fillStrokeOrder:y=a.fillStrokeOrder,x=a.x,y:S=a.y}=n.attribute,A=ip(c,v,g,f,h),R=np(c,m,g,f),T=cr(h,d),M=Cs(u,C);if(!n.valid||!_||!p&&(!T&&!M||!(A||R||s||l||d)))return;if(w&&w.length&&o.drawContribution){const H=t.disableFill,E=t.disableStroke,F=t.disableBeginPath;t.disableFill=!0,t.disableStroke=!0,t.disableBeginPath=!0,w.forEach(L=>{o.drawContribution.getRenderContribution(L).draw(L,o.renderService,o,r)}),t.disableFill=H,t.disableStroke=E,t.disableBeginPath=F}else b===0||it(b)&&b.every(H=>H===0)?(t.beginPath(),t.rect(e,i,g,f)):(t.beginPath(),on(t,e,i,g,f,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Mx));const P={doFill:T,doStroke:M};this._groupRenderContribitions.forEach(H=>{H.time===Ut.beforeFillStroke&&H.drawShape(n,t,e,i,T,M,A,R,a,o,s,l,P)}),p&&t.clip(),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,n.attribute,a);const k=()=>{P.doFill&&(s?s(t,n.attribute,a):A&&(t.setCommonStyle(n,n.attribute,x-e,S-i,a),t.fill()))},B=()=>{P.doStroke&&(l?l(t,n.attribute,a):R&&(t.setStrokeStyle(n,n.attribute,x-e,S-i,a),t.stroke()))};y?(B(),k()):(k(),B()),this._groupRenderContribitions.forEach(H=>{H.time===Ut.afterFillStroke&&H.drawShape(n,t,e,i,T,M,A,R,a,o,s,l)})}draw(n,t,e,i){const{context:o}=e;if(!o)return;const{clip:r,baseOpacity:s=1}=n.attribute;r?o.save():o.highPerformanceSave();const l=o.baseGlobalAlpha;o.baseGlobalAlpha*=s;const a=Ht(n,i==null?void 0:i.theme).group,h=o.modelMatrix;if(o.camera){const g=Le.allocate(),f=Le.allocate();lp(f,n,a),ys(g,h||g,f),o.modelMatrix=g,Le.free(f),o.setTransform(1,0,0,1,0,0,!0)}else o.transformFromMatrix(n.transMatrix,!0);o.beginPath(),i.skipDraw?this.drawShape(n,o,0,0,e,i,()=>!1,()=>!1):this.drawShape(n,o,0,0,e);const{scrollX:d=a.scrollX,scrollY:u=a.scrollY}=n.attribute;let c;(d||u)&&o.translate(d,u),i&&i.drawingCb&&(c=i.drawingCb()),o.modelMatrix!==h&&Le.free(o.modelMatrix),o.modelMatrix=h,o.baseGlobalAlpha=l,c&&c.then?c.then(()=>{r?o.restore():o.highPerformanceRestore()}):r?o.restore():o.highPerformanceRestore()}};qu=bA([st(),wp(0,Ot(Me)),wp(0,Ie(tn)),CA("design:paramtypes",[Object])],qu);var _A=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},yA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},Sp=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};const wA=["","repeat-x","repeat-y","repeat"];let Zu=class extends vi{constructor(n){super(),this.imageRenderContribitions=n,this.numberType=ta,this.builtinContributions=[kx,Ix],this.init(n)}drawShape(n,t,e,i,o,r,s,l){const a=Ht(n).image,{width:h=a.width,height:d=a.height,repeatX:u=a.repeatX,repeatY:c=a.repeatY,x:g=a.x,y:f=a.y,cornerRadius:p=a.cornerRadius,fillStrokeOrder:v=a.fillStrokeOrder,image:m}=n.attribute,b=this.valid(n,a,s);if(!b)return;const{fVisible:w,sVisible:C,doFill:_,doStroke:y}=b;t.setShadowBlendStyle&&t.setShadowBlendStyle(n,a),this.beforeRenderStep(n,t,e,i,_,!1,w,!1,a,o,s);const x=()=>{if(_){if(s)s(t,n.attribute,a);else if(w){if(!m||!n.resources)return;const A=n.resources.get(m);if(A.state!=="success")return;let R=!1;p===0||it(p)&&p.every(M=>M===0)||(t.beginPath(),on(t,e,i,h,d,p),t.save(),t.clip(),R=!0),t.setCommonStyle(n,n.attribute,e,i,a);let T=0;if(u==="repeat"&&(T|=1),c==="repeat"&&(T|=2),T){const M=t.createPattern(A.data,wA[T]);t.fillStyle=M,t.translate(e,i,!0),t.fillRect(0,0,h,d),t.translate(-e,-i,!0)}else t.drawImage(A.data,e,i,h,d);R&&t.restore()}}},S=()=>{y&&(l?l(t,n.attribute,a):C&&(t.setStrokeStyle(n,n.attribute,g-e,f-i,a),t.stroke()))};v?(S(),x()):(x(),S()),this.afterRenderStep(n,t,e,i,_,!1,w,!1,a,o,s)}draw(n,t,e){const{image:i}=n.attribute;if(!n.isGifImage){if(!i||!n.resources)return;const s=n.resources.get(i);if(s.state==="loading"&&Qt(i))return void ee.improveImageLoading(i);if(s.state!=="success")return}const{context:o}=t.drawParams;if(!o)return;const r=Ht(n).image;this._draw(n,r,!1,e)}};Zu=_A([st(),Sp(0,Ot(Me)),Sp(0,Ie(Bo)),yA("design:paramtypes",[Object])],Zu);const xp=Symbol.for("IncrementalDrawContribution"),Ca=Symbol.for("ArcRender"),_a=Symbol.for("CircleRender"),hi=Symbol.for("GraphicRender"),Ap=Symbol.for("GroupRender"),ya=Symbol.for("LineRender"),wa=Symbol.for("PathRender"),Sa=Symbol.for("PolygonRender"),xa=Symbol.for("RectRender"),Aa=Symbol.for("SymbolRender"),Ju=Symbol.for("TextRender"),Qu=Symbol.for("RichTextRender"),Rp=Symbol.for("ImageRender"),tc=Symbol.for("DrawContribution"),Tp=(n,t,e,i)=>{let o,r=!1,s=!1;if(t.forEachChildren(l=>(r=l.numberType===GS,!r)),t.forEachChildren(l=>(s=!!l.findFace,!s)),r){const l=t.getChildren(),a=[...l];a.sort((h,d)=>{var u,c,g,f;let p=((c=(u=h.attribute.startAngle)!==null&&u!==void 0?u:0+h.attribute.endAngle)!==null&&c!==void 0?c:0)/2,v=((f=(g=d.attribute.startAngle)!==null&&g!==void 0?g:0+d.attribute.endAngle)!==null&&f!==void 0?f:0)/2;for(;p<0;)p+=Gt;for(;v<0;)v+=Gt;return v-p}),a.forEach(h=>{h._next=null,h._prev=null}),t.removeAllChild(),t.update(),a.forEach(h=>{t.appendChild(h)}),i.hack_pieFace="outside",o=e(r,s),o&&o.graphic||(i.hack_pieFace="inside",o=e(r,s)),o&&o.graphic||(i.hack_pieFace="top",o=e(r,s)),t.removeAllChild(),l.forEach(h=>{h._next=null,h._prev=null}),l.forEach(h=>{t.appendChild(h)})}else if(s){const l=t.getChildren(),a=l.map(h=>({ave_z:h.findFace().vertices.map(d=>{var u;return n.view(d[0],d[1],(u=d[2]+h.attribute.z)!==null&&u!==void 0?u:0)[2]}).reduce((d,u)=>d+u,0),g:h}));a.sort((h,d)=>d.ave_z-h.ave_z),t.removeAllChild(),a.forEach(h=>{h.g._next=null,h.g._prev=null}),t.update(),a.forEach(h=>{t.add(h.g)}),o=e(r,s),t.removeAllChild(),l.forEach(h=>{h._next=null,h._prev=null}),t.update(),l.forEach(h=>{t.add(h)})}else o=e(r,s);return o};var SA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},xA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};const xs=Symbol.for("DrawItemInterceptor"),Mp=new he,Bp=new he;class AA{constructor(){this.order=1}afterDrawItem(t,e,i,o,r){return t.attribute.shadowRootIdx==null&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,o,r),!1}beforeDrawItem(t,e,i,o,r){return t.attribute.shadowRootIdx==null&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,o,r),!1}drawItem(t,e,i,o,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),o.dirtyBounds&&o.backupDirtyBounds){Mp.copy(o.dirtyBounds),Bp.copy(o.backupDirtyBounds);const l=t.globalTransMatrix.getInverse();o.dirtyBounds.copy(o.backupDirtyBounds).transformWithMatrix(l),o.backupDirtyBounds.copy(o.dirtyBounds)}return o.renderGroup(t.shadowRoot,i,wi.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),o.dirtyBounds&&o.backupDirtyBounds&&(o.dirtyBounds.copy(Mp),o.backupDirtyBounds.copy(Bp)),!0}}class RA{constructor(){this.order=1}afterDrawItem(t,e,i,o,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,o,r),!1}drawItem(t,e,i,o,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const l=t.AABBBounds;return t.attribute._debug_bounds!==!0&&t.attribute._debug_bounds(s,t),s.strokeRect(l.x1,l.y1,l.width(),l.height()),s.highPerformanceRestore(),!0}}let Ra=class{constructor(){this.order=1,this.interceptors=[new AA,new MA,new TA,new RA]}afterDrawItem(n,t,e,i,o){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(n,t,e,i,o))return!0;return!1}beforeDrawItem(n,t,e,i,o){if((!n.in3dMode||e.in3dInterceptor)&&!n.shadowRoot&&!(n.baseGraphic||n.attribute.globalZIndex||n.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(n,t,e,i,o))return!0;return!1}};Ra=SA([st(),xA("design:paramtypes",[])],Ra);class TA{constructor(){this.order=1}beforeDrawItem(t,e,i,o,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,o,r):this.beforeSetInteractive(t,e,i,o,r))}beforeSetInteractive(t,e,i,o,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const l=i.stage.getLayer("_builtin_interactive");return l&&this.getShadowRoot(l).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const l=i.stage.getLayer("_builtin_interactive");l&&this.getShadowRoot(l).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,o,r){const s=t.baseGraphic;let l=!!s.stage,a=s.parent;for(;l&&a&&a.stage!==a;)l=!!a.stage,a=a.parent;if(!l){const h=i.stage.getLayer("_builtin_interactive");return h&&this.getShadowRoot(h).removeChild(t),!0}if(s){this.processing=!0;const{context:h}=i;return h.highPerformanceSave(),h.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?o.renderGroup(s,i,s.parent.globalTransMatrix):o.renderItem(s,i),h.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=bt.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),(e=i.shadowRoot)!==null&&e!==void 0?e:i.attachShadow()}}class MA{constructor(){this.order=1}beforeDrawItem(t,e,i,o,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:l}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=l.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const h=Le.allocate();Wu(h,a);const d=s.modelMatrix;if(d){if(h){const u=Le.allocate();s.modelMatrix=ys(u,d,h)}}else s.modelMatrix=h;return s.setTransform(1,0,0,1,0,0,!0),t.isContainer?Tp(s,t,(u,c)=>o.renderGroup(t,i,t.parent.globalTransMatrix,!u&&c),i):o.renderItem(t,i),s.camera=null,s.restore(),s.modelMatrix!==d&&Le.free(s.modelMatrix),s.modelMatrix=d,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var BA=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},PA=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},HA=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};const Pp=Symbol.for("RenderService");let ec=class{constructor(n){this.drawContribution=n}prepare(n){n&&this.renderTreeRoots.forEach(t=>{this._prepare(t,n)})}_prepare(n,t){n.forEachChildren(e=>{this._prepare(e,t)}),n.update({bounds:t,trans:!0})}prepareRenderList(){}beforeDraw(n){}draw(n){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(n){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(n,t){this.renderTreeRoots=n,this.drawParams=t;const e=t.updateBounds;this.prepare(e),this.prepareRenderList(),this.beforeDraw(t),this.draw(t),this.afterDraw(t),this.drawParams=null}};ec=BA([st(),HA(0,Ot(tc)),PA("design:paramtypes",[Object])],ec);const EA=new Bt(n=>{n(Pp).to(ec)}),br=Symbol.for("PickerService"),Hp=Symbol.for("GlobalPickerService"),As=(n,t,e)=>{const{outerBorder:i,shadowBlur:o=t.shadowBlur}=n;if(i){const r=t.outerBorder,{distance:s=r.distance,lineWidth:l=r.lineWidth}=i;e.expand(s+(o+l)/2)}return e},Ep=["radius","startAngle","endAngle",...zi];class Rs extends pi{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Ql}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return Ht(this).circle}updateAABBBounds(t,e,i,o){this.updatePathProxyAABBBounds(i)||(o?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=X.graphicService.updateTempAABBBounds(i);return As(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),X.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:o=e.radius}=t;return i.set(-o,-o,o,o),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:o=e.startAngle,endAngle:r=e.endAngle,radius:s=e.radius}=t;return r-o>Gt-ae?i.set(-s,-s,s,s):Au(o,r,s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Ep)}needUpdateTag(t){return super.needUpdateTag(t,Ep)}toCustomPath(){var t,e,i;const o=this.attribute,r=(t=o.radius)!==null&&t!==void 0?t:this.getDefaultAttribute("radius"),s=(e=o.startAngle)!==null&&e!==void 0?e:this.getDefaultAttribute("startAngle"),l=(i=o.endAngle)!==null&&i!==void 0?i:this.getDefaultAttribute("endAngle"),a=new Ue;return a.arc(0,0,r,s,l),a}clone(){return new Rs(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rs.NOWORK_ANIMATE_ATTR}}Rs.NOWORK_ANIMATE_ATTR=Ji;function Lp(n){return new Rs(n)}class ic{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if(e==="left"||e==="start")t.xOffset=0;else if(e==="center")t.xOffset=t.width/-2;else{if(e!=="right"&&e!=="end")throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset=i==="top"?0:i==="middle"?t.height/-2:i==="alphabetic"?-.79*t.height:-t.height,t}GetLayout(t,e,i,o,r,s,l,a,h){const d=[],u=[e,i],c=[0,0];for(;t.length>0;){const{str:f}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,l,a,h);d.push({str:f,width:this.textMeasure.measureTextWidth(f,this.textOptions)}),t=t.substring(f.length)}o==="left"||o==="start"||(o==="center"?c[0]=u[0]/-2:o!=="right"&&o!=="end"||(c[0]=-u[0])),r==="top"||(r==="middle"?c[1]=u[1]/-2:r==="bottom"&&(c[1]=-u[1]));const g={xOffset:c[0],yOffset:c[1],width:u[0],height:u[1]};return this.layoutWithBBox(g,d,o,r,s)}GetLayoutByLines(t,e,i,o,r="",s,l,a="end"){t=t.map(c=>c.toString());const h=[],d=[0,0];if(typeof l=="number"&&l!==1/0){let c;for(let g=0,f=t.length;g<f;g++)c=Math.min(this.textMeasure.measureTextWidth(t[g],this.textOptions),l),h.push({str:this.textMeasure.clipTextWithSuffix(t[g],this.textOptions,c,r,s,a).str,width:c});d[0]=l}else{let c,g;l=0;for(let f=0,p=t.length;f<p;f++)g=t[f],c=this.textMeasure.measureTextWidth(g,this.textOptions),l=Math.max(l,c),h.push({str:g,width:c});d[0]=l}d[1]=h.length*o,d[0]=h.reduce((c,g)=>Math.max(c,g.width),0);const u={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(u,e,i),this.layoutWithBBox(u,h,e,i,o)}layoutWithBBox(t,e,i,o,r){const s=[0,0],l=e.length*r;o==="top"||(o==="middle"?s[1]=(t.height-l)/2:o==="bottom"&&(s[1]=t.height-l));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,o,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:o}}lineOffset(t,e,i,o,r,s){return i==="left"||i==="start"?e.leftOffset=0:i==="center"?e.leftOffset=(t.width-e.width)/2:i!=="right"&&i!=="end"||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const Fp=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...zi];class fe extends pi{get font(){const t=this.getGraphicTheme();return this._font||(this._font=Fl(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme();if(!this.isSimplify())return;const{maxLineWidth:o=i.maxLineWidth}=e;return Number.isFinite(o)?(this.tryUpdateAABBBounds(),this.cache.clipedText):((t=e.text)!==null&&t!==void 0?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),o=this.attribute,{maxLineWidth:r=i.maxLineWidth,text:s,whiteSpace:l=i.whiteSpace}=o;if(!Number.isFinite(r))return!1;if(this.tryUpdateAABBBounds(),(e=(t=this.cache)===null||t===void 0?void 0:t.layoutData)===null||e===void 0?void 0:e.lines){let a="";return this.cache.layoutData.lines.forEach(h=>{a+=h.str}),(Array.isArray(s)?s.join(""):s)!==a}return o.direction==="vertical"&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map(a=>a.text).join("")!==o.text.toString():this.clipedText!=null&&this.clipedText!==o.text.toString()}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&this.attribute.direction!=="vertical"}get isMultiLine(){return Array.isArray(this.attribute.text)||this.attribute.whiteSpace==="normal"}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=oa,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return it(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}getGraphicTheme(){return Ht(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const h=this.AABBBounds;return this._OBBBounds.setValue(h.x1,h.y1,h.x2,h.y2),this._OBBBounds}this.obbText||(this.obbText=new fe({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const o=this.obbText.AABBBounds,{x:r,y:s}=e,l={x:(o.x1+o.x2)/2,y:(o.y1+o.y2)/2},a=or(l,i,{x:r,y:s});return this._OBBBounds.copy(o),this._OBBBounds.translate(a.x-l.x,a.y-l.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:o=e.text}=this.attribute;Array.isArray(o)?this.updateMultilineAABBBounds(o):this.updateSingallineAABBBounds(o);const{tb1:r}=X.graphicService.updateTempAABBBounds(i),{scaleX:s=e.scaleX,scaleY:l=e.scaleY,shadowBlur:a=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(a){const d=a/Math.abs(s+l);Zl(r,d,!0,h),i.union(r)}return X.graphicService.combindShadowAABBBounds(i,this),t.forceBoundsHeight==null&&t.forceBoundsWidth==null||X.graphicService.updateHTMLTextAABBBounds(t,e,i),Qd(i,i,this.transMatrix),i}updateWrapAABBBounds(t){var e,i,o,r;const s=this.getGraphicTheme(),{fontFamily:l=s.fontFamily,textAlign:a=s.textAlign,textBaseline:h=s.textBaseline,fontSize:d=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:c,stroke:g=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:v=s.fontWeight,ignoreBuf:m=s.ignoreBuf,suffixPosition:b=s.suffixPosition,heightLimit:w=0,lineClamp:C}=this.attribute,_=(e=Hn(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))!==null&&e!==void 0?e:this.attribute.fontSize||s.fontSize,y=m?0:2;if(!this.shouldUpdateShape()&&(!((i=this.cache)===null||i===void 0)&&i.layoutData)){const B=this.cache.layoutData.bbox;return this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=X.graphicUtil.textMeasure,S=new ic(l,{fontSize:d,fontWeight:v,fontFamily:l},x),A=it(t)?t.map(B=>B.toString()):[t.toString()],R=[],T=[0,0];let M=1/0;if(w>0&&(M=Math.max(Math.floor(w/_),1)),C&&(M=Math.min(M,C)),typeof c=="number"&&c!==1/0){if(c>0)for(let H=0;H<A.length;H++){const E=A[H];let F=!0;if(H===M-1){const D=S.textMeasure.clipTextWithSuffix(E,S.textOptions,c,u,!1,b,H!==A.length-1);R.push({str:D.str,width:D.width});break}const L=S.textMeasure.clipText(E,S.textOptions,c,p!=="break-all",p==="keep-all");if(E!==""&&L.str===""||L.wordBreaked){if(u){const D=S.textMeasure.clipTextWithSuffix(E,S.textOptions,c,u,!1,b);L.str=(o=D.str)!==null&&o!==void 0?o:"",L.width=(r=D.width)!==null&&r!==void 0?r:0}else L.str="",L.width=0;F=!1}R.push({str:L.str,width:L.width});let z=L.str.length;if(!L.wordBreaked||E!==""&&L.str===""||(F=!0,z=L.wordBreaked),L.str.length!==E.length){if(F){let D=E.substring(z);p==="keep-all"&&(D=D.replace(/^\s+/g,"")),A.splice(H+1,0,D)}}}let B=0;R.forEach(H=>{B=Math.max(B,H.width)}),T[0]=B}else{let B,H,E=0;for(let F=0,L=A.length;F<L;F++){if(F===M-1){const z=S.textMeasure.clipTextWithSuffix(A[F],S.textOptions,c,u,!1,b);R.push({str:z.str,width:z.width}),E=Math.max(E,z.width);break}H=A[F],B=S.textMeasure.measureTextWidth(H,S.textOptions,p==="break-word"),E=Math.max(E,B),R.push({str:H,width:B})}T[0]=E}T[1]=R.length*(_+y);const P={xOffset:0,yOffset:0,width:T[0],height:T[1]};S.LayoutBBox(P,a,h);const k=S.layoutWithBBox(P,R,a,h,_);return this.cache.layoutData=k,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,r=i==="horizontal"?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return i==="horizontal"&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),r}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,r=i==="horizontal"?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return i==="horizontal"&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),r}updateHorizontalSinglelineAABBBounds(t){var e,i;const o=this.getGraphicTheme(),{wrap:r=o.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds([t]);const s=X.graphicUtil.textMeasure;let l,a;const h=this.attribute,{maxLineWidth:d=o.maxLineWidth,ellipsis:u=o.ellipsis,textAlign:c=o.textAlign,textBaseline:g=o.textBaseline,fontFamily:f=o.fontFamily,fontSize:p=o.fontSize,fontWeight:v=o.fontWeight,stroke:m=o.stroke,lineWidth:b=o.lineWidth,ignoreBuf:w=o.ignoreBuf,whiteSpace:C=o.whiteSpace,suffixPosition:_=o.suffixPosition}=h;if(C==="normal")return this.updateWrapAABBBounds(t);const y=w?0:Math.max(2,.075*p),x=h.fontSize||o.fontSize,S=(e=Hn(h.lineHeight,x))!==null&&e!==void 0?e:x+y;if(!this.shouldUpdateShape()&&this.cache){l=(i=this.cache.clipedWidth)!==null&&i!==void 0?i:0;const M=fn(c,l),P=pn(g,S,p);return this._AABBBounds.set(M,P,M+l,P+S),m&&this._AABBBounds.expand(b/2),this._AABBBounds}if(Number.isFinite(d)){if(u){const M=u===!0?o.ellipsis:u,P=s.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:v,fontFamily:f},d,M,!1,_);a=P.str,l=P.width}else{const M=s.clipText(t.toString(),{fontSize:p,fontWeight:v,fontFamily:f},d,!1);a=M.str,l=M.width}this.cache.clipedText=a,this.cache.clipedWidth=l}else l=s.measureTextWidth(t.toString(),{fontSize:p,fontWeight:v,fontFamily:f}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=l;this.clearUpdateShapeTag();const A=fn(c,l);let R=S;X.global&&X.global.isSafari()&&(R+=.2*p);const T=pn(g,R,p,y);return this._AABBBounds.set(A,T,A+l,T+R),m&&this._AABBBounds.expand(b/2),this._AABBBounds}getBaselineMapAlign(){return fe.baselineMapAlign}getAlignMapBaseline(){return fe.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,i,o;const r=this.getGraphicTheme(),s=X.graphicUtil.textMeasure;let l;const a=this.attribute,{ignoreBuf:h=r.ignoreBuf}=a,d=h?0:2,{maxLineWidth:u=r.maxLineWidth,ellipsis:c=r.ellipsis,fontSize:g=r.fontSize,fontWeight:f=r.fontWeight,fontFamily:p=r.fontFamily,stroke:v=r.stroke,lineWidth:m=r.lineWidth,verticalMode:b=r.verticalMode,suffixPosition:w=r.suffixPosition}=a,C=(e=Hn(a.lineHeight,a.fontSize||r.fontSize))!==null&&e!==void 0?e:(a.fontSize||r.fontSize)+d;let{textAlign:_=r.textAlign,textBaseline:y=r.textBaseline}=a;if(!b){const R=_;_=(i=fe.baselineMapAlign[y])!==null&&i!==void 0?i:"left",y=(o=fe.alignMapBaseline[R])!==null&&o!==void 0?o:"top"}if(!this.shouldUpdateShape()&&this.cache){l=this.cache.clipedWidth;const R=fn(_,l),T=pn(y,C,g);return this._AABBBounds.set(T,R,T+C,R+l),v&&this._AABBBounds.expand(m/2),this._AABBBounds}let x=[U0(t.toString())];if(Number.isFinite(u)){if(c){const R=c===!0?r.ellipsis:c,T=s.clipTextWithSuffixVertical(x[0],{fontSize:g,fontWeight:f,fontFamily:p},u,R,!1,w);x=[T.verticalList],l=T.width}else{const R=s.clipTextVertical(x[0],{fontSize:g,fontWeight:f,fontFamily:p},u,!1);x=[R.verticalList],l=R.width}this.cache.verticalList=x,this.cache.clipedWidth=l}else l=0,x[0].forEach(R=>{const T=R.direction===Ro.HORIZONTAL?g:s.measureTextWidth(R.text,{fontSize:g,fontWeight:f,fontFamily:p});l+=T,R.width=T}),this.cache.verticalList=x,this.cache.clipedWidth=l;this.clearUpdateShapeTag();const S=fn(_,l),A=pn(y,C,g);return this._AABBBounds.set(A,S,A+C,S+l),v&&this._AABBBounds.expand(m/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const o=this.getGraphicTheme(),{wrap:r=o.wrap}=this.attribute;if(r)return this.updateWrapAABBBounds(t);const s=this.attribute,{fontFamily:l=o.fontFamily,textAlign:a=o.textAlign,textBaseline:h=o.textBaseline,fontSize:d=o.fontSize,fontWeight:u=o.fontWeight,ellipsis:c=o.ellipsis,maxLineWidth:g,stroke:f=o.stroke,lineWidth:p=o.lineWidth,whiteSpace:v=o.whiteSpace,suffixPosition:m=o.suffixPosition}=s,b=(e=Hn(s.lineHeight,s.fontSize||o.fontSize))!==null&&e!==void 0?e:s.fontSize||o.fontSize;if(v==="normal")return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(!((i=this.cache)===null||i===void 0)&&i.layoutData)){const y=this.cache.layoutData.bbox;return this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}const w=X.graphicUtil.textMeasure,C=new ic(l,{fontSize:d,fontWeight:u,fontFamily:l},w).GetLayoutByLines(t,a,h,b,c===!0?o.ellipsis:c||void 0,!1,g,m),{bbox:_}=C;return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(_.xOffset,_.yOffset,_.xOffset+_.width,_.yOffset+_.height),f&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,o;const r=this.getGraphicTheme(),s=X.graphicUtil.textMeasure;let l;const a=this.attribute,{ignoreBuf:h=r.ignoreBuf}=a,d=h?0:2,{maxLineWidth:u=r.maxLineWidth,ellipsis:c=r.ellipsis,fontFamily:g=r.fontFamily,fontSize:f=r.fontSize,fontWeight:p=r.fontWeight,stroke:v=r.stroke,lineWidth:m=r.lineWidth,verticalMode:b=r.verticalMode,suffixPosition:w=r.suffixPosition}=a,C=(e=Hn(a.lineHeight,a.fontSize||r.fontSize))!==null&&e!==void 0?e:(a.fontSize||r.fontSize)+d;let{textAlign:_=r.textAlign,textBaseline:y=r.textBaseline}=a;if(!b){const T=_;_=(i=fe.baselineMapAlign[y])!==null&&i!==void 0?i:"left",y=(o=fe.alignMapBaseline[T])!==null&&o!==void 0?o:"top"}if(l=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach(k=>{const B=k.reduce((H,E)=>H+E.width,0);l=Xn(B,l)});const T=fn(_,l),M=this.cache.verticalList.length*C,P=pn(y,M,f);return this._AABBBounds.set(P,T,P+M,T+l),v&&this._AABBBounds.expand(m/2),this._AABBBounds}const x=t.map(T=>U0(T.toString()));x.forEach((T,M)=>{if(Number.isFinite(u))if(c){const P=c===!0?r.ellipsis:c,k=s.clipTextWithSuffixVertical(T,{fontSize:f,fontWeight:p,fontFamily:g},u,P,!1,w);x[M]=k.verticalList,l=k.width}else{const P=s.clipTextVertical(T,{fontSize:f,fontWeight:p,fontFamily:g},u,!1);x[M]=P.verticalList,l=P.width}else l=0,T.forEach(P=>{const k=P.direction===Ro.HORIZONTAL?f:s.measureTextWidth(P.text,{fontSize:f,fontWeight:p,fontFamily:g});l+=k,P.width=k})}),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach(T=>{const M=T.reduce((P,k)=>P+k.width,0);l=Xn(M,l)});const S=fn(_,l),A=this.cache.verticalList.length*C,R=pn(y,A,f);return this._AABBBounds.set(R,S,R+A,S+l),v&&this._AABBBounds.expand(m/2),this._AABBBounds}needUpdateTags(t,e=Fp){return super.needUpdateTags(t,e)}needUpdateTag(t,e=Fp){return super.needUpdateTag(t,e)}clone(){return new fe(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fe.NOWORK_ANIMATE_ATTR}}fe.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ji),fe.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fe.alignMapBaseline={left:"top",right:"bottom",center:"middle"};function nc(n){return new fe(n)}const Ta=["heightLimit","lineClamp"];class Ma extends fe{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return it(t)?!t.every(e=>e==null||e===""):t!=null&&t!==""}updateMultilineAABBBounds(t){var e,i,o,r;const s=this.getGraphicTheme(),{fontFamily:l=s.fontFamily,textAlign:a=s.textAlign,textBaseline:h=s.textBaseline,fontSize:d=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:c,stroke:g=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:v=s.fontWeight,ignoreBuf:m=s.ignoreBuf,heightLimit:b=0,suffixPosition:w=s.suffixPosition,lineClamp:C}=this.attribute,_=(e=Hn(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))!==null&&e!==void 0?e:this.attribute.fontSize||s.fontSize,y=m?0:2;if(!this.shouldUpdateShape()&&(!((i=this.cache)===null||i===void 0)&&i.layoutData)){const B=this.cache.layoutData.bbox;return this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=X.graphicUtil.textMeasure,S=new ic(l,{fontSize:d,fontWeight:v,fontFamily:l},x),A=t.map(B=>B.toString()),R=[],T=[0,0];let M=1/0;if(b>0&&(M=Math.max(Math.floor(b/_),1)),C&&(M=Math.min(M,C)),typeof c=="number"&&c!==1/0){if(c>0)for(let H=0;H<A.length;H++){const E=A[H];let F=!0;if(H===M-1){const z=S.textMeasure.clipTextWithSuffix(E,S.textOptions,c,u,!1,w);R.push({str:z.str,width:z.width});break}const L=S.textMeasure.clipText(E,S.textOptions,c,p==="break-word");if(E!==""&&L.str===""){if(u){const z=S.textMeasure.clipTextWithSuffix(E,S.textOptions,c,u,!1,w);L.str=(o=z.str)!==null&&o!==void 0?o:"",L.width=(r=z.width)!==null&&r!==void 0?r:0}else L.str="",L.width=0;F=!1}if(R.push({str:L.str,width:L.width}),L.str.length!==E.length){if(F){const z=E.substring(L.str.length);A.splice(H+1,0,z)}}}let B=0;R.forEach(H=>{B=Math.max(B,H.width)}),T[0]=B}else{let B,H,E=0;for(let F=0,L=A.length;F<L;F++){if(F===M-1){const z=S.textMeasure.clipTextWithSuffix(A[F],S.textOptions,c,u,!1,w);R.push({str:z.str,width:z.width}),E=Math.max(E,z.width);break}H=A[F],B=S.textMeasure.measureTextWidth(H,S.textOptions,p==="break-word"),E=Math.max(E,B),R.push({str:H,width:B})}T[0]=E}T[1]=R.length*(_+y);const P={xOffset:0,yOffset:0,width:T[0],height:T[1]};S.LayoutBBox(P,a,h);const k=S.layoutWithBBox(P,R,a,h,_);return this.cache.layoutData=k,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),g&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Ta.length;e++){const i=Ta[e];if(t.indexOf(i)!==-1)return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Ta.length;e++)if(t===Ta[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Ma.NOWORK_ANIMATE_ATTR}}function LA(n){return new Ma(n)}class Se{bounds(t,e){if(nt(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function kp(n,t,e,i,o){return o?n.arc(e,i,t,0,Ye,!1,o):n.arc(e,i,t,0,Ye),!1}class FA extends Se{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,o,r){return kp(t,e/2,i,o,r)}drawOffset(t,e,i,o,r,s){return kp(t,e/2+r,i,o,s)}drawToSvgPath(t,e,i,o){const r=t/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}}const kA=new FA;function IA(n,t,e,i,o){return n.moveTo(-3*t+e,-t+i,o),n.lineTo(-t+e,-t+i,o),n.lineTo(-t+e,-3*t+i,o),n.lineTo(t+e,-3*t+i,o),n.lineTo(t+e,-t+i,o),n.lineTo(3*t+e,-t+i,o),n.lineTo(3*t+e,t+i,o),n.lineTo(t+e,t+i,o),n.lineTo(t+e,3*t+i,o),n.lineTo(-t+e,3*t+i,o),n.lineTo(-t+e,t+i,o),n.lineTo(-3*t+e,t+i,o),n.closePath(),!0}function zA(n,t,e,i,o,r){return n.moveTo(-3*t+e-o,-t+i-o,r),n.lineTo(-t+e-o,-t+i-o,r),n.lineTo(-t+e-o,-3*t+i-o,r),n.lineTo(t+e+o,-3*t+i-o,r),n.lineTo(t+e+o,-t+i-o,r),n.lineTo(3*t+e+o,-t+i-o,r),n.lineTo(3*t+e+o,t+i+o,r),n.lineTo(t+e+o,t+i+o,r),n.lineTo(t+e+o,3*t+i+o,r),n.lineTo(-t+e-o,3*t+i+o,r),n.lineTo(-t+e-o,t+i+o,r),n.lineTo(-3*t+e-o,t+i+o,r),n.closePath(),!0}class DA extends Se{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,o,r){return IA(t,e/6,i,o,r)}drawOffset(t,e,i,o,r,s){return zA(t,e/6,i,o,r,s)}}const OA=new DA;function oc(n,t,e,i,o){return n.moveTo(e,i-t,o),n.lineTo(t+e,i,o),n.lineTo(e,i+t,o),n.lineTo(e-t,i,o),n.closePath(),!0}class WA extends Se{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,o,r){return oc(t,e/2,i,o,r)}drawFitDir(t,e,i,o,r){return oc(t,e/2,i,o,r)}drawOffset(t,e,i,o,r,s){return oc(t,e/2+r,i,o,s)}}const NA=new WA;function Ip(n,t,e,i){const o=2*t;return n.rect(e-t,i-t,o,o),!1}class VA extends Se{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,o){return Ip(t,e/2,i,o)}drawOffset(t,e,i,o,r){return Ip(t,e/2+r,i,o)}}const jA=new VA;function zp(n,t,e,i,o=0){return n.moveTo(e+t+2*o,t+i+o),n.lineTo(e-t-2*o,t+i+o),n.lineTo(e,i-t-2*o),n.closePath(),!0}class Dp extends Se{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,o){return zp(t,e/2,i,o)}drawOffset(t,e,i,o,r){return zp(t,e/2,i,o,r)}}const GA=new Dp;class UA extends Dp{constructor(){super(...arguments),this.type="triangle"}}const KA=new UA,Op=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),$A=Math.sin(Ye/10)*Op,YA=-Math.cos(Ye/10)*Op;function Wp(n,t,e,i){const o=$A*t,r=YA*t;n.moveTo(e,-t+i),n.lineTo(o+e,r+i);for(let s=1;s<5;++s){const l=Ye*s/5,a=Math.cos(l),h=Math.sin(l);n.lineTo(h*t+e,-a*t+i),n.lineTo(a*o-h*r+e,h*o+a*r+i)}return n.closePath(),!0}class XA extends Se{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,o){return Wp(t,e/2,i,o)}drawOffset(t,e,i,o,r){return Wp(t,e/2+r,i,o)}}const qA=new XA,ZA=Zi(3);function Np(n,t,e,i){const o=t,r=o/ZA,s=r/5,l=t;return n.moveTo(0+e,-o+i),n.lineTo(r/2+e,i),n.lineTo(s/2+e,i),n.lineTo(s/2+e,l+i),n.lineTo(-s/2+e,l+i),n.lineTo(-s/2+e,i),n.lineTo(-r/2+e,i),n.closePath(),!0}class JA extends Se{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,o){return Np(t,e/2,i,o)}drawOffset(t,e,i,o,r){return Np(t,e/2+r,i,o)}}const QA=new JA;function Vp(n,t,e,i){const o=2*t;return n.moveTo(e,-t+i),n.lineTo(o/3/2+e,t+i),n.lineTo(-o/3/2+e,t+i),n.closePath(),!0}class tR extends Se{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,o){return Vp(t,e/2,i,o)}drawOffset(t,e,i,o,r){return Vp(t,e/2+r,i,o)}}const eR=new tR;function jp(n,t,e,i){return n.moveTo(-t+e,i),n.lineTo(e,t+i),!1}class iR extends Se{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,o){return jp(t,e/2,i,o)}drawOffset(t,e,i,o,r){return jp(t,e/2+r,i,o)}}const nR=new iR,Oi=-.5,Wi=Zi(3)/2,Gp=1/Zi(12);function Up(n,t,e,i){const o=t/2,r=t*Gp,s=o,l=t*Gp+t,a=-s,h=l;return n.moveTo(o+e,r+i),n.lineTo(s+e,l+i),n.lineTo(a+e,h+i),n.lineTo(Oi*o-Wi*r+e,Wi*o+Oi*r+i),n.lineTo(Oi*s-Wi*l+e,Wi*s+Oi*l+i),n.lineTo(Oi*a-Wi*h+e,Wi*a+Oi*h+i),n.lineTo(Oi*o+Wi*r+e,Oi*r-Wi*o+i),n.lineTo(Oi*s+Wi*l+e,Oi*l-Wi*s+i),n.lineTo(Oi*a+Wi*h+e,Oi*h-Wi*a+i),n.closePath(),!1}class oR extends Se{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,o){return Up(t,e/2,i,o)}drawOffset(t,e,i,o,r){return Up(t,e/2+r,i,o)}}const rR=new oR;function Kp(n,t,e,i,o){return n.moveTo(-t+e-2*o,i),n.lineTo(t+e+o,t+i+2*o),n.lineTo(t+e+o,i-t-2*o),n.closePath(),!0}class sR extends Se{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,o){return Kp(t,e/2,i,o,0)}drawOffset(t,e,i,o,r){return Kp(t,e/2,i,o,r)}}const lR=new sR;function $p(n,t,e,i,o=0){return n.moveTo(e-t-o,t+i+2*o),n.lineTo(t+e+2*o,i),n.lineTo(e-t-o,i-t-2*o),n.closePath(),!0}class aR extends Se{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,o){return $p(t,e/2,i,o)}drawOffset(t,e,i,o,r){return $p(t,e/2,i,o,r)}}const hR=new aR;function Yp(n,t,e,i,o=0){return n.moveTo(e-t-2*o,i-t-o),n.lineTo(e+t+2*o,i-t-o),n.lineTo(e,i+t+2*o),n.closePath(),!0}class dR extends Se{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,o){return Yp(t,e/2,i,o)}drawOffset(t,e,i,o,r){return Yp(t,e/2,i,o,r)}}const uR=new dR,rc=Zi(3);function Xp(n,t,e,i){const o=t*rc;return n.moveTo(e,i+-o/3*2),n.lineTo(t+e,i+o),n.lineTo(e-t,i+o),n.closePath(),!0}class cR extends Se{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,o){return Xp(t,e/2/rc,i,o)}drawOffset(t,e,i,o,r){return Xp(t,e/2/rc+r,i,o)}}const gR=new cR;function qp(n,t,e,i){const o=2*t;return n.moveTo(t+e,i-o),n.lineTo(e-t,i),n.lineTo(t+e,o+i),!0}class fR extends Se{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,o){return qp(t,e/4,i,o)}drawOffset(t,e,i,o,r){return qp(t,e/4+r,i,o)}}const pR=new fR;function Zp(n,t,e,i){const o=2*t;return n.moveTo(e-t,i-o),n.lineTo(e+t,i),n.lineTo(e-t,o+i),!0}class vR extends Se{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,o){return Zp(t,e/4,i,o)}drawOffset(t,e,i,o,r){return Zp(t,e/4+r,i,o)}}const mR=new vR;function Jp(n,t,e,i){const o=2*t;return n.moveTo(e-o,i+t),n.lineTo(e,i-t),n.lineTo(e+o,i+t),!0}class bR extends Se{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,o){return Jp(t,e/4,i,o)}drawOffset(t,e,i,o,r){return Jp(t,e/4+r,i,o)}}const CR=new bR;function Qp(n,t,e,i){const o=2*t;return n.moveTo(e-o,i-t),n.lineTo(e,i+t),n.lineTo(e+o,i-t),!0}class _R extends Se{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,o){return Qp(t,e/4,i,o)}drawOffset(t,e,i,o,r){return Qp(t,e/4+r,i,o)}}const yR=new _R;function tv(n,t,e,i,o){return n.moveTo(e,i-t),n.lineTo(e,i+t),!0}class wR extends Se{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,o,r){return tv(t,e/2,i,o)}drawOffset(t,e,i,o,r,s){return tv(t,e/2+r,i,o)}drawToSvgPath(t,e,i,o){const r=t/2;return`M ${e}, ${i-r} L ${e},${i+r}`}}const SR=new wR;function ev(n,t,e,i,o){return n.moveTo(e-t,i),n.lineTo(e+t,i),!0}class xR extends Se{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,o,r){return ev(t,e/2,i,o)}drawOffset(t,e,i,o,r,s){return ev(t,e/2+r,i,o)}drawToSvgPath(t,e,i,o){const r=t/2;return`M ${e-r}, ${i} L ${e+r},${i}`}}const AR=new xR;function iv(n,t,e,i,o){return n.moveTo(e-t,i-t),n.lineTo(e+t,i+t),n.moveTo(e+t,i-t),n.lineTo(e-t,i+t),!0}class RR extends Se{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,o,r){return iv(t,e/2,i,o)}drawOffset(t,e,i,o,r,s){return iv(t,e/2+r,i,o)}drawToSvgPath(t,e,i,o){const r=t/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}}const TR=new RR;function nv(n,t,e,i){return n.rect(e-t[0]/2,i-t[1]/2,t[0],t[1]),!1}function ov(n,t,e,i){const o=t,r=t/2;return n.rect(e-o/2,i-r/2,o,r),!1}class MR extends Se{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,o){return nt(e)?ov(t,e,i,o):nv(t,e,i,o)}drawOffset(t,e,i,o,r){return nt(e)?ov(t,e+2*r,i,o):nv(t,[e[0]+2*r,e[1]+2*r],i,o)}}const BR=new MR,Ts=new he;class rv{constructor(t,e,i=!1){this.pathStr="",this.type=t,it(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,o,r,s,l){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach(a=>{t.beginPath(),qn(a.path.commandList,t,i,o,e,e),l&&l(a.path,a.attribute)}),!1):(qn(this.path.commandList,t,i,o,e+r,e+r),!1)}draw(t,e,i,o,r,s){return this.drawOffset(t,e,i,o,0,r,s)}bounds(t,e){if(this.isSvg)return this.svgCache?(e.clear(),void this.svgCache.forEach(({path:i})=>{Ts.x1=i.bounds.x1*t,Ts.y1=i.bounds.y1*t,Ts.x2=i.bounds.x2*t,Ts.y2=i.bounds.y2*t,e.union(Ts)})):void 0;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 PR=[kA,OA,NA,jA,gR,KA,qA,QA,eR,nR,rR,lR,hR,GA,uR,pR,mR,CR,yR,BR,SR,AR,TR],sv={};PR.forEach(n=>{sv[n.type]=n});const HR={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"},ER=(n,t,e)=>{const{outerBorder:i,shadowBlur:o=t.shadowBlur,strokeBoundsBuffer:r=t.strokeBoundsBuffer}=n;if(i){const s=t.outerBorder,{distance:l=s.distance,lineWidth:a=s.lineWidth}=i;Zl(e,l+(o+a)/2,!0,r)}return e},Ba=new he,lv=["symbolType","size",...zi];let sc=class ts extends pi{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=na}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return it(t)?t.length===2&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const t=this.getGraphicTheme();let{symbolType:e=t.symbolType}=this.attribute,i=sv[e];if(i)return this._parsedPath=i,i;if(i=ts.userSymbolMap[e],i)return this._parsedPath=i,i;if(e=HR[e]||e,DS(e)===!0){const a=new ql,{svg:h}=a.parse(e);if(!h)return null;const d=it(h.path)?h.path:[h.path];Ba.clear();const u=[];d.forEach(p=>{const v=new Ue().fromString(p.d),m={};US.forEach(b=>{p[b]&&(m[Z0[b]]=p[b])}),u.push({path:v,attribute:m}),Ba.union(v.bounds)});const c=Ba.width(),g=Ba.height(),f=1/Xn(c,g);return u.forEach(p=>p.path.transform(0,0,f,f)),this._parsedPath=new rv(e,u,!0),ts.userSymbolMap[e]=this._parsedPath,this._parsedPath}const o=new Ue().fromString(e),r=o.bounds.width(),s=o.bounds.height(),l=1/Xn(r,s);return o.transform(0,0,l,l),this._parsedPath=new rv(e,o),ts.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Ht(this).symbol}updateAABBBounds(t,e,i,o){this.updatePathProxyAABBBounds(i)||(o?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=X.graphicService.updateTempAABBBounds(i);ER(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:l=e.lineJoin}=t;return X.graphicService.transformAABBBounds(t,i,e,l==="miter",this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:o=e.size}=t;if(it(o))i.set(-o[0]/2,-o[1]/2,o[0]/2,o[1]/2);else{const r=o/2;i.set(-r,-r,r,r)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:o=e.size}=t;return this.getParsedPath().bounds(o,i),i}needUpdateTags(t){return super.needUpdateTags(t,lv)}needUpdateTag(t){return super.needUpdateTag(t,lv)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=it(e)?e:[e,e];return t.path?new Ue().fromCustomPath2D(t.path,0,0,i[0],i[1]):new Ue().fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new ts(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ts.NOWORK_ANIMATE_ATTR}};sc.userSymbolMap={},sc.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ji);function Ms(n){return new sc(n)}const av=["segments","points","curveType","curveTension",...zi];let hv=class pf extends pi{constructor(t={}){super(t),this.type="line",this.numberType=vs}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?e.length!==0:!!t&&!(t.length<=1)}_interpolate(t,e,i,o,r){t==="points"&&(r.points=F0(i,o,e))}getGraphicTheme(){return Ht(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),X.graphicService.updateTempAABBBounds(i);const{lineJoin:o=e.lineJoin}=t;return X.graphicService.transformAABBBounds(t,i,e,o==="miter",this),i}updateLineAABBBoundsByPoints(t,e,i,o){const{points:r=e.points,connectedType:s}=t,l=i;return r.forEach(a=>{a.defined===!1&&s!=="zero"&&s!=="connect"||l.add(a.x,a.y)}),l}updateLineAABBBoundsBySegments(t,e,i,o){const{segments:r=e.segments,connectedType:s}=t,l=i;return r.forEach(a=>{a.points.forEach(h=>{h.defined===!1&&s!=="zero"&&s!=="connect"||l.add(h.x,h.y)})}),l}needUpdateTags(t){return super.needUpdateTags(t,av)}needUpdateTag(t){return super.needUpdateTag(t,av)}toCustomPath(){const t=this.attribute,e=new Ue,i=t.segments,o=r=>{if(r&&r.length){let s=!0;r.forEach(l=>{l.defined!==!1&&(s?e.moveTo(l.x,l.y):e.lineTo(l.x,l.y),s=!1)})}};return i&&i.length?i.forEach(r=>{o(r.points)}):t.points&&o(t.points),e}clone(){return new pf(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return pf.NOWORK_ANIMATE_ATTR}};hv.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ji);function Si(n){return new hv(n)}const dv=["width","x1","y1","height","cornerRadius",...zi];let lc=class vf extends pi{constructor(t){super(t),this.type="rect",this.numberType=Bu}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Ht(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:s,height:l}=t;const{x1:a,y1:h,x:d,y:u}=t;s=s??a-d,l=l??h-u,(isFinite(s)||isFinite(l)||isFinite(d)||isFinite(u))&&i.set(0,0,s||0,l||0)}const{tb1:o,tb2:r}=X.graphicService.updateTempAABBBounds(i);return As(t,e,o),i.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2),X.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,dv)}needUpdateTag(t){return super.needUpdateTag(t,dv)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:o,height:r}=SS(t),s=new Ue;return s.moveTo(e,i),s.rect(e,i,o,r),s}clone(){return new vf(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return vf.NOWORK_ANIMATE_ATTR}};lc.NOWORK_ANIMATE_ATTR=Ji;function ve(n){return new lc(n)}class LR{constructor(t,e,i,o,r,s,l,a,h,d,u,c,g,f){this.left=t,this.top=e,this.width=i,this.height=o,this.actualHeight=0,this.bottom=e+o,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=l,this.lines=[],this.globalAlign=a,this.globalBaseline=h,this.layoutDirection=d,this.directionKey=fu[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=c,this.singleLine=g,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:i,height:o}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,o):this.height||o||0;s=Math.min(s,o);let l=0;switch(this.globalBaseline){case"top":l=0;break;case"middle":l=-s/2;break;case"bottom":l=-s}let a=0;this.globalAlign==="right"||this.globalAlign==="end"?a=-r:this.globalAlign==="center"&&(a=-r/2);let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let d=!1;if(this.verticalDirection==="middle")if(this.actualHeight>=h&&h!==0)for(let u=0;u<this.lines.length;u++){const{top:c,height:g}=this.lines[u];if(c+g<this[this.directionKey.top]||c+g>this[this.directionKey.top]+h)return d;let f=!1;this.ellipsis&&this.lines[u+1]&&this.lines[u+1].top+this.lines[u+1].height>this[this.directionKey.top]+h&&(f=!0,d=!0),this.lines[u].draw(t,f,this.lines[u][this.directionKey.left]+a,this.lines[u][this.directionKey.top]+l,this.ellipsis,e)}else{const u=Math.floor((h-this.actualHeight)/2);this.layoutDirection==="vertical"?a+=u:l+=u;for(let c=0;c<this.lines.length;c++)this.lines[c].draw(t,!1,this.lines[c][this.directionKey.left]+a,this.lines[c][this.directionKey.top]+l,this.ellipsis,e)}else if(this.verticalDirection==="bottom"&&this.layoutDirection!=="vertical")for(let u=0;u<this.lines.length;u++){const{top:c,height:g}=this.lines[u],f=h-this.lines[u].top-this.lines[u].height;if(h===0)this.lines[u].draw(t,!1,a,f+l,this.ellipsis,e);else{if(f+g>this[this.directionKey.top]+h||f<this[this.directionKey.top])return d;{let p=!1;this.ellipsis&&this.lines[u+1]&&f-this.lines[u+1].height<this[this.directionKey.top]&&(p=!0,d=!0),this.lines[u].draw(t,p,a,f+l,this.ellipsis,e)}}}else{this.verticalDirection==="bottom"&&this.layoutDirection==="vertical"&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let u=0;u<this.lines.length;u++){this.verticalDirection==="bottom"&&this.layoutDirection==="vertical"&&(a-=this.lines[u].height+this.lines[u].top);const{top:c,height:g}=this.lines[u];if(h===0)this.lines[u].draw(t,!1,this.lines[u][this.directionKey.left]+a,this.lines[u][this.directionKey.top]+l,this.ellipsis,e);else{if(c+g<this[this.directionKey.top]||c+g>this[this.directionKey.top]+h)return d;{let f=!1;this.ellipsis&&this.lines[u+1]&&this.lines[u+1].top+this.lines[u+1].height>this[this.directionKey.top]+h&&(f=!0,d=!0),this.lines[u].draw(t,f,this.lines[u][this.directionKey.left]+a,this.lines[u][this.directionKey.top]+l,this.ellipsis,e)}}}}return d}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const o=this.lines[i];o.actualWidth>t&&(t=o.actualWidth),e+=o.height}return{width:this.layoutDirection==="vertical"?e:t,height:this.layoutDirection==="vertical"?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:o}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),this.verticalDirection==="middle")if(this.actualHeight>=r&&r!==0)for(let s=0;s<this.lines.length;s++){const{top:l,height:a}=this.lines[s];if(!(l+a<this[this.directionKey.top]||l+a>this[this.directionKey.top]+r))if(this.ellipsis&&this.lines[s+1]&&this.lines[s+1].top+this.lines[s+1].height>this[this.directionKey.top]+r){const h=this.ellipsis===!0?"...":this.ellipsis||"",d=this.lines[s].getWidthWithEllips(h);d>t&&(t=d),e+=this.lines[s].height}else this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}else{Math.floor((r-this.actualHeight)/2);for(let s=0;s<this.lines.length;s++)this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}else if(this.verticalDirection==="bottom")for(let s=0;s<this.lines.length;s++){const{top:l,height:a}=this.lines[s],h=r-this.lines[s].top-this.lines[s].height;if(r===0)this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height;else if(!(h+a>this[this.directionKey.top]+r||h<this[this.directionKey.top]))if(this.ellipsis&&this.lines[s+1]&&h-this.lines[s+1].height<this[this.directionKey.top]){const d=this.ellipsis===!0?"...":this.ellipsis||"",u=this.lines[s].getWidthWithEllips(d);u>t&&(t=u),e+=this.lines[s].height}else this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}else for(let s=0;s<this.lines.length;s++){const{top:l,height:a}=this.lines[s];if(r===0)this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height;else if(!(l+a<this[this.directionKey.top]||l+a>this[this.directionKey.top]+r))if(this.ellipsis&&this.lines[s+1]&&this.lines[s+1].top+this.lines[s+1].height>this[this.directionKey.top]+r){const h=this.ellipsis===!0?"...":this.ellipsis||"",d=this.lines[s].getWidthWithEllips(h);d>t&&(t=d),e+=this.lines[s].height}else this.lines[s].actualWidth>t&&(t=this.lines[s].actualWidth),e+=this.lines[s].height}return{width:this.layoutDirection==="vertical"?e:t,height:this.layoutDirection==="vertical"?t:e}}}class Bs{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const o=Hn(i.lineHeight,this.fontSize);this.lineHeight=typeof o=="number"?o>this.fontSize?o:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:l,width:a}=lr(t,i);let h=0,d=0,u=0;this.height>s&&(h=(this.height-s)/2,d=Math.ceil(h),u=Math.floor(h)),this.textBaseline==="top"?(this.ascent=h,this.descent=s-h):this.textBaseline==="bottom"?(this.ascent=s-h,this.descent=h):this.textBaseline==="middle"?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+d,this.descent=l+u),this.length=t.length,this.width=a||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,i.direction==="vertical"&&(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}=lr(this.text,this.character);this.width=t,this.direction==="vertical"&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,o,r){let s=this.text,l=this.left+i;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,a="vertical",e-=this.ellipsisWidth/2;else{if(this.ellipsis==="hide")return;if(this.ellipsis==="add")s+=this.ellipsisStr,r!=="right"&&r!=="end"||(l-=this.ellipsisWidth);else if(this.ellipsis==="replace"){const h=pu(s,(a==="vertical"?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,h),s+=this.ellipsisStr,r==="right"||r==="end"){const{width:d}=lr(this.text.slice(h),this.character);a==="vertical"||(l-=this.ellipsisWidth-d)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}a==="vertical"&&(t.save(),t.rotateAbout(Math.PI/2,l,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(l,e),l=0,e=0),this.character.stroke&&(rS(t,this.character),t.strokeText(s,l,e)),oS(t,this.character),this.character.fill&&t.fillText(s,l,e),this.character.fill&&(typeof this.character.lineThrough=="boolean"||typeof this.character.underline=="boolean"?(this.character.underline&&t.fillRect(l,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(l,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):this.character.textDecoration==="underline"?t.fillRect(l,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):this.character.textDecoration==="line-through"&&t.fillRect(l,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),a==="vertical"&&t.restore()}getWidthWithEllips(t){let e=this.text;const i=t==="vertical"?this.height:this.width;if(this.ellipsis==="hide")return i;if(this.ellipsis==="add")return i+this.ellipsisWidth;if(this.ellipsis==="replace"){const o=pu(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,o),e+=this.ellipsisStr;const{width:r}=lr(this.text.slice(o),this.character);return i+this.ellipsisWidth-r}return i}}function FR(n,t){const e=n.text.slice(0,t),i=n.text.slice(t);return[new Bs(e,n.newLine,n.character),new Bs(i,!0,n.character)]}const uv=["width","height","image",...zi];let Eo=class mf extends pi{constructor(t){super(t),this.type="image",this.numberType=ta,this.loadImage(this.attribute.image)}get width(){var t;return(t=this.attribute.width)!==null&&t!==void 0?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return(t=this.attribute.height)!==null&&t!==void 0?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return(t=this.attribute.repeatX)!==null&&t!==void 0?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return(t=this.attribute.repeatY)!==null&&t!==void 0?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,()=>{this.successCallback&&this.successCallback()})}imageLoadFail(t,e){super.imageLoadFail(t,()=>{this.failCallback&&this.failCallback()})}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,o){return t==="image"&&this.loadImage(e),super.setAttribute(t,e,i,o)}getGraphicTheme(){return Ht(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:s=e.width,height:l=e.height}=t;i.set(0,0,s,l)}const{tb1:o,tb2:r}=X.graphicService.updateTempAABBBounds(i);return As(t,e,o),i.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2),X.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return ls[t]}needUpdateTags(t){return super.needUpdateTags(t,uv)}needUpdateTag(t){return super.needUpdateTag(t,uv)}clone(){return new mf(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return mf.NOWORK_ANIMATE_ATTR}};Eo.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Ji);function Pa(n){return new Eo(n)}class kn extends Eo{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],t.backgroundShowMode==="always"&&(this._hovered=!0),t.margin){const e=gs(t.margin);this._marginArray=typeof e=="number"?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(e,i,o)=>{if(it(o)&&o.indexOf("margin")!==-1||o==="margin")if(i.margin){const r=gs(i.margin);this._marginArray=typeof r=="number"?[r,r,r,r]:r}else this._marginArray=[0,0,0,0]}}get width(){var t;return((t=this.attribute.width)!==null&&t!==void 0?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return((t=this.attribute.height)!==null&&t!==void 0?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=ls.width,height:e=ls.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:o=e}=this.attribute,r=(i-t)/2,s=(o-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){this.attribute.backgroundShowMode==="hover"&&this._hovered!==t&&(this._hovered=t)}}class kR{constructor(t,e,i,o,r,s,l,a){this.left=t,this.width=e,this.baseline=i,this.ascent=o,this.descent=r,this.top=i-o,this.paragraphs=s.map(d=>d),this.textAlign=(this.paragraphs[0]instanceof kn?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=l,this.directionKey=fu[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach((d,u)=>{if(u===0&&d instanceof Bs){const c=nS.exec(d.text);(c==null?void 0:c.index)!==0&&(d.text=d.text.slice(c==null?void 0:c.index),d.updateWidth())}this.actualWidth+=d[this.directionKey.width],h=Math.max(d[this.directionKey.height],h)}),this.height=h,this.blankWidth=a?0:this.width-this.actualWidth,this.calcOffset(e,a)}calcOffset(t,e){const i=this.directionKey,o=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&(this.textAlign==="right"||this.textAlign==="end"?r=t-this.actualWidth:this.textAlign==="center"?r=(t-this.actualWidth)/2:this.textAlign==="justify"&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map(function(l){l instanceof kn?(l["_"+i.x]=r,r+=l[i.width]+s,l["_"+i.y]=l.attribute.textBaseline==="top"?0:l.attribute.textBaseline==="bottom"?o-l.height:(o-l.height)/2):(l[i.left]=r,r+=l[i.width]+s)})}draw(t,e,i,o,r,s){if(r&&(e||this.paragraphs.some(l=>l.overflow))){let l=!0,a=!1;for(let d=this.paragraphs.length-1;d>=0;d--){const u=this.paragraphs[d];if(u.overflow)l=l&&u.text==="";else if(l){a=!0;break}}let h=0;if(!a)for(let d=this.paragraphs.length-1;d>=0;d--){const u=this.paragraphs[d];if(u.overflow){if(u.text==="")break;continue}if(u instanceof kn)break;if(this.direction==="vertical"&&u.direction!=="vertical"){u.verticalEllipsis=!0;break}const c=r===!0?"...":r||"";u.ellipsisStr=c;const{width:g}=lr(c,u.character),f=g||0;if(f<=this.blankWidth+h){e&&(u.ellipsis="add");break}if(f<=this.blankWidth+h+u.width){u.ellipsis="replace",u.ellipsisWidth=f,u.ellipsisOtherParagraphWidth=this.blankWidth+h;break}u.ellipsis="hide",h+=u.width}}this.paragraphs.map((l,a)=>{if(l instanceof kn)return l.setAttributes({x:i+l._x,y:o+l._y}),void s(l,t,i+l._x,o+l._y,this.ascent);l.draw(t,o+this.ascent,i,a===0,this.textAlign)})}getWidthWithEllips(t){let e=0;for(let o=this.paragraphs.length-1;o>=0;o--){const r=this.paragraphs[o];if(r instanceof kn)break;const{width:s}=lr(t,r.character),l=s||0;if(l<=this.blankWidth+e){r.ellipsis="add",r.ellipsisWidth=l;break}if(l<=this.blankWidth+e+r.width){r.ellipsis="replace",r.ellipsisWidth=l,r.ellipsisOtherParagraphWidth=this.blankWidth+e;break}r.ellipsis="hide",e+=r.width}let i=0;return this.paragraphs.map((o,r)=>{i+=o instanceof kn?o.width:o.getWidthWithEllips(this.direction)}),i}}class IR{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=fu[this.direction]}store(t){if(t instanceof kn){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;t.attribute.textBaseline==="top"?(e=0,i=t.height):t.attribute.textBaseline==="bottom"?(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),t.text.length!==0?(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(this.lineBuffer.length===0)return;const t=this.maxAscent===0?this.maxAscentForBlank:this.maxAscent,e=this.maxDescent===0?this.maxDescentForBlank:this.maxDescent,i=new kR(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,this.direction==="horizontal"?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 kn?this.direction==="horizontal"&&this.width===0||this.direction==="vertical"&&this.height===0||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineBuffer.length===0?(this.store(t),this.send()):(this.send(),this.deal(t)):typeof this.width!="number"||this.width<0||(t.newLine&&this.send(),t.text.length!==0&&(this.direction==="horizontal"&&this.width===0||this.direction==="vertical"&&this.height===0||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,o=Math.ceil(i/t[this.directionKey.width]*t.length)||0,r=pu(t.text,i,t.character,o,this.frame.wordBreak==="break-word");if(r!==0){const[s,l]=FR(t,r);this.store(s),e?this.send():this.deal(l)}else this.lineBuffer.length!==0&&(this.send(),this.deal(t))}}const cv=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...zi];class rn extends pi{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Pu,this.onBeforeAttributeUpdate=(e,i,o)=>{for(const r in e)if(r==="hoverIconId"){if(e[r]===i[r])continue;const s=this._frameCache.icons.get(e[r]);this.updateHoverIconState(s)}}}get width(){var t;return(t=this.attribute.width)!==null&&t!==void 0?t:Tn.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return(t=this.attribute.height)!==null&&t!==void 0?t:Tn.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(t=this.attribute.ellipsis)!==null&&t!==void 0?t:Tn.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return(t=this.attribute.wordBreak)!==null&&t!==void 0?t:Tn.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return(t=this.attribute.verticalDirection)!==null&&t!==void 0?t:Tn.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return(t=this.attribute.textAlign)!==null&&t!==void 0?t:Tn.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return(t=this.attribute.textBaseline)!==null&&t!==void 0?t:Tn.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return(t=this.attribute.textConfig)!==null&&t!==void 0?t:Tn.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Ht(this).richtext}updateAABBBounds(t,e,i){const{width:o=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:l=e.maxHeight,textAlign:a=e.textAlign,textBaseline:h=e.textBaseline}=t;if(o>0&&r>0)i.set(0,0,o,r);else{const c=this.getFrameCache(),{width:g,height:f}=c.getActualSize();let p=o||g||0,v=r||f||0;v=typeof l=="number"&&v>l?l:v||0,p=typeof s=="number"&&p>s?s:p||0,i.set(0,0,p,v)}let d=0;switch(h){case"top":d=0;break;case"middle":d=-i.height()/2;break;case"bottom":d=-i.height()}let u=0;switch(a){case"left":u=0;break;case"center":u=-i.width()/2;break;case"right":u=-i.width()}return i.translate(u,d),X.graphicService.updateTempAABBBounds(i),t.forceBoundsHeight==null&&t.forceBoundsWidth==null||X.graphicService.updateHTMLTextAABBBounds(t,e,i),X.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,cv)}needUpdateTag(t){return super.needUpdateTag(t,cv)}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 i=0;i<t.lines.length;i++){const o=t.lines[i];for(let r=0;r<o.paragraphs.length;r++){const s=o.paragraphs[r];if(s.overflow&&s.text!=="")return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:o,fontFamily:r,fontStyle:s,fontWeight:l,lineWidth:a,opacity:h,fillOpacity:d,strokeOpacity:u}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:o,fontFamily:r,fontStyle:s,fontWeight:l,lineWidth:a,opacity:h,fillOpacity:d,strokeOpacity:u},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:o,maxHeight:r,width:s,height:l,ellipsis:a,wordBreak:h,verticalDirection:d,textAlign:u,textBaseline:c,layoutDirection:g,singleLine:f,disableAutoWrapLine:p}=this.attribute,v=[],m=t??i;for(let S=0;S<m.length;S++)if("image"in m[S]){const A=this.combinedStyleToCharacter(m[S]);A.lineWidth=void 0;const R=A.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(A.id);if(R)v.push(R);else{const T=new kn(A);T.successCallback=()=>{var M;this.addUpdateBoundTag(),(M=this.stage)===null||M===void 0||M.renderNextFrame()},T.richtextId=A.id,v.push(T)}}else{const A=this.combinedStyleToCharacter(m[S]);if(nt(A.text)&&(A.text=`${A.text}`),A.text&&A.text.includes(`
|
|
5
|
+
`)){const R=A.text.split(`
|
|
6
|
+
`);for(let T=0;T<R.length;T++)v.push(new Bs(R[T],T!==0,A))}else A.text&&v.push(new Bs(A.text,!1,A))}const b=typeof o=="number"&&Number.isFinite(o)&&o>0,w=typeof r=="number"&&Number.isFinite(r)&&r>0,C=typeof s=="number"&&Number.isFinite(s)&&s>0&&(!b||s<=o),_=typeof l=="number"&&Number.isFinite(l)&&l>0&&(!w||l<=r),y=new LR(0,0,(C?s:b?o:0)||0,(_?l:w?r:0)||0,a,h,d,u,c,g||"horizontal",!C&&b,!_&&w,f||!1,(e=this._frameCache)===null||e===void 0?void 0:e.icons),x=new IR(y);if(p){let S=0,A=!1;for(let R=0;R<v.length;R++){const T=v[R];A?(T.overflow=!0,T.left=1/0,T.top=1/0,!T.newLine&&y.lines[y.lines.length-1].paragraphs.push(T)):x.deal(T,!0),y.lines.length!==S&&(S=y.lines.length,x.lineBuffer.length=0,T.overflow=!0,T.left=1e3,T.top=1e3,y.lines[y.lines.length-1].paragraphs.push(T),A=!0),T.newLine&&(A=!1,x.lineWidth=0),x.send()}}else for(let S=0;S<v.length;S++)x.deal(v[S]);if(x.send(),!(y.layoutDirection==="horizontal"?C:_)){const S=y.getActualSizeWidthEllipsis();let A=y.layoutDirection==="horizontal"?S.width:S.height;(y.layoutDirection==="horizontal"?b:w)&&(A=Math.min(A,y.layoutDirection==="horizontal"?o:r)),y.lines.forEach(function(R){R.calcOffset(A,!1)})}this._frameCache=y}clone(){return new rn(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,o,r,s;t?((e=this._currentHoverIcon)===null||e===void 0||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),(i=this.stage)===null||i===void 0||i.setCursor(t.attribute.cursor),(o=this.stage)===null||o===void 0||o.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,(r=this.stage)===null||r===void 0||r.setCursor(),(s=this.stage)===null||s===void 0||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:o}=this.globalTransMatrix;let r;return e.icons.forEach((s,l)=>{var a,h;const d=s.AABBBounds.clone();d.translate(s._marginArray[3],s._marginArray[0]),d.containsPoint({x:t.x-i,y:t.y-o})&&(r=s,r.globalX=((a=r.attribute.x)!==null&&a!==void 0?a:0)+i+s._marginArray[3],r.globalY=((h=r.attribute.y)!==null&&h!==void 0?h:0)+o+s._marginArray[0])}),r}getNoWorkAnimateAttr(){return rn.NOWORK_ANIMATE_ATTR}}rn.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Ji);function zR(n){return new rn(n)}const gv=["path","customPath",...zi];class Ps extends pi{constructor(t){super(t),this.type="path",this.numberType=ea}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return t!=null&&t!==""}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Ue?e.path:(ct(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ue?this.cache:t.path)}getGraphicTheme(){return Ht(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const l=this.getParsedPathShape();i.union(l.getBounds())}const{tb1:o,tb2:r}=X.graphicService.updateTempAABBBounds(i);As(t,e,o),i.union(o),o.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:s=e.lineJoin}=t;return X.graphicService.transformAABBBounds(t,i,e,s==="miter",this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;Qt(t.path,!0)?this.cache=new Ue().fromString(t.path):t.customPath&&(this.cache=new Ue,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,gv)}needUpdateTag(t){return super.needUpdateTag(t,gv)}toCustomPath(){return new Ue().fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Ps(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ps.NOWORK_ANIMATE_ATTR}}Ps.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ji);function DR(n){return new Ps(n)}const fv=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...zi];class Cr extends pi{constructor(t){super(t),this.type="arc",this.numberType=Jl}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:o}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(o)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:o=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=o,s-=i,e===0||e==="0%")return 0;const l=Math.abs(r-s),a=h=>Math.min(nt(h,!0)?h:l*parseFloat(h)/100,l/2);if(it(e)){const h=e.map(d=>a(d)||0);return h.length===0?[h[0],h[0],h[0],h[0]]:h.length===2?[h[0],h[1],h[0],h[1]]:(h.length===3&&h.push(0),h)}return a(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:o=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=J1(e),i=e+s,o&&Jt(s)<Gt-ae){let l=1,a=1;o.length&&(l=Number(o[0]),a=Number(o[1]));let{outerRadius:h=t.outerRadius,innerRadius:d=t.innerRadius}=this.attribute;const{outerPadding:u=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;h+=u,d-=c;const g=Math.abs(h-d)/2,f=g/h;if(g>ae&&h>ae)return{startAngle:e-r*f*l,endAngle:i+r*f*a,sc:r*f*l,ec:r*f*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:o=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:s=i.padAngle}=this.attribute;let{outerRadius:l=i.outerRadius,innerRadius:a=i.innerRadius}=this.attribute;l+=r,a-=o;const{padRadius:h=Zi(l*l+a*a)}=this.attribute,d=Jt(e-t);let u=t,c=e,g=t,f=e;const p=s/2;let v=d,m=d;if(p>ae&&h>ae){const b=e>t?1:-1;let w=Nf(Number(h)/a*pe(p)),C=Nf(Number(h)/l*pe(p));return(v-=2*w)>ae?(w*=b,g+=w,f-=w):(v=0,g=f=(t+e)/2),(m-=2*C)>ae?(C*=b,u+=C,c-=C):(m=0,u=c=(t+e)/2),{outerStartAngle:u,outerEndAngle:c,innerStartAngle:g,innerEndAngle:f,innerDeltaAngle:v,outerDeltaAngle:m}}return{outerStartAngle:u,outerEndAngle:c,innerStartAngle:g,innerEndAngle:f,innerDeltaAngle:v,outerDeltaAngle:m}}getGraphicTheme(){return Ht(this).arc}updateAABBBounds(t,e,i,o){this.updatePathProxyAABBBounds(i)||(o?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=X.graphicService.updateTempAABBBounds(i);As(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:l=e.lineJoin}=t;return X.graphicService.transformAABBBounds(t,i,e,l==="miter",this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:o=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:l=e.innerPadding}=t;return o+=s,r-=l,o<r&&(o=r),i.set(-o,-o,o,o),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:o=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:l=e.innerPadding}=t;if(o+=s,r-=l,o<r){const d=o;o=r,r=d}let{endAngle:a=e.endAngle,startAngle:h=e.startAngle}=t;if(h>a){const d=h;h=a,a=d}return o<=ae?i.set(0,0,0,0):Math.abs(a-h)>Gt-ae?i.set(-o,-o,o,o):(Au(h,a,o,i),Au(h,a,r,i)),i}needUpdateTags(t){return super.needUpdateTags(t,fv)}needUpdateTag(t){return super.needUpdateTag(t,fv)}toCustomPath(){var t,e,i,o;const r=this.attribute,{startAngle:s,endAngle:l}=this.getParsedAngle();let a=((t=r.innerRadius)!==null&&t!==void 0?t:0)-((e=r.innerPadding)!==null&&e!==void 0?e:0),h=((i=r.outerRadius)!==null&&i!==void 0?i:0)-((o=r.outerPadding)!==null&&o!==void 0?o:0);const d=Jt(l-s),u=l>s;if(h<a){const g=h;h=a,a=g}const c=new Ue;if(h<=ae)c.moveTo(0,0);else if(d>=Gt-ae)c.moveTo(0+h*Pe(s),0+h*pe(s)),c.arc(0,0,h,s,l,!u),a>ae&&(c.moveTo(0+a*Pe(l),0+a*pe(l)),c.arc(0,0,a,l,s,u));else{const g=h*Pe(s),f=h*pe(s),p=a*Pe(l),v=a*pe(l);c.moveTo(0+g,0+f),c.arc(0,0,h,s,l,!u),c.lineTo(0+p,0+v),c.arc(0,0,a,l,s,u),c.closePath()}return c}clone(){return new Cr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cr.NOWORK_ANIMATE_ATTR}}Cr.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ji);function ac(n){return new Cr(n)}const pv=["points","cornerRadius",...zi];class Hs extends pi{constructor(t){super(t),this.type="polygon",this.numberType=ia}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Ht(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),X.graphicService.updateTempAABBBounds(i);const{lineJoin:o=e.lineJoin}=t;return X.graphicService.transformAABBBounds(t,i,e,o==="miter",this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:o=e.points}=t;return o.forEach(r=>{i.add(r.x,r.y)}),i}_interpolate(t,e,i,o,r){t==="points"&&(r.points=F0(i,o,e))}needUpdateTags(t){return super.needUpdateTags(t,pv)}needUpdateTag(t){return super.needUpdateTag(t,pv)}toCustomPath(){const t=this.attribute.points,e=new Ue;return t.forEach((i,o)=>{o===0?e.moveTo(i.x,i.y):e.lineTo(i.x,i.y)}),e.closePath(),e}clone(){return new Hs(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Hs.NOWORK_ANIMATE_ATTR}}Hs.NOWORK_ANIMATE_ATTR=Ji;function OR(n){return new Hs(n)}class WR extends Qi{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 NR(n){return new WR(n)}var hc=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};const _r=Symbol.for("PickItemInterceptor");let Ha=class{constructor(){this.order=1}afterPickItem(n,t,e,i,o){return n.attribute.shadowRootIdx>0||!n.attribute.shadowRootIdx?this._pickItem(n,t,e,i,o):null}beforePickItem(n,t,e,i,o){return n.attribute.shadowRootIdx<0?this._pickItem(n,t,e,i,o):null}_pickItem(n,t,e,i,o){var r;if(!n.shadowRoot)return null;const{parentMatrix:s}=o||{};if(!s)return null;const l=t.pickContext;l.highPerformanceSave();const a=(r=Ht(n))===null||r===void 0?void 0:r[n.type],{shadowPickMode:h=a==null?void 0:a.shadowPickMode}=n.attribute,d=n.shadowRoot,u=wi.allocateByObj(s),c=new ye(u.a*e.x+u.c*e.y+u.e,u.b*e.x+u.d*e.y+u.f),g=t.pickGroup(d,c,u,i);return l.highPerformanceRestore(),!g.graphic&&g.group&&h==="full"&&(g.graphic=g.group),g}};Ha=hc([st()],Ha);let Ea=class{constructor(){this.order=1}beforePickItem(n,t,e,i,o){const r=n.baseGraphic;if(r&&r.parent){const s=new ye(e.x,e.y),l=t.pickContext;l.highPerformanceSave();const a=r.parent.globalTransMatrix;a.transformPoint(s,s);const h=r.isContainer?t.pickGroup(r,s.clone(),a,i):t.pickItem(r,s.clone(),a,i);return l.highPerformanceRestore(),h}return null}};Ea=hc([st()],Ea);let La=class{constructor(){this.order=1}beforePickItem(n,t,e,i,o){if(!n.in3dMode||i.in3dInterceptor)return null;const r=t.pickContext,s=n.stage;if(!r||!s)return null;if(i.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=s.camera,n.isContainer){const l=Tp(r,n,()=>t.pickGroup(n,e,o.parentMatrix,i),i);return r.camera=null,i.in3dInterceptor=!1,r.restore(),l}return r.restore(),null}initCanvasCtx(n){n.setTransformForCurrent()}};La=hc([st()],La);const VR=new Bt((n,t,e)=>{e(br)||(n(Hp).toSelf(),n(br).toService(Hp)),n(La).toSelf().inSingletonScope(),n(_r).toService(La),n(Ha).toSelf().inSingletonScope(),n(_r).toService(Ha),n(Ea).toSelf().inSingletonScope(),n(_r).toService(Ea),ei(n,_r)}),jR=new Bt(n=>{n(X0).to(Vu).inSingletonScope(),n(q0).toConstantValue(bt)}),Es=Symbol.for("AutoEnablePlugins"),vv=Symbol.for("PluginService");var GR=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},UR=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},mv=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let dc=class{constructor(n){this.autoEnablePlugins=n,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(n,t){this.stage=n,this.actived=!0;const{pluginList:e}=t;e&&Tt.isBound(Es)&&this.autoEnablePlugins.getContributions().forEach(i=>{e.includes(i.name)&&this.register(i)})}findPluginsByName(n){const t=[];return this.onStartupFinishedPlugin.forEach(e=>{e.name===n&&t.push(e)}),this.onRegisterPlugin.forEach(e=>{e.name===n&&t.push(e)}),t}register(n){n.activeEvent==="onStartupFinished"?this.onStartupFinishedPlugin.push(n):n.activeEvent==="onRegister"&&(this.onRegisterPlugin.push(n),n.activate(this))}unRegister(n){n.activeEvent==="onStartupFinished"?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(n),1):n.activeEvent==="onRegister"&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(n),1),n.deactivate(this)}release(...n){this.onStartupFinishedPlugin.forEach(t=>{t.deactivate(this)}),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach(t=>{t.deactivate(this)}),this.onRegisterPlugin=[]}};dc=GR([st(),mv(0,Ot(Me)),mv(0,Ie(Es)),UR("design:paramtypes",[Object])],dc);const KR=new Bt(n=>{n(vv).to(dc),w1(n,Es)}),$R=new Bt(n=>{ei(n,Bl)}),YR=new Bt(n=>{n(Mn).to(ar).inSingletonScope(),ei(n,Mn)});var XR=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},qR=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let Fa=class{constructor(){this.type="static",this.offscreen=!1,this.global=X.global}setDpr(n){this.canvas.dpr=n}init(n,t,e){if(this.layer=n,this.window=t,e.main)this.main=!0,this.context=t.getContext(),this.canvas=this.context.getCanvas();else{let i;this.main=!1,e.canvasId&&(i=this.global.getElementById(e.canvasId)),i||(i=this.global.createCanvas({width:t.width,height:t.height})),i.style&&(i.style["pointer-events"]="none");const o=t.getContext().getCanvas().nativeCanvas,r=mu({nativeCanvas:i,width:t.width,height:t.height,dpr:t.dpr,id:e.canvasId,canvasControled:!0,container:t.getContainer(),x:o.offsetLeft,y:o.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(n,t){this.canvas.resize(n,t)}resizeView(n,t){}render(n,t,e){var i;if(!this.main){const o=this.window.getContext().getCanvas().nativeCanvas;!o||this.canvas.x===o.offsetLeft&&this.canvas.y===o.offsetTop||(this.canvas.x=o.offsetLeft,this.canvas.y=o.offsetTop,this.canvas.applyPosition())}t.renderService.render(n,Object.assign(Object.assign({context:this.context,clear:(i=t.background)!==null&&i!==void 0?i:"#ffffff"},t),e))}merge(n){n.forEach(t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)})}prepare(n,t){}drawTo(n,t,e){var i;const o=n.getContext();e.renderService.render(t,Object.assign(Object.assign({context:o},e),{clear:e.clear?(i=e.background)!==null&&i!==void 0?i:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};Fa=XR([st(),qR("design:paramtypes",[])],Fa);const ZR=new Bt(n=>{n(Fa).toSelf(),n(ep).toService(Fa)});function JR(n){n.load($R),n.load(YR),n.load(ZR)}var QR=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};function bv(n,t,e){const i={},o=[];return n.forEachChildren(r=>{const{zIndex:s=t}=r.attribute;i[s]?i[s].push(r):(i[s]=[r],o.push(s))},e),o.sort((r,s)=>e?s-r:r-s),{childMap:i,zIdxArray:o}}function Cv(n,t,e,i=!1,o=!1){let r=!1;if(o)r=!0;else{let s;n.forEachChildren((l,a)=>{const{zIndex:h=t}=l.attribute;if(a===0)s=h;else if(s!==h)return r=!0,!0;return!1},i)}if(r){const{childMap:s,zIdxArray:l}=bv(n,t,i);let a=!1;for(let h=0;h<l.length&&!a;h++){const d=s[l[h]];o&&d.sort((u,c)=>{var g,f;return(i?-1:1)*(((g=c.attribute.z)!==null&&g!==void 0?g:0)-((f=u.attribute.z)!==null&&f!==void 0?f:0))});for(let u=0;u<d.length;u++)if(e(d[u],u)){a=!0;break}}}else n.forEachChildren(e,i)}function _v(n,t,e,i=!1){return QR(this,void 0,void 0,function*(){yield n.forEachChildrenAsync(e,i)})}function tT(n,t,e,i=!1){let o=!1;n.forEachChildren((l,a)=>{const{zIndex:h=e}=l.attribute;if(a!==0){if(h!==void 0)return o=!0,!0}return!1},i);let r=null,s=!1;if(o){const{childMap:l,zIdxArray:a}=bv(n,e,i);let h=!1;for(let d=0;d<a.length&&!h;d++){const u=l[a[d]];for(let c=0;c<u.length;c++){if(s){h=!0,r=u[c];break}u[c]._uid!==t||(s=!0)}}}else n.forEachChildren(l=>s?(r=l,!0):(l._uid===t&&(s=!0),!1),i);return r}var eT=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},iT=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},uc=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let ka=class{constructor(n,t){this.contributions=n,this.drawItemInterceptorContributions=t,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Ci,this.backupDirtyBounds=new Ci,this.global=X.global,this.layerService=X.layerService,this.init()}init(){this.contributions.forEach(n=>{if(n.style){const t=this.styleRenderMap.get(n.style)||new Map;t.set(n.numberType,n),this.styleRenderMap.set(n.style,t)}else this.defaultRenderMap.set(n.numberType,n)}),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((n,t)=>n.order-t.order)}prepareForDraw(n,t){t.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!t.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(n,t){this.prepareForDraw(n,t),t.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(t.renderStyle)||this.defaultRenderMap,this.currentRenderService=n;const{context:e,stage:i,viewBox:o,transMatrix:r}=t;if(!e)return;const s=this.dirtyBounds.setValue(0,0,o.width(),o.height());if(i.dirtyBounds&&!i.dirtyBounds.empty()){const a=Gf(s,i.dirtyBounds,!1);s.x1=Math.floor(a.x1),s.y1=Math.floor(a.y1),s.x2=Math.ceil(a.x2),s.y2=Math.ceil(a.y2)}const l=e.dpr%1;(l||l!==.5)&&(s.x1=Math.floor(s.x1*e.dpr)/e.dpr,s.y1=Math.floor(s.y1*e.dpr)/e.dpr,s.x2=Math.ceil(s.x2*e.dpr)/e.dpr,s.y2=Math.ceil(s.y2*e.dpr)/e.dpr),this.backupDirtyBounds.copy(s),e.inuse=!0,e.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),e.clearMatrix(),e.setTransformForCurrent(!0),e.translate(o.x1,o.y1,!0),e.beginPath(),e.rect(s.x1,s.y1,s.width(),s.height()),e.clip(),i.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(n,e,t),e.save(),n.renderTreeRoots.sort((a,h)=>{var d,u;return((d=a.attribute.zIndex)!==null&&d!==void 0?d:_e.zIndex)-((u=h.attribute.zIndex)!==null&&u!==void 0?u:_e.zIndex)}).forEach(a=>{a.isContainer?this.renderGroup(a,t,wi.allocate(1,0,0,1,0,0)):this.renderItem(a,t)}),e.restore(),e.setClearMatrix(1,0,0,1,0,0),e.inuse=!1,e.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(n){let t=n.parent,e=n._uid;for(;t;){const i=tT(t,e,_e.zIndex);if(i)return i;e=t._uid,t=t.parent}return null}renderGroup(n,t,e,i){if(t.break||n.attribute.visibleAll===!1)return;if(n.incremental&&(t.startAtId==null||t.startAtId===n._uid))return t.break=!0,void this._increaseRender(n,t);if(this.useDirtyBounds&&!qd(n.AABBBounds,this.dirtyBounds,!1))return;let o,r=e;if(this.useDirtyBounds){o=pa.allocateByObj(this.dirtyBounds);const s=n.transMatrix;r=wi.allocateByObj(e).multiply(s.a,s.b,s.c,s.d,s.e,s.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(n,t,{drawingCb:()=>{var s;i?n.forEachChildren(l=>{t.break||(l.isContainer?this.renderGroup(l,t,r):this.renderItem(l,t))}):Cv(n,_e.zIndex,l=>{t.break||(l.isContainer?this.renderGroup(l,t,r):this.renderItem(l,t))},!1,!!(!((s=t.context)===null||s===void 0)&&s.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(o),pa.free(o),wi.free(r))}_increaseRender(n,t){const{layer:e,stage:i}=t,{subLayers:o}=e;let r=o.get(n._uid);r||(r={layer:this.layerService.createLayer(i),zIndex:o.size,group:n},o.set(n._uid,r));const s=r.layer.getNativeHandler().getContext(),l=r.drawContribution||Tt.get(xp);l.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.draw(this.currentRenderService,Object.assign(Object.assign({},t),{drawContribution:l,clear:"transparent",layer:r.layer,context:s,startAtId:n._uid,break:!1})),r.drawContribution=l;const a=this._findNextGraphic(n);if(a)if(a.isContainer&&a.incremental)this._increaseRender(a,t);else{let h=o.get(a._uid);h||(h={layer:this.layerService.createLayer(i),zIndex:o.size},o.set(a._uid,h));const d=h.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},t),{drawContribution:l,clear:"transparent",layer:h.layer,context:d,startAtId:a._uid,break:!1}))}}getRenderContribution(n){let t;return t||(t=this.selectRenderByNumberType(n.numberType,n)),t||(t=this.selectRenderByType(n.type)),t}renderItem(n,t,e){if(this.InterceptorContributions.length)for(let l=0;l<this.InterceptorContributions.length;l++){const a=this.InterceptorContributions[l];if(a.beforeDrawItem&&a.beforeDrawItem(n,this.currentRenderService,t,this,e))return}const i=this.getRenderContribution(n);if(!i)return;let o,r=!1;if(n.parent){const{scrollX:l=0,scrollY:a=0}=n.parent.attribute;if(r=!(!l&&!a),r){o=this.dirtyBounds.clone();const h=n.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(h),this.dirtyBounds.translate(-l,-a)}}if(this.useDirtyBounds&&!n.isContainer&&!qd(n.AABBBounds,this.dirtyBounds,!1))return void(r&&this.dirtyBounds.copy(o));const s=t.startAtId!=null&&n._uid!==t.startAtId;if(n._uid===t.startAtId&&(t.startAtId=null),e&&(e.skipDraw=s),s?n.isContainer&&i.draw(n,this.currentRenderService,t,e):i.draw(n,this.currentRenderService,t,e),r&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(let l=0;l<this.InterceptorContributions.length;l++){const a=this.InterceptorContributions[l];if(a.afterDrawItem&&a.afterDrawItem(n,this.currentRenderService,t,this))return}}selectRenderByType(n){return ne.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(n,t){let e;if(t.attribute.renderStyle){const i=this.styleRenderMap.get(t.attribute.renderStyle);e=i&&i.get(n)}return e||this.currentRenderMap.get(n)||this.defaultRenderMap.get(n)}clearScreen(n,t,e){var i,o;const{clear:r,viewBox:s}=e,l=s.width(),a=s.height();if(r){t.clearRect(0,0,l,a);const h=(i=n.drawParams)===null||i===void 0?void 0:i.stage;if(h&&(t.globalAlpha=(o=h.attribute.opacity)!==null&&o!==void 0?o:1),h&&h.backgroundImg&&h.resources){const d=h.resources.get(r);d&&d.state==="success"&&d.data&&t.drawImage(d.data,0,0,l,a)}else t.fillStyle=ju(t,r,{AABBBounds:{x1:0,y1:0,x2:0+l,y2:0+a}},0,0),t.fillRect(0,0,l,a)}}afterDraw(n,t){}};ka=eT([st(),uc(0,Mf(hi)),uc(1,Ot(Me)),uc(1,Ie(xs)),iT("design:paramtypes",[Array,Object])],ka);var nT=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Ia=class extends Ss{constructor(){super(...arguments),this.numberType=vs}drawShape(n,t,e,i,o,r,s,l){if(n.incremental&&o.multiGraphicOptions){const{startAtIdx:a,length:h}=o.multiGraphicOptions,{segments:d=[]}=n.attribute;if(a>d.length)return;const u=Ht(n).line,{fill:c=u.fill,stroke:g=u.stroke,opacity:f=u.opacity,fillOpacity:p=u.fillOpacity,strokeOpacity:v=u.strokeOpacity,lineWidth:m=u.lineWidth,visible:b=u.visible}=n.attribute,w=To(f,p,c),C=Eu(f,v),_=cr(c),y=Cs(g,m);if(!n.valid||!b||!_&&!y||!(w||C||s||l))return;const{context:x}=o;for(let S=a;S<a+h;S++)this.drawIncreaseSegment(n,x,d[S-1],d[S],n.attribute.segments[S],[u,n.attribute],e,i)}else super.drawShape(n,t,e,i,o,r,s,l)}drawIncreaseSegment(n,t,e,i,o,r,s,l){i&&(t.beginPath(),Kx(t.nativeContext,e,i,{offsetX:s,offsetY:l}),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,o,r),t.setStrokeStyle(n,o,s,l,r),t.stroke())}};Ia=nT([st()],Ia);var oT=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let cc=class extends Ku{constructor(){super(...arguments),this.numberType=Y0}drawShape(n,t,e,i,o,r,s){if(n.incremental&&o.multiGraphicOptions){const{startAtIdx:l,length:a}=o.multiGraphicOptions,{segments:h=[]}=n.attribute;if(l>h.length)return;const d=Ht(n).area,{fill:u=d.fill,fillOpacity:c=d.fillOpacity,opacity:g=d.opacity,visible:f=d.visible}=n.attribute,p=To(g,c,u),v=cr(u);if(!n.valid||!f||!v||!p&&!s)return;for(let m=l;m<l+a;m++)this.drawIncreaseSegment(n,t,h[m-1],h[m],n.attribute.segments[m],[d,n.attribute],e,i)}else super.drawShape(n,t,e,i,o,r,s)}drawIncreaseSegment(n,t,e,i,o,r,s,l){i&&(t.beginPath(),$x(t.camera?t:t.nativeContext,e,i,{offsetX:s,offsetY:l}),t.setShadowBlendStyle&&t.setShadowBlendStyle(n,o,r),t.setCommonStyle(n,o,s,l,r),t.fill())}};cc=oT([st()],cc);var yr,rT=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},sT=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},Ls=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}},vn=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};(function(n){n[n.NORMAL=0]="NORMAL",n[n.STOP=1]="STOP"})(yr||(yr={}));let gc=class extends ka{constructor(n,t,e,i){super(n,i),this.contributions=n,this.lineRender=t,this.areaRender=e,this.drawItemInterceptorContributions=i,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=yr.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new gi([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(n,t){return vn(this,void 0,void 0,function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=n,this.lastDrawContext=t,this.checkingForDrawPromise=this.checkForDraw(t);const e=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,e)return;this.currentRenderService=n;const{context:i,viewBox:o}=t;i&&(i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0),i.save(),t.restartIncremental&&this.clearScreen(this.currentRenderService,i,t),i.translate(o.x1,o.y1,!0),i.save(),n.renderTreeRoots.sort((r,s)=>{var l,a;return((l=r.attribute.zIndex)!==null&&l!==void 0?l:_e.zIndex)-((a=s.attribute.zIndex)!==null&&a!==void 0?a:_e.zIndex)}).forEach(r=>{this.renderGroup(r,t)}),this.hooks.completeDraw.tap("top-draw",()=>{i.restore(),i.restore(),i.draw(),i.inuse=!1,this.rendering=!1}))})}_increaseRender(n,t){return vn(this,void 0,void 0,function*(){this.rendering=!0,yield this._renderIncrementalGroup(n,t)})}_renderIncrementalGroup(n,t){return vn(this,void 0,void 0,function*(){this.count=n.count,yield new Promise(e=>{this.renderItem(n,t,{drawingCb:()=>vn(this,void 0,void 0,function*(){if(n.count!==2)yield _v(n,_e.zIndex,(i,o)=>{if(this.status===yr.STOP)return!0;if(i.isContainer||o<this.currentIdx)return!1;const r=this.currFrameStartAt+n.incremental;return o<r&&(this.currentIdx=o+1,this.renderItem(i,t)),o===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())}),e(!1);else{const i=n.getChildAt(0);if(i.incremental&&i.attribute.segments)for(i.incrementalAt||(i.incrementalAt=0);i.incrementalAt<i.attribute.segments.length;)t.multiGraphicOptions={startAtIdx:i.incrementalAt,length:i.incremental},this.renderItem(i,t),i.incrementalAt+=i.incremental,yield this.waitToNextFrame();else this.renderItem(i,t);e(!1)}})})}),this.hooks.completeDraw.call()})}waitToNextFrame(){return vn(this,void 0,void 0,function*(){return new Promise(n=>{this.global.getRequestAnimationFrame()(()=>{n(!1)})})})}checkForDraw(n){return vn(this,void 0,void 0,function*(){let t=this.rendering;return n.restartIncremental&&(t=!1,yield this.forceStop(),this.resetToInit()),t})}forceStop(){return vn(this,void 0,void 0,function*(){this.rendering&&(this.status=yr.STOP,yield new Promise(n=>{this.hooks.completeDraw.tap("stopCb",()=>{this.status=yr.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter(t=>t.name!=="stopCb"),n(!1)})}))})}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(n,t){return vn(this,void 0,void 0,function*(){if(!t.break&&n.attribute.visibleAll!==!1)return n.incremental&&t.startAtId===n._uid?(yield this._increaseRender(n,t),void(t.break=!0)):void(yield new Promise(e=>{this.renderItem(n,t,{drawingCb:()=>vn(this,void 0,void 0,function*(){yield _v(n,_e.zIndex,i=>vn(this,void 0,void 0,function*(){t.break||i.isContainer&&(yield this.renderGroup(i,t))})),e(!1)})})}))})}};gc=rT([st(),Ls(0,Mf(hi)),Ls(1,Ot(Ia)),Ls(2,Ot(cc)),Ls(3,Ot(Me)),Ls(3,Ie(xs)),sT("design:paramtypes",[Array,Object,Object,Object])],gc);const lT=new Bt(n=>{n(ws).toSelf().inSingletonScope(),n(Gu).toSelf().inSingletonScope(),n(tc).to(ka),n(xp).to(gc),n(Ap).to(qu).inSingletonScope(),n(hi).toService(Ap),ei(n,tn),n(nn).toSelf().inSingletonScope(),ei(n,Ou),ei(n,hi),n(Ra).toSelf().inSingletonScope(),n(xs).toService(Ra),ei(n,xs)});function aT(n){n.load(lT)}function Fs(){Fs.__loaded||(Fs.__loaded=!0,Tt.load(ZS),Tt.load(jR),Tt.load(EA),Tt.load(VR),Tt.load(KR),JR(Tt),aT(Tt))}Fs.__loaded=!1,Fs();const Ce=Tt.get(Nd);X.global=Ce;const hT=Tt.get(tp);X.graphicUtil=hT;const dT=Tt.get(Q0);X.transformUtil=dT;const uT=Tt.get(X0);X.graphicService=uT;const cT=Tt.get(Hu);X.layerService=cT;class gT{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=Te.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&t.stage!=null&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,X.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),X.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),X.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=i=>i.filter(o=>o.name!==this.key);X.graphicService.hooks.onAttributeUpdate.taps=e(X.graphicService.hooks.onAttributeUpdate.taps),X.graphicService.hooks.onSetStage.taps=e(X.graphicService.hooks.onSetStage.taps),X.graphicService.hooks.onRemove.taps=e(X.graphicService.hooks.onRemove.taps)}}class fT{constructor(){this.name="AutoRefreshPlugin",this.activeEvent="onRegister",this._uid=Te.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&t.stage!=null&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,this.dpr=X.global.devicePixelRatio,this.refresh()}refresh(){this._refreshByMediaQuery()||this._refreshByRaf()}_refreshByRaf(){const t=X.global.getRequestAnimationFrame();this.rafId=t(()=>{X.global.devicePixelRatio!==this.dpr&&(this.dpr=X.global.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0)),this.refresh()})}_refreshByMediaQuery(){try{const t=`(resolution: ${window.devicePixelRatio}dppx)`,e=()=>{window.devicePixelRatio!==this.dpr&&(this.dpr=window.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0))};matchMedia(t).addEventListener("change",e)}catch{return!1}return!0}deactivate(t){const e=X.global.getCancelAnimationFrame();e&&this.rafId&&e(this.rafId)}}class pT{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=Te.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,X.graphicService.hooks.onAddIncremental.tap(this.key,(e,i,o)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&e.stage!=null&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))}),X.graphicService.hooks.onClearIncremental.tap(this.key,(e,i)=>{e.stage===t.stage&&e.stage!=null&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))})}deactivate(t){X.graphicService.hooks.onAddIncremental.taps=X.graphicService.hooks.onAddIncremental.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.onClearIncremental.taps=X.graphicService.hooks.onClearIncremental.taps.filter(e=>e.name!==this.key)}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,X.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach(e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const o=e.layer.subLayers.get(e._uid);o&&o.drawContribution&&o.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:o.layer.getNativeHandler().getContext()},this.nextUserParams))}),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const yv=new he;class vT{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=Te.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,e=>{e&&e===this.pluginService.stage&&e.dirtyBounds.clear()}),X.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(e,i,o,r)=>{e.glyphHost&&(e=e.glyphHost),i&&i===this.pluginService.stage&&i.renderCount&&(e.isContainer&&!e.shouldSelfChangeUpdateAABBBounds()||o&&(yv.setValue(r.x1,r.y1,r.x2,r.y2),i.dirty(yv,e.parent&&e.parent.globalTransMatrix)))}),X.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(e,i,o,r,s)=>{i&&i===this.pluginService.stage&&i.renderCount&&(e.isContainer&&!s||i.dirty(r.globalAABBBounds))}),X.graphicService.hooks.clearAABBBounds.tap(this.key,(e,i,o)=>{i&&i===this.pluginService.stage&&i.renderCount&&i&&i.dirty(o)}),X.graphicService.hooks.onRemove.tap(this.key,e=>{const i=e.stage;i&&i===this.pluginService.stage&&i.renderCount&&i&&i.dirty(e.globalAABBBounds)})}deactivate(t){X.graphicService.hooks.beforeUpdateAABBBounds.taps=X.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.afterUpdateAABBBounds.taps=X.graphicService.hooks.afterUpdateAABBBounds.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.clearAABBBounds.taps=X.graphicService.hooks.clearAABBBounds.taps.filter(e=>e.name!==this.key),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.onRemove.taps=X.graphicService.hooks.onRemove.taps.filter(e=>e.name!==this.key)}}const fc=new R0;fc.addTimeline(T0),fc.setFPS(60);let Lo;function wv(){if(Lo==null)try{const n=document.createElement("canvas"),t=n.getContext("2d");Lo=!!(window&&n.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&t&&t.isPointInPath&&t.isPointInStroke),Lo&&(Lo=!!document.createElement)}catch{Lo=!1}}function pc(){wv();const n=X.global&&X.global.env;return n?n==="browser":Lo}function mT(){wv();const n=X.global&&X.global.env;return n?n==="node":!Lo}let eo=class bf{static registerPlugin(t,e){bf._pluginClasses[t]=e}static getPlugin(t){return bf._pluginClasses[t]}};eo._pluginClasses={};const Sv={WIDTH:500,HEIGHT:500,X:0,Y:0,BACKGROUND:"white"};class bT extends Qi{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return(t=this._background)!==null&&t!==void 0?t:Sv.BACKGROUND}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=i=>{if(!(this._skipRender<0))if(i){if(this.dirtyBounds){const o=this.window.getViewBox();this.dirtyBounds.setValue(o.x1,o.y1,o.width(),o.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=i=>{this._beforeRender&&this._beforeRender(i)},this.afterRender=i=>{this.renderCount++,this._afterRender&&this._afterRender(i),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach(o=>o(i)),this._afterNextRenderCbs=null},this.params=t,this.theme=new hs,this.hooks={beforeRender:new gi(["stage"]),afterRender:new gi(["stage"])},this.global=X.global,!this.global.env&&pc()&&this.global.setEnv("browser"),this.window=Tt.get(as),this.renderService=Tt.get(Pp),this.pluginService=Tt.get(vv),this.layerService=Tt.get(Hu),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:t.canvasControled!==!1,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=(e=t.background)!==null&&e!==void 0?e:Sv.BACKGROUND,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),t.autoRefresh&&this.enableAutoRefresh(),t.disableDirtyBounds===!1&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||fc,this.supportInteractiveLayer=t.interactiveLayer!==!1,this.timeline=new xu,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&Qt(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(t=-1){this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new _S(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:this.params.optimize.skipRenderWithOutRange!==!1?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:o=0,beta:r=0,camera:s,fieldRatio:l=1,fieldDepth:a}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:o,beta:r,camera:s,fieldRatio:l,fieldDepth:a})}set3dOptions(t){var e,i,o,r,s,l;this.option3d=t;const a=this.get3dOptions(t),{light:h,center:d,camera:u,alpha:c,beta:g,fieldRatio:f,fieldDepth:p}=a,{dir:v=[1,1,-1],color:m="white",ambient:b}=h,w=((e=d.x)!==null&&e!==void 0?e:this.width/2)+((i=d.dx)!==null&&i!==void 0?i:0),C=((o=d.y)!==null&&o!==void 0?o:this.height/2)+((r=d.dy)!==null&&r!==void 0?r:0),_=[w,C,((s=d.z)!==null&&s!==void 0?s:0)+((l=d.dz)!==null&&l!==void 0?l:0)];let y=0,x=0,S=0;u||(y=Math.sin(c)+w,x=Math.sin(g)+C,S=Math.cos(c)*Math.cos(g)*1);const A=eo.getPlugin("DirectionalLight");A&&(this.light=new A(v,m,b));const R={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:f,fieldDepth:p,viewParams:{pos:[y,x,S],center:_,up:[0,1,0]}};if(this.camera)this.camera.params=R;else{const T=eo.getPlugin("OrthoCamera");T&&(this.camera=new T(R))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=eo.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new gT))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableAutoRefresh(){this.autoRefresh||(this.autoRefresh=!0,this.pluginService.register(new fT))}disableAutoRefresh(){this.autoRefresh&&(this.autoRefresh=!1,this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new pT))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Ci;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new vT,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=eo.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=eo.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableReactAttribute(t){if(this.reactAttribute)return;const e=eo.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach(t=>{this.pluginService.unRegister(t)}))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if(this.releaseStatus==="released")return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach(i=>{this.appendChild(i)})}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){this.releaseStatus!=="released"&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if(this.releaseStatus==="released")return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if(this.global.env==="harmony"){const t=this.window.getContext().nativeContext;this.forEachChildren((e,i)=>{if(i>0){const o=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(o)}})}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach(i=>{this.nextFrameRenderLayerSet.add(i)}),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){if(this.releaseStatus==="released")return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let o=0;o<t.length;o++){let r=t[o];r.layerMode==="virtual"&&(r=r.getNativeHandler().mainHandler.layer),i.includes(r)||i.push(r)}i.forEach(o=>{o.renderCount>this.renderCount||(o.renderCount=this.renderCount+1,o===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),o.render({renderService:this.renderService,background:o===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){this.releaseStatus!=="released"&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren(o=>{o.resize(t,e)}),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e,i=!0){this.releaseStatus!=="released"&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren(o=>{o.resizeView(t,e)}),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,o,r){let s=!0;typeof t=="object"?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),e===!1&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+o),r===!1&&(s=!1)),this.forEachChildren(l=>{l.resizeView(this.viewBox.width(),this.viewBox.height())}),s&&this.render()}setDpr(t,e=!0){this.forEachChildren(i=>{i.setDpr(t)}),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if(this.releaseStatus==="released")return;const i=this.getPickerService().pick(this.children,new ye(t,e),{bounds:this.AABBBounds});return!(!(i!=null&&i.graphic)&&!(i!=null&&i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach(t=>{t.release()}),this.interactiveLayer&&(this.interactiveLayer.forEachChildren(t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)}),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){this.releaseStatus!=="released"&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter(e=>e.name===t)[0]}renderTo(t){this.releaseStatus!=="released"&&this.forEachChildren((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:i===0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})})}renderToNewWindow(t=!0,e){if(this.releaseStatus==="released")return;const i=Tt.get(as),o=e?-e.x1:0,r=e?-e.y1:0,s=e?e.x2:this.viewWidth,l=e?e.y2:this.viewHeight,a=e?e.width():this.viewWidth,h=e?e.height():this.viewHeight;return i.create({viewBox:{x1:o,y1:r,x2:s,y2:l},width:a,height:h,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){if(this.releaseStatus==="released")return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=Tt.get(br)),this.pickerService}}function CT(n){return new bT(n)}const vc={WIDTH:500,HEIGHT:500,DPR:1};class mc{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:o=vc.WIDTH,height:r=vc.HEIGHT,dpr:s=vc.DPR,x:l,y:a,id:h,canvasControled:d=!0}=t;this._x=l??0,this._y=a??0,this._pixelWidth=o*s,this._pixelHeight=r*s,this._visiable=t.visiable!==!1,this.controled=d,this._displayWidth=o,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._id=(e=i.id)!==null&&e!==void 0?e:h,h&&(i.id=h),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,o){return this._context.getImageData(t,e,i,o)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}mc.env="browser";var _T=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let za=class{configure(n,...t){n.env===this.type&&n.setActiveEnvContribution(this)}getNativeAABBBounds(n){return new he}removeDom(n){return!1}createDom(n){return null}updateDom(n,t){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(n){return document.getElementById(n)}getRootElement(){return document.body}loadJson(n){const t=fetch(n).then(e=>e.json());return t.then(e=>({data:e,state:"success"})).catch(()=>({data:null,state:"fail"})),t}loadArrayBuffer(n){return fetch(n).then(t=>t.arrayBuffer()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadBlob(n){return fetch(n).then(t=>t.blob()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}getElementTop(n,t){return 0}getElementLeft(n,t){return 0}getElementTopLeft(n,t){return{top:0,left:0}}};za=_T([st()],za);var yT=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},wT=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let Da=class{constructor(){this._uid=Te.GenAutoIncrementId(),this.viewBox=new he,this.modelMatrix=new He(1,0,0,1,0,0)}onChange(n){this._onChangeCb=n}configure(n,t){t.env===this.type&&n.setWindowHandler(this)}release(...n){this.releaseWindow()}isVisible(n){return!0}onVisibleChange(n){}getTopLeft(n){return{top:0,left:0}}setViewBox(n){this.viewBox.setValue(n.x1,n.y1,n.x2,n.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(n,t,e,i,o,r){this.modelMatrix.setValue(n,t,e,i,o,r)}getViewBoxTransform(){return this.modelMatrix}};Da=yT([st(),wT("design:paramtypes",[])],Da);var ST=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},xT=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},xv=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let bc=class{constructor(n){this.pickItemInterceptorContributions=n,this.type="default",this.global=X.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((n,t)=>n.order-t.order)}pick(n,t,e){let i={graphic:null,group:null};e.pickerService=this;const o=e.bounds.width(),r=e.bounds.height();if(!new he().setValue(0,0,o,r).containsPoint(t))return i;this.pickContext&&(this.pickContext.inuse=!0),e.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const s=new He(1,0,0,1,0,0);let l;for(let a=n.length-1;a>=0&&(i=n[a].isContainer?this.pickGroup(n[a],t,s,e):this.pickItem(n[a],t,s,e),!i.graphic);a--)l||(l=i.group);if(i.graphic||(i.group=l),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){let a=i.graphic;for(;a.parent;)a=a.parent;a.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=a.shadowHost)}return i}containsPoint(n,t,e){var i;return!!(!((i=this.pickItem(n,t,null,e??{pickContext:this.pickContext,pickerService:this}))===null||i===void 0)&&i.graphic)}pickGroup(n,t,e,i){let o={group:null,graphic:null};if(n.attribute.visibleAll===!1)return o;const r=i.pickContext,s=r.modelMatrix;if(r.camera){const g=n.transMatrix,f=Le.allocate();if(Wu(f,g),s){if(f){const p=Le.allocate();r.modelMatrix=ys(p,s,f),Le.free(f)}}else Wu(f,n.globalTransMatrix),r.modelMatrix=f}if(this.InterceptorContributions.length)for(let g=0;g<this.InterceptorContributions.length;g++){const f=this.InterceptorContributions[g];if(f.beforePickItem){const p=f.beforePickItem(n,this,t,i,{parentMatrix:e});if(p)return r.modelMatrix!==s&&Le.free(r.modelMatrix),r.modelMatrix=s,p}}const l=n.transMatrix,a=wi.allocateByObj(e),h=new ye(t.x,t.y);a.transformPoint(h,h);const d=n.AABBBounds.containsPoint(h);if(!d&&!n.stage.camera)return o;const u=this.pickItem(n,h.clone(),e,i);u&&u.graphic&&(o.graphic=u.graphic,o.params=u.params);const c=n.attribute.pickable!==!1&&d;return a.multiply(l.a,l.b,l.c,l.d,l.e,l.f),n.attribute.childrenPickable===!1||u&&u.graphic||Cv(n,_e.zIndex,g=>{if(g.isContainer){const f=new ye(t.x,t.y),p=Ht(n).group,{scrollX:v=p.scrollX,scrollY:m=p.scrollY}=n.attribute;f.x-=v,f.y-=m,o=this.pickGroup(g,f,a,i)}else{const f=new ye(t.x,t.y);a.transformPoint(f,f);const p=Ht(n).group,{scrollX:v=p.scrollX,scrollY:m=p.scrollY}=n.attribute;f.x-=v,f.y-=m;const b=this.pickItem(g,f,e,i);b&&b.graphic&&(o.graphic=b.graphic,o.params=b.params)}return!!o.graphic||!!o.group},!0,!!r.camera),r.modelMatrix!==s&&Le.free(r.modelMatrix),r.modelMatrix=s,o.graphic||o.group||!c||n.stage.camera||(o.group=n),wi.free(a),o}selectPicker(n){return this.pickerMap.get(n.numberType)||null}};bc=ST([st(),xv(0,Ot(Me)),xv(0,Ie(_r)),xT("design:paramtypes",[Object])],bc);let Av=!1;const AT=new Bt(n=>{Av||(Av=!0,n(aa).toSelf().inSingletonScope(),n(Ca).to(aa).inSingletonScope(),n(hi).toService(Ca),n(Fu).toService(nn),ei(n,Fu))});let Rv=!1;const RT=new Bt(n=>{Rv||(Rv=!0,n(ga).toSelf().inSingletonScope(),n(xa).to(ga).inSingletonScope(),n(hi).toService(xa),n(vr).toSelf(),n(pr).toSelf(),n(Po).toService(vr),n(Po).toService(pr),n(Po).toService(nn),ei(n,Po))});let Tv=!1;const TT=new Bt(n=>{Tv||(Tv=!0,n(Ss).toSelf().inSingletonScope(),n(Ia).toSelf().inSingletonScope(),n(ya).to(Ss).inSingletonScope(),n(hi).toService(ya))});let Mv=!1;const MT=new Bt(n=>{Mv||(Mv=!0,n(fa).toSelf().inSingletonScope(),n(Aa).to(fa).inSingletonScope(),n(hi).toService(Aa),n(Du).toService(nn),ei(n,Du))});let Bv=!1;const BT=new Bt(n=>{Bv||(Bv=!0,n(ha).toSelf().inSingletonScope(),n(_a).to(ha).inSingletonScope(),n(hi).toService(_a),n(ku).toService(nn),ei(n,ku))});let Pv=!1;const PT=new Bt(n=>{Pv||(Pv=!0,n(Ju).to($u).inSingletonScope(),n(hi).toService(Ju),n(sa).toService(nn),ei(n,sa))});let Hv=!1;const HT=new Bt(n=>{Hv||(Hv=!0,n(ca).toSelf().inSingletonScope(),n(wa).to(ca).inSingletonScope(),n(hi).toService(wa),n(Iu).toService(nn),ei(n,Iu))});let Ev=!1;const ET=new Bt(n=>{Ev||(Ev=!0,n(Sa).to(Xu).inSingletonScope(),n(hi).toService(Sa),n(zu).toService(nn),ei(n,zu))});var LT=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},FT=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let Cc=class extends vi{constructor(){super(),this.numberType=Pu,this.builtinContributions=[bp],this.init()}drawShape(n,t,e,i,o){const r=Ht(n).richtext,{strokeOpacity:s=r.strokeOpacity,opacity:l=r.opacity,fillOpacity:a=r.fillOpacity,visible:h=r.visible}=n.attribute;if(!n.valid||!h)return;const d=To(l,a,!0),u=To(l,s,!0);d&&(t.translate(e,i),this.beforeRenderStep(n,t,e,i,d,u,d,u,r,o),n.getFrameCache().draw(t,this.drawIcon),this.afterRenderStep(n,t,e,i,d,u,d,u,r,o))}drawIcon(n,t,e,i,o){var r;const s=Ht(n).richtextIcon,{width:l=s.width,height:a=s.height,opacity:h=s.opacity,image:d,backgroundFill:u=s.backgroundFill,backgroundFillOpacity:c=s.backgroundFillOpacity,backgroundStroke:g=s.backgroundStroke,backgroundStrokeOpacity:f=s.backgroundStrokeOpacity,backgroundRadius:p=s.backgroundRadius,margin:v}=n.attribute,{backgroundWidth:m=l,backgroundHeight:b=a}=n.attribute;if(v&&(e+=n._marginArray[3],i+=n._marginArray[0]),n._hovered){const C=(m-l)/2,_=(b-a)/2;p===0?(t.beginPath(),t.rect(e-C,i-_,m,b)):(t.beginPath(),on(t,e-C,i-_,m,b,p)),u&&(t.globalAlpha=c,t.fillStyle=u,t.fill()),g&&(t.globalAlpha=f,t.strokeStyle=g,t.stroke())}const w=d&&((r=n==null?void 0:n.resources)===null||r===void 0?void 0:r.get(d));w&&w.state==="success"&&(t.globalAlpha=h,t.drawImage(w.data,e,i,l,a))}draw(n,t,e){const i=Ht(n).richtext;this._draw(n,i,!1,e)}};Cc=LT([st(),FT("design:paramtypes",[])],Cc);let Lv=!1;const kT=new Bt(n=>{Lv||(Lv=!0,n(Qu).to(Cc).inSingletonScope(),n(hi).toService(Qu))});let Fv=!1;const IT=new Bt(n=>{Fv||(Fv=!0,n(Rp).to(Zu).inSingletonScope(),n(hi).toService(Rp),n(Bo).toService(nn),ei(n,Bo))});function zT(){bt.RegisterGraphicCreator("arc",ac)}function DT(){bt.RegisterGraphicCreator("circle",Lp)}function OT(){bt.RegisterGraphicCreator("group",ra)}function WT(){bt.RegisterGraphicCreator("image",Pa)}function NT(){bt.RegisterGraphicCreator("line",Si)}function VT(){bt.RegisterGraphicCreator("path",DR)}function jT(){bt.RegisterGraphicCreator("polygon",OR)}function GT(){bt.RegisterGraphicCreator("rect",ve)}function UT(){bt.RegisterGraphicCreator("richtext",zR)}function KT(){bt.RegisterGraphicCreator("symbol",Ms)}function $T(){bt.RegisterGraphicCreator("text",nc)}function YT(){bt.RegisterGraphicCreator("shadowRoot",NR)}function XT(){bt.RegisterGraphicCreator("wrapText",LA)}const kv=new he;class qT{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=Te.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new he}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t,e=!0){if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const o=Ht(i).group,{display:r=o.display}=i.attribute;if(r!=="flex")return;const{flexDirection:s=o.flexDirection,flexWrap:l=o.flexWrap,alignItems:a=o.alignItems,clip:h=o.clip}=i.attribute,{alignContent:d=a??o.alignContent}=i.attribute;let{width:u,height:c,justifyContent:g=o.justifyContent}=i.attribute;const f=i.getChildren();if(u==null||c==null){let S=0,A=0,R=0;if(f.forEach(T=>{const M=this.getAABBBounds(T);M.empty()||(s==="column"||s==="column-reverse"?(A+=M.height(),S=Math.max(S,M.width())):(S+=M.width(),A=Math.max(A,M.height())),R+=M.x1,R+=M.y1,R+=M.x2,R+=M.y2)}),!isFinite(R))return;u=S,c=A}i.attribute.width==null?i.attribute.width=u:u=i.attribute.width,i.attribute.height==null?i.attribute.height=c:c=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const p={main:{len:u,field:"x"},cross:{len:c,field:"y"}},v=p.main,m=p.cross;s!=="column"&&s!=="column-reverse"||(v.len=c,m.len=u,v.field="y",m.field="x"),s!=="row-reverse"&&s!=="column-reverse"||(g==="flex-start"?g="flex-end":g==="flex-end"?g="flex-start":f.reverse());let b=0,w=0;const C=[];f.forEach(S=>{const A=this.getAABBBounds(S);if(A.empty())return;const R=v.field==="x"?A.width():A.height(),T=m.field==="x"?A.width():A.height();C.push({mainLen:R,crossLen:T}),b+=R,w=Math.max(w,T)});const _=[];if(b>v.len&&l==="wrap"){let S=0,A=0;C.forEach(({mainLen:R,crossLen:T},M)=>{S+R>v.len?S===0?(_.push({idx:M,mainLen:S+R,crossLen:T}),S=0,A=0):(_.push({idx:M-1,mainLen:S,crossLen:A}),S=R,A=T):(S+=R,A=Math.max(A,T))}),_.push({idx:C.length-1,mainLen:S,crossLen:A})}else _.push({idx:C.length-1,mainLen:b,crossLen:w});let y=0;if(_.forEach(S=>{this.layoutMain(i,f,g,v,C,y,S),y=S.idx+1}),w=_.reduce((S,A)=>S+A.crossLen,0),_.length===1){const S={"flex-start":0,"flex-end":m.len,center:m.len/2};this.layoutCross(f,a,m,S,C,_[0],0)}else if(d==="flex-start"){y=0;let S=0;_.forEach((A,R)=>{const T={"flex-start":S,"flex-end":S+A.crossLen,center:S+A.crossLen/2};this.layoutCross(f,"flex-start",m,T,C,_[R],y),y=A.idx+1,S+=A.crossLen})}else if(d==="center"){y=0;let S=Math.max(0,(m.len-w)/2);_.forEach((A,R)=>{const T={"flex-start":S,"flex-end":S+A.crossLen,center:S+A.crossLen/2};this.layoutCross(f,"center",m,T,C,_[R],y),y=A.idx+1,S+=A.crossLen})}else if(d==="space-around"){y=0;const S=Math.max(0,(m.len-w)/_.length/2);let A=S;_.forEach((R,T)=>{const M={"flex-start":A,"flex-end":A+R.crossLen,center:A+R.crossLen/2};this.layoutCross(f,"flex-start",m,M,C,_[T],y),y=R.idx+1,A+=R.crossLen+2*S})}else if(d==="space-between"){y=0;const S=Math.max(0,(m.len-w)/(2*_.length-2));let A=0;_.forEach((R,T)=>{const M={"flex-start":A,"flex-end":A+R.crossLen,center:A+R.crossLen/2};this.layoutCross(f,"flex-start",m,M,C,_[T],y),y=R.idx+1,A+=R.crossLen+2*S})}f.forEach((S,A)=>{S.addUpdateBoundTag(),S.addUpdatePositionTag(),S.clearUpdateLayoutTag()}),i.addUpdateLayoutTag();const x=this.getAABBBounds(i);h||this.tempBounds.equals(x)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(e??0)-i}layoutMain(t,e,i,o,r,s,l){if(i==="flex-start"){let a=0;for(let h=s;h<=l.idx;h++){const d=a+mn(e[h],o.field),u=this.getAABBBounds(e[h]);!u.empty()&&(e[h].attribute[o.field]=this.updateChildPos(d,e[h].attribute[o.field],u[`${o.field}1`])),a+=r[h].mainLen}}else if(i==="flex-end"){let a=o.len;for(let h=l.idx;h>=s;h--){a-=r[h].mainLen;const d=a+mn(e[h],o.field),u=this.getAABBBounds(e[h]);!u.empty()&&(e[h].attribute[o.field]=this.updateChildPos(d,e[h].attribute[o.field],u[`${o.field}1`]))}}else if(i==="space-around")if(l.mainLen>=o.len){let a=0;for(let h=s;h<=l.idx;h++){const d=a+mn(e[h],o.field),u=this.getAABBBounds(e[h]);!u.empty()&&(e[h].attribute[o.field]=this.updateChildPos(d,e[h].attribute[o.field],u[`${o.field}1`])),a+=r[h].mainLen}}else{const a=l.idx-s+1,h=(o.len-l.mainLen)/a/2;let d=h;for(let u=s;u<=l.idx;u++){const c=d+mn(e[u],o.field),g=this.getAABBBounds(e[u]);!g.empty()&&(e[u].attribute[o.field]=this.updateChildPos(c,e[u].attribute[o.field],g[`${o.field}1`])),d+=r[u].mainLen+2*h}}else if(i==="space-between")if(l.mainLen>=o.len){let a=0;for(let h=s;h<=l.idx;h++){const d=a+mn(e[h],o.field),u=this.getAABBBounds(e[h]);!u.empty()&&(e[h].attribute[o.field]=this.updateChildPos(d,e[h].attribute[o.field],u[`${o.field}1`])),a+=r[h].mainLen}}else{const a=l.idx-s+1,h=(o.len-l.mainLen)/(2*a-2);let d=0;for(let u=s;u<=l.idx;u++){const c=d+mn(e[u],o.field),g=this.getAABBBounds(e[u]);!g.empty()&&(e[u].attribute[o.field]=this.updateChildPos(c,e[u].attribute[o.field],g[`${o.field}1`])),d+=r[u].mainLen+2*h}}else if(i==="center"){let a=(o.len-l.mainLen)/2;for(let h=s;h<=l.idx;h++){const d=a+mn(e[h],o.field),u=this.getAABBBounds(e[h]);!u.empty()&&(e[h].attribute[o.field]=this.updateChildPos(d,e[h].attribute[o.field],u[`${o.field}1`])),a+=r[h].mainLen}}}layoutCross(t,e,i,o,r,s,l){var a;for(let h=l;h<=s.idx;h++){const d=t[h];let{alignSelf:u}=d.attribute;u&&u!=="auto"||(u=e);const c=this.getAABBBounds(d),g=(a=o[u])!==null&&a!==void 0?a:o["flex-start"];u==="flex-end"?!c.empty()&&(d.attribute[i.field]=this.updateChildPos(g-r[h].crossLen+mn(d,i.field),d.attribute[i.field],c[`${i.field}1`])):u==="center"?!c.empty()&&(d.attribute[i.field]=this.updateChildPos(g-r[h].crossLen/2+mn(d,i.field),d.attribute[i.field],c[`${i.field}1`])):!c.empty()&&(d.attribute[i.field]=this.updateChildPos(g+mn(d,i.field),d.attribute[i.field],c[`${i.field}1`]))}}activate(t){this.pluginService=t,X.graphicService.hooks.onAttributeUpdate.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),e.stage&&e.stage===this.pluginService.stage&&this.tryLayout(e,!1)}),X.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(e,i,o,r)=>{e.glyphHost&&(e=e.glyphHost),i&&i===this.pluginService.stage&&e.isContainer&&!this.skipBoundsTrigger&&kv.copy(r)}),X.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(e,i,o,r,s)=>{i&&i===this.pluginService.stage&&e.isContainer&&!this.skipBoundsTrigger&&(kv.equals(o)||this.tryLayout(e,!1))}),X.graphicService.hooks.onSetStage.tap(this.key,e=>{e.glyphHost&&(e=e.glyphHost),this.tryLayout(e,!1)})}deactivate(t){X.graphicService.hooks.onAttributeUpdate.taps=X.graphicService.hooks.onAttributeUpdate.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.beforeUpdateAABBBounds.taps=X.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.afterUpdateAABBBounds.taps=X.graphicService.hooks.afterUpdateAABBBounds.taps.filter(e=>e.name!==this.key),X.graphicService.hooks.onSetStage.taps=X.graphicService.hooks.onSetStage.taps.filter(e=>e.name!==this.key)}}function mn(n,t){return 0}const Iv=()=>{eo.registerPlugin("FlexLayoutPlugin",qT)},zv=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Ni extends Qi{constructor(t,e){super(t),e!=null&&e.mode&&(this.mode=e.mode,this.setMode(e.mode)),e!=null&&e.skipDefault&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage(()=>{this.render(),this.bindEvents()})}setAttribute(t,e,i){er(this.attribute[t])&&er(e)&&!jt(this.attribute[t])&&!jt(e)?dt(this.attribute[t],e):this.attribute[t]=e,zv.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){const i=Object.keys(t);this._mergeAttributes(t,i),i.every(o=>zv.includes(o))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){ct(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const o=e[i];!er(this.attribute[o])||jt(this.attribute[o])||jt(t[o])?this.attribute[o]=t[o]:dt(this.attribute[o],t[o])}}bindEvents(){}_getNodeId(t){var e;return`${(e=this.id)!==null&&e!==void 0?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const o=new Su(t,e);o.manager=(i=this.stage)===null||i===void 0?void 0:i.eventSystem.manager,this.dispatchEvent(o)}}const io=Symbol.for("MathPickerContribution"),Dv=Symbol.for("MathArcPicker"),Ov=Symbol.for("MathCirclePicker"),Oa=Symbol.for("MathImagePicker"),Wv=Symbol.for("MathLinePicker"),Nv=Symbol.for("MathPathPicker"),Vv=Symbol.for("MathRectPicker"),jv=Symbol.for("MathSymbolPicker"),Gv=Symbol.for("MathTextPicker"),Uv=Symbol.for("MathPolygonPicker"),Kv=Symbol.for("CanvasArcPicker"),$v=Symbol.for("CanvasCirclePicker"),Yv=Symbol.for("CanvasImagePicker"),Xv=Symbol.for("CanvasLinePicker"),qv=Symbol.for("CanvasPathPicker"),Zv=Symbol.for("CanvasRectPicker"),Jv=Symbol.for("CanvasSymbolPicker"),Qv=Symbol.for("CanvasTextPicker"),tm=Symbol.for("CanvasPolygonPicker"),em=Symbol.for("CanvasRichTextPicker"),im=Symbol.for("CanvasGroupPicker"),xi=Symbol.for("CanvasPickerContribution"),ZT={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},nm=(n,t)=>{const e=t.x-n.x,i=t.y-n.y;return Math.abs(e)>Math.abs(i)?e>0?"right":"left":i>0?"down":"up"},Wa=(n,t)=>{const e=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);return Math.sqrt(e*e+i*i)},JT=n=>{const t=n.length;if(t===1)return{x:Math.round(n[0].x),y:Math.round(n[0].y)};let e=0,i=0,o=0;for(;o<t;)e+=n[o].x,i+=n[o].y,o++;return{x:Math.round(e/t),y:Math.round(i/t)}};class QT extends _o{constructor(t,e={}){var i,o,r,s,l,a,h,d,u,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=g=>{this.cachedEvents=[],this.startPoints=[],this.reset(),this.startTime=Ao.now();const{cachedEvents:f,startPoints:p}=this;g&&f.push(g.clone()),p.length=f.length;for(let v=0;v<f.length;v++){const{x:m,y:b}=f[v],w={x:m,y:b};p[v]=w}if(p.length!==1)this.startDistance=Wa(p[0],p[1]),this.center=JT([p[0],p[1]]);else{const v=f[0];this.pressTimeout=setTimeout(()=>{v.direction="none",v.deltaX=0,v.deltaY=0,v.points=p,this.triggerStartEvent("press",v),this.triggerEvent("press",v),this.eventType="press",this.direction="none",this.pressTimeout=null},this.config.press.time)}},this.onMove=g=>{this.clearPressTimeout();const{startPoints:f,cachedEvents:p}=this;if(!f.length)return;const v=g.clone(),{x:m,y:b,pointerId:w}=v;for(let A=0,R=p.length;A<R;A++)if(w===p[A].pointerId){p[A]=v;break}const C={x:m,y:b},_=p.map(A=>({x:A.x,y:A.y})),y=Ao.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=y,this.lastMovePoint=C,f.length===1){const A=f[0],R=m-A.x,T=b-A.y,M=this.direction||nm(A,C);this.direction=M;const P=this.getEventType(C);return v.direction=M,v.deltaX=R,v.deltaY=T,v.points=_,this.triggerStartEvent(P,v),void this.triggerEvent(P,v)}const{startDistance:x}=this,S=Wa(_[0],_[1]);v.scale=S/x,v.center=this.center,v.points=_,this.triggerStartEvent("pinch",v),this.triggerEvent("pinch",v)},this.onEnd=g=>{const f=g.clone(),{cachedEvents:p,startPoints:v}=this,m=p.map(b=>({x:b.x,y:b.y}));if(f.points=m,this.triggerEndEvent(f),p.length===1){const b=Ao.now(),w=this.lastMoveTime;if(b-w<100){const C=w-(this.prevMoveTime||this.startTime);if(C>0){const _=this.prevMovePoint||v[0],y=this.lastMovePoint||v[0],x=Wa(_,y),S=x/C;if(S>this.config.swipe.velocity&&x>this.config.swipe.threshold)return f.velocity=S,f.direction=nm(_,y),this.triggerEvent("swipe",f),this.cachedEvents=[],this.startPoints=[],void this.reset()}}b-this.startTime<this.config.press.time&&(b-this.lastTapTime<this.config.tap.interval&&g.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=b,this.lastTapTarget=g.target,this.tapCount===1?this.triggerEvent("tap",f):this.tapCount===2&&(this.triggerEvent("doubletap",f),this.tapCount=0))}for(let b=0,w=p.length;b<w;b++)if(p[b].pointerId===f.pointerId){p.splice(b,1),v.splice(b,1);break}this.reset(),p.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:(o=(i=e==null?void 0:e.press)===null||i===void 0?void 0:i.time)!==null&&o!==void 0?o:251,threshold:(s=(r=e==null?void 0:e.press)===null||r===void 0?void 0:r.threshold)!==null&&s!==void 0?s:9},swipe:{threshold:(a=(l=e==null?void 0:e.swipe)===null||l===void 0?void 0:l.threshold)!==null&&a!==void 0?a:10,velocity:(d=(h=e==null?void 0:e.swipe)===null||h===void 0?void 0:h.velocity)!==null&&d!==void 0?d:.3},tap:{interval:(c=(u=e==null?void 0:e.tap)===null||u===void 0?void 0:u.interval)!==null&&c!==void 0?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:o}=this;if(e)return e;let r;return r=Ao.now()-i>this.config.press.time&&Wa(o[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,o={type:t,ev:e};for(let r=0,s=i.length;r<s;r++)if(i[r].type===t)return void i.splice(r,1,o);i.push(o)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:o}=this;i||(this.throttleTimer=X.global.getRequestAnimationFrame()(()=>{X.global.getCancelAnimationFrame()(this.throttleTimer),this.throttleTimer=null;for(let r=0,s=o.length;r<s;r++){const{type:l,ev:a}=o[r];this.emitEvent(l,a)}this.emitThrottles.length=0}))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach(i=>{this.triggerEvent(`${i}end`,t),i==="press"&&this.triggerEvent(`${i}up`,t),delete e[i]})}emitEvent(t,e){const i=this.element._events[A0];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let o=0,r=i.length;o<r&&!e.propagationImmediatelyStopped;o++)i[o].fn.call(i[o].context,e,t);this.emit(t,e)}}var tM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},eM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};const Ft=[0,0,0],iM=(n,t,e,i,o,r,s,l)=>{if(l)for(;e>t;)e-=Gt;else for(;e<t;)e+=Gt;const a=oe/3*(e>t?1:-1);let h=t,d=h;for(;d!==e;){d=a>0?Math.min(d+a,e):Math.max(d+a,e);const u=Math.abs(d-h),c=4*Math.tan(u/4)/3,g=d<h?-1:1,f=Math.cos(h),p=Math.sin(h),v=Math.cos(d),m=Math.sin(d),b=f*r+i,w=p*s+o,C=v*r+i,_=m*s+o,y=r*c*g,x=s*c*g;n.push([b-y*p,w+x*f,C+y*m,_-x*v,C,_]),h=d}};let wr=class{set fillStyle(n){this.nativeContext.fillStyle=n}get fillStyle(){return this.nativeContext.fillStyle}set font(n){this.nativeContext.font=n}get font(){return this.nativeContext.font}set globalAlpha(n){this.nativeContext.globalAlpha=n*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(n){this.nativeContext.lineCap=n}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(n){this.nativeContext.lineDashOffset=n}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(n){this.nativeContext.lineJoin=n}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(n){this.nativeContext.lineWidth=n}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(n){this.nativeContext.miterLimit=n}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(n){this.nativeContext.shadowBlur=n}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(n){this.nativeContext.shadowColor=n}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(n){this.nativeContext.shadowOffsetX=n}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(n){this.nativeContext.shadowOffsetY=n}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(n){this.nativeContext.strokeStyle=n}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(n){this.nativeContext.textAlign=n}get textAlign(){return this.nativeContext.textAlign}set textBaseline(n){this.nativeContext.textBaseline=n}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(n){n!==!!this._inuse&&(this._inuse=n,n?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(n,t){this.fillAttributes=Object.assign(Object.assign({},c0),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},g0),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},ki),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const e=n.nativeCanvas.getContext("2d");if(!e)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=e,this.canvas=n,this.matrix=new He(1,0,0,1,0,0),this.stack=[],this.dpr=t,this.applyedMatrix=new He(1,0,0,1,0,0),this._clearMatrix=new He(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&ne.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new He(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(n=!1){!n&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(n){return wi.allocateByObj(n)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(wi.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(wi.free(this.matrix),this.matrix=this.stack.pop())}rotate(n,t=!0){this.matrix.rotate(n),t&&this.setTransformForCurrent()}save(){const n=this.cloneMatrix(this.matrix);this.stack.push(n),this.nativeContext.save()}highPerformanceSave(){const n=this.cloneMatrix(this.matrix);this.stack.push(n)}scale(n,t,e=!0){this.matrix.scale(n,t),e&&this.setTransformForCurrent()}setScale(n,t,e=!0){this.matrix.setScale(n,t),e&&this.setTransformForCurrent()}scalePoint(n,t,e,i,o=!0){this.translate(e,i,!1),this.scale(n,t,!1),this.translate(-e,-i,!1),o&&this.setTransformForCurrent()}setTransform(n,t,e,i,o,r,s=!0,l=this.dpr){this.matrix.setValue(l*n,l*t,l*e,l*i,l*o,l*r),s&&this.setTransformForCurrent()}setTransformFromMatrix(n,t=!0,e=this.dpr){this.matrix.setValue(n.a*e,n.b*e,n.c*e,n.d*e,n.e*e,n.f*e),t&&this.setTransformForCurrent()}resetTransform(n=!0,t=this.dpr){this.setTransform(t,0,0,t,0,0),n&&this.setTransformForCurrent()}transform(n,t,e,i,o,r,s=!0){this.matrix.multiply(n,t,e,i,o,r),s&&this.setTransformForCurrent()}transformFromMatrix(n,t){this.matrix.multiply(n.a,n.b,n.c,n.d,n.e,n.f),t&&this.setTransformForCurrent()}translate(n,t,e=!0){this.matrix.translate(n,t),e&&this.setTransformForCurrent()}rotateDegrees(n,t=!0){const e=n*Math.PI/180;this.rotate(e,t)}rotateAbout(n,t,e,i=!0){this.translate(t,e,!1),this.rotate(n,!1),this.translate(-t,-e,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(n,t,e,i=!0){this.translate(t,e,!1),this.rotateDegrees(n,!1),this.translate(-t,-e,!1),i&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(n,t){n?typeof n=="string"?this.nativeContext.clip(n):this.nativeContext.clip(n,t):this.nativeContext.clip()}arc(n,t,e,i,o,r,s){if(s=s||0,this.camera){const l=[];iM(l,i,o,n,t,e,e,r);for(let a=0;a<l.length;++a){const h=l[a];this.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5],s)}}else this.nativeContext.arc(n,t,Math.max(0,e),i,o,r)}arcTo(n,t,e,i,o){this.nativeContext.arcTo(n,t,e,i,o)}bezierCurveTo(n,t,e,i,o,r,s){if(s=s||0,this.camera){let l=s,a=s;this.modelMatrix&&(en(Ft,[n,t,s],this.modelMatrix),n=Ft[0],t=Ft[1],l=Ft[2],en(Ft,[e,i,s],this.modelMatrix),e=Ft[0],i=Ft[1],a=Ft[2],en(Ft,[o,r,s],this.modelMatrix),o=Ft[0],r=Ft[1],s=Ft[2]);let h=this.camera.vp(o,r,s);o=h.x,r=h.y,h=this.camera.vp(n,t,l),n=h.x,t=h.y,h=this.camera.vp(e,i,a),e=h.x,i=h.y}this.nativeContext.bezierCurveTo(n,t,e,i,o,r)}closePath(){this.nativeContext.closePath()}ellipse(n,t,e,i,o,r,s,l){l==null?this.nativeContext.ellipse(n,t,e,i,o,r,s):this.nativeContext.ellipse(n,t,e,i,o,r,s,l)}lineTo(n,t,e){if(e=e||0,this.camera){this.modelMatrix&&(en(Ft,[n,t,e],this.modelMatrix),n=Ft[0],t=Ft[1],e=Ft[2]);const i=this.camera.vp(n,t,e);n=i.x,t=i.y}this.nativeContext.lineTo(n,t)}moveTo(n,t,e){if(e=e||0,this.camera){this.modelMatrix&&(en(Ft,[n,t,e],this.modelMatrix),n=Ft[0],t=Ft[1],e=Ft[2]);const i=this.camera.vp(n,t,e);n=i.x,t=i.y}this.nativeContext.moveTo(n,t)}quadraticCurveTo(n,t,e,i,o){if(o=o||0,this.camera){let r=o;this.modelMatrix&&(en(Ft,[n,t,o],this.modelMatrix),n=Ft[0],t=Ft[1],r=Ft[2],en(Ft,[e,i,o],this.modelMatrix),e=Ft[0],i=Ft[1],o=Ft[2]);let s=this.camera.vp(e,i,o);e=s.x,i=s.y,s=this.camera.vp(n,t,r),n=s.x,t=s.y}this.nativeContext.quadraticCurveTo(n,t,e,i)}rect(n,t,e,i,o){o=o||0,this.camera?(this.moveTo(n,t,o),this.lineTo(n+e,t,o),this.lineTo(n+e,t+i,o),this.lineTo(n,t+i,o),this.closePath()):this.nativeContext.rect(n,t,e,i)}createImageData(){const n=arguments;return n.length===2?this.nativeContext.createImageData(n[0],n[1]):n.length===1?this.nativeContext.createImageData(n[0]):null}createLinearGradient(n,t,e,i){return isFinite(n+t+e+i)||(n=0,t=0,e=0,i=0),this.nativeContext.createLinearGradient(n,t,e,i)}createPattern(n,t){return n.width===0||n.height===0?null:this.nativeContext.createPattern(n,t)}createRadialGradient(n,t,e,i,o,r){return this.nativeContext.createRadialGradient(n,t,e,i,o,r)}createConicGradient(n,t,e,i){let o,r=!1;const s=this;return{stops:[],addColorStop(l,a){this.stops.push([l,a]),r=!0},GetPattern(l,a,h){return r&&(h||(h=i-e),o=ex(s,this.stops,n,t,h,e,i,l,a),r=!1),o}}}fill(n,t){this.disableFill||(n?this.nativeContext.fill(n):this.nativeContext.fill())}fillRect(n,t,e,i){this.nativeContext.fillRect(n,t,e,i)}clearRect(n,t,e,i){this.nativeContext.clearRect(n,t,e,i)}project(n,t,e){if(e=e||0,this.camera){this.modelMatrix&&(en(Ft,[n,t,e],this.modelMatrix),n=Ft[0],t=Ft[1],e=Ft[2]);const i=this.camera.vp(n,t,e);n=i.x,t=i.y}return{x:n,y:t}}view(n,t,e){return e=e||0,this.camera?(this.modelMatrix&&(en(Ft,[n,t,e],this.modelMatrix),n=Ft[0],t=Ft[1],e=Ft[2]),this.camera.view(n,t,e)):[n,t,e]}fillText(n,t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(en(Ft,[t,e,i],this.modelMatrix),t=Ft[0],e=Ft[1],i=Ft[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}this.nativeContext.fillText(n,t,e)}getImageData(n,t,e,i){return this.nativeContext.getImageData(n,t,e,i)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(n,t){return this.nativeContext.isPointInPath(n,t)}isPointInStroke(n,t){return this.nativeContext.isPointInStroke(n,t)}measureText(n,t=X.global.measureTextMethod){var e,i;if(!t||t==="native")return this.nativeContext.measureText(n);this.mathTextMeasure||(this.mathTextMeasure=X.graphicUtil.createTextMeasureInstance({},{},()=>this.canvas.nativeCanvas));const o=(e=this.fontFamily)!==null&&e!==void 0?e:ki.fontFamily,r=(i=this.fontSize)!==null&&i!==void 0?i:ki.fontSize;return this.mathTextMeasure.textSpec.fontFamily===o&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=o,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(n,t)}putImageData(n,t,e){this.nativeContext.putImageData(n,t,e)}setLineDash(n){const t=arguments,e=this.nativeContext;this.nativeContext.setLineDash?t[0]&&e.setLineDash(t[0]):"mozDash"in e?e.mozDash=t[0]:"webkitLineDash"in e&&(e.webkitLineDash=t[0])}stroke(n){this.disableStroke||(n?this.nativeContext.stroke(n):this.nativeContext.stroke())}strokeRect(n,t,e,i){this.nativeContext.strokeRect(n,t,e,i)}strokeText(n,t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(en(Ft,[t,e,i],this.modelMatrix),t=Ft[0],e=Ft[1],i=Ft[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}this.nativeContext.strokeText(n,t,e)}drawImage(){const n=this.nativeContext,t=arguments;t.length===3?n.drawImage(t[0],t[1],t[2]):t.length===5?n.drawImage(t[0],t[1],t[2],t[3],t[4]):t.length===9&&n.drawImage(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}setCommonStyle(n,t,e,i,o){if(Array.isArray(o)){if(o.length<=1)return this._setCommonStyle(n,t,e,i,o[0]);const r=Object.create(o[0]);return o.forEach((s,l)=>{l!==0&&Object.assign(r,s)}),this._setCommonStyle(n,t,e,i,r)}return this._setCommonStyle(n,t,e,i,o)}_setCommonStyle(n,t,e,i,o){const r=this.nativeContext;o||(o=this.fillAttributes);const{fillOpacity:s=o.fillOpacity,opacity:l=o.opacity,fill:a=o.fill}=t;r.globalAlpha=s*l*this.baseGlobalAlpha,s>1e-12&&l>1e-12&&(r.fillStyle=ju(this,a,n,e,i))}setShadowBlendStyle(n,t,e){if(Array.isArray(e)){if(e.length<=1)return this._setShadowBlendStyle(n,e[0]);const i=Object.create(e[0]);return e.forEach((o,r)=>{r!==0&&Object.assign(i,o)}),this._setShadowBlendStyle(n,t,i)}return this._setShadowBlendStyle(n,t,e)}_setShadowBlendStyle(n,t,e){const i=this.nativeContext;e||(e=this.fillAttributes);const{opacity:o=e.opacity,shadowBlur:r=e.shadowBlur,shadowColor:s=e.shadowColor,shadowOffsetX:l=e.shadowOffsetX,shadowOffsetY:a=e.shadowOffsetY,blur:h=e.blur,globalCompositeOperation:d=e.globalCompositeOperation}=t;o<=1e-12||(r||l||a?(i.shadowBlur=r*this.dpr,i.shadowColor=s,i.shadowOffsetX=l*this.dpr,i.shadowOffsetY=a*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),h?(i.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1),d?(i.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(i.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(n,t,e,i,o){if(Array.isArray(o)){if(o.length<=1)return this._setStrokeStyle(n,t,e,i,o[0]);const r=Object.create(o[0]);return o.forEach((s,l)=>{l!==0&&Object.assign(r,s)}),this._setStrokeStyle(n,t,e,i,r)}return this._setStrokeStyle(n,t,e,i,o)}_setStrokeStyle(n,t,e,i,o){const r=this.nativeContext;o||(o=this.strokeAttributes);const{strokeOpacity:s=o.strokeOpacity,opacity:l=o.opacity}=t;if(r.globalAlpha=s*l*this.baseGlobalAlpha,s>1e-12&&l>1e-12){const{lineWidth:a=o.lineWidth,stroke:h=o.stroke,lineJoin:d=o.lineJoin,lineDash:u=o.lineDash,lineCap:c=o.lineCap,miterLimit:g=o.miterLimit}=t;r.lineWidth=Fn(this,a,this.dpr),r.strokeStyle=ju(this,h,n,e,i),r.lineJoin=d,u&&r.setLineDash(u),r.lineCap=c,r.miterLimit=g}}setTextStyleWithoutAlignBaseline(n,t,e){const i=this.nativeContext;t||(t=this.textAttributes);const{scaleIn3d:o=t.scaleIn3d}=n;n.font?i.font=n.font:i.font=Fl(n,t,o&&this.camera&&this.camera.getProjectionScale(e));const{fontFamily:r=t.fontFamily,fontSize:s=t.fontSize}=n;this.fontFamily=r,this.fontSize=s,i.textAlign="left",i.textBaseline="alphabetic"}setTextStyle(n,t,e){var i,o;const r=this.nativeContext;t||(t=this.textAttributes),n.font?r.font=n.font:r.font=Fl(n,t,this.camera&&this.camera.getProjectionScale(e));const{fontFamily:s=t.fontFamily,fontSize:l=t.fontSize}=n;this.fontFamily=s,this.fontSize=l,r.textAlign=(i=n.textAlign)!==null&&i!==void 0?i:t.textAlign,r.textBaseline=(o=n.textBaseline)!==null&&o!==void 0?o:t.textBaseline}draw(){}clearMatrix(n=!0,t=this.dpr){this.setTransformFromMatrix(this._clearMatrix,n,t)}setClearMatrix(n,t,e,i,o,r){this._clearMatrix.setValue(n,t,e,i,o,r)}onlyTranslate(n=this.dpr){return this.matrix.a===n&&this.matrix.b===0&&this.matrix.c===0&&this.matrix.d===n}release(...n){this.stack.forEach(t=>wi.free(t)),this.stack.length=0}};wr.env="browser",wr=tM([st(),eM("design:paramtypes",[Object,Number])],wr);var nM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},oM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let Sr=class extends mc{constructor(n){super(n)}init(n){const{container:t}=n;if(typeof t=="string"){const e=X.global.getElementById(t);e&&(this._container=e)}else this._container=t;this._context=new wr(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:n}=this;n.width=this._pixelWidth,n.height=this._pixelHeight,!n.style||this.setCanvasStyle(n,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(n),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const n=this._nativeCanvas;n.style.position="absolute",n.style.top=`${this._y}px`,n.style.left=`${this._x}px`}resetStyle(n){if(!this.controled)return;const{width:t=this._displayWidth,height:e=this._displayHeight,dpr:i=this._dpr,x:o=this._x,y:r=this._y}=n,{nativeCanvas:s}=this;s.width=t*i,s.height=e*i,!s.style||this.setCanvasStyle(s,o,r,t,e),n.id&&(s.id=n.id),this.visiable||this.hide()}setCanvasStyle(n,t,e,i,o){this.controled&&(n.style.width=`${i}px`,n.style.height=`${o}px`)}toDataURL(n,t){return n==="image/jpeg"?this._nativeCanvas.toDataURL(n,t):n==="image/png"?this._nativeCanvas.toDataURL(n):this._nativeCanvas.toDataURL(n,t)}resize(n,t){this.controled&&(this._pixelWidth=n*this._dpr,this._pixelHeight=t*this._dpr,this._displayWidth=n,this._displayHeight=t,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${n}px`,this._nativeCanvas.style.height=`${t}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};Sr.env="browser",Sr=nM([st(),oM("design:paramtypes",[Object])],Sr);function om(n,t){return new Bt(e=>{e(C0).toDynamicValue(()=>i=>new n(i)).whenTargetNamed(n.env),e(hS).toDynamicValue(()=>(i,o)=>new t(i,o)).whenTargetNamed(t.env)})}const rM=om(Sr,wr);var sM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},lM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},ks=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let xr=class extends bc{constructor(n,t,e){super(e),this.contributions=n,this.drawContribution=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("canvas-picker-service",(i,o,r)=>{this.configure(r,o)}),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach(n=>{this.pickerMap.set(n.numberType,n)}),super._init()}configure(n,t){this.pickCanvas=hr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(n,t,e,i){if(n.attribute.pickable===!1)return null;if(this.InterceptorContributions.length)for(let a=0;a<this.InterceptorContributions.length;a++){const h=this.InterceptorContributions[a];if(h.beforePickItem){const d=h.beforePickItem(n,this,t,i,{parentMatrix:e});if(d)return d}}const o=this.pickerMap.get(n.numberType);if(!o)return null;const r=o.contains(n,t,i),s=r?n:null,l={graphic:s,params:r};if(s)return l;if(this.InterceptorContributions.length)for(let a=0;a<this.InterceptorContributions.length;a++){const h=this.InterceptorContributions[a];if(h.afterPickItem){const d=h.afterPickItem(n,this,t,i,{parentMatrix:e});if(d)return d}}return l}};xr=sM([st(),ks(0,Ot(Me)),ks(0,Ie(xi)),ks(1,Ot(tc)),ks(2,Ot(Me)),ks(2,Ie(_r)),lM("design:paramtypes",[Object,Object,Object])],xr);var aM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let _c=class{constructor(){this.type="group",this.numberType=Mu}contains(n,t,e){return!1}};_c=aM([st()],_c);const Na=new Bt((n,t,e,i)=>{Na.__vloaded||(Na.__vloaded=!0,n(im).to(_c).inSingletonScope(),n(xi).toService(im),ei(n,xi))});Na.__vloaded=!1;const hM=Na,dM=new Bt((n,t,e,i)=>{e(xr)||n(xr).toSelf().inSingletonScope(),e(br)?i(br).toService(xr):n(br).toService(xr)});function uM(n){n.load(hM),n.load(dM)}var Is,cM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},gM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let no=Is=class extends Da{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Is.idprefix}_${Is.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=X.global,this.viewBox=new he,this.modelMatrix=new He(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(n){n.canvas?this.createWindowByCanvas(n):this.createWindowByConfig(n),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch{console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(n){const t=n.getBoundingClientRect(),e=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(t.right<0||t.bottom<0||t.left>e||t.top>i)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const n=new IntersectionObserver((t,e)=>{t.forEach(i=>{this._canvasIsIntersecting!==i.isIntersecting?(this._canvasIsIntersecting=i.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(i.isIntersecting)):this._canvasIsIntersecting=i.isIntersecting})});n&&n.observe(this.canvas.nativeCanvas)}createWindowByConfig(n){const t=this.global.createCanvas({width:n.width,height:n.height});let e;if(e=typeof n.container=="string"?this.global.getElementById(n.container):n.container?n.container:this.global.getRootElement(),!e)throw new Error("发生错误,containerId可能传入有误");n.offscreen?e=null:e.appendChild(t);const i={width:n.width,height:n.height,dpr:n.dpr,nativeCanvas:t,container:e,id:Is.GenerateCanvasId(),canvasControled:!0};this.canvas=new Sr(i)}createWindowByCanvas(n){var t;let e;if(typeof n.canvas=="string"){if(e=this.global.getElementById(n.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=n.canvas;if(!e)throw new Error("发生错误,传入的canvas不正确");let i=n.width,o=n.height;if(i==null||o==null||!n.canvasControled){const s=e.getBoundingClientRect();i=s.width,o=s.height}let r=n.dpr;r==null&&(r=(t=e.getContext("2d").pixelRatio)!==null&&t!==void 0?t:e.width/i),this.canvas=new Sr({width:i,height:o,dpr:r,nativeCanvas:e,canvasControled:n.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(n,t){this.canvas.resize(n,t)}setDpr(n){this.canvas.dpr=n}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(n,t,e){return this.canvas.nativeCanvas.addEventListener(n,t,e)}removeEventListener(n,t,e){return this.canvas.nativeCanvas.removeEventListener(n,t,e)}dispatchEvent(n){return this.canvas.nativeCanvas.dispatchEvent(n)}getStyle(){var n;return(n=this.canvas.nativeCanvas.style)!==null&&n!==void 0?n:{}}setStyle(n){this.canvas.nativeCanvas.style=n}getBoundingClientRect(){const n=this.canvas.nativeCanvas,t=this.getWH();return n.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(n){const t=this.viewBox,e=this.getContext(),i=this.getDpr();e.nativeContext.save(),e.nativeContext.setTransform(i,0,0,i,0,0),e.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),n&&(e.fillStyle=n,e.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),e.nativeContext.restore()}isVisible(n){return this._canvasIsIntersecting}onVisibleChange(n){this._onVisibleChangeCb=n}getTopLeft(n){return this.global.getElementTopLeft(this.canvas.nativeCanvas,n)}};no.env="browser",no.idprefix="visactor_window",no.prefix_count=0,no=Is=cM([st(),gM("design:paramtypes",[])],no);const fM=new Bt(n=>{n(no).toSelf(),n(bu).toDynamicValue(t=>t.container.get(no)).whenTargetNamed(no.env)});var pM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},vM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};class mM{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function rm(n,t=!1){const e=document.createElement("img");if(e.crossOrigin="anonymous",t){const i=new Blob([n],{type:"image/svg+xml"});n=window.URL.createObjectURL(i)}return e.src=n,e.complete?Promise.resolve(e):new Promise((i,o)=>{e.onload=()=>{i(e)},e.onerror=()=>{o(new Error("加载失败"))}})}let Va=class extends za{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch{this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(n,t){var e,i;let o=0,r=0,s=0,l=0;if(n.changedTouches){const a=(e=n.changedTouches[0])!==null&&e!==void 0?e:{};o=a.clientX||0,r=a.clientY||0,s=o,l=r}else o=n.clientX||0,r=n.clientY||0,s=n.offsetX||0,l=n.offsetY||0;if(t){const a=o,h=r,d=t.getBoundingClientRect(),u=(i=t.getNativeHandler)===null||i===void 0?void 0:i.call(t).nativeCanvas;let c,g;return u&&(c=d.width/u.offsetWidth,g=d.height/u.offsetHeight),{x:(a-d.left)/(ie(c)?c:1),y:(h-d.top)/(ie(g)?g:1)}}return{x:s,y:l}}getNativeAABBBounds(n){let t=n;if(typeof n=="string"&&(t=new DOMParser().parseFromString(n,"text/html").firstChild,t.lastChild&&(t=t.lastChild.firstChild)),t.getBoundingClientRect){const e=t.getBoundingClientRect();return new mM(e)}return new he}removeDom(n){return n.parentElement.removeChild(n),!0}updateDom(n,t){const{width:e,height:i,style:o}=t;return o&&(Qt(o)?n.setAttribute("style",o):Object.keys(o).forEach(r=>{n.style[r]=o[r]})),e!=null&&(n.style.width=`${e}px`),i!=null&&(n.style.height=`${i}px`),!0}createDom(n){const{tagName:t="div",parent:e}=n,i=document.createElement(t);if(this.updateDom(i,n),e){const o=Qt(e)?this.getElementById(e):e;o&&o.appendChild&&o.appendChild(i)}return i}loadImage(n){return rm(n,!1).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadSvg(n){return rm(n,!0).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}createCanvas(n){var t,e;const i=document.createElement("canvas");n.id&&(i.id=(t=n.id)!==null&&t!==void 0?t:Te.GenAutoIncrementId().toString());const o=(e=n.dpr)!==null&&e!==void 0?e:window.devicePixelRatio;return n.width&&n.height&&(i.style.width=`${n.width}px`,i.style.height=`${n.height}px`,i.width=n.width*o,i.height=n.height*o),i}createOffscreenCanvas(n){var t;const e=(t=n.dpr)!==null&&t!==void 0?t:window.devicePixelRatio;return new OffscreenCanvas(n.width*e,n.height*e)}releaseCanvas(n){let t;t=typeof n=="string"?document.getElementById(n):n,t&&t.parentElement&&t.parentElement.removeChild(t)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(n,t,e){return document.addEventListener(n,t,e)}removeEventListener(n,t,e){return document.removeEventListener(n,t,e)}dispatchEvent(n){return document.dispatchEvent(n)}getElementById(n){return document.getElementById(n)}getRootElement(){return document.body}getDocument(){return document}release(...n){}getElementTop(n,t){let e=n.offsetTop,i=n.offsetParent;for(;i!==null;)e+=i.offsetTop,i=i.offsetParent;return e}getElementLeft(n,t){let e=n.offsetLeft,i=n.offsetParent;for(;i!==null;)e+=i.offsetLeft,i=i.offsetParent;return e}getElementTopLeft(n,t){let e=n.offsetTop,i=n.offsetLeft,o=n.offsetParent;for(;o!==null;)e+=o.offsetTop,i+=o.offsetLeft,o=o.offsetParent;return{top:e,left:i}}};Va=pM([st(),vM("design:paramtypes",[])],Va);const ja=new Bt(n=>{ja.isBrowserBound||(ja.isBrowserBound=!0,n(Va).toSelf().inSingletonScope(),n(Bl).toService(Va))});ja.isBrowserBound=!1;function Ga(n,t=!0){Ga.__loaded||(Ga.__loaded=!0,n.load(ja),n.load(rM),n.load(fM),t&&uM(n))}Ga.__loaded=!1;class In{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if(t.attribute.pickMode==="imprecise")return!0;const{pickContext:o}=i??{};if(!o)return!1;const r=t.getGraphicTheme();o.highPerformanceSave();let{x:s=r.x,y:l=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const h=t.getOffsetXY(r);s+=h.x,l+=h.y,o.setTransformForCurrent()}else s=0,l=0,o.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,o,s,l,{},null,(h,d,u)=>!!a||(a=h.isPointInPath(e.x,e.y),a),(h,d,u)=>{if(a)return!0;const c=d.lineWidth||u.lineWidth,g=d.pickStrokeBuffer||u.pickStrokeBuffer;return o.lineWidth=Fn(o,c+g,o.dpr),a=h.isPointInStroke(e.x,e.y),a}),o.highPerformanceRestore(),a}}var bM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},CM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},_M=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let yc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="arc",this.numberType=Jl}};yc=bM([st(),_M(0,Ot(Ca)),CM("design:paramtypes",[Object])],yc);let sm=!1;const yM=new Bt((n,t,e,i)=>{sm||(sm=!0,n(Dv).to(yc).inSingletonScope(),n(io).toService(Dv))});var wM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},SM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},xM=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let wc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="circle",this.numberType=Ql}};wc=wM([st(),xM(0,Ot(_a)),SM("design:paramtypes",[Object])],wc);let lm=!1;const AM=new Bt((n,t,e,i)=>{lm||(lm=!0,n(Ov).to(wc).inSingletonScope(),n(io).toService(Ov))});var RM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Ar=class{constructor(){this.type="image",this.numberType=ta}contains(n,t,e){const{pickContext:i}=e??{};return!!i&&!!n.AABBBounds.containsPoint(t)}};Ar=RM([st()],Ar);let am=!1;const TM=new Bt((n,t,e,i)=>{am||(am=!0,n(Oa).to(Ar).inSingletonScope(),n(Ar).toService(Oa))});var MM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},BM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},PM=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Sc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="line",this.numberType=vs}};Sc=MM([st(),PM(0,Ot(ya)),BM("design:paramtypes",[Object])],Sc);let hm=!1;const HM=new Bt((n,t,e,i)=>{hm||(hm=!0,n(Wv).to(Sc).inSingletonScope(),n(io).toService(Wv))});var EM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},LM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},FM=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let xc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="polygon",this.numberType=ia}};xc=EM([st(),FM(0,Ot(Sa)),LM("design:paramtypes",[Object])],xc);let dm=!1;const kM=new Bt((n,t,e,i)=>{dm||(dm=!0,n(Uv).to(xc).inSingletonScope(),n(io).toService(Uv))});var IM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},zM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},DM=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Ac=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="path",this.numberType=ea}};Ac=IM([st(),DM(0,Ot(wa)),zM("design:paramtypes",[Object])],Ac);let um=!1;const OM=new Bt((n,t,e,i)=>{um||(um=!0,n(Nv).to(Ac).inSingletonScope(),n(io).toService(Nv))}),Rc=new he;class cm{constructor(){this.type="rect",this.numberType=Bu}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if(t.attribute.pickMode==="imprecise")return!0;const{pickContext:o}=i??{};if(!o)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:l=r.x,y:a=r.y}=t.attribute;o.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const u=t.getOffsetXY(r);l+=u.x,a+=u.y,o.setTransformForCurrent()}else l=0,a=0,h=!1,o.transformFromMatrix(t.transMatrix,!0);let d=!0;if(!h||t.shadowRoot||nt(s,!0)&&s!==0||it(s)&&s.some(u=>u!==0))d=!1,this.canvasRenderer.drawShape(t,o,l,a,{},null,(u,c,g)=>!!d||(d=u.isPointInPath(e.x,e.y),d),(u,c,g)=>{if(d)return!0;const f=c.lineWidth||g.lineWidth,p=c.pickStrokeBuffer||g.pickStrokeBuffer;return o.lineWidth=Fn(o,f+p,o.dpr),d=u.isPointInStroke(e.x,e.y),d});else{const{fill:u=r.fill,stroke:c=r.stroke,lineWidth:g=r.lineWidth}=t.attribute;if(u)d=!0;else if(c){const f=t.AABBBounds;Rc.setValue(f.x1,f.y1,f.x2,f.y2),Rc.expand(-g/2),d=!Rc.containsPoint(e)}}return o.highPerformanceRestore(),d}}var WM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},NM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},VM=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Tc=class extends cm{constructor(n){super(),this.canvasRenderer=n}};Tc=WM([st(),VM(0,Ot(xa)),NM("design:paramtypes",[Object])],Tc);let gm=!1;const jM=new Bt((n,t,e,i)=>{gm||(gm=!0,n(Vv).to(Tc).inSingletonScope(),n(io).toService(Vv))});let fm=!1;const GM=new Bt((n,t,e,i)=>{fm||(fm=!0,n(Oa).to(Ar).inSingletonScope(),n(Ar).toService(Oa))});var UM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},KM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},$M=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Mc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="symbol",this.numberType=na}};Mc=UM([st(),$M(0,Ot(Aa)),KM("design:paramtypes",[Object])],Mc);let pm=!1;const YM=new Bt((n,t,e,i)=>{pm||(pm=!0,n(jv).to(Mc).inSingletonScope(),n(io).toService(jv))});var XM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Bc=class{constructor(){this.type="text",this.numberType=oa}contains(n,t,e){return!!n.AABBBounds.containsPoint(t)}};Bc=XM([st()],Bc);let vm=!1;const qM=new Bt((n,t,e,i)=>{vm||(vm=!0,n(Gv).to(Bc).inSingletonScope(),n(io).toService(Gv))});var ZM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},JM=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let zs=class extends wr{constructor(n,t){super(n,t);const e=n.nativeCanvas.getContext("2d");if(!e)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=e,this.canvas=n,this.matrix=new He(1,0,0,1,0,0),this.stack=[],this.dpr=t??1}release(...n){}};zs.env="node",zs=ZM([st(),JM("design:paramtypes",[Object,Number])],zs);var QM=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},tB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)};let Rr=class extends mc{constructor(n){super(n)}init(){this._context=new zs(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...n){this._nativeCanvas.release&&jt(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Rr.env="node",Rr=QM([st(),tB("design:paramtypes",[Object])],Rr);const eB=om(Rr,zs);var iB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},nB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},oB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Tr=class extends Da{get container(){return null}constructor(n){super(),this.global=n,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(n){n.canvas?this.createWindowByCanvas(n):this.createWindowByConfig(n)}createWindowByConfig(n){const t=this.global.createCanvas({width:n.width,height:n.height}),e={width:n.width,height:n.height,dpr:n.dpr,nativeCanvas:t,id:Te.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Rr(e)}createWindowByCanvas(n){const t=n.canvas;let e=n.width,i=n.height;e!=null&&i!=null&&n.canvasControled||(e=t.width,i=t.height),this.canvas=new Rr({width:e,height:i,dpr:1,nativeCanvas:t,canvasControled:n.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(n,t){this.canvas.resize(n,t)}setDpr(n){this.canvas.dpr=n}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(n="image/png"){return this.canvas.nativeCanvas.toBuffer(n)}addEventListener(n,t,e){}dispatchEvent(n){return!0}removeEventListener(n,t,e){}getStyle(){}setStyle(n){}getBoundingClientRect(){return null}clearViewBox(n){}};Tr.env="node",Tr=iB([st(),oB(0,Ot(Nd)),nB("design:paramtypes",[Object])],Tr);const rB=new Bt(n=>{n(Tr).toSelf(),n(bu).toDynamicValue(t=>t.container.get(Tr)).whenTargetNamed(Tr.env)});var sB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Ua=class extends za{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(n,t){n.env===this.type&&(n.setActiveEnvContribution(this),this.pkg=t)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(n){const t=fetch(n).then(e=>e.json());return t.then(e=>({data:e,state:"success"})).catch(()=>({data:null,state:"fail"})),t}loadArrayBuffer(n){return fetch(n).then(t=>t.arrayBuffer()).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadImage(n){const{loadImage:t}=this.pkg;return t?t(n).then(e=>({loadState:e?"success":"fail",data:e})).catch(()=>({loadState:"fail",data:null})):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(n){const t=this.pkg.Resvg;if(!t)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const e=new t(n).render().asPng();return this.loadImage(e)}createCanvas(n){return this.pkg.createCanvas(n.width,n.height)}releaseCanvas(n){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(n){return k0.call(n)}}getCancelAnimationFrame(){return n=>{k0.clear(n)}}addEventListener(n,t,e){}removeEventListener(n,t,e){}getElementById(n){return null}getRootElement(){return null}dispatchEvent(n){}release(...n){}createOffscreenCanvas(n){}};Ua=sB([st()],Ua);const Ka=new Bt(n=>{Ka.isNodeBound||(Ka.isNodeBound=!0,n(Ua).toSelf().inSingletonScope(),n(Bl).toService(Ua))});Ka.isNodeBound=!1;function $a(n,t=!0){$a.__loaded||($a.__loaded=!0,n.load(Ka),n.load(eB),n.load(rB))}$a.__loaded=!1;var lB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},aB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},hB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Pc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="arc",this.numberType=Jl}};Pc=lB([st(),hB(0,Ot(Ca)),aB("design:paramtypes",[Object])],Pc);let mm=!1;const dB=new Bt((n,t,e,i)=>{mm||(mm=!0,n(Kv).to(Pc).inSingletonScope(),n(xi).toService(Kv))});var uB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},cB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},gB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Hc=class extends cm{constructor(n){super(),this.canvasRenderer=n}};Hc=uB([st(),gB(0,Ot(xa)),cB("design:paramtypes",[Object])],Hc);let bm=!1;const fB=new Bt((n,t,e,i)=>{bm||(bm=!0,n(Zv).to(Hc).inSingletonScope(),n(xi).toService(Zv))});class Cm extends vi{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if(t.attribute.pickMode==="imprecise")return!0;const{pickContext:o}=i??{};if(!o)return!1;o.highPerformanceSave();const r=t.getGraphicTheme(),s=this.transform(t,r,o),{x:l,y:a,z:h,lastModelMatrix:d}=s;let u=e;if(o.camera){u=e.clone();const g=t.parent.globalTransMatrix;u.x=g.a*e.x+g.c*e.y+g.e,u.y=g.b*e.x+g.d*e.y+g.f}this.canvasRenderer.z=h;let c=!1;return this.canvasRenderer.drawShape(t,o,l,a,{},null,g=>!!c||(c=g.isPointInPath(u.x,u.y),c),(g,f,p)=>{if(c)return!0;const v=f.lineWidth||p.lineWidth,m=f.pickStrokeBuffer||p.pickStrokeBuffer;return o.lineWidth=Fn(o,v+m,o.dpr),c=g.isPointInStroke(u.x,u.y),c}),this.canvasRenderer.z=0,o.modelMatrix!==d&&Le.free(o.modelMatrix),o.modelMatrix=d,o.highPerformanceRestore(),c}}var pB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},vB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},mB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Ec=class extends Cm{constructor(n){super(),this.canvasRenderer=n,this.type="line",this.numberType=vs}};Ec=pB([st(),mB(0,Ot(ya)),vB("design:paramtypes",[Object])],Ec);let _m=!1;const bB=new Bt((n,t,e,i)=>{_m||(_m=!0,n(Xv).to(Ec).inSingletonScope(),n(xi).toService(Xv))});class ym extends vi{contains(t,e,i){const{pickContext:o}=i??{};if(!o)return!1;const r=t.getGraphicTheme();o.highPerformanceSave();const s=this.transform(t,r,o),{x:l,y:a,z:h,lastModelMatrix:d}=s;let u=e;if(o.camera){u=e.clone();const g=t.parent.globalTransMatrix;u.x=g.a*e.x+g.c*e.y+g.e,u.y=g.b*e.x+g.d*e.y+g.f}this.canvasRenderer.z=h;let c=!1;return this.canvasRenderer.drawShape(t,o,l,a,i,null,(g,f,p)=>!!c||(c=g.isPointInPath(u.x,u.y),c)),this.canvasRenderer.z=0,o.modelMatrix!==d&&Le.free(o.modelMatrix),o.modelMatrix=d,o.highPerformanceRestore(),c}}var CB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},_B=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},yB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Lc=class extends ym{constructor(n){super(),this.canvasRenderer=n,this.type="symbol",this.numberType=na}contains(n,t,e){const{pickContext:i}=e??{};if(!i)return!1;const o=n.getParsedPath();if(!i.camera){if(!n.AABBBounds.containsPoint(t))return!1;if(o.isSvg||n.attribute.pickMode==="imprecise")return!0}i.highPerformanceSave();const r=n.getGraphicTheme(),s=this.transform(n,r,i),{x:l,y:a,z:h,lastModelMatrix:d}=s;let u=t;if(i.camera){u=t.clone();const g=n.parent.globalTransMatrix;u.x=g.a*t.x+g.c*t.y+g.e,u.y=g.b*t.x+g.d*t.y+g.f}this.canvasRenderer.z=h;let c=!1;return this.canvasRenderer.drawShape(n,i,l,a,{},null,(g,f,p)=>!!c||(c=g.isPointInPath(u.x,u.y),c),(g,f,p)=>{if(c)return!0;const v=f.lineWidth||p.lineWidth,m=f.pickStrokeBuffer||p.pickStrokeBuffer;return i.lineWidth=Fn(i,v+m,i.dpr),c=g.isPointInStroke(u.x,u.y),c}),this.canvasRenderer.z=0,i.modelMatrix!==d&&Le.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),c}};Lc=CB([st(),yB(0,Ot(Aa)),_B("design:paramtypes",[Object])],Lc);let wm=!1;const wB=new Bt((n,t,e,i)=>{wm||(wm=!0,n(Jv).to(Lc).inSingletonScope(),n(xi).toService(Jv))});var SB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},xB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},AB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Fc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="circle",this.numberType=Ql}};Fc=SB([st(),AB(0,Ot(_a)),xB("design:paramtypes",[Object])],Fc);let Sm=!1;const RB=new Bt((n,t,e,i)=>{Sm||(Sm=!0,n($v).to(Fc).inSingletonScope(),n(xi).toService($v))});var TB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},MB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},BB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let kc=class extends ym{constructor(n){super(),this.canvasRenderer=n,this.type="text",this.numberType=oa}contains(n,t,e){const{pickContext:i}=e??{};if(!i)return!1;const o=n.AABBBounds;if(!i.camera)return!!o.containsPoint(t);i.highPerformanceSave();const r=n.getGraphicTheme(),{keepDirIn3d:s=r.keepDirIn3d}=n.attribute,l=!s,a=this.transform(n,r,i,l),{x:h,y:d,z:u,lastModelMatrix:c}=a;this.canvasRenderer.z=u;let g=t;if(i.camera){g=t.clone();const p=n.parent.globalTransMatrix;g.x=p.a*t.x+p.c*t.y+p.e,g.y=p.b*t.x+p.d*t.y+p.f}let f=!1;return this.canvasRenderer.drawShape(n,i,h,d,{},null,(p,v,m)=>{if(f)return!0;const{fontSize:b=r.fontSize,textBaseline:w=r.textBaseline,textAlign:C=r.textAlign}=n.attribute,_=n.AABBBounds,y=_.height(),x=_.width(),S=pn(w,y,b),A=fn(C,x);return p.rect(A+h,S+d,x,y,u),f=p.isPointInPath(g.x,g.y),f},(p,v,m)=>f),this.canvasRenderer.z=0,i.modelMatrix!==c&&Le.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),f}};kc=TB([st(),BB(0,Ot(Ju)),MB("design:paramtypes",[Object])],kc);let xm=!1;const PB=new Bt((n,t,e,i)=>{xm||(xm=!0,n(Qv).to(kc).inSingletonScope(),n(xi).toService(Qv))});var HB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},EB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},LB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Ic=class extends Cm{constructor(n){super(),this.canvasRenderer=n,this.type="path",this.numberType=ea}};Ic=HB([st(),LB(0,Ot(wa)),EB("design:paramtypes",[Object])],Ic);let Am=!1;const FB=new Bt((n,t,e,i)=>{Am||(Am=!0,n(qv).to(Ic).inSingletonScope(),n(xi).toService(qv))});var kB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},IB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},zB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let zc=class extends In{constructor(n){super(),this.canvasRenderer=n,this.type="polygon",this.numberType=ia}};zc=kB([st(),zB(0,Ot(Sa)),IB("design:paramtypes",[Object])],zc);let Rm=!1;const DB=new Bt((n,t,e,i)=>{Rm||(Rm=!0,n(tm).to(zc).inSingletonScope(),n(xi).toService(tm))});var OB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s},WB=globalThis&&globalThis.__metadata||function(n,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,t)},NB=globalThis&&globalThis.__param||function(n,t){return function(e,i){t(e,i,n)}};let Dc=class{constructor(n){this.canvasRenderer=n,this.type="richtext",this.numberType=Pu}contains(n,t,e){return!!n.AABBBounds.containsPoint(t)}};Dc=OB([st(),NB(0,Ot(Qu)),WB("design:paramtypes",[Object])],Dc);let Tm=!1;const VB=new Bt((n,t,e,i)=>{Tm||(Tm=!0,n(em).to(Dc).inSingletonScope(),n(xi).toService(em))});var jB=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let Oc=class{constructor(){this.type="image",this.numberType=ta}contains(n,t,e){const{pickContext:i}=e??{};return!!i&&!!n.AABBBounds.containsPoint(t)}};Oc=jB([st()],Oc);let Mm=!1;const GB=new Bt((n,t,e,i)=>{Mm||(Mm=!0,n(Yv).to(Oc).inSingletonScope(),n(xi).toService(Yv))}),bn=pc();function Ya(){Ya.__loaded||(Ya.__loaded=!0,zT(),Tt.load(AT),Tt.load(bn?dB:yM))}Ya.__loaded=!1;const UB=Ya;function Xa(){Xa.__loaded||(Xa.__loaded=!0,DT(),Tt.load(BT),Tt.load(bn?RB:AM))}Xa.__loaded=!1;const KB=Xa;function qa(){qa.__loaded||(qa.__loaded=!0,OT())}qa.__loaded=!1;const Ai=qa;function Za(){Za.__loaded||(Za.__loaded=!0,WT(),Tt.load(IT),Tt.load(bn?GB:TM))}Za.__loaded=!1;const Ja=Za;function Qa(){Qa.__loaded||(Qa.__loaded=!0,NT(),Tt.load(TT),Tt.load(bn?bB:HM))}Qa.__loaded=!1;const Wc=Qa;function th(){th.__loaded||(th.__loaded=!0,VT(),Tt.load(HT),Tt.load(bn?FB:OM))}th.__loaded=!1;const $B=th;function eh(){eh.__loaded||(eh.__loaded=!0,jT(),Tt.load(ET),Tt.load(bn?DB:kM))}eh.__loaded=!1;const YB=eh;function ih(){ih.__loaded||(ih.__loaded=!0,GT(),Tt.load(RT),Tt.load(bn?fB:jM))}ih.__loaded=!1;const oo=ih;function nh(){nh.__loaded||(nh.__loaded=!0,UT(),Tt.load(kT),Tt.load(bn?VB:GM))}nh.__loaded=!1;const oh=nh;function rh(){rh.__loaded||(rh.__loaded=!0,YT())}rh.__loaded=!1;const XB=rh;function sh(){sh.__loaded||(sh.__loaded=!0,KT(),Tt.load(MT),Tt.load(bn?wB:YM))}sh.__loaded=!1;const Mr=sh;function lh(){lh.__loaded||(lh.__loaded=!0,$T(),Tt.load(PT),Tt.load(bn?PB:qM))}lh.__loaded=!1;const zn=lh;function ah(){ah.__loaded||(ah.__loaded=!0,XT())}ah.__loaded=!1;const qB=ah;function Bm(){Ai(),oo()}const Pm="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",ZB=14;var di;(function(n){n.selected="selected",n.selectedReverse="selected_reverse",n.hover="hover",n.hoverReverse="hover_reverse"})(di||(di={}));const Br={[di.selectedReverse]:{},[di.selected]:{},[di.hover]:{},[di.hoverReverse]:{}},Hm={container:"",width:30,height:30,style:{}},JB="scrollDrag",Em={debounce:Of,throttle:Wf};Bm();class Fo extends Ni{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Fo.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=i=>{const{viewX:o,viewY:r}=i,{direction:s,width:l,height:a,range:h}=this.attribute,d=this._sliderSize,[u,c]=this._getScrollRange();let g;if(s==="vertical"){const f=r-this._viewPosition.y,p=bi(f-d/2,u,c);g=f/a,this._slider.setAttribute("y",p,!0)}else{const f=o-this._viewPosition.x,p=bi(f-d/2,u,c);g=f/l,this._slider.setAttribute("x",p,!0)}this.setScrollRange([g-(h[1]-h[0])/2,g+(h[1]-h[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=i=>{const{stopSliderDownPropagation:o=!0}=this.attribute;o&&i.stopPropagation();const{direction:r}=this.attribute,{x:s,y:l}=this.stage.eventPointTransform(i);this._prePos=r==="horizontal"?s:l,this._dispatchEvent("scrollDown",{pos:this._prePos,event:i}),Ce.env==="browser"?(Ce.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),Ce.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=i=>{const{direction:o}=this.attribute,{x:r,y:s}=this.stage.eventPointTransform(i);let l,a,h=0;const{width:d,height:u}=this.getSliderRenderBounds();return o==="vertical"?(a=s,h=a-this._prePos,l=h/u):(a=r,h=a-this._prePos,l=h/d),[a,l]},this._onSliderPointerMove=i=>{const{stopSliderMovePropagation:o=!0}=this.attribute;o&&i.stopPropagation();const r=this.getScrollRange(),[s,l]=this._computeScrollValue(i);this.setScrollRange([r[0]+l,r[1]+l],!0),this._prePos=s},this._onSliderPointerMoveWithDelay=this.attribute.delayTime===0?this._onSliderPointerMove:Em[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=i=>{i.preventDefault();const{realTime:o=!0,range:r,limitRange:s=[0,1]}=this.attribute,l=this.getScrollRange(),[a,h]=this._computeScrollValue(i),d=[l[0]+h,l[1]+h];this._dispatchEvent("scrollUp",{pre:r,value:wo(d,s[0],s[1])}),Ce.env==="browser"?(Ce.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),Ce.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){const{direction:i="horizontal",limitRange:o=[0,1],range:r,realTime:s=!0}=this.attribute,l=wo(t,o[0],o[1]);if(e){const a=this._getSliderPos(l);if(this._slider){const h=a[1]-a[0];this._sliderSize=h,i==="horizontal"?this._slider.setAttributes({x:a[0],width:h},!0):this._slider.setAttributes({y:a[0],height:h},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=l,s&&this._dispatchEvent(JB,{pre:r,value:l})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",Em[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:o,limitRange:r=[0,1],railStyle:s,sliderStyle:l,padding:a=2}=this.attribute,h=this.createOrUpdateChild("scrollbar-container",{},"group"),d=h.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},s),"rect");this._rail=d;const u=this.getSliderRenderBounds(),c=this._getSliderPos(wo(o,r[0],r[1])),g=c[1]-c[0];let f;this._sliderSize=g,f=t==="horizontal"?{x:c[0],y:u.y1,width:g,height:u.height}:{x:u.x1,y:c[0],width:u.width,height:g};const p=h.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},f),{cornerRadius:this._getDefaultSliderCornerRadius()}),l),{boundsPadding:gn(a),pickMode:"imprecise"}),"rect");this._slider=p,this._container=h;const v=this._container.AABBBounds;this._viewPosition={x:v.x1,y:v.y1}}getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[o,r,s,l]=gn(i),a={x1:l,y1:o,x2:t-r,y2:e-s,width:Math.max(0,t-(l+r)),height:Math.max(0,e-(o+s))};return this._sliderRenderBounds=a,a}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:i,height:o}=this.getSliderRenderBounds();return t==="horizontal"?o:i}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:o,x1:r,y1:s}=this.getSliderRenderBounds();return e==="horizontal"?[i*t[0]+r,i*t[1]+r]:[o*t[0]+s,o*t[1]+s]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,o]=wo(t,0,1),{width:r,height:s,x1:l,y1:a}=this.getSliderRenderBounds(),h=this._sliderSize;return e==="horizontal"?wo([l+i*r,l+o*r],l,r-h):wo([a+i*s,a+o*s],a,s-h)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}Fo.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};function Pr(n,t){n.forEachChildren(e=>{const i=t(e);e.isContainer&&!i&&Pr(e,t)})}function Lm(n,t){return[n[0]*t,n[1]*t]}function Fm(n){const[t,e]=n;return Math.sqrt(t*t+e*e)}function QB(n){let t=Fm(n);return t>0&&(t=1/t),[n[0]*t,n[1]*t]}function tP(n,t){const[e,i]=n,[o,r]=t,s=Math.sqrt((e*e+i*i)*(o*o+r*r)),l=s&&(e*o+i*r)/s;return Math.acos(Math.min(Math.max(l,-1),1))}function eP(n,t,e){const i=tP(n,t),o=q1(n,t)>=0;return e?o?2*Math.PI-i:i:o?i:2*Math.PI-i}const km=(n,t,e,i)=>new Oe(Object.assign({defaultFontParams:Object.assign({fontFamily:Pm,fontSize:ZB},i),getTextBounds:e?void 0:ma,specialCharSet:`-/: .,@%'"~`+Oe.ALPHABET_CHAR_SET+Oe.ALPHABET_CHAR_SET.toUpperCase()},t??{}),n);function Nc(n,t,e={}){if(!n)return{width:0,height:0};const i=ma({text:n,fontFamily:t.fontFamily||e.fontFamily||Pm,fontSize:t.fontSize||e.fontSize||12,fontWeight:t.fontWeight||e.fontWeight,textAlign:t.textAlign||"center",textBaseline:t.textBaseline,ellipsis:!!t.ellipsis,maxLineWidth:t.maxLineWidth||1/0,lineHeight:t.fontSize||e.fontSize||12});return{width:i.width(),height:i.height()}}function iP(n,t="type"){return Im(n,t)==="rich"}function Im(n,t="type"){var e,i;return $t(n.text)&&"type"in n.text?(e=n.text.type)!==null&&e!==void 0?e:"text":t in n&&(i=n[t])!==null&&i!==void 0?i:"text"}function zm(n){var t,e;return I(n.maxLineWidth)&&(n.maxWidth=n.maxLineWidth,delete n.maxLineWidth),n.width=(t=n.width)!==null&&t!==void 0?t:0,n.height=(e=n.height)!==null&&e!==void 0?e:0,n.textConfig=n.text.text||n.text,n}function nP(n){const{text:t,_originText:e}=n,{text:i}=t;return n.html=i,n.text=e,n.renderable=!1,n}function oP(n){const{text:t,_originText:e}=n,{text:i}=t;return n.react=i,n.text=e,n.renderable=!1,n}function Vc(n,t="type"){const e=Im(n,t);return e==="rich"?bt.richtext(zm(n)):(e==="html"?n=nP(n):e==="react"&&(n=oP(n)),bt.text(n))}function Dm(){Ai(),oo(),Mr(),oh(),zn()}var Om=globalThis&&globalThis.__rest||function(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(i=Object.getOwnPropertySymbols(n);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(n,i[o])&&(e[i[o]]=n[i[o]])}return e};Dm();class Hr extends Ni{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Hr.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:o="",textStyle:r={},shape:s={},panel:l={},space:a=4,minWidth:h,maxWidth:d,padding:u=4,visible:c,state:g,type:f,textAlwaysCenter:p,containerTextAlign:v}=this.attribute,m=gn(u),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let w,C=-m[3],_=-m[0],y=m[1]+m[3],x=m[0]+m[2],S=0,A=0;const{visible:R}=s,T=Om(s,["visible"]);if(ze(R)){const B=(T==null?void 0:T.size)||10,H=nt(B)?B:Math.max(B[0],B[1]);w=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:B,strokeBoundsBuffer:0},T),{visible:R,x:H/2,y:H/2}),"symbol"),Et(g==null?void 0:g.shape)||(w.states=g.shape),R&&(A=H+a)}let M;if(y+=A,S+=A,iP({text:o})||f==="rich"){const B=Object.assign(Object.assign(Object.assign({},zm(Object.assign({type:f,text:o},r))),r),{visible:I(o)&&c!==!1,x:S,y:0});M=b.createOrUpdateChild("tag-text",B,"richtext"),y+=M.AABBBounds.width(),x+=M.AABBBounds.height(),C+=M.AABBBounds.x1,_+=M.AABBBounds.y1}else{const B=Object.assign(Object.assign({text:$t(o)&&"type"in o&&o.type==="text"?o.text:o,visible:I(o)&&c!==!1,lineHeight:r==null?void 0:r.fontSize},r),{x:S,y:0});ct(B.lineHeight)&&(B.lineHeight=r.fontSize),M=b.createOrUpdateChild("tag-text",B,"text"),Et(g==null?void 0:g.text)||(M.states=g.text);const H=Nc(B.text,r,(e=(t=this.stage)===null||t===void 0?void 0:t.getTheme())===null||e===void 0?void 0:e.text),E=H.width,F=H.height;y+=E;const L=(i=s.size)!==null&&i!==void 0?i:10,z=nt(L)?L:Math.max(L[0],L[1]);x+=Math.max(F,s.visible?z:0);const{textAlign:D,textBaseline:N}=r;(I(h)||I(d))&&(I(h)&&y<h&&(y=h),I(d)&&y>d&&(y=d,M.setAttribute("maxLineWidth",d-m[1]-m[2]))),C=0,_=0;let V=0;D==="left"||D==="start"?V=1:D==="right"||D==="end"?V=-1:D==="center"&&(V=0),V?V<0?(C-=y,w&&w.setAttribute("x",(w.attribute.x||0)-E),b.setAttribute("x",-m[1]-A)):V>0&&b.setAttribute("x",m[3]):(C-=y/2,w&&w.setAttribute("x",(w.attribute.x||0)-E/2),b.setAttribute("x",-A/2));const G=v==="right"||v==="end",U=v==="left"||v==="start";if((v?v==="center":p)&&V){const Z=y-m[1]-m[3],q=E+A,j=V===1?(Z-q)/2+A+E/2:m[0]+A-(y/2+q/2-A)+E/2;if(M.setAttributes({x:j,textAlign:"center"}),w){const rt=j-E/2-A+z/2;w.setAttributes({x:rt})}}if(U&&V!==1){const Z=y-m[1]-m[3],q=V===0?-Z/2+A/2:-y+m[3]+m[1]+A,j=q+A;if(M.setAttributes({x:j,textAlign:"left"}),w){const rt=q+z/2;w.setAttributes({x:rt})}}if(G&&V!==-1){const Z=y-m[1]-m[3],q=V===0?Z/2+A/2:Z;if(M.setAttributes({x:q,textAlign:"right"}),w){const j=q-E-A+z/2;w.setAttributes({x:j})}}N==="middle"?(_-=x/2,w&&w.setAttribute("y",0)):N==="bottom"?(_-=x,w&&w.setAttribute("y",-F/2),b.setAttribute("y",-m[2])):N==="top"&&(b.setAttribute("y",m[0]),w&&w.setAttribute("y",F/2))}const{visible:P}=l,k=Om(l,["visible"]);if(c&&ze(P)){const B=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},k),{visible:P&&!!o,width:y,height:x,x:C,y:_}),"rect");if(Et(g==null?void 0:g.panel)||(B.states=g.panel),k.customShape){const H=k.customShape;B.pathProxy=E=>H(this,E,new Ue)}this._bgRect=B}this._textShape=M,this._symbol=w,this.resetStates()}initAttributes(t,e){t=e!=null&&e.skipDefault?t:dt({},Hr.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,o,r,s,l,a,h,d,u,c,g,f;this._tagStates=(e=(t=this.currentStates)===null||t===void 0?void 0:t.slice())!==null&&e!==void 0?e:[],this._rectStates=(r=(o=(i=this._bgRect)===null||i===void 0?void 0:i.currentStates)===null||o===void 0?void 0:o.slice())!==null&&r!==void 0?r:[],this._symbolStates=(a=(l=(s=this._symbol)===null||s===void 0?void 0:s.currentStates)===null||l===void 0?void 0:l.slice())!==null&&a!==void 0?a:[],this._textStates=(u=(d=(h=this._textShape)===null||h===void 0?void 0:h.currentStates)===null||d===void 0?void 0:d.slice())!==null&&u!==void 0?u:[],this.clearStates(),(c=this._bgRect)===null||c===void 0||c.clearStates(),(g=this._symbol)===null||g===void 0||g.clearStates(),(f=this._textShape)===null||f===void 0||f.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&((t=this._bgRect)===null||t===void 0||t.useStates(this._rectStates)),this._symbolStates.length&&((e=this._symbol)===null||e===void 0||e.useStates(this._symbolStates)),this._textStates.length&&((i=this._textShape)===null||i===void 0||i.useStates(this._textStates))}}Hr.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const Wm={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},Nm={poptip:dt({},Wm)};function rP(){Ai(),zn(),Mr(),oo()}function sP(n){dt(Nm.poptip,Wm,n)}var lP=globalThis&&globalThis.__rest||function(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(i=Object.getOwnPropertySymbols(n);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(n,i[o])&&(e[i[o]]=n[i[o]])}return e};const Vm=new he;rP();class Ds extends Ni{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Ds.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,o,r,s,l,a;const{titleStyle:h={},position:d,contentStyle:u={},panel:c={},space:g=4,minWidth:f=0,maxWidth:p=1/0,padding:v=4,maxWidthPercent:m,visible:b,state:w,dx:C=0,dy:_=0}=this.attribute;let{title:y="",content:x=""}=this.attribute;y=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(y):y,x=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(x):x;const S=gn(v),A=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),R=p-S[1]-S[3],T=I(y)&&b!==!1,M=Object.assign(Object.assign({text:it(y)?y:[y],visible:T,wrap:!0},h),{x:S[3],y:S[0],maxLineWidth:R,textAlign:"left",textBaseline:"top"}),P=A.createOrUpdateChild("poptip-title",M,"text");Et(w==null?void 0:w.title)||(P.states=w.title);const k=P.AABBBounds,B=k.height(),H=k.width();let E=B+g;T||(E=0);const F=I(x)&&b!==!1,L=Object.assign(Object.assign({text:it(x)?x:[x],visible:F,wrap:!0},u),{x:S[3],y:S[0]+E,maxLineWidth:R,textAlign:"left",textBaseline:"top"}),z=A.createOrUpdateChild("poptip-content",L,"text");Et(w==null?void 0:w.content)||(z.states=w.content);const D=z.AABBBounds,N=D.height(),V=D.width();F&&(E+=N);let G=Xn(H+S[1]+S[3],V+S[1]+S[3]);G>p?G=p:G<f&&(G=f);let U=S[0]+S[2]+E;const{visible:Z}=c,q=lP(c,["visible"]),j=(t=q.size)!==null&&t!==void 0?t:12,rt=it(j)?[j[0]+((e=q.space)!==null&&e!==void 0?e:0),j[1]+((i=q.space)!==null&&i!==void 0?i:0)]:j+((o=q.space)!==null&&o!==void 0?o:0),ht=(r=q.lineWidth)!==null&&r!==void 0?r:1,gt=this.stage?[(s=this.stage.viewWidth)!==null&&s!==void 0?s:this.stage.width,(l=this.stage.viewHeight)!==null&&l!==void 0?l:this.stage.height]:void 0;if(gt){const Y=this.AABBBounds,$=(a=this.attribute.x)!==null&&a!==void 0?a:Y.x1,Q=gt[0]-Y.x1;let et=Math.max($,Q);const ot=(it(j)?j[0]:12)+3;if(et=Math.min(et-ot,et*m),et<G){G=et;const K=S[1]+S[3];P.setAttribute("maxLineWidth",et-K),z.setAttribute("maxLineWidth",et-K),U=S[0]+S[2],T&&(U+=P.AABBBounds.height()+g),U+=z.AABBBounds.height()}}const vt=d==="auto";let W,O=-1/0;for(let Y=0;Y<this.positionList.length+1;Y++){const $=vt?this.positionList[Y===this.positionList.length?W:Y]:d,{angle:Q,offset:et,rectOffset:ot}=this.getAngleAndOffset($,G,U,it(rt)?rt:[rt,rt-ht]);if(ze(Z)){const K=(it(j)?j[0]:j)/4,at=A.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},q),{visible:Z&&(F||T),x:K,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:Q,dx:et[0],dy:et[1],size:j,zIndex:-9}),"symbol");Et(w==null?void 0:w.panel)||(at.states=w.panel);const tt=A.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},q),{visible:Z&&(F||T),x:0,y:0,width:G,height:U,zIndex:-8}),"rect");Et(w==null?void 0:w.panel)||(tt.states=w.panel)}if(A.setAttributes({x:-et[0]+C,y:-et[1]+_}),!vt||!gt)break;{Vm.setValue(0,0,G,U).transformWithMatrix(A.globalTransMatrix);const K=Vm,at=new Ci().setValue(0,0,gt[0],gt[1]);if(tw(K,at,!1))break;{const tt=Gf(K,at,!1),_t=(tt.x2-tt.x1)*(tt.y2-tt.y1);_t>O&&(O=_t,W=Y)}}}}getAngleAndOffset(t,e,i,o){const r=o[1]/2;switch(t){case"tl":return{angle:oe/2*3,offset:[e/4,i+r],rectOffset:[-e/4,-i-o[1]]};case"top":return{angle:oe/2*3,offset:[e/2,i+r],rectOffset:[0,-i-o[1]]};case"tr":return{angle:oe/2*3,offset:[e/4*3,i+r],rectOffset:[e/4*3,-i-o[1]]};case"rt":return{angle:0,offset:[-r,i/5],rectOffset:[e/4*3,-i-o[1]]};case"right":return{angle:0,offset:[-r,i/2],rectOffset:[e/4*3,-i-o[1]]};case"rb":return{angle:0,offset:[-r,i/5*4],rectOffset:[e/4*3,-i-o[1]]};case"bl":return{angle:oe/2,offset:[e/4,-r],rectOffset:[-e/4,-i-o[1]]};case"bottom":return{angle:oe/2,offset:[e/2,-r],rectOffset:[0,-i-o[1]]};case"br":return{angle:oe/2,offset:[e/4*3,-r],rectOffset:[e/4*3,-i-o[1]]};case"lt":return{angle:oe,offset:[e+r,i/5],rectOffset:[-e/4,-i-o[1]]};case"left":return{angle:oe,offset:[e+r,i/2],rectOffset:[0,-i-o[1]]};case"lb":return{angle:oe,offset:[e+r,i/5*4],rectOffset:[e/4*3,-i-o[1]]}}}}Ds.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};var aP=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};function hP(n,t){return dt(n,Nm.poptip,t),n}let Os=class{render(n,t,e,i,o,r,s,l,a,h,d,u,c){var g,f;if(n._showPoptip===1){const{visible:p,visibleCb:v}=n.attribute.poptip||{};if(p===!1||v&&v(n)===!1)return;const m={};dt(m,Ds.defaultAttributes,n.attribute.poptip?n.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(m):this.poptipComponent=new Ds(m);let b=n.attribute.poptip||{};if(n.type==="text"&&b.title==null&&b.content==null){const _={};hP(_,b),b=_,b.content=(g=b.content)!==null&&g!==void 0?g:n.attribute.text}const w=n.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},b),{x:w.e,y:w.f})),h.stage.tryInitInteractiveLayer();const C=h.stage.getLayer("_builtin_interactive");C&&C.add(this.poptipComponent)}else n._showPoptip===2&&(n._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),(f=this.poptipComponent.parent)===null||f===void 0||f.removeChild(this.poptipComponent),this.poptipComponent=null))}};Os=aP([st()],Os);var jm=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};class Gm{constructor(){this.activeEvent="onRegister",this._uid=Te.GenAutoIncrementId(),this.poptip=t=>{const e=t.target;this.needHide(e)?this.unpoptip(t):e!==this.activeGraphic&&(this.needShow(e)&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0))},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}needHide(t){return t.isContainer||!t.attribute}needShow(t){return!!t.attribute.poptip}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let Ws=class extends Gm{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};Ws=jm([st()],Ws);let Ns=class extends Gm{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=n=>{const{stage:t}=this.pluginService;n.target===t&&this.unpoptip(n)}}activate(n){super.activate(n);const{stage:t}=this.pluginService;t.addEventListener("pointerleave",this.pointerlave)}needHide(n){return n.type!=="text"||!n.cliped||n.isContainer||!n.attribute||n.attribute.disableAutoClipedPoptip}needShow(n){return!0}deactivate(n){const{stage:t}=this.pluginService;super.deactivate(n),t.removeEventListener("pointerleave",this.pointerlave)}};Ns=jm([st()],Ns);const dP=new Bt((n,t,e,i)=>{e(Os)||(n(Os).toSelf().inSingletonScope(),n(Ou).toService(Os)),e(Ws)||(n(Ws).toSelf(),n(Es).toService(Ws)),e(Ns)||(n(Ns).toSelf(),n(Es).toService(Ns))});function uP(){Tt.load(dP)}function cP(){Ai(),Wc(),YB(),Mr()}cP();class hh extends Ni{getStartAngle(){return jf(this._startAngle)}getEndAngle(){return jf(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},hh.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:o,visible:r=!0,multiSegment:s,mainSegmentIndex:l}=this.attribute;if(!r)return;this._computeLineAngle();const a=this._getMainSegmentPoints(),h=this._renderSymbol(t,a,"start"),d=this._renderSymbol(e,a,"end");if(this.startSymbol=h,this.endSymbol=d,s){const u=[...this.attribute.points];if(ie(l))u[l]=this._clipPoints(u[l]);else{const c=this._clipPoints($d(u));u[0][0]=c[0],u[u.length-1][u[u.length-1].length-1]=c[c.length-1]}u.forEach((c,g)=>{var f,p;const v=bt.line(Object.assign(Object.assign({points:c},it(i)?(f=i[g])!==null&&f!==void 0?f:i[i.length-1]:i),{fill:!1}));v.name=`${this.name}-line`,v.id=this._getNodeId("line"+g),Et(o==null?void 0:o.line)||(v.states=it(o.line)?(p=o.line[g])!==null&&p!==void 0?p:o.line[o.line.length-1]:o.line),this.add(v),this.lines.push(v)})}else{let u=bt.line;Ud(i)[0].cornerRadius&&(u=bt.polygon);const c=u(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Ud(i)[0]),{fill:!1,closePath:!1}));c.name=`${this.name}-line`,c.id=this._getNodeId("line"),Et(o==null?void 0:o.line)||(c.states=[].concat(o.line)[0]),this.add(c),this.lines.push(c)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:o=!0}=t;let r;if(t&&t.visible){const s=this.getStartAngle(),l=this.getEndAngle(),{state:a}=this.attribute,h=e[0],d=e[e.length-1],{refX:u=0,refY:c=0,refAngle:g=0,style:f,symbolType:p,size:v=12}=t;let m,b;i==="start"?(m={x:h.x+(ie(s)?u*Math.cos(s)+c*Math.cos(s-Math.PI/2):0),y:h.y+(ie(s)?u*Math.sin(s)+c*Math.sin(s-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(m={x:d.x+(ie(l)?u*Math.cos(l)+c*Math.cos(l-Math.PI/2):0),y:d.y+(ie(l)?u*Math.sin(l)+c*Math.sin(l-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),r=bt.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:p,size:v,angle:o?b+g:0,strokeBoundsBuffer:0}),f)),r.name=`${this.name}-${i}-symbol`,r.id=this._getNodeId(`${i}-symbol`),Et(a==null?void 0:a.symbol)||(r.states=a.symbol),i==="start"?Et(a==null?void 0:a.startSymbol)||(r.states=a.startSymbol):Et(a==null?void 0:a.endSymbol)||(r.states=a.endSymbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let o;return o=e?ie(i)?t[i]:$d(t):t,this._mainSegmentPoints=o,o}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let o=t;if(e.visible){const r=e.clip?e.size||10:0;o=[{x:t[0].x-r/2*(Math.cos(this._startAngle)||0),y:t[0].y-r/2*(Math.sin(this._startAngle)||0)},...o.slice(1)]}if(i.visible){const r=i.clip?i.size||10:0,s={x:t[t.length-1].x-r/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-r/2*(Math.sin(this._endAngle)||0)};o=[...o.slice(0,o.length-1),s]}return o}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],o=t[t.length-2],r=t[t.length-1],s=[e.x-i.x,e.y-i.y],l=Math.atan2(s[1],s[0]),a=[r.x-o.x,r.y-o.y],h=Math.atan2(a[1],a[0]);this._startAngle=l,this._endAngle=h}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}hh.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}}};var qe;(function(n){n.innerView="inner-view",n.axisContainer="axis-container",n.labelContainer="axis-label-container",n.tickContainer="axis-tick-container",n.tick="axis-tick",n.subTick="axis-sub-tick",n.label="axis-label",n.title="axis-title",n.gridContainer="axis-grid-container",n.grid="axis-grid",n.gridRegion="axis-grid-region",n.line="axis-line",n.background="axis-background",n.axisLabelBackground="axis-label-background",n.axisBreak="axis-break",n.axisBreakSymbol="axis-break-symbol"})(qe||(qe={}));var Er;(function(n){n.selected="selected",n.selectedReverse="selected_reverse",n.hover="hover",n.hoverReverse="hover_reverse"})(Er||(Er={}));const Lr={[Er.selectedReverse]:{},[Er.selected]:{},[Er.hover]:{},[Er.hoverReverse]:{}},gP=999,jc={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},Um={size:8,stroke:"#000",lineWidth:1,zIndex:1};function fP(n,t){return{x:n.x+t[0],y:n.y+t[1]}}function pP(n={}){var t,e;const{style:i={},angle:o=.5*Math.PI}=n,r=dt({},Um,i),s=(t=r.size)!==null&&t!==void 0?t:Um.size;return Object.assign(Object.assign({},r),{symbolType:(e=r.symbolType)!==null&&e!==void 0?e:`M ${-s/2} ${s*Math.sin(o)} L ${s/2} ${-s*Math.sin(o)}`,symbolSize:s})}function vP(n){const t={};return Pr(n,e=>{e.type!=="group"&&e.id&&(t[e.id]=e)}),t}function Km(n,t){return{x:n.x+t[0],y:n.y+t[1]}}function $m(n,t,e,i=!1,o=!1){const r=[t.x-e.x,t.y-e.y];return Lm(r,(i?-1:1)*(o?-1:1)*n/Fm(r))}function mP(n,t,e,i,o){const r=Q1({x:0,y:0},e,n),s=Km(r,$m(i,r,t,o));return fP(s,$m(i||1,s,t,o))}function sn(n,t,e){let i=n.OBBBounds,o=t.OBBBounds;return i&&o&&!i.empty()&&!o.empty()?i.intersects(o):(i=n.AABBBounds,o=t.AABBBounds,e>Math.max(o.x1-i.x2,i.x1-o.x2,o.y1-i.y2,i.y1-o.y2))}function Gc(n,t){for(let e,i=1,o=n.length,r=n[0];i<o;r=e,++i)if(e=n[i],sn(r,e,t))return!0;return!1}const bP=(n,t,e)=>{const i=n.target;return i!==e&&i.name&&!Et(i.states)?(i.addState(di.hover,!0),Pr(t,o=>{o!==i&&o.name&&!Et(o.states)&&o.addState(di.hoverReverse,!0)}),i):e},CP=(n,t,e)=>e&&(Pr(t,i=>{i.name&&!Et(i.states)&&(i.removeState(di.hoverReverse),i.removeState(di.hover))}),null),_P=(n,t,e)=>{const i=n.target;return e===i&&i.hasState(di.selected)?(Pr(t,o=>{o.name&&!Et(o.states)&&(o.removeState(di.selectedReverse),o.removeState(di.selected))}),null):i.name&&!Et(i.states)?(i.addState(di.selected,!0),Pr(t,o=>{o!==i&&o.name&&!Et(o.states)&&o.addState(di.selectedReverse,!0)}),i):e};class yP extends Ni{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=bP(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=CP(t,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=_P(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=Be(this.attribute);dt(this.attribute,t);const i=bt.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&vP(this._innerView),this.removeAllChild(!0),this._innerView=bt.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:o,line:r,items:s}=this.attribute,l=bt.group({x:0,y:0,zIndex:1,pickable:!1});if(l.name=qe.axisContainer,l.id=this._getNodeId("container"),l.setMode(this.mode),this.axisContainer=l,t.add(l),r&&r.visible&&this.renderLine(l),s&&s.length&&(this.data=this._transformItems(s[0]),o&&o.visible&&this.renderTicks(l),i&&i.visible)){const a=bt.group({x:0,y:0,pickable:!1});a.name=qe.labelContainer,a.id=this._getNodeId("label-container"),this.axisLabelsContainer=a,l.add(a),s.forEach((h,d)=>{const u=this.renderLabels(a,h,d),c=u.getChildren();this.beforeLabelsOverlap(c,h,u,d,s.length),this.handleLabelsOverlap(c,h,u,d,s.length),this.afterLabelsOverlap(c,h,u,d,s.length);let g=0,f=0,p="center",v="middle",m=0;c.forEach((b,w)=>{var C;const _=b.attribute,y=(C=_.angle)!==null&&C!==void 0?C:0,x=b.AABBBounds;let S=x.width(),A=x.height();y&&(S=Math.abs(S*Math.cos(y)),A=Math.abs(A*Math.sin(y))),g=Math.max(g,S),f=Math.max(f,A),p=_.textAlign,v=_.textBaseline,w===0&&(m=_.x)}),this.axisLabelLayerSize[d]={width:g,height:f,labelPos:m,textAlign:p,textBaseline:v}})}e&&e.visible&&this.renderTitle(l)}renderTicks(t){const e=this.getTickLineItems(),i=bt.group({x:0,y:0,pickable:!1});i.name=qe.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach((r,s)=>{var l;const a=bt.line(Object.assign({},this._getTickLineAttribute("tick",r,s,e)));if(a.name=qe.tick,a.id=this._getNodeId(r.id),Et((l=this.attribute.tick)===null||l===void 0?void 0:l.state))a.states=Br;else{const h=this.data[s],d=dt({},Br,this.attribute.tick.state);Object.keys(d).forEach(u=>{jt(d[u])&&(d[u]=d[u](h.rawValue,s,h,this.data))}),a.states=d}i.add(a)}),this.tickLineItems=e;const{subTick:o}=this.attribute;if(o&&o.visible){const r=this.getSubTickLineItems();r.length&&r.forEach((s,l)=>{const a=bt.line(Object.assign({},this._getTickLineAttribute("subTick",s,l,e)));if(a.name=qe.subTick,a.id=this._getNodeId(`${l}`),Et(o.state))a.states=Br;else{const h=dt({},Br,o.state);Object.keys(h).forEach(d=>{jt(h[d])&&(h[d]=h[d](s.value,l,s,e))}),a.states=h}i.add(a)}),this.subTickLineItems=r}}renderLabels(t,e,i){const{dataFilter:o}=this.attribute.label;o&&jt(o)&&(e=o(e,i));const r=this._transformItems(e),s=bt.group({x:0,y:0,pickable:!1});return s.name=`${qe.labelContainer}-layer-${i}`,s.id=this._getNodeId(`label-container-layer-${i}`),t.add(s),r.forEach((l,a)=>{var h;const d=this._getLabelAttribute(l,a,r,i),u=Vc(d);if(u.name=qe.label,u.id=this._getNodeId(`layer${i}-label-${l.id}`),Et((h=this.attribute.label)===null||h===void 0?void 0:h.state))u.states=Br;else{const c=dt({},Br,this.attribute.label.state);Object.keys(c).forEach(g=>{jt(c[g])&&(c[g]=c[g](l,a,r,i))}),u.states=c}s.add(u)}),s}renderTitle(t){const e=this.getTitleAttribute(),i=new Hr(Object.assign({},e));i.name=qe.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return Km(t,this.getVerticalVector(e,i,t))}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:o,inside:r=!1,length:s,dataFilter:l}=t;let a=1;return e.length>=2&&(a=e[1].value-e[0].value),(l&&jt(l)?l(e):e).forEach(h=>{let d=h.point,u=h.value;if(!o){const g=h.value-a/2;if(this.isInValidValue(g))return;d=this.getTickCoord(g),u=g}const c=this.getVerticalCoord(d,s,r);if(this.mode==="3d"){const g=this.getVerticalVector(s,r,d);let f=0,p=0;Jt(g[0])>Jt(g[1])?f=oe/2*(c.x>d.x?1:-1):p=oe/2*(c.y>d.y?-1:1),i.push({start:d,end:c,value:u,id:`tick-${h.id}`,anchor:[d.x,d.y],alpha:f,beta:p})}else i.push({start:d,end:c,value:u,id:`tick-${h.id}`})}),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:o=!1,length:r=2}=t,s=this.tickLineItems,l=s.length;if(l>=2)for(let a=0;a<l-1;a++){const h=s[a],d=s[a+1];for(let u=0;u<i;u++){const c=(u+1)/(i+1),g=(1-c)*h.value+c*d.value,f=this.getTickCoord(g),p=this.getVerticalCoord(f,r,o);e.push({start:f,end:p,value:g,id:`sub-tick-${g}`})}}return e}_getTickLineAttribute(t,e,i,o){let r=De(this.attribute,`${t}.style`);const s=this.data[i];r=jt(r)?dt({},De(jc,`${t}.style`),t==="tick"?r(s.rawValue,i,s,this.data):r(e.value,i,e,o)):r;const{start:l,end:a,anchor:h,alpha:d,beta:u}=e;return Object.assign({points:[l,a],anchor:h,alpha:d,beta:u},r)}_getLabelAttribute(t,e,i,o){var r,s;const{space:l=4,inside:a=!1,formatMethod:h,type:d="text",text:u}=this.attribute.label;let c=l,g=0;!((r=this.attribute.tick)===null||r===void 0)&&r.visible&&this.attribute.tick.inside===a&&(g=this.attribute.tick.length||4),!((s=this.attribute.subTick)===null||s===void 0)&&s.visible&&this.attribute.subTick.inside===a&&(g=Math.max(g,this.attribute.subTick.length||2)),c+=g;const f=this.getRelativeVector(t.point);o>0&&(f[1]===0?c+=(this.axisLabelLayerSize[o-1].height+De(this.attribute,"label.space",4))*o:c+=(this.axisLabelLayerSize[o-1].width+De(this.attribute,"label.space",4))*o);const p=this.getVerticalCoord(t.point,c,a),v=this.getVerticalVector(c||1,a,p),m=h?h(`${t.label}`,t,e,i,o):t.label;let{style:b}=this.attribute.label;b=jt(b)?dt({},jc.label.style,b(t,e,i,o)):b;const w=this.getLabelAlign(v,a,b.angle);return b=dt(w,b),jt(b.text)&&(b.text=b.text({label:t.label,value:t.rawValue,index:t.index,layer:o})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(p,v,m,b)),{text:u??m,_originText:t.label,lineHeight:b==null?void 0:b.fontSize,type:d}),b)}getLabelPosition(t,e,i,o){return t}_transformItems(t){const e=[];return t.forEach(i=>{var o;e.push(Object.assign(Object.assign({},i),{point:this.getTickCoord(i.value),id:(o=i.id)!==null&&o!==void 0?o:i.label}))}),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}const Ym={parity:function(n){return n.filter((t,e)=>e%2?t.setAttribute("opacity",0):1)},greedy:function(n,t){let e;return n.filter((i,o)=>o&&sn(e,i,t)?i.setAttribute("opacity",0):(e=i,1))}};function wP(n){let t;return t=n.OBBBounds.empty()?n.AABBBounds:n.OBBBounds,t.width()>1&&t.height()>1}function SP(n){return n.forEach(t=>t.setAttribute("opacity",1)),n}function Xm(n,t,e,i,o=!1){if(e&&!n.attribute.opacity){const r=t.length;if(r>1){n.setAttribute("opacity",1);for(let s=0;s<r;s++){const l=o?t[r-1-s]:t[s];if(!i(l))break;l.setAttribute("opacity",0)}}}}function xP(n,t){if(Et(n))return;const e=n.filter(wP);if(Et(e))return;let i;i=SP(e);const{method:o="parity",separation:r=0}=t,s=jt(o)?o:Ym[o]||Ym.parity;if(i.length>=3&&Gc(i,r)){do i=s(i,r);while(i.length>=3&&Gc(i,r));const l=(c,g,f=!0)=>f&&c<3||g,a=l(i.length,t.firstVisible,!1);let h=l(i.length,t.lastVisible);const d=e[0],u=yo(e);sn(d,u,r)&&a&&h&&(u.setAttribute("opacity",0),h=!1),Xm(d,i,a,c=>sn(c,d,r)),Xm(u,i,h,c=>sn(c,u,r)||!(!a||c===d)&&sn(c,d,r),!0)}e.forEach(l=>{l.setAttribute("visible",!!l.attribute.opacity)})}function AP(n){const t=n.AABBBounds;return{x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2,centerX:n.attribute.x,centerY:n.attribute.y,angle:n.attribute.angle}}function RP(n){n.forEach(t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=AP(t),i=or({x:t.attribute.x,y:t.attribute.y},e.angle,{x:e.centerX,y:e.centerY}),o=i.x-e.centerX,r=i.y-e.centerY;e.x1+=o,e.x2+=o,e.y1+=r,e.y2+=r,e.centerX+=o,e.centerY+=r,t.rotatedBounds=e})}function TP(n,t){var e,i;return!((e=n.OBBBounds)===null||e===void 0)&&e.empty()||!((i=t.OBBBounds)===null||i===void 0)&&i.empty()?qd(n.AABBBounds,t.AABBBounds,!1)&&(!n.rotatedBounds||!t.rotatedBounds||Kf(n.rotatedBounds,t.rotatedBounds,!0)):n.OBBBounds.intersects(t.OBBBounds)}const qm=Math.sin(Math.PI/10);function Zm(n){const t=!ct(n)&&n!==0,e=t?Math.cos(n):1;return t&&Math.abs(e)<=qm}function Jm(n){const t=!ct(n)&&n!==0,e=t?Math.sin(n):0;return!t||Math.abs(e)<=qm}function MP(n,t){if(Et(n))return;const{orient:e,labelRotateAngle:i=[0,45,90]}=t;if(i.length===0||n.some(s=>!!s.attribute.angle))return;let o=0,r=0;for(i&&i.length>0&&(r=i.length);o<r;){const s=i[o++];if(n.forEach(l=>{l.attribute.angle=Li(s)}),PP(e,n),!BP(n))break}}function BP(n){for(let t=1;t<n.length;t++)if(TP(n[t-1],n[t]))return!0;return!1}function PP(n,t){n!=="bottom"&&n!=="top"||EP(n,t),n!=="left"&&n!=="right"||HP(n,t),RP(t)}function dh(n=0){if(n<0)for(;n<0;)n+=2*Math.PI;if(n>0)for(;n>=2*Math.PI;)n-=2*Math.PI;return n}function HP(n,t){t.forEach((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},tb(n,e.attribute.angle)),{angle:dh(e.attribute.angle)}))})}function EP(n,t){t.forEach(e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},Qm(n,e.attribute.angle)),{angle:dh(e.attribute.angle)}))})}function Qm(n,t=0){let e=["center","left","left","left","center","right","right","right","left"],i=["top","top","middle","bottom","bottom","bottom","middle","top","top"];n==="top"&&(e=["center","right","right","right","center","left","left","left","right"],i=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const o=(t=dh(t))/(.5*Math.PI);let r;return r=o===Math.floor(o)?2*Math.floor(o):2*Math.floor(o)+1,{textAlign:e[r],textBaseline:i[r]}}function tb(n,t=0){let e=["right","right","center","left","left","left","center","right","right"],i=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];n==="right"&&(e=["left","left","center","right","right","right","center","left","left"],i=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);const o=(t=dh(t))/(.5*Math.PI);let r;return r=o===Math.floor(o)?2*Math.floor(o):2*Math.floor(o)+1,{textAlign:e[r],textBaseline:i[r]}}function LP(n){return ie(n)?{left:n,right:n}:$t(n)?{left:n.left||0,right:n.right||0}:{left:0,right:0}}function FP(n,t){const{limitLength:e,verticalLimitLength:i,ellipsis:o="...",orient:r,axisLength:s}=t;if(Et(n)||!ie(e))return;const l=LP(t.overflowLimitLength),a=n[0],h=a.attribute.angle,d=!ct(h),u=d?Math.cos(h):1,c=d?Math.sin(h):0,g=Jm(h),f=Zm(h),p=r==="top"||r==="bottom",v=a.attribute.direction,m=!g&&!f&&p&&(n.length<2||n.some(b=>Math.abs(b.AABBBounds.width()-a.AABBBounds.width())>=2))&&a.AABBBounds.width()>Math.abs(e/c);n.forEach(b=>{var w;if(p&&(f&&Math.floor(b.AABBBounds.height())<=e||g&&Math.floor(b.AABBBounds.width())<=i)||!p&&(v==="vertical"&&Math.floor(b.AABBBounds.height())<=i||v!=="vertical"&&(g&&Math.floor(b.AABBBounds.width())<=e||f&&Math.floor(b.AABBBounds.height())<=i)))return;let C=null;if(g||f)C=p?g?i:e:v==="vertical"||f?i:e;else if(p){const{x1:_,x2:y}=b.AABBBounds,x=c/u,S=Math.abs(e/c);if(m&&x>0&&_<=s+l.right&&e/x+_>s+l.right){const A=(s-_+l.right)/Math.abs(u);C=Math.min(A,S)}else if(m&&x<0&&y>=-l.left&&e/x+y<-l.left){const A=(y+l.left)/Math.abs(u);C=Math.min(A,S)}else C=S}else C=Math.abs(e/u);ie(b.attribute.maxLineWidth)&&(C=ie(C)?Math.min(b.attribute.maxLineWidth,C):b.attribute.maxLineWidth),b.setAttributes({maxLineWidth:C,ellipsis:(w=b.attribute.ellipsis)!==null&&w!==void 0?w:o})})}function kP(n,t){const{limitLength:e,axisLength:i,ellipsis:o="...",orient:r}=t;if(Et(n)||!ie(e))return;const s=n[0].attribute.angle,l=Jm(s),a=Zm(s),h=r==="top"||r==="bottom";let d=i/n.length;n.forEach((u,c)=>{var g,f,p,v,m;if(h){if(a&&Math.floor(u.AABBBounds.height())<=e)return;if(l){const C=eb(u.attribute.x,(g=n[c+1])===null||g===void 0?void 0:g.attribute.x,(f=n[c-1])===null||f===void 0?void 0:f.attribute.x);ie(C)&&(d=ii(d,C))}}else{if(a){const C=eb(u.attribute.y,(p=n[c+1])===null||p===void 0?void 0:p.attribute.y,(v=n[c-1])===null||v===void 0?void 0:v.attribute.y);ie(C)&&(d=ii(d,C))}if(l&&Math.floor(u.AABBBounds.width())<=e)return}let b=null,w=null;h?a?(b=e,w=d):(b=d,w=e):a?(b=d,w=e):(b=e,w=d),u.setAttributes({maxLineWidth:b,ellipsis:(m=u.attribute.ellipsis)!==null&&m!==void 0?m:o,whiteSpace:"normal",heightLimit:w})})}function eb(n,t,e){let i;return ie(t)&&(i=Math.abs(t-n)),ie(e)&&(i=ie(i)?Math.min(Math.abs(n-e),i):Math.abs(n-e)),i}function IP(n,t,e,i,o){i==="left"||i==="right"?o==="left"?n.forEach(r=>{var s;r.setAttributes({dx:((s=r.attribute.dx)!==null&&s!==void 0?s:0)+t-r.AABBBounds.x1})}):o==="right"?n.forEach(r=>{var s;r.setAttributes({dx:((s=r.attribute.dx)!==null&&s!==void 0?s:0)+t+e-r.AABBBounds.x2})}):o==="center"&&n.forEach(r=>{var s;r.setAttributes({dx:((s=r.attribute.dx)!==null&&s!==void 0?s:0)+t+e/2-(r.AABBBounds.x1+r.AABBBounds.x2)/2})}):i!=="bottom"&&i!=="top"||(o==="top"?n.forEach(r=>{var s;r.setAttributes({dy:((s=r.attribute.dy)!==null&&s!==void 0?s:0)+t-r.AABBBounds.y1})}):o==="bottom"?n.forEach(r=>{var s;r.setAttributes({dy:((s=r.attribute.dy)!==null&&s!==void 0?s:0)+t+e-r.AABBBounds.y2})}):o==="middle"&&n.forEach(r=>{var s;r.setAttributes({dy:((s=r.attribute.dy)!==null&&s!==void 0?s:0)+t+e/2-(r.AABBBounds.y1+r.AABBBounds.y2)/2})}))}class zP{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:o=1}=this.attribute,r=this.getRelativeVector(),s=QB(r),l=[s[1],-1*s[0]];return Lm(l,t*(e?1:-1)*o)}}function DP(){Ai(),Wc(),oh(),zn()}function OP(){DP(),oo()}var ib=globalThis&&globalThis.__rest||function(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(i=Object.getOwnPropertySymbols(n);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(n,i[o])&&(e[i[o]]=n[i[o]])}return e};OP();class Vs extends yP{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Vs.defaultAttributes,t),e)}_renderInner(t){var e;if(this._breaks=null,this.attribute.breaks&&this.attribute.breaks.length){const o=[];for(let r=0;r<this.attribute.breaks.length;r++){const s=this.attribute.breaks[r],{range:l,breakSymbol:a,rawRange:h}=s;o.push({startPoint:this.getTickCoord(l[0]),endPoint:this.getTickCoord(l[1]),range:l,breakSymbol:a,rawRange:h})}this._breaks=o}super._renderInner(t),this._breaks&&this._breaks.length&&this._breaks.forEach((o,r)=>{const{startPoint:s,endPoint:l,breakSymbol:a,rawRange:h}=o;if((a==null?void 0:a.visible)!==!1){const d=bt.group({zIndex:gP});d.name=qe.axisBreak,d.id=this._getNodeId(`${qe.axisBreak}-${r}`),d.data=h;const u=pP(a),c=bt.symbol(Object.assign({x:s.x,y:s.y},u));c.name=qe.axisBreakSymbol;const g=bt.symbol(Object.assign({x:l.x,y:l.y},u));g.name=qe.axisBreakSymbol,d.add(c),d.add(g),t.add(d)}});const{panel:i}=this.attribute;if(i&&i.visible){const o=this.axisContainer,r=o.AABBBounds,s=bt.rect(Object.assign({x:r.x1,y:r.y1,width:r.width(),height:r.height()},i.style));s.name=qe.background,s.id=this._getNodeId("background"),s.states=dt({},Lr,(e=i.state)!==null&&e!==void 0?e:{}),o.insertBefore(s,o.firstChild)}}renderLine(t){const{start:e,end:i,line:o}=this.attribute,r=o,{startSymbol:s,endSymbol:l,style:a,state:h}=r,d=ib(r,["startSymbol","endSymbol","style","state"]),u=Object.assign({startSymbol:s,endSymbol:l,lineStyle:a},d);if(this._breaks&&this._breaks.length){const g=[];let f=e;this._breaks.forEach(p=>{const{startPoint:v,endPoint:m}=p;g.push([f,v]),f=m}),g.push([f,i]),u.points=g,u.multiSegment=!0}else u.points=[e,i];Et(h)||(u.state={line:dt({},Lr,h),symbol:dt({},Lr,h)});const c=new hh(u);c.name=qe.line,c.id=this._getNodeId("line"),t.add(c)}getTextAlign(t){let e="center";return qi(t[0],0)?qi(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTitleAttribute(){var t,e,i;const o=this.attribute.title,{position:r="middle",space:s=4,textStyle:l={},autoRotate:a=!0,shape:h,background:d,state:u={},maxWidth:c}=o,g=ib(o,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]);let f=.5;r==="start"?f=0:r==="end"&&(f=1);const{verticalFactor:p=1}=this.attribute,v=-1*p,m=this.getTickCoord(f),b=this.getRelativeVector();let w=0;if(!((t=this.attribute.label)===null||t===void 0)&&t.visible&&this.attribute.label.inside===!1){const P=+De(this.attribute,"label.space",4);w+=P;const k=Object.keys(this.axisLabelLayerSize).length;if(b[1]===0){const B=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(B)?w+=B+(k-1)*P:w=0}else if(b[0]===0)if(this.axisLabelsContainer&&this.axisLabelsContainer.AABBBounds&&!this.axisLabelsContainer.AABBBounds.empty()){const B=this.axisLabelLayerSize[0].labelPos,H=this.axisLabelsContainer.AABBBounds;w+=(v===1?H.x2>B?Math.min(H.x2-B,H.width()):0:H.x1<B?Math.min(B-H.x1,H.width()):0)+(k-1)*P}else w=0;else Object.keys(this.axisLabelLayerSize).forEach((B,H)=>{w+=this.axisLabelLayerSize[B].width+(H>0?P:0)})}let C=0;!((e=this.attribute.tick)===null||e===void 0)&&e.visible&&this.attribute.tick.inside===!1&&(C=this.attribute.tick.length||4),!((i=this.attribute.subTick)===null||i===void 0)&&i.visible&&this.attribute.subTick.inside===!1&&(C=Math.max(C,this.attribute.subTick.length||2));const _=C+w+s,y=this.getVerticalCoord(m,_,!1),x=this.getVerticalVector(_,!1,{x:0,y:0});let S,A,{angle:R}=g;if(S=r==="start"?"start":r==="end"?"end":"center",ct(R)&&a){R=eP(b,[1,0],!0);const{verticalFactor:P=1}=this.attribute;A=-1*P===1?"bottom":"top"}else S=this.getTextAlign(x),A=this.getTextBaseline(x,!1);let T=c;if(ct(T)){const{verticalLimitSize:P,verticalMinSize:k,orient:B}=this.attribute,H=Math.min(P||1/0,k||1/0);if(ie(H))if(B==="bottom"||B==="top")if(R!==Math.PI/2){const E=Math.abs(Math.cos(R??0));T=E<1e-6?1/0:this.attribute.end.x/E}else T=H-_;else if(R&&R!==0){const E=Math.abs(Math.sin(R));T=E<1e-6?1/0:this.attribute.end.y/E}else T=H-_}const M=Object.assign(Object.assign(Object.assign({},y),g),{maxWidth:T,textStyle:Object.assign({textAlign:S,textBaseline:A},l),state:{text:dt({},Lr,u.text),shape:dt({},Lr,u.shape),panel:dt({},Lr,u.background)}});return M.angle=R,h&&h.visible&&(M.shape=Object.assign({visible:!0},h.style),h.space&&(M.space=h.space)),d&&d.visible&&(M.panel=Object.assign({visible:!0},d.style)),M}getTextBaseline(t,e){let i="middle";const{verticalFactor:o=1}=this.attribute,r=(e?1:-1)*o;return qi(t[1],0)?i=!qi(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":r===1?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const o=this.attribute.orient;if(["top","bottom","right","left"].includes(o)||t[0]===0&&t[1]===0){if(o==="top"||o==="bottom")return Qm(e?o==="bottom"?"top":"bottom":o,i);if(o==="left"||o==="right")return tb(e?o==="left"?"right":"left":o,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,o,r){var s,l,a,h;const{flush:d=!1}=this.attribute.label||{};if(d&&t.length){const{orient:u,start:c,end:g}=this.attribute,f=u==="bottom"||u==="top",p=t[0],v=yo(t),m=f?p.attribute.x>v.attribute.x:p.attribute.y<v.attribute.y;if(f){const b=m?v:p,w=m?p:v,C=c.x,_=g.x,y=b.AABBBounds.x1,x=w.AABBBounds.x2;y<C&&(b.attribute.angle?b.setAttributes({dx:((s=b.attribute.dx)!==null&&s!==void 0?s:0)+C-y}):b.setAttributes({x:C,textAlign:"left"})),x>_&&(w.attribute.angle?w.setAttributes({dx:((l=w.attribute.dx)!==null&&l!==void 0?l:0)+_-x}):w.setAttributes({x:_,textAlign:"right"}))}else{const b=m?v:p,w=m?p:v,C=b.AABBBounds.y2,_=w.AABBBounds.y1,y=c.y,x=g.y;_<y&&(w.attribute.angle?w.setAttributes({dy:((a=w.attribute.dy)!==null&&a!==void 0?a:0)+y-_}):w.setAttributes({y,textBaseline:"top"})),C>x&&(b.attribute.angle?b.setAttributes({dy:((h=b.attribute.dy)!==null&&h!==void 0?h:0)+x-C}):b.setAttributes({y:x,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,o,r){if(Et(t))return;const{verticalLimitSize:s,label:l,orient:a}=this.attribute,h=this._getAxisLabelLimitLength(s,r),{layoutFunc:d,autoRotate:u,autoRotateAngle:c,autoLimit:g,limitEllipsis:f,autoHide:p,autoHideMethod:v,autoHideSeparation:m,lastVisible:b,firstVisible:w,autoWrap:C,overflowLimitLength:_}=l;if(jt(d))d(t,e,o,this);else{if(u)MP(t,{labelRotateAngle:c,orient:a});else if(C){const y=Math.abs(a==="left"||a==="right"?this.attribute.start.y-this.attribute.end.y:this.attribute.start.x-this.attribute.end.x);kP(t,{orient:a,limitLength:h,axisLength:y,ellipsis:f})}if(!C&&g&&ie(h)&&h>0){const y=a==="left"||a==="right",x=Math.abs(y?this.attribute.start.y-this.attribute.end.y:this.attribute.start.x-this.attribute.end.x),S=y?x/t.length:p||u?1/0:x/t.length;FP(t,{limitLength:h,verticalLimitLength:S,ellipsis:f,orient:a,axisLength:x,overflowLimitLength:_})}p&&xP(t,{orient:a,method:v,separation:m,lastVisible:b,firstVisible:w})}}afterLabelsOverlap(t,e,i,o,r){const{verticalLimitSize:s,orient:l}=this.attribute,a=l==="bottom"||l==="top",h=i.AABBBounds;let d=a?h.height():h.width();const{verticalMinSize:u}=this.attribute;if(ie(u)&&(!ie(s)||u<=s)){const c=this._getAxisLabelLimitLength(u,r);let g,f;d=Math.max(d,c),l==="left"?(g=h.x2-d,f=h.y1):l==="right"?(g=h.x1,f=h.y1):l==="top"?(g=h.x1,f=h.y2-d):l==="bottom"&&(g=h.x1,f=h.y1);const p=bt.rect({x:g,y:f,width:a?h.width():d,height:a?d:h.height(),pickable:!1});p.name=qe.axisLabelBackground,p.id=this._getNodeId("axis-label-background"),i.insertBefore(p,i.firstChild)}if(I(this.attribute.label.containerAlign)){let c;l==="left"?c=h.x2-d:l==="right"?c=h.x1:l==="top"?c=h.y2-d:l==="bottom"&&(c=h.y1),IP(t,c,d,l,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,o,r,s,l;const{label:a,title:h,line:d,tick:u}=this.attribute,c=(i=a.space)!==null&&i!==void 0?i:4;let g=t,f=0,p=0;const v=d&&d.visible?(o=d.style.lineWidth)!==null&&o!==void 0?o:1:0,m=u&&u.visible?(r=u.length)!==null&&r!==void 0?r:4:0;if(h&&h.visible&&typeof h.text=="string"){f=Nc(h.text,h.textStyle,(l=(s=this.stage)===null||s===void 0?void 0:s.getTheme())===null||l===void 0?void 0:l.text).height;const b=gn(h.padding);p=h.space+b[0]+b[2]}return g&&(g=(g-c-p-f-v-m)/e),g}release(){super.release(),this._breaks=null}}Vs.defaultAttributes=jc,Gd(Vs,zP);const Dn=n=>n.map((t,e)=>({index:e,value:t})),nb=(n,t,e=0)=>{const i=new he(n).expand(e/2),o=new he(t).expand(e/2);return i.intersects(o)},ob=12,uh=(n,t,e,i)=>e<n?Math.max(n-t/2,e):e>n?Math.min(n-t/2,e-t):e<i?e:e-t,rb=(n,t,e)=>{var i;const{labelStyle:o,axisOrientType:r,labelFlush:s,labelFormatter:l,startAngle:a=0}=e;let h=(i=o.angle)!==null&&i!==void 0?i:0;o.direction==="vertical"&&(h+=Li(90));const d=["bottom","top"].includes(r),u=["left","right"].includes(r);let c=1,g=0;d||(u?(c=0,g=1):a&&(c=Math.cos(a),g=-Math.sin(a)));const f=km(o),p=n.range();return t.map((m,b)=>{var w,C;const _=l?l(m):`${m}`,{width:y,height:x}=f.quickMeasure(_),S=Math.max(y,12),A=Math.max(x,12),R=n.scale(m),T=c*R,M=g*R;let P,k,B=T,H=M;s&&d&&b===0?B=uh(T,S,p[0],p[p.length-1]):s&&d&&b===t.length-1?B=uh(T,S,p[p.length-1],p[0]):P=(w=o.textAlign)!==null&&w!==void 0?w:"center",P==="right"?B-=S:P==="center"&&(B-=S/2),s&&u&&b===0?H=uh(M,A,p[0],p[p.length-1]):s&&u&&b===t.length-1?H=uh(M,A,p[p.length-1],p[0]):k=(C=o.textBaseline)!==null&&C!==void 0?C:"middle",k==="bottom"?H-=A:k==="middle"&&(H-=A/2);const E=new he().set(B,H,B+S,H+A);return h&&E.rotate(h,T,M),E})},WP=n=>["bottom","top","z"].includes(n);var Ke;(function(n){n.Identity="identity",n.Linear="linear",n.Log="log",n.Pow="pow",n.Sqrt="sqrt",n.Symlog="symlog",n.Time="time",n.Quantile="quantile",n.Quantize="quantize",n.Threshold="threshold",n.Ordinal="ordinal",n.Point="point",n.Band="band"})(Ke||(Ke={})),Object.values(Ke).forEach(n=>{});function sb(n){switch(n){case Ke.Linear:case Ke.Log:case Ke.Pow:case Ke.Sqrt:case Ke.Symlog:case Ke.Time:return!0;default:return!1}}function NP(n){switch(n){case Ke.Ordinal:case Ke.Point:case Ke.Band:return!0;default:return!1}}function Fr(n){return n}const VP=n=>-Math.log(-n),jP=n=>-Math.exp(-n),GP=n=>isFinite(n)?Math.pow(10,n):n<0?0:n,lb=n=>n===10?GP:n===Math.E?Math.exp:t=>Math.pow(n,t),ab=n=>n===Math.E?Math.log:n===10?Math.log10:n===2?Math.log2:(n=Math.log(n),t=>Math.log(t)/n),hb=n=>t=>Math.sign(t)*Math.log1p(Math.abs(t/n)),db=n=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*n;function Uc(n,t){if(n=Number(n),t=Number(t),t-=n)return i=>(i-n)/t;const e=Number.isNaN(t)?NaN:.5;return()=>e}function ub(n,t,e){const i=n[0],o=n[1],r=t[0],s=t[1];let l,a;return o<i?(l=Uc(o,i),a=e(s,r)):(l=Uc(i,o),a=e(r,s)),h=>a(l(h))}function Kc(n,t,e){let i;return i=n===1?n+2*e:n-t+2*e,n?i>0?i:1:0}function UP(n,t,e,i){return e===1&&(e=0),Kc(n,e,i)*(t/(1-e))}function KP(n,t,e,i,o){const r=Kc(n,e,i);let s=t/Math.max(1,r||1);o&&(s=Math.floor(s));let l=s*(1-e);return o&&(l=Math.round(l)),l}function cb(n,t){const e=(n[1]-n[0])/(t[1]-t[0]),i=n[0]-e*t[0];return[i,e+i]}function $P(n,t,e){const i=Math.min(n.length,t.length)-1,o=new Array(i),r=new Array(i);let s=-1;for(n[i]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++s<i;)o[s]=Uc(n[s],n[s+1]),r[s]=e(t[s],t[s+1]);return function(l){const a=j1(n,l,1,i)-1;return r[a](o[a](l))}}const YP=(n,t)=>{const e=n.slice();let i=0,o=e.length-1,r=e[i],s=e[o];return s<r&&([i,o]=[o,i],[r,s]=[s,r]),e[i]=t.floor(r),e[o]=t.ceil(s),e},gb=(n,t=!1)=>{const e=Math.floor(Math.log10(n)),i=n/Math.pow(10,e);let o;return o=t?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10,o*Math.pow(10,e)},XP=(n,t)=>{let e,i;return t[0]<t[1]?(e=t[0],i=t[1]):(e=t[1],i=t[0]),Math.min(Math.max(n,e),i)};class fb{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:I(this._rangeFactorStart)&&I(this._rangeFactorEnd)&&t.length===2?(this._wholeRange=cb(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(t.length===2&&t.every(o=>o>=0&&o<=1)&&(this._wholeRange=null,t[0]===0&&t[1]===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):I(this._rangeFactorStart)&&I(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return ct(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,t!==0||!ct(this._rangeFactorEnd)&&this._rangeFactorEnd!==1?(this._rangeFactorStart=t,this._rangeFactorEnd=(i=this._rangeFactorEnd)!==null&&i!==void 0?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return ct(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,t!==0||!ct(this._rangeFactorStart)&&this._rangeFactorStart!==0?(this._rangeFactorEnd=t,this._rangeFactorStart=(i=this._rangeFactorStart)!==null&&i!==void 0?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:o}=this._fishEyeOptions,r=this.range(),s=r[0],l=r[r.length-1],a=Math.min(s,l),h=Math.max(s,l),d=bi((t=this._fishEyeOptions.focus)!==null&&t!==void 0?t:0,a,h),u=ct(o)?(h-a)*i:o;let c=Math.exp(e);c=c/(c-1)*u;const g=e/u;this._fishEyeTransform=f=>{const p=Math.abs(f-d);if(p>=u)return f;if(p<=1e-6)return d;const v=c*(1-Math.exp(-p*g))/p*.75+.25;return d+(f-d)*v}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return(i=this==null?void 0:this[t])!==null&&i!==void 0?i:e}}const $c=Symbol("implicit");class Yc extends fb{specified(t){var e;return t?(this._specified=Object.assign((e=this._specified)!==null&&e!==void 0?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=Ke.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=$c}clone(){const t=new Yc().domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return I(this._rangeFactorStart)&&I(this._rangeFactorEnd)&&t.length===2?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(i!==void 0)return i;let o=this._index.get(e);if(!o){if(this._unknown!==$c)return this._unknown;o=this._domain.push(t),this._index.set(e,o)}const r=this._ordinalRange[(o-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;for(const e of t){const i=`${e}`;this._index.has(i)||this._index.set(i,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();const e=Array.from(t);return this._ordinalRange=e,this}index(t){var e;return this._index&&(e=this._index.get(`${t}`))!==null&&e!==void 0?e:-1}}function pb(n,t,e,i){const o=[];let r=n;for(;r<=t;)o.push(r),r+=e;return i&&o.reverse(),o}function vb(n,t,e,i){let o,r;if(t=Math.floor(+t),n=Math.floor(+n),!(e=Math.floor(+e)))return[];if(n===t)return[n];if(o=t<n){const l=n;n=t,t=l}let s=Yd(1,t-n+1)(e);if(r=Math.floor((t-n+1)/s),!i)for(;Math.ceil((t-n+1)/r)>e&&s>1;)s-=1,r=Math.floor((t-n)/s);return pb(n,t,r,o)}function qP(n,t,e){let i;if(t=Math.floor(+t),n=Math.floor(+n),e=Yd(1,t-n+1)(Math.floor(+e)),i=t<n){const o=n;n=t,t=o}return pb(n,t,e,i)}class ch extends Yc{constructor(t){super(),this.type=Ke.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),o=super.domain().length,r=i[1]<i[0];let s=i[Number(r)-0];const l=i[1-Number(r)],a=Kc(o,this._paddingInner,this._paddingOuter);return this._step=(l-s)/Math.max(1,a||1),this._round&&(this._step=Math.floor(this._step)),s+=(l-s-this._step*(o-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(s=Math.round(s),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:r,start:r?s+this._step*(o-1):s,count:o},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;const e=`${t}`,i=this._getSpecifiedValue(e);if(i!==void 0)return i;let o=this._index.get(e);if(!o){if(this._unknown!==$c)return this._unknown;o=this._domain.push(t),this._index.set(e,o)}const{count:r,start:s,reverse:l}=this._bandRangeState,a=s+(l?-1:1)*((o-1)%r)*this._step;return this._fishEyeTransform?this._fishEyeTransform(a):a}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){let i;if(I(this._rangeFactorStart)&&I(this._rangeFactorEnd)&&t.length===2){const r=cb(t,[this._rangeFactorStart,this._rangeFactorEnd]);i=Math.abs(r[1]-r[0])}else i=Math.abs(t[1]-t[0]);const o=KP(super.domain().length,i,this._paddingInner,this._paddingOuter,this._round);o<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):o>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=o,this._isFixed=!1)}if(this.isBandwidthFixed()){const i=UP(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),o=Math.min((t[1]-t[0])/i,1);if(I(this._rangeFactorStart)&&I(this._rangeFactorEnd)){if(i>0){const l=t[0]-i*this._rangeFactorStart,a=l+i;this._wholeRange=[l,a]}else{const l=t[1]+i*(1-this._rangeFactorEnd),a=l-i;this._wholeRange=[a,l]}const r=this._rangeFactorStart+o<=1,s=this._rangeFactorEnd-o>=0;e==="rangeFactorStart"&&r?this._rangeFactorEnd=this._rangeFactorStart+o:e==="rangeFactorEnd"&&s?this._rangeFactorStart=this._rangeFactorEnd-o:t[0]<=t[1]?r?this._rangeFactorEnd=this._rangeFactorStart+o:s?this._rangeFactorStart=this._rangeFactorEnd-o:(this._rangeFactorStart=0,this._rangeFactorEnd=o):s?this._rangeFactorStart=this._rangeFactorEnd-o:r?this._rangeFactorEnd=this._rangeFactorStart+o:(this._rangeFactorStart=1-o,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=o,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(I(this._rangeFactorStart)&&I(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),o=this._getInvertIndex(t[1]);return e.slice(Math.min(i,o),Math.max(i,o)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[ns(t[0]),ns(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[ns(t[0]),ns(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return t===-1?e:vb(0,e.length-1,t,!1).map(i=>e[i])}tickData(t=10){return this.ticks(t).map((e,i)=>({index:i,tick:e,value:(this.scale(e)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])}))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return vb(0,e.length-1,t,!0).filter(i=>i<e.length).map(i=>e[i])}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return qP(0,e.length-1,t).map(i=>e[i])}_getInvertIndex(t){let e=0;const i=this.step()/2,o=this.bandwidth()/2,r=this._domain.length,s=this.range(),l=s[0]>s[s.length-1];for(e=0;e<r;e++){const a=this.scale(this._domain[e])+o;if(e===0&&(!l&&!zf(t,a+i)||l&&!Df(t,a-i))||e===r-1||!Df(t,a-i)&&!zf(t,a+i))break}return e>=0&&e<=r-1?e:r-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return t!==void 0?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return t!==void 0?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return t!==void 0?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return t!==void 0?(this._round=t,this.rescale(e)):this._round}align(t,e){return t!==void 0?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return ct(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return ct(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?(t==="auto"?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth=t==="auto"?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth=t==="auto"?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&nt(this._userBandwidth)}clone(){var t,e,i;return new ch(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth((t=this._userBandwidth)!==null&&t!==void 0?t:"auto",!0).maxBandwidth((e=this._maxBandwidth)!==null&&e!==void 0?e:"auto",!0).minBandwidth((i=this._maxBandwidth)!==null&&i!==void 0?i:"auto")}}const{interpolateRgb:Xc}=hw;function ZP(n,t){const e=typeof t;let i;if(ct(t)||e==="boolean")return()=>t;if(e==="number")return Ll(n,t);if(e==="string"){if(i=_i.parseColorString(t)){const o=Xc(_i.parseColorString(n),i);return r=>o(r).formatRgb()}return Ll(Number(n),Number(t))}return t instanceof li?Xc(n,t):t instanceof _i?Xc(n.color,t.color):t instanceof Date?Y1(n,t):Ll(Number(n),Number(t))}class mb extends fb{constructor(t=Fr,e=Fr){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=Fr,this._piecewise=ub,this._interpolate=ZP}calculateVisibleDomain(t){var e;return I(this._rangeFactorStart)&&I(this._rangeFactorEnd)&&t.length===2?[this.invert(t[0]),this.invert(t[1])]:(e=this._niceDomain)!==null&&e!==void 0?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(((e=this._niceDomain)!==null&&e!==void 0?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),((e=this._niceDomain)!==null&&e!==void 0?e:this._domain).map(this.transformer),Ll)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return((i=this._niceDomain)!==null&&i!==void 0?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const o=Array.from(t,ns);return this._domain=o,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=$1,this.rescale(e)}rescale(t){var e;if(t)return this;const i=(e=this._niceDomain)!==null&&e!==void 0?e:this._domain,o=i.length,r=this._range.length;let s=Math.min(o,r);if(o&&o<r&&this._forceAlign){const l=r-o+1,a=i[o-1],h=o>=2?(a-i[o-2])/l:0;for(let d=1;d<=l;d++)i[o-2+d]=a-h*(l-d);s=r}return this._autoClamp&&(this._clamp=Yd(i[0],i[s-1])),this._piecewise=s>2?$P:ub,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:Fr),this.rescale(i)):this._clamp!==Fr}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(e??[]).map((i,o)=>({index:o,tick:i,value:(this.scale(i)-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 ct(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return ct(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const JP=Math.sqrt(50),QP=Math.sqrt(10),tH=Math.sqrt(2),gh=[1,2,5,10],bb=(n,t,e)=>{let i=1,o=n;const r=Math.floor((t-1)/2),s=Math.abs(n);return n>=0&&n<=Number.MIN_VALUE?o=0:n<0&&n>=-Number.MIN_VALUE?o=-(t-1):!e&&s<1?i=Cb(s).step:(e||s>1)&&(o=Math.floor(n)-r*i),i>0?(n>0?o=Math.max(o,0):n<0&&(o=Math.min(o,-(t-1)*i)),W1(0,t).map(l=>o+l*i)):n>0?fh(0,-(t-1)/i,i):fh((t-1)/i,0,i)},eH=os((n,t,e,i)=>{let o,r,s,l,a=-1;if(e=+e,(n=+n)==(t=+t))return[n];if(Math.abs(n-t)<=Number.MIN_VALUE&&e>0)return[n];if((o=t<n)&&(r=n,n=t,t=r),l=qc(n,t,e).step,!isFinite(l))return[];if(l>0){let h=Math.round(n/l),d=Math.round(t/l);for(h*l<n&&++h,d*l>t&&--d,s=new Array(r=d-h+1);++a<r;)s[a]=(h+a)*l}else if(l<0&&(i!=null&&i.noDecimals)){l=1;const h=Math.ceil(n),d=Math.floor(t);if(!(h<=d))return[];for(s=new Array(r=d-h+1);++a<r;)s[a]=h+a}else{l=-l;let h=Math.round(n*l),d=Math.round(t*l);for(h/l<n&&++h,d/l>t&&--d,s=new Array(r=d-h+1);++a<r;)s[a]=(h+a)/l}return o&&s.reverse(),s}),fh=(n,t,e)=>{let i,o,r=-1;if(e>0){let s=Math.floor(n/e),l=Math.ceil(t/e);for((s+1)*e<n&&++s,(l-1)*e>t&&--l,o=new Array(i=l-s+1);++r<i;)o[r]=(s+r)*e}else{e=-e;let s=Math.floor(n*e),l=Math.ceil(t*e);for((s+1)/e<n&&++s,(l-1)/e>t&&--l,o=new Array(i=l-s+1);++r<i;)o[r]=(s+r)/e}return o},iH=(n,t,e)=>{let i;const o=n[0],r=n[n.length-1],s=t-n.length;if(r<=0){const h=[];for(i=s;i>=1;i--)h.push(o-i*e);return h.concat(n)}if(o>=0){for(i=1;i<=s;i++)n.push(r+i*e);return n}let l=[];const a=[];for(i=1;i<=s;i++)i%2==0?l=[o-Math.floor(i/2)*e].concat(l):a.push(r+Math.ceil(i/2)*e);return l.concat(n).concat(a)},ph=os((n,t,e,i)=>{let o,r,s;if(e=+e,(n=+n)==(t=+t)||Math.abs(n-t)<=Number.MIN_VALUE&&e>0)return bb(n,e,i==null?void 0:i.noDecimals);(o=t<n)&&(s=n,n=t,t=s);const l=qc(n,t,e);let a=l.step;if(!isFinite(a))return[];if(a>0){let h=1;const{power:d,gap:u}=l,c=u===10?2*10**d:1*10**d;for(;h<=5&&(r=fh(n,t,a),r.length>e+1)&&e>2;)a+=c,h+=1;e>2&&r.length<e-1&&(r=iH(r,e,a))}else i!=null&&i.noDecimals&&a<0&&(a=1),r=fh(n,t,a);return o&&r.reverse(),r}),Cb=n=>{const t=Math.floor(Math.log(n)/Math.LN10),e=n/10**t;let i=gh[0];return e>=JP?i=gh[3]:e>=QP?i=gh[2]:e>=tH&&(i=gh[1]),t>=0?{step:i*10**t,gap:i,power:t}:{step:-(10**-t)/i,gap:i,power:t}};function qc(n,t,e){const i=(t-n)/Math.max(0,e);return Cb(i)}function _b(n,t,e){let i;if(e=+e,(n=+n)==(t=+t)&&e>0)return[n];if(e<=0||(i=nH(n,t,e))===0||!isFinite(i))return[];const o=new Array(e);for(let r=0;r<e;r++)o[r]=n+r*i;return o}function nH(n,t,e){return(t-n)/Math.max(1,e-1)}function oH(n,t,e){let i,o,r=-1;if(e=+e,(o=(t=+t)<(n=+n))&&(i=n,n=t,t=i),!isFinite(e)||t-n<=e)return[n];const s=Math.floor((t-n)/e+1),l=new Array(s);for(;++r<s;)l[r]=n+r*e;return o&&l.reverse(),l}function Zc(n,t=10){let e,i,o=0,r=n.length-1,s=n[o],l=n[r],a=10;for(l<s&&(i=s,s=l,l=i,i=o,o=r,r=i);a-- >0;){if(i=qc(s,l,t).step,i===e)return n[o]=s,n[r]=l,n;if(i>0)s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i}e=i}}function yb(n,t){const e=nt(t.forceMin),i=nt(t.forceMax);let o=null;const r=[];let s=null;const l=e&&i?a=>a>=t.forceMin&&a<=t.forceMax:e?a=>a>=t.forceMin:i?a=>a<=t.forceMax:null;return e?r[0]=t.forceMin:nt(t.min)&&t.min<=Math.min(n[0],n[n.length-1])&&(r[0]=t.min),i?r[1]=t.forceMax:nt(t.max)&&t.max>=Math.max(n[0],n[n.length-1])&&(r[1]=t.max),nt(r[0])&&nt(r[1])?(s=n.slice(),s[0]=r[0],s[s.length-1]=r[1]):o=nt(r[0])||nt(r[1])?nt(r[0])?"max":"min":"all",{niceType:o,niceDomain:s,niceMinMax:r,domainValidator:l}}const Jc=(n,t,e)=>Math.abs(t-n)<1?+e.toFixed(1):Math.round(+e),wb=os((n,t,e,i,o,r,s)=>{let l=n,a=t;const h=a<l;h&&([l,a]=[a,l]);let d,u,c=o(l),g=o(a),f=[];if(!(i%1)&&g-c<e){if(c=Math.floor(c),g=Math.ceil(g),l>0){for(;c<=g;++c)for(d=1;d<i;++d)if(u=c<0?d/r(-c):d*r(c),!(u<l)){if(u>a)break;f.push(u)}}else for(;c<=g;++c)for(d=i-1;d>=1;--d)if(u=c>0?d/r(-c):d*r(c),!(u<l)){if(u>a)break;f.push(u)}2*f.length<e&&(f=ph(l,a,e))}else f=ph(c,g,Math.min(g-c,e)).map(r);return f=f.filter(p=>p!==0),s!=null&&s.noDecimals&&(f=Array.from(new Set(f.map(p=>Math.floor(p))))),h?f.reverse():f}),Sb=os((n,t,e,i,o,r)=>{const s=[],l={},a=o(n),h=o(t);let d=[];if(Number.isInteger(i))d=ph(a,h,e);else{const u=(h-a)/(e-1);for(let c=0;c<e;c++)d.push(a+c*u)}return d.forEach(u=>{const c=r(u),g=Number.isInteger(i)?Jc(n,t,c):Jc(n,t,gb(c)),f=Jc(n,t,XP(g,[n,t]));!l[f]&&!isNaN(f)&&d.length>1&&(l[f]=1,s.push(f))}),s}),vh=os((n,t,e,i,o)=>_b(i(n),i(t),e).map(r=>gb(o(r))));class ko extends mb{constructor(){super(...arguments),this.type=Ke.Linear}clone(){return new ko().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return eH(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(jt(e==null?void 0:e.customTicks))return e.customTicks(this,t);if(I(this._rangeFactorStart)&&I(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&this._range.length===2||!this._niceType)return this.d3Ticks(t,e);const o=(i=this._niceDomain)!==null&&i!==void 0?i:this._domain,r=this._domain,s=o[0],l=o[o.length-1];let a=ph(r[0],r[r.length-1],t,e);if(!a.length)return a;if(this._domainValidator)a=a.filter(this._domainValidator);else if((a[0]!==s||a[a.length-1]!==l)&&this._niceType){const h=o.slice();if(this._niceType==="all"?(h[0]=a[0],h[h.length-1]=a[a.length-1],this._niceDomain=h,this.rescale()):this._niceType==="min"&&a[0]!==s?(h[0]=a[0],this._niceDomain=h,this.rescale()):this._niceType==="max"&&a[a.length-1]!==l&&(h[h.length-1]=a[a.length-1],this._niceDomain=h,this.rescale()),this._niceType!=="all"){const d=Math.min(h[0],h[h.length-1]),u=Math.max(h[0],h[h.length-1]);a=a.filter(c=>c>=d&&c<=u)}}return a}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return _b(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return oH(e[0],e[e.length-1],t)}nice(t=10,e){var i,o;const r=this._domain;let s=[];if(e){const l=yb(r,e);if(s=l.niceMinMax,this._domainValidator=l.domainValidator,this._niceType=l.niceType,l.niceDomain)return this._niceDomain=l.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const l=Zc(r.slice(),t);this._niceType==="min"?l[l.length-1]=(i=s[1])!==null&&i!==void 0?i:l[l.length-1]:this._niceType==="max"&&(l[0]=(o=s[0])!==null&&o!==void 0?o:l[0]),this._niceDomain=l,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Zc(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=Zc(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class xb{nice(t=10,e){var i,o,r,s;const l=this._domain;let a=[],h=null;if(e){const d=yb(l,e);if(a=d.niceMinMax,this._domainValidator=d.domainValidator,h=d.niceType,d.niceDomain)return this._niceDomain=d.niceDomain,this.rescale(),this}else h="all";if(h){const d=YP(l.slice(),(o=(i=this.getNiceConfig)===null||i===void 0?void 0:i.call(this))!==null&&o!==void 0?o:{floor:u=>Math.floor(u),ceil:u=>Math.ceil(u)});return h==="min"?d[d.length-1]=(r=a[1])!==null&&r!==void 0?r:d[d.length-1]:h==="max"&&(d[0]=(s=a[0])!==null&&s!==void 0?s:d[0]),this._niceDomain=d,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function Ab(n){return t=>-n(-t)}function Rb(n=Number.EPSILON){return t=>Math.max(t,n)}function rH(n=Number.EPSILON){return t=>Math.min(t,-n)}class js extends mb{constructor(){super(ab(10),lb(10)),this.type=Ke.Log,this._limit=Rb(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return new js().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=ab(this._base),o=lb(this._base);return((e=this._niceDomain)!==null&&e!==void 0?e:this._domain)[0]<0?(this._logs=Ab(i),this._pows=Ab(o),this._limit=rH(),this.transformer=VP,this.untransformer=jP):(this._logs=i,this._pows=o,this._limit=Rb(),this.transformer=this._logs,this.untransformer=o),this}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(((e=this._niceDomain)!==null&&e!==void 0?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return Fr}d3Ticks(t=10,e){const i=this.domain(),o=this._limit(i[0]),r=this._limit(i[i.length-1]);return wb(o,r,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Sb(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return vh(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return vh(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}Gd(js,xb);class sH extends ch{constructor(t){super(!1),this.type=Ke.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}}class Gs extends ko{constructor(){super(hb(1),db(1)),this.type=Ke.Symlog,this._const=1}clone(){return new Gs().domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=hb(t),this.untransformer=db(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const i=this.domain(),o=i[0],r=i[i.length-1];return wb(o,r,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Sb(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return vh(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return vh(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}Gd(Gs,xb);function Qc(n,t,e,i){let o;const{breakData:r}=n;if(r&&r()){const{breakDomains:s}=r(),l=t.domain();o=[];for(let a=0;a<l.length-1;a++)i(e,[l[a],l[a+1]]).forEach(h=>{s.some(d=>h>=d[0]&&h<=d[1])||o.push(h)});t.domain(l)}else o=i(e);return o}function Tb(n,t,e,i,o=!1){if(e&&!t.includes(n)){let r=t.length;if(r>1){o?t.push(n):t.unshift(n);for(let s=0;s<r;s++){const l=o?r-1-s:s;if(!i(t[l]))break;t.splice(l,1),s--,r--}}}}const lH=(n,t)=>{var e,i;if(!sb(n.type))return Dn(n.domain());const o=n.range(),r=Math.abs(o[o.length-1]-o[0]);if(r<2)return Dn([n.domain()[0]]);const{tickCount:s,forceTickCount:l,tickStep:a,noDecimals:h=!1,labelStyle:d,breakData:u}=t;let c;if(I(a))c=n.stepTicks(a);else if(I(l))c=Qc(t,n,l,(f,p)=>p&&p.length?n.domain(p,!0).forceTicks(f):n.forceTicks(f));else if(t.tickMode==="d3"){const f=(e=jt(s)?s({axisLength:r,labelStyle:d}):s)!==null&&e!==void 0?e:5;c=Qc(t,n,f,(p,v)=>v&&v.length?n.domain(v,!0).d3Ticks(p,{noDecimals:h}):n.d3Ticks(p,{noDecimals:h}))}else{const f=(i=jt(s)?s({axisLength:r,labelStyle:d}):s)!==null&&i!==void 0?i:5,p=jt(t.tickMode)?t.tickMode:void 0;c=Qc(t,n,f,(v,m)=>m&&m.length?n.domain(m,!0).ticks(v,{noDecimals:h,customTicks:p}):n.ticks(v,{noDecimals:h,customTicks:p}))}const g=n.domain();if(t.labelFirstVisible&&g[0]!==c[0]&&!c.includes(g[0])&&c.unshift(g[0]),t.labelLastVisible&&g[g.length-1]!==c[c.length-1]&&!c.includes(g[g.length-1])&&c.push(g[g.length-1]),t.sampling&&c.length>1&&(t.coordinateType==="cartesian"||t.coordinateType==="polar"&&t.axisOrientType==="radius")){const{labelGap:f=4,labelFlush:p}=t;let v=rb(n,c,t).map((S,A)=>({AABBBounds:S,value:c[A]}));const m=[...v],b=m[0],w=yo(m),C=u&&u()?Mb.greedy:Mb.parity;for(;v.length>=3&&Gc(v,f);)v=C(v,f);const _=t.labelFirstVisible;let y=t.labelLastVisible;sn(b,w,f)&&v.includes(w)&&v.length>1&&_&&y&&(v.splice(v.indexOf(w),1),y=!1),Tb(b,v,_,S=>sn(S,b,f)),Tb(w,v,y,S=>sn(S,w,f)||!(!_||S===b)&&sn(S,b,f),!0);const x=v.map(S=>S.value);x.length<3&&p&&(x.length>1&&x.pop(),yo(x)!==yo(c)&&x.push(yo(c))),c=x}return Dn(c)},Mb={parity:function(n){return n.filter((t,e)=>e%2==0)},greedy:function(n,t){let e;return n.filter((i,o)=>(!o||!sn(e,i,t))&&(e=i,!0))}},Bb=(n,t,e,i)=>rb(n,t,e).map(o=>i?[o.x1,o.x2,o.width()]:[o.y1,o.y2,o.height()]),Pb=(n,t,e=0)=>Math.max(n[0],t[0])-e/2<=Math.min(n[1],t[1])+e/2,Hb=(n,t)=>n[1]<t[0]?t[0]-n[1]:t[1]<n[0]?n[0]-t[1]:0,aH=(n,t)=>{var e;const i=n.domain();if(!i.length)return[];const{tickCount:o,forceTickCount:r,tickStep:s,labelGap:l=4,axisOrientType:a,labelStyle:h}=t,d=WP(a),u=n.range(),c=n.calculateWholeRangeSize();if(c<2)return t.labelLastVisible?Dn([i[i.length-1]]):Dn([i[0]]);let g;if(I(s))g=n.stepTicks(s);else if(I(r))g=n.forceTicks(r);else if(I(o)){const f=jt(o)?o({axisLength:c,labelStyle:h}):o;g=n.ticks(f)}else if(t.sampling){const f=((e=t.labelStyle.fontSize)!==null&&e!==void 0?e:12)+2,p=Pl(u),v=Kd(u);if(i.length<=c/f){const m=(v-p)/i.length,b=Bb(n,i,t,d),w=Math.min(...b.map(_=>_[2])),C=hH(i,b,l,t.labelLastVisible,Math.floor(w/m),!1);g=n.stepTicks(C.step),t.labelLastVisible&&(C.delCount&&(g=g.slice(0,g.length-C.delCount)),g.push(i[i.length-1]))}else{const m=[i[0],i[Math.floor(i.length/2)],i[i.length-1]],b=Bb(n,m,t,d);let w=null;b.forEach(_=>{w?w[2]<_[2]&&(w=_):w=_});const C=v-p-l>0?Math.ceil(i.length*(l+w[2])/(v-p-l)):i.length-1;g=n.stepTicks(C),!t.labelLastVisible||g.length&&g[g.length-1]===i[i.length-1]||(g.length&&Math.abs(n.scale(g[g.length-1])-n.scale(i[i.length-1]))<w[2]&&(g=g.slice(0,-1)),g.push(i[i.length-1]))}}else g=n.domain();return Dn(g)},hH=(n,t,e,i,o,r)=>{let s=0,l=0,a=-1,h=Number.MAX_VALUE;const d=g=>{let f=!0,p=0;do p+g<n.length&&Pb(t[p],t[p+g],e)&&(f=!1),p+=g;while(f&&p<n.length);return f},u=G1(o,n.length,g=>d(g)?1:-1);let c=u;do if(c>u&&!r&&!d(c))c++;else{if(!i){l=c;break}{const g=n.length-1;let f,p=0;f=n.length%c>0?n.length-n.length%c+c:n.length;do{if(f-=c,f!==g&&!Pb(t[f],t[g],e))break;p++}while(f>0);if(f===g){l=c,s=p;break}{const v=Math.floor(n.length/c)-p+1;if(v<a)break;{a=v;const m=Hb(t[f],t[g]),b=f-c>=0?Hb(t[f-c],t[f]):m,w=Math.abs(m-b);if(w<h&&(h=w,l=c,s=p),m<=b)break}}}c++}while(c<=n.length);return{step:l,delCount:s}},dH=(n,t,e)=>{var i;const{labelStyle:o,getRadius:r,labelOffset:s,labelFormatter:l,inside:a}=e,h=r==null?void 0:r(),d=(i=o.angle)!==null&&i!==void 0?i:0,u=km(o);return t.map(c=>{const g=l?l(c):`${c}`,{width:f,height:p}=u.quickMeasure(g),v=Math.max(f,ob),m=Math.max(p,ob),b=n.scale(c),w={x:0,y:0};let C=0,_=0;const y={align:o.textAlign,baseline:o.textBaseline},{x,y:S}=mP(b,w,h,s,a);return y.align||(qi(x,w.x)?y.baseline||(y.baseline=S>w.y?"top":"bottom"):x>w.x?y.align="left":x<w.x&&(y.align="right")),C=x+(y.align==="right"?-v:y.align==="left"?0:-v/2),_=S+(y.baseline==="bottom"?-m:y.baseline==="top"?0:-m/2),new he().set(C,_,C+v,_+m).rotate(d,C+v/2,_+m/2)})},uH=(n,t)=>{const{tickCount:e,forceTickCount:i,tickStep:o,getRadius:r,labelOffset:s,labelGap:l=0,labelStyle:a}=t,h=r==null?void 0:r();if(!h)return Dn(n.domain());let d;if(I(o))d=n.stepTicks(o);else if(I(i))d=n.forceTicks(i);else if(I(e)){const u=n.range(),c=Math.abs(u[u.length-1]-u[0]),g=jt(e)?e({axisLength:c,labelStyle:a}):e;d=n.ticks(g)}else if(t.sampling){const u=n.domain(),c=n.range(),g=dH(n,u,t),f=Pl(c),p=Kd(c),v=Math.abs(p-f)*(h+s)/u.length,{step:m,delCount:b}=cH(u,g,l,Math.floor(g.reduce((w,C)=>Math.min(w,C.width(),C.height()),Number.MAX_VALUE)/v));d=n.stepTicks(m),d=d.slice(0,d.length-b)}else d=n.domain();return Dn(d)},cH=(n,t,e,i)=>{let o=i;do{let s=!0;o++;let l=0;do l+o<n.length&&nb(t[l],t[l+o],e)&&(s=!1),l+=o;while(s&&l<n.length);if(s)break}while(o<=n.length);let r=0;if(n.length>2){let s=n.length-n.length%o;for(s>=n.length&&(s-=o);s>0&&nb(t[0],t[s]);)r++,s-=o}return{step:o,delCount:r}},gH=(n,t)=>{if(sb(n.type))return lH(n,t);if(NP(n.type)){if(t.coordinateType==="cartesian")return aH(n,t);if(t.coordinateType==="polar"&&t.axisOrientType==="angle")return uH(n,t)}return Dn(n.domain())};function Eb(){Ai(),Mr(),zn()}const Lb={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};Eb();class Us extends Ni{getCurrent(){return this._current}constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Us.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=i=>{const o=i.target;o.hasState("disable")||o.addState("hover")},this._onUnHover=i=>{i.target.removeState("hover")},this._onClick=i=>{const o=i.target;if(o.name==="preHandler"){if(this._current===1)return;this._current-=1,this._current===1?o.addState("disable"):o.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:i})}if(o.name==="nextHandler"){if(this._current===this._total)return;this._current+=1,this._current===this._total?o.addState("disable"):o.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:i})}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",this._getPageText(this._current))}}render(){var t,e,i;this._reset();const{layout:o="horizontal",handler:r=Lb,total:s,defaultCurrent:l=1,textStyle:a,padding:h=0}=this.attribute;this._current=l;const d=gn(h),u=o==="horizontal",c=bt.group({x:0,y:0}),g=r.style||{},f=g.size||15,p=(t=r.space)!==null&&t!==void 0?t:8,v=r.state||{};let{preShape:m,nextShape:b}=r;m||(m=u?"triangleLeft":"triangleUp"),b||(b=u?"triangleRight":"triangleDown");const w=bt.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},g),{x:0,y:0,symbolType:m,size:f}));w.states=v,w.name="preHandler",this.preHandler=w,c.add(w);const{width:C,height:_}=Nc(this._getPageText(s),Object.assign({textAlign:"center",textBaseline:"middle"},a),(i=(e=this.stage)===null||e===void 0?void 0:e.getTheme())===null||i===void 0?void 0:i.text),y=nt(f)?f:f[0],x=nt(f)?f:f[1],S=bt.text(Object.assign({x:u?y/2+p+C/2:0,y:u?0:x/2+p+_/2,text:this._getPageText(l),textAlign:"center",textBaseline:"middle",lineHeight:a==null?void 0:a.fontSize},a));this.text=S,c.add(S);const A=bt.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},g),{x:u?y+2*p+C:0,y:u?0:x+2*p+_,symbolType:b,size:f}));A.name="nextHandler",A.states=v,this.nextHandler=A,c.add(A),this._total===1?(w.addState("disable"),A.addState("disable")):this._current===1?w.addState("disable"):this._current===s&&A.addState("disable");const R=c.AABBBounds,T=R.width(),M=R.height();c.translateTo(0-R.x1+d[3],0-R.y1+d[0]),this.add(c),this.attribute.width=T+d[1]+d[3],this.attribute.height=M+d[0]+d[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(!0),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}_getPageText(t){const{pageFormatter:e}=this.attribute;return e?jt(e)?e(t,this._total):`${e}`.replace("{current}",`${t}`).replace("{total}",`${this._total}`):`${t}/${this._total}`}setTotal(t){t!==this.attribute.total&&(this._total=t,this._current!==1&&this._current<=t?this.setAttributes({total:t,defaultCurrent:this._current}):this.setAttribute("total",t))}}Us.defaultAttributes={handler:Lb,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const mh=10,Fb=8,kb=8,fH=8,bh=16,Ch=8,Ks=12,tg=12;var Ct;(function(n){n.selected="selected",n.unSelected="unSelected",n.selectedHover="selectedHover",n.unSelectedHover="unSelectedHover",n.focus="focus"})(Ct||(Ct={}));var Vi;(function(n){n.legendItemHover="legendItemHover",n.legendItemUnHover="legendItemUnHover",n.legendItemClick="legendItemClick",n.legendItemAttributeUpdate="legendItemAttributeUpdate"})(Vi||(Vi={}));var Ze;(function(n){n.innerView="innerView",n.title="legendTitle",n.item="legendItem",n.itemShape="legendItemShape",n.itemLabel="legendItemLabel",n.itemValue="legendItemValue",n.focus="legendItemFocus"})(Ze||(Ze={}));class eg extends Ni{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute;this._parsedPadding=gn(i);const o=bt.group({x:this._parsedPadding[3],y:this._parsedPadding[0],pickable:t,childrenPickable:t});o.name=Ze.innerView,this.add(o),this._innerView=o,e!=null&&e.visible&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const r=this._innerView.AABBBounds;this.attribute.width=r.width()+this._parsedPadding[1]+this._parsedPadding[3],this.attribute.height=r.height()+this._parsedPadding[0]+this._parsedPadding[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:o=0,background:r,minWidth:s,maxWidth:l,shape:a}=t,h={x:0,y:0,text:e,textStyle:i,padding:gn(o),minWidth:s,maxWidth:l};a&&a.visible&&(h.shape=Object.assign({visible:!0},a.style),I(a.space)&&(h.space=a.space)),r&&r.visible&&(h.panel=Object.assign({visible:!0},r.style));const d=new Hr(h);d.name=Ze.title,this._title=d,this._innerView.add(d)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),o=(t=this.attribute.title)===null||t===void 0?void 0:t.align;o==="center"?this._title.setAttribute("x",(e-i)/2):o==="end"&&this._title.setAttribute("x",e-i)}}}function ig(){Ai(),zn(),oo(),Mr()}function ng(){Ai(),Dm()}function pH(){ng(),Eb(),Bm()}function vH(){ng(),ig()}function mH(){ng(),ig(),$B()}var Ib=globalThis&&globalThis.__rest||function(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(i=Object.getOwnPropertySymbols(n);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(n,i[o])&&(e[i[o]]=n[i[o]])}return e};const bH={[Ct.focus]:{},[Ct.selected]:{},[Ct.selectedHover]:{},[Ct.unSelected]:{},[Ct.unSelectedHover]:{}};pH();class _h extends eg{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},_h.defaultAttributes,t)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._contentMaxHeight=0,this._onHover=i=>{const o=i.target;if(o&&o.name&&o.name.startsWith(Ze.item)){const r=o.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===r.id)return;this._unHover(this._lastActiveItem,i)}this._hover(r,i)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,i),this._lastActiveItem=null)},this._onUnHover=i=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,i),this._lastActiveItem=null)},this._onClick=i=>{var o,r,s,l;const a=i.target;if(a&&a.name&&a.name.startsWith(Ze.item)){const h=a.delegate,{selectMode:d="multiple"}=this.attribute;if(a.name===Ze.focus||d==="focus"){const u=h.hasState(Ct.focus);h.toggleState(Ct.focus),u?(o=this._itemsContainer)===null||o===void 0||o.getChildren().forEach(c=>{this._removeLegendItemState(c,[Ct.unSelected,Ct.unSelectedHover,Ct.focus],i),this._setLegendItemState(c,Ct.selected,i)}):(this._setLegendItemState(h,Ct.selected,i),this._removeLegendItemState(h,[Ct.unSelected,Ct.unSelectedHover],i),(r=this._itemsContainer)===null||r===void 0||r.getChildren().forEach(c=>{h!==c&&(this._removeLegendItemState(c,[Ct.selected,Ct.selectedHover,Ct.focus],i),this._setLegendItemState(c,Ct.unSelected,i))}))}else{(s=this._itemsContainer)===null||s===void 0||s.getChildren().forEach(f=>{f.removeState(Ct.focus)});const{allowAllCanceled:u=!0}=this.attribute,c=h.hasState(Ct.selected),g=this._getSelectedLegends();if(d==="multiple"){if(u===!1&&c&&g.length===1)return void this._dispatchLegendEvent(Vi.legendItemClick,h,i);c?(this._removeLegendItemState(h,[Ct.selected,Ct.selectedHover],i),this._setLegendItemState(h,Ct.unSelected,i)):(this._setLegendItemState(h,Ct.selected,i),this._removeLegendItemState(h,[Ct.unSelected,Ct.unSelectedHover],i))}else this._setLegendItemState(h,Ct.selected,i),this._removeLegendItemState(h,[Ct.unSelected,Ct.unSelectedHover],i),(l=this._itemsContainer)===null||l===void 0||l.getChildren().forEach(f=>{h!==f&&(this._removeLegendItemState(f,[Ct.selected,Ct.selectedHover],i),this._setLegendItemState(f,Ct.unSelected,i))})}this._dispatchLegendEvent(Vi.legendItemClick,h,i)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;((e=this._itemsContainer)===null||e===void 0?void 0:e.getChildren()).forEach(i=>{const o=i.data;t.includes(o.label)?(this._setLegendItemState(i,Ct.selected),this._removeLegendItemState(i,[Ct.unSelected,Ct.unSelectedHover])):(this._removeLegendItemState(i,[Ct.selected,Ct.selectedHover]),this._setLegendItemState(i,Ct.unSelected))})}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:o,defaultSelected:r,lazyload:s,autoPage:l}=this.attribute,{spaceCol:a=bh,spaceRow:h=Ch}=t,d=this._itemsContainer,{items:u,isHorizontal:c,startIndex:g,isScrollbar:f}=this._itemContext,p=f?1:c?i:e,v=this._contentMaxHeight;let m,{doWrap:b,maxWidthInCol:w,startX:C,startY:_,pages:y}=this._itemContext,x=0;for(let S=g,A=u.length;S<A&&!(s&&y>this._itemContext.currentPage*p);S++){s&&(this._itemContext.startIndex=S+1),m=u[S],m.id||(m.id=m.label),m.index=S;let R=!0;it(r)&&(R=r.includes(m.label));const T=this._renderEachItem(m,R,S,u),M=T.attribute.width,P=T.attribute.height;this._itemHeight=Math.max(this._itemHeight,P),w=Math.max(M,w),this._itemMaxWidth=Math.max(M,this._itemMaxWidth),c?(I(o)&&(f&&l?(y=Math.ceil((C+M)/o),b=y>1):C+M>o&&(b=!0,C>0&&(y+=1,C=0,_+=P+h))),C===0&&_===0||T.setAttributes({x:C,y:_}),C+=a+M):(I(v)&&(f&&l?(y=Math.ceil((_+P)/v),b=y>1):v<=P?(y+=1,b=!0,_=0,S>0&&(C+=x+a)):v<_+P&&(y+=1,b=!0,_=0,C+=w+a,w=0)),C===0&&_===0||T.setAttributes({x:C,y:_}),_+=h+P),d.add(T),x=M}return this._itemContext.doWrap=b,this._itemContext.startX=C,this._itemContext.startY=_,this._itemContext.maxWidthInCol=w,this._itemContext.pages=y,this._itemContext.maxPages=p,f&&(this._itemContext.totalPage=y),s||(this._itemContext.startIndex=u.length),this._itemContext}_renderContent(){const{item:t={},items:e,reversed:i,maxWidth:o,maxHeight:r}=this.attribute;if(t.visible===!1||Et(e))return;let s=e;i&&(s=e==null?void 0:e.reverse()),this._contentMaxHeight=Math.max(0,r-this._parsedPadding[0]-this._parsedPadding[2]);const l=bt.group({x:0,y:0});this._itemsContainer=l;const{layout:a,autoPage:h}=this.attribute,d=a==="horizontal",{maxWidth:u,width:c,height:g}=t,f=[];I(u)&&f.push(u),I(c)&&f.push(c),f.length&&(I(o)&&f.push(o),this._itemWidthByUser=Pl(f)),I(g)&&(this._itemHeightByUser=g);const p=this.attribute.pager;this._itemContext={currentPage:p&&p.defaultCurrent||1,doWrap:!1,maxWidthInCol:0,maxPages:1,pages:1,startX:0,startY:0,startIndex:0,items:s,isHorizontal:d,totalPage:1/0,isScrollbar:p&&p.type==="scrollbar",clipContainer:void 0},this._itemContext=this._renderItems();let v=!1;this._itemContext.doWrap&&h&&this._itemContext.pages>this._itemContext.maxPages&&(v=this._renderPagerComponent()),v||(l.setAttribute("y",this._title?this._title.AABBBounds.height()+De(this.attribute,"title.space",8):0),this._innerView.add(l))}_bindEvents(){if(this.attribute.disableTriggerEvent||!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;if(t){let i="pointermove",o="pointerleave";$t(t)&&(t.trigger&&(i=t.trigger),t.triggerOff&&(o=t.triggerOff)),this._itemsContainer.addEventListener(i,this._onHover),this._itemsContainer.addEventListener(o,this._onUnHover)}if(e){let i="pointerdown";$t(e)&&e.trigger&&(i=e.trigger),this._itemsContainer.addEventListener(i,this._onClick)}}_autoEllipsis(t,e,i,o){var r,s;const{label:l,value:a}=this.attribute.item,h=o.AABBBounds,d=i.AABBBounds,u=h.width(),c=d.width();let g=!1;t==="labelFirst"?c>e?g=!0:o.setAttribute("maxLineWidth",e-c):t==="valueFirst"?u>e?g=!0:i.setAttribute("maxLineWidth",e-u):u+c>e&&(g=!0),g&&(o.setAttribute("maxLineWidth",Math.max(e*((r=l.widthRatio)!==null&&r!==void 0?r:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*((s=a.widthRatio)!==null&&s!==void 0?s:.5),e-u)))}_renderEachItem(t,e,i,o){var r,s;const{id:l,label:a,value:h,shape:d}=t,{padding:u=0,focus:c,focusIconStyle:g,align:f,autoEllipsisStrategy:p}=this.attribute.item,{shape:v,label:m,value:b,background:w}=this.attribute.item,C=this._handleStyle(v,t,e,i,o),_=this._handleStyle(m,t,e,i,o),y=this._handleStyle(b,t,e,i,o),x=this._handleStyle(w,t,e,i,o),S=gn(u);let A;w.visible===!1?(A=bt.group({x:0,y:0,cursor:(r=x.style)===null||r===void 0?void 0:r.cursor}),this._appendDataToShape(A,Ze.item,t,A)):(A=bt.group(Object.assign({x:0,y:0},x.style)),this._appendDataToShape(A,Ze.item,t,A,x.state)),A.id=`${l??a}-${i}`,A.addState(e?Ct.selected:Ct.unSelected);const R=bt.group({x:0,y:0,pickable:!1});A.add(R);let T,M=0,P=0,k=0;if(v&&v.visible!==!1){const U=De(C,"style.size",mh);P=it(U)?U[0]||0:U,k=De(v,"space",Fb);const Z=bt.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},d),C.style));Object.keys(C.state||{}).forEach(q=>{const j=C.state[q].fill||C.state[q].stroke;d.fill&&ct(C.state[q].fill)&&j&&(C.state[q].fill=j),d.stroke&&ct(C.state[q].stroke)&&j&&(C.state[q].stroke=j)}),this._appendDataToShape(Z,Ze.itemShape,t,A,C.state),Z.addState(e?Ct.selected:Ct.unSelected),R.add(Z)}let B=0;if(c){const U=De(g,"size",mh);T=bt.symbol(Object.assign(Object.assign({x:0,y:-U/2-1,strokeBoundsBuffer:0,boundsPadding:S},g),{visible:!0,pickMode:"imprecise"})),this._appendDataToShape(T,Ze.focus,t,A),B=U}const H=m.formatMethod?m.formatMethod(a,t,i):a,E=Object.assign(Object.assign({x:P/2+k,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(s=_.style)===null||s===void 0?void 0:s.fontSize},_.style),{text:H,_originText:m.formatMethod?a:void 0}),F=Vc(E);this._appendDataToShape(F,Ze.itemLabel,t,A,_.state),F.addState(e?Ct.selected:Ct.unSelected),R.add(F);const L=De(m,"space",kb);if(I(h)){const U=De(b,"space",c?fH:0),Z=b.formatMethod?b.formatMethod(h,t,i):h,q=Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:y.style.fontSize},y.style),{text:Z,_originText:b.formatMethod?h:void 0}),j=Vc(q);if(this._appendDataToShape(j,Ze.itemValue,t,A,y.state),j.addState(e?Ct.selected:Ct.unSelected),this._itemWidthByUser){const rt=this._itemWidthByUser-S[1]-S[3]-P-k-L-B-U;this._autoEllipsis(p,rt,F,j),b.alignRight?j.setAttributes({textAlign:"right",x:this._itemWidthByUser-P/2-S[1]-S[3]-B-U}):j.setAttribute("x",L+(F.AABBBounds.empty()?0:F.AABBBounds.x2))}else j.setAttribute("x",L+(F.AABBBounds.empty()?0:F.AABBBounds.x2));M=U+(j.AABBBounds.empty()?0:j.AABBBounds.x2),R.add(j)}else this._itemWidthByUser&&F.setAttribute("maxLineWidth",this._itemWidthByUser-S[1]-S[3]-P-k-B),M=L+(F.AABBBounds.empty()?0:F.AABBBounds.x2);T&&(T.setAttribute("x",M),R.add(T));const z=R.AABBBounds,D=z.width();if(f==="right"){const U=z.x2,Z=z.x1;R.forEachChildren((q,j)=>{q.type!=="symbol"&&q.attribute.textAlign!=="right"||q===T?q.setAttribute("x",Z+U-q.attribute.x-q.AABBBounds.width()):q.type!=="symbol"?q.setAttributes({x:Z+U-q.attribute.x,textAlign:"left"}):q.setAttribute("x",Z+U-q.attribute.x)})}const N=z.height(),V=I(this.attribute.item.width)?this.attribute.item.width:D+S[1]+S[3],G=this._itemHeightByUser||N+S[0]+S[2];return A.attribute.width=V,A.attribute.height=G,T&&T.setAttribute("visible",!1),R.translateTo(-z.x1+S[3],-z.y1+S[0]),A}_createPager(t){var e,i;const{disableTriggerEvent:o,maxRow:r}=this.attribute,s=l=>l<=99?99:l<=999?999:9999;return this._itemContext.isHorizontal?new Us(Object.assign(Object.assign({layout:r===1?"horizontal":"vertical",total:s(this._itemContext.pages)},dt({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:(e=this.attribute.pager)===null||e===void 0?void 0:e.defaultCurrent,disableTriggerEvent:o})):new Us(Object.assign({layout:"horizontal",total:s(this._itemContext.pages),disableTriggerEvent:o,defaultCurrent:(i=this.attribute.pager)===null||i===void 0?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new Fo(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:t.visible===!1?0:12},t),{width:e})):new Fo(Object.assign(Object.assign({direction:"vertical",width:t.visible===!1?0:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i){const{pager:o}=this.attribute,{totalPage:r,isHorizontal:s}=this._itemContext,l=o&&o.position||"middle";if(this._pagerComponent.setTotal(r),s){let a;a=l==="start"?t:l==="end"?t+i-this._pagerComponent.AABBBounds.height()/2:t+i/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:e-this._pagerComponent.AABBBounds.width(),y:a})}else{let a;a=l==="start"?0:l==="end"?e-this._pagerComponent.AABBBounds.width():(e-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:a,y:i-this._pagerComponent.AABBBounds.height()})}}_computeScrollbarDelta(){const{isHorizontal:t,clipContainer:e}=this._itemContext,i=this._itemsContainer.AABBBounds,o=e.AABBBounds;let r,s;return t?(s=o.width(),r=s/i.width()):(s=o.height(),r=s/i.height()),r}_updatePositionOfScrollbar(t,e,i){const{isHorizontal:o,currentPage:r,totalPage:s}=this._itemContext,l=(r-1)/s;this._pagerComponent.setScrollRange([l,l+this._computeScrollbarDelta()]),o?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:o=!0,animationDuration:r=450,animationEasing:s="quadIn"}=i,l=this._itemContext.isScrollbar?d=>{const{value:u}=d.detail;let c;return c=u[0]===0?1:u[1]===1?this._itemContext.totalPage:u[0]*this._itemContext.totalPage+1,c}:d=>d.detail.current,a=d=>{const u=this._pagerComponent,c=u.getScrollRange(),{direction:g}=u.attribute,{width:f,height:p}=u.getSliderRenderBounds(),v=g==="vertical"?d.deltaY/p:d.deltaX/f;u.setScrollRange([c[0]+v,c[1]+v],!0),this.updateScrollMask()},h=d=>{const u=l(d);if(u!==this._itemContext.currentPage){if(this._itemContext.currentPage=u,this._itemContext&&this._itemContext.startIndex<this._itemContext.items.length){this._renderItems();const c=Math.ceil(this._itemContext.pages/this._itemContext.maxPages);if(this._itemContext.totalPage=c,this._itemContext.isScrollbar&&this._pagerComponent){const g=this._computeScrollbarDelta(),[f]=this._pagerComponent.getScrollRange();this._pagerComponent.setScrollRange([f,f+g])}}if(this._itemContext.isScrollbar){const[c]=this._pagerComponent.getScrollRange();let g;g=this._itemContext.isHorizontal?this._itemsContainer.AABBBounds.width():this._itemsContainer.AABBBounds.height();const f=g*c;this.updateScrollMask(),o?this._itemsContainer.animate().to({[e]:-f},r,s):this._itemsContainer.setAttribute(e,-f)}else o?this._itemsContainer.animate().to({[e]:-(u-1)*t},r,s):this._itemsContainer.setAttribute(e,-(u-1)*t)}};this._itemContext.isScrollbar?(this._pagerComponent.addEventListener("scrollDrag",h),this._pagerComponent.addEventListener("scrollUp",h),this.attribute.pager.roamScroll&&(this.addEventListener("wheel",u=>u.nativeEvent.preventDefault()),this.addEventListener("wheel",Wf(a,50)))):(this._pagerComponent.addEventListener("toPrev",h),this._pagerComponent.addEventListener("toNext",h))}_renderPager(){const t=this._title?this._title.AABBBounds.height()+De(this.attribute,"title.space",8):0,{maxWidth:e,maxCol:i=1,maxRow:o=2,item:r={},pager:s={}}=this.attribute,{spaceCol:l=bh,spaceRow:a=Ch}=r,h=this._itemsContainer,{space:d=tg,defaultCurrent:u=1}=s,c=Ib(s,["space","defaultCurrent"]),{isHorizontal:g}=this._itemContext,f=this._contentMaxHeight;let p,v=0,m=0,b=0,w=0,C=0,_=0,y=1;if(g){if(m=(o-1)*a+this._itemHeight*o,v=e,p=this._createPager(c),this._pagerComponent=p,this._innerView.add(p),b=e-p.AABBBounds.width()-d,b<=0)return this._innerView.removeChild(p),!1;h.getChildren().forEach((A,R)=>{const{width:T,height:M}=A.attribute;b<C+T&&(C=0,_+=M+a,y+=1),R>0&&A.setAttributes({x:C,y:_}),C+=l+T}),this._itemContext.startX=C,this._itemContext.startY=_,this._itemContext.pages=y;const S=Math.ceil(y/o);this._itemContext.totalPage=S,this._updatePositionOfPager(t,v,m)}else{if(v=this._itemMaxWidth*i+(i-1)*l,m=f,b=v,p=this._createPager(c),this._pagerComponent=p,this._innerView.add(p),w=f-p.AABBBounds.height()-d-t,w<=0)return this._innerView.removeChild(p),!1;h.getChildren().forEach((A,R)=>{const{height:T}=A.attribute;w<_+T&&(_=0,C+=this._itemMaxWidth+l,y+=1),R>0&&A.setAttributes({x:C,y:_}),_+=a+T});const S=Math.ceil(y/i);this._itemContext.totalPage=S,this._updatePositionOfPager(t,v,m)}u>1&&(g?h.setAttribute("y",-(u-1)*(m+a)):h.setAttribute("x",-(u-1)*(v+l)));const x=bt.group({x:0,y:t,width:g?b:v,height:g?m:w,clip:!0,pickable:!1});return x.add(h),this._innerView.add(x),this._itemContext.clipContainer=x,this._bindEventsOfPager(g?m+a:v+l,g?"y":"x"),!0}_renderScrollbar(){var t;const e=this._title?this._title.AABBBounds.height()+De(this.attribute,"title.space",8):0,{maxWidth:i,item:o={},pager:r={}}=this.attribute,{spaceCol:s=bh,spaceRow:l=Ch}=o,a=this._itemsContainer,{space:h=tg,defaultCurrent:d=1}=r,u=Ib(r,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext,g=this._contentMaxHeight;let f,p=0,v=0,m=0,b=1;if(c)p=i,v=this._itemHeight,f=this._createScrollbar(u,p),this._pagerComponent=f,this._innerView.add(f);else{if(v=g-e,p=this._itemMaxWidth,f=this._createScrollbar(u,v),this._pagerComponent=f,this._innerView.add(f),v<=0)return this._innerView.removeChild(f),!1;const C=a.getChildren(),_=C.map(y=>y.attribute.height);if(_.length===1||_.every(y=>y===_[0])){const y=_[0],x=v,S=Math.floor(x/(l+y));v=S*(l+y),b=Math.ceil(C.length/S)}else C.forEach((y,x)=>{const{height:S}=y.attribute,A=b,R=m;b=Math.floor((m+S)/v)+1,m+=l+S,A!==b&&x===a.getChildren().length-1&&m-v>=1/3*S&&(v=R+S,b-=1)});this._itemContext.totalPage=b,this._itemContext.pages=b}if(d>1)if(c){const C=this._itemsContainer.AABBBounds.width()-p;a.setAttribute("x",-Math.min((d-1)*(p+s),C))}else{const C=this._itemsContainer.AABBBounds.height()-v;a.setAttribute("y",-Math.min((d-1)*(v+l),C))}const w=bt.group({x:0,y:e,width:p,height:v,clip:!0,pickable:!1});return w.add(a),this._innerView.add(w),this._itemContext.clipContainer=w,this._updatePositionOfScrollbar(p,v,e),!((t=r.scrollMask)===null||t===void 0)&&t.visible&&this.renderScrollMask(w),this._bindEventsOfPager(c?p:v,c?"x":"y"),!0}renderScrollMask(t){const{scrollMask:e={}}=this.attribute.pager,{visible:i=!0,gradientLength:o=16,gradientStops:r}=e;if(!i||!r)return;const s=t.AABBBounds.width(),l=t.AABBBounds.height(),a=this._itemContext.isHorizontal?s:l,h=r.map(c=>({offset:o*c.offset/a,color:c.color})),d=r.map(c=>({offset:(a-o*c.offset)/a,color:c.color})),u=bt.rect({x:0,y:0,width:s,height:l});this._scrollMask=u,this._scrollMaskContext={startStops:h,endStops:d},this.updateScrollMask(),t.add(u)}updateScrollMask(){if(!this._scrollMask||!this._pagerComponent||!this._itemContext.isScrollbar)return;const[t,e]=this._pagerComponent.getScrollRange(),i=[];qi(bi(e,0,1),1)||i.push(...this._scrollMaskContext.endStops),qi(bi(t,0,1),0)||i.push(...this._scrollMaskContext.startStops),i.length&&(this._itemContext.isHorizontal?this._scrollMask.setAttributes({fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:i}}):this._scrollMask.setAttributes({fill:{gradient:"linear",x0:0,y0:0,x1:0,y1:1,stops:i}}))}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(Ct.selected)?this._setLegendItemState(t,Ct.selectedHover,e):this._setLegendItemState(t,Ct.unSelectedHover,e);const i=t.getChildren()[0].find(o=>o.name===Ze.focus,!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(Vi.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(Ct.unSelectedHover)||t.hasState(Ct.selectedHover))&&(i=!0),t.removeState(Ct.unSelectedHover),t.removeState(Ct.selectedHover),t.getChildren()[0].getChildren().forEach(r=>{i||!r.hasState(Ct.unSelectedHover)&&!r.hasState(Ct.selectedHover)||(i=!0),r.removeState(Ct.unSelectedHover),r.removeState(Ct.selectedHover)});const o=t.getChildren()[0].find(r=>r.name===Ze.focus,!1);o&&o.setAttribute("visible",!1),i&&this._dispatchLegendEvent(Vi.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(Vi.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let o=!1;t.hasState(e)||(o=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach(r=>{r.name!==Ze.focus&&(o||r.hasState(e)||(o=!0),r.addState(e,!0))}),o&&this._dispatchLegendEvent(Vi.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let o=!1;e.forEach(r=>{!o&&t.hasState(r)&&(o=!0),t.removeState(r)}),t.getChildren()[0].getChildren().forEach(r=>{r.name!==Ze.focus&&e.forEach(s=>{!o&&r.hasState(s)&&(o=!0),r.removeState(s)})}),o&&this._dispatchLegendEvent(Vi.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return(t=this._itemsContainer)===null||t===void 0||t.getChildren().forEach(i=>{i.hasState(Ct.selected)&&e.push(i.data)}),e}_appendDataToShape(t,e,i,o,r={}){t.name=e,t.data=i,t.delegate=o,t.states=dt({},bH,r)}_dispatchLegendEvent(t,e,i){const o=this._getSelectedLegends();o.sort((s,l)=>s.index-l.index);const r=o.map(s=>s.label);this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(Ct.selected),currentSelectedItems:o,currentSelected:r,event:i})}_handleStyle(t,e,i,o,r){const s={};return t.style&&(jt(t.style)?s.style=t.style(e,i,o,r):s.style=t.style),t.state&&(s.state={},Object.keys(t.state).forEach(l=>{t.state[l]&&(jt(t.state[l])?s.state[l]=t.state[l](e,i,o,r):s.state[l]=t.state[l])})),s}release(){super.release(),this.removeAllEventListeners()}}_h.defaultAttributes={layout:"horizontal",title:{align:"start",space:Ks,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:bh,spaceRow:Ch,shape:{space:Fb,style:{size:mh,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:kb,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:mh,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:tg,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};var Je;(function(n){n.innerView="innerView",n.railContainer="sliderRailContainer",n.rail="sliderRail",n.startText="sliderStartText",n.endText="sliderEndText",n.startHandler="sliderStartHandler",n.startHandlerText="startHandlerText",n.endHandler="sliderEndHandler",n.endHandlerText="sliderEndHandlerText",n.track="sliderTrack",n.trackContainer="sliderTrackContainer"})(Je||(Je={}));function og(n){return it(n)?n:[n,n]}function yh(n){return n?"ew-resize":"ns-resize"}ig();class $s extends Ni{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},$s.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=i=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(i),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=i=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const o=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),r=bi(this._isHorizontal?(i.viewX-this._rail.globalAABBBounds.x1)/o:(i.viewY-this._rail.globalAABBBounds.y1)/o,0,1);r!==this._tooltipState.pos&&(this._tooltipState.pos=r,this._tooltipState.value=this.calculateValueByPos(r*o),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:i}=this.attribute;i&&i.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=i=>{i.stopPropagation(),this._isChanging=!0;const{x:o,y:r}=this.stage.eventPointTransform(i);this._currentHandler=i.target,this._prePos=this._isHorizontal?o:r,Ce.env==="browser"?(Ce.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Ce.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=i=>{var o,r;i.stopPropagation(),this._isChanging=!0;const{railWidth:s,railHeight:l,min:a,max:h}=this.attribute;if(h===a)return;const{x:d,y:u}=this.stage.eventPointTransform(i);let c,g,f,p=0;this._isHorizontal?(c=d,p=c-this._prePos,g=(r=this._currentHandler)===null||r===void 0?void 0:r.attribute.x,f=s):(c=u,p=c-this._prePos,g=(o=this._currentHandler)===null||o===void 0?void 0:o.attribute.y,f=l);const v=bi(g+p,0,f),m=this.calculateValueByPos(v);this._currentHandler.type==="text"?this._updateHandlerText(this._currentHandler,v,m):this._updateHandler(this._currentHandler,v,m),this._updateTrack(),this._prePos=c,this._dispatchChangeEvent()},this._onHandlerPointerUp=i=>{i.preventDefault(),this._isChanging=!1,this._currentHandler=null,Ce.env==="browser"?(Ce.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Ce.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=i=>{i.stopPropagation(),this._isChanging=!0;const{x:o,y:r}=this.stage.eventPointTransform(i);this._prePos=this._isHorizontal?o:r,Ce.env==="browser"?(Ce.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),Ce.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=i=>{i.stopPropagation(),this._isChanging=!0;const{railWidth:o,railHeight:r,min:s,max:l,inverse:a}=this.attribute;if(l===s)return;const{startHandler:h,endHandler:d}=this._getHandlers();let u,c,g;const{x:f,y:p}=this.stage.eventPointTransform(i);this._isHorizontal?(u=f,c=this._track.attribute.width,g=o):(u=p,c=this._track.attribute.height,g=r);const v=u-this._prePos;if(h){const m=this._isHorizontal?h.attribute.x:h.attribute.y,b=a?bi(m+v,c,g):bi(m+v,0,g-c),w=this.calculateValueByPos(b);this._updateHandler(h,b,w)}if(d){const m=this._isHorizontal?d.attribute.x:d.attribute.y,b=a?bi(m+v,0,g-c):bi(m+v,c,g),w=this.calculateValueByPos(b),C=h==null?void 0:h.attribute;this._updateHandler(d,b,w),this._track.setAttributes(this._isHorizontal?{x:Math.min(C.x,d.attribute.x),width:Math.abs(C.x-d.attribute.x)}:{y:Math.min(C.y,d.attribute.y),height:Math.abs(C.y-d.attribute.y)})}this._prePos=u,this._dispatchChangeEvent()},this._onTrackPointerUp=i=>{i.preventDefault(),this._isChanging=!1,Ce.env==="browser"?(Ce.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),Ce.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=i=>{i.stopPropagation(),this._isChanging=!0;const{railWidth:o,railHeight:r,min:s,max:l}=this.attribute;if(l===s)return;const a=this._startHandler,h=this._endHandler;let d,u,c;this._isHorizontal?(d=i.viewX-this._rail.globalAABBBounds.x1,u=a==null?void 0:a.attribute.x,c=h==null?void 0:h.attribute.x):(d=i.viewY-this._rail.globalAABBBounds.y1,u=a==null?void 0:a.attribute.y,c=h==null?void 0:h.attribute.y);const g=this.calculateValueByPos(d);if(I(c)){const f=Math.abs(d-u)>Math.abs(d-c)?h:a;this._updateHandler(f,d,g)}else this._updateHandler(a,d,g);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:o,railHeight:r,min:s,max:l,inverse:a}=this.attribute;let h=0;return h=s===l?e==="start"?0:e==="end"?1:0:(t-s)/(l-s),(a?1-h:h)*(i==="vertical"?r:o)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:o,min:r,max:s,inverse:l}=this.attribute,a=e==="vertical"?o:i;return r+(s-r)*(l?1-t/a:t/a)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[o,r]=Ud(t),{startHandler:s,endHandler:l}=this._getHandlers();s&&this._updateHandler(s,this.calculatePosByValue(o),o),l&&this._updateHandler(l,this.calculatePosByValue(r),r),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:o,railHeight:r,startText:s,endText:l,min:a,max:h,showHandler:d=!0,showTooltip:u}=this.attribute;let{value:c}=this.attribute;ct(c)&&(c=[a,h]),this._currentValue={startValue:og(c)[0],endValue:og(c)[1]};const g=i==="horizontal";this._isHorizontal=g;const f=bt.group({x:0,y:0});f.name=Je.innerView,this.add(f),this._innerView=f;let p,v=0;if(s&&s.visible){p=bt.text(Object.assign({x:g?0:o/2,y:g?r/2:0,textAlign:g?"start":"center",textBaseline:g?"middle":"top",text:s.text,lineHeight:(t=s.style)===null||t===void 0?void 0:t.fontSize},s.style)),p.name=Je.startText,f.add(p);const C=I(s.space)?s.space:0;v+=(g?p.AABBBounds.width():p.AABBBounds.height())+C}const m=bt.group({x:g?v:0,y:g?0:v});f.add(m);const b=bt.group({x:0,y:0});let w;if(b.name=Je.railContainer,this._railContainer=b,m.add(b),this._mainContainer=m,this._renderRail(b),v+=g?o:r,l&&l.visible){const C=I(l.space)?l.space:0;w=bt.text(Object.assign({x:g?v+C:o/2,y:g?r/2:v+C,textAlign:g?"start":"center",textBaseline:g?"middle":"top",text:l.text,lineHeight:(e=l.style)===null||e===void 0?void 0:e.fontSize},l.style)),w.name=Je.endText,f.add(w)}this._renderTrack(b),d&&(this._renderHandlers(m),this._bindEvents()),u&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:o,slidable:r}=this.attribute;let s="default";r!==!1&&(s="pointer");const l=bt.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:s},o));return l.name=Je.rail,t.add(l),this._rail=l,l}_renderHandlers(t){const{range:e,min:i,max:o,handlerSize:r=14,handlerStyle:s,handlerText:l,railHeight:a,railWidth:h,slidable:d}=this.attribute;let{value:u}=this.attribute;ct(u)&&(u=[i,o]);const c=l&&l.visible,g=this._isHorizontal,[f,p]=og(u),v=this.calculatePosByValue(f,e?"start":"end"),m=this._renderHandler(Object.assign({x:g?v:h/2,y:g?a/2:v,size:r,strokeBoundsBuffer:0,cursor:d===!1?"default":yh(g)},s));if(m.name=Je.startHandler,this._startHandler=m,t.add(m),this._currentValue.startPos=v,c){const b=this._renderHandlerText(f,e?"start":"end");b.name=Je.startHandlerText,t.add(b),this._startHandlerText=b}if(e){const b=this.calculatePosByValue(p,"end"),w=this._renderHandler(Object.assign({x:g?b:h/2,y:g?a/2:b,size:r,strokeBoundsBuffer:0,cursor:d===!1?"default":yh(g)},s));if(w.name=Je.endHandler,this._endHandler=w,t.add(w),this._currentValue.endPos=b,c){const C=this._renderHandlerText(p,"end");C.name=Je.endHandlerText,t.add(C),this._endHandlerText=C}}}_renderTrack(t){const{range:e,min:i,max:o,railHeight:r,railWidth:s,trackStyle:l,railStyle:a,slidable:h,value:d}=this.attribute;let u,c;if(ct(d))e?(u=i,c=o):u=c=i;else if(e){const C=wo(d,i,o);u=C[0],c=C[1]}else u=i,c=bi(d,i,o);const g=this._isHorizontal;e||(u=i);const f=bt.group({x:0,y:0,width:s,height:r,cornerRadius:a==null?void 0:a.cornerRadius,clip:!0,pickable:!1});f.name=Je.trackContainer;const p=$t(e)&&e.draggableTrack===!0;let v;v=h===!1?"default":e===!1||p===!1?"pointer":yh(g);const m=this.calculatePosByValue(u,"start"),b=this.calculatePosByValue(c,e?"end":"start"),w=bt.rect(Object.assign({x:g?Math.min(m,b):0,y:g?0:Math.min(m,b),width:g?Math.abs(b-m):s,height:g?r:Math.abs(b-m),cursor:v},l));w.name=Je.track,this._track=w,f.add(w),t.add(f)}_renderHandler(t){return bt.symbol(t)}_renderHandlerText(t,e){var i,o,r;const{align:s,handlerSize:l=14,handlerText:a={},railHeight:h,railWidth:d,slidable:u}=this.attribute,c=this._isHorizontal,g=this.calculatePosByValue(t,e),f=(i=a.space)!==null&&i!==void 0?i:4,p={text:a.formatter?a.formatter(t):t.toFixed((o=a.precision)!==null&&o!==void 0?o:0),lineHeight:(r=a.style)===null||r===void 0?void 0:r.lineHeight,cursor:u===!1?"default":yh(c)};return c?s==="top"?(p.textBaseline="bottom",p.textAlign="center",p.x=g,p.y=(h-l)/2-f):(p.textBaseline="top",p.textAlign="center",p.x=g,p.y=(h+l)/2+f):s==="left"?(p.textBaseline="middle",p.textAlign="end",p.x=(d-l)/2-f,p.y=g):(p.textBaseline="middle",p.textAlign="start",p.x=(d+l)/2+f,p.y=g),bt.text(Object.assign(Object.assign({},p),a.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:o,align:r}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const s=this._isHorizontal?0:o/2,l=this._isHorizontal?i/2:0;if(e&&e.shape){const c=bt.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:s,y:l,symbolType:"circle"},e.shapeStyle));this._tooltipShape=c,this._mainContainer.add(c)}const a=e&&e.text||{},h=(t=a.space)!==null&&t!==void 0?t:6,d={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(d.x=s,d.y=r==="top"?l-i/2-h:l+i/2+h,d.textAlign="center",d.textBaseline=r==="top"?"bottom":"top"):(d.y=l,d.x=r==="left"?s-o/2-h:l+o/2+h,d.textAlign=r==="left"?"end":"start",d.textBaseline="middle");const u=bt.text(Object.assign(Object.assign({},d),a.style));this._mainContainer.add(u),this._tooltipText=u,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:o}=this.attribute,r=this._isHorizontal?i:o,s=this._tooltipState.pos*r,l=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[l]:s});const{align:a}=this.attribute;if(this._tooltipText){const h=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[l]:s,text:h.formatter?h.formatter(this._tooltipState.value):this._isHorizontal||a!=="left"?`≈ ${this._tooltipState.value.toFixed((e=h.precision)!==null&&e!==void 0?e:0)}`:`${this._tooltipState.value.toFixed((t=h.precision)!==null&&t!==void 0?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),$t(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,o=this._startHandler,r=this._endHandler;if(this._isHorizontal){const s=o==null?void 0:o.attribute.x;if(r){const l=r==null?void 0:r.attribute.x;this._track.setAttributes({x:Math.min(s,l),width:Math.abs(s-l)})}else t?this._track.setAttributes({x:s,width:e-s}):this._track.setAttributes({width:s})}else{const s=o==null?void 0:o.attribute.y;if(r){const l=r==null?void 0:r.attribute.y;this._track.setAttributes({y:Math.min(s,l),height:Math.abs(s-l)})}else t?this._track.setAttributes({y:s,height:i-s}):this._track.setAttributes({height:s})}}_updateHandler(t,e,i){var o;const r=this._isHorizontal;t.setAttribute(r?"x":"y",e);const s=t.name===Je.startHandler?this._startHandlerText:this._endHandlerText;if(s){const{handlerText:l={}}=this.attribute;s.setAttributes({text:l.formatter?l.formatter(i):i.toFixed((o=l.precision)!==null&&o!==void 0?o:0),[r?"x":"y"]:e})}t.name===Je.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var o;const r=this._isHorizontal,{handlerText:s={}}=this.attribute;t.setAttributes({[r?"x":"y"]:e,text:s.formatter?s.formatter(i):i.toFixed((o=s.precision)!==null&&o!==void 0?o:0)});const l=t.name===Je.startHandlerText?this._startHandler:this._endHandler;l&&l.setAttributes({[r?"x":"y"]:e}),t.name===Je.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(e==null?void 0:e.attribute.x)||t&&i.attribute.x>(e==null?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(e==null?void 0:e.attribute.y)||t&&i.attribute.y>(e==null?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}$s.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},vH();class wh extends eg{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},wh.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=i=>{const o=this._slider.tooltipShape;if(o&&i.detail&&!ct(i.detail.value)){const r=this._colorScale.scale(i.detail.value);o.setAttribute("fill",r)}this.dispatchEvent(i)},this._onSliderChange=i=>{this._updateColor(),this.dispatchEvent(i)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:o,min:r,max:s,value:l,railWidth:a,railHeight:h,showHandler:d=!0,handlerSize:u,handlerStyle:c,railStyle:g,trackStyle:f,startText:p,endText:v,handlerText:m,showTooltip:b,tooltip:w,inverse:C,disableTriggerEvent:_}=this.attribute,y=[],x=(s-r)/(t.length-1);for(let A=0;A<t.length;A++)y.push(r+x*A);this._colorScale=new ko().domain(y,!0).range(t),this._color=this._getTrackColor();const S=new $s({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:i,align:o,min:r,max:s,value:l,railWidth:a,railHeight:h,showHandler:d,handlerSize:u,handlerStyle:c,railStyle:g,trackStyle:Object.assign({fill:this._color},f),startText:p,endText:v,handlerText:m,showTooltip:b,tooltip:w,disableTriggerEvent:_,inverse:C});this._innerView.add(S),this._slider=S,S.translateTo(0-S.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+De(this.attribute,"title.space",Ks):0)-S.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}_getTrackColor(){const{colors:t,layout:e,inverse:i}=this.attribute;if(Et(t))return;const o=t.length;if(o===1)return t[0];const r=[];for(let a=0;a<o;a++){const h=a/(o-1);r.push({offset:h,color:t[a]})}const s=e==="horizontal",l={gradient:"linear",stops:r,x0:0,y0:0,x1:s?1:0,y1:s?0:1};return i&&(s?(l.x0=1,l.x1=0):(l.y0=1,l.y1=0)),l}_updateColor(){var t;const{layout:e="horizontal",colors:i,railWidth:o,railHeight:r}=this.attribute,{startHandler:s,endHandler:l,track:a,attribute:h}=this._slider,{startValue:d,endValue:u,startPos:c,endPos:g}=this._slider.currentValue,f=(t=h.handlerStyle)===null||t===void 0?void 0:t.fill;if(s&&!f){const v=this._colorScale.scale(d);s.setAttribute("fill",v)}if(l&&!f){const v=this._colorScale.scale(u);l.setAttribute("fill",v)}const p=e==="horizontal"?o:r;if(Math.abs(c-g)!==p&&i&&i.length>1){const v=this._color.stops,m=Math.min(c,g),b=Math.max(c,g),w=m/p,C=b/p,_=C-w,y=v.filter(M=>M.offset>w&&M.offset<C),x=Math.min(d,u),S=Math.max(d,u),A=this._colorScale.scale(x),R=this._colorScale.scale(S),T=[{offset:0,color:A}];y.forEach(M=>{T.push({offset:(M.offset-w)/_,color:M.color})}),T.push({offset:1,color:R}),a.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:T}))}}}wh.defaultAttributes={layout:"horizontal",title:{align:"start",space:Ks,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}};function CH(n="bottom"){let t=0;return n==="top"?`
|
|
7
|
+
M${t},-6L${t-3.5},-2.5
|
|
8
|
+
v5
|
|
9
|
+
h7
|
|
10
|
+
v-5
|
|
11
|
+
Z
|
|
12
|
+
`:n==="left"?(t=1,`
|
|
13
|
+
M${t-6},0L${t-6+2.5},-3.5
|
|
14
|
+
h5
|
|
15
|
+
v7
|
|
16
|
+
h-5
|
|
17
|
+
Z
|
|
18
|
+
`):n==="right"?(t=-1,`
|
|
19
|
+
M${t+6},0L${t+6-2.5},-3.5
|
|
20
|
+
h-5
|
|
21
|
+
v7
|
|
22
|
+
h5
|
|
23
|
+
Z
|
|
24
|
+
`):`
|
|
25
|
+
M${t},6L${t-3.5},2.5
|
|
26
|
+
v-5
|
|
27
|
+
h7
|
|
28
|
+
v5
|
|
29
|
+
Z
|
|
30
|
+
`}mH();class Sh extends eg{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Sh.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=i=>{this.dispatchEvent(i)},this._onSliderToolipChange=i=>{this.dispatchEvent(i)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:o,max:r,value:s,railWidth:l,railHeight:a,showHandler:h=!0,handlerSize:d,handlerStyle:u,railStyle:c,trackStyle:g,startText:f,endText:p,handlerText:v,showTooltip:m,tooltip:b,sizeBackground:w,disableTriggerEvent:C,inverse:_}=this.attribute,y=bt.group({x:0,y:0});this._innerView.add(y);const x=new $s({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:o,max:r,value:s,railWidth:l,railHeight:a,showHandler:h,handlerSize:d,handlerStyle:Object.assign({symbolType:CH(i)},u),railStyle:c,trackStyle:g,startText:f,endText:p,handlerText:v,showTooltip:m,tooltip:b,disableTriggerEvent:C,inverse:_});y.add(x);let S,A=0;e==="horizontal"?i==="top"?(S=`M0,0L${l},0L${_?0:l},12Z`,A=a):(S=`M0,12L${l},12L${_?0:l},0Z`,x.setAttribute("y",12)):i==="left"?S=`M${l},0L${l+12},${_?0:a}L${l},${a}Z`:(S=`M0,${_?0:a}L12,${a}L12,0Z`,x.setAttribute("x",12));const R=bt.path(Object.assign(Object.assign({x:0,y:A,path:S},w),{zIndex:0}));y.add(R);const T=this._title?this._title.AABBBounds.height()+De(this.attribute,"title.space",Ks):0;y.translate(0-y.AABBBounds.x1,T-y.AABBBounds.y1),this._slider=x}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}Sh.defaultAttributes={layout:"horizontal",title:{align:"start",space:Ks,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};function _H(){Ai(),zn(),oh()}_H();let zb=class c1 extends Ni{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},c1.defaultAttributes,t)),this.name="title"}render(){var t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b;const{textType:w,text:C,subtextType:_,textStyle:y={},subtext:x,subtextStyle:S={},width:A,height:R,minWidth:T,maxWidth:M,minHeight:P,maxHeight:k,align:B,verticalAlign:H,padding:E=0}=this.attribute,F=gn(E),L=this.createOrUpdateChild("title-container",{x:F[3],y:F[0],zIndex:1},"group");if(this.attribute.visible!==!1&&y.visible!==!1){const{width:Z,height:q,maxHeight:j,maxWidth:rt,x:ht=0,y:gt=0,ellipsis:vt=!0,wordBreak:W="break-word",maxWidth:O,lineClamp:Y}=y;if(w==="rich"||I(y.character)){const $=Object.assign({x:ht,y:gt,width:(t=Z??A)!==null&&t!==void 0?t:0,height:(e=q??R)!==null&&e!==void 0?e:0,ellipsis:vt==null||vt,wordBreak:W??"break-word",maxHeight:j??k,maxWidth:rt??O,textConfig:(i=y.character)!==null&&i!==void 0?i:C},y);this._mainTitle=L.createOrUpdateChild("mainTitle",$,"richtext")}else if(w==="html"){const $=Object.assign({html:Object.assign(Object.assign({dom:C},Hm),y),x:ht,y:gt,width:(o=Z??A)!==null&&o!==void 0?o:0,height:(r=q??R)!==null&&r!==void 0?r:0,ellipsis:vt,wordBreak:W,maxHeight:j??k,maxWidth:rt??O,textConfig:[]},y);this._mainTitle=L.createOrUpdateChild("mainTitle",$,"richtext")}else I(C)&&(this._mainTitle=L.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:it(C)?C:[C],whiteSpace:"normal"},y),{maxLineWidth:(l=(s=y.maxLineWidth)!==null&&s!==void 0?s:Z)!==null&&l!==void 0?l:A,heightLimit:q??k,lineClamp:Y,ellipsis:vt,x:ht,y:gt}),"text"))}const z=this._mainTitle?this._mainTitle.AABBBounds.height():0,D=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(this.attribute.visible!==!1&&S.visible!==!1){const{width:Z,height:q,maxWidth:j,maxHeight:rt,x:ht=0,y:gt=0,ellipsis:vt=!0,wordBreak:W="break-word",lineClamp:O}=S,Y=Math.max(Number.MIN_VALUE,k-z);if(_==="rich"||I(S.character)){const $=Object.assign({x:ht,y:gt,width:(a=Z??A)!==null&&a!==void 0?a:0,height:(h=q??R)!==null&&h!==void 0?h:0,ellipsis:vt,wordBreak:W,maxHeight:rt??Y,maxWidth:j??M,textConfig:(d=S.character)!==null&&d!==void 0?d:x},S);this._subTitle=L.createOrUpdateChild("subTitle",$,"richtext")}else if(_==="html"){const $=Object.assign({html:Object.assign(Object.assign({dom:x},Hm),S),x:ht,y:gt,width:(u=Z??A)!==null&&u!==void 0?u:0,height:(c=q??R)!==null&&c!==void 0?c:0,ellipsis:vt,wordBreak:W,maxHeight:rt??Y,maxWidth:j??M,textConfig:[]},S);this._subTitle=L.createOrUpdateChild("subTitle",$,"richtext")}else I(x)&&(this._subTitle=L.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:it(x)?x:[x],whiteSpace:"normal"},S),{maxLineWidth:(g=S.maxLineWidth)!==null&&g!==void 0?g:A,heightLimit:(f=S.heightLimit)!==null&&f!==void 0?f:Y,lineClamp:O,ellipsis:vt,x:0,y:z}),"text"))}const N=this._subTitle?this._subTitle.AABBBounds.height():0,V=this._subTitle?this._subTitle.AABBBounds.width():0;let G=Math.max(D,V),U=z+((p=S.height)!==null&&p!==void 0?p:N);if(I(A)&&(G=A),I(R)&&(U=R),I(T)&&G<T&&(G=T),I(M)&&G>M&&(G=M),I(P)&&U<P&&(U=P),I(k)&&U>k&&(U=k),L.attribute.width=G,L.attribute.height=U,L.attribute.boundsPadding=F,this._mainTitle){if(I(B)||I(y.align)){const Z=y.align?y.align:B,q=(v=y.width)!==null&&v!==void 0?v:D;Z==="left"?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):Z==="center"?(this._mainTitle.setAttribute("x",q/2),this._mainTitle.setAttribute("textAlign","center")):Z==="right"&&(this._mainTitle.setAttribute("x",q),this._mainTitle.setAttribute("textAlign","right"))}if(I(H)||I(y.verticalAlign)){const Z=y.verticalAlign?y.verticalAlign:H,q=y.height?y.height:U;Z==="top"?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):Z==="middle"?(this._mainTitle.setAttribute("y",q/2),this._mainTitle.setAttribute("textBaseline","middle")):Z==="bottom"&&(this._mainTitle.setAttribute("y",q),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(I(B)||I(S.align)){const Z=S.align?S.align:B,q=(m=S.width)!==null&&m!==void 0?m:V;Z==="left"?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):Z==="center"?(this._subTitle.setAttribute("x",q/2),this._subTitle.setAttribute("textAlign","center")):Z==="right"&&(this._subTitle.setAttribute("x",q),this._subTitle.setAttribute("textAlign","right"))}if(I(H)||I(y.verticalAlign)){const Z=S.verticalAlign?S.verticalAlign:H,q=z,j=(b=S.height)!==null&&b!==void 0?b:0;Z==="top"?(this._subTitle.setAttribute("y",q),this._subTitle.setAttribute("textBaseline","top")):Z==="middle"?(this._subTitle.setAttribute("y",q+j/2),this._subTitle.setAttribute("textBaseline","middle")):Z==="bottom"&&(this._subTitle.setAttribute("y",q+j),this._subTitle.setAttribute("textBaseline","bottom"))}}}};zb.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};function yH(){Ai(),oo(),zn(),Ja()}const wH='<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',SH='<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>';yH();class kr extends Ni{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},kr.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(i,o,r)=>{"interactive"in i&&this.setAttribute("pickable",i.interactive),"disabled"in i&&this.setAttribute("cursor",i.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new lc(dt({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t?this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}):this.attribute.disabled&&this._box.setAttributes({fill:this.attribute.box.disableFill}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new Eo(dt({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Eo(dt({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new fe(dt({wrap:!0},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,i=this._text.AABBBounds.height(),o=Math.max(t,e,i),r=o/2-t/2,s=o/2-e/2,l=o/2-i/2,a=this.attribute.box.width,h=this.attribute.icon.width,d=Math.max(a,h),u=d/2-a/2,c=d/2-h/2,g=d+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:u,y:r}),this._checkIcon.setAttributes({x:c,y:s}),this._indeterminateIcon.setAttributes({x:c,y:s}),this._text.setAttributes({x:g,y:l})}initAttributes(t,e){t=e!=null&&e.skipDefault?t:dt({},kr.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}kr.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:wH,indeterminateIconImage:SH,width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};function xH(){Ai(),oo(),qB(),Ja()}xH();class Ir extends Ni{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},Ir.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||this.attribute.checked||(this.setAttribute("checked",!0),this._dispatchEvent("radio_checked",{eventType:"radio_checked",target:this}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(i,o,r)=>{"interactive"in i&&this.setAttribute("pickable",i.interactive),"disabled"in i&&this.setAttribute("cursor",i.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderCircle(),this.renderText(),this.layout()}renderCircle(){this._circle=new Cr(dt({},this.attribute.circle));const t=this.attribute.checked;t&&this.attribute.disabled?this._circle.setAttributes({fill:this.attribute.circle.disableCheckedFill,stroke:this.attribute.circle.disableCheckedStroke}):t?this._circle.setAttributes({fill:this.attribute.circle.checkedFill,stroke:this.attribute.circle.checkedStroke}):this.attribute.disabled&&this._circle.setAttributes({fill:this.attribute.circle.disableFill}),this.appendChild(this._circle)}renderText(){this._text=new Ma(dt({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),e=this._text.AABBBounds.height(),i=Math.max(t,e),o=i/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,r=i/2-e/2,s=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),l=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,a=s+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:l,y:o}),this._text.setAttributes({x:a,y:r})}initAttributes(t,e){t=e!=null&&e.skipDefault?t:dt({},Ir.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}Ir.defaultAttributes={interactive:!0,disabled:!1,checked:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},circle:{outerRadius:7,innerRadius:3,startAngle:0,endAngle:2*Math.PI,lineWidth:1,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};function AH(){Ai(),zn(),Ja()}const RH='<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>';AH();let Db=class g1 extends Ni{constructor(t,e){super(e!=null&&e.skipDefault?t:dt({},g1.defaultAttributes,t))}render(){this.removeAllChild(!0),this.renderIcon(),this.renderText(),this.layout()}renderIcon(){this._emptyTipIcon=new Eo(dt({image:this.attribute.icon.image},this.attribute.icon)),this.appendChild(this._emptyTipIcon)}renderText(){this._text=new fe(dt({wrap:!0},this.attribute.text)),this.appendChild(this._text)}layout(){const t=this.attribute.icon.height,e=this._text.AABBBounds.height(),i=this.attribute.icon.width,{width:o,height:r,spaceBetweenTextAndIcon:s}=this.attribute;this._emptyTipIcon.setAttribute("x",o/2-i/2),this._emptyTipIcon.setAttribute("y",r/2-t/2-e/2-s/2),this._text.setAttribute("x",o/2),this._text.setAttribute("textAlign","center"),this._text.setAttribute("y",r/2+t/2+s/2),this._text.setAttribute("textBaseline","middle")}};Db.defaultAttributes={spaceBetweenTextAndIcon:20,text:{text:"no data",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",pickable:!1},icon:{image:RH,width:100,height:100,pickable:!1}};var Io={},Ob={},On={};Object.defineProperty(On,"__esModule",{value:!0}),On.loop=On.conditional=On.parse=void 0;var TH=function n(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i;if(Array.isArray(e))e.forEach(function(s){return n(t,s,i,o)});else if(typeof e=="function")e(t,i,o,n);else{var r=Object.keys(e)[0];Array.isArray(e[r])?(o[r]={},n(t,e[r],i,o[r])):o[r]=e[r](t,i,o,n)}return i};On.parse=TH;var MH=function(t,e){return function(i,o,r,s){e(i,o,r)&&s(i,t,o,r)}};On.conditional=MH;var BH=function(t,e){return function(i,o,r,s){for(var l=[],a=i.pos;e(i,o,r);){var h={};if(s(i,t,o,h),i.pos===a)break;a=i.pos,l.push(h)}return l}};On.loop=BH;var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.readBits=Fe.readArray=Fe.readUnsigned=Fe.readString=Fe.peekBytes=Fe.readBytes=Fe.peekByte=Fe.readByte=Fe.buildStream=void 0;var PH=function(t){return{data:t,pos:0}};Fe.buildStream=PH;var Wb=function(){return function(t){return t.data[t.pos++]}};Fe.readByte=Wb;var HH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+t]}};Fe.peekByte=HH;var xh=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};Fe.readBytes=xh;var EH=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}};Fe.peekBytes=EH;var LH=function(t){return function(e){return Array.from(xh(t)(e)).map(function(i){return String.fromCharCode(i)}).join("")}};Fe.readString=LH;var FH=function(t){return function(e){var i=xh(2)(e);return t?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};Fe.readUnsigned=FH;var kH=function(t,e){return function(i,o,r){for(var s=typeof e=="function"?e(i,o,r):e,l=xh(t),a=new Array(s),h=0;h<s;h++)a[h]=l(i);return a}};Fe.readArray=kH;var IH=function(t,e,i){for(var o=0,r=0;r<i;r++)o+=t[e+r]&&Math.pow(2,i-r-1);return o},zH=function(t){return function(e){for(var i=Wb()(e),o=new Array(8),r=0;r<8;r++)o[7-r]=!!(i&1<<r);return Object.keys(t).reduce(function(s,l){var a=t[l];return a.length?s[l]=IH(o,a.index,a.length):s[l]=o[a.index],s},{})}};Fe.readBits=zH,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=On,e=Fe,i={blocks:function(c){for(var g=0,f=[],p=c.data.length,v=0,m=(0,e.readByte)()(c);m!==g&&m;m=(0,e.readByte)()(c)){if(c.pos+m>=p){var b=p-c.pos;f.push((0,e.readBytes)(b)(c)),v+=b;break}f.push((0,e.readBytes)(m)(c)),v+=m}for(var w=new Uint8Array(v),C=0,_=0;_<f.length;_++)w.set(f[_],C),C+=f[_].length;return w}},o=(0,t.conditional)({gce:[{codes:(0,e.readBytes)(2)},{byteSize:(0,e.readByte)()},{extras:(0,e.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,e.readUnsigned)(!0)},{transparentColorIndex:(0,e.readByte)()},{terminator:(0,e.readByte)()}]},function(u){var c=(0,e.peekBytes)(2)(u);return c[0]===33&&c[1]===249}),r=(0,t.conditional)({image:[{code:(0,e.readByte)()},{descriptor:[{left:(0,e.readUnsigned)(!0)},{top:(0,e.readUnsigned)(!0)},{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{lct:(0,e.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,e.readArray)(3,function(u,c,g){return Math.pow(2,g.descriptor.lct.size+1)})},function(u,c,g){return g.descriptor.lct.exists}),{data:[{minCodeSize:(0,e.readByte)()},i]}]},function(u){return(0,e.peekByte)()(u)===44}),s=(0,t.conditional)({text:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{preData:function(c,g,f){return(0,e.readBytes)(f.text.blockSize)(c)}},i]},function(u){var c=(0,e.peekBytes)(2)(u);return c[0]===33&&c[1]===1}),l=(0,t.conditional)({application:[{codes:(0,e.readBytes)(2)},{blockSize:(0,e.readByte)()},{id:function(c,g,f){return(0,e.readString)(f.blockSize)(c)}},i]},function(u){var c=(0,e.peekBytes)(2)(u);return c[0]===33&&c[1]===255}),a=(0,t.conditional)({comment:[{codes:(0,e.readBytes)(2)},i]},function(u){var c=(0,e.peekBytes)(2)(u);return c[0]===33&&c[1]===254}),h=[{header:[{signature:(0,e.readString)(3)},{version:(0,e.readString)(3)}]},{lsd:[{width:(0,e.readUnsigned)(!0)},{height:(0,e.readUnsigned)(!0)},{gct:(0,e.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,e.readByte)()},{pixelAspectRatio:(0,e.readByte)()}]},(0,t.conditional)({gct:(0,e.readArray)(3,function(u,c){return Math.pow(2,c.lsd.gct.size+1)})},function(u,c){return c.lsd.gct.exists}),{frames:(0,t.loop)([o,l,a,r,s],function(u){var c=(0,e.peekByte)()(u);return c===33||c===44})}],d=h;n.default=d}(Ob);var Ah={};Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.deinterlace=void 0;var DH=function(t,e){for(var i=new Array(t.length),o=t.length/e,r=function(c,g){var f=t.slice(g*e,(g+1)*e);i.splice.apply(i,[c*e,e].concat(f))},s=[0,4,2,1],l=[8,8,4,2],a=0,h=0;h<4;h++)for(var d=s[h];d<o;d+=l[h])r(d,a),a++;return i};Ah.deinterlace=DH;var Rh={};Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.lzw=void 0;var OH=function(t,e,i){var o=4096,r=-1,s=i,l,a,h,d,u,c,g,y,f,p,_,v,x,S,R,A,m=new Array(i),b=new Array(o),w=new Array(o),C=new Array(o+1);for(v=t,a=1<<v,u=a+1,l=a+2,g=r,d=v+1,h=(1<<d)-1,f=0;f<a;f++)b[f]=0,w[f]=f;var _,y,x,S,A,R;for(_=y=x=S=A=R=0,p=0;p<s;){if(S===0){if(y<d){_+=e[R]<<y,y+=8,R++;continue}if(f=_&h,_>>=d,y-=d,f>l||f==u)break;if(f==a){d=v+1,h=(1<<d)-1,l=a+2,g=r;continue}if(g==r){C[S++]=w[f],g=f,x=f;continue}for(c=f,f==l&&(C[S++]=x,f=g);f>a;)C[S++]=w[f],f=b[f];x=w[f]&255,C[S++]=x,l<o&&(b[l]=g,w[l]=x,l++,!(l&h)&&l<o&&(d++,h+=l)),g=c}S--,m[A++]=C[S],p++}for(p=A;p<s;p++)m[p]=0;return m};Rh.lzw=OH,Object.defineProperty(Io,"__esModule",{value:!0});var Nb=Io.decompressFrames=Io.decompressFrame=Vb=Io.parseGIF=void 0,WH=UH(Ob),NH=On,VH=Fe,jH=Ah,GH=Rh;function UH(n){return n&&n.__esModule?n:{default:n}}var KH=function(t){var e=new Uint8Array(t);return(0,NH.parse)((0,VH.buildStream)(e),WH.default)},Vb=Io.parseGIF=KH,$H=function(t){for(var e=t.pixels.length,i=new Uint8ClampedArray(e*4),o=0;o<e;o++){var r=o*4,s=t.pixels[o],l=t.colorTable[s]||[0,0,0];i[r]=l[0],i[r+1]=l[1],i[r+2]=l[2],i[r+3]=s!==t.transparentIndex?255:0}return i},jb=function(t,e,i){if(!t.image){console.warn("gif frame does not have associated image.");return}var o=t.image,r=o.descriptor.width*o.descriptor.height,s=(0,GH.lzw)(o.data.minCodeSize,o.data.blocks,r);o.descriptor.lct.interlaced&&(s=(0,jH.deinterlace)(s,o.descriptor.width));var l={pixels:s,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return o.descriptor.lct&&o.descriptor.lct.exists?l.colorTable=o.lct:l.colorTable=e,t.gce&&(l.delay=(t.gce.delay||10)*10,l.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(l.transparentIndex=t.gce.transparentColorIndex)),i&&(l.patch=$H(l)),l};Io.decompressFrame=jb;var YH=function(t,e){return t.frames.filter(function(i){return i.image}).map(function(i){return jb(i,t.gct,e)})};Nb=Io.decompressFrames=YH;let Gb=!1;function XH(){Gb||(Gb=!0,Fs(),pc()?Ga(Tt):mT()&&$a(Tt),UB(),KB(),Ai(),Ja(),Wc(),oo(),oh(),XB(),Mr(),zn(),Iv(),uP(),Iv())}var Rt;(function(n){n.default="default",n.grabing="grabing",n.scrolling="scrolling"})(Rt||(Rt={}));var Nt;(function(n){n.single="single",n.column="column",n.row="row",n.cross="cross",n.none="none"})(Nt||(Nt={}));var Ri;(function(n){n.top="top",n.bottom="bottom",n.left="left",n.right="right"})(Ri||(Ri={}));var Pt;(function(n){n.expand="expand",n.collapse="collapse",n.none="none",n.loading="loading"})(Pt||(Pt={}));var Mt;(function(n){n.RECORD="RECORD",n.NONE="NONE",n.SUM="SUM",n.MIN="MIN",n.MAX="MAX",n.AVG="AVG",n.COUNT="COUNT",n.CUSTOM="CUSTOM",n.RECALCULATE="RECALCULATE"})(Mt||(Mt={}));var Ve;(function(n){n.ASC="ASC",n.DESC="DESC",n.NORMAL="NORMAL",n.desc="desc",n.asc="asc",n.normal="normal"})(Ve||(Ve={}));var Yt;(function(n){n.inlineFront="inlineFront",n.inlineEnd="inlineEnd",n.left="left",n.right="right",n.absoluteRight="absoluteRight",n.contentLeft="contentLeft",n.contentRight="contentRight",n.absolute="absolute"})(Yt||(Yt={}));var Zt;(function(n){n.frozen="frozen",n.sort="sort",n.dropDown="dropDown",n.dropDownState="dropDownState",n.play="play",n.damagePic="damagePic",n.expand="expand",n.collapse="collapse",n.drillDown="drillDown",n.drillUp="drillUp",n.dragReorder="dragReorder"})(Zt||(Zt={}));var ui;(function(n){n.upwardIconName="sort_upward",n.downwardIconName="sort_downward",n.normalIconName="sort_normal",n.freezeIconName="freeze",n.frozenIconName="frozen",n.frozenCurrentIconName="frozenCurrent",n.dropdownIconName="dropdownIcon",n.expandIconName="expand",n.collapseIconName="collapse",n.dragReorderIconName="dragReorder",n.loadingIconName="loading"})(ui||(ui={}));let qH=1,Th=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=qH++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const r=i.indexOf(e);i.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const o=t;this.removeEventListener(o,e)}else{const o=t;if(!this.listenersData)return;(i=this.listenersData.listenerData[o])===null||i===void 0||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map(o=>o.call(this,e)).filter(o=>I(o)):[]}release(){delete this.listenersData}},Ub;const ZH={CHANGE_STYLE:"change_style"};let ro=class Cf extends Th{static get EVENT_TYPE(){return ZH}static get DEFAULT(){return Ub||(Ub=new Cf)}constructor(t={},e={}){var i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E;super(),this._defaultPadding=[10,16,10,16],this._textAlign=(i=t==null?void 0:t.textAlign)!==null&&i!==void 0?i:e==null?void 0:e.textAlign,this._textBaseline=(o=t==null?void 0:t.textBaseline)!==null&&o!==void 0?o:e==null?void 0:e.textBaseline,this._color=(r=t==null?void 0:t.color)!==null&&r!==void 0?r:e==null?void 0:e.color,this._strokeColor=(s=t==null?void 0:t.strokeColor)!==null&&s!==void 0?s:e==null?void 0:e.strokeColor,this._fontSize=(l=t.fontSize)!==null&&l!==void 0?l:e==null?void 0:e.fontSize,this._fontFamily=(a=t.fontFamily)!==null&&a!==void 0?a:e==null?void 0:e.fontFamily,this._fontWeight=(h=t.fontWeight)!==null&&h!==void 0?h:e==null?void 0:e.fontWeight,this._fontVariant=(d=t.fontVariant)!==null&&d!==void 0?d:e==null?void 0:e.fontVariant,this._fontStyle=(u=t.fontStyle)!==null&&u!==void 0?u:e==null?void 0:e.fontStyle,this._padding=(g=(c=t==null?void 0:t.padding)!==null&&c!==void 0?c:e==null?void 0:e.padding)!==null&&g!==void 0?g:this._defaultPadding,this._borderColor=(f=t==null?void 0:t.borderColor)!==null&&f!==void 0?f:e==null?void 0:e.borderColor,this._textOverflow=(p=t==null?void 0:t.textOverflow)!==null&&p!==void 0?p:e==null?void 0:e.textOverflow,this._textStick=(m=(v=t.textStick)!==null&&v!==void 0?v:e==null?void 0:e.textStick)!==null&&m!==void 0&&m,this._textStickBaseOnAlign=(w=(b=t.textStickBaseOnAlign)!==null&&b!==void 0?b:e==null?void 0:e.textStickBaseOnAlign)!==null&&w!==void 0&&w,this._bgColor=(C=t==null?void 0:t.bgColor)!==null&&C!==void 0?C:e==null?void 0:e.bgColor,this._lineHeight=(_=t==null?void 0:t.lineHeight)!==null&&_!==void 0?_:e==null?void 0:e.lineHeight,this._underline=(y=t==null?void 0:t.underline)!==null&&y!==void 0?y:e==null?void 0:e.underline,this._underlineColor=(x=t==null?void 0:t.underlineColor)!==null&&x!==void 0?x:e==null?void 0:e.underlineColor,this._underlineDash=(S=t==null?void 0:t.underlineDash)!==null&&S!==void 0?S:e==null?void 0:e.underlineDash,this._underlineOffset=(A=t==null?void 0:t.underlineOffset)!==null&&A!==void 0?A:e==null?void 0:e.underlineOffset,this._lineThrough=(R=t==null?void 0:t.lineThrough)!==null&&R!==void 0?R:e==null?void 0:e.lineThrough,this._lineThroughColor=(T=t==null?void 0:t.lineThroughColor)!==null&&T!==void 0?T:e==null?void 0:e.lineThroughColor,this._lineThroughDash=(M=t==null?void 0:t.lineThroughDash)!==null&&M!==void 0?M:e==null?void 0:e.lineThroughDash,this._linkColor=(P=t==null?void 0:t.linkColor)!==null&&P!==void 0?P:e==null?void 0:e.linkColor,this._cursor=(k=t.cursor)!==null&&k!==void 0?k:e==null?void 0:e.cursor,this._borderLineWidth=(B=t.borderLineWidth)!==null&&B!==void 0?B:e==null?void 0:e.borderLineWidth,this._borderLineDash=(H=t.borderLineDash)!==null&&H!==void 0?H:e==null?void 0:e.borderLineDash,this._marked=(E=t.marked)!==null&&E!==void 0?E:e==null?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new Cf(this,null)}},Kb,JH=class _f extends ro{static get DEFAULT(){return Kb||(Kb=new _f)}constructor(t={},e={}){super(t,e)}clone(){return new _f(this,null)}},$b;class Ys extends ro{static get DEFAULT(){return $b||($b=new Ys)}constructor(t={},e={}){var i,o;super(t,e),this._autoWrapText=(i=t==null?void 0:t.autoWrapText)!==null&&i!==void 0?i:e==null?void 0:e.autoWrapText,this._lineClamp=(o=t==null?void 0:t.lineClamp)!==null&&o!==void 0?o:e==null?void 0:e.lineClamp}clone(){return new Ys(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let Yb,rg=class Dd extends ro{static get DEFAULT(){return Yb||(Yb=new Dd)}constructor(t={},e={},i={}){var o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A;super(t,e),this._size=((r=(o=t==null?void 0:t.size)!==null&&o!==void 0?o:e==null?void 0:e.size)!==null&&r!==void 0?r:i==null?void 0:i.size)||14,this._spaceBetweenTextAndIcon=((l=(s=t==null?void 0:t.spaceBetweenTextAndIcon)!==null&&s!==void 0?s:e==null?void 0:e.spaceBetweenTextAndIcon)!==null&&l!==void 0?l:i==null?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=(h=(a=t==null?void 0:t.checkboxStyle)===null||a===void 0?void 0:a.defaultFill)!==null&&h!==void 0?h:i==null?void 0:i.defaultFill,this._defaultStroke=(u=(d=t==null?void 0:t.checkboxStyle)===null||d===void 0?void 0:d.defaultStroke)!==null&&u!==void 0?u:i==null?void 0:i.defaultStroke,this._disableFill=(g=(c=t==null?void 0:t.checkboxStyle)===null||c===void 0?void 0:c.disableFill)!==null&&g!==void 0?g:i==null?void 0:i.disableFill,this._checkedFill=(p=(f=t==null?void 0:t.checkboxStyle)===null||f===void 0?void 0:f.checkedFill)!==null&&p!==void 0?p:i==null?void 0:i.checkedFill,this._checkedStroke=(m=(v=t==null?void 0:t.checkboxStyle)===null||v===void 0?void 0:v.checkedStroke)!==null&&m!==void 0?m:i==null?void 0:i.checkedStroke,this._disableCheckedFill=(w=(b=t==null?void 0:t.checkboxStyle)===null||b===void 0?void 0:b.disableCheckedFill)!==null&&w!==void 0?w:i==null?void 0:i.disableCheckedFill,this._disableCheckedStroke=(_=(C=t==null?void 0:t.checkboxStyle)===null||C===void 0?void 0:C.disableCheckedStroke)!==null&&_!==void 0?_:i==null?void 0:i.disableCheckedStroke,this._checkIconImage=(x=(y=t==null?void 0:t.checkboxStyle)===null||y===void 0?void 0:y.checkIconImage)!==null&&x!==void 0?x:i==null?void 0:i.checkIconImage,this._indeterminateIconImage=(A=(S=t==null?void 0:t.checkboxStyle)===null||S===void 0?void 0:S.indeterminateIconImage)!==null&&A!==void 0?A:i==null?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new Dd(t,this)}clone(){return new Dd(this)}},Xb;class zo extends ro{static get DEFAULT(){return Xb||(Xb=new zo)}constructor(t={},e={},i={}){var o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T;super(t,e),this._size=((r=(o=t==null?void 0:t.size)!==null&&o!==void 0?o:e==null?void 0:e.size)!==null&&r!==void 0?r:i==null?void 0:i.size)||14,this._spaceBetweenTextAndIcon=((l=(s=t==null?void 0:t.spaceBetweenTextAndIcon)!==null&&s!==void 0?s:e==null?void 0:e.spaceBetweenTextAndIcon)!==null&&l!==void 0?l:i==null?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=((h=(a=t==null?void 0:t.spaceBetweenRadio)!==null&&a!==void 0?a:e==null?void 0:e.spaceBetweenRadio)!==null&&h!==void 0?h:i==null?void 0:i.spaceBetweenRadio)||2,this._innerRadius=(u=(d=t==null?void 0:t.radioStyle)===null||d===void 0?void 0:d.innerRadius)!==null&&u!==void 0?u:i==null?void 0:i.innerRadius,this._outerRadius=(g=(c=t==null?void 0:t.radioStyle)===null||c===void 0?void 0:c.outerRadius)!==null&&g!==void 0?g:i==null?void 0:i.outerRadius,this._defaultFill=(p=(f=t==null?void 0:t.radioStyle)===null||f===void 0?void 0:f.defaultFill)!==null&&p!==void 0?p:i==null?void 0:i.defaultFill,this._defaultStroke=(m=(v=t==null?void 0:t.radioStyle)===null||v===void 0?void 0:v.defaultStroke)!==null&&m!==void 0?m:i==null?void 0:i.defaultStroke,this._disableFill=(w=(b=t==null?void 0:t.radioStyle)===null||b===void 0?void 0:b.disableFill)!==null&&w!==void 0?w:i==null?void 0:i.disableFill,this._checkedFill=(_=(C=t==null?void 0:t.radioStyle)===null||C===void 0?void 0:C.checkedFill)!==null&&_!==void 0?_:i==null?void 0:i.checkedFill,this._checkedStroke=(x=(y=t==null?void 0:t.radioStyle)===null||y===void 0?void 0:y.checkedStroke)!==null&&x!==void 0?x:i==null?void 0:i.checkedStroke,this._disableCheckedFill=(A=(S=t==null?void 0:t.radioStyle)===null||S===void 0?void 0:S.disableCheckedFill)!==null&&A!==void 0?A:i==null?void 0:i.disableCheckedFill,this._disableCheckedStroke=(T=(R=t==null?void 0:t.radioStyle)===null||R===void 0?void 0:R.disableCheckedStroke)!==null&&T!==void 0?T:i==null?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new zo(t,this)}clone(){return new zo(this)}}function sg(n,t,e,i=ro,o,r){var s,l;return n||t?n instanceof ro?n:typeof n=="function"?sg(n(e),t,e,i,o,r):(n||(n={}),o&&!I(n.autoWrapText)&&(n.autoWrapText=!0),i===rg?new rg(n??{},t??{},(s=r.checkboxStyle)!==null&&s!==void 0?s:{}):i===zo?new zo(n??{},t??{},(l=r.radioStyle)!==null&&l!==void 0?l:{}):new i(n??{},t??{})):i.DEFAULT}class Wt{static get mode(){return Wt._mode||(Wt._mode=QH()),Wt._mode}static set mode(t){Wt._mode=t}static RegisterCreateCanvas(t){Wt.CreateCanvas=t}static RegisterLoadImage(t){Wt.LoadImage=t}static GetCreateCanvasFunc(){return Wt.CreateCanvas?Wt.CreateCanvas:Wt.mode==="worker"?(t=200,e=200)=>new OffscreenCanvas(t,e):void 0}static RegisterRequestAnimationFrame(t){Wt.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(Wt.RequestAnimationFrame)return Wt.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){Wt.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(Wt.CancelAnimationFrame)return Wt.CancelAnimationFrame}}function QH(){let n="browser";try{window.type==="node"?n="node":typeof window>"u"||window.performance?typeof window>"u"&&(n="node"):n="miniApp"}catch{n="node"}return n}Wt.dpr=0;function t2(){if(Wt.mode==="node")return;const n=document.createElement("style");n.id="vtable-style-styleSheet",n.textContent=`
|
|
31
|
+
.vtable .input-container {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top:0px;
|
|
34
|
+
}
|
|
35
|
+
.vtable .table-scrollable {
|
|
36
|
+
position: absolute;
|
|
37
|
+
overflow: scroll;
|
|
38
|
+
}
|
|
39
|
+
.vtable .table-scrollable::-webkit-scrollbar-button{
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
}
|
|
42
|
+
.vtable .table-scrollable::-webkit-scrollbar-track-piece{
|
|
43
|
+
background-color: transparent;
|
|
44
|
+
}
|
|
45
|
+
.vtable .table-scrollable::-webkit-scrollbar-corner {
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
.vtable .table-scrollable::-webkit-scrollbar-thumb {
|
|
49
|
+
border-radius : 4px;
|
|
50
|
+
background-color : rgba(100, 100, 100, .5);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.vtable .table-scroll-end-point {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
.vtable {
|
|
58
|
+
/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */
|
|
59
|
+
/* overflow: auto; */
|
|
60
|
+
position: relative;
|
|
61
|
+
width: 100%;
|
|
62
|
+
height: 100%;
|
|
63
|
+
text-align: left;
|
|
64
|
+
-webkit-font-smoothing:auto;
|
|
65
|
+
|
|
66
|
+
overflow: hidden; // for react-vtable dom custom element
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.vtable-gantt {
|
|
70
|
+
/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */
|
|
71
|
+
/* overflow: auto; */
|
|
72
|
+
position: absolute;
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
text-align: left;
|
|
76
|
+
-webkit-font-smoothing:auto;
|
|
77
|
+
|
|
78
|
+
overflow: hidden; // for react-vtable dom custom element
|
|
79
|
+
}
|
|
80
|
+
.vtable .table-component-container {
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 0px;
|
|
85
|
+
left: 0px;
|
|
86
|
+
}
|
|
87
|
+
.vtable > canvas {
|
|
88
|
+
position: absolute;
|
|
89
|
+
width: 0;
|
|
90
|
+
height: 0;
|
|
91
|
+
}
|
|
92
|
+
.vtable .table-focus-control {
|
|
93
|
+
position: relative !important;
|
|
94
|
+
width: 1px;
|
|
95
|
+
height: 1px;
|
|
96
|
+
opacity: 0;
|
|
97
|
+
padding: 0;
|
|
98
|
+
margin: 0;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
max-width: 500px;
|
|
102
|
+
max-height: 500px;
|
|
103
|
+
float: none !important;
|
|
104
|
+
}
|
|
105
|
+
.vtable input.table-focus-control::-ms-clear {
|
|
106
|
+
visibility: hidden;
|
|
107
|
+
}
|
|
108
|
+
.vtable input.table-focus-control.composition {
|
|
109
|
+
opacity: 1;
|
|
110
|
+
max-width: none;
|
|
111
|
+
max-height: none;
|
|
112
|
+
}
|
|
113
|
+
`,document.head.appendChild(n)}function e2(n){var t;return n!=null&&n.hoverOn||n!=null&&n.horizontalVisible&&(n==null?void 0:n.horizontalVisible)==="none"||!(n!=null&&n.horizontalVisible)&&(n==null?void 0:n.visible)==="none"?0:(t=n==null?void 0:n.width)!==null&&t!==void 0?t:7}function i2(n){var t;return n!=null&&n.hoverOn||n!=null&&n.verticalVisible&&(n==null?void 0:n.verticalVisible)==="none"||!(n!=null&&n.verticalVisible)&&(n==null?void 0:n.visible)==="none"?0:(t=n==null?void 0:n.width)!==null&&t!==void 0?t:7}function n2(n){return!!I(n)&&(!it(n)||n.some(t=>I(t)))}function o2(n){return n===0||it(n)&&n.every(t=>t===0)}const r2=n=>{switch(Object.prototype.toString.call(n)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}},Mh=(n,t)=>r2(n)===t,Bh=n=>Mh(n,"object"),s2=n=>Mh(n,"string"),l2=n=>Mh(n,"number"),a2=n=>Mh(n,"boolean");function ce(n,...t){if(!t.length)return n||{};const e=t.shift();if(Bh(n)&&Bh(e))for(const i in e)Bh(e[i])?(n[i]||Object.assign(n,{[i]:{}}),Bh(n[i])||Object.assign(n,{[i]:e[i]}),ce(n[i],e[i])):e[i]!==null&&e[i]!==void 0&&Object.assign(n,{[i]:e[i]});return ce(n,...t)}function qb(n){return typeof n=="function"&&(n=n()),I(n)?`${n}`:""}function lg(n){if((n==null?void 0:n.length)<=0)return n;const t=n.length,e=n[0].length,i=new Array(e);for(let o=0;o<t;o++)for(let r=0;r<e;r++)i[r]||(i[r]=new Array(t)),i[r][o]=n[o][r];return i}function Zb(n,t){let e=null;return function(...i){e||(n.apply(this,i),e=setTimeout(()=>{e=null},t))}}function h2(n,t){let e=null;return function(...i){e||(e=setTimeout(()=>{n.apply(this,i),e=null},t))}}function ag(n,t){for(n=`${n}`;n.length<t;)n="0"+n;return n}function so(n,t,e){n=(n=n.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const i=Math.round(256*t)*(e?-1:1),o=n.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),r=o&&I(o[4])?o[4]:null,s=o?[o[1],o[2],o[3]]:n.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`}).split(/,/);return o?`rgb${r!==null?"a":""}(${Math[e?"max":"min"](parseInt(s[0],10)+i,e?0:255)}, ${Math[e?"max":"min"](parseInt(s[1],10)+i,e?0:255)}, ${Math[e?"max":"min"](parseInt(s[2],10)+i,e?0:255)}${r!==null?`, ${r}`:""})`:["#",ag(Math[e?"max":"min"](parseInt(s[0],10)+i,e?0:255).toString(16),2),ag(Math[e?"max":"min"](parseInt(s[1],10)+i,e?0:255).toString(16),2),ag(Math[e?"max":"min"](parseInt(s[2],10)+i,e?0:255).toString(16),2)].join("")}function hg(n){return s2(n)||l2(n)||a2(n)?n.toString():""}function dg(){return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}function d2(n,t,e){return e!=="desc"?n===t?0:n>t?1:-1:n===t?0:n<t?1:-1}function u2(n,t){let e,i=n;for(;(e=t.shift())&&(i=i[e],i););return i}function ug(n){return/^-?\d+(\.\d+)?$/.test(n)}function Xs(n){const t=[];for(let e=0;e<n.length;e++)t.indexOf(n[e])===-1&&t.push(n[e]);return t}function c2(n){const t=window.getSelection();if(t.rangeCount){const e=t.getRangeAt(0);return e.endOffset>e.startOffset&&n.contains(e.commonAncestorContainer)}return!1}function cg(n,t,e){e(n),n!=null&&n[t]&&Array.isArray(n==null?void 0:n[t])&&n[t].forEach(i=>cg(i,t,e))}const Jb=typeof window>"u"||window.window===void 0;let gg,fg;const Qb={get find(){return gg||(gg=Array.prototype.find?(n,t)=>Array.prototype.find.call(n,t):(n,t)=>{const e=Qb.findIndex(n,t);return e>=0?n[e]:void 0},gg)},get findIndex(){return fg||(fg=Array.prototype.findIndex?(n,t)=>Array.prototype.findIndex.call(n,t):(n,t)=>{const{length:e}=n;for(let i=0;i<e;i++)if(t(n[i],i,n))return i;return-1},fg)}};function g2(){if(Jb)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const n=window.navigator.userAgent.toLowerCase();return{IE:!!/(msie|trident)/.exec(n),Edge:n.indexOf("edge")>-1,Chrome:n.indexOf("chrome")>-1&&n.indexOf("edge")===-1,Firefox:n.indexOf("firefox")>-1,Safari:n.indexOf("safari")>-1&&n.indexOf("edge")===-1}}const{IE:f2,Chrome:tC,Firefox:eC,Edge:p2,Safari:v2}=g2();function m2(n){return n===Object(n)}function qs(...n){const t={};return n.forEach(e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(o){e[i]=o},configurable:!0,enumerable:!0})}),t}function iC(n,t,...e){let i=n;for(let o=0;o<e.length&&i!=null;o++)i=t(i,e[o]);return i}function Ph(n,...t){return iC(n,(e,i)=>e[i],...t)}function xe(n,...t){return typeof n=="function"?n(...t):n}function b2(n,t,e){const i=hg(n);(typeof e!="number"||!isFinite(e)||Math.floor(e)!==e||e>i.length)&&(e=i.length),e-=t.length;const o=i.lastIndexOf(t,e);return o!==-1&&o===e}function Cn(n){return!!(n&&typeof n.then=="function")}function Hh(n,t){Cn(n)?n.then(e=>{t(e)}).catch(e=>{}):t(n)}function C2(n){return!!n.changedTouches}function _2(n,t){if(n[t])return n[t];const e=t.toLowerCase();if(n[e])return n[e];const i=t.toLowerCase();if(n[i])return n[i];for(const o in n)if(o.toLowerCase()===e)return n[o]}function nC(n){return Array.isArray(n)?n.length===3?[n[0],n[1],n[2],n[1]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:[n[0],n[1],n[2],n[3]]:[n,n,n,n]}function Ti(n,t,e){return n.start.col<=t&&t<=n.end.col&&n.start.row<=e&&e<=n.end.row||n.end.col<=t&&t<=n.start.col&&n.end.row<=e&&e<=n.start.row||n.end.col<=t&&t<=n.start.col&&n.start.row<=e&&e<=n.end.row||n.start.col<=t&&t<=n.end.col&&n.end.row<=e&&e<=n.start.row}function y2(n,t,e){for(let i=0;i<n.length;i++){const o=n[i],r=Math.min(o.start.col,o.end.col),s=Math.max(o.start.col,o.end.col),l=Math.min(o.start.row,o.end.row),a=Math.max(o.start.row,o.end.row);if(r<=t&&t<=s&&l<=e&&e<=a||s<=t&&t<=r&&a<=e&&e<=l)return!0}return!1}function oC(n){return{start:{col:Math.min(n.start.col,n.end.col),row:Math.min(n.start.row,n.end.row)},end:{col:Math.max(n.start.col,n.end.col),row:Math.max(n.start.row,n.end.row)}}}function w2(n,t){const e=oC(n),i=oC(t);return Math.max(e.start.col,i.start.col)<=Math.min(e.end.col,i.end.col)&&Math.max(e.start.row,i.start.row)<=Math.min(e.end.row,i.end.row)}const S2={IE:f2,Edge:p2,Chrome:tC,Firefox:eC,Safari:v2,heightLimit:tC?33554431:eC?17895588:10737433},rC={isObject:m2},Eh={endsWith:b2},x2={isTouchEvent:C2},A2={toBoxArray:nC},R2=Function.prototype,J={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_TABLE:"mousemove_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION_START:"change_header_position_start",CHANGE_HEADER_POSITION:"change_header_position",CHANGING_HEADER_POSITION:"changing_header_position",CHANGE_HEADER_POSITION_FAIL:"change_header_position_fail",SORT_CLICK:"sort_click",AFTER_SORT:"after_sort",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},T2=n=>{switch(Object.prototype.toString.call(n)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}},M2=(n,t)=>T2(n)===t,B2=n=>M2(n,"object");function sC(n,t,e){let i,o,r,s,l,a,h=0,d=!1,u=!1,c=!0;const g=!t&&t!==0&&typeof requestAnimationFrame=="function";if(typeof n!="function")throw new TypeError("Expected a function");function f(b){const w=i,C=o;return o=void 0,i=void 0,h=b,s=n.apply(C,w),s}function p(b,w){return g?requestAnimationFrame(b):setTimeout(b,w)}function v(b){const w=b-a;return a===void 0||w>=t||w<0||d&&b-h>=r}function m(){const b=Date.now();if(v(b))return function(w){return l=void 0,c&&i?f(w):(o=void 0,i=void 0,s)}(b);l=p(m,function(w){const C=w-h,_=t&&-(w-a);return d?Math.min(_,r-C):_}(b))}return t=+t||0,B2(e)&&(u=!!e.leading,d="maxWait"in e,d&&(r=Math.max(+e.maxWait||0,t)),c="trailing"in e?!!e.trailing:c),function(...b){const w=Date.now(),C=v(w);if(i=b,o=this,a=w,C){if(l===void 0)return function(_){return h=_,l=p(m,t),u?f(_):s}(a);if(d)return l=p(m,t),f(a)}return l===void 0&&(l=p(m,t)),s}}let P2=1;class H2{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const r=this.getSize();let s=!1;r.width===this.lastSize.width&&r.height===this.lastSize.height&&(s=!0),this.lastSize=r,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:s}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=sC(this.callBack,this.resizeTime),window==null||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const r=window.ResizeObserver;this.observer=new r(this.mutationResize),(o=this.observer)===null||o===void 0||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}class Lh{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i,...o){if(Wt.mode==="node")return-1;const r=P2++;if(t!=null&&t.addEventListener)if(e!=="resize"||t===window)t==null||t.addEventListener(e,i,...o);else{const l=new H2(t,i,this.resizeTime);this.reseizeListeners[r]=l}const s={target:t,type:e,listener:i,options:o};return this.listeners[r]=s,r}once(t,e,i,...o){if(Wt.mode==="node")return-1;const r=this.on(t,e,(...s)=>{this.off(r),i(...s)},...o);return r}off(t){var e;if(Wt.mode==="node"||t===null)return;const i=(e=this.listeners)===null||e===void 0?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e,...i){if(Wt.mode!=="node")for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&r.listener.call(r.target,...i)}}hasListener(t,e){if(Wt.mode==="node")return!1;let i=!1;for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&(i=!0)}return i}clear(){if(Wt.mode!=="node"){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e==null||e.disConnect()}this.listeners={}}}release(){Wt.mode!=="node"&&(this.clear(),this.listeners={})}}const Zs=(n,t)=>{let e=0,i=n.length-1;for(;e<=i;){const o=Math.floor((e+i)/2);if(n[o]===t)return o;n[o]>t?i=o-1:e=o+1}return i<0?0:i};class lo{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort((s,l)=>s<l?-1:s>l?1:0),this._sorted=!0),t>e){const s=[];for(let l=Zs(o,t+i-1);l>=0;l--){const a=o[l];if(a>=t)s.push(this.get(a));else if(e<=a&&a<t)this.put(a+i,this.get(a));else if(a<e)break}for(let l=0;l<i;l++)this.put(e+l,s[i-1-l])}const{length:r}=o;if(t<e){const s=[];for(let l=Zs(o,t);l<r;l++){const a=o[l];if(a>=t&&a<t+i)s.push(this.get(a));else if(t+i<=a&&a<=e)this.put(a-i,this.get(a));else if(a>e)break}for(let l=0;l<i;l++)this.put(e+l,s[l])}}exchangeOrder(t,e,i,o,r){const{_keys:s}=this;if(this._sorted||(s.sort((l,a)=>l<a?-1:l>a?1:0),this._sorted=!0),t>i){const l=[],a=[];for(let h=Zs(s,i);h<t+e;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(r+e+h,l[h])}else{const l=[],a=[];for(let h=Zs(s,t);h<i+o;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(t+h,l[h])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);e!==-1&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return I(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:r}=o;this._sorted||(o.sort((s,l)=>s<l?-1:s>l?1:0),this._sorted=!0);for(let s=Zs(o,t);s<r;s++){const l=o[s];if(t<=l&&l<=e){if(i(this.get(l),l)===!1)break}else if(e<l)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),I(e)&&this.put(t,e)}}class _n{constructor(t,e,i,o){this.bounds=new Ci,this.bounds.set(t,e,t+i,e+o)}static bounds(t,e,i,o){return new _n(t,e,Math.round(i-t),Math.round(o-e))}get left(){return this.bounds.x1}set left(t){this.bounds.x1=t}get top(){return this.bounds.y1}set top(t){this.bounds.y1=t}get right(){return this.bounds.x2}set right(t){this.bounds.x2=t}get bottom(){return this.bounds.y2}set bottom(t){this.bounds.y2=t}get width(){return this.bounds.width()}set width(t){this.bounds.x2=this.bounds.x1+t}get height(){return this.bounds.height()}set height(t){this.bounds.y2=this.bounds.y1+t}offsetLeft(t){this.bounds.translate(t,0)}offsetTop(t){this.bounds.translate(0,t)}copy(){return new _n(this.left,this.top,this.width,this.height)}contains(t){return this.bounds.encloses(t.bounds)}inPoint(t,e){return this.bounds.contains(t,e)}}function E2(n){const{row:t,table:e}=n;return 1&t-e.frozenRowCount?"#282a2e":"#2d3137"}const lC={name:"DARK",underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:E2,fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"},functionalIconsStyle:{sort_color:"#FFFFFF",sort_color_opacity:"0.75",sort_color_2:"#416EFF",sort_color_opacity_2:"1",frozen_color:"#FFFFFF",frozen_color_opacity:"0.75",collapse_color:"#FFF",collapse_color_opacity:"0.75",expand_color:"#FFF",expand_color_opacity:"0.75",dragReorder_color:"#FFF",dragReorder_color_opacity:"0.75"}};function L2(n){const{row:t,table:e}=n;return 1&t-e.frozenRowCount?"#FFF":"#F4F8FF"}const aC={name:"BRIGHT",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:L2,borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};function F2(n){const{row:t,table:e}=n;return 1&t-e.frozenRowCount?"#fbfbfc":"#FFF"}const hC={name:"ARCO",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:F2,borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};function k2(n){const{row:t,table:e}=n;return 1&t-e.frozenRowCount?"#FDFDFD":"#FAF9FB"}const dC={name:"DEFAULT",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:k2,hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};function I2(n){const{row:t,table:{frozenRowCount:e}}=n;return e-1===t?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}function z2(n){const{col:t,table:e}=n,{colCount:i,frozenColCount:o}=e,r="#ccc7c7";return o-1===t||i-1===t?[r,"#f2f2f2","#ccc7c7",null]:[r,null,"#ccc7c7",null]}const uC={name:"SIMPLIFY",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:z2,hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:I2},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}},D2={},cC=16,gC="Arial,sans-serif",O2="#FFF",W2="#000",N2=1,V2=[],j2="#000",pg=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,fC=16,G2=16,ln="$$indicator$$",U2='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',K2='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>';function $2(n){return{defaultAxisStyle:Js(n.defaultAxisStyle),leftAxisStyle:Js(n.leftAxisStyle),rightAxisStyle:Js(n.rightAxisStyle),topAxisStyle:Js(n.topAxisStyle),bottomAxisStyle:Js(n.bottomAxisStyle)}}function Js(n){return n||{}}const Y2={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function zr(n,t,e,i){var o,r,s;return(s=(r=(o=Ph(n,...e))!==null&&o!==void 0?o:Ph(t,...e))!==null&&r!==void 0?r:i&&Ph(n,...i))!==null&&s!==void 0?s:i&&Ph(t,...i)}class Mi{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._groupTitle=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this._internalIconsStyle=null,this.isPivot=!1,this.name="",this.internalTheme={obj:t,superTheme:e},this.name=zr(t,e,["name"])}getExtendTheme(){return this.internalTheme.obj}clearBodyStyleCache(){this._body=null}get font(){const{obj:t,superTheme:e}=this.internalTheme;return zr(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return zr(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return(t=zr(e,i,["cellInnerBorder"]))===null||t===void 0||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return(t=zr(e,i,["cellBorderClipDirection"]))!==null&&t!==void 0?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return(t=zr(e,i,["_contentOffset"]))!==null&&t!==void 0?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=ce({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var r;return(r=o.fontSize)!==null&&r!==void 0?r:cC},get fontFamily(){var r;return(r=o.fontFamily)!==null&&r!==void 0?r:gC},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var r;return(r=o.bgColor)!==null&&r!==void 0?r:O2},get color(){var r;return(r=o.color)!==null&&r!==void 0?r:j2},get borderColor(){var r;return(r=o.borderColor)!==null&&r!==void 0?r:W2},get borderLineWidth(){var r;return(r=o.borderLineWidth)!==null&&r!==void 0?r:N2},get borderLineDash(){var r;return(r=o.borderLineDash)!==null&&r!==void 0?r:V2},get hover(){if(o.hover)return{get cellBgColor(){var r,s;return(s=(r=o.hover)===null||r===void 0?void 0:r.cellBgColor)!==null&&s!==void 0?s:void 0},get inlineColumnBgColor(){var r,s,l,a,h,d;return(d=(s=(r=o.hover)===null||r===void 0?void 0:r.inlineColumnBgColor)!==null&&s!==void 0?s:!((l=o.hover)===null||l===void 0)&&l.cellBgColor&&typeof((a=o.hover)===null||a===void 0?void 0:a.cellBgColor)=="string"?so((h=o.hover)===null||h===void 0?void 0:h.cellBgColor,.1,!1):void 0)!==null&&d!==void 0?d:void 0},get inlineRowBgColor(){var r,s,l,a,h,d;return(d=(s=(r=o.hover)===null||r===void 0?void 0:r.inlineRowBgColor)!==null&&s!==void 0?s:!((l=o.hover)===null||l===void 0)&&l.cellBgColor&&typeof((a=o.hover)===null||a===void 0?void 0:a.cellBgColor)=="string"?so((h=o.hover)===null||h===void 0?void 0:h.cellBgColor,.1,!1):void 0)!==null&&d!==void 0?d:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var r,s,l,a,h,d;return(d=(a=(s=(r=o.select)===null||r===void 0?void 0:r.inlineColumnBgColor)!==null&&s!==void 0?s:(l=t.selectionStyle)===null||l===void 0?void 0:l.inlineColumnBgColor)!==null&&a!==void 0?a:!((h=t.selectionStyle)===null||h===void 0)&&h.cellBgColor&&typeof t.selectionStyle.cellBgColor=="string"?so(t.selectionStyle.cellBgColor,.1,!1):void 0)!==null&&d!==void 0?d:void 0},get inlineRowBgColor(){var r,s,l,a,h;return(h=(l=(s=(r=o.select)===null||r===void 0?void 0:r.inlineRowBgColor)!==null&&s!==void 0?s:t.selectionStyle.inlineRowBgColor)!==null&&l!==void 0?l:!((a=t.selectionStyle)===null||a===void 0)&&a.cellBgColor&&typeof t.selectionStyle.cellBgColor=="string"?so(t.selectionStyle.cellBgColor,.1,!1):void 0)!==null&&h!==void 0?h:void 0}}},get padding(){var r;return(r=o.padding)!==null&&r!==void 0?r:[10,16,10,16]},get textAlign(){var r;return(r=o.textAlign)!==null&&r!==void 0?r:"left"},get textBaseline(){var r;return(r=o.textBaseline)!==null&&r!==void 0?r:"middle"},get textOverflow(){var r;return(r=o.textOverflow)!==null&&r!==void 0?r:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var r;return(r=o.autoWrapText)!==null&&r!==void 0&&r},get lineClamp(){var r;return(r=o.lineClamp)!==null&&r!==void 0?r:"auto"},get linkColor(){var r;return(r=o.linkColor)!==null&&r!==void 0?r:"#3772ff"},get cursor(){var r;return(r=o.cursor)!==null&&r!==void 0?r:"auto"},get marked(){var r;return(r=o.marked)!==null&&r!==void 0&&r},get underline(){var r;return(r=o.underline)!==null&&r!==void 0&&r},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var r;return(r=o.lineThrough)!==null&&r!==void 0&&r},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=ce({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=ce({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=ce({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=ce({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=ce({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=ce({},this.defaultStyle,i.rowHeaderStyle,(t=e.rowHeaderStyle)!==null&&t!==void 0?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get groupTitleStyle(){if(!this._groupTitle){const{obj:t,superTheme:e}=this.internalTheme;if(!e.groupTitleStyle&&!t.groupTitleStyle)return this._groupTitle;const i=ce({},this.defaultStyle,e.groupTitleStyle,t.groupTitleStyle);this._groupTitle=this.getStyle(i)}return this._groupTitle}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var o;return(o=i.scrollSliderColor)!==null&&o!==void 0?o:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var o;return(o=i.visible)!==null&&o!==void 0?o:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var o;return(o=i.width)!==null&&o!==void 0?o:7},get hoverOn(){var o;return(o=i.hoverOn)===null||o===void 0||o},get barToSide(){var o;return(o=i.barToSide)!==null&&o!==void 0&&o},get horizontalPadding(){var o;return(o=i.horizontalPadding)!==null&&o!==void 0?o:0},get verticalPadding(){var o;return(o=i.verticalPadding)!==null&&o!==void 0?o:0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var o;return(o=i.fontFamily)!==null&&o!==void 0?o:gC},get fontSize(){var o;return(o=i.fontSize)!==null&&o!==void 0?o:cC},get bgColor(){var o;return(o=i.bgColor)!==null&&o!==void 0?o:"#000"},get padding(){var o;return(o=i.padding)!==null&&o!==void 0?o:[6,8]},get color(){var o;return(o=i.color)!==null&&o!==void 0?o:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var o;return(o=i.lineColor)!==null&&o!==void 0?o:"#416EFF"},get bgColor(){var o;return(o=i.bgColor)!==null&&o!==void 0?o:"#D9E2FF"},get lineWidth(){var o;return(o=i.lineWidth)!==null&&o!==void 0?o:1},get width(){var o;return(o=i.width)!==null&&o!==void 0?o:i.lineWidth+2},get labelColor(){var o;return(o=i.labelColor)!==null&&o!==void 0?o:"#FFF"},get labelFontSize(){var o;return(o=i.labelFontSize)!==null&&o!==void 0?o:10},get labelFontFamily(){var o;return(o=i.labelFontFamily)!==null&&o!==void 0?o:"sans-serif"},get labelBackgroundFill(){var o;return(o=i.labelBackgroundFill)!==null&&o!==void 0?o:"#3073F2"},get labelBackgroundCornerRadius(){var o;return(o=i.labelBackgroundCornerRadius)!==null&&o!==void 0?o:5},get labelVisible(){var o;return(o=i.labelVisible)===null||o===void 0||o}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var o;return(o=i.lineColor)!==null&&o!==void 0?o:"blue"},get lineWidth(){var o;return(o=i.lineWidth)!==null&&o!==void 0?o:2},get shadowBlockColor(){var o;return(o=i.shadowBlockColor)!==null&&o!==void 0?o:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var o,r;return(r=(o=i.shadow)===null||o===void 0?void 0:o.width)!==null&&r!==void 0?r:24},get startColor(){var o,r;return(r=(o=i.shadow)===null||o===void 0?void 0:o.startColor)!==null&&r!==void 0?r:"rgba(00, 24, 47, 0.06)"},get endColor(){var o,r;return(r=(o=i.shadow)===null||o===void 0?void 0:o.endColor)!==null&&r!==void 0?r:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var o,r;return(r=(o=i.border)===null||o===void 0?void 0:o.lineColor)!==null&&r!==void 0?r:"rgba(00, 24, 47, 0.06)"},get bgColor(){var o,r,s,l;return(l=(r=(o=i.border)===null||o===void 0?void 0:o.bgColor)!==null&&r!==void 0?r:(s=i.border)===null||s===void 0?void 0:s.lineColor)!==null&&l!==void 0?l:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var o,r;return(r=(o=i.border)===null||o===void 0?void 0:o.lineWidth)!==null&&r!==void 0?r:4},get width(){var o,r,s,l;return(l=(r=(o=i.border)===null||o===void 0?void 0:o.width)!==null&&r!==void 0?r:(s=i.border)===null||s===void 0?void 0:s.lineWidth)!==null&&l!==void 0?l:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var o;return(o=i==null?void 0:i.cellBgColor)!==null&&o!==void 0?o:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var o;return(o=i==null?void 0:i.cellBorderColor)!==null&&o!==void 0?o:"#3073f2"},get cellBorderLineWidth(){var o;return(o=i==null?void 0:i.cellBorderLineWidth)!==null&&o!==void 0?o:2},get inlineColumnBgColor(){return i==null?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return i==null?void 0:i.inlineRowBgColor},get selectionFillMode(){var o;return(o=i==null?void 0:i.selectionFillMode)!==null&&o!==void 0?o:"overlay"}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.axisStyle,t.axisStyle);this._axisStyle=$2(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},Y2,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}get functionalIconsStyle(){if(!this._internalIconsStyle){const{obj:t,superTheme:e}=this.internalTheme,i=ce({},e.functionalIconsStyle,t.functionalIconsStyle);this._internalIconsStyle=i}return this._internalIconsStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return pC(e,t)||pC(i,t)}extends(t){return new Mi(ce({},t),ce(this.internalTheme.superTheme,this.internalTheme.obj))}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var i,o;return(o=(i=t.hover)===null||i===void 0?void 0:i.cellBgColor)!==null&&o!==void 0?o:void 0},get inlineColumnBgColor(){var i,o,r,s,l,a;return(a=(o=(i=t.hover)===null||i===void 0?void 0:i.inlineColumnBgColor)!==null&&o!==void 0?o:!((r=t.hover)===null||r===void 0)&&r.cellBgColor&&typeof((s=t.hover)===null||s===void 0?void 0:s.cellBgColor)=="string"?so((l=t.hover)===null||l===void 0?void 0:l.cellBgColor,.1,!1):void 0)!==null&&a!==void 0?a:void 0},get inlineRowBgColor(){var i,o,r,s,l,a;return(a=(o=(i=t.hover)===null||i===void 0?void 0:i.inlineRowBgColor)!==null&&o!==void 0?o:!((r=t.hover)===null||r===void 0)&&r.cellBgColor&&typeof((s=t.hover)===null||s===void 0?void 0:s.cellBgColor)=="string"?so((l=t.hover)===null||l===void 0?void 0:l.cellBgColor,.1,!1):void 0)!==null&&a!==void 0?a:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,r,s,l,a;return(a=(s=(o=(i=t.select)===null||i===void 0?void 0:i.inlineColumnBgColor)!==null&&o!==void 0?o:(r=e.selectionStyle)===null||r===void 0?void 0:r.inlineColumnBgColor)!==null&&s!==void 0?s:!((l=e.selectionStyle)===null||l===void 0)&&l.cellBgColor&&typeof e.selectionStyle.cellBgColor=="string"?so(e.selectionStyle.cellBgColor,.1,!1):void 0)!==null&&a!==void 0?a:void 0},get inlineRowBgColor(){var i,o,r,s,l;return(l=(r=(o=(i=t.select)===null||i===void 0?void 0:i.inlineRowBgColor)!==null&&o!==void 0?o:e.selectionStyle.inlineRowBgColor)!==null&&r!==void 0?r:!((s=e.selectionStyle)===null||s===void 0)&&s.cellBgColor&&typeof e.selectionStyle.cellBgColor=="string"?so(e.selectionStyle.cellBgColor,.1,!1):void 0)!==null&&l!==void 0?l:void 0},get cellBgColor(){var i,o,r;if(e.selectionStyle.selectionFillMode==="replace")return(r=(o=(i=t.select)===null||i===void 0?void 0:i.cellBgColor)!==null&&o!==void 0?o:e.selectionStyle.cellBgColor)!==null&&r!==void 0?r:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var i,o;return(o=(i=t.frameStyle)===null||i===void 0?void 0:i.borderColor)!==null&&o!==void 0?o:void 0},get borderLineWidth(){var i,o;return(o=(i=t.frameStyle)===null||i===void 0?void 0:i.borderLineWidth)!==null&&o!==void 0?o:void 0},get borderLineDash(){var i,o;return(o=(i=t.frameStyle)===null||i===void 0?void 0:i.borderLineDash)!==null&&o!==void 0?o:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var i;return(i=t.underline)!==null&&i!==void 0&&i},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var i;return(i=t.lineThrough)!==null&&i!==void 0&&i},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function pC(n,t){if(n instanceof Mi)return n.hasProperty(t);let e=n;if(!e)return!1;for(let i=0;i<t.length;i++)if(e=e[t[i]],!e)return!1;return!!e}const vC=new Mi(lC,lC),mC=new Mi(aC,aC),bC=new Mi(hC,hC),CC=new Mi(dC,dC),_C=new Mi(uC,uC),X2={DEFAULT:CC,SIMPLIFY:_C,ARCO:bC,DARK:vC,BRIGHT:mC},q2={TableTheme:Mi};function Z2(n){if(!n)return null;if(typeof n=="string"){const t=_2(yC(),n);return t?t instanceof Mi?t:new Mi(t,t):null}return n instanceof Mi?n:new Mi(n,n)}function yC(){return qs(X2,D2)}const ao={DARK:vC,BRIGHT:mC,ARCO:bC,DEFAULT:CC,SIMPLIFY:_C,theme:q2,of:Z2,get:yC};function ke(n,t,e){var i;if(n.internalProps.customMergeCell){const r=n.getCustomMerge(t,e);if(r)return r.range}if(!n.internalProps.enableTreeNodeMerge&&!n.isHeader(t,e)&&!(!((i=n.getBodyColumnDefine(t,e))===null||i===void 0)&&i.mergeCell))return!1;const o=n.getCellRange(t,e);return!(o.start.col===o.end.col&&o.start.row===o.end.row)&&o}class St{static registerComponent(t,e){St._components[t]=e}static getComponent(t){return St._components[t]}static registerFunction(t,e){St._functions[t]=e}static getFunction(t){return St._functions[t]}static registerCellType(t,e){St._cellTypes[t]=e}static getCellType(t){return St._cellTypes[t]}}St._components={},St._functions={},St._cellTypes={};function J2(n,t){const e=new Array(t);for(let i=0;i<t;i++)e[i]=n(i);return e}function Q2(n,t,e,i,o,r){const s=J2(n,e);s.sort((l,a)=>i(r(l),r(a),o));for(let l=0;l<e;l++)t(l,s[l])}class Wn{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=(e=t.isRecord)!==null&&e!==void 0?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[],this.clearCacheValue()}}class wC extends Wn{constructor(){super(...arguments),this.type=Mt.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),this.clearCacheValue()}deleteRecord(t){t&&this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),this.clearCacheValue())}value(){return this.records}reset(){this.records=[]}recalculate(){}}class SC extends Wn{constructor(){super(...arguments),this.type=Mt.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field])),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field]),this.clearCacheValue())}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class tE extends Wn{constructor(t){super(t),this.type=Mt.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),this.field&&this.records.length&&(this.values=this.records.map(i=>i[this.field])),this.clearCacheValue())}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),this.field&&this.records.length&&(this.values=this.records.map(e=>e[this.field]))),this.clearCacheValue()}value(){var t;return this.fieldValue||(this.fieldValue=(t=this.aggregationFun)===null||t===void 0?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class eE extends Wn{constructor(t){super(t),this.type=Mt.RECALCULATE,this.isRecord=!0,this.calculateFun=t.calculateFun,this.dependAggregators=t.dependAggregators,this.dependIndicatorKeys=t.dependIndicatorKeys}push(t){t&&this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),this.clearCacheValue()}deleteRecord(t){t&&this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),this.clearCacheValue())}value(){var t;if(!this.fieldValue){const e=oE(this.dependAggregators,this.dependIndicatorKeys);this.fieldValue=(t=this.calculateFun)===null||t===void 0?void 0:t.call(this,e,this.records,this.field)}return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class xC extends Wn{constructor(t){var e;super(t),this.type=Mt.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=(e=t.needSplitPositiveAndNegative)!==null&&e!==void 0&&e}push(t){if(t){if(this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),t.className==="Aggregator"){const e=t.value();this.sum+=e??0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}}this.clearCacheValue()}deleteRecord(t){if(t){if(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),t.className==="Aggregator"){const e=t.value();this.sum-=e??0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum-=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}}this.clearCacheValue()}updateRecord(t,e){if(t&&e){if(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),t.className==="Aggregator"){const i=t.value(),o=e.value();this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const i=parseFloat(t[this.field]),o=parseFloat(e[this.field]);this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}this.clearCacheValue()}}value(){var t;return((t=this.records)===null||t===void 0?void 0:t.length)>=1?this.sum:void 0}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){super.reset(),this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if(e.className==="Aggregator"){const i=e.value();this.sum+=i??0,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum+=i:i<0&&(this.nagetiveSum+=i))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const i=parseFloat(e[this.field]);this.sum+=i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum+=i:i<0&&(this.nagetiveSum+=i))}}}}class AC extends Wn{constructor(){super(...arguments),this.type=Mt.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),t.className==="Aggregator"?this.count+=t.value():this.count++),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),t.className==="Aggregator"?this.count-=t.value():this.count--),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),t.className==="Aggregator"&&(this.count+=e.value()-t.value()))}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];e.className==="Aggregator"?this.count+=e.value():this.count++}}}class RC extends Wn{constructor(){super(...arguments),this.type=Mt.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),t.className==="Aggregator"&&t.type===Mt.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),t.className==="Aggregator"&&t.type===Mt.AVG?(this.sum-=t.sum,this.count-=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum-=parseFloat(t[this.field]),this.count--)),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),t.className==="Aggregator"&&t.type===Mt.AVG?(this.sum+=e.sum-t.sum,this.count+=e.count-t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(e[this.field])-parseFloat(t[this.field])),this.clearCacheValue())}value(){var t;return((t=this.records)===null||t===void 0?void 0:t.length)>=1?this.sum/this.count:void 0}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];e.className==="Aggregator"&&e.type===Mt.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class TC extends Wn{constructor(){super(...arguments),this.type=Mt.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),t.className==="Aggregator"?this.max=t.max>this.max?t.max:this.max:typeof t=="number"?this.max=t>this.max?t:this.max:this.field&&typeof t[this.field]=="number"?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),this.recalculate())}value(){var t;return((t=this.records)===null||t===void 0?void 0:t.length)>=1?this.max:void 0}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];e.className==="Aggregator"?this.max=e.max>this.max?e.max:this.max:typeof e=="number"?this.max=e>this.max?e:this.max:this.field&&typeof e[this.field]=="number"?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class MC extends Wn{constructor(){super(...arguments),this.type=Mt.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&(t.className==="Aggregator"?this.records.push(...t.records):this.records.push(t)),t.className==="Aggregator"?this.min=t.min<this.min?t.min:this.min:typeof t=="number"?this.min=t<this.min?t:this.min:this.field&&typeof t[this.field]=="number"?this.min=t[this.field]<this.min?t[this.field]:this.min:this.field&&!isNaN(t[this.field])&&(this.min=parseFloat(t[this.field])<this.min?parseFloat(t[this.field]):this.min)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter(e=>e!==t)),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map(i=>i===t?e:i)),this.recalculate())}value(){var t;return((t=this.records)===null||t===void 0?void 0:t.length)>=1?this.min:void 0}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];e.className==="Aggregator"?this.min=e.min<this.min?e.min:this.min:typeof e=="number"?this.min=e<this.min?e:this.min:this.field&&typeof e[this.field]=="number"?this.min=e[this.field]<this.min?e[this.field]:this.min:this.field&&!isNaN(e[this.field])&&(this.min=parseFloat(e[this.field])<this.min?parseFloat(e[this.field]):this.min)}}}function iE(n,t,e){if(e===Ve.NORMAL||e===Ve.normal)return 0;const i=e===Ve.DESC||e===Ve.desc?-1:1;return n&&t?n.toString().localeCompare(t.toString(),"zh")*i:n?1*i:-1*i}function Fh(n,t,e){if(e===Ve.NORMAL||e===Ve.normal)return 0;const i=/(\d+)|(\D+)/g,o=/\d/,r=/^0/;let s,l,a,h,d=0,u=0;const c=e===Ve.DESC||e===Ve.desc?-1:1;if(t!==null&&n===null)return-1*c;if(n!==null&&t===null)return 1*c;if(typeof n=="number"&&isNaN(n))return-1*c;if(typeof t=="number"&&isNaN(t))return 1*c;if(d=+n,u=+t,d<u)return-1*c;if(d>u)return 1*c;if(typeof n=="number"&&typeof t!="number")return-1*c;if(typeof t=="number"&&typeof n!="number")return 1*c;if(typeof n=="number"&&typeof t=="number")return 0;if(isNaN(u)&&!isNaN(d))return-1*c;if(isNaN(d)&&!isNaN(u))return 1*c;if(s=String(n),a=String(t),s===a)return 0;if(!o.test(s)||!o.test(a))return(s>a?1:-1)*c;for(s=s.match(i),a=a.match(i);s.length&&a.length;)if(l=s.shift(),h=a.shift(),l!==h)return o.test(l)&&o.test(h)?(l.replace(r,".0")-h.replace(r,".0"))*c:(l>h?1:-1)*c;return(s.length-a.length)*c}function nE(n){let t;const e={},i={};for(let o=0;o<n.length;o++)t=n[o],e[t]=o,typeof t=="string"&&(i[t.toLowerCase()]=o);return function(o,r,s){if(s===Ve.NORMAL||s===Ve.normal)return 0;const l=s===Ve.DESC||s===Ve.desc?-1:1;let a;return e[o]!==null&&e[o]!==void 0&&e[r]!==null&&e[r]!==void 0?a=e[o]-e[r]:e[o]!==null&&e[o]!==void 0?a=-1:e[r]!==null&&e[r]!==void 0?a=1:i[o]!==null&&e[o]!==void 0&&i[r]!==null&&e[r]!==void 0?a=i[o]-i[r]:i[o]===null||e[o]===void 0||i[r]===null||e[r]===void 0?a=0:i[o]!==null&&e[o]!==void 0?a=-1:i[r]!==null&&e[r]!==void 0&&(a=1),I(a)?a*l:Fh(o,r,s)}}function oE(n,t){const e={};for(let i=0;i<(t==null?void 0:t.length);i++){const o=n.find(r=>r.key===t[i]);o&&(e[o.key]=o==null?void 0:o.value())}return e}function rE(n){if(rC.isObject(n)){const t=n;if(I(t.get)&&I(t.set))return!0}return!1}const kh={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function Do(n,t){const e=xe(n);if(Cn(e)){const i=e.then(o=>(t(o),o));return t(i),i}return e}function Ih(n,t,e,i,o,r){if(n==null)return;if(Cn(n))return n.then(a=>Ih(a,t,e,i,o,r));const s=rE(t)?t.get:t;if(s in n)return Do(n[s],r);if(typeof s=="function")return Do(s(n,e,i,o),r);if(Array.isArray(s))return Do(u2(n,[...s]),r);const l=`${s}`.split(".");return l.length<=1?Do(n[s],r):Do(iC(n,(a,h)=>Ih(a,h,e,i,o,R2),...l),r)}function Dr(n,t){if(!n)return t;const e=n[t];return I(e)?e:t}class Oo extends Th{static get EVENT_TYPE(){return kh}constructor(t,e,i,o,r,s){var l;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap={},this.registedAggregators={},this.fieldAggregators=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=t==null?void 0:t.get,this.columns=o,this._source=t!=null&&t.records?this.processRecords(t==null?void 0:t.records):t,this._sourceLength=((l=this._source)===null||l===void 0?void 0:l.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},s>=1&&(this.hierarchyExpandLevel=s),this.currentIndexedData=Array.from({length:this._sourceLength},(a,h)=>h),r==="tree"&&this.initTreeHierarchyState(),this.rowHierarchyType=r,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},(i,o)=>o);let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],r=this.getOriginalRecord(o),s=(t=r.filteredChildren)!==null&&t!==void 0?t:r.children;if((s==null?void 0:s.length)>0){if(this.hierarchyExpandLevel>1?!r.hierarchyState&&(r.hierarchyState=Pt.expand):!r.hierarchyState&&(r.hierarchyState=Pt.collapse),this.hasHierarchyStateExpand=!0,r.hierarchyState===Pt.collapse)continue;const l=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,r);i+=l,e+=l}else r.children===!0&&!r.hierarchyState&&(r.hierarchyState=Pt.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(Mt.RECORD,wC),this.registerAggregator(Mt.SUM,xC),this.registerAggregator(Mt.COUNT,AC),this.registerAggregator(Mt.MAX,TC),this.registerAggregator(Mt.MIN,MC),this.registerAggregator(Mt.AVG,RC),this.registerAggregator(Mt.NONE,SC),this.registerAggregator(Mt.CUSTOM,tE)}updateColumns(t){this.columns=t}_generateFieldAggragations(){const t=this.columns;this.fieldAggregators=[];for(let e=0;e<(t==null?void 0:t.length);e++){delete t[e].vtable_aggregator;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let r=0;r<o.length;r++){const s=o[r],l=new this.registedAggregators[s.aggregationType]({dimension:i,formatFun:s.formatFun,isRecord:!0,aggregationFun:s.aggregationFun});this.fieldAggregators.push(l),t[e].vtable_aggregator||(t[e].vtable_aggregator=[]),t[e].vtable_aggregator.push(l)}else{const r=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(r),t[e].vtable_aggregator=r}}}processRecords(t){var e,i,o,r,s,l,a,h;this._generateFieldAggragations();const d=[],u=this.fieldAggregators.length>=1;if(((i=(e=this.dataConfig)===null||e===void 0?void 0:e.filterRules)===null||i===void 0?void 0:i.length)>=1||((o=this.lastFilterRules)===null||o===void 0?void 0:o.length)>=1||u){for(let c=0,g=t.length;c<g;c++){const f=t[c];((s=(r=this.dataConfig)===null||r===void 0?void 0:r.filterRules)===null||s===void 0?void 0:s.length)>=1?this.filterRecord(f)&&(d.push(f),this.rowHierarchyType==="tree"&&f.children&&(f.filteredChildren=this.filteredChildren(f.children)),u&&this.processRecord(f)):((l=this.lastFilterRules)===null||l===void 0?void 0:l.length)>=1?(this.clearFilteredChildren(f),u&&this.processRecord(f)):u&&this.processRecord(f)}if(((h=(a=this.dataConfig)===null||a===void 0?void 0:a.filterRules)===null||h===void 0?void 0:h.length)>=1)return d}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const r=t[i];this.filterRecord(r)&&(e.push(r),r.children&&(r.filteredChildren=this.filteredChildren(r.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var r,s,l;let a=0;const h=o.filteredChildren?o.filteredChildren.length:(s=(r=o.children)===null||r===void 0?void 0:r.length)!==null&&s!==void 0?s:0;for(let d=0;d<h;d++){(i<=e||o.hierarchyState===Pt.expand)&&(a+=1);const u=o.filteredChildren?o.filteredChildren[d]:o.children[d],c=Array.isArray(t)?t.concat(d):[t,d];(i<=e||o.hierarchyState===Pt.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+a,0,c),(u.filteredChildren?u.filteredChildren.length>0:((l=u.children)===null||l===void 0?void 0:l.length)>0)&&(i<e||u.hierarchyState===Pt.expand?(!u.hierarchyState&&(u.hierarchyState=Pt.expand),this.hasHierarchyStateExpand=!0):!u.hierarchyState&&(u.hierarchyState=Pt.collapse)),u.hierarchyState===Pt.expand&&(a+=this.initChildrenNodeHierarchy(c,e,i+1,u)),u.children===!0&&!u.hierarchyState&&(u.hierarchyState=Pt.collapse)}return a}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),r=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let s=-1;for(let l=0;l<t.length;l++)if((Array.isArray(t[l])&&t[l].length===1||!Array.isArray(t[l]))&&s++,s>=o&&s<r)this._currentPagerIndexedData.push(t[l]);else if(s>=r)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(Dr(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(Dr(this.currentPagerIndexedData,t))}getIndexKey(t){return Dr(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex(e=>is(e,t)):this.currentPagerIndexedData.findIndex(e=>e===t)}getField(t,e,i,o,r){return this.getOriginalField(Dr(this.currentPagerIndexedData,t),e,i,o,r)}getRawField(t,e,i,o,r){return this.getRawFieldData(Dr(this.currentPagerIndexedData,t),e,i,o,r)}hasField(t,e){return this.hasOriginalField(Dr(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentPagerIndexedData[t]);return(e=i==null?void 0:i.hierarchyState)!==null&&e!==void 0?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),r=this.getIndexKey(t),s=this.getHierarchyState(t),l=this.getOriginalRecord(r);if(this.clearSortedIndexMap(),s===Pt.collapse)l.hierarchyState=Pt.expand,this.pushChildrenNode(r,Pt.expand,l),this.hasHierarchyStateExpand=!0;else if(s===Pt.expand){let d=0;const u=(c,g,f)=>{if(!g||g===Pt.collapse||g===Pt.none)return;const p=f.filteredChildren?f.filteredChildren:f.children;if(p)for(let v=0;v<p.length;v++){d+=1;const m=Array.isArray(c)?c.concat([v]):[c,v];u(m,p[v].hierarchyState,p[v])}};u(r,s,l),this.currentIndexedData.splice(this.currentIndexedData.indexOf(r)+1,d),l.hierarchyState=Pt.collapse}this.updatePagerData();const a=[],h=[];if(s===Pt.collapse){const d=this.currentIndexedData.length-o.length;for(let u=0;u<d;u++)a.push(t+u+1)}else if(s===Pt.expand){const d=o.length-this.currentIndexedData.length;for(let u=0;u<d;u++)h.push(t+u+1)}return{add:a,remove:h}}pushChildrenNode(t,e,i){var o,r;if(!e||e===Pt.collapse||e===Pt.none)return 0;let s=0;const l=i.filteredChildren?i.filteredChildren:i.children;if(l){const a=Array.from({length:l.length},(h,d)=>d);(o=this.lastSortStates)===null||o===void 0||o.forEach(h=>{h.order!=="normal"&&Q2(d=>I(a[d])?a[d]:a[d]=d,(d,u)=>{a[d]=u},l.length,h.orderFn,h.order,d=>this.getOriginalField(Array.isArray(t)?t.concat([d]):[t,d],h.field))});for(let h=0;h<a.length;h++){s+=1;const d=Array.isArray(t)?t.concat([a[h]]):[t,a[h]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+s,0,d);const u=this.getOriginalRecord(d);!u.hierarchyState&&((r=u.filteredChildren)!==null&&r!==void 0?r:u.children)&&(u.hierarchyState=Pt.collapse),s+=this.pushChildrenNode(d,u.hierarchyState,l[a[h]])}}return s}changeFieldValue(t,e,i,o,r,s){var l;if(i!==null&&e>=0){const a=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[a]){const h=this.getOriginalRecord(a);this.beforeChangedRecordsMap[a]=(l=Be(h))!==null&&l!==void 0?l:{}}if(typeof i=="string"||typeof i=="number"){const h=this.beforeChangedRecordsMap[a][i],d=this.getOriginalRecord(a);let u=t;typeof h=="number"&&ug(t)&&(u=parseFloat(t)),Cn(d)?d.then(c=>{c[i]=u}).catch(c=>{}):d?d[i]=u:(this.records[a]={},this.records[a][i]=u)}}}setRecord(t,e){var i,o;let r=!0;if(((o=(i=this.dataConfig)===null||i===void 0?void 0:i.filterRules)===null||o===void 0?void 0:o.length)>=1&&(this.filterRecord(t)?this.rowHierarchyType==="tree"&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):r=!1),r&&Array.isArray(this.records)){const s=this.getIndexKey(e);Array.isArray(s)||this.records.splice(s,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1;for(let o=0;o<this.fieldAggregators.length;o++)this.fieldAggregators[o].push(t);if(this.rowHierarchyType==="tree"&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:o,currentPage:r}=this.pagination;e<o*(r||0)+o&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();!((i=this.dataSourceObj)===null||i===void 0)&&i.added&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let o=0;o<t.length;o++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length;for(let o=0;o<this.fieldAggregators.length;o++)for(let r=0;r<t.length;r++)this.fieldAggregators[o].push(t[r])}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:o,currentPage:r}=this.pagination;e<o*(r||0)+o&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();!((i=this.dataSourceObj)===null||i===void 0)&&i.added&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const o=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=o}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort((r,s)=>s-r);for(let r=0;r<o.length;r++){const s=o[r];if(s>=this._sourceLength||s<0)continue;delete this.beforeChangedRecordsMap[s],i.push(s);const l=this.records[s];for(let a=0;a<this.fieldAggregators.length;a++)this.fieldAggregators[a].deleteRecord(l);this.records.splice(s,1),this.currentIndexedData.pop(),this._sourceLength-=1}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),!((e=this.dataSourceObj)===null||e===void 0)&&e.deleted&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort((i,o)=>o-i);for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const r=this.currentIndexedData[o];delete this.beforeChangedRecordsMap[r],this.records.splice(r,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const r=e[o];if(Array.isArray(r))delete this.beforeChangedRecordsMap[r.join(",")],i.push(r),r.slice(0,-1).reduce((s,l)=>(s[l]===void 0&&(s[l]={}),s[l].children),this.records)[r[r.length-1]]=t[o];else{if(r>=this._sourceLength||r<0)continue;delete this.beforeChangedRecordsMap[r],i.push(r);for(let s=0;s<this.fieldAggregators.length;s++)this.fieldAggregators[s].updateRecord(this.records[r],t[o]);this.records[r]=t[o]}}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const r=this.currentIndexedData[o];if(typeof r!="number")return;delete this.beforeChangedRecordsMap[r],this.records[r]=t[i]}this.sortedIndexMap.clear()}sort(t){t=(Array.isArray(t)?t:[t]).filter(r=>{const s=this.columns.find(l=>l.field===r.field);return(s==null?void 0:s.sort)!==!1&&r.order!=="normal"}),this.lastSortStates=t;let e=t.map(r=>this.sortedIndexMap.get(r==null?void 0:r.field)||{asc:[],desc:[],normal:[]}),i=null;if(e.length>0&&(i=t.reduce((r,s,l)=>{var a;const h=(a=e[l])===null||a===void 0?void 0:a[s.order];return h&&h.length>0?h:r},null),i&&i.length>0))return this.currentIndexedData=i,this.updatePagerData(),void this.fireListeners(kh.CHANGE_ORDER,null);const o=Array.from({length:this._sourceLength},(r,s)=>s);if(o.sort((r,s)=>t.reduce((l,a)=>l!==0?l:(a.orderFn||(a.order!=="desc"?(h,d)=>h===d?0:h>d?1:-1:(h,d)=>h===d?0:h<d?1:-1))(this.getOriginalField(r,a.field),this.getOriginalField(s,a.field),a.order),0)),this.currentIndexedData=o,this.hierarchyExpandLevel){let r=o.length;for(let s=0;s<r;s++){const l=this.getOriginalRecord(o[s]),a=this.pushChildrenNode(o[s],l.hierarchyState,this.getOriginalRecord(o[s]));r+=a,s+=a}}if(!e.length){e=t.map(()=>({asc:[],desc:[],normal:[]}));for(let r=0;r<t.length;r++)this.sortedIndexMap.set(t[r].field,e[r])}t.forEach((r,s)=>{e[s][r.order]=o.slice()}),this.updatePagerData(),this.fireListeners(kh.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;(i=o<((e=t.children)===null||e===void 0?void 0:e.length))!==null&&i!==void 0&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let r=!0;for(let s=0;s<((e=this.dataConfig.filterRules)===null||e===void 0?void 0:e.length);s++){const l=(i=this.dataConfig)===null||i===void 0?void 0:i.filterRules[s];if(l.filterKey){const a=t[l.filterKey];if(l.filteredValues.indexOf(a)===-1){r=!1;break}}else if(!(!((o=l.filterFunc)===null||o===void 0)&&o.call(l,t))){r=!1;break}}return r}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords((i=(e=this.dataSourceObj)===null||e===void 0?void 0:e.records)!==null&&i!==void 0?i:this.dataSourceObj),this._sourceLength=((o=this._source)===null||o===void 0?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},(r,s)=>s),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords((i=(e=this.dataSourceObj)===null||e===void 0?void 0:e.records)!==null&&i!==void 0?i:this.dataSourceObj),this._sourceLength=((o=this._source)===null||o===void 0?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},(r,s)=>s),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.rowHierarchyType==="tree"&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastSortStates&&this.lastSortStates.length>0&&this.sortedIndexMap.forEach((t,e)=>{this.lastSortStates.some(i=>i.field===e)?this.lastSortStates.forEach(i=>{i.order==="asc"?(t.desc=[],t.normal=[]):i.order==="desc"?(t.asc=[],t.normal=[]):(t.asc=[],t.desc=[])}):this.sortedIndexMap.delete(e)})}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(kh.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;(t=super.release)===null||t===void 0||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach(t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)}),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?BC(this.records,t):this.records[t]:this._get(t),Do(e,i=>{this.recordPromiseCallBack(t,i)})}getRawRecord(t){var e;if(!((e=this.beforeChangedRecordsMap)===null||e===void 0)&&e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?BC(this.records,t):this.records[t]:this._get(t),Do(i,o=>{this.recordPromiseCallBack(t,o)})}getOriginalField(t,e,i,o,r){if(e!==null)return Ih(this.getOriginalRecord(t),e,i,o,r,s=>{this.fieldPromiseCallBack(t,e,s)})}getRawFieldData(t,e,i,o,r){if(e!==null)return Ih(this.getRawRecord(t),e,i,o,r,s=>{this.fieldPromiseCallBack(t,e,s)})}hasOriginalField(t,e){if(e===null)return!1;if(typeof e=="function")return!0;const i=this.getOriginalRecord(t);return!!(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let r=this.currentPagerIndexedData[e+1];r=Array.isArray(r)?[...r]:[r],r.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let r=0;r<=i.length-2;r++)if(i[r]!==o[r])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i,o;if(!(!((i=this.lastSortStates)===null||i===void 0)&&i.some(r=>r.order==="asc"||r.order==="desc"))&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let r,s,l=this.currentPagerIndexedData[t],a=this.currentPagerIndexedData[e];if(l=Array.isArray(l)?[...l]:[l],a=Array.isArray(a)?[...a]:[a],l.length>1||a.length>1){if(e>t&&a.length>l.length){let h=this.currentPagerIndexedData[e+1];h=Array.isArray(h)?[...h]:[h],h.length<a.length&&a.splice(a.length-1,1)}if(r=l.splice(l.length-1,1)[0],s=a.splice(a.length-1,1)[0],l.length>=1){const h=this.getOriginalRecord(l),d=h.filteredChildren?h.filteredChildren.splice(r,1):h.children.splice(r,1);d.unshift(s,0),Array.prototype.splice.apply((o=h.filteredChildren)!==null&&o!==void 0?o:h.children,d)}else{const h=this.records.splice(r,1);h.unshift(s,0),Array.prototype.splice.apply(this.records,h)}}else{r=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];const h=this.records.splice(r,1);h.unshift(s,0),Array.prototype.splice.apply(this.records,h)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const r=this.records.splice(t,1);r.unshift(e,0),Array.prototype.splice.apply(this.records,r)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let o=0;o<this._sourceLength;o++){const r=this.getOriginalRecord(o);((t=r.filteredChildren)!==null&&t!==void 0?t:r.children)&&!r.hierarchyState&&(r.hierarchyState=Pt.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},(o,r)=>r);let i=this._sourceLength;for(let o=0;o<i;o++){const r=this.currentIndexedData[o],s=this.getOriginalRecord(r),l=(e=s.filteredChildren)!==null&&e!==void 0?e:s.children;if((l==null?void 0:l.length)>0&&s.hierarchyState===Pt.expand){this.hasHierarchyStateExpand=!0;const a=this.restoreChildrenNodeHierarchy(r,s);o+=a,i+=a}else s.children===!0&&!s.hierarchyState&&(s.hierarchyState=Pt.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let r=0;const s=(i=e.filteredChildren)!==null&&i!==void 0?i:e.children,l=(o=s==null?void 0:s.length)!==null&&o!==void 0?o:0;for(let a=0;a<l;a++){e.hierarchyState===Pt.expand&&(r+=1);const h=s[a],d=Array.isArray(t)?t.concat(a):[t,a];e.hierarchyState===Pt.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,d),r+=this.restoreChildrenNodeHierarchy(d,h)}return r}}function BC(n,t){var e;let i=n;for(let o=0;o<t.length;o++){const r=t[o];if(!i[r])return;i=i[r];const s=(e=i.filteredChildren)!==null&&e!==void 0?e:i==null?void 0:i.children;s&&o+1<t.length&&(i=s)}return i}Oo.EMPTY=new Oo({get(){},length:0});function sE(n,t,e,i){(n[t]||(n[t]=new Map)).set(e,i)}class vg extends Oo{static get EVENT_TYPE(){return Oo.EVENT_TYPE}static ofArray(t,e,i,o,r,s){return new vg({get:l=>t[l],length:t.length,records:t},e,i,o,r,s)}constructor(t,e,i,o,r,s){it(e==null?void 0:e.groupByRules)&&(r="tree"),super(t,e,i,o,r,s),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getRawRecord(t){var e;return!((e=this.beforeChangedRecordsMap)===null||e===void 0)&&e[t]?this.beforeChangedRecordsMap[t]:this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getRawRecord(t)}getOriginalField(t,e,i,o,r){const s=this._fieldCache&&this._fieldCache[t];if(s){const l=s.get(e);if(l)return l}return super.getOriginalField(t,e,i,o,r)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){sE(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache&&(this._recordCache[t]=e)}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;(t=super.release)===null||t===void 0||t.call(this),this._recordCache=null,this._fieldCache=null}_generateFieldAggragations(){var t;if(super._generateFieldAggragations(),it((t=this.dataConfig)===null||t===void 0?void 0:t.groupByRules)){const e=this.dataConfig.groupByRules;this.groupAggregator=new this.registedAggregators[Mt.CUSTOM]({dimension:"",aggregationFun:(i,o,r)=>{const s=new Map,l=[];for(let a=0;a<o.length;a++)mg(o[a],l,s,e,0),o[a].vtableOriginIndex=a;return l}}),this.fieldAggregators.push(this.groupAggregator)}}processRecords(t){var e;const i=super.processRecords(t);return((e=this.groupAggregator)===null||e===void 0?void 0:e.value())||i}getGroupLength(){var t,e,i;return(i=(e=(t=this.dataConfig)===null||t===void 0?void 0:t.groupByRules)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:0}updateGroup(){var t,e,i;this.clearCache();const o=this.source;this._source=this.processRecords((e=(t=this.dataSourceObj)===null||t===void 0?void 0:t.records)!==null&&e!==void 0?e:this.dataSourceObj),o&&PC(o,this.source),this.sourceLength=((i=this.source)===null||i===void 0?void 0:i.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this.sourceLength},(r,s)=>s),this.userPagination||(this.pagination.perPageCount=this.sourceLength,this.pagination.totalCount=this.sourceLength),this.initTreeHierarchyState(),this.updatePagerData()}addRecordsForGroup(t,e){it(t)&&t.length!==0&&((e===void 0||e>this.dataSourceObj.records)&&(e=this.dataSourceObj.records),this.dataSourceObj.records.splice(e,0,...t),this.updateGroup())}deleteRecordsForGroup(t){if(!it(t)||t.length===0)return;const e=t.sort((i,o)=>o-i);for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records.splice(o,1),this.sourceLength-=1)}this.updateGroup()}updateRecordsForGroup(t,e){for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records[o]=t[i])}this.updateGroup()}}function mg(n,t,e,i,o){const r=i[o];if(!I(r))return void t.push(n);const s=n[r];if(s!==void 0){if(e.has(s)){const l=e.get(s);return mg(n,t[l].children,t[l].map,i,o+1)}return e.set(s,t.length),t.push({vtableMerge:!0,vtableMergeName:s,children:[],map:new Map}),mg(n,t[t.length-1].children,t[t.length-1].map,i,o+1)}}function PC(n,t,e,i){if(!e){e=new Map;for(let o=0;o<n.length;o++){const r=n[o];r.vtableMerge&&e.set(r.vtableMergeName,o)}}if(!i){i=new Map;for(let o=0;o<t.length;o++){const r=t[o];r.vtableMerge&&i.set(r.vtableMergeName,o)}}for(let o=0;o<n.length;o++){const r=n[o],s=t[i.get(r.vtableMergeName)];I(s)&&(s.hierarchyState=n[o].hierarchyState),it(r.children)&&it(s.children)&&r.map.size!==0&&s.map.size!==0&&PC(r.children,s.children,r.map,s.map)}}var zh={},lE={get exports(){return zh},set exports(n){zh=n}},Dh={},aE=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),hE=["style","variant","weight","size","lineHeight","family"],dE=/([\.0-9]+)(.*)/,HC=function(n,t,e){var i=n.match(dE);if(i){n=parseFloat(i[1]);var o=i[2].toLowerCase().trim(),r=Math.round(n);switch(r===n&&(n=r),o){case"em":return t===null?void 0:n*t;case"px":return n;case"pt":return n/(72/e);case"pc":return n/(6/e);case"mm":return n*(e/25.4);case"cm":return n*(e/2.54);case"in":return n*e;case"%":return t===null?void 0:t*(n/100)}}},EC={size:HC,lineHeight:HC},LC={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},uE=lE.exports=function(n,t,e){var i=n+"-"+(t||"null")+"@"+e;if(e=e||96,typeof Dh[i]<"u")return Dh[i];if(t&&(t=uE(t,null,e)),n==="inherit")return t;var o=aE.exec(n);if(!o){Dh[i]=null;return}o.shift();for(var r={},s=0;s<o.length;s++){var l=hE[s],a=o[s];if(EC[l]&&a){var h=t&&t[l]||null,d=EC[l](a,h,e);typeof d>"u"&&l==="lineHeight"&&a?a=r.size*parseFloat(a):a=d}if(!(!a||a==="normal")){if(a==="inherit"){if(!t)return;a=t[l]}a.trim&&(a=a.trim()),r[l]=a}}Object.keys(r).length||(r=null),Dh[i]=r;var u=[];r.style&&u.push(r.style),r.variant&&u.push(r.variant),r.weight&&r.weight!=="400"&&r.weight!=="normal"&&u.push(r.weight),u.push(r.size+"px"),r.lineHeight&&(u[u.length-1]+="/"+r.lineHeight+"px");var c=r.family.split(",");return r.family=c.map(function(g){return g=g.trim(),LC[g.toLowerCase()]&&(g=g.toLowerCase()),g}),u.push(r.family),Object.defineProperty(r,"toString",{value:function(){return u.map(function(g){return Array.isArray(g)?g.map(function(f){return f.indexOf(" ")>-1?'"'+f.replace(/["']/g,"")+'"':f}).join(", "):g}).join(" ")}}),r};zh.generics=LC;function cE(n){return zh(n)}function kt(n){var t,e,i,o;if(nt(n)||Qt(n)||it(n)){let r=gs(n);return typeof r=="number"||typeof r=="string"?r=[r,r,r,r]:Array.isArray(r)&&(r=r.slice(0)),r}return n&&(isFinite(n.bottom)||isFinite(n.left)||isFinite(n.right)||isFinite(n.top))?[(t=n.top)!==null&&t!==void 0?t:0,(e=n.right)!==null&&e!==void 0?e:0,(i=n.bottom)!==null&&i!==void 0?i:0,(o=n.left)!==null&&o!==void 0?o:0]:[0,0,0,0]}const Oh=0,FC=1,Wh=2,kC=3,IC=10,zC=11,DC=12,gE=9,fE=13,pE=10,vE=12,mE=32,bE=37,CE=46,_E=48,yE=57,wE=65,SE=90,xE=97,AE=122;function RE(n){return n>=wE&&n<=SE}function TE(n){return n>=xE&&n<=AE}function ME(n){return TE(n)||RE(n)}function BE(n){return n===gE||n===pE||n===vE||n===fE||n===mE}function bg(n){return n>=_E&&n<=yE}function OC(n){return n===CE}function WC(n){return ME(n)||n===bE}function Qs(n){return new Error(`calc parse error: ${n}`)}function PE(n){const t=n.replace(/calc\(/g,"(").trim(),e=[],i=t.length;for(let l=0;l<i;l++){const a=t[l],h=a.charCodeAt(0);if(a==="("||a===")")e.push({value:a,type:Oh});else if(a==="*"||a==="/")e.push({value:a,type:Wh});else if(a==="+"||a==="-")l=o(a,l+1)-1;else if(bg(h)||OC(h))l=r(a,l+1)-1;else if(!BE(h))throw Qs(n)}function o(l,a){if(a<i){const h=t[a],d=h.charCodeAt(0);if(bg(d)||OC(d))return r(l+h,a+1)}return e.push({value:l,type:Wh}),a}function r(l,a){let h=a;for(;h<i;h++){const d=t[h],u=d.charCodeAt(0);if(bg(u))l+=d;else{if(d!=="."){if(WC(u))return s(l,d,h+1);break}if(l.indexOf(".")>=0)throw Qs(n);l+=d}}if(l===".")throw Qs(n);return e.push({value:parseFloat(l),type:kC}),h}function s(l,a,h){let d=h;for(;d<i;d++){const u=t[d];if(!WC(u.charCodeAt(0)))break;a+=u}return e.push({value:parseFloat(l),unit:a,type:FC}),d}return e}const NC={"*":3,"/":3,"+":2,"-":2};function VC(n,t){function e(o){const r=o.pop(),s=o.pop(),l=o.pop();if(!(l&&l.nodeType&&s&&s.type===Wh&&r&&r.nodeType))throw Qs(t);return{nodeType:zC,left:l,op:s,right:r}}const i=[];for(;n.length;){const o=n.shift();if(o.type===Oh&&o.value==="("){let r=0;const s=Qb.findIndex(n,l=>{if(l.type===Oh&&l.value==="(")r++;else if(l.type===Oh&&l.value===")"){if(!r)return!0;r--}return!1});if(s===-1)throw Qs(t);i.push(VC(n.splice(0,s),t)),n.shift()}else if(o.type===Wh){if(i.length>=3){const r=i[i.length-2].value;NC[o.value]<=NC[r]&&i.push(e(i))}i.push(o)}else if(o.type===FC){const{value:r,unit:s}=o;i.push({nodeType:IC,value:r,unit:s})}else o.type===kC&&i.push({nodeType:DC,value:o.value})}for(;i.length>1;)i.push(e(i));return i[0]}function HE(n){return VC(PE(n),n)}function Cg(n,t){if(n.nodeType===zC){const e=Cg(n.left,t),i=Cg(n.right,t);switch(n.op.value){case"+":return e+i;case"-":return e-i;case"*":return e*i;case"/":return e/i;default:throw new Error(`calc error. unknown operator: ${n.op.value}`)}}else if(n.nodeType===IC)switch(n.unit){case"%":return n.value*t.full/100;case"px":return n.value;default:throw new Error(`calc error. unknown unit: ${n.unit}`)}else if(n.nodeType===DC)return n.value;throw new Error("calc error.")}function EE(n,t){return Cg(HE(n),t)}function LE(n,t){return typeof n=="string"?EE(n.trim(),t):n-0}function FE(n){return!ct(n)&&(!!nt(n)||+n==+n)}function _g(n){return!!Qt(n)&&!!n.endsWith("%")&&FE(n.substring(0,n.length-1))}function kE(n,t="vtable"){var e,i;const o=document.createElement("div");o.setAttribute("tabindex","0"),o.classList.add(t),o.style.outline="none",o.style.margin=`${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`;const r=(o.offsetWidth||((e=o.parentElement)===null||e===void 0?void 0:e.offsetWidth)||1)-1,s=(o.offsetHeight||((i=o.parentElement)===null||i===void 0?void 0:i.offsetHeight)||1)-1;return o.style.width=r&&r-n.left-n.right+"px"||"0px",o.style.height=s&&s-n.top-n.bottom+"px"||"0px",o}function IE(n,t){var e,i;n.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(n.offsetWidth||((e=n.parentElement)===null||e===void 0?void 0:e.offsetWidth)||1)-1,r=(n.offsetHeight||((i=n.parentElement)===null||i===void 0?void 0:i.offsetHeight)||1)-1;n.style.width=o&&o-t.left-t.right+"px"||"0px",n.style.height=r&&r-t.top-t.bottom+"px"||"0px"}function zE(n,t){const{dataSourceEventIds:e}=n.internalProps;e&&e.forEach(i=>n.internalProps.handler.off(i)),t(n),n.internalProps.dataSourceEventIds=[n.internalProps.handler.on(n.internalProps.dataSource,Oo.EVENT_TYPE.CHANGE_ORDER,()=>{n.dataSource.hierarchyExpandLevel&&n.refreshRowColCount(),n.render()})]}function DE(n,t){zE(n,()=>{if(t)if(t instanceof Oo)n.internalProps.dataSource=t;else{const e=n.internalProps.dataSource=new vg(t);n.addReleaseObj(e)}else n.internalProps.dataSource=Oo.EMPTY;n.internalProps.records=null})}function OE(n,t){if(!n.internalProps.frozenRowCount)return null;let{scrollTop:e}=n;const i=n.internalProps.frozenRowCount;for(let o=0;o<i;o++){const r=n.getRowHeight(o),s=e+r;if(s>t)return{top:e,row:o,bottom:s,height:r};e=s}return null}function WE(n,t){if(!n.internalProps.frozenColCount)return null;let{scrollLeft:e}=n;const i=n.internalProps.frozenColCount;for(let o=0;o<i;o++){const r=n.getColWidth(o),s=e+r;if(s>t)return{left:e,col:o,right:s,width:r};e=s}return null}function tl(n,t){return Math.round(LE(t,n.internalProps.calcWidthContext))}function NE(n,t){return n?n.min&&n.min>t?n.min:n.max&&n.max<t?n.max:t:t}function VE(n){let t=0,e=0;n.frozenColCount>0&&(t=n.getFrozenColsWidth()),n.rightFrozenColCount>0&&(e=n.getRightFrozenColsWidth());let i=0,o=0;return n.frozenRowCount>0&&(i=n.getFrozenRowsHeight()),n.bottomFrozenRowCount>0&&(o=n.getBottomFrozenRowsHeight()),new _n(n.scrollLeft+t,n.scrollTop+i,n.tableNoFrameWidth-t-e,n.tableNoFrameHeight-i-o)}function ho(n,t,e,i,o,r=!0){const s=kt(o("padding",n,e,i,t)),l=o("bgColor",n,e,i,t),a=o("font",n,e,i,t);let h,d,u,c,g;if(a){const{family:H,size:E,weight:F,style:L,variant:z}=cE(a);h=H.join(" "),d=E,u=F,c=L,c=z}else h=o("fontFamily",n,e,i,t),d=o("fontSize",n,e,i,t),u=o("fontWeight",n,e,i,t),c=o("fontStyle",n,e,i,t),g=o("fontVariant",n,e,i,t);const f=o("textAlign",n,e,i,t),p=o("textBaseline",n,e,i,t),v=o("color",n,e,i,t),m=o("strokeColor",n,e,i,t),b=o("lineHeight",n,e,i,t),w=o("underline",n,e,i,t),C=o("underlineDash",n,e,i,t),_=o("underlineOffset",n,e,i,t),y=o("lineThrough",n,e,i,t),x=Math.max(1,Math.floor(d/10)),S=o("textOverflow",n,e,i,t),A=o("borderColor",n,e,i,t),R=o("borderLineWidth",n,e,i,t),T=o("borderLineDash",n,e,i,t),M=o("marked",n,e,i,t),P=o("cursor",n,e,i,t),k=!(s&&l&&a&&f&&p&&v&&S&&A&&R&&T&&typeof w=="boolean"&&typeof y=="boolean"&&typeof M=="boolean");if(!r)return{hasFunctionPros:k};const B={text:{fontFamily:h,fontSize:d,fontWeight:u,fontStyle:c,fontVariant:g,fill:v,stroke:m!=null&&m,textAlign:f,textBaseline:p,lineHeight:b??d,underline:w?x:void 0,underlineDash:C,underlineOffset:_,lineThrough:y?x:void 0,ellipsis:S==="clip"?"":S==="ellipsis"?"...":I(S)?S:void 0},group:{fill:l,lineDash:T,lineWidth:R,stroke:A,cursor:P==="auto"||P==="default"?void 0:P},_vtable:{padding:s,marked:M}};if(Array.isArray(R)&&(B.group.strokeArrayWidth=kt(R)),Array.isArray(A)){const H=kt(A);B.group.stroke=!H.every(E=>!E)&&H,B.group.strokeArrayColor=kt(A)}return{theme:B,hasFunctionPros:k}}function Nh(n,t,e){const i=e.theme.frameStyle.cornerRadius;if(Array.isArray(i)){if(n===0&&t===0)return[i[0],0,0,0];if(n===e.colCount-1&&t===0)return[0,i[1],0,0];if(n===0&&t===e.rowCount-1)return[0,0,0,i[3]];if(n===e.colCount-1&&t===e.rowCount-1)return[0,0,i[2],0]}else if(i){if(n===0&&t===0)return[i,0,0,0];if(n===e.colCount-1&&t===0)return[0,i,0,0];if(n===0&&t===e.rowCount-1)return[0,0,0,i];if(n===e.colCount-1&&t===e.rowCount-1)return[0,0,i,0]}return 0}class Wo extends Eo{constructor(t){super(t),this.attribute.visibleTime!=="mouseenter_cell"&&this.attribute.visibleTime!=="click_cell"||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image),this.attribute.isGif&&this.attribute.gif&&this.loadGif()}loadGif(){this.playing=!1,ee.GetFile(this.attribute.gif,"arrayBuffer").then(t=>{const e=Vb(t),i=Nb(e,!0);this.renderGIF(i),this.resources.set(this.attribute.image,{state:"success",data:this.gifCanvas})}).catch(t=>{})}get backgroundWidth(){var t,e;return(e=(t=this.attribute.backgroundWidth)!==null&&t!==void 0?t:this.attribute.width)!==null&&e!==void 0?e:0}get backgroundHeight(){var t,e;return(e=(t=this.attribute.backgroundHeight)!==null&&t!==void 0?t:this.attribute.height)!==null&&e!==void 0?e:0}renderGIF(t){this.loadedFrames=t,this.frameIndex=0,this.tempCanvas||(this.tempCanvas=document.createElement("canvas"),this.tempCtx=this.tempCanvas.getContext("2d")),this.gifCanvas||(this.gifCanvas=document.createElement("canvas"),this.gifCtx=this.gifCanvas.getContext("2d")),this.gifCanvas.width=t[0].dims.width,this.gifCanvas.height=t[0].dims.height,this.playing=!0,this.lastTime=new Date().getTime(),this.animate().to({},1e3,"linear").loop(1/0)}renderFrame(t,e,i){const o=this.loadedFrames[this.frameIndex||0];o.disposalType===2&&this.gifCtx.clearRect(0,0,this.gifCanvas.width,this.gifCanvas.height),this.drawPatch(o),this.manipulate(t,e,i);const r=new Date().getTime()-this.lastTime;o.delay<r&&(this.frameIndex++,this.lastTime=new Date().getTime()),this.frameIndex>=this.loadedFrames.length&&(this.frameIndex=0)}drawPatch(t){const e=t.dims;this.frameImageData&&e.width===this.frameImageData.width&&e.height===this.frameImageData.height||(this.tempCanvas.width=e.width,this.tempCanvas.height=e.height,this.frameImageData=this.tempCtx.createImageData(e.width,e.height)),this.frameImageData.data.set(t.patch),this.tempCtx.putImageData(this.frameImageData,0,0),this.gifCtx.drawImage(this.tempCanvas,e.left,e.top)}manipulate(t,e,i){t.drawImage(this.gifCanvas,0,0,this.gifCanvas.width,this.gifCanvas.height,e,i,this.attribute.width,this.attribute.height)}setAttribute(t,e,i,o){super.setAttribute(t,e,i,o),t==="gif"&&this.loadGif()}setAttributes(t,e,i){super.setAttributes(t,e,i),t.gif&&this.loadGif()}}function el(n){return{rootContainer:new Qi({}),renderDefault:!0}}class jE{constructor(t,e){this.removeAllContainer=t,this.table=e,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=UE(t,i,e);for(let r=0;r<o.length;r++){const s=o[r];for(let l=s.start.col;l<=s.end.col;l++)for(let a=s.start.row;a<=s.end.row;a++)i.scenegraph.updateCellContent(l,a)}}else{const o=GE(t,i,e);for(let r=o.start.col;r<=o.end.col;r++)for(let s=o.start.row;s<=o.end.row;s++)i.scenegraph.updateCellContent(r,s)}i.widthMode==="autoWidth"&&i.scenegraph.recalculateColWidths(),i.heightMode==="autoHeight"&&i.scenegraph.recalculateRowHeights(),i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:r}=this.table.getHeaderDefine(t,e);return(i=this.headerCustomLayoutFuncCache.get(r))!==null&&i!==void 0?i:el}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||el}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:r}=o;i=this.headerReactRemoveGraphicCache.get(r)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:r}=o;i=this.reactRemoveGraphicCache.get(r)}i&&i(t,e)}clearCache(){this.removeAllContainer()}}function GE(n,t,e){const i=t.internalProps.rowSeriesNumber?1:0;if(e){const r=t.internalProps.layoutMap,{headerObjects:s}=t.internalProps.layoutMap;let l;for(let h=0;h<s.length;h++){const d=s[h];if(d.define.componentId===n){l=d.id;break}}const a=r.getHeaderCellAdressById(l);return r.getCellRange(a.col,a.row)}const{columnObjects:o}=t.internalProps.layoutMap;for(let r=0;r<o.length;r++)if(o[r].define.componentId===n)return{start:{col:i+r,row:t.columnHeaderLevelCount},end:{col:i+r,row:t.rowCount-1}};return{start:{col:0,row:0},end:{col:t.colCount-1,row:t.rowCount-1}}}function UE(n,t,e){const i=t.internalProps.rowSeriesNumber?1:0,o=[],r=t.internalProps.layoutMap;if(e){const{headerObjects:s}=r,l=[];for(let a=0;a<s.length;a++){const h=s[a];h&&h.define.componentId===n&&l.push(h.id)}for(let a=0;a<l.length;a++){const h=l[a],d=r.getHeaderCellAdressById(h),u=r.getCellRange(d.col,d.row);o.push(u)}}else{let s;const{columnObjects:l,indicatorsAsCol:a}=r;for(let h=0;h<l.length;h++)if(l[h].define.componentId===n){s=h;break}if(a)for(let h=r.rowHeaderLevelCount+s;h<r.colCount;h+=l.length){const d={start:{col:h+i,row:r.columnHeaderLevelCount},end:{col:h+i,row:r.rowCount-1}};o.push(d)}else for(let h=r.columnHeaderLevelCount+s;h<r.rowCount;h+=l.length){const d={start:{col:r.rowHeaderLevelCount+i,row:h},end:{col:r.colCount-1,row:h}};o.push(d)}}return o}function $e(n){const t={abstractPos:{x:n.viewport.x,y:n.viewport.y}},e=il(n.target);return e&&(t.eventArgs={col:e.col,row:e.row,event:n,targetCell:e,mergeInfo:KE(e),target:n.target}),t}function il(n){for(;n&&n.parent;){if(n.role==="cell")return n;n=n.parent}return null}function KE(n){if(I(n.mergeStartCol)&&I(n.mergeStartRow)&&I(n.mergeEndCol)&&I(n.mergeEndRow))return{colStart:n.mergeStartCol,colEnd:n.mergeEndCol,rowStart:n.mergeStartRow,rowEnd:n.mergeEndRow}}const $E=/radio-\d+-\d+-(\d+)/,jC="_custom_",yn="custom-container",Vh=jC+"_0";function uo(n,t,e,i,o,r,s,l,a,h,d){var u,c,g;let f,p,v,m,b=!0,w=!1;if(n==="react-custom-layout"&&(n=((u=d.reactCustomLayout)===null||u===void 0?void 0:u.getCustomLayoutFunc(e,i))||el),typeof n=="function"){const C=n({col:(c=h==null?void 0:h.start.col)!==null&&c!==void 0?c:e,row:(g=h==null?void 0:h.start.row)!==null&&g!==void 0?g:i,dataValue:d.getCellOriginValue(e,i),value:d.getCellValue(e,i)||"",rect:{left:0,top:0,right:o,bottom:r,width:o,height:r},table:d,originCol:e,originRow:i});if(!C)return{renderDefault:!0};C.rootContainer&&(C.rootContainer=nl(C.rootContainer,d.animationManager.timeline)),C.rootContainer instanceof Qi&&(m=C.rootContainer,m.name=yn,m.col=e,m.row=i),b=C.renderDefault,w=C.enableCellPadding}else if(typeof t=="function"){const C=t({col:e,row:i,dataValue:d.getCellOriginValue(e,i),value:d.getCellValue(e,i)||"",rect:{left:0,top:0,right:o,bottom:r,width:o,height:r},table:d});C&&(v=C.elements,b=C.renderDefault,f=C.expectedWidth,p=C.expectedHeight)}else t&&(f=t.expectedWidth,p=t.expectedHeight,v=t.elements,b=t.renderDefault);return v&&(m=YE(v,s?f:o,l?p:r,d.getCellValue(e,i))),w&&m.setAttributes({x:a[3],y:a[0],width:o-a[1]-a[3],height:r-a[0]-a[2]}),jh(m,o,r),!h||h.start.col===h.end.col&&h.start.row===h.end.row||GC(m,e,i,0),{elementsGroup:m,renderDefault:b}}function YE(n,t,e,i){const o=new Qi({x:0,y:0,width:t,height:e,fill:!1,stroke:!1,pickable:!1});return o.name=yn,XE(n,t,e,i).forEach(r=>{var s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E;switch(r.clickable&&(r.pickable=r.clickable),r.type){case"arc":const F=ac({x:r.x,y:r.y,dx:(s=r.dx)!==null&&s!==void 0?s:0,dy:(l=r.dy)!==null&&l!==void 0?l:0,fill:r.fill,stroke:r.stroke,outerRadius:r.radius,startAngle:r.startAngle,endAngle:r.endAngle,pickable:!!r.pickable,cursor:r.cursor});F.name=r.name,o.appendChild(F);break;case"text":if(r.background){const U=(h=(a=r.background)===null||a===void 0?void 0:a.expandX)!==null&&h!==void 0?h:0,Z=(u=(d=r.background)===null||d===void 0?void 0:d.expandY)!==null&&u!==void 0?u:0,q=ve({x:r.x-U,y:r.y-Z,dx:(c=r.dx)!==null&&c!==void 0?c:0,dy:(g=r.dy)!==null&&g!==void 0?g:0,width:r.width+2*U,height:r.height+2*Z,cornerRadius:(p=(f=r.background)===null||f===void 0?void 0:f.cornerRadius)!==null&&p!==void 0?p:0,fill:(m=(v=r.background)===null||v===void 0?void 0:v.fill)!==null&&m!==void 0?m:"#888"});o.appendChild(q)}const L=new fe(Object.assign({pickable:!!r.pickable,fill:(b=r.color)!==null&&b!==void 0?b:r.fill},r));L.name=r.name,o.appendChild(L);break;case"rect":const z=ve({x:r.x,y:r.y,dx:(w=r.dx)!==null&&w!==void 0?w:0,dy:(C=r.dy)!==null&&C!==void 0?C:0,width:r.width,height:r.height,cornerRadius:r.radius,fill:r.fill,stroke:r.stroke,pickable:!!r.pickable,cursor:r.cursor});z.name=r.name,o.appendChild(z);break;case"circle":const D=Lp({x:r.x,y:r.y,dx:(_=r.dx)!==null&&_!==void 0?_:0,dy:(y=r.dy)!==null&&y!==void 0?y:0,radius:r.radius,fill:r.fill,stroke:r.stroke,pickable:!!r.pickable,cursor:r.cursor});D.name=r.name,o.appendChild(D);break;case"icon":const N=new Wo({x:r.x,y:r.y,dx:(x=r.dx)!==null&&x!==void 0?x:0,dy:(S=r.dy)!==null&&S!==void 0?S:0,width:r.width,height:r.height,image:r.svg,backgroundWidth:r.hover?(A=r.hover.width)!==null&&A!==void 0?A:r.width:void 0,backgroundHeight:r.hover?(R=r.hover.width)!==null&&R!==void 0?R:r.width:void 0,backgroundColor:r.hover?(T=r.hover.bgColor)!==null&&T!==void 0?T:"rgba(22,44,66,0.2)":void 0,pickable:!!r.pickable,cursor:r.cursor});N.name=r.name,N.role="icon-custom",o.appendChild(N);break;case"image":const V=new Wo({x:r.x,y:r.y,dx:(M=r.dx)!==null&&M!==void 0?M:0,dy:(P=r.dy)!==null&&P!==void 0?P:0,width:r.width,height:r.height,image:r.src,backgroundWidth:r.hover?(k=r.hover.width)!==null&&k!==void 0?k:r.width:void 0,backgroundHeight:r.hover?(B=r.hover.width)!==null&&B!==void 0?B:r.width:void 0,backgroundColor:r.hover?(H=r.hover.bgColor)!==null&&H!==void 0?H:"rgba(22,44,66,0.2)":void 0,pickable:!!r.pickable,cursor:r.cursor,shape:r.shape});V.name=r.name,V.role="image-custom",o.appendChild(V);break;case"line":const G=Si({points:r.points,lineWidth:(E=r.lineWidth)!==null&&E!==void 0?E:1,stroke:r.stroke,pickable:!!r.pickable,cursor:r.cursor});G.name=r.name,o.appendChild(G)}}),o}function XE(n,t,e,i){const o=[],r=[0,0,0,0];for(let s=0;s<n.length;s++){const l=n[s],a=Object.assign({},l);for(const d in a)a.hasOwnProperty(d)&&jt(a[d])&&(a[d]=a[d](i));const h=a;I(h.x)&&(h.x=Qt(h.x)?Nn(h.x,t-r[1]):Number(h.x)),I(h.y)&&(h.y=Qt(h.y)?Nn(h.y,e-r[2]):Number(h.y)),"width"in a&&(a.width=Qt(a.width)?Nn(a.width,t-r[1]):Number(a.width)),"height"in a&&(a.height=Qt(a.height)?Nn(a.height,e-r[2]):Number(a.height)),"radius"in a&&(a.radius=Qt(a.radius)?Nn(a.radius,Math.min(t-r[1],e-r[2])):Number(a.radius)),"hover"in a&&(a.hover.x=Qt(a.hover.x)?Nn(a.hover.x,t-r[1]):Number(a.hover.x),a.hover.y=Qt(a.hover.y)?Nn(a.hover.y,e-r[2]):Number(a.hover.y),a.hover.width=Qt(a.hover.width)?Nn(a.hover.width,t-r[1]):Number(a.hover.width),a.hover.height=Qt(a.hover.height)?Nn(a.hover.height,e-r[2]):Number(a.hover.height),a.hover.x+=0,a.hover.y+=0),h.x=h.x+0,h.y=h.y+0,o.push(a)}return o}function Nn(n,t){return n.endsWith("px")?parseInt(n,10):n.endsWith("%")&&t?parseInt(n,10)/100*t:parseInt(n,10)}function jh(n,t,e){n&&n.forEachChildren(i=>{var o,r;i&&($t(i.attribute.width)&&i.attribute.width.percent&&i.setAttribute("width",Math.max(0,i.attribute.width.percent/100*t+((o=i.attribute.width.delta)!==null&&o!==void 0?o:0))),i.attribute.width<0&&i.setAttribute("width",0),$t(i.attribute.height)&&i.attribute.height.percent&&i.setAttribute("height",Math.max(0,i.attribute.height.percent/100*e+((r=i.attribute.height.delta)!==null&&r!==void 0?r:0))),i.attribute.height<0&&i.setAttribute("height",0),i.type==="group"&&jh(i,i.attribute.width,i.attribute.height))})}function nl(n,t){if(!n||!I(n.$$typeof)&&!I(n.vtype))return n;const e=n.type,{attribute:i,children:o,stateProxy:r,animation:s}=n.props,l=e({attribute:i});if(qE(l,n.props),r&&(l.stateProxy=r),l.id=i.id,l.name=i.name,it(o)?o.forEach(a=>{const h=nl(a,t);h&&h.type&&l.add(h)}):o&&l.add(nl(o,t)),it(s)&&t){const a=l.animate();a.setTimeline(t),s.forEach(h=>{a[h[0]](...h.slice(1))})}return l}function qE(n,t){let e=!1;switch(n.type){case"richtext":case"rich/image":break;default:e=!0}e&&Object.keys(t).forEach(i=>{const o=ZT[i];o&&n.on(o,t[i])})}function GC(n,t,e,i,o){n&&(n.name=`${jC}${o??""}_${i}`,n.onBeforeAttributeUpdate=ZE,n.type==="group"&&n.childrenCount&&n.forEachChildren((r,s)=>{GC(r,t,e,s,(o??"")+"_"+i)}))}function ZE(n,t){const e=this;if(e.skipMergeUpdate)return;const i=il(e);if(!i||!i.stage)return;const o=i.stage.table;e.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=i;if(I(r)&&I(s)&&I(l)&&I(a)&&(r!==s||l!==a)){for(let h=r;h<=s;h++)for(let d=l;d<=a;d++){if(h===i.col&&d===i.row)continue;const u=o.scenegraph.highPerformanceGetCell(h,d);if(u.role==="cell"){const c=u.getChildByName(e.name,!0);if(!c||c.skipAttributeUpdate)continue;for(const g in n)n[g]!==c.attribute[g]&&g!=="dx"&&g!=="dy"&&c.setAttribute(g,n[g])}}e.skipAttributeUpdate=void 0}}const JE={};class UC{static setIcon(t,e){this.cache.set(t,e)}static getIcon(t){return this.cache.has(t)?this.cache.get(t):null}static hasIcon(t){return this.cache.has(t)}static clear(t){return this.cache.delete(t)}static clearAll(){this.cache=new Map}}UC.cache=new Map;let ol,rl,yg,wg,No,Vo,Sg,KC,$C,YC,XC,jo,Go,qC,ZC,sl,ll,JC,QC,xg,Ag,Uo,Ko,Rg;function Gh(n){var t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S;ol=(t=n==null?void 0:n.sort_color)!==null&&t!==void 0?t:"#282F38",rl=(e=n==null?void 0:n.sort_color_opacity)!==null&&e!==void 0?e:"0.35",yg=(i=n==null?void 0:n.sort_color_2)!==null&&i!==void 0?i:"#416EFF",wg=(o=n==null?void 0:n.sort_color_opacity_2)!==null&&o!==void 0?o:"1",No=(r=n==null?void 0:n.sort_size)!==null&&r!==void 0?r:16,Vo=(s=n==null?void 0:n.sort_size_2)!==null&&s!==void 0?s:22,Sg=(l=n==null?void 0:n.frozen_color)!==null&&l!==void 0?l:"#282F38",KC=(a=n==null?void 0:n.frozen_color_opacity)!==null&&a!==void 0?a:"0.35",$C=(h=n==null?void 0:n.frozen_color_opacity)!==null&&h!==void 0?h:"0.2",YC=(d=n==null?void 0:n.frozen_color_2)!==null&&d!==void 0?d:"#416EFF",XC=(u=n==null?void 0:n.frozen_color_opacity_2)!==null&&u!==void 0?u:"1",jo=(c=n==null?void 0:n.frozen_size)!==null&&c!==void 0?c:22,Go=(g=n==null?void 0:n.frozen_size_2)!==null&&g!==void 0?g:22,qC=(f=n==null?void 0:n.collapse_color)!==null&&f!==void 0?f:"#141414",ZC=(p=n==null?void 0:n.collapse_color_opacity)!==null&&p!==void 0?p:"0.65",sl=(v=n==null?void 0:n.collapse_size)!==null&&v!==void 0?v:16,ll=(m=n==null?void 0:n.frozen_size_2)!==null&&m!==void 0?m:22,JC=(b=n==null?void 0:n.expand_color)!==null&&b!==void 0?b:"#141414",QC=(w=n==null?void 0:n.expand_color_opacity)!==null&&w!==void 0?w:"0.65",xg=(C=n==null?void 0:n.expand_size)!==null&&C!==void 0?C:16,Ag=(_=n==null?void 0:n.expand_size_2)!==null&&_!==void 0?_:22,Uo=(y=n==null?void 0:n.dragReorder_color)!==null&&y!==void 0?y:"#666666",Ko=(x=n==null?void 0:n.dragReorder_color_opacity)!==null&&x!==void 0?x:"1",Rg=(S=n==null?void 0:n.dragReorder_size)!==null&&S!==void 0?S:20}const QE={get sort_downward(){return{type:"svg",svg:`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="${yg}" fill-opacity="${wg}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${ol}" fill-opacity="${rl}"/></svg> `,width:No,height:No,funcType:Zt.sort,name:"sort_downward",positionType:Yt.contentRight,marginLeft:3,hover:{width:Vo,height:Vo,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_upward(){return{type:"svg",svg:`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="${ol}" fill-opacity="${rl}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${yg}" fill-opacity="${wg}"/> </svg>`,width:No,height:No,funcType:Zt.sort,positionType:Yt.contentRight,name:"sort_upward",marginLeft:3,hover:{width:Vo,height:Vo,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_normal(){return{type:"svg",svg:`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="${ol}" fill-opacity="${rl}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${ol}" fill-opacity="${rl}"/></svg> `,width:No,height:No,funcType:Zt.sort,positionType:Yt.contentRight,name:"sort_normal",marginLeft:3,hover:{width:Vo,height:Vo,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get freeze(){return{type:"svg",svg:`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M17.1313 8.42047C17.1932 8.48238 17.2423 8.55587 17.2759 8.63676C17.3094 8.71764 17.3266 8.80434 17.3266 8.89189C17.3266 8.97944 17.3094 9.06613 17.2759 9.14702C17.2423 9.2279 17.1932 9.3014 17.1313 9.3633L13.3843 13.1103C13.7007 14.3048 13.5305 15.4443 12.8388 16.2395C12.8104 16.2781 12.7778 16.3136 12.7417 16.3451L12.712 16.3755C12.6501 16.4374 12.5766 16.4865 12.4957 16.52C12.4148 16.5535 12.3281 16.5707 12.2406 16.5707C12.153 16.5707 12.0663 16.5535 11.9854 16.52C11.9046 16.4865 11.8311 16.4374 11.7692 16.3755L9.17633 13.7826L6.05316 16.9058L5.11983 17.0925C5.09291 17.0979 5.06508 17.0965 5.03881 17.0886C5.01254 17.0806 4.98863 17.0663 4.96923 17.0469C4.94982 17.0275 4.9355 17.0036 4.92755 16.9773C4.9196 16.951 4.91827 16.9232 4.92366 16.8963L5.11033 15.963L8.23333 12.8396L5.64066 10.2471C5.57875 10.1852 5.52964 10.1117 5.49614 10.0309C5.46263 9.94997 5.44539 9.86327 5.44539 9.77572C5.44539 9.68817 5.46263 9.60148 5.49614 9.52059C5.52964 9.43971 5.57875 9.36621 5.64066 9.3043C5.65066 9.2943 5.66066 9.2843 5.67099 9.27464C5.70266 9.2383 5.73833 9.20547 5.77766 9.17664C6.57283 8.48564 7.71199 8.31564 8.90599 8.63197L12.6528 4.88497C12.7147 4.82306 12.7882 4.77395 12.8691 4.74045C12.95 4.70694 13.0367 4.6897 13.1242 4.6897C13.2118 4.6897 13.2985 4.70694 13.3794 4.74045C13.4603 4.77395 13.5338 4.82306 13.5957 4.88497L17.1312 8.42047H17.1313ZM15.7172 8.8918L13.1243 6.29914L9.56483 9.8588C9.47574 9.94788 9.36323 10.0099 9.24034 10.0376C9.11746 10.0654 8.98922 10.0578 8.87049 10.0156C8.22783 9.78764 7.63899 9.7553 7.17749 9.89814L12.1182 14.8388C12.261 14.3771 12.2287 13.7885 12.0007 13.146C11.9585 13.0272 11.9509 12.899 11.9787 12.7761C12.0064 12.6532 12.0684 12.5407 12.1575 12.4516L15.7172 8.89164V8.8918Z" fill="${Sg}" fill-opacity="${$C}"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>`,width:jo,height:jo,name:"freeze",funcType:Zt.frozen,positionType:Yt.right,marginRight:0,hover:{width:Go,height:Go,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozen(){return{type:"svg",svg:`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="${Sg}" fill-opacity="${KC}"/></svg>`,width:jo,height:jo,name:"frozen",funcType:Zt.frozen,positionType:Yt.right,marginRight:0,hover:{width:Go,height:Go,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozenCurrent(){return{type:"svg",svg:`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="${YC}" fill-opacity="${XC}"/></svg>`,width:jo,height:jo,funcType:Zt.frozen,positionType:Yt.right,name:"frozenCurrent",marginRight:0,hover:{width:Go,height:Go,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get dropdownIcon(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>',width:24,height:24,funcType:Zt.dropDown,positionType:Yt.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)",image:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>'},cursor:"pointer",visibleTime:"mouseenter_cell"}},get play(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01" /><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /><path d="M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /></svg>',width:24,height:24,funcType:Zt.play,positionType:Yt.right,name:"play",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get damage_pic(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10V38C5 39.1046 5.89543 40 7 40H14H18L15 29L22 27L21 20L29 16L27 13L30 8H7C5.89543 8 5 8.89543 5 10Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 38V10C43 8.89543 42.1046 8 41 8H38L34 14L37 19L28 23L29 31L22 33L24 40H41C42.1046 40 43 39.1046 43 38Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',width:24,height:24,funcType:Zt.damagePic,positionType:Yt.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:Yt.left}},get expand(){return{type:"svg",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
114
|
+
<path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="${JC}" fill-opacity="${QC}"/>
|
|
115
|
+
</svg>`,width:xg,height:xg,funcType:Zt.expand,name:"expand",positionType:Yt.contentLeft,marginLeft:0,marginRight:4,hover:{width:Ag,height:Ag,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get collapse(){return{type:"svg",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
116
|
+
<path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 7.60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="${qC}" fill-opacity="${ZC}"/>
|
|
117
|
+
</svg>`,width:sl,height:sl,funcType:Zt.collapse,name:"collapse",positionType:Yt.contentLeft,marginLeft:0,marginRight:4,hover:{width:ll,height:ll,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading(){return{type:"image",src:"https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/media/loading-circle.gif",width:sl,height:sl,name:"loading",positionType:Yt.contentLeft,marginLeft:0,marginRight:4,hover:{width:ll,height:ll,bgColor:"rgba(101, 117, 168, 0.1)"},isGif:!0}},get drillDown(){return{name:"drillDown",type:"svg",positionType:Yt.absolute,funcType:Zt.drillDown,svg:U2,width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:Yt.absolute,funcType:Zt.drillUp,svg:K2,width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:`<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${Uo}" fill-opacity="${Ko}" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${Uo}" fill-opacity="${Ko}" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${Uo}" fill-opacity="${Ko}" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${Uo}" fill-opacity="${Ko}" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${Uo}" fill-opacity="${Ko}" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${Uo}" fill-opacity="${Ko}" p-id="5172"></path></svg>`,width:Rg,height:Rg,funcType:Zt.dragReorder,positionType:Yt.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function an(){return qs(QE,JE)}class Kt extends Qi{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren(o=>o.name===t&&(i=o,!0)),e&&this.forEachChildren(o=>{if(o.getChildByName){const r=o.getChildByName(t,!0);if(r)return i=r,!0}return!1}),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,(t=this.attribute.width)!==null&&t!==void 0?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,(t=this.attribute.height)!==null&&t!==void 0?t:0)}setDeltaWidth(t){var e;t!==0&&(this.setAttribute("width",((e=this.attribute.width)!==null&&e!==void 0?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),this.border.type==="group"&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;t!==0&&(this.setAttribute("height",((e=this.attribute.height)!==null&&e!==void 0?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),this.border.type==="group"&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){t!==0&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){t!==0&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t,e="border-rect",i=!1){if(i){let o=this._lastChild,r=0;for(;o;){if(o.name!==e&&t(o,r++))return;o=o._prev}}else{let o=this._firstChild,r=0;for(;o;){if(o.name!==e&&t(o,r++))return;o=o._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(this.childrenCount===0||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&e.name==="border-rect"?e._next:e}tryUpdateAABBBounds(){if(this.role==="cell"){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),tL(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if(this.role==="cell"){const t=this.attribute,{x:e,y:i,width:o,height:r}=t;return this._AABBBounds.setValue(e,i,e+o,i+r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds}return this.role==="body"||this.role==="row-header"||this.role==="col-header"||this.role==="right-frozen"||this.role==="bottom-frozen"||this.role==="corner-header"||this.role==="corner-right-top-header"||this.role==="corner-right-bottom-header"||this.role==="corner-left-bottom-header"?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}}function tL(n,t){n.stage&&n.stage.dirtyBounds&&n.stage.renderCount&&(n.isContainer&&!t||n.stage.dirty(n.globalAABBBounds))}function Uh(n,t,e,i){const o=n/t;let r,s;return o>e/i?(r=e,s=r/o,(i-s)/2):(s=i,r=s*o,(e-r)/2),{width:r,height:s}}function Tg(n,t,e,i,o,r,s="left",l="middle",a=[0,0,0,0],h=0,d=0,u=0,c=0){const g=n+e,f=t+i;let p=n+a[3]+h;s==="right"||s==="end"?p=g-o-a[1]-d:s==="center"&&(p=n+(e-o+h-d)/2);let v=t+a[0]+u;return l==="bottom"||l==="alphabetic"||l==="ideographic"?v=f-r-a[2]-c:l==="middle"&&(v=t+(i-r+u-c)/2),{x:p,y:v}}function lt(n,t,e,i,o){const r=t&&I(t[n])?t[n]:void 0;return typeof r=="function"?r({col:e,row:i,table:o,value:o.getCellValue(e,i),dataValue:o.getCellOriginValue(e,i),cellHeaderPaths:o.getCellHeaderPaths(e,i)}):r}function Kh(n,t,e,i,o){const r=t&&I(t[n])?t[n]:void 0;if(typeof r=="function")return r({col:e,row:i,table:o,value:o.getCellValue(e,i),dataValue:o.getCellOriginValue(e,i),cellHeaderPaths:o.getCellHeaderPaths(e,i)})}function $o(n,t,e,i){var o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_;let y=(r=(o=e==null?void 0:e.group)===null||o===void 0?void 0:o.strokeArrayWidth)!==null&&r!==void 0?r:void 0;return i.theme.cellInnerBorder||!n2(i.theme.frameStyle.borderLineWidth)||o2(i.theme.frameStyle.borderLineWidth)||(n===0&&(y=y??[(s=e==null?void 0:e.group)===null||s===void 0?void 0:s.lineWidth,(l=e==null?void 0:e.group)===null||l===void 0?void 0:l.lineWidth,(a=e==null?void 0:e.group)===null||a===void 0?void 0:a.lineWidth,(h=e==null?void 0:e.group)===null||h===void 0?void 0:h.lineWidth],y[3]=0),n===i.colCount-1&&(y=y??[(d=e==null?void 0:e.group)===null||d===void 0?void 0:d.lineWidth,(u=e==null?void 0:e.group)===null||u===void 0?void 0:u.lineWidth,(c=e==null?void 0:e.group)===null||c===void 0?void 0:c.lineWidth,(g=e==null?void 0:e.group)===null||g===void 0?void 0:g.lineWidth],y[1]=0),t===0&&(y=y??[(f=e==null?void 0:e.group)===null||f===void 0?void 0:f.lineWidth,(p=e==null?void 0:e.group)===null||p===void 0?void 0:p.lineWidth,(v=e==null?void 0:e.group)===null||v===void 0?void 0:v.lineWidth,(m=e==null?void 0:e.group)===null||m===void 0?void 0:m.lineWidth],y[0]=0),t===i.rowCount-1&&(y=y??[(b=e==null?void 0:e.group)===null||b===void 0?void 0:b.lineWidth,(w=e==null?void 0:e.group)===null||w===void 0?void 0:w.lineWidth,(C=e==null?void 0:e.group)===null||C===void 0?void 0:C.lineWidth,(_=e==null?void 0:e.group)===null||_===void 0?void 0:_.lineWidth],y[2]=0)),y}class eL extends Kt{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new Kt({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new Kt({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new Kt({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+((e=t.attribute.marginLeft)!==null&&e!==void 0?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth(((i=t.attribute.marginLeft)!==null&&i!==void 0?i:0)+((o=t.attribute.marginRight)!==null&&o!==void 0?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+((e=t.attribute.marginLeft)!==null&&e!==void 0?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth(((i=t.attribute.marginLeft)!==null&&i!==void 0?i:0)+((o=t.attribute.marginRight)!==null&&o!==void 0?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof fe&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const s=this._centerGroup.width;this._cellWidth=t+e+s,this.setAttribute("width",this._cellWidth)}else{const s=this._cellWidth-t-e;this.updateCenterLayout(s);const l=this._centerGroup.width;this._cellWidth=t+e+l,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,r=this._centerGroup.height;this._cellHeight=Math.max(i,o,r),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren(r=>{r instanceof Wo&&(e-=r.AABBBounds.width())});const i=this._centerGroup.getChildByName("text");i instanceof rn?i.setAttribute("width",e):i instanceof fe&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren(r=>{r.setAttribute("x",o),o+=r.AABBBounds.width()})}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),this._align==="left"||this._align==="start"?this.setAttribute("dx",0):this._align==="center"?this.setAttribute("dx",-this.attribute.width/2):this._align!=="right"&&this._align!=="end"||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){this._baseline==="top"?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):this._baseline==="middle"?(this._leftGroup.forEachChildren(t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)}),this._rightGroup.forEachChildren(t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)}),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):this._baseline==="bottom"&&(this._leftGroup.forEachChildren(t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())}),this._rightGroup.forEachChildren(t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())}),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth;const e=this.getChildByName("text",!0);e&&e.setAttribute("heightLimit",t),this.layout()}}function hn(n,t,e){var i,o,r,s,l;let a=0;const h=e.internalProps.layoutMap;if(h.isHeader(n,t)){const d=h.getHeader(n,t);I(d==null?void 0:d.hierarchyLevel)&&(a=((i=d.hierarchyLevel)!==null&&i!==void 0?i:0)*((o=h.rowHierarchyIndent)!==null&&o!==void 0?o:0),h.rowHierarchyTextStartAlignment&&!e.internalProps.headerHelper.getHierarchyIcon(n,t)&&(a+=e.internalProps.headerHelper.getHierarchyIconWidth()))}else if(e.options.groupBy||!((r=e.getBodyColumnDefine(n,t))===null||r===void 0)&&r.tree){const d=e.dataSource.getIndexKey(e.getRecordShowIndexByCell(n,t)),u=(s=e.dataSource.getGroupLength())!==null&&s!==void 0?s:0;let c=it(d)?d.length-1:0;u>0&&c===u&&(c=0),a=Array.isArray(d)&&e.getHierarchyState(n,t)!==Pt.none?c*((l=h.hierarchyIndent)!==null&&l!==void 0?l:0):0,h.hierarchyTextStartAlignment&&!e.internalProps.bodyHelper.getHierarchyIcon(n,t)&&(a+=e.internalProps.bodyHelper.getHierarchyIconWidth())}return a}function al(n,t){var e,i;let o,r=!1;for(Qt(n)&&n.length>(t.options.maxCharactersNumber||200)&&(n=n.slice(0,t.options.maxCharactersNumber||200),n+="…",r=!0),o=t.internalProps.enableLineBreak||!((e=t.options.customConfig)===null||e===void 0)&&e.multilinesForXTable?qb(n).replace(/\r?\n/g,`
|
|
118
|
+
`).replace(/\r/g,`
|
|
119
|
+
`).split(`
|
|
120
|
+
`)||[]:[qb(n)];o.length&&o.length>1&&!o[o.length-1];)o.pop();if(!((i=t.options.customConfig)===null||i===void 0)&&i.multilinesForXTable&&!t.internalProps.autoWrapText)for(;o.length&&o.length>1&&!o[0];)o.shift();return{text:o,moreThanMaxCharacters:r}}function iL(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){var p,v,m,b,w,C,_,y,x;let S,A=0,R=0,T=0;if(Array.isArray(t)&&t.length!==0){const{inlineFrontIcons:k,inlineEndIcons:B,contentLeftIcons:H,contentRightIcons:E,leftIconWidth:F,rightIconWidth:L,absoluteRightIconWidth:z}=qh(t,n,f,c);let D;if(A=F,R=L,T=z,k.length===0&&B.length===0){let N=0;nt(c.theme._contentOffset)&&(d==="left"?N=c.theme._contentOffset:d==="right"&&(N=-c.theme._contentOffset));const V=f?hn(f.start.col,f.start.row,c):hn(n.col,n.row,c),{text:G,moreThanMaxCharacters:U}=al(e,c),Z={text:G.length===1?G[0]:G,moreThanMaxCharacters:U,maxLineWidth:o?1/0:a-(i[1]+i[3])-A-R-V,textBaseline:"top",heightLimit:((b=c.options.customConfig)===null||b===void 0?void 0:b.limitContentHeight)===!1||r&&!(!((w=c.options.customConfig)===null||w===void 0)&&w.multilinesForXTable)?-1:h-Math.floor(i[0]+i[2]),pickable:!1,autoWrapText:s,lineClamp:l,wordBreak:"break-word",whiteSpace:((C=c.options.customConfig)===null||C===void 0?void 0:C.limitContentHeight)===!1||G.length!==1||s?"normal":"no-wrap",dx:(d==="left"?H.length?0:V:0)+N},q=new fe(g.text?Object.assign({},g.text,Z):Z);q.name="text",D=q}else{const N=Object.assign({text:e==null?void 0:e.toString()},((x=(y=(_=n.parent)===null||_===void 0?void 0:_.theme)===null||y===void 0?void 0:y.userTheme)===null||x===void 0?void 0:x.text)||{});g.text&&Object.assign(N,g.text),N.textBaseline="middle";const V=[...k.map(U=>$h(U)),N,...B.map(U=>$h(U))];V[0].textAlign=d;const G=new rn({width:o?0:a-(i[1]+i[3])-A-R,height:r&&s?0:Math.ceil(h-(i[0]+i[2])),textConfig:V,verticalDirection:r&&s?"top":u,ellipsis:N.ellipsis});G.name="text",D=G,G.bindIconEvent(),!f||f.start.col===f.end.col&&f.start.row===f.end.row||(G.onBeforeAttributeUpdate=oL)}if(H.length!==0||E.length!==0){const N=new eL({x:0,y:0,fill:!1,stroke:!1,pickable:!1});N.name="content",N.setCellContentOption({autoWidth:o,autoHeight:r,cellWidth:a-(i[1]+i[3])-A-R,cellHeight:h-(i[0]+i[2]),align:d,baseline:u});const V={addedHierarchyOffset:0};H.forEach(G=>{const U=ji(G,void 0,n.col,n.row,f,c,V);U.role="icon-content-left",U.name=G.name,N.addLeftOccupyingIcon(U)}),E.forEach(G=>{const U=ji(G,void 0,n.col,n.row,f,c,V);U.role="icon-content-right",U.name=G.name,N.addRightOccupyingIcon(U)}),N.addContent(D),n.appendChild(N),N.layout(),S=N.AABBBounds.width(),N.AABBBounds.height()}else n.firstChild?n.insertBefore(D,n.firstChild):n.appendChild(D),S=D.AABBBounds.width(),D.AABBBounds.height()}else if(I(e)){const{text:k,moreThanMaxCharacters:B}=al(e,c),H=f?hn(f.start.col,f.start.row,c):hn(n.col,n.row,c);let E=0;nt(c.theme._contentOffset)&&(d==="left"?E=c.theme._contentOffset:d==="right"&&(E=-c.theme._contentOffset));const F={text:k.length===1?k[0]:k,moreThanMaxCharacters:B,maxLineWidth:o?1/0:a-(i[1]+i[3]+H),textBaseline:"top",autoWrapText:s,lineClamp:l,wordBreak:"break-word",heightLimit:((p=c.options.customConfig)===null||p===void 0?void 0:p.limitContentHeight)===!1||r&&!(!((v=c.options.customConfig)===null||v===void 0)&&v.multilinesForXTable)?-1:h-Math.floor(i[0]+i[2]),pickable:!1,dx:(d==="left"?H:0)+E,whiteSpace:((m=c.options.customConfig)===null||m===void 0?void 0:m.limitContentHeight)===!1||k.length!==1||s?"normal":"no-wrap"},L=new fe(g.text?Object.assign({},g.text,F):F);L.name="text",L.textBaseline=u,n.appendChild(L),S=L.AABBBounds.width(),L.AABBBounds.height()}const M=o?A+S+R:a-(i[1]+i[3]),P=h-(i[0]+i[2]);n.forEachChildren(k=>{k.role==="icon-left"?k.setAttribute("x",k.attribute.x+i[3]):k.role==="icon-right"?k.setAttribute("x",k.attribute.x+M-R+i[3]):k.role==="icon-absolute-right"?k.setAttribute("x",k.attribute.x+M-T+i[3]+i[1]):k.name!=="content"&&k.name!=="text"||(d==="center"&&k.type!=="richtext"?k.setAttribute("x",i[3]+A+(M-A-R)/2):d==="right"&&k.type!=="richtext"?k.setAttribute("x",i[3]+M-R):k.setAttribute("x",i[3]+A))}),n.forEachChildren(k=>{k.name!==yn&&(u==="middle"?k.setAttribute("y",i[0]+(P-k.AABBBounds.height())/2):u==="bottom"?k.setAttribute("y",i[0]+P-k.AABBBounds.height()):k.setAttribute("y",i[0]))}),n.setAttributes({width:M+i[1]+i[3],height:P+i[0]+i[2]})}function ji(n,t,e,i,o,r,s){var l,a,h,d,u,c;const g={};n.type==="image"?(n.isGif&&(g.gif=n.src),g.image=n.src):(n.type==="svg"||"svg"in n)&&(g.image=n.svg),g.width=n.width,g.height=n.height,g.visibleTime=(l=n.visibleTime)!==null&&l!==void 0?l:"always",g.funcType=n.funcType,g.interactive=n.interactive,g.isGif=n.isGif;let f=0;if(s&&(s==null?void 0:s.addedHierarchyOffset)!==0||!nt(e)||!nt(i)||!r||n.funcType!==Zt.collapse&&n.funcType!==Zt.expand&&n.positionType!==Yt.contentLeft&&n.positionType!==Yt.contentRight||(f=o?hn(o.start.col,o.start.row,r):hn(e,i,r),s&&(s.addedHierarchyOffset=1)),g.marginLeft=((a=n.marginLeft)!==null&&a!==void 0?a:0)+f,g.marginRight=(h=n.marginRight)!==null&&h!==void 0?h:0,n.interactive===!1&&(g.pickable=!1),n.hover&&(g.backgroundWidth=(d=n.hover.width)!==null&&d!==void 0?d:n.width,g.backgroundHeight=(u=n.hover.width)!==null&&u!==void 0?u:n.width,g.backgroundColor=(c=n.hover.bgColor)!==null&&c!==void 0?c:"rgba(22,44,66,0.2)",g.hoverImage=n.hover.image),n.cursor&&(g.cursor=n.cursor),"shape"in n&&n.shape==="circle"&&(g.shape=n.shape),t)return t.setAttributes(g),t.loadImage(g.image),t.tooltip=n.tooltip,t.name=n.name,t;const p=new Wo(g);return p.tooltip=n.tooltip,p.name=n.name,p}function $h(n){var t,e,i,o,r,s;const l={};return n.type==="image"?l.image=n.src:(n.type==="svg"||"svg"in n)&&(l.image=n.svg),l.visibleTime=(t=n.visibleTime)!==null&&t!==void 0?t:"always",l.funcType=n.funcType,l.id=n.name,l.width=n.width,l.height=n.height,(n.marginRight||n.marginLeft)&&(l.margin=[0,(e=n.marginRight)!==null&&e!==void 0?e:0,0,(i=n.marginLeft)!==null&&i!==void 0?i:0]),n.hover&&(l.backgroundWidth=(o=n.hover.width)!==null&&o!==void 0?o:n.width,l.backgroundHeight=(r=n.hover.height)!==null&&r!==void 0?r:n.height,l.backgroundShowMode="hover",l.hoverImage=n.hover.image,l.backgroundStroke=!1,l.backgroundFill=(s=n.hover.bgColor)!==null&&s!==void 0?s:"rgba(22,44,66,0.2)"),n.cursor&&(l.cursor=n.cursor),l.tooltip=n.tooltip,l}function Yh(n,t,e,i,o,r,s,l,a){var h,d,u,c;ie(n.contentWidth)&&(i=t-((h=n.contentWidth)!==null&&h!==void 0?h:n.attribute.width));let g,f=0,p=0,v=0,m=0;n.forEachChildren(y=>{var x,S,A,R;y.role==="icon-left"?(f+=y.AABBBounds.width()+((x=y.attribute.marginLeft)!==null&&x!==void 0?x:0)+((S=y.attribute.marginRight)!==null&&S!==void 0?S:0),p=Math.max(p,y.AABBBounds.height())):y.role==="icon-right"&&(v+=y.AABBBounds.width()+((A=y.attribute.marginLeft)!==null&&A!==void 0?A:0)+((R=y.attribute.marginRight)!==null&&R!==void 0?R:0),m=Math.max(m,y.AABBBounds.height()))});const b=n.getChildByName("text"),w=n.getChildByName("content");let C;b instanceof fe?(g=b.AABBBounds.height(),b.setAttribute("maxLineWidth",t-f-v-(r[1]+r[3])-((d=b.attribute.dx)!==null&&d!==void 0?d:0)-((u=a.table.theme._contentOffset)!==null&&u!==void 0?u:0)),C=b.AABBBounds.height()):b instanceof rn?(g=b.AABBBounds.height(),b.setAttribute("width",t-f-v-(r[1]+r[3])),C=b.AABBBounds.height()):w&&(g=w.AABBBounds.height(),w.updateWidth(t-f-v-(r[1]+r[3])),C=w.AABBBounds.height());const _=Math.round(Math.max(p,m,g)+r[0]+r[2]);if(n.forEachChildren(y=>{var x;if(y.role!=="icon-left")if(y.role==="icon-right")y.setAttribute("x",y.attribute.x+i);else if(y.role==="icon-absolute-right")y.setAttribute("x",y.attribute.x+i);else if(y.name==="content"||y.name==="text"&&y.type!=="richtext"){const S=(x=y.attribute.textAlign)!==null&&x!==void 0?x:s;S==="center"?y.setAttribute("x",r[3]+f+(t-(r[1]+r[3])-f-v)/2):S==="right"&&y.setAttribute("x",r[3]+t-(r[1]+r[3])-v)}else y.name==="mark"&&y.setAttribute("x",n.attribute.width)}),o){let y=Math.max(p,C,m);if(nL(a,n,Math.round(y+r[0]+r[2]),_))return!0;y=((c=n.contentHeight)!==null&&c!==void 0?c:e)-(r[0]+r[2]),n.forEachChildren(x=>{x.type!=="rect"&&x.type!=="chart"&&x.name!==yn&&(x.name==="mark"?x.setAttribute("y",0):l==="middle"?x.setAttribute("y",r[0]+(y-x.AABBBounds.height())/2):l==="bottom"?x.setAttribute("y",r[0]+y-x.AABBBounds.height()):x.setAttribute("y",r[0]))})}else l!=="middle"&&l!=="bottom"||n.forEachChildren(y=>{y.type!=="rect"&&y.type!=="chart"&&y.name!==yn&&(y.name==="mark"?y.setAttribute("y",0):l==="middle"?y.setAttribute("y",(e-r[2]+r[0]-y.AABBBounds.height())/2):l==="bottom"?y.setAttribute("y",e-y.AABBBounds.height()-r[2]):y.setAttribute("y",r[0]))});return!1}function Xh(n,t,e,i,o,r,s,l){var a;const h=t-Math.floor(o[0]+o[2]),d=n.getChildByName("text");d instanceof fe&&!i?d.setAttributes({heightLimit:((a=l.options.customConfig)===null||a===void 0?void 0:a.limitContentHeight)===!1?-1:h}):d instanceof rn&&!i?d.setAttributes({height:h}):n.getChildByName("content")&&n.getChildByName("content").updateHeight(h),n.forEachChildren(u=>{u.setAttribute("dy",0),u.type==="rect"||u.type==="chart"||u.name===yn||(u.name==="mark"?u.setAttribute("y",0):s==="middle"?u.setAttribute("y",o[0]+(h-u.AABBBounds.height())/2):s==="bottom"?u.setAttribute("y",o[0]+h-u.AABBBounds.height()):u.setAttribute("y",o[0]))})}function nL(n,t,e,i){const o=n.table,r=ke(o,t.col,t.row);if(r&&r.end.row-r.start.row){i/=r.end.row-r.start.row+1,e/=r.end.row-r.start.row+1;for(let s=r.start.row;s<=r.end.row;s++){const l=o.getRowHeight(s);if(l===i&&e!==l||e>l)return!0}}else{const s=o.getRowHeight(t.row);if(s===i&&e!==s||e>s)return!0}return!1}function qh(n,t,e,i){const o=[],r=[],s=[],l=[],a=[],h=[],d=[],u=[];let c=0,g=0,f=0,p=0,v=0,m=0;return n.forEach(b=>{switch(b.positionType){case Yt.left:o.push(b);break;case Yt.right:r.push(b);break;case Yt.contentLeft:s.push(b);break;case Yt.contentRight:l.push(b);break;case Yt.absoluteRight:u.push(b);break;case Yt.inlineFront:a.push(b);break;case Yt.inlineEnd:h.push(b)}}),o.forEach(b=>{var w,C,_;const y=ji(b,void 0,t.col,t.row,e,i);y.role="icon-left",y.name=b.name,y.setAttribute("x",c+((w=y.attribute.marginLeft)!==null&&w!==void 0?w:0)),c+=y.AABBBounds.width()+((C=y.attribute.marginLeft)!==null&&C!==void 0?C:0)+((_=y.attribute.marginRight)!==null&&_!==void 0?_:0),g=Math.max(g,y.AABBBounds.height()),t.appendChild(y)}),r.forEach(b=>{var w,C,_;const y=ji(b,void 0,t.col,t.row,e,i);y.role="icon-right",y.name=b.name,y.setAttribute("x",f+((w=y.attribute.marginLeft)!==null&&w!==void 0?w:0)),f+=y.AABBBounds.width()+((C=y.attribute.marginLeft)!==null&&C!==void 0?C:0)+((_=y.attribute.marginRight)!==null&&_!==void 0?_:0),p=Math.max(p,y.AABBBounds.height()),t.appendChild(y)}),d.forEach(b=>{var w,C,_;const y=ji(b,void 0,t.col,t.row,e,i);y.role="icon-absolute-left",y.name=b.name,y.setAttribute("x",v+((w=y.attribute.marginLeft)!==null&&w!==void 0?w:0)),v+=y.AABBBounds.width()+((C=y.attribute.marginLeft)!==null&&C!==void 0?C:0)+((_=y.attribute.marginRight)!==null&&_!==void 0?_:0),t.appendChild(y)}),u.forEach(b=>{var w,C,_;const y=ji(b,void 0,t.col,t.row,e,i);y.role="icon-absolute-right",y.name=b.name,y.setAttribute("x",m+((w=y.attribute.marginLeft)!==null&&w!==void 0?w:0)),m+=y.AABBBounds.width()+((C=y.attribute.marginLeft)!==null&&C!==void 0?C:0)+((_=y.attribute.marginRight)!==null&&_!==void 0?_:0),t.appendChild(y)}),{leftIcons:o,rightIcons:r,contentLeftIcons:s,contentRightIcons:l,inlineFrontIcons:a,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:u,leftIconWidth:c,leftIconHeight:g,rightIconWidth:f,rightIconHeight:p,absoluteLeftIconWidth:v,absoluteRightIconWidth:m}}function oL(n,t){if(n.hasOwnProperty("hoverIconId")){const e=this;if(e.skipMergeUpdate)return;const i=il(e);if(!i||!i.stage)return;const o=i.stage.table;e.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=i;if(I(r)&&I(s)&&I(l)&&I(a)&&(r!==s||l!==a)){for(let h=r;h<=s;h++)for(let d=l;d<=a;d++){if(h===i.col&&d===i.row){if(n.hoverIconId!==e.attribute.hoverIconId){const c=e._frameCache.icons.get(n.hoverIconId);e.updateHoverIconState(c)}continue}const u=o.scenegraph.highPerformanceGetCell(h,d);if(u.role==="cell"){const c=u.getChildByName(e.name,!0);if(!c||c.skipAttributeUpdate)continue;n.hoverIconId!==c.attribute.hoverIconId&&(c.setAttribute("hoverIconId",n.hoverIconId),u.addUpdateBoundTag())}}e.skipAttributeUpdate=void 0}}}function rL(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v){var m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht;const gt=g._getCellStyle(i,o),vt=Kh("padding",gt,i,o,g);!((m=g.options.customConfig)===null||m===void 0)&&m.imageMargin?h=kt((b=g.options.customConfig)===null||b===void 0?void 0:b.imageMargin):I(vt)&&(h=vt),!((w=f==null?void 0:f.text)===null||w===void 0)&&w.textAlign&&(d=(C=f==null?void 0:f.text)===null||C===void 0?void 0:C.textAlign),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textBaseline&&(u=(y=f==null?void 0:f.text)===null||y===void 0?void 0:y.textBaseline);const W=$o(i,o,f,g);let O,Y;if(v&&(O=g.scenegraph.highPerformanceGetCell(i,o,!0),O&&O.role==="cell"&&O.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(S=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.lineWidth)!==null&&S!==void 0?S:void 0,fill:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.fill)!==null&&R!==void 0?R:void 0,stroke:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.stroke)!==null&&M!==void 0?M:void 0,strokeArrayWidth:W??void 0,strokeArrayColor:(k=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&k!==void 0?k:void 0,cursor:(H=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.cursor)!==null&&H!==void 0?H:void 0,lineDash:(F=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),O&&O.role==="cell"||(O=new Kt({x:t,y:e,width:r,height:s,lineWidth:(z=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&z!==void 0?z:void 0,fill:(N=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.fill)!==null&&N!==void 0?N:void 0,stroke:(G=(V=f==null?void 0:f.group)===null||V===void 0?void 0:V.stroke)!==null&&G!==void 0?G:void 0,strokeArrayWidth:W??void 0,strokeArrayColor:(Z=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Z!==void 0?Z:void 0,cursor:(j=(q=f==null?void 0:f.group)===null||q===void 0?void 0:q.cursor)!==null&&j!==void 0?j:void 0,lineDash:(ht=(rt=f==null?void 0:f.group)===null||rt===void 0?void 0:rt.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),O.role="cell",O.col=i,O.row=o,n==null||n.addCellGroup(O)),c){let at=i,tt=o;p&&(at=p.start.col,tt=p.start.row),Y=g.getCellIcons(at,tt)}let $=0,Q=0,et=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:at,rightIconWidth:tt,absoluteLeftIconWidth:_t,absoluteRightIconWidth:yt}=qh(Y,O,p,g);$=at+tt,Q=at,et=tt,O.forEachChildren(ut=>{ut.role==="icon-left"?ut.setAttribute("x",ut.attribute.x+h[3]):ut.role==="icon-right"?ut.setAttribute("x",ut.attribute.x+r-tt-h[1]):ut.role==="icon-absolute-right"&&ut.setAttribute("x",ut.attribute.x+r-yt-h[1])}),O.forEachChildren(ut=>{u==="middle"?ut.setAttribute("y",(s-ut.AABBBounds.height())/2):u==="bottom"?ut.setAttribute("y",s-ut.AABBBounds.height()-h[2]):ut.setAttribute("y",h[0])}),O._cellLeftIconWidth=Q,O._cellRightIconWidth=et}const ot=g.getCellValue(i,o),K=Pa({x:h[3],y:h[0],width:r-h[1]-h[3]-$,height:s-h[0]-h[2],image:ot,cursor:"pointer"});return K.name="image",K.keepAspectRatio=l,K.textAlign=d,K.textBaseline=u,l||a?K.resources&&K.resources.has(K.attribute.image)&&K.resources.get(K.attribute.image).state==="success"?setTimeout(()=>{e_(a,l,h,d,u,K,O,g)},0):K.successCallback=()=>{e_(a,l,h,d,u,K,O,g),g.scenegraph.updateNextFrame()}:K.resources&&K.resources.has(K.attribute.image)&&K.resources.get(K.attribute.image).state==="success"?hl(O,i,o,0,0,g):K.successCallback=()=>{hl(O,i,o,0,0,g)},K.failCallback=()=>{const at=an();K.image=at.damage_pic.svg},O.appendChild(K),O}function t_(n,t,e,i,o,r,s){let l=!1,a=null,h=null;const{width:d,height:u,isMerge:c}=Or(s,o.table);if(d<e+r[1]+r[3]&&(a=e+r[1]+r[3],l=!0),u<i+r[2]+r[0]&&(h=i+r[2]+r[0],l=!0),l){if(typeof a=="number")if(c)for(let g=s.mergeStartCol;g<=s.mergeEndCol;g++)o.setColWidth(g,a/(s.mergeEndCol-s.mergeStartCol+1));else o.setColWidth(n,a);if(typeof h=="number")if(c)for(let g=s.mergeStartRow;g<=s.mergeEndRow;g++)o.setRowHeight(g,h/(s.mergeEndRow-s.mergeStartRow+1));else o.setRowHeight(t,h);return o.component.updateScrollBar(),!0}return!1}function hl(n,t,e,i,o,r){var s,l,a,h,d,u,c,g,f,p,v,m;const b=n.getChildByName("image");if(!b)return;const w=typeof b.attribute.image!="string"&&b.attribute.image||((s=b.resources)===null||s===void 0?void 0:s.get(b.attribute.image).data);if(!w)return;const C=r._getCellStyle(t,e),_=(l=lt("textAlign",C,t,e,r))!==null&&l!==void 0?l:"left",y=(a=lt("textBaseline",C,t,e,r))!==null&&a!==void 0?a:"middle";let x;x=!((h=r.options.customConfig)===null||h===void 0)&&h.imageMargin?kt((d=r.options.customConfig)===null||d===void 0?void 0:d.imageMargin):(u=kt(lt("padding",C,t,e,r)))!==null&&u!==void 0?u:[0,0,0,0];const{width:S,height:A,isMerge:R}=Or(n,r),T=(c=n.mergeStartCol)!==null&&c!==void 0?c:n.col,M=(g=n.mergeStartRow)!==null&&g!==void 0?g:n.row,P=(f=n.mergeEndCol)!==null&&f!==void 0?f:n.col,k=(p=n.mergeEndCol)!==null&&p!==void 0?p:n.row,B=(v=n._cellLeftIconWidth)!==null&&v!==void 0?v:0,H=(m=n._cellRightIconWidth)!==null&&m!==void 0?m:0;if(b.keepAspectRatio){const{width:E,height:F}=Uh(w.width||w.videoWidth,w.height||w.videoHeight,S-(x[1]+x[3]),A-(x[0]+x[2])),L=Tg(0,0,S,A,E,F,_,y,x);for(let z=T;z<=P;z++)for(let D=M;D<=k;D++){const N=r.scenegraph.getCell(z,D).getChildByName("image");N==null||N.setAttributes({x:L.x,y:L.y,width:E,height:F})}}else for(let E=T;E<=P;E++)for(let F=M;F<=k;F++){const L=r.scenegraph.getCell(E,F).getChildByName("image");L==null||L.setAttributes({x:B+x[3],y:x[0],width:S-x[1]-x[3]-H-B,height:A-x[0]-x[2]})}if(n.getChildByName("play-icon")){const{width:L,height:z}=Or(n,r),D=Math.floor(Math.min(L-x[1]-x[3],z-x[2]-x[0])/2),N=0+(L>b.attribute.width?b.attribute.x-0+b.attribute.width/2:L/2),V=0+(z>b.attribute.height?b.attribute.y-0+b.attribute.height/2:z/2);for(let G=T;G<=P;G++)for(let U=M;U<=k;U++)r.scenegraph.getCell(G,U).getChildByName("play-icon").setAttributes({x:N-D/2,y:V-D/2,width:D,height:D})}n.forEachChildren(E=>{E.role==="icon-left"||(E.role==="icon-right"||E.role==="icon-absolute-right")&&E.setAttribute("x",E.attribute.x+i)}),n.forEachChildren(E=>{(E.type==="rect"||E.role&&E.role.startsWith("icon"))&&(y==="middle"?E.setAttribute("y",x[0]+(A-x[0]-x[2]-E.AABBBounds.height())/2):y==="bottom"?E.setAttribute("y",x[0]+A-x[0]-x[2]-E.AABBBounds.height()):E.setAttribute("y",x[0]))}),R&&Mg(n.mergeStartCol,n.mergeEndCol,n.mergeStartRow,n.mergeEndRow,r)}function Or(n,t){return n.role==="cell"&&I(n.mergeStartCol)&&I(n.mergeEndCol)&&I(n.mergeStartRow)&&I(n.mergeEndRow)?{width:t.getColsWidth(n.mergeStartCol,n.mergeEndCol),height:t.getRowsHeight(n.mergeStartRow,n.mergeEndRow),isMerge:!0}:{width:n.attribute.width,height:n.attribute.height,isMerge:!1}}function Mg(n,t,e,i,o){for(let r=n;r<=t;r++)for(let s=e;s<=i;s++){const l=o.scenegraph.getCell(r,s);if(l){const a=l.getChildByName("image");a&&a.setAttributes({dx:-o.getColsWidth(l.mergeStartCol,r-1),dy:-o.getRowsHeight(l.mergeStartRow,s-1)});const h=l.getChildByName("play-icon");h&&h.setAttributes({dx:-o.getColsWidth(l.mergeStartCol,r-1),dy:-o.getRowsHeight(l.mergeStartRow,s-1)})}}}function e_(n,t,e,i,o,r,s,l){const a=r.resources.get(r.attribute.image).data,{col:h,row:d}=s;if(n&&!i_(r)&&t_(h,d,a.width,a.height,l.scenegraph,e,s),t||i_(r)){const{width:u,height:c,isMerge:g}=Or(s,l),{width:f,height:p}=Uh(a.width,a.height,u-e[1]-e[3],c-e[0]-e[2]),v=Tg(0,0,u,c,f,p,i,o,e);r.setAttributes({x:v.x,y:v.y,width:f,height:p}),g&&Mg(s.mergeStartCol,s.mergeEndCol,s.mergeStartRow,s.mergeEndRow,l)}}function i_(n){const t=an();return n.attribute.image===t.damage_pic.svg}function n_(n,t,e){n.then(()=>{e(),t.scenegraph.updateNextFrame()}).catch(i=>{})}function sL(n,t){var e,i;const o=this;if(o.shadowRoot&&o.shadowRoot.childrenCount&&(I(n.width)||I(n.height))){const r=o.shadowRoot.findChildrenByName("shadow-rect")[0];r&&r.setAttributes({width:(e=n.width)!==null&&e!==void 0?e:r.attribute.width,height:(i=n.height)!==null&&i!==void 0?i:r.attribute.height})}}function Bg(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m){var b,w;let C,_=!1;if(Cn(t)){if(i.scenegraph.highPerformanceGetCell(o,r).role!=="cell")return C;t=i.getCellValue(o,r),_=!0}if(n==="text"||n==="link"||m){if(n==="link"){const A=t,R=i._getCellStyle(o,r);n==="link"&&("templateLink"in e&&e.templateLink||!("linkDetect"in e)||!e.linkDetect||pg.test(A))&&(p?(p.text.fill=lt("linkColor",R,o,r,i),p.group.cursor="pointer"):p={text:{fill:lt("linkColor",R,o,r,i)},group:{cursor:"pointer"}})}let y,x=!0;if(m)y=m.elementsGroup,x=m.renderDefault;else{let A,R;if(i.getCellLocation(o,r)!=="body"?(A=e==null?void 0:e.headerCustomRender,R=e==null?void 0:e.headerCustomLayout):(A=(e==null?void 0:e.customRender)||i.customRender,R=e==null?void 0:e.customLayout),R||A){const T=uo(R,A,o,r,l,a,!1,i.isAutoRowHeight(r),u,v,i);y=T.elementsGroup,x=T.renderDefault}}C=St.getFunction("createTextCellGroup")(i,t,h,0,d,o,r,s,l,a,u,c,g,f,y,x,p,v,_);const S=i.internalProps.layoutMap.getAxisConfigInPivotChart(o,r);if(S){const A=new(St.getComponent("axis"))(S,C.attribute.width,C.attribute.height,(b=S.__vtablePadding)!==null&&b!==void 0?b:u,i);C.clear(),C.appendChild(A.component),A.overlap()}else i.internalProps.layoutMap.isEmpty(o,r)?(C.setAttributes({fill:!1,stroke:!1}),C.clear()):i.internalProps.layoutMap.isAxisCell(o,r)&&C.clear()}else if(n==="image")C=St.getFunction("createImageCellGroup")(h,0,d,o,r,l,a,e.keepAspectRatio,e.imageAutoSizing,u,c,g,f,i,p,v,_);else if(n==="video")C=St.getFunction("createVideoCellGroup")(h,0,d,o,r,l,a,e.keepAspectRatio,e.imageAutoSizing,u,c,g,f,i,p,v,_);else if(n==="chart"){const y=i.internalProps.layoutMap.getChartInstance(o,r);C=St.getFunction("createChartCellGroup")(null,h,0,d,o,r,l,a,u,t,e.chartModule,i.internalProps.layoutMap.getChartSpec(o,r),y,(w=i.internalProps.layoutMap.getChartDataId(o,r))!==null&&w!==void 0?w:"data",i,p,i.internalProps.layoutMap.isShareChartSpec(o,r),_,i.internalProps.layoutMap.isNoChartDataRenderNothing(o,r))}else if(n==="progressbar"){const y=i._getCellStyle(o,r),x=i.getCellOriginValue(o,r);C=St.getFunction("createTextCellGroup")(i,t,h,0,d,o,r,s,l,a,u,c,g,!1,null,!0,p,v,_);const S=St.getFunction("createProgressBarCell")(e,y,s,t,x,o,r,u,i,v);C.firstChild?C.insertBefore(S,C.firstChild):C.appendChild(S)}else n==="sparkline"?C=St.getFunction("createSparkLineCellGroup")(null,h,0,d,o,r,l,a,u,i,p,_):n==="checkbox"?C=St.getFunction("createCheckboxCellGroup")(null,h,0,d,o,r,s,l,a,u,c,g,f,i,p,e,v,_):n==="radio"&&(C=St.getFunction("createRadioCellGroup")(null,h,0,d,o,r,s,l,a,u,c,g,i,p,e));return C.onBeforeAttributeUpdate=sL,C}function co(n,t,e,i,o){var r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S;const A=e.scenegraph.highPerformanceGetCell(n,t,!0),R=e.getCellLocation(n,t);let T,M,P,k,B=e.getCellValue(n,t),H=!1;if(e.internalProps.customMergeCell){const vt=e.getCustomMerge(n,t);if(vt){const{range:W,text:O,style:Y,customLayout:$,customRender:Q}=vt;M=W,T=M.start.col!==M.end.col||M.start.row!==M.end.row,B=O,P=Y,($||Q)&&(k=uo($,Q,W.start.col,W.start.row,e.getColsWidth(W.start.col,W.end.col),e.getRowsHeight(W.start.row,W.end.row),!1,e.isAutoRowHeight(t),[0,0,0,0],M,e)),H=!0}}let E=n,F=t;M&&(E=M.start.col,F=M.start.row);const L=R!=="body"?e.getHeaderDefine(E,F):e.getBodyColumnDefine(E,F);let z=R!=="body"||(L==null?void 0:L.dragOrder)||!!(L!=null&&L.icon)||!!(L!=null&&L.tree);M||!e.internalProps.enableTreeNodeMerge&&R==="body"&&!(L!=null&&L.mergeCell)||(M=e.getCellRange(n,t),T=M.start.col!==M.end.col||M.start.row!==M.end.row);let D=!1;if(e.internalProps.enableTreeNodeMerge&&T){const vt=e.getCellRawRecord(M.start.col,M.start.row),{vtableMergeName:W,vtableMerge:O}=vt??{};D=O,O&&(z=!0,e.options.groupTitleCustomLayout&&(k=uo(e.options.groupTitleCustomLayout,void 0,M.start.col,M.start.row,e.getColsWidth(M.start.col,M.end.col),e.getRowsHeight(M.start.row,M.end.row),!1,e.isAutoRowHeight(t),[0,0,0,0],M,e))),W&&(B=W)}const N=P||e._getCellStyle(M?M.start.col:n,M?M.start.row:t),V=(r=N.autoWrapText)!==null&&r!==void 0?r:e.internalProps.autoWrapText,G=ho(N,e,T?M.start.col:n,T?M.start.row:t,lt).theme;if(G.group.cornerRadius=Nh(n,t,e),!i&&!T&&!(L!=null&&L.customLayout||L!=null&&L.customRender||L!=null&&L.headerCustomLayout||L!=null&&L.headerCustomRender)&&lL(n,t,A,V,z,e)){const vt=e.getColWidth(n),W=e.getRowHeight(t);A.setAttributes({width:vt,height:W,lineWidth:(l=(s=G==null?void 0:G.group)===null||s===void 0?void 0:s.lineWidth)!==null&&l!==void 0?l:void 0,fill:(h=(a=G==null?void 0:G.group)===null||a===void 0?void 0:a.fill)!==null&&h!==void 0?h:void 0,stroke:(u=(d=G==null?void 0:G.group)===null||d===void 0?void 0:d.stroke)!==null&&u!==void 0?u:void 0,strokeArrayWidth:(g=(c=G==null?void 0:G.group)===null||c===void 0?void 0:c.strokeArrayWidth)!==null&&g!==void 0?g:void 0,strokeArrayColor:(p=(f=G==null?void 0:G.group)===null||f===void 0?void 0:f.strokeArrayColor)!==null&&p!==void 0?p:void 0,cursor:(m=(v=G==null?void 0:G.group)===null||v===void 0?void 0:v.cursor)!==null&&m!==void 0?m:void 0,cornerRadius:(w=(b=G==null?void 0:G.group)===null||b===void 0?void 0:b.cornerRadius)!==null&&w!==void 0?w:0,lineDash:(_=(C=G==null?void 0:G.group)===null||C===void 0?void 0:C.lineDash)!==null&&_!==void 0?_:void 0,y:e.scenegraph.getCellGroupY(t)}),A.forEachChildren(Y=>{Y.setAttributes({dx:0,dy:0})});const O=A.getChildByName("text");if(O){const Y=e.getCellValue(n,t),{text:$,moreThanMaxCharacters:Q}=al(Y,e),et=hn(n,t,e),ot=N.lineClamp,K=(y=kt(lt("padding",N,n,t,e)))!==null&&y!==void 0?y:[0,0,0,0],at=G.text.textAlign;let tt=0;tt=at==="center"?K[3]+(vt-(K[1]+K[3]))/2:at==="right"?K[3]+vt-(K[1]+K[3]):K[3];const _t={text:$.length!==1||V?$:$[0],moreThanMaxCharacters:Q,maxLineWidth:vt-(K[1]+K[3]+et),textBaseline:"top",autoWrapText:V,lineClamp:ot,wordBreak:"break-word",heightLimit:W-Math.floor(K[0]+K[2]),pickable:!1,dx:at==="left"?et:0,x:tt};if(O.setAttributes(G.text?Object.assign({},G.text,_t):_t),O.attribute.text){const yt=G.text.textBaseline,ut=W-(K[0]+K[2]);let xt=0;xt=yt==="middle"?K[0]+(ut-O.AABBBounds.height())/2:yt==="bottom"?K[0]+ut-O.AABBBounds.height():K[0],O.setAttributes({y:xt})}}return A}if(!i&&A.role==="empty")return;const U=D||H?"text":e.isHeader(n,t)?(x=e._getHeaderLayoutMap(n,t).headerType)!==null&&x!==void 0?x:"text":(S=e.getBodyColumnType(n,t))!==null&&S!==void 0?S:"text",Z=G._vtable.padding,q=G.text.textAlign,j=G.text.textBaseline;let rt,ht,gt;if(M?(ht=e.getColsWidth(M.start.col,M.end.col),gt=e.getRowsHeight(M.start.row,M.end.row)):(ht=e.getColWidth(n),gt=e.getRowHeight(t)),Cn(B)?(A.removeAllChild(),n_(B,e,aL.bind(null,{type:U,value:B,define:L,table:e,col:n,row:t,cellWidth:ht,cellHeight:gt,oldCellGroup:A,padding:Z,textAlign:q,textBaseline:j,mayHaveIcon:z,addNew:i,range:M,customResult:k,customStyle:P}))):rt=o_(U,B,L,e,n,t,ht,gt,A,Z,q,j,z,i,G,M,k),T){const{width:vt}=rt.attribute,{height:W}=rt.attribute;rt.contentWidth=vt,rt.contentHeight=W,o?hL(M,ht,gt,Z,q,j,e,rt):r_(M,ht,gt,Z,q,j,e)}return rt}function o_(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v){var m,b;if(Cn(t)&&(t=i.getCellValue(o,r)),!g&&(a.row!==r||a.col!==o))return null;if(!g&&a.parent&&i.reactCustomLayout){const C=a.getChildByName("custom-container");if(C){const{col:_,row:y}=C;i.reactCustomLayout.removeCustomCell(_,y)}}const w=Bg(n,t,e,i,o,r,i.getColWidth(o),s,l,g?i.scenegraph.getColGroup(o):a.parent,g?0:i.scenegraph.getCellGroupY(r),h,d,u,c,f,p,v);return!g&&a.parent&&(a.parent.insertAfter(w,a),a.parent.removeChild(a),!((m=i.scenegraph)===null||m===void 0)&&m.proxy.cellCache.get(o)&&((b=i.scenegraph)===null||b===void 0||b.proxy.cellCache.set(o,w))),w}function lL(n,t,e,i,o,r){var s;const l=r.getBodyColumnType(n,t),a=r.isAutoRowHeight(t),h=r.getCellValue(n,t);return!(r.isHeader(n,t)||e.role!=="cell"||l!=="text"||i||a||o||((s=e.firstChild)===null||s===void 0?void 0:s.type)!=="text"||Cn(h))}function aL(n){const{type:t,value:e,define:i,table:o,col:r,row:s,cellWidth:l,cellHeight:a,oldCellGroup:h,padding:d,textAlign:u,textBaseline:c,mayHaveIcon:g,addNew:f,range:p,customResult:v,customStyle:m}=n,b=m||o._getCellStyle(p?p.start.col:r,p?p.start.row:s),w=ho(b,o,p?p.start.col:r,p?p.start.row:s,lt).theme;w.group.cornerRadius=Nh(r,s,o),o_(t,e,i,o,r,s,l,a,h,d,u,c,g,f,w,p,v)}function r_(n,t,e,i,o,r,s){for(let l=n.start.col;l<=n.end.col;l++)for(let a=n.start.row;a<=n.end.row;a++){const h=s.scenegraph.highPerformanceGetCell(l,a,!0);if(h.role!=="cell")continue;n.start.row!==n.end.row&&h.contentHeight!==e&&Xh(h,e,e,s.isAutoRowHeight(a),i,o,r,s),n.start.col!==n.end.col&&h.contentWidth!==t&&Yh(h,t,e,0,s.isAutoRowHeight(a),i,o,r,s.scenegraph),h.contentWidth=t,h.contentHeight=e;const d=s.getRowHeight(a);dl(h,s.getColWidth(l),d,n,s)}}function hL(n,t,e,i,o,r,s,l){const{col:a,row:h}=l;n.start.row!==n.end.row&&l.contentHeight!==e&&Xh(l,e,e,s.isAutoRowHeight(h),i,o,r,s),n.start.col!==n.end.col&&l.contentWidth!==t&&Yh(l,t,e,0,s.isAutoRowHeight(h),i,o,r,s.scenegraph),l.contentWidth=t,l.contentHeight=e;const d=s.getRowHeight(h);dl(l,s.getColWidth(a),d,n,s)}function dl(n,t,e,i,o){var r,s;const{col:l,row:a}=n,h=-o.getColsWidth(i.start.col,l-1);let d=0;if(!((r=o.options.customConfig)===null||r===void 0)&&r._disableColumnAndRowSizeRound)for(let v=i.start.row;v<=a-1;v++)d-=o.getRowHeight(v);else d=-o.getRowsHeight(i.start.row,a-1);n.forEachChildren(v=>{var m,b,w,C,_,y;typeof v._dx=="number"?(v.skipMergeUpdate=!0,v.setAttributes({dx:((m=v._dx)!==null&&m!==void 0?m:0)+h}),v.skipMergeUpdate=!1):(v.skipMergeUpdate=!0,v._dx=(b=v.attribute.dx)!==null&&b!==void 0?b:0,v.setAttributes({dx:((w=v.attribute.dx)!==null&&w!==void 0?w:0)+h}),v.skipMergeUpdate=!1),typeof v._dy=="number"?(v.skipMergeUpdate=!0,v.setAttributes({dy:((C=v._dy)!==null&&C!==void 0?C:0)+d}),v.skipMergeUpdate=!1):(v._dy=(_=v.attribute.dy)!==null&&_!==void 0?_:0,v.skipMergeUpdate=!0,v.setAttributes({dy:((y=v.attribute.dy)!==null&&y!==void 0?y:0)+d}),v.skipMergeUpdate=!1)});const u=(s=n.attribute.strokeArrayWidth)!==null&&s!==void 0?s:n.attribute.lineWidth,c=it(u),g=[0,0,0,0];l===i.start.col&&(g[3]=c?u[3]:u),a===i.start.row&&(g[0]=c?u[0]:u),l===i.end.col&&(g[1]=c?u[1]:u),a===i.end.row&&(g[2]=c?u[2]:u);const f=t!==n.attribute.width,p=e!==n.attribute.height;return n.skipMergeUpdate=!0,n.setAttributes({width:t,height:e,strokeArrayWidth:g}),n.skipMergeUpdate=!1,n.mergeStartCol=i.start.col,n.mergeStartRow=i.start.row,n.mergeEndCol=i.end.col,n.mergeEndRow=i.end.row,{widthChange:f,heightChange:p}}function Zh(n,t,e,i){if(i.internalProps.customMergeCell){const o=i.getCustomMerge(n,t);if(o){const{range:r,text:s,style:l,customLayout:a,customRender:h}=o;if(a||h){const d=uo(a,h,r.start.col,r.start.row,i.getColsWidth(r.start.col,r.end.col),i.getRowsHeight(r.start.row,r.end.row),!1,i.isAutoRowHeight(t),[0,0,0,0],r,i).elementsGroup;e.childrenCount>0&&d?e.insertBefore(d,e.firstChild):d&&e.appendChild(d);const u=i.getRowHeight(t),c=i.getColWidth(n),{width:g}=e.attribute,{height:f}=e.attribute;return e.contentWidth=g,e.contentHeight=f,dl(e,c,u,r,i),r}}}}function go(n){return!!(n.role==="cell"&&nt(n.mergeStartCol)&&nt(n.mergeStartRow)&&nt(n.mergeEndCol)&&nt(n.mergeEndRow))}const Pg=new kr({}),Hg=new Ir({});function dL(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){const p=$t(n)?n.text:n,v=hg(p).split(`
|
|
121
|
+
`)||[],m=f.getColsWidth(t,i),b=lt("size",o,t,e,f);let w=0;if(r){const C=lt("spaceBetweenTextAndIcon",o,t,e,f),_=m-(g[1]+g[3])-s-b-C;Pg.setAttributes({text:{maxLineWidth:_,text:v,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:u,wordBreak:"break-word",lineClamp:c},icon:{width:Math.floor(b/1.4),height:Math.floor(b/1.4)},box:{width:b,height:b},spaceBetweenTextAndIcon:C}),Pg.render(),w=Pg.AABBBounds.height()}else w=Math.max(b,v.length*u);return w}function uL(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){var p;if(it(n)){let v=0;const m=f.getBodyColumnDefine(t,e),b=lt("spaceBetweenRadio",o,t,e,f),w=(p=m==null?void 0:m.radioDirectionInCell)!==null&&p!==void 0?p:"vertical";return w==="vertical"?n.forEach((C,_)=>{const y=Eg(C,t,e,i,o,r,s,l,a,h,d,u,c,g,f);v+=y,_!==n.length-1&&(v+=b)}):w==="horizontal"&&n.forEach(C=>{const _=Eg(C,t,e,i,o,r,s,l,a,h,d,u,c,g,f);v=Math.max(_,v)}),v}return Eg(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f)}function Eg(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){const p=$t(n)?n.text:n,v=hg(p).split(`
|
|
122
|
+
`)||[],m=f.getColsWidth(t,i),b=lt("size",o,t,e,f);let w=lt("outerRadius",o,t,e,f);const C=nt(w)?2*w:b;let _=0;if(r){const y=lt("spaceBetweenTextAndIcon",o,t,e,f),x=m-(g[1]+g[3])-s-C-y;nt(w)||(w=Math.round(b/2)),Hg.setAttributes({text:{maxLineWidth:x,text:v,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:u,wordBreak:"break-word",lineClamp:c},circle:{outerRadius:w},spaceBetweenTextAndIcon:y}),Hg.render(),_=Hg.AABBBounds.height()}else _=Math.max(b,v.length*u);return _}let cL="",Jh="quick";const gL=new Bt((n,t,e,i)=>{e(Mn)?i(Mn).to(l_).inSingletonScope():n(Mn).to(l_).inSingletonScope()});new Bt((n,t,e,i)=>{e(Mn)?i(Mn).to(ar).inSingletonScope():n(Mn).to(ar).inSingletonScope()});const s_=new Map;function Qh(n,t,e,i="normal"){const o=`${n}-${t}-${e}-${i}`,r=s_.get(o);if(r)return r;const s=(l={fontSize:n,fontFamily:e,fontWeight:t,fontStyle:i},new Oe(Object.assign({defaultFontParams:{fontFamily:ki.fontFamily,fontSize:ki.fontSize},getTextBounds:h?void 0:ma,specialCharSet:`{}()//&-/: .,@%'"~…=——${Oe.ALPHABET_CHAR_SET}${Oe.ALPHABET_CHAR_SET.toUpperCase()}0123456789${cL}`},a??{}),l));var l,a,h;return s_.set(o,s),s}class l_ extends ar{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return Qh(i,r,o,s).measure(t,Jh).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return Qh(i,r,o,s).measure(t,Jh)}}class fL{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return Qh(i,r,o,s).measure(t,Jh)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:s="normal"}=e;return Qh(i,r,o,s).measure(t,Jh).width}clipText(t,e,i){if(t.length===0)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,r){const s=Math.floor((o+r)/2),l=t.substring(0,s+1),a=this.measureTextWidth(l,e);let h;if(a>i){if(l.length<=1)return{str:"",width:0};const d=t.substring(0,s);return h=this.measureTextWidth(d,e),h<=i?{str:d,width:h}:this._clipText(t,e,i,o,s)}if(a<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const d=t.substring(0,s+2);return h=this.measureTextWidth(d,e),h>=i?{str:l,width:a}:this._clipText(t,e,i,s,r)}return{str:l,width:a}}clipTextWithSuffix(t,e,i,o){if(o==="")return this.clipText(t,e,i);if(t.length===0)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};const s=this.measureTextWidth(o,e);if(s>i)return{str:"",width:0};i-=s;const l=this._clipText(t,e,i,0,t.length-1);return l.str+=o,l.width+=s,l}}const a_=new fL,h_=new fe({ignoreBuf:!0});function d_(n){return h_.initAttributes(Object.assign(Object.assign({},n),{ignoreBuf:!0})),h_.AABBBounds}const u_=new rn({width:0,height:0,textConfig:[]});function Gi(n,t,e,i=!0,o){var r,s,l,a,h,d,u,c,g,f,p;typeof window<"u"&&window.performance.now();const v=[],m=[];if(o)for(let _=t;_<=e;_++)v[_]=n.getRowHeight(_);const b=n.internalProps.layoutMap;n.isPivotTable()&&(b.enableUseGetBodyCache(),b.enableUseHeaderPathCache()),n.defaultHeaderRowHeight,n.defaultHeaderColWidth;const w=n.defaultHeaderRowHeight==="auto"||it(n.defaultHeaderRowHeight)&&n.defaultHeaderRowHeight.some(_=>_==="auto"),C=n.heightMode==="autoHeight"||n.heightMode==="adaptive"&&n.options.autoHeightInAdaptiveMode!==!1;if(C||w){t=t??0,e=e??n.rowCount-1,(t===0&&e===n.rowCount-1||i)&&n._clearRowRangeHeightsMap();for(let _=t;_<n.columnHeaderLevelCount;_++){let y=0,x=n.colCount-1;if((n.isPivotTable()&&!n.isPivotChart()||n.isPivotChart()&&!n.internalProps.layoutMap.indicatorsAsCol)&&mL(n,_)&&!ke(n,n.rowHeaderLevelCount,_)&&(y=0,x=n.rowHeaderLevelCount),C||n.getDefaultRowHeight(_)==="auto"){const S=dn(_,y,x,n);m[_]=Math.round(S),n.heightAdaptiveMode!=="only-body"&&o||n._setRowHeight(_,S)}}for(let _=n.rowCount-n.bottomFrozenRowCount;_<=e;_++)if(C||n.getDefaultRowHeight(_)==="auto"){const y=dn(_,0,n.colCount-1,n);o?m[_]=Math.round(y):n._setRowHeight(_,y)}if(!(e<n.columnHeaderLevelCount||!C))if(n.internalProps.transpose||n.isPivotTable()&&!n.internalProps.layoutMap.indicatorsAsCol||!pL(n))if(n.internalProps.transpose||n.isPivotTable()&&!n.internalProps.layoutMap.indicatorsAsCol)for(let _=Math.max(t,n.columnHeaderLevelCount);_<=e;_++){let y;y=vL(n,_)?dn(_,0,n.rowHeaderLevelCount,n):dn(_,0,n.colCount-1,n),o?m[_]=Math.round(y):n._setRowHeight(_,y)}else for(let _=Math.max(t,n.columnHeaderLevelCount);_<=e;_++){const y=dn(_,0,n.colCount-1,n);o?m[_]=Math.round(y):n._setRowHeight(_,y)}else{bL(dn(n.columnHeaderLevelCount,0,n.colCount-1,n),n.columnHeaderLevelCount,n.rowCount-1-n.bottomFrozenRowCount,n,o?m:void 0);for(let _=n.rowCount-n.bottomFrozenRowCount;_<=e;_++){const y=dn(_,0,n.colCount-1,n);o?m[_]=Math.round(y):n._setRowHeight(_,y)}}}else if((n.heightMode==="adaptive"||n.autoFillHeight)&&n.clearRowHeightCache(),o)for(let _=t;_<=e;_++)m[_]=n.getRowHeight(_);if((t===0&&e===n.rowCount-1||i)&&n._clearRowRangeHeightsMap(),n.heightMode==="adaptive"){n._clearRowRangeHeightsMap();let _=n.tableNoFrameHeight,y=0,x=n.rowCount;if(n.heightAdaptiveMode==="only-body"){const R=n.getRowsHeight(0,n.columnHeaderLevelCount-1),T=n.isPivotChart()?n.getBottomFrozenRowsHeight():0;_=n.tableNoFrameHeight-R-T,y=n.columnHeaderLevelCount,x=n.isPivotChart()?n.rowCount-n.bottomFrozenRowCount:n.rowCount}let S=0;for(let R=y;R<x;R++)S+=o&&(r=m[R])!==null&&r!==void 0?r:n.getRowHeight(R);const A=_/S;for(let R=y;R<x;R++){let T;T=R===x-1?_-(o?m.reduce((M,P,k)=>k>=y&&k<=x-2?M+P:M,0):n.getRowsHeight(y,x-2)):Math.round((o&&(s=m[R])!==null&&s!==void 0?s:n.getRowHeight(R))*A),o?m[R]=T:n._setRowHeight(R,T,!1)}}else if(n.autoFillHeight){n._clearRowRangeHeightsMap();const _=n.tableNoFrameHeight;let y=0,x=0;for(let S=0;S<n.rowCount;S++){const A=o&&(l=m[S])!==null&&l!==void 0?l:n.getRowHeight(S);(S<n.columnHeaderLevelCount||n.isPivotChart()&&S>=n.rowCount-n.bottomFrozenRowCount)&&(x+=A),y+=A}if(n.scenegraph._dealAutoFillHeightOriginRowsHeight=y,y<_&&y-x>0){const S=n.columnHeaderLevelCount,A=n.isPivotChart()?n.rowCount-n.bottomFrozenRowCount:n.rowCount,R=(_-x)/(y-x);for(let T=S;T<A;T++){let M;M=T===A-1?_-x-(o?m.reduce((P,k,B)=>B>=S&&B<=A-2?P+k:P,0):n.getRowsHeight(S,A-2)):Math.round((o&&(a=m[T])!==null&&a!==void 0?a:n.getRowHeight(T))*R),o?m[T]=M:n._setRowHeight(T,M,!1)}}}if(o){for(let _=t;_<=e;_++){const y=(h=m[_])!==null&&h!==void 0?h:n.getRowHeight(_);I(y)&&n._setRowHeight(_,y)}if(n.heightMode==="adaptive"||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight){for(let _=0;_<=n.columnHeaderLevelCount-1;_++){const y=n.getRowHeight(_);y!==((d=v[_])!==null&&d!==void 0?d:n.getRowHeight(_))&&n.scenegraph.updateRowHeight(_,y-((u=v[_])!==null&&u!==void 0?u:n.getRowHeight(_)),!0)}for(let _=n.rowCount-n.bottomFrozenRowCount;_<=n.rowCount-1;_++){const y=n.getRowHeight(_);y!==((c=v[_])!==null&&c!==void 0?c:n.getRowHeight(_))&&n.scenegraph.updateRowHeight(_,y-((g=v[_])!==null&&g!==void 0?g:n.getRowHeight(_)),!0)}}for(let _=n.scenegraph.proxy.rowStart;_<=n.scenegraph.proxy.rowEnd;_++){const y=n.getRowHeight(_);y!==((f=v[_])!==null&&f!==void 0?f:n.getRowHeight(_))&&n.scenegraph.updateRowHeight(_,y-((p=v[_])!==null&&p!==void 0?p:n.getRowHeight(_)),!0)}}n.isPivotTable()&&(b.disableUseGetBodyCache(),b.disableUseHeaderPathCache())}function dn(n,t,e,i){var o;let r;if(i.isPivotChart()&&n>=i.columnHeaderLevelCount&&n<i.rowCount-i.bottomFrozenRowCount)if(i.internalProps.layoutMap.indicatorsAsCol){const l=i.internalProps.layoutMap.getOptimunHeightForChart(n);if(l>0)return l}else{const l=i.getDefaultRowHeight(n);if(nt(l))return l}for(let l=t;l<=e;l++){const a=CL(l,n,i);if(a&&(r=I(r)?Math.max(a.height,r):a.height,!a.renderDefault))continue;if(i.isPivotChart()){const d=i.internalProps.layoutMap.getAxisConfigInPivotChart(l,n);if(d){const u=St.getFunction("computeAxisComponentHeight")(d,i);if(typeof u=="number"){r=I(r)?Math.max(u,r):u;continue}}}if(i.isPivotChart()&&(i.isLeftFrozenColumn(l)&&i.isBottomFrozenRow(n)||i.isRightFrozenColumn(l)&&i.isBottomFrozenRow(n)))continue;const h=_L(l,n,i.isHeader(l,n)?(o=i._getHeaderLayoutMap(l,n))===null||o===void 0?void 0:o.headerType:i.getBodyColumnType(l,n),i);r=I(r)?Math.max(h,r):h}if(I(r))return r;const s=i.getDefaultRowHeight(n);return nt(s)?s:i.defaultRowHeight}function pL(n){var t,e,i;const{layoutMap:o}=n.internalProps,r=n.columnHeaderLevelCount;if((n.internalProps.autoWrapText||n.internalProps.enableLineBreak||n.isPivotChart())&&(n.options.heightMode==="autoHeight"||n.options.heightMode==="adaptive"))return!1;for(let s=0;s<n.colCount;s++){const l=o.getBody(s,r);if(l.cellType==="radio"||typeof l.style=="function"||typeof l.icon=="function"||!((t=l.define)===null||t===void 0)&&t.customRender||!((e=l.define)===null||e===void 0)&&e.customLayout||typeof((i=l.define)===null||i===void 0?void 0:i.icon)=="function")return!1;const a=n._getCellStyle(s,r);if(typeof a.padding=="function"||typeof a.fontSize=="function"||typeof a.lineHeight=="function"||a.autoWrapText===!0)return!1}return!0}function vL(n,t){var e,i,o;const{layoutMap:r}=n.internalProps;if((n.internalProps.autoWrapText||n.internalProps.enableLineBreak)&&(n.options.heightMode==="autoHeight"||n.options.heightMode==="adaptive"))return!1;const s=r.getBody(n.rowHeaderLevelCount,t);if(typeof s.style=="function"||typeof s.icon=="function"||!((e=s.define)===null||e===void 0)&&e.customRender||!((i=s.define)===null||i===void 0)&&i.customLayout||typeof((o=s.define)===null||o===void 0?void 0:o.icon)=="function")return!1;const l=n._getCellStyle(n.rowHeaderLevelCount,t);return typeof l.padding!="function"&&typeof l.fontSize!="function"&&typeof l.lineHeight!="function"&&l.autoWrapText!==!0}function mL(n,t){var e,i,o;const{layoutMap:r}=n.internalProps;if(n.internalProps.autoWrapText&&(n.options.heightMode==="autoHeight"||n.options.heightMode==="adaptive"))return!1;const s=r.getHeader(n.rowHeaderLevelCount,t);if(typeof s.style=="function"||typeof s.icons=="function"||!((e=s.define)===null||e===void 0)&&e.headerCustomRender||!((i=s.define)===null||i===void 0)&&i.headerCustomLayout||typeof((o=s.define)===null||o===void 0?void 0:o.icon)=="function")return!1;const l=n._getCellStyle(n.rowHeaderLevelCount,t);return typeof l.padding!="function"&&typeof l.fontSize!="function"&&typeof l.lineHeight!="function"&&l.autoWrapText!==!0}function bL(n,t,e,i,o){if(!i.internalProps.useOneRowHeightFillAll){for(let r=t;r<=e;r++)o?o[r]=n:i._setRowHeight(r,n);i.internalProps.useOneRowHeightFillAll=!0}}function CL(n,t,e){var i,o,r,s,l,a,h;const d=e.getCustomRender(n,t);let u=e.getCustomLayout(n,t);if(d||u){let c,g=1,f=0,p=!1,v=!1;(e.isHeader(n,t)||!((i=e.getBodyColumnDefine(n,t))===null||i===void 0)&&i.mergeCell||e.hasCustomMerge())&&(c=e.getCellRange(n,t),g=c.end.row-c.start.row+1);const m={col:(o=c==null?void 0:c.start.col)!==null&&o!==void 0?o:n,row:(r=c==null?void 0:c.start.row)!==null&&r!==void 0?r:t,dataValue:e.getCellOriginValue(n,t),value:e.getCellValue(n,t)||"",rect:yL(n,t,e),table:e,originCol:n,originRow:t};if(u==="react-custom-layout"&&(u=((s=e.reactCustomLayout)===null||s===void 0?void 0:s.getCustomLayoutFunc(n,t))||el),jt(u)){const b=u(m);b.rootContainer?(b.rootContainer=nl(b.rootContainer),jh(b.rootContainer,e.getColWidth(n),0),b.rootContainer.setStage(e.scenegraph.stage),f=(l=b.rootContainer.AABBBounds.height())!==null&&l!==void 0?l:0,p=b.renderDefault,v=b.enableCellPadding):(f=0,p=b.renderDefault,v=b.enableCellPadding)}else if(typeof d=="function"){const b=d(m);f=(a=b==null?void 0:b.expectedHeight)!==null&&a!==void 0?a:0,p=b==null?void 0:b.renderDefault}else f=(h=d==null?void 0:d.expectedHeight)!==null&&h!==void 0?h:0,p=d==null?void 0:d.renderDefault;if(v){const b=e._getCellStyle(n,t),w=kt(lt("padding",b,n,t,e));f+=w[0]+w[2]}return{height:f/g,renderDefault:p}}}function _L(n,t,e,i){var o,r,s;let l=0;const a=i.getCellValue(n,t),h=i._getCellStyle(n,t);let d=0,u=0;const c=[];let g=0;const f=[];let p=0,v=!1;if(i.getCellLocation(n,t)!=="body")v=!0;else{const M=i.getBodyColumnDefine(n,t);v=!!(M!=null&&M.icon)||!!(M!=null&&M.tree)||(M==null?void 0:M.dragOrder)}if(v){const M=i.getCellIcons(n,t);M==null||M.forEach(P=>{var k,B,H,E,F,L,z,D,N,V;P.positionType!==Yt.absoluteRight&&P.positionType!==Yt.inlineFront&&P.positionType!==Yt.inlineEnd?(u+=((k=P.width)!==null&&k!==void 0?k:0)+((B=P.marginLeft)!==null&&B!==void 0?B:0)+((H=P.marginRight)!==null&&H!==void 0?H:0),d=Math.max(d,(E=P.height)!==null&&E!==void 0?E:0)):P.positionType===Yt.inlineFront?(c.push(P),g=Math.max(g,((F=P.height)!==null&&F!==void 0?F:0)+((L=P.marginLeft)!==null&&L!==void 0?L:0)+((z=P.marginRight)!==null&&z!==void 0?z:0))):P.positionType===Yt.inlineEnd&&(f.push(P),p=Math.max(p,((D=P.height)!==null&&D!==void 0?D:0)+((N=P.marginLeft)!==null&&N!==void 0?N:0)+((V=P.marginRight)!==null&&V!==void 0?V:0)))})}let m=1,b=n;if(i.isHeader(n,t)||!((o=i.getBodyColumnDefine(n,t))===null||o===void 0)&&o.mergeCell||i.hasCustomMerge()){const M=i.getCellRange(n,t);m=M.end.row-M.start.row+1,n=M.start.col,b=M.end.col}const w=kt(lt("padding",h,n,t,i)),C=lt("fontSize",h,n,t,i),_=lt("fontStyle",h,n,t,i),y=lt("fontWeight",h,n,t,i),x=(r=lt("lineHeight",h,n,t,i))!==null&&r!==void 0?r:C,S=lt("fontFamily",h,n,t,i),A=lt("autoWrapText",h,n,t,i),R=lt("lineClamp",h,n,t,i);let T;if(e!=="text"&&e!=="link"&&e!=="progressbar"&&e!=="checkbox"&&e!=="radio")l=x;else if(e==="checkbox")l=dL(a,n,t,b,h,A,u,C,_,y,S,x,R,w,i);else if(e==="radio")l=uL(a,n,t,b,h,A,u,C,_,y,S,x,R,w,i);else{T=a;const M=al(T,i).text,P=i.getColsWidth(n,b);if(c.length||f.length)if(A){const k=Object.assign({text:a==null?void 0:a.toString(),fontFamily:S,fontSize:C,fontStyle:_,fontWeight:y,lineHeight:x});k.textBaseline="middle";const B=[...c.map(H=>$h(H)),k,...f.map(H=>$h(H))];u_.setAttributes({width:P-(w[1]+w[3])-u,height:0,textConfig:B}),l=u_.AABBBounds.height()}else l=0,M.forEach((k,B)=>{var H;!((H=i.options.customConfig)===null||H===void 0)&&H.multilinesForXTable&&B!==0||(B===0&&c.length?l+=Math.max(x,g):B===M.length-1&&f.length?l+=Math.max(x,p):l+=x)});else if(A){const k=hn(n,t,i),B=P-(w[1]+w[3])-u-k;l=d_({maxLineWidth:B,text:M,fontSize:C,fontStyle:_,fontWeight:y,fontFamily:S,lineHeight:x,wordBreak:"break-word",whiteSpace:M.length!==1||A?"normal":"no-wrap",lineClamp:R}).height()||(typeof x=="number"?x:C)}else l=!((s=i.options.customConfig)===null||s===void 0)&&s.multilinesForXTable?x:M.length*x}return(Math.max(l,d)+w[0]+w[2])/m}function yL(n,t,e){return{left:0,top:0,right:e.getColWidth(n),bottom:e.getRowHeight(t),width:e.getColWidth(n),height:0}}function fo(n,t){if(!t||!t.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:e,mergeEndCol:i,mergeStartRow:o,mergeEndRow:r,col:s,row:l}=n,{colStart:a,colEnd:h,rowStart:d,rowEnd:u,bodyLeftCol:c,bodyRightCol:g,bodyTopRow:f,bodyBottomRow:p}=t.proxy;let v=e,m=i,b=o,w=r;return s>=c&&s<=g&&(v=Math.max(n.mergeStartCol,a),m=Math.min(n.mergeEndCol,h)),l>=f&&l<=p&&(b=Math.max(n.mergeStartRow,d),w=Math.min(n.mergeEndRow,u)),{colStart:v,colEnd:m,rowStart:b,rowEnd:w}}function c_(n,t,e,i){i||n.table._setRowHeight(t,n.table.getRowHeight(t)+e,!0);for(let s=0;s<n.table.colCount;s++){const l=n.getCell(s,t);if(l.role==="empty")continue;const a=ke(n.table,s,t);a&&a.start.col!==s||(g_(n,l,s,t,l.attribute.height+e,e,n.table.isHeader(s,t)),n.updateCellContentWhileResize(s,t))}let o=0,r=0;t<n.table.frozenRowCount?(o=t+1,r=n.table.frozenRowCount-1):t>=n.table.rowCount-n.table.bottomFrozenRowCount?(o=t+1,r=n.table.rowCount-1):(o=t+1,r=Math.min(n.proxy.rowEnd,n.table.rowCount-n.table.bottomFrozenRowCount-1));for(let s=0;s<n.table.colCount;s++)for(let l=o;l<=r;l++){const a=n.highPerformanceGetCell(s,l);a.role==="cell"&&a.setAttribute("y",a.attribute.y+e)}}function g_(n,t,e,i,o,r,s){t&&wL(n,t,e,i,o,r)}function wL(n,t,e,i,o,r,s){var l,a,h,d,u;if(t.attribute.height===o&&!t.needUpdateHeight)return;t.needUpdateHeight=!1,t.setAttribute("height",o);const c=(l=n.table.getCellRawRecord(e,i))===null||l===void 0?void 0:l.vtableMerge,g=!!n.table.getCustomMerge(e,i),f=c||g?"text":n.table.isHeader(e,i)?(a=n.table._getHeaderLayoutMap(e,i).headerType)!==null&&a!==void 0?a:"text":(h=n.table.getBodyColumnType(e,i))!==null&&h!==void 0?h:"text";if(f==="progressbar"){const p=n.table.getBodyColumnDefine(e,i),v=n.table._getCellStyle(e,i),m=n.table.getCellValue(e,i),b=n.table.getCellOriginValue(e,i),w=kt(lt("padding",v,e,i,n.table));let C;p!=null&&p.mergeCell&&(C=n.table.getCellRange(e,i));const _=St.getFunction("createProgressBarCell")(p,v,t.attribute.width,m,b,e,i,w,n.table,C),y=t.getChildByName("progress-bar");t.insertBefore(_,y),t.removeChild(y),y.removeAllChild(),y.release(),f_(t,o,r,n.table.isAutoRowHeight(i),!0,n.table)}else if(f==="sparkline"){t.removeAllChild();const p=n.table._getCellStyle(e,i),v=kt(lt("padding",p,e,i,n.table));St.getFunction("createSparkLineCellGroup")(t,t.parent,t.attribute.x,t.attribute.y,e,i,t.attribute.width,t.attribute.height,v,n.table,ho(p,n.table,e,i,lt).theme,!1)}else if(f==="image"||f==="video")hl(t,e,i,0,r,n.table);else if(((d=t.firstChild)===null||d===void 0?void 0:d.name)==="axis")(u=t.firstChild)===null||u===void 0||u.originAxis.resize(t.attribute.width,t.attribute.height);else{let p=!0;const v=t.getChildByName(yn)||t.getChildByName(Vh);if(v){let m;t.removeChild(v);const b=Zh(e,i,t,n.table);if(b)for(let w=b.start.row;w<=b.end.row;w++){if(w===i)continue;const C=n.getCell(e,w),_=C.getChildByName(yn)||C.getChildByName(Vh);_.removeAllChild(),C.removeChild(_),Zh(e,w,C,n.table)}else{let w,C;const _=n.table.getCellLocation(e,i),{vtableMerge:y}=n.table.getCellRawRecord(e,i)||{};if(y&&n.table.options.groupTitleCustomLayout)C=n.table.options.groupTitleCustomLayout;else if(_!=="body"){const x=n.table.getHeaderDefine(e,i);w=x==null?void 0:x.headerCustomRender,C=x==null?void 0:x.headerCustomLayout}else{const x=n.table.getBodyColumnDefine(e,i);w=(x==null?void 0:x.customRender)||n.table.customRender,C=x==null?void 0:x.customLayout}if((w||C)&&go(t))for(let x=t.mergeStartCol;x<=t.mergeEndCol;x++)for(let S=t.mergeStartRow;S<=t.mergeEndRow;S++)S!==i&&n.updateCellContent(x,S);if(C||w){const x=n.table._getCellStyle(e,i),S=kt(lt("padding",x,e,i,n.table));let A=t.attribute.width,R=t.attribute.height;go(t)&&(A=n.table.getColsWidth(t.mergeStartCol,t.mergeEndCol),R=n.table.getRowsHeight(t.mergeStartRow,t.mergeEndRow));const T=uo(C,w,e,i,A,R,!1,n.table.isAutoRowHeight(i),S,go(t)?{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}}:void 0,n.table);m=T.elementsGroup,p=T.renderDefault}t.childrenCount>0&&m?t.insertBefore(m,t.firstChild):m&&t.appendChild(m)}}f_(t,o,r,n.table.isAutoRowHeight(i),p,n.table)}}function f_(n,t,e,i,o,r){if(go(n)){t=0;for(let d=n.mergeStartRow;d<=n.mergeEndRow;d++)t+=r.getRowHeight(d);const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=fo(n,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++){const c=r.scenegraph.getCell(d,u);if(c.forEachChildren(v=>{v.setAttributes({dx:0,dy:0})}),o){const v=r._getCellStyle(s,a);Xh(c,t,e,i,kt(v.padding),v.textAlign,v.textBaseline,r)}const g=r.getRowHeight(u),f=r.getColWidth(d);c.contentHeight=t;const{widthChange:p}=dl(c,f,g,{start:{col:n.mergeStartCol,row:n.mergeStartRow},end:{col:n.mergeEndCol,row:n.mergeEndRow}},r);p&&(c.needUpdateWidth=!0)}}else{const s=r._getCellStyle(n.col,n.row);Xh(n,t,e,i,kt(s.padding),s.textAlign,s.textBaseline,r)}}function SL(n,t,e,i){i||n.table._setColWidth(t,n.table.getColWidth(t)+e,!0);const o=n.getColGroup(t,!0),r=n.getColGroupInRightTopCorner(t);o&&!r&&Wr(o,e,"col-corner",n),r&&Wr(r,e,"right-top",n);const s=n.getColGroup(t);s&&Wr(s,e,"row-body",n);const l=n.getColGroupInLeftBottomCorner(t);l&&Wr(l,e,"left-bottom",n);const a=n.getColGroupInBottom(t);a&&Wr(a,e,"bottom",n);const h=n.getColGroupInRightBottomCorner(t);h&&Wr(h,e,"right-bottom",n),t<n.frozenColCount?(n.cornerHeaderGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),n.rowHeaderGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)})):(n.colHeaderGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),n.bodyGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)})),l&&n.leftBottomCornerGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),a&&n.bottomFrozenGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)}),h&&n.rightBottomCornerGroup.forEachChildrenSkipChild((d,u)=>{d.col>t&&d.setAttribute("x",d.attribute.x+e)})}function Wr(n,t,e,i){var o,r,s,l,a,h,d;let u=!1;const c=(o=n==null?void 0:n.attribute.width)!==null&&o!==void 0?o:0;if(n==null||n.setAttribute("width",c+t),n==null||n.forEachChildren((g,f)=>{if(xL(i,g,g.col,g.row,c,c+t,t,e!=="row-body"||g.col<i.table.rowHeaderLevelCount,i.table.internalProps.autoWrapText)){const p=ke(i.table,g.col,g.row);if(p&&p.end.row-p.start.row)for(let v=p.start.row;v<=p.end.row;v++)v_(i,v);else v_(i,g.row);u=!0}}),u){let g,f,p,v=0;for(let m=0;m<i.table.colCount;m++){if(e==="col-corner"?(p=0,g=i.getColGroup(m,!0),f=(r=i.colHeaderGroup.attribute.height)!==null&&r!==void 0?r:0):e==="row-body"?(p=i.table.frozenRowCount,g=i.getColGroup(m,!1),f=(s=i.bodyGroup.attribute.height)!==null&&s!==void 0?s:0):e==="bottom"?(p=i.table.rowCount-i.table.bottomFrozenRowCount,g=i.getColGroupInBottom(m),f=(l=i.bottomFrozenGroup.attribute.height)!==null&&l!==void 0?l:0):e==="left-bottom"?(p=i.table.rowCount-i.table.bottomFrozenRowCount,g=i.getColGroupInLeftBottomCorner(m),f=(a=i.leftBottomCornerGroup.attribute.height)!==null&&a!==void 0?a:0):e==="right-top"?(p=0,g=i.getColGroupInRightTopCorner(m),f=(h=i.rightTopCornerGroup.attribute.height)!==null&&h!==void 0?h:0):e==="right-bottom"&&(p=i.table.rowCount-i.table.bottomFrozenRowCount,g=i.getColGroupInRightBottomCorner(m),f=(d=i.rightBottomCornerGroup.attribute.height)!==null&&d!==void 0?d:0),!g)continue;let b=0;g.forEachChildren(w=>{var C;w.setAttribute("y",b),b+=(C=i.table.getRowHeight(w.row))!==null&&C!==void 0?C:0}),v=b}i.updateContainerHeight(p,v-f);for(let m=0;m<i.table.frozenColCount;m++){const b=i.getColGroupInLeftBottomCorner(m);let w=0;b==null||b.forEachChildren(C=>{C.setAttribute("y",w),w+=i.table.getRowHeight(C.row)})}for(let m=i.table.colCount-i.table.rightFrozenColCount;m<i.table.colCount;m++){const b=i.getColGroupInRightBottomCorner(m);let w=0;b==null||b.forEachChildren(C=>{C.setAttribute("y",w),w+=i.table.getRowHeight(C.row)})}for(let m=i.table.frozenColCount;m<i.table.colCount-i.table.rightFrozenColCount;m++){const b=i.getColGroupInBottom(m);let w=0;b==null||b.forEachChildren(C=>{C.setAttribute("y",w),w+=i.table.getRowHeight(C.row)})}}}function xL(n,t,e,i,o,r,s,l,a){var h,d,u,c,g,f,p;if(t.attribute.width===r&&!t.needUpdateWidth)return!1;t.needUpdateWidth=!1,t.setAttribute("width",r);const v=t;if(!v)return!1;const m=n.table.isAutoRowHeight(i),b=(h=n.table.getCellRawRecord(e,i))===null||h===void 0?void 0:h.vtableMerge,w=!!n.table.getCustomMerge(e,i),C=b||w?"text":n.table.isHeader(e,i)?(d=n.table._getHeaderLayoutMap(e,i).headerType)!==null&&d!==void 0?d:"text":(u=n.table.getBodyColumnType(e,i))!==null&&u!==void 0?u:"text";let _=!1;if(C==="progressbar"){const y=n.table.getBodyColumnDefine(e,i),x=n.table._getCellStyle(e,i),S=n.table.getCellValue(e,i),A=n.table.getCellOriginValue(e,i),R=kt(lt("padding",x,e,i,n.table));let T;y!=null&&y.mergeCell&&(T=n.table.getCellRange(e,i));const M=St.getFunction("createProgressBarCell")(y,x,v.attribute.width,S,A,e,i,R,n.table,T),P=v.getChildByName("progress-bar");v.insertBefore(M,P),v.removeChild(P),P.removeAllChild(),P.release();const k=p_(v,r,s,m,!0,n.table);_=_||k}else if(C==="sparkline"){v.removeAllChild();const y=n.table._getCellStyle(e,i),x=kt(lt("padding",y,e,i,n.table));St.getFunction("createSparkLineCellGroup")(v,v.parent,v.attribute.x,v.attribute.y,e,i,v.attribute.width,v.attribute.height,x,n.table,ho(y,n.table,e,i,lt).theme,!1)}else if(C==="image"||C==="video")hl(v,e,i,s,0,n.table);else if(((c=v.firstChild)===null||c===void 0?void 0:c.name)==="axis"){const y=n.table.internalProps.layoutMap.getAxisConfigInPivotChart(e,i),x=n.table._getCellStyle(e,i),S=kt(lt("padding",x,e,i,n.table));if(y){const A=new(St.getComponent("axis"))(y,v.attribute.width,v.attribute.height,(g=y.__vtablePadding)!==null&&g!==void 0?g:S,n.table);v.clear(),v.appendChild(A.component),A.overlap()}}else if(((f=t.firstChild)===null||f===void 0?void 0:f.name)==="axis")(p=t.firstChild)===null||p===void 0||p.originAxis.resize(t.attribute.width,t.attribute.height);else{let y=!0;const x=t.getChildByName(yn)||t.getChildByName(Vh);if(x){let A;t.removeChild(x);const R=Zh(e,i,t,n.table);if(R)for(let T=R.start.col;T<=R.end.col;T++){if(T===e)continue;const M=n.getCell(T,i),P=M.getChildByName(yn)||M.getChildByName(Vh);P.removeAllChild(),M.removeChild(P),Zh(T,i,M,n.table)}else{let T,M;const P=n.table.getCellLocation(e,i),{vtableMerge:k}=n.table.getCellRawRecord(e,i)||{};if(k&&n.table.options.groupTitleCustomLayout)M=n.table.options.groupTitleCustomLayout;else if(P!=="body"){const B=n.table.getHeaderDefine(e,i);T=B==null?void 0:B.headerCustomRender,M=B==null?void 0:B.headerCustomLayout}else{const B=n.table.getBodyColumnDefine(e,i);T=(B==null?void 0:B.customRender)||n.table.customRender,M=B==null?void 0:B.customLayout}if((T||M)&&go(v)){for(let B=v.mergeStartCol;B<=v.mergeEndCol;B++)if(B!==e)for(let H=v.mergeStartRow;H<=v.mergeEndRow;H++)n.updateCellContent(B,H)}if(M||T){const B=n.table._getCellStyle(e,i),H=kt(lt("padding",B,e,i,n.table));let E=v.attribute.width,F=v.attribute.height;go(v)&&(E=n.table.getColsWidth(v.mergeStartCol,v.mergeEndCol),F=n.table.getRowsHeight(v.mergeStartRow,v.mergeEndRow));const L=uo(M,T,e,i,E,F,!1,n.table.isAutoRowHeight(i),H,go(v)?{start:{col:v.mergeStartCol,row:v.mergeStartRow},end:{col:v.mergeEndCol,row:v.mergeEndRow}}:void 0,n.table);A=L.elementsGroup,y=L.renderDefault,_=!0}t.childrenCount>0&&A?t.insertBefore(A,t.firstChild):A&&t.appendChild(A)}}const S=p_(v,r,s,m,y,n.table);_=_||S}return a||(a=n.table._getCellStyle(e,i).autoWrapText),!(!m||!a)&&_}function p_(n,t,e,i,o,r){if(go(n)){t=0;let d=!1;for(let v=n.mergeStartCol;v<=n.mergeEndCol;v++)t+=r.getColWidth(v);let u=0;for(let v=n.mergeStartRow;v<=n.mergeEndRow;v++)u+=r.getRowHeight(v);const{colStart:c,colEnd:g,rowStart:f,rowEnd:p}=fo(n,r.scenegraph);for(let v=c;v<=g;v++)for(let m=f;m<=p;m++){if(v===n.col&&m!==n.row)continue;const b=r.scenegraph.getCell(v,m);b.forEachChildren(x=>{x.setAttributes({dx:0,dy:0})});let w=!1;if(o){const x=r._getCellStyle(c,f),S=kt(x.padding),A=x.textAlign,R=x.textBaseline;w=Yh(b,t,u,e,i,S,A,R,r.scenegraph);const T=hn(b.col,b.row,r);if(T){const M=b.getChildByName("text"),P=b.getChildByName("expand")||b.getChildByName("collapse");(P==null?void 0:P.role)!=="icon-left"&&M&&M.setAttribute("dx",T)}}const C=r.getRowHeight(m),_=r.getColWidth(v);b.contentWidth=t;const{heightChange:y}=dl(b,_,C,{start:{col:n.mergeStartCol,row:n.mergeStartRow},end:{col:n.mergeEndCol,row:n.mergeEndRow}},r);y&&(b.needUpdateHeight=!0),d=d||w}return d}const s=r._getCellStyle(n.col,n.row),l=kt(s.padding),a=s.textAlign,h=s.textBaseline;return Yh(n,t,r.getRowHeight(n.row),e,i,l,a,h,r.scenegraph)}function v_(n,t){const e=Math.round(dn(t,0,n.table.colCount-1,n.table));n.table._setRowHeight(t,e,!0);for(let i=0;i<n.table.colCount;i++){const o=e,r=n.highPerformanceGetCell(i,t);if(r.role==="empty")return;g_(n,r,i,t,o,o-r.attribute.height,n.table.isHeader(i,t))}}var Bi;(function(n){n.dropDown="dropDown",n.contextmenu="contextmenu",n.custom="custom"})(Bi||(Bi={}));const me={fontSize:12,fontFamily:"Arial,sans-serif",color:"#000",highlightColor:"#2E68CF",hoverBgColor:"#EEE",lineHeight:30,bgColor:"#FFF",cornerRadius:4,borderWidth:.5,borderColor:"#CCC",menuPadding:6,menuItemPadding:9,maxLineWidth:200};let AL=class{constructor(t){this._table=t,this._menuInstance=new Kt({x:0,y:0,fill:me.bgColor,stroke:me.borderColor,cornerRadius:me.cornerRadius,lineWidth:me.borderWidth}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:Bi.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,r,s){if(r===Bi.dropDown&&this.checkDropDownMenuChange(i,o)){const l=this.getMenuInfo(i,o,r);if(!l)return;const{menuInfo:a,highlightIndex:h}=l;this.updateMenuInfo(i,o,r,a,h),this.updateMenuInstance(a,h)}else if(r===Bi.contextmenu&&this.checkContextMenuChange(t,e)){const l=this.getMenuInfo(i,o,r);if(!l)return;const{menuInfo:a,highlightIndex:h}=l;this.updateMenuInfo(i,o,r,a,h),this.updateMenuInstance(a,h)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,r){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=r}checkDropDownMenuChange(t,e){const{type:i,col:o,row:r}=this._menuInfo;return i!==Bi.dropDown||t!==o||e!==r}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:r}=this._menuInfo;return o!==Bi.contextmenu||r!==((i=this._table.internalProps.menu)===null||i===void 0?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=me.menuPadding;const o=me.menuPadding;let r=0;t.forEach((s,l)=>{var a,h;const d=e===l;let u,c;typeof s=="string"?c=s:typeof s=="object"&&(c=s.text,u=d?s.selectedIcon:s.icon);const g=new Kt({y:i,x:o,height:me.lineHeight,fill:me.bgColor});g.role="menu-item",this._menuInstance.appendChild(g),g.stateProxy=p=>p==="hover"?{fill:me.hoverBgColor}:{fill:me.bgColor},g.addEventListener("pointerenter",p=>{g.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()}),g.addEventListener("pointerleave",p=>{g.removeState("hover",!1),this._table.scenegraph.updateNextFrame()});const f=new fe({x:me.menuItemPadding,y:me.menuItemPadding,fill:d?me.highlightColor:me.color,text:c,textBaseline:"top",fontSize:me.fontSize,fontFamily:me.fontFamily,pickable:!1,maxLineWidth:me.maxLineWidth,ellipsis:"…"});if(g.addChild(f),u){f.AABBBounds.height();const p=(a=u.width)!==null&&a!==void 0?a:16,v=(h=u.height)!==null&&h!==void 0?h:16,m=new Wo({x:me.menuItemPadding,y:(me.lineHeight-v)/2,width:p,height:v,image:u.svg,pickable:!1});m.role="menu-icon",g.insertBefore(m,f),f.setAttribute("x",p+me.menuItemPadding)}r=Math.max(g.AABBBounds.width(),r),i+=me.lineHeight}),this._menuInstance.setAttributes({width:r+2*me.menuItemPadding+2*me.menuPadding,height:i+me.menuPadding}),this._menuInstance.forEachChildren(s=>{s.setAttribute("width",r+2*me.menuItemPadding)})}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===Bi.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=Bi.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===Bi.dropDown){const{dropDownMenu:r=this._table.globalDropDownMenu,pivotInfo:s}=this._table._getHeaderLayoutMap(t,e);let l=-1;if(Array.isArray(r)){for(let a=0;a<r.length;a++)if(this._table._dropDownMenuIsHighlight(t,e,a)){l=a;break}}return{menuInfo:r,highlightIndex:l}}if(i===Bi.contextmenu){const r=(o=this._table.internalProps.menu)===null||o===void 0?void 0:o.contextMenuItems;let s;if(Array.isArray(r))s=r;else if(typeof r=="function"){const{field:l}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);s=r(l,e,t)}return{menuInfo:s,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",t=>{const{target:e}=t;if(e&&e.role==="menu-item"){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),r=Object.assign(i,o);r.event=t.nativeEvent,this._table.fireListeners(J.DROPDOWN_MENU_CLICK,r)}})}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren((s,l)=>s===t&&(i=l-1,!0));const o=typeof this._menuInfo.menuInfo[i]=="string"?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,r=typeof this._menuInfo.menuInfo[i]=="string"?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:r}}get bounds(){return this._menuInstance.globalAABBBounds}};const Lg=an();class RL{constructor(){const t=Lg.drillDown;this.icon=new Wo({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,r,s){if(!t||o&&r)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void s.updateNextFrame();const l=Lg.drillDown,a=Lg.drillUp;this.icon.setAttributes({x:e,y:i,image:o?l.svg:a.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),s.updateNextFrame()}}class TL{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=Ms({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=Si({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=ve({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),r=ke(this.table,t,e);r&&(t=r.start.col,e=r.start.row);let s=0,l=0,a=0,h=0,d=0,u=0,c=0,g=0,f=Math.PI;const p=[];return o==="columnHeader"?(s=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,l=this.table.getRowsHeight(0,this.table.frozenRowCount-1),h=this.table.tableNoFrameHeight,a=r?this.table.getColsWidth(r.start.col,r.end.col):this.table.getColWidth(t),d=s-i,c=s+a,g=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):(o==="rowHeader"||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(l=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,s=this.table.getColsWidth(0,this.table.frozenColCount-1),a=this.table.tableNoFrameWidth,h=r?this.table.getRowsHeight(r.start.row,r.end.row):this.table.getRowHeight(e),u=l-i,c=2,g=l+h,f=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:s-d,y:l-u,width:a,height:h,dx:d,dy:u}),this.columnMoverLine.setAttributes({x:c,y:g,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:g,angle:f}),{backX:s-d,lineX:c,backY:l-u,lineY:g}}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){typeof t=="number"&&typeof e=="number"?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):typeof i=="number"&&typeof o=="number"&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function td(n,t,e){if(e)return Math.min(t.tableNoFrameWidth,t.getAllColsWidth())-t.getColsWidth(n,t.colCount-1);let i=t.getColsWidth(0,n);return n>=t.frozenColCount&&(i-=t.scrollLeft),i}function m_(n,t,e){if(e)return Math.min(t.tableNoFrameWidth,t.getAllRowsHeight())-t.getRowsHeight(n,t.rowCount-1);let i=t.getRowsHeight(0,n);return n>=t.frozenRowCount&&(i-=t.scrollTop),i}class ML{constructor(t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b;this.table=t;const w=this.table.theme;this.createScrollBar();const C=(e=w.columnResize)===null||e===void 0?void 0:e.lineColor,_=(i=w.columnResize)===null||i===void 0?void 0:i.lineWidth,y=(o=w.columnResize)===null||o===void 0?void 0:o.bgColor,x=(r=w.columnResize)===null||r===void 0?void 0:r.width,S=(l=(s=w.columnResize)===null||s===void 0?void 0:s.labelVisible)===null||l===void 0||l,A=(a=w.columnResize)===null||a===void 0?void 0:a.labelColor,R=(h=w.columnResize)===null||h===void 0?void 0:h.labelFontSize,T=(d=w.columnResize)===null||d===void 0?void 0:d.labelFontFamily,M=(u=w.columnResize)===null||u===void 0?void 0:u.labelBackgroundFill,P=(c=w.columnResize)===null||c===void 0?void 0:c.labelBackgroundCornerRadius;this.labelVisible=S,this.columnResizeLine=Si({visible:!1,pickable:!1,stroke:C,lineWidth:_,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=Si({visible:!1,pickable:!1,stroke:y,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const k=nc({visible:!1,pickable:!1,x:0,y:0,fontSize:R,fill:A,fontFamily:T,text:"",textBaseline:"top",dx:16,dy:-R/2}),B=ve({visible:!1,pickable:!1,fill:M,x:0,y:0,width:5*R*.8,height:R+8,cornerRadius:P,dx:12,dy:-R/2-4});this.columnResizeLabel=ra({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(B),this.columnResizeLabel.appendChild(k),this.rowResizeLine=Si({visible:!1,pickable:!1,stroke:C,lineWidth:_,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=Si({visible:!1,pickable:!1,stroke:y,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const H=nc({visible:!1,pickable:!1,x:0,y:0,fontSize:R,fill:A,fontFamily:T,text:"",textBaseline:"top",dx:16,dy:-R/2}),E=ve({visible:!1,pickable:!1,fill:M,x:0,y:0,width:5*R*.8,height:R+8,cornerRadius:P,dx:12,dy:-R/2-4});this.rowResizeLabel=ra({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(E),this.rowResizeLabel.appendChild(H),this.cellMover=new TL(this.table);const F=(f=(g=w.frozenColumnLine)===null||g===void 0?void 0:g.shadow)===null||f===void 0?void 0:f.width,L=(v=(p=w.frozenColumnLine)===null||p===void 0?void 0:p.shadow)===null||v===void 0?void 0:v.startColor,z=(b=(m=w.frozenColumnLine)===null||m===void 0?void 0:m.shadow)===null||b===void 0?void 0:b.endColor;this.frozenShadowLine=ve({visible:!0,pickable:!1,x:0,y:0,width:F,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:L,offset:0},{color:z,offset:1}]}}),this.rightFrozenShadowLine=ve({visible:!0,pickable:!1,x:0,y:0,width:F,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:z,offset:0},{color:L,offset:1}]}}),this.menu=new AL(this.table),this.drillIcon=new RL}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o,r,s;const l=this.table.theme,a=(t=l.scrollStyle)===null||t===void 0?void 0:t.scrollRailColor,h=(e=l.scrollStyle)===null||e===void 0?void 0:e.scrollSliderColor,d=(i=l.scrollStyle)===null||i===void 0?void 0:i.scrollSliderCornerRadius,u=(o=l.scrollStyle)===null||o===void 0?void 0:o.width,c=(r=l.scrollStyle)===null||r===void 0?void 0:r.horizontalPadding,g=(s=l.scrollStyle)===null||s===void 0?void 0:s.verticalPadding;let f;f=I(d)?{cornerRadius:d,fill:h}:{fill:h},this.hScrollBar=new Fo({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:u,padding:c,railStyle:{fill:a},sliderStyle:f,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new Fo({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:u,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:g,railStyle:{fill:a},sliderStyle:f,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,r,s,l;const a=this.table.stateManager.scroll.horizontalBarPos,h=this.table.stateManager.scroll.verticalBarPos,d=this.table.theme,u=(t=d.scrollStyle)===null||t===void 0?void 0:t.width,c=(e=d.scrollStyle)===null||e===void 0?void 0:e.visible,g=(o=(i=d.scrollStyle)===null||i===void 0?void 0:i.horizontalVisible)!==null&&o!==void 0?o:c,f=(s=(r=d.scrollStyle)===null||r===void 0?void 0:r.verticalVisible)!==null&&s!==void 0?s:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),v=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),m=this.table.getAllRowsHeight(),b=this.table.getAllColsWidth(),w=this.table.getFrozenRowsHeight(),C=this.table.getFrozenColsWidth(),_=this.table.getBottomFrozenRowsHeight(),y=this.table.getRightFrozenColsWidth(),x=!((l=this.table.options.customConfig)===null||l===void 0)&&l._disableColumnAndRowSizeRound?1:0;if(b>p+x){const S=Math.min(v,m),A=Math.max(.05,(p-C)/(b-C)),R=this.table.theme.scrollStyle.hoverOn;let T=0;T=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(R?u:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:S-(R?u:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:C+(R?0:this.table.scenegraph.tableGroup.attribute.x),y:T,width:p-C-y,range:[0,A],visible:g==="always"});const M=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:M.x1,y:M.y1},g==="always"&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(m>v+x){const S=Math.min(p,b),A=Math.max(.05,(v-w)/(m-w));let R=0;const T=this.table.theme.scrollStyle.hoverOn;R=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(T?u:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:S-(T?u:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:R,y:w+(T?0:this.table.scenegraph.tableGroup.attribute.y),height:v-w-_,range:[0,A],visible:f==="always"});const M=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:M.x1,y:M.y1},f==="always"&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(a),this.table.stateManager.setScrollTop(h)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=td(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`))}updateResizeCol(t,e,i){const o=td(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`))}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=m_(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`))}updateResizeRow(t,e,i){const o=m_(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`))}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){return this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=td(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=td(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=(t=this.table.theme.scrollStyle.verticalVisible)!==null&&t!==void 0?t:e;i!=="focus"&&i!=="scrolling"||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=(t=this.table.theme.scrollStyle.verticalVisible)!==null&&t!==void 0?t:e;i!=="focus"&&i!=="scrolling"||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=(t=this.table.theme.scrollStyle.horizontalVisible)!==null&&t!==void 0?t:e;i!=="focus"&&i!=="scrolling"||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=(t=this.table.theme.scrollStyle.horizontalVisible)!==null&&t!==void 0?t:e;i!=="focus"&&i!=="scrolling"||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const r=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:r.x1,y:r.y1}}updateStyle(){var t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x;const S=this.table.theme,A=(t=S.scrollStyle)===null||t===void 0?void 0:t.scrollRailColor,R=(e=S.scrollStyle)===null||e===void 0?void 0:e.scrollSliderColor,T=(i=S.scrollStyle)===null||i===void 0?void 0:i.scrollSliderCornerRadius,M=(o=S.scrollStyle)===null||o===void 0?void 0:o.width,P=(r=S.scrollStyle)===null||r===void 0?void 0:r.horizontalPadding,k=(s=S.scrollStyle)===null||s===void 0?void 0:s.verticalPadding;let B;B=I(T)?{cornerRadius:T,fill:R}:{fill:R},this.hScrollBar.setAttributes({height:M,padding:P,railStyle:{fill:A},sliderStyle:B}),this.vScrollBar.setAttributes({width:M,padding:k,railStyle:{fill:A},sliderStyle:B});const H=(l=S.columnResize)===null||l===void 0?void 0:l.lineColor,E=(a=S.columnResize)===null||a===void 0?void 0:a.lineWidth,F=(h=S.columnResize)===null||h===void 0?void 0:h.bgColor,L=(d=S.columnResize)===null||d===void 0?void 0:d.width;this.columnResizeLine.setAttributes({stroke:H,lineWidth:E}),this.columnResizeBgLine=Si({stroke:F,lineWidth:L});const z=(u=S.columnResize)===null||u===void 0?void 0:u.labelColor,D=(c=S.columnResize)===null||c===void 0?void 0:c.labelFontSize,N=(g=S.columnResize)===null||g===void 0?void 0:g.labelFontFamily,V=(f=S.columnResize)===null||f===void 0?void 0:f.labelBackgroundFill,G=(p=S.columnResize)===null||p===void 0?void 0:p.labelBackgroundCornerRadius,U=(m=(v=S.columnResize)===null||v===void 0?void 0:v.labelVisible)===null||m===void 0||m;this.labelVisible=U,this.columnResizeLabel.lastChild.setAttributes({fontSize:D,fill:z,fontFamily:N,dy:-D/2}),this.columnResizeLabel.firstChild.setAttributes({fill:V,width:5*D*.8,height:D+8,cornerRadius:G,dy:-D/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:D,fill:z,fontFamily:N,dy:-D/2}),this.rowResizeLabel.firstChild.setAttributes({fill:V,width:5*D*.8,height:D+8,cornerRadius:G,dy:-D/2-4});const Z=(w=(b=S.frozenColumnLine)===null||b===void 0?void 0:b.shadow)===null||w===void 0?void 0:w.width,q=(_=(C=S.frozenColumnLine)===null||C===void 0?void 0:C.shadow)===null||_===void 0?void 0:_.startColor,j=(x=(y=S.frozenColumnLine)===null||y===void 0?void 0:y.shadow)===null||x===void 0?void 0:x.endColor;this.frozenShadowLine.setAttributes({width:Z,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:q,offset:0},{color:j,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:Z,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:q,offset:1}]}}),this.cellMover.updateStyle()}}function Nr(n,t,e,i,o){var r,s,l,a,h,d;if(!t)return;const u=e==="table",{shadowBlur:c,shadowOffsetX:g,shadowOffsetY:f,shadowColor:p,cornerRadius:v,borderColor:m,borderLineWidth:b,borderLineDash:w}=t;let C=!1;const _={},y={pickable:!1};c&&u&&(y.shadowBlur=c,y.shadowOffsetX=g,y.shadowOffsetY=f,y.shadowColor=p,y.stroke=!0,y.stroke=p,y.lineWidth=1,C=!0),b&&(y.stroke=!0,y.fill=!1,y.stroke=Fg(m??"#E1E4E8",i,b),y.lineWidth=b,w&&(y.lineDash=w),y.lineCap="butt"),Array.isArray(m)&&(y.strokeArrayColor=kt(m)),Array.isArray(b)&&(y.strokeArrayWidth=kt(b),y.lineWidth=1),v&&(y.cornerRadius=v,_.cornerRadius=v);const x=y.strokeArrayWidth?y.strokeArrayWidth[0]:(r=y.lineWidth)!==null&&r!==void 0?r:0,S=y.strokeArrayWidth?y.strokeArrayWidth[1]:(s=y.lineWidth)!==null&&s!==void 0?s:0,A=y.strokeArrayWidth?y.strokeArrayWidth[2]:(l=y.lineWidth)!==null&&l!==void 0?l:0,R=y.strokeArrayWidth?y.strokeArrayWidth[3]:(a=y.lineWidth)!==null&&a!==void 0?a:0;if(n.setAttributes(_),!o)if(y.stroke)if(y.x=R/2,y.y=x/2,y.pickable=!1,u){if(v)if(Array.isArray(v)){const P=kt(v);y.cornerRadius=P,_.cornerRadius=P,P[0]&&(P[0]=P[0]+Math.min(R,x)/2),P[1]&&(P[1]=P[1]+Math.min(x,S)/2),P[2]&&(P[2]=P[2]+Math.min(S,A)/2),P[3]&&(P[3]=P[3]+Math.min(A,R)/2)}else if(it(b)){const P=[];y.cornerRadius=P,_.cornerRadius=P,P[0]=v+Math.min(R,x)/2,P[1]=v+Math.min(x,S)/2,P[2]=v+Math.min(S,A)/2,P[3]=v+Math.min(A,R)/2}else y.cornerRadius=v+((h=y.lineWidth)!==null&&h!==void 0?h:0)/2,_.cornerRadius=v+((d=y.lineWidth)!==null&&d!==void 0?d:0)/2;let T,M;if(t.innerBorder?(y.x=n.attribute.x+R/2,y.y=n.attribute.y+x/2,y.width=n.attribute.width-R/2-S/2,y.height=n.attribute.height-x/2-A/2):(y.x=n.attribute.x-R/2,y.y=n.attribute.y-x/2,y.width=n.attribute.width+R/2+S/2,y.height=n.attribute.height+x/2+A/2),C){y.fill="white",y.notAdjustPos=!0,M=ra(y),M.name="table-border-rect",T=ve({x:R/2,y:x/2,width:n.attribute.width,height:n.attribute.height,fill:"red",cornerRadius:n.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),M.addChild(T);const P=ve({x:R/2,y:x/2,width:n.attribute.width,height:n.attribute.height,fill:"transparent",pickable:!1,globalCompositeOperation:"source-over"});M.addChild(P)}else M=ve(y),M.name="table-border-rect";t.innerBorder&&!C?n.parent.insertAfter(M,n):n.parent.insertBefore(M,n),n.border=M}else{y.width=n.attribute.width-R/2-S/2,y.height=n.attribute.height-x/2-A/2;const T=ve(y);T.name="border-rect",n.addChild(T),n.border=T}else{const T=ve({fill:!1,stroke:!1,pickable:!1,lineWidth:0});T.name="border-rect",n.addChild(T),n.border=T}}function b_(n,t,e){var i;if(!t)return;const{borderColor:o}=t;(i=n.border)===null||i===void 0||i.setAttribute("stroke",Fg(o,e))}function Fg(n,t,e){let i=!0;return!t&&!it(e)||it(n)?t?i=t:t||it(n)?it(n)&&(i=!0):i=n:i=(t??e).map(o=>!!o&&n),i}function ed(n){var t,e,i,o;if(!n.border)return;const r=n.border.attribute.strokeArrayWidth?n.border.attribute.strokeArrayWidth[0]:(t=n.border.attribute.lineWidth)!==null&&t!==void 0?t:0,s=n.border.attribute.strokeArrayWidth?n.border.attribute.strokeArrayWidth[1]:(e=n.border.attribute.lineWidth)!==null&&e!==void 0?e:0,l=n.border.attribute.strokeArrayWidth?n.border.attribute.strokeArrayWidth[2]:(i=n.border.attribute.lineWidth)!==null&&i!==void 0?i:0,a=n.border.attribute.strokeArrayWidth?n.border.attribute.strokeArrayWidth[3]:(o=n.border.attribute.lineWidth)!==null&&o!==void 0?o:0;n.border.setAttributes({width:n.attribute.width-a/2-s/2,height:n.attribute.height-r/2-l/2}),n.border.type==="group"&&n.border.firstChild.setAttributes({width:n.attribute.width,height:n.attribute.height})}function BL(n){if(!n.theme.frameStyle.cornerRadius)return;const t=n.theme.frameStyle.cornerRadius,{cornerHeaderGroup:e,colHeaderGroup:i,rowHeaderGroup:o,bodyGroup:r,rightTopCornerGroup:s,leftBottomCornerGroup:l,rightBottomCornerGroup:a,rightFrozenGroup:h,bottomFrozenGroup:d}=n.scenegraph;e.setAttribute("cornerRadius",0),i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0);const u=nC(t);e.attribute.width>0&&e.attribute.height>0?ri(e,[u[0],0,0,0]):i.attribute.height>0?ri(i,[u[0],0,0,0]):o.attribute.width>0?ri(o,[u[0],0,0,0]):ri(r,[u[0],0,0,0]),l.attribute.width>0&&l.attribute.height>0?ri(l,[0,0,0,u[3]]):d.attribute.height>0?ri(d,[0,0,0,u[3]]):o.attribute.width>0?ri(o,[0,0,0,u[3]]):ri(r,[0,0,0,u[3]]),s.attribute.width>0&&s.attribute.height>0?ri(s,[0,u[1],0,0]):i.attribute.height>0?ri(i,[0,u[1],0,0]):h.attribute.width>0?ri(h,[0,u[1],0,0]):ri(r,[0,u[1],0,0]),a.attribute.width>0&&a.attribute.height>0?ri(a,[0,0,u[2],0]):h.attribute.width>0?ri(h,[0,0,u[2],0]):d.attribute.height>0?ri(d,[0,0,u[2],0]):ri(r,[0,0,u[2],0])}function ri(n,t){n.setAttribute("cornerRadius",t),n.border&&n.border.setAttribute("cornerRadius",t)}const C_=Xe();class Vr extends Qi{constructor(t,e){if(super(e),this.type="chart",this.numberType=C_,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const i=this.chartInstance=new e.ClassType(e.spec,dt({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:this.attribute.mode==="node"?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1}));i.renderSync(),i.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=i}}activate(t){var e,i,o,r;this.active=!0;const{col:s,row:l}=this.parent,{x1:a,y1:h,x2:d,y2:u}=this.getViewBox(),c=PL(s,l,t).intersect({x1:a-t.scrollLeft,x2:d-t.scrollLeft,y1:h-t.scrollTop,y2:u-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,dt({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:d-a,y1:0,y2:u-h},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:v=>{const m=this.stage,b=v.window.getContext(),w=m.window.getViewBoxTransform(),C=m.window.getViewBox();b.inuse=!0,b.clearMatrix(),b.setTransform(w.a,w.b,w.c,w.d,w.e,w.f,!0),b.translate(C.x1,C.y1),b.setTransformForCurrent(!0),b.beginPath(),b.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),b.clip(),b.clearMatrix(),t.options.canvas&&!v.needRender&&(v.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(v){v.window.getContext().inuse=!1,v.needRender=!1,g.resumeRender()}}));const g=this.activeChartInstance.getStage(),f=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();f.multiply(p.a,p.b,p.c,p.d,p.e,p.f),g.window.setViewBoxTransform&&g.window.setViewBoxTransform(f.a,f.b,f.c,f.d,f.e,f.f),this.activeChartInstance.renderSync(),(i=(e=t.internalProps.layoutMap)===null||e===void 0?void 0:e.updateDataStateToActiveChartInstance)===null||i===void 0||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",v=>{var m;((m=this.attribute.spec.select)===null||m===void 0?void 0:m.enable)===!1?t.scenegraph.updateChartState(null):Vr.temp&&t.scenegraph.updateChartState(v==null?void 0:v.datum)}),this.activeChartInstance.on("brushEnd",v=>{var m;t.scenegraph.updateChartState((m=v==null?void 0:v.value)===null||m===void 0?void 0:m.inBrushData),Vr.temp=0,setTimeout(()=>{Vr.temp=1},0)}),(r=(o=t)._bindChartEvent)===null||r===void 0||r.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,(t=this.activeChartInstance)===null||t===void 0||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),(e=this.activeChartInstance)===null||e===void 0||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,i,o,r,s,l,a;const h=this.parent,d=this.attribute.cellPadding,u=this.stage.table,{x1:c,y1:g,x2:f,y2:p}=h.globalAABBBounds;return{x1:Math.ceil(c+d[3]+u.scrollLeft+((e=(t=u.options.viewBox)===null||t===void 0?void 0:t.x1)!==null&&e!==void 0?e:0)),x2:Math.ceil(c+h.attribute.width-d[1]+u.scrollLeft+((o=(i=u.options.viewBox)===null||i===void 0?void 0:i.x1)!==null&&o!==void 0?o:0)),y1:Math.ceil(g+d[0]+u.scrollTop+((s=(r=u.options.viewBox)===null||r===void 0?void 0:r.y1)!==null&&s!==void 0?s:0)),y2:Math.ceil(g+h.attribute.height-d[2]+u.scrollTop+((a=(l=u.options.viewBox)===null||l===void 0?void 0:l.y1)!==null&&a!==void 0?a:0))}}}function PL(n,t,e){var i,o,r,s,l,a,h,d;const{layoutMap:u}=e.internalProps,c=new Ci,g=e.scenegraph.tableGroup.globalAABBBounds;return c.x1=g.x1,c.x2=g.x2,c.y1=g.y1,c.y2=g.y2,u.isLeftBottomCorner(n,t)||u.isRightTopCorner(n,t)||u.isLeftTopCorner(n,t)||u.isRightBottomCorner(n,t)||(u.isFrozenColumn(n,t)?(c.y1=g.y1+e.getFrozenRowsHeight(),c.y2=g.y2-e.getBottomFrozenRowsHeight()):u.isFrozenRow(n,t)?(c.x1=g.x1+e.getFrozenColsWidth(),c.x2=g.x2-e.getRightFrozenColsWidth()):u.isRightFrozenColumn(n,t)?(c.y1=g.y1+e.getFrozenRowsHeight(),c.y2=g.y2-e.getBottomFrozenRowsHeight()):u.isBottomFrozenRow(n,t)?(c.x1=g.x1+e.getFrozenColsWidth(),c.x2=g.x2-e.getRightFrozenColsWidth()):u.isFrozenColumn(n,t)||u.isRightFrozenColumn(n,t)||(c.x1=g.x1+e.getFrozenColsWidth(),c.x2=g.x2-e.getRightFrozenColsWidth(),c.y1=g.y1+e.getFrozenRowsHeight(),c.y2=g.y2-e.getBottomFrozenRowsHeight())),c.x1=c.x1+((o=(i=e.options.viewBox)===null||i===void 0?void 0:i.x1)!==null&&o!==void 0?o:0),c.x2=c.x2+((s=(r=e.options.viewBox)===null||r===void 0?void 0:r.x1)!==null&&s!==void 0?s:0),c.y1=c.y1+((a=(l=e.options.viewBox)===null||l===void 0?void 0:l.y1)!==null&&a!==void 0?a:0),c.y2=c.y2+((d=(h=e.options.viewBox)===null||h===void 0?void 0:h.y1)!==null&&d!==void 0?d:0),c}Vr.temp=1;const kg=[],Ig=[];let zg=5,Dg=!1;function __(n){I(n)&&(zg=n)}function HL(){return Dg}function y_(n){var t,e,i,o,r,s;const{axes:l,dataId:a,data:h,spec:d,ClassType:u,canvas:c,mode:g,modeParams:f,dpr:p}=n.attribute;let{chartInstance:v}=n;v||(v=new u(d,{renderCanvas:c,mode:g==="node"?"node":"desktop-browser",modeParams:f,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:p,interactive:!1,animation:!1,autoFit:!1}),v.renderSync(),n.chartInstance=v);const m=n.getViewBox();m.x2<=m.x1&&(m.x2=m.x1+1),m.y2<=m.y1&&(m.y2=m.y1+1),v.updateViewBox({x1:0,x2:m.x2-m.x1,y1:0,y2:m.y2-m.y1},!1,!1);const b=v.getStage(),w=n.globalTransMatrix.clone(),C=n.stage.window.getViewBoxTransform();w.multiply(C.a,C.b,C.c,C.d,C.e,C.f),b.window.setViewBoxTransform&&b.window.setViewBoxTransform(w.a,w.b,w.c,w.d,w.e,w.f);const{table:_}=n.getRootNode();let y=!1;if(_.options.specFormat){const x=_.options.specFormat(n.attribute.spec);if(x.needFormatSpec&&x.spec){const S=x.spec;v.updateSpecSync(S),y=!0}}if(!y)if(l==null||l.forEach((x,S)=>{var A,R,T,M;x.type==="band"?v.updateModelSpec({type:"axes",index:S},{domain:x.domain.slice(0)},!0):v.updateModelSpecSync({type:"axes",index:S},{min:(R=(A=x.range)===null||A===void 0?void 0:A.min)!==null&&R!==void 0?R:0,max:(M=(T=x.range)===null||T===void 0?void 0:T.max)!==null&&M!==void 0?M:0},!0)}),(e=(t=_.internalProps.layoutMap)===null||t===void 0?void 0:t.updateDataStateToActiveChartInstance)===null||e===void 0||e.call(t,v),typeof a=="string")v.updateDataSync(a,h??[]);else{const x=[];for(const S in a){const A=a[S],R=d.series.find(T=>{var M;return((M=T==null?void 0:T.data)===null||M===void 0?void 0:M.id)===S});x.push({id:S,values:A?(i=h==null?void 0:h.filter(T=>T.hasOwnProperty(A)))!==null&&i!==void 0?i:[]:h??[],fields:(o=R==null?void 0:R.data)===null||o===void 0?void 0:o.fields}),v.updateFullDataSync||v.updateDataSync(S,A?(r=h==null?void 0:h.filter(T=>T.hasOwnProperty(A)))!==null&&r!==void 0?r:[]:h??[])}(s=v.updateFullDataSync)===null||s===void 0||s.call(v,x)}EL(v.getStage(),n)}function w_(n){Dg=!0,Ig.length>0?requestAnimationFrame(()=>{const t=Ig.splice(0,zg);kg.splice(0,zg),t.forEach(e=>{y_(e),e.addUpdateBoundTag()}),n.render(),w_(n)}):Dg=!1}const wn=2e3;function EL(n,t){var e;const{viewWidth:i,viewHeight:o}=n;if(i<wn&&o<wn)return t.cacheCanvas=S_(n),void(t.isShareChartSpec||((e=t.chartInstance)===null||e===void 0||e.release(),t.chartInstance=null,t.setAttribute("chartInstance",null)));const r=Math.ceil(o/wn),s=Math.ceil(i/wn),l=[];for(let a=0;a<r;a++)for(let h=0;h<s;h++){const d=h*wn,u=a*wn,c=d+wn>i?i:d+wn,g=u+wn>o?o:u+wn,f=c-d,p=g-u,v=new Ci;v.setValue(d,u,c,g);const m=S_(n,!1,v);l.push({canvas:m,x:d,y:u,width:f,height:p})}t.cacheCanvas=l}function S_(n,t=!0,e){if(n.releaseStatus==="released")return null;const i=n.window.getViewBoxTransform(),o=LL(n,t,e);o.setViewBoxTransform(i.a,i.b,i.c,i.d,0,0),n.renderTo(o);const r=o.getNativeHandler();return r.nativeCanvas?r.nativeCanvas:null}function LL(n,t=!0,e){const i=n.window.getViewBoxTransform(),o=Tt.get(as),r=e?-e.x1:0,s=e?-e.y1:0,l=e?e.x2:n.viewWidth,a=e?e.y2:n.viewHeight,h=e?e.width():n.viewWidth,d=e?e.height():n.viewHeight;return o.create({viewBox:{x1:r,y1:s,x2:l,y2:a},width:h*i.a,height:d*i.d,dpr:n.window.dpr,canvasControled:!0,offscreen:!0,title:""}),n.renderTo(o),o}var FL=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};const kL=Symbol.for("ChartRender");let ul=class extends vi{constructor(){super(...arguments),this.numberType=C_}drawShape(n,t,e,i,o,r,s,l){var a,h,d,u;const c=Ht(n,r==null?void 0:r.theme).group,{dataId:g,data:f,spec:p}=n.attribute,{width:v=c.width,height:m=c.height}=(n.getViewBox(),n.attribute),{table:b}=n.getRootNode(),{active:w,cacheCanvas:C,activeChartInstance:_}=n;if(!w&&C)it(C)?C.forEach(y=>{const{x,y:S,width:A,height:R,canvas:T}=y;t.drawImage(T,x,S,A,R)}):t.drawImage(C,e,i,v,m);else if(_){if(b.options.specFormat){const R=b.options.specFormat(n.attribute.spec);if(R.needFormatSpec&&R.spec){const T=R.spec;return void _.updateSpecSync(T)}}const y=n.getViewBox();_.updateViewBox({x1:0,x2:y.x2-y.x1,y1:0,y2:y.y2-y.y1},!1,!1);const x=_.getStage();x.needRender=!0;const S=n.globalTransMatrix.clone(),A=n.stage.window.getViewBoxTransform().clone();if(A.multiply(S.a,S.b,S.c,S.d,S.e,S.f),x.window.setViewBoxTransform(A.a,A.b,A.c,A.d,A.e,A.f),typeof g=="string")_.updateDataSync(g,f??[]);else{const R=[];for(const T in g){const M=g[T],P=p.series.find(k=>{var B;return((B=k==null?void 0:k.data)===null||B===void 0?void 0:B.id)===T});R.push({id:T,values:M?(a=f==null?void 0:f.filter(k=>k.hasOwnProperty(M)))!==null&&a!==void 0?a:[]:f??[],fields:(h=P==null?void 0:P.data)===null||h===void 0?void 0:h.fields}),_.updateFullDataSync||_.updateDataSync(T,M?(d=f==null?void 0:f.filter(k=>k.hasOwnProperty(M)))!==null&&d!==void 0?d:[]:f??[])}(u=_.updateFullDataSync)===null||u===void 0||u.call(_,R)}}else b.internalProps.renderChartAsync?(kg.indexOf(`${n.parent.col}+${n.parent.row}`)===-1&&(kg.push(`${n.parent.col}+${n.parent.row}`),Ig.push(n)),HL()||w_(b)):y_(n)}draw(n,t,e,i){this._draw(n,{},!1,e,i)}};ul=FL([st()],ul);var id=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let nd=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{shape:g}=n.attribute;if(g==="circle"){const{width:f=a.width,height:p=a.height}=n.attribute;t.beginPath(),t.arc(e+f/2,i+p/2,Math.min(f,p)/2,0,2*Math.PI),t.closePath(),t.save(),t.clip()}}};nd=id([st()],nd);let od=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{shape:g}=n.attribute;g==="circle"&&t.restore()}};od=id([st()],od);let rd=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{isGif:g}=n.attribute;g&&n.playing&&(n.attribute.opacity=0)}};rd=id([st()],rd);let sd=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{isGif:g}=n.attribute;g&&n.playing&&(n.attribute.opacity=1,t.globalAlpha=n.attribute.opacity,n.renderFrame(t,e,i))}};sd=id([st()],sd);function IL(n,t){var e,i,o,r,s,l,a,h,d,u,c;let g,f;if(n.role==="cell"&&I(n.mergeStartCol)&&I(n.mergeStartRow)&&I(n.mergeEndCol)&&I(n.mergeEndRow)){const{colStart:v,colEnd:m,rowStart:b,rowEnd:w}=fo(n,t.scenegraph);for(let C=v;C<=m;C++)for(let _=b;_<=w;_++){const y=x_(t.stateManager,C,_,n);!y||g&&y!=="cellBgColor"||(g=y)}}else n.role==="cell"&&(g=x_(t.stateManager,n.col,n.row,n));if(!g)return;const p=t.internalProps.layoutMap;return p.isCornerHeader(n.col,n.row)?f=((e=t.theme.cornerHeaderStyle)===null||e===void 0?void 0:e.hover)||((i=t.theme.headerStyle)===null||i===void 0?void 0:i.hover):p.isColumnHeader(n.col,n.row)?f=(o=t.theme.headerStyle)===null||o===void 0?void 0:o.hover:p.isRowHeader(n.col,n.row)?f=(r=t.theme.rowHeaderStyle)===null||r===void 0?void 0:r.hover:p.isBottomFrozenRow(n.col,n.row)?f=((s=t.theme.bottomFrozenStyle)===null||s===void 0?void 0:s.hover)||(t.isListTable()?(l=t.theme.bodyStyle)===null||l===void 0?void 0:l.hover:(a=t.theme.headerStyle)===null||a===void 0?void 0:a.hover):p.isRightFrozenColumn(n.col,n.row)?f=((h=t.theme.rightFrozenStyle)===null||h===void 0?void 0:h.hover)||(t.isListTable()?(d=t.theme.bodyStyle)===null||d===void 0?void 0:d.hover:(u=t.theme.rowHeaderStyle)===null||u===void 0?void 0:u.hover):t.isHeader(n.col,n.row)||(f=(c=t.theme.bodyStyle)===null||c===void 0?void 0:c.hover),lt(g,f,n.col,n.row,t)}function x_(n,t,e,i){var o;const{highlightScope:r,disableHeader:s,cellPos:l}=n.hover,a=n.table,h=a.isHeader(t,e);if(h&&s)return;let d;if(r===Nt.single&&l.col===t&&l.row===e?d="cellBgColor":r===Nt.column&&l.col===t?d=l.col===t&&l.row===e?"cellBgColor":"inlineColumnBgColor":r===Nt.row&&l.row===e?d=l.col===t&&l.row===e?"cellBgColor":"inlineRowBgColor":r===Nt.cross&&(l.col===t&&l.row===e?d="cellBgColor":l.col===t?d="inlineColumnBgColor":l.row===e&&(d="inlineRowBgColor")),d){let u;if(h){const c=a.getHeaderDefine(t,e);u=c==null?void 0:c.disableHeaderHover,i.firstChild&&i.firstChild.name==="axis"&&(!((o=a.options.hover)===null||o===void 0)&&o.disableAxisHover)&&(u=!0)}else{const c=a.getBodyColumnDefine(t,e);u=c==null?void 0:c.disableHover}u&&(d=void 0)}return d}function zL(n,t){var e,i,o,r,s,l,a,h,d,u,c;let g,f;if(n.role==="cell"&&I(n.mergeStartCol)&&I(n.mergeStartRow)&&I(n.mergeEndCol)&&I(n.mergeEndRow)){const{colStart:v,colEnd:m,rowStart:b,rowEnd:w}=fo(n,t.scenegraph);for(let C=v;C<=m;C++)for(let _=b;_<=w;_++){const y=A_(t.stateManager,C,_);!y||g&&y!=="cellBgColor"||(g=y)}}else n.role==="cell"&&(g=A_(t.stateManager,n.col,n.row));if(!g)return;const p=t.internalProps.layoutMap;return p.isCornerHeader(n.col,n.row)?f=((e=t.theme.cornerHeaderStyle)===null||e===void 0?void 0:e.select)||((i=t.theme.headerStyle)===null||i===void 0?void 0:i.select):p.isColumnHeader(n.col,n.row)?f=(o=t.theme.headerStyle)===null||o===void 0?void 0:o.select:p.isRowHeader(n.col,n.row)?f=(r=t.theme.rowHeaderStyle)===null||r===void 0?void 0:r.select:p.isBottomFrozenRow(n.col,n.row)?f=((s=t.theme.bottomFrozenStyle)===null||s===void 0?void 0:s.select)||(t.isListTable()?(l=t.theme.bodyStyle)===null||l===void 0?void 0:l.select:(a=t.theme.headerStyle)===null||a===void 0?void 0:a.select):p.isRightFrozenColumn(n.col,n.row)?f=((h=t.theme.rightFrozenStyle)===null||h===void 0?void 0:h.select)||(t.isListTable()?(d=t.theme.bodyStyle)===null||d===void 0?void 0:d.select:(u=t.theme.rowHeaderStyle)===null||u===void 0?void 0:u.select):t.isHeader(n.col,n.row)||(f=(c=t.theme.bodyStyle)===null||c===void 0?void 0:c.select),lt(g,f,n.col,n.row,t)}function DL(n){return n.start.col!==n.end.col||n.start.row!==n.end.row}function OL(n,t,e){let i;const{highlightScope:o,cellPos:r,ranges:s}=n.select,l=s[0],a=Math.min(l.start.col,l.end.col),h=Math.max(l.start.col,l.end.col),d=Math.min(l.start.row,l.end.row),u=Math.max(l.start.row,l.end.row);return o===Nt.single&&r.col===t&&r.row===e?i="cellBgColor":o===Nt.column&&t>=a&&t<=h?i=Ti(s[0],t,e)?"cellBgColor":"inlineColumnBgColor":o===Nt.row&&e>=d&&e<=u?i=Ti(s[0],t,e)?"cellBgColor":"inlineRowBgColor":o===Nt.cross&&(Ti(s[0],t,e)?i="cellBgColor":t>=a&&t<=h?i="inlineColumnBgColor":e>=d&&e<=u&&(i="inlineRowBgColor")),i}function WL(n,t,e){let i;const{highlightScope:o,cellPos:r}=n.select;return o===Nt.single&&r.col===t&&r.row===e?i="cellBgColor":o===Nt.column&&r.col===t?i=r.col===t&&r.row===e?"cellBgColor":"inlineColumnBgColor":o===Nt.row&&r.row===e?i=r.col===t&&r.row===e?"cellBgColor":"inlineRowBgColor":o===Nt.cross&&(r.col===t&&r.row===e?i="cellBgColor":r.col===t?i="inlineColumnBgColor":r.row===e&&(i="inlineRowBgColor")),i}function A_(n,t,e,i){const{highlightInRange:o,disableHeader:r,ranges:s}=n.select;let l;const a=s.length===1&&DL(s==null?void 0:s[0])&&o;if(a?(s==null?void 0:s.length)===1&&s[0].start&&s[0].end:(s==null?void 0:s.length)===1&&s[0].end.col===s[0].start.col&&s[0].end.row===s[0].start.row){const h=n.table,d=h.isHeader(t,e);if(d&&r)return;if(l=a?OL(n,t,e):WL(n,t,e),l){let u;if(d){const c=h.getHeaderDefine(t,e);u=c==null?void 0:c.disableHeaderSelect}else{const c=h.getBodyColumnDefine(t,e);u=c==null?void 0:c.disableSelect}u&&(l=void 0)}}else if(n.table.theme.selectionStyle.selectionFillMode==="replace")for(let h=0;h<s.length;h++){const d=s[h],u=Math.min(d.start.col,d.end.col),c=Math.max(d.start.col,d.end.col),g=Math.min(d.start.row,d.end.row),f=Math.max(d.start.row,d.end.row);if(u<=t&&g<=e&&c>=t&&f>=e){l="cellBgColor";break}}return l}function ld(n,t,e){const i=n.getBodyColumnDefine(t,e),o=n.isHeader(t,e);return!(!(i!=null&&i.disableSelect)||o)||!(!o||!(i!=null&&i.disableHeaderSelect))}var Vn=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let ad=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{stroke:g=a.stroke,strokeArrayWidth:f=a.strokeArrayWidth,strokeArrayColor:p=a.strokeArrayColor}=n.attribute;g&&(Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};ad=Vn([st()],ad);let hd=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u){var c,g;const{stroke:f=a.stroke,strokeArrayColor:p=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:w=a.cornerRadius}=n.attribute;let C,_,{width:y=a.width,height:x=a.height}=n.attribute;if(f&&(Array.isArray(v)||m!==0)&&(Array.isArray(p)||Array.isArray(v))){if(typeof m=="number"&&1&m||Array.isArray(v)&&v.some(S=>1&S)){const S=n.stage.table;if(!S)return;const A=((c=S==null?void 0:S.theme)===null||c===void 0?void 0:c.cellBorderClipDirection)==="bottom-right";if(A){if(e=Math.floor(e)-.5,i=Math.floor(i)-.5,n.role==="cell"){const M=n.col,P=n.row;M===0&&(e+=1),P===0&&(i+=1)}}else e=Math.floor(e)+.5,i=Math.floor(i)+.5;!((g=S.options.customConfig)===null||g===void 0)&&g._disableColumnAndRowSizeRound&&(y=Math.round(y),x=Math.round(x));const{width:R,height:T}=Og(n,Math.ceil(y),Math.ceil(x),A);C=R,_=T}else C=Math.ceil(y),_=Math.ceil(x);w===0||it(w)&&w.every(S=>S===0)?T_(n,t,e,i,a,f,v||m,p||b,C,_):(t.beginPath(),on(t,e,i,C,_,w,new Array(4).fill(0).map((S,A)=>(R,T,M,P)=>{B_(A,R,T,M,P,n,t,e,i,a,f,v||m,p||b,C,_)})),t.stroke())}}};hd=Vn([st()],hd);function R_(n){if(!Array.isArray(n))return{isSplitDraw:!1,width:n};let t;for(let e=0;e<n.length;e++){const i=n[e];if(i)if(t){if(i!==t)return{isSplitDraw:!0}}else t=i}return{isSplitDraw:!1,width:t}}function T_(n,t,e,i,o,r,s,l,a,h,d,u){var c,g,f,p;const v=R_(s),m=!Array.isArray(s),b=!Array.isArray(r),w=Array.isArray(u),C=Array.isArray(l)||v.isSplitDraw;t.setStrokeStyle(n,n.attribute,e,i,o);const{lineDash:_=o.lineDash}=n.attribute;let y=!1;_.length&&_.some(T=>Array.isArray(T))&&(y=!0),t.beginPath(),t.moveTo(e,i);const x=(b||r[0])&&(m||s[0]),S=(b||r[1])&&(m||s[1]),A=(b||r[2])&&(m||s[2]),R=(b||r[3])&&(m||s[3]);if(x){const T=(m?v.width:s[0])/2,M=(m?v.width:s[0])/2;w&&Array.isArray(u[0])?(t.moveTo(e-T+(a+T+M)*u[0][0],i),t.lineTo(e-T+(a+T+M)*(u[0][1]-u[0][0]),i),t.moveTo(e+a+M,i)):(t.moveTo(e-T,i),t.lineTo(e+a+M,i)),(C||y)&&(l&&l[0]?t.strokeStyle=l[0]:t.strokeStyle="transparent",m||(t.lineWidth=s[0]),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,y&&t.setLineDash((c=_[0])!==null&&c!==void 0?c:[]),t.stroke(),t.beginPath(),t.moveTo(e+a,i))}else t.moveTo(e+a,i);if(S){const T=(m?v.width:s[1])/2,M=(m?v.width:s[1])/2;w&&Array.isArray(u[1])?(t.moveTo(e+a,i-T+h*u[1][0]),t.lineTo(e+a,i-T+(h+T+M)*(u[1][1]-u[1][0])),t.moveTo(e+a,i+h+M)):(t.moveTo(e+a,i-T),t.lineTo(e+a,i+h+M)),(C||y)&&(l&&l[1]?t.strokeStyle=l[1]:t.strokeStyle="transparent",m||(t.lineWidth=s[1]),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,y&&t.setLineDash((g=_[1])!==null&&g!==void 0?g:[]),t.stroke(),t.beginPath(),t.moveTo(e+a,i+h))}else t.moveTo(e+a,i+h);if(A){const T=(m?v.width:s[2])/2,M=(m?v.width:s[2])/2;w&&Array.isArray(u[2])?(t.moveTo(e-T+(a+T+M)*u[2][0],i+h),t.lineTo(e-T+(a+T+M)*(u[2][1]-u[2][0]),i+h),t.moveTo(e-T,i+h)):(t.moveTo(e-T,i+h),t.lineTo(e+a+M,i+h)),(C||y)&&(l&&l[2]?t.strokeStyle=l[2]:t.strokeStyle="transparent",m||(t.lineWidth=s[2]),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,y&&t.setLineDash((f=_[2])!==null&&f!==void 0?f:[]),t.stroke(),t.beginPath(),t.moveTo(e,i+h))}else t.moveTo(e,i+h);if(R){const T=(m?v.width:s[3])/2,M=(m?v.width:s[3])/2;w&&Array.isArray(u[3])?(t.moveTo(e,i-T+(h+T+M)*u[3][0]),t.lineTo(e,i-T+(h+T+M)*(u[3][1]-u[3][0])),t.moveTo(e,i-T)):(t.moveTo(e,i-T),t.lineTo(e,i+h+M)),(C||y)&&(l&&l[3]?t.strokeStyle=l[3]:t.strokeStyle="transparent",m||(t.lineWidth=s[3]),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,y&&t.setLineDash((p=_[3])!==null&&p!==void 0?p:[]),t.stroke(),t.beginPath(),t.moveTo(e,i))}else t.moveTo(e,i);C||y||(!m&&v.width&&(t.lineWidth=v.width),t.stroke()),t.lineDashOffset=0,t.setLineDash([])}let dd=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){var g;const{lineDash:f=a.lineDash,stroke:p=a.stroke,strokeArrayColor:v=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth}=n.attribute;p&&Array.isArray(f)&&f.length&&(!((g=f[0])===null||g===void 0)&&g.length)&&!Array.isArray(v)&&!Array.isArray(m)&&(c.doStroke=!1)}};dd=Vn([st()],dd);let ud=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u){var c,g,f,p,v,m;const{lineDash:b=a.lineDash,stroke:w=a.stroke,strokeArrayColor:C=a.strokeArrayColor,strokeArrayWidth:_=a.strokeArrayWidth,lineWidth:y=a.lineWidth}=n.attribute;if(!w||!(Array.isArray(b)&&b.length&&(!((c=b[0])===null||c===void 0)&&c.length))||Array.isArray(C)||Array.isArray(_))return;const x=n.stage.table;if(!x)return;const S=it(b[0])?NL(b):[b,b,b,b];let A,R,{width:T=a.width,height:M=a.height}=n.attribute;if(!((g=x.options.customConfig)===null||g===void 0)&&g._disableColumnAndRowSizeRound?(T=Math.round(T),M=Math.round(M)):(T=Math.ceil(T),M=Math.ceil(M)),1&y){const P=x.theme.cellBorderClipDirection==="bottom-right",k=0,B=0;P?(e=Math.floor(e)-.5,i=Math.floor(i)-.5,n.role==="cell"&&(n.col===0&&(e+=1),n.row===0&&(i+=1))):(e=Math.floor(e)+.5,i=Math.floor(i)+.5);const{width:H,height:E}=Og(n,Math.ceil(T+k),Math.ceil(M+B),P);A=H,R=E}else A=Math.ceil(T),R=Math.ceil(M);t.setStrokeStyle(n,n.attribute,e,i,a),t.beginPath(),t.moveTo(e,i),t.lineTo(e+A,i),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,t.setLineDash((f=S[0])!==null&&f!==void 0?f:[]),t.stroke(),t.beginPath(),t.moveTo(e+A,i),t.lineTo(e+A,i+R),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,t.setLineDash((p=S[1])!==null&&p!==void 0?p:[]),t.stroke(),t.beginPath(),t.moveTo(e,i+R),t.lineTo(e+A,i+R),t.lineDashOffset=t.currentMatrix.e/t.currentMatrix.a,t.setLineDash((v=S[2])!==null&&v!==void 0?v:[]),t.stroke(),t.beginPath(),t.moveTo(e,i),t.lineTo(e,i+R),t.lineDashOffset=t.currentMatrix.f/t.currentMatrix.d,t.setLineDash((m=S[3])!==null&&m!==void 0?m:[]),t.stroke(),t.lineDashOffset=0,t.setLineDash([])}};ud=Vn([st()],ud);let cd=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{lineWidth:g=a.lineWidth,stroke:f=a.stroke,lineDash:p=a.lineDash,strokeArrayWidth:v=a.strokeArrayWidth,strokeArrayColor:m=a.strokeArrayColor,notAdjustPos:b}=n.attribute;b!==!0&&f&&Array.isArray(p)&&!p.length&&!Array.isArray(m)&&!Array.isArray(v)&&1&g&&(c.doStroke=!1)}};cd=Vn([st()],cd);let gd=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u){var c,g;const{lineWidth:f=a.lineWidth,stroke:p=a.stroke,lineDash:v=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:w,cornerRadius:C=a.cornerRadius}=n.attribute;let{width:_=a.width,height:y=a.height}=n.attribute;if(w!==!0&&p&&Array.isArray(v)&&!v.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&f){const x=n.stage.table;if(!x)return;!((c=x.options.customConfig)===null||c===void 0)&&c._disableColumnAndRowSizeRound&&(_=Math.round(_),y=Math.round(y)),t.beginPath();const S=((g=x==null?void 0:x.theme)===null||g===void 0?void 0:g.cellBorderClipDirection)==="bottom-right",A=0,R=0;S?(e=Math.floor(e)-.5,i=Math.floor(i)-.5,n.role==="cell"&&(n.col===0&&(e+=1),n.row===0&&(i+=1))):(e=Math.floor(e)+.5,i=Math.floor(i)+.5);const{width:T,height:M}=Og(n,Math.ceil(_),Math.ceil(y),S);C?on(t,e,i,T+A,M+R,C):t.rect(e,i,T,M),t.setStrokeStyle(n,n.attribute,e,i,a),t.stroke()}}};gd=Vn([st()],gd);let fd=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){if(n.role==="cell"){const g=n.stage.table;if(g){const f=zL(n,g);if(f)n.attribute._vtableHightLightFill=f;else if(g.stateManager.interactionState!==Rt.scrolling){const p=IL(n,g);p&&(n.attribute._vtableHightLightFill=p)}}}}};fd=Vn([st()],fd);let pd=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u){if(n.attribute._vtableHightLightFill&&!d){if(s){const c=n.attribute.fill;n.attribute.fill=n.attribute._vtableHightLightFill,t.setCommonStyle(n,n.attribute,e,i,a),t.fill(),n.attribute.fill=c,n.attribute._vtableHightLightFill=void 0}}}};pd=Vn([st()],pd);let vd=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){var g,f,p,v,m,b;const w=n.stage.table;w&&(n.role==="body"?jn(t,-((g=n.attribute.x)!==null&&g!==void 0?g:0)+w.getFrozenColsWidth(),-((f=n.attribute.y)!==null&&f!==void 0?f:0)+w.getFrozenRowsHeight(),n.parent.attribute.width-w.getFrozenColsWidth()-w.getRightFrozenColsWidth(),n.parent.attribute.height-w.getFrozenRowsHeight()-w.getBottomFrozenRowsHeight()):n.role==="row-header"?jn(t,0,-((p=n.attribute.y)!==null&&p!==void 0?p:0)+w.getFrozenRowsHeight(),w.getFrozenColsWidth(),n.parent.attribute.height-w.getFrozenRowsHeight()-w.getBottomFrozenRowsHeight()):n.role==="col-header"?jn(t,-((v=n.attribute.x)!==null&&v!==void 0?v:0)+w.getFrozenColsWidth(),0,n.parent.attribute.width-w.getFrozenColsWidth()-w.getRightFrozenColsWidth(),w.getFrozenRowsHeight()):n.role==="right-frozen"?jn(t,0,-((m=n.attribute.y)!==null&&m!==void 0?m:0)+w.getFrozenRowsHeight(),w.getRightFrozenColsWidth(),n.parent.attribute.height-w.getFrozenRowsHeight()-w.getBottomFrozenRowsHeight()):n.role==="bottom-frozen"?jn(t,-((b=n.attribute.x)!==null&&b!==void 0?b:0)+w.getFrozenColsWidth(),0,n.parent.attribute.width-w.getFrozenColsWidth()-w.getRightFrozenColsWidth(),w.getBottomFrozenRowsHeight()):n.role==="corner-header"?jn(t,0,0,w.getFrozenColsWidth(),w.getFrozenRowsHeight()):n.role==="corner-right-top-header"?jn(t,0,0,w.getRightFrozenColsWidth(),w.getFrozenRowsHeight()):n.role==="corner-right-bottom-header"?jn(t,0,0,w.getRightFrozenColsWidth(),w.getBottomFrozenRowsHeight()):n.role==="corner-left-bottom-header"&&jn(t,0,0,w.getFrozenColsWidth(),w.getBottomFrozenRowsHeight()))}};vd=Vn([st()],vd);const jr=Math.pow(2,24);function jn(n,t,e,i,o){n.beginPath();const r=n.applyedMatrix;Math.abs(r.f)>jr||Math.abs(r.g)>jr?n.rect(t-jr,e-jr,i+2*jr,o+2*jr):n.rect(t,e,i,o)}function Og(n,t,e,i){const o=n.stage.table;if(!o)return{width:t,height:e};if(n.role==="cell"){let r=n.col,s=n.row;const l=ke(o,r,s);l&&(r=l.end.col,s=l.end.row),r!==o.colCount-1||i?(r===o.frozenColCount-1&&o.scrollLeft&&!i||r===0&&i)&&(t-=1):t-=1,s!==o.rowCount-1||i?(s===o.frozenRowCount-1&&o.scrollTop&&!i||s===0&&i)&&(e-=1):e-=1}else n.role==="corner-frozen"&&(o.scrollLeft&&!i&&(t-=1),o.scrollTop&&!i&&(e-=1));return{width:t,height:e}}function NL(n){return n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n}var M_=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let cl=class{constructor(){this.time=Ut.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){const{stroke:g=a.stroke,strokeArrayWidth:f=a.strokeArrayWidth,strokeArrayColor:p=a.strokeArrayColor}=n.attribute;g&&(Array.isArray(g)||Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};cl=M_([st()],cl);let gl=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u){const{width:c=a.width,height:g=a.height,stroke:f=a.stroke,strokeArrayColor:p=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:w=a.cornerRadius}=n.attribute;f&&(Array.isArray(v)||m!==0)&&(Array.isArray(f)||Array.isArray(p)||Array.isArray(v))&&(n.name!=="border-rect"&&n.name!=="table-border-rect"&&(typeof m=="number"&&1&m||Array.isArray(v)&&v.some(y=>1&y))&&(e=Math.floor(e)+.5,i=Math.floor(i)+.5),w===0||it(w)&&w.every(y=>y===0)?T_(n,t,e,i,a,f,v||m,p||b,Math.ceil(c+0),Math.ceil(g+0)):(t.beginPath(),on(t,e,i,c,g,w,new Array(4).fill(0).map((y,x)=>(S,A,R,T)=>{B_(x,S,A,R,T,n,t,e,i,a,f,v||m,p||b,Math.ceil(c+0),Math.ceil(g+0))})),t.stroke()))}};gl=M_([st()],gl);function B_(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){var p,v,m,b;const w=r,C=h,_=R_(u),y=!Array.isArray(u),x=!Array.isArray(d),S=Array.isArray(c)||_.isSplitDraw;s.setStrokeStyle(r,r.attribute,l,a,h);const{lineDash:A=C.lineDash}=w.attribute;let R=!1;A.length&&A.some(B=>Array.isArray(B))&&(R=!0),s.moveTo(l,a);const T=(x||d[0])&&(y||u[0]),M=(x||d[1])&&(y||u[1]),P=(x||d[2])&&(y||u[2]),k=(x||d[3])&&(y||u[3]);T&&n===0?(y?_.width:u[0],y?_.width:u[0],s.moveTo(t,e),s.lineTo(i,o),(S||R)&&(c&&c[0]?s.strokeStyle=c[0]:s.strokeStyle="transparent",y||(s.lineWidth=u[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash((p=A[0])!==null&&p!==void 0?p:[]),s.stroke(),s.beginPath())):n===0&&s.moveTo(l+g,a),M&&n===1?(y?_.width:u[1],y?_.width:u[1],s.moveTo(t,e),s.lineTo(i,o),(S||R)&&(c&&c[1]?s.strokeStyle=c[1]:s.strokeStyle="transparent",y||(s.lineWidth=u[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash((v=A[1])!==null&&v!==void 0?v:[]),s.stroke(),s.beginPath(),s.moveTo(l+g,a+f))):n===1&&s.moveTo(l+g,a+f),P&&n===2?(y?_.width:u[2],y?_.width:u[2],s.moveTo(t,e),s.lineTo(i,o),(S||R)&&(c&&c[2]?s.strokeStyle=c[2]:s.strokeStyle="transparent",y||(s.lineWidth=u[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash((m=A[2])!==null&&m!==void 0?m:[]),s.stroke(),s.beginPath(),s.moveTo(l,a+f))):n===2&&s.moveTo(l,a+f),k&&n===3?(y?_.width:u[3],y?_.width:u[3],s.moveTo(t,e),s.lineTo(i,o),(S||R)&&(c&&c[3]?s.strokeStyle=c[3]:s.strokeStyle="transparent",y||(s.lineWidth=u[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash((b=A[3])!==null&&b!==void 0?b:[]),s.stroke(),s.beginPath(),s.moveTo(l,a))):n===3&&s.moveTo(l,a),S||R||(!y&&_.width&&(s.lineWidth=_.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}var VL=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let fl,md=class{constructor(){this.order=1,this.interceptors=[new jL]}afterDrawItem(n,t,e,i,o){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(n,t,e,i,o))return!0;return!1}beforeDrawItem(n,t,e,i,o){if((!n.in3dMode||e.in3dInterceptor)&&!n.shadowRoot&&!(n.baseGraphic||n.attribute.globalZIndex||n.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(n,t,e,i,o))return!0;return!1}};md=VL([st()],md);class jL{constructor(){this.order=1}afterDrawItem(t,e,i,o,r){return t.type==="image"&&this.drawItem(t,e,i,o,r),!1}drawItem(t,e,i,o,r){const{image:s,gif:l}=t.attribute;if(l&&t.playing||!s||!t.resources)return!1;const a=t.resources.get(s);if(!a||a.state!=="loading")return!1;if(!fl){const p=an(),v=p.loading_pic.svg,m=p.loading_pic.width,b=p.loading_pic.height;fl=Pa({width:m,height:b,image:v})}const{image:h}=fl.attribute;if(!s||!fl.resources)return!1;const d=fl.resources.get(h);if(d.state!=="success")return!1;const{context:u}=i;u.highPerformanceSave(),t.parent&&u.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&u.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const c=t.AABBBounds,{width:g,height:f}=Uh(d.data.width,d.data.height,c.width(),c.height());return u.drawImage(d.data,c.x1+(c.width()-g)/2,c.y1+(c.height()-f)/2,g,f),u.highPerformanceRestore(),!0}}var GL=globalThis&&globalThis.__decorate||function(n,t,e,i){var o,r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(s=(r<3?o(s):r>3?o(t,e,s):o(t,e))||s);return r>3&&s&&Object.defineProperty(t,e,s),s};let bd=class{constructor(){this.time=Ut.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(n,t,e,i,o,r,s,l,a,h,d,u,c){var g,f;const{text:p,underline:v=a.underline,lineThrough:m=a.lineThrough,direction:b=a.direction,whiteSpace:w=a.whiteSpace,fontSize:C=a.fontSize,verticalMode:_=a.verticalMode,ellipsis:y=a.ellipsis,textAlign:x=a.textAlign,textBaseline:S=a.textBaseline,x:A=a.x,y:R=a.y}=n.attribute;let T=!1;if(Array.isArray(n)){const B=(g=n.cache)===null||g===void 0?void 0:g.layoutData;y&&B&&B.lines.every(H=>H.str==="")&&(T=!0)}else{const{cache:B}=n;y&&B&&B.clipedText===""&&B.clipedWidth===0&&(T=!0)}if(!T)return;const M=Qt(y)?y:"...",P=(f=Hn(n.attribute.lineHeight,C))!==null&&f!==void 0?f:C;let k=0;P!==C&&(S==="top"?k=(P-C)/2:S==="middle"||S==="bottom"&&(k=-(P-C)/2)),r&&(u?u(t,n.attribute,a):l&&(t.setStrokeStyle(n,n.attribute,A-e,R-i,a),t.strokeText(M,A,R+k))),o&&(d?d(t,n.attribute,a):s&&(t.setCommonStyle(n,n.attribute,A-e,R-i,a),t.fillText(M,A,R+k),this.drawUnderLine(v,m,n,A,R+k,0,a,t,M)))}drawUnderLine(n,t,e,i,o,r,s,l,a){if(t+n<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:u=s.fontSize,fontFamily:c=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:f=s.fontStyle,fill:p=s.fill,opacity:v=s.opacity,underlineOffset:m=s.underlineOffset,underlineDash:b=s.underlineDash,fillOpacity:w=s.fillOpacity}=e.attribute;if(!n&&!t)return;const C=a_.measureTextWidth(a,{fontSize:u,fontFamily:c,fontWeight:g,fontStyle:f}),_=fn(h,C),y=pn(d,u,u),x={lineWidth:0,stroke:p,opacity:v,strokeOpacity:w};if(n){x.lineWidth=n,l.setStrokeStyle(e,x,i,o,s),l.setLineDash(b),l.beginPath();const S=o+y+u+m;l.moveTo(i+_,S,r),l.lineTo(i+_+C,S,r),l.stroke()}if(t){x.lineWidth=t,l.setStrokeStyle(e,x,i,o,s),l.beginPath();const S=o+y+u/2;l.moveTo(i+_,S,r),l.lineTo(i+_+C,S,r),l.stroke()}}};bd=GL([st()],bd);const UL=new Bt((n,t,e,i)=>{e(pr)?i(pr).to(cl).inSingletonScope():(n(cl).toSelf().inSingletonScope(),n(Po).toService(cl)),e(vr)?i(vr).to(gl).inSingletonScope():(n(gl).toSelf().inSingletonScope(),n(Po).toService(gl)),n(ul).toSelf().inSingletonScope(),n(kL).to(ul),n(hi).to(ul),n(nd).toSelf().inSingletonScope(),n(Bo).toService(nd),n(od).toSelf().inSingletonScope(),n(Bo).toService(od),n(rd).toSelf().inSingletonScope(),n(Bo).toService(rd),n(sd).toSelf().inSingletonScope(),n(Bo).toService(sd),n(fd).toSelf().inSingletonScope(),n(tn).toService(fd),n(pd).toSelf().inSingletonScope(),n(tn).toService(pd),n(hd).toSelf().inSingletonScope(),n(tn).toService(hd),n(ad).toSelf().inSingletonScope(),n(tn).toService(ad),n(dd).toSelf().inSingletonScope(),n(tn).toService(dd),n(ud).toSelf().inSingletonScope(),n(tn).toService(ud),n(cd).toSelf().inSingletonScope(),n(tn).toService(cd),n(gd).toSelf().inSingletonScope(),n(tn).toService(gd),n(vd).toSelf().inSingletonScope(),n(tn).toService(vd),n(md).toSelf().inSingletonScope(),n(xs).toService(md),n(bd).toSelf().inSingletonScope(),n(sa).toService(bd)});function Ui(n,t,e,i){var o,r,s,l,a,h,d,u;n.internalProps.columnWidthConfig&&n._parseColumnWidthConfig(n.internalProps.columnWidthConfig),t=t??0,e=e??n.colCount-1,t===0&&e===n.colCount-1&&n._clearColRangeWidthsMap();const c=n.internalProps.layoutMap;n.isPivotTable()&&(c.enableUseGetBodyCache(),c.enableUseHeaderPathCache());const g=[],f=[];if(i)for(let p=0;p<n.colCount;p++)g[p]=n.getColWidth(p);for(let p=t;p<=e;p++){let v;if(n.internalProps.transpose||((r=(o=n.internalProps.layoutMap.columnObjects)===null||o===void 0?void 0:o[p])===null||r===void 0?void 0:r.columnWidthComputeMode)!=="only-header"&&n.columnWidthComputeMode!=="only-header"||!("showHeader"in n.internalProps.layoutMap))v=n.internalProps.transpose||((l=(s=n.internalProps.layoutMap.columnObjects)===null||s===void 0?void 0:s[p])===null||l===void 0?void 0:l.columnWidthComputeMode)!=="only-body"&&n.columnWidthComputeMode!=="only-body"?Gr(p,0,n.rowCount-1,n):Gr(p,n.internalProps.layoutMap.getBodyRange().start.row,n.internalProps.layoutMap.getBodyRange().end.row,n);else{const m=n.internalProps.layoutMap.showHeader;n.internalProps.layoutMap.showHeader=!0,v=Gr(p,0,n.internalProps.layoutMap.headerLevelCount-1,n),n.internalProps.layoutMap.showHeader=m}n._setColContentWidth(p,v),n.getColWidth(p)!==v&&n._clearColRangeWidthsMap(p),i?f[p]=Math.round(n._adjustColWidth(p,v)):n._setColWidth(p,n._adjustColWidth(p,v),!1,!0)}if(n.widthMode==="adaptive"){n._clearColRangeWidthsMap();const p=n.tableNoFrameWidth;let v=0,m=0,b=n.colCount;if(n.widthAdaptiveMode==="only-body"){for(let w=0;w<n.colCount;w++){const C=i&&(a=f[w])!==null&&a!==void 0?a:n.getColWidth(w);(w<n.rowHeaderLevelCount||n.isPivotChart()&&w>=n.colCount-n.rightFrozenColCount)&&(v+=C)}m=n.rowHeaderLevelCount,b=n.isPivotChart()?n.colCount-n.rightFrozenColCount:n.colCount}Cd(p-v,m,b,i,f,n)}else if(n.autoFillWidth){n._clearColRangeWidthsMap();const p=n.tableNoFrameWidth;let v=0,m=0;for(let b=0;b<n.colCount;b++){const w=i&&(h=f[b])!==null&&h!==void 0?h:n.getColWidth(b);(b<n.rowHeaderLevelCount||n.isPivotChart()&&b>=n.colCount-n.rightFrozenColCount)&&(v+=w),m+=w}m<p&&m>v&&Cd(p-v,n.rowHeaderLevelCount,n.isPivotChart()?n.colCount-n.rightFrozenColCount:n.colCount,i,f,n)}if(i){for(let p=0;p<n.colCount;p++){const v=(u=(d=f[p])!==null&&d!==void 0?d:n.getColWidth(p))!==null&&u!==void 0?u:n.getColWidth(p);v!==g[p]&&n._setColWidth(p,v,!1,!0)}n.stateManager.checkFrozen();for(let p=0;p<n.colCount;p++){const v=n.getColWidth(p);v!==g[p]&&n.scenegraph.updateColWidth(p,v-g[p],!0,!0)}n.scenegraph.updateContainer(!0)}n.isPivotTable()&&(c.disableUseGetBodyCache(),c.disableUseHeaderPathCache())}function Gr(n,t,e,i,o=!1){let r=XL(n,i);return i.internalProps.transpose&&r==="auto"&&(i.columnWidthComputeMode==="only-header"&&n>=i.rowHeaderLevelCount||i.columnWidthComputeMode==="only-body"&&n<i.rowHeaderLevelCount)&&(r=i.getDefaultColumnWidth(n)),o&&!i.internalProps.transpose?P_(r,n,t,e,o,i):typeof r=="number"?r:r!=="auto"&&typeof r=="string"?i._adjustColWidth(n,i._colWidthDefineToPxWidth(r)):P_(r,n,t,e,o,i)}function P_(n,t,e,i,o,r){var s,l,a,h,d;let u=0,c=1,g=1;if(i-e>5e3&&(g=Math.ceil((i-e)/5e3)),r.isPivotChart()&&t>=r.rowHeaderLevelCount&&t<r.colCount-r.rightFrozenColCount){if(r.internalProps.layoutMap.indicatorsAsCol)return r.defaultColWidth;{const v=r.internalProps.layoutMap.getOptimunWidthForChart(t);if(v>0)return v}}for(let v=e;v<=i;v+=c){if(r.isPivotChart()){const x=r.internalProps.layoutMap,S=x.getAxisConfigInPivotChart(t,v);if(S){const A=St.getFunction("computeAxisComponentWidth")(S,r);if(typeof A=="number"){u=Math.max(A,u);continue}}else if(x.isLeftBottomCorner(t,v)||x.isRightTopCorner(t,v)||x.isRightBottomCorner(t,v))continue}const m=KL(t,v,r);if(m&&(u=Math.max(m.width,u),!m.renderDefault))continue;const b=n;if(typeof b=="number"&&r.widthMode==="standard"&&!o){u=Math.max(b,u);continue}const w=r.isHeader(t,v)?(s=r._getHeaderLayoutMap(t,v))===null||s===void 0?void 0:s.headerType:r.getBodyColumnType(t,v);if(I(w)&&w!=="text"&&w!=="link"&&w!=="progressbar"&&w!=="checkbox"&&w!=="radio"){u=Math.max(u,r.getColWidthDefinedNumber(t)||0);continue}let C=0;const _=r.internalProps.layoutMap;if(_.isHeader(t,v)){const x=_.getHeader(t,v);if(((l=x==null?void 0:x.define)===null||l===void 0?void 0:l.columnWidthComputeMode)==="only-body")continue;I(x==null?void 0:x.hierarchyLevel)&&(C=((a=x.hierarchyLevel)!==null&&a!==void 0?a:0)*((h=_.rowHierarchyIndent)!==null&&h!==void 0?h:0),_.rowHierarchyTextStartAlignment&&!r.internalProps.headerHelper.getHierarchyIcon(t,v)&&(C+=r.internalProps.headerHelper.getHierarchyIconWidth()))}else if(r.isListTable()){c=g;const x=r.getBodyColumnDefine(t,v);if(x!=null&&x.tree){const S=r.dataSource.getIndexKey(r.getRecordShowIndexByCell(t,v));C=Array.isArray(S)&&r.getHierarchyState(t,v)!==Pt.none?(S.length-1)*((d=_.hierarchyIndent)!==null&&d!==void 0?d:0):0,_.hierarchyTextStartAlignment&&!r.internalProps.bodyHelper.getHierarchyIcon(t,v)&&(C+=r.internalProps.headerHelper.getHierarchyIconWidth())}}const y=$L(t,v,w,r);u=Math.max(y+C,u),c>1&&r.bottomFrozenRowCount>0&&v<r.rowCount-r.bottomFrozenRowCount&&v+c>=r.rowCount-r.bottomFrozenRowCount&&(v=r.rowCount-r.bottomFrozenRowCount-c,c=1,g=1)}const f=r.getMinColWidth(t),p=r.getMaxColWidth(t);return u<f?f:u>p?p:(u<=0&&(u=r.defaultColWidth),u)}function KL(n,t,e){var i,o,r,s,l,a,h;const d=e.getCustomRender(n,t);let u=e.getCustomLayout(n,t);if(d||u){let c,g=1,f=0,p=!1,v=!1;(e.isHeader(n,t)||!((i=e.getBodyColumnDefine(n,t))===null||i===void 0)&&i.mergeCell||e.hasCustomMerge())&&(c=e.getCellRange(n,t),g=c.end.col-c.start.col+1);const m={col:(o=c==null?void 0:c.start.col)!==null&&o!==void 0?o:n,row:(r=c==null?void 0:c.start.row)!==null&&r!==void 0?r:t,dataValue:e.getCellOriginValue(n,t),value:e.getCellValue(n,t)||"",rect:YL(n,t,e),table:e,originCol:n,originRow:t};if(u==="react-custom-layout"&&(u=((s=e.reactCustomLayout)===null||s===void 0?void 0:s.getCustomLayoutFunc(n,t))||el),jt(u)){const b=u(m);if(b.rootContainer){b.rootContainer=nl(b.rootContainer),jh(b.rootContainer,0,e.getRowHeight(t));const w=b.rootContainer.attribute.width;b.rootContainer.setStage(e.scenegraph.stage),f=w>0?w:(l=b.rootContainer.AABBBounds.width())!==null&&l!==void 0?l:0,p=b.renderDefault,v=b.enableCellPadding}else f=0,p=b.renderDefault,v=b.enableCellPadding}else if(typeof d=="function"){const b=d(m);f=(a=b==null?void 0:b.expectedWidth)!==null&&a!==void 0?a:0,p=b==null?void 0:b.renderDefault}else f=(h=d==null?void 0:d.expectedWidth)!==null&&h!==void 0?h:0,p=d==null?void 0:d.renderDefault;if(f=Math.ceil(f),v){const b=e._getCellStyle(n,t),w=kt(lt("padding",b,n,t,e));f+=w[1]+w[3]}return{width:f/g,renderDefault:p}}}function $L(n,t,e,i){var o,r,s;let l=0;const a=i.getCellValue(n,t),h=i._getCellStyle(n,t);let d=0,u=!1;if(i.getCellLocation(n,t)!=="body")u=!0;else{const C=i.getBodyColumnDefine(n,t);u=!!(C!=null&&C.icon)||!!(C!=null&&C.tree)||(C==null?void 0:C.dragOrder)}if(u){const C=i.getCellIcons(n,t);C==null||C.forEach(_=>{var y,x,S;_.positionType!==Yt.absoluteRight&&(d+=((y=_.width)!==null&&y!==void 0?y:0)+((x=_.marginLeft)!==null&&x!==void 0?x:0)+((S=_.marginRight)!==null&&S!==void 0?S:0))})}let c=1;if(i.isHeader(n,t)||!((o=i.getBodyColumnDefine(n,t))===null||o===void 0)&&o.mergeCell||i.hasCustomMerge()){const C=i.getCellRange(n,t);c=C.end.col-C.start.col+1}const g=kt(lt("padding",h,n,t,i)),f=g[1]+g[3],p=lt("fontSize",h,n,t,i),v=lt("fontFamily",h,n,t,i),m=lt("fontWeight",h,n,t,i);let b;if(e==="checkbox")b=$t(a)?a.text:a;else if(e==="radio")if(it(a)){b="";const C=i.getBodyColumnDefine(n,t),_=(r=C==null?void 0:C.radioDirectionInCell)!==null&&r!==void 0?r:"vertical";_==="vertical"?a.forEach(y=>{b+=($t(y)?y.text:y).toString()+`
|
|
123
|
+
`}):_==="horizontal"&&a.forEach(y=>{b+=($t(y)?y.text:y).toString()})}else b=$t(a)?a.text:a;else b=a;const w=al(b,i).text;if(w.length>=1&&(w.length!==1||w[0]!=="")?w.forEach(C=>{const _=i.measureText(C,{fontSize:p,fontFamily:v,fontWeight:m}).width;l=Math.max((_+f+4+d)/c,l)}):l=Math.max((f+4+d)/c,l),i.internalProps.limitMaxAutoWidth!==!1&&(l=Math.min(typeof i.internalProps.limitMaxAutoWidth=="number"?i.internalProps.limitMaxAutoWidth:450,l)),e==="checkbox"){const C=lt("size",h,n,t,i);if(l+=C,b){const _=lt("spaceBetweenTextAndIcon",h,n,t,i);l+=_}}else if(e==="radio"){const C=lt("size",h,n,t,i),_=lt("outerRadius",h,n,t,i),y=nt(_)?2*_:C,x=lt("spaceBetweenTextAndIcon",h,n,t,i);if(it(a)){const S=i.getBodyColumnDefine(n,t),A=lt("spaceBetweenRadio",h,n,t,i),R=(s=S==null?void 0:S.radioDirectionInCell)!==null&&s!==void 0?s:"vertical";R==="vertical"?(l+=y,l+=x):R==="horizontal"&&(l+=(y+x)*a.length,l+=A*(a.length-1))}else l+=y,b&&(l+=x)}return l}function YL(n,t,e){return{left:0,top:0,right:e.getColWidth(n),bottom:e.getRowHeight(t),width:null,height:null}}function XL(n,t){const e=t.getColWidthDefined(n);return t.internalProps._widthResizedColMap.has(n)?t.getColWidth(n):e}function Cd(n,t,e,i,o,r,s){var l,a,h,d;let u=0;const c=[],g=[];let f=0;for(let v=t;v<e;v++){const m=i&&(l=o[v])!==null&&l!==void 0?l:r.getColWidth(v),b=r.getMaxColWidth(v),w=r.getMinColWidth(v);m!==b&&m!==w?(u+=m,c.push(v)):n-=m,!((a=r.options.customConfig)===null||a===void 0)&&a.shrinkSparklineFirst&&r.getBodyColumnType(v,0)==="sparkline"&&(g.push({col:v,width:m}),f+=m-r.defaultColWidth)}const p=n/u;if(!((h=r.options.customConfig)===null||h===void 0)&&h.shrinkSparklineFirst&&p<1&&u-n<f)for(let v=0;v<g.length;v++){const{col:m,width:b}=g[v],w=(u-n)/g.length,C=Math.floor(b-w);i?o[m]=r._adjustColWidth(m,C):s?r.scenegraph.setColWidth(m,r._adjustColWidth(m,C)):r._setColWidth(m,r._adjustColWidth(m,C),!1,!0)}else for(let v=0;v<c.length;v++){const m=c[v];let b;b=v===c.length-1?n-c.reduce((w,C,_)=>{var y;return C!==m?w+(i?(y=o[C])!==null&&y!==void 0?y:r.getColWidth(m):r.getColWidth(C)):w},0):Math.round((i&&(d=o[m])!==null&&d!==void 0?d:r.getColWidth(m))*p),i?o[m]=r._adjustColWidth(m,b):s?r.scenegraph.setColWidth(m,r._adjustColWidth(m,b)):r._setColWidth(m,r._adjustColWidth(m,b),!1,!0)}}const _d=new Kt({});_d.role="empty";function yd(n,t,e,i,o,r,s,l,a){var h,d;let u,c,g,f=0;n.lastChild&&n.lastChild.row===i-1?f=n.lastChild.attribute.y+n.lastChild.attribute.height:n.colHeight&&(f=n.colHeight);for(let p=i;p<=o;p++){const v=p;let m,b,w,C,_=l.getCellLocation(t,v),y=l.getCellValue(t,v),x=e,S=l.getRowHeight(v),A=!1;if(l.internalProps.customMergeCell){const H=l.getCustomMerge(t,v);if(H){const{range:E,text:F,style:L,customLayout:z,customRender:D}=H;if(m=E,b=m.start.col!==m.end.col||m.start.row!==m.end.row,b){const N=H_(m,r,l,i>m.start.row);x=N.cellWidth,S=N.cellHeight}y=F,w=L,(z||D)&&(C=uo(z,D,E.start.col,E.start.row,l.getColsWidth(E.start.col,E.end.col),l.getRowsHeight(E.start.row,E.end.row),!1,l.isAutoRowHeight(v),[0,0,0,0],m,l)),A=!0}}let R,T=t,M=v;m&&(T=m.start.col,M=m.start.row),!l.isPivotTable()&&(_==="columnHeader"||_==="cornerHeader")&&v>=l.columnHeaderLevelCount&&(_="body"),R=!l.isPivotTable()&&l.isSeriesNumberInBody(t,v)?l.getBodyColumnDefine(T,M):_!=="body"?l.getHeaderDefine(T,M):l.getBodyColumnDefine(T,M);let P=_!=="body"||(R==null?void 0:R.dragOrder)||!!(R!=null&&R.icon)||!!(R!=null&&R.tree);if(!m&&(l.internalProps.enableTreeNodeMerge||_!=="body"||R!=null&&R.mergeCell)&&(m=l.getCellRange(t,v),b=m.start.col!==m.end.col||m.start.row!==m.end.row,b)){const H=H_(m,r,l,i>m.start.row);x=H.cellWidth,S=H.cellHeight}let k=!1;if(l.internalProps.enableTreeNodeMerge&&b){const H=l.getCellRawRecord(m.start.col,m.start.row),{vtableMergeName:E,vtableMerge:F}=H??{};k=F,F&&(P=!0,l.options.groupTitleCustomLayout&&(C=uo(l.options.groupTitleCustomLayout,void 0,m.start.col,m.start.row,l.getColsWidth(m.start.col,m.end.col),l.getRowsHeight(m.start.row,m.end.row),!1,l.isAutoRowHeight(v),[0,0,0,0],m,l))),E&&(y=E)}const B=k||A?"text":(d=l.isHeader(t,v)?(h=l._getHeaderLayoutMap(t,v).headerType)!==null&&h!==void 0?h:"text":l.getBodyColumnType(t,v))!==null&&d!==void 0?d:"text";if(Cn(y)){ZL(t,v,0,f,x,S,n),n_(y,l,qL.bind(null,{type:B,value:y,define:R,table:l,col:t,row:v,colWidth:e,cellWidth:x,cellHeight:S,columnGroup:n,y:f,customStyle:w,mayHaveIcon:P,cellLocation:_,range:m,customResult:C,defaultRowHeight:s})),n.updateColumnRowNumber(v);const H=l.getRowHeight(v);n.updateColumnHeight(H),f+=H}else{const H=w||l._getCellStyle(m?m.start.col:t,m?m.start.row:v),E=ho(H,l,m?m.start.col:t,m?m.start.row:v,lt).theme;E.group.cornerRadius=Nh(t,v,l),E.group.width=e,E.group.height=Array.isArray(s)?s[v]:s,E._vtable.padding&&(u=E._vtable.padding),E.text.textAlign&&(c=E.text.textAlign),E.text.textBaseline&&(g=E.text.textBaseline),_==="body"||E.group.fill||(E.group.fill="#fff");const F=Bg(B,y,R,l,t,v,e,x,S,n,f,u,c,g,P,E,m,C);if(n.updateColumnRowNumber(v),b){const L=l.getRowHeight(v),{width:z}=(l.getColWidth(t),F.attribute),{height:D}=F.attribute;F.contentWidth=z,F.contentHeight=D,r_(m,z,D,u,c,g,l),n.updateColumnHeight(L),f+=L}else n.updateColumnHeight(S),f+=S}if(a&&v>a)break}return n.setAttribute("width",e),{width:e,height:f}}function qL(n){let t,e,i;const{type:o,value:r,define:s,table:l,col:a,row:h,colWidth:d,cellWidth:u,cellHeight:c,columnGroup:g,y:f,cellLocation:p,mayHaveIcon:v,customStyle:m,range:b,customResult:w,defaultRowHeight:C}=n,_=m||l._getCellStyle(b?b.start.col:a,b?b.start.row:h),y=ho(_,l,b?b.start.col:a,b?b.start.row:h,lt).theme;y.group.cornerRadius=Nh(a,h,l),y.group.width=d,y.group.height=Array.isArray(C)?C[h]:C,y._vtable.padding&&(t=y._vtable.padding),y.text.textAlign&&(e=y.text.textAlign),y.text.textBaseline&&(i=y.text.textBaseline),p==="body"||y.group.fill||(y.group.fill="#fff"),Bg(o,r,s,l,a,h,d,u,c,g,f,t,e,i,v,y,b,w)}function H_(n,t,e,i){let o=0,r=0;const s=t.get(`${n.start.col},${n.start.row};${n.end.col},${n.end.row}`);if(!s||i){for(let l=n.start.col;l<=n.end.col;l++)o+=e.getColWidth(l);for(let l=n.start.row;l<=n.end.row;l++)r+=e.getRowHeight(l);t.set(`${n.start.col},${n.start.row};${n.end.col},${n.end.row}`,{cellWidth:o,cellHeight:r})}else o=s.cellWidth,r=s.cellHeight;return{cellWidth:o,cellHeight:r}}function ZL(n,t,e,i,o,r,s){const l=new Kt({x:e,y:i,width:o,height:r});l.role="cell",l.col=n,l.row=t,s.addChild(l)}function je(n,t,e,i,o,r,s,l,a,h){if(i>o||r>s)return;const{layoutMap:d,defaultRowHeight:u,defaultHeaderRowHeight:c,defaultColWidth:g}=a.internalProps;let f=0,p=0;for(let v=i;v<=o;v++){const m=v,b=a.getColWidth(m),w=new Kt({x:t+f,y:e,width:b,height:0,clip:!1,pickable:!1});w.role="column",w.col=v,n.addChild(w);const{width:C,height:_}=yd(w,m,b,r,s,a.scenegraph.mergeMap,l==="columnHeader"&&nt(c)?c:u,a,h);f+=C,p=Math.max(p,_)}n.setAttribute("width",f),n.setAttribute("height",p)}function JL(n,t,e,i,o,r,s,l,a){var h,d,u,c,g,f,p,v,m,b,w,C;const{table:_}=a,{leftBottomCornerGroup:y,rightTopCornerGroup:x,rightBottomCornerGroup:S}=_.scenegraph;let A,R,T,M;a.setParamsForRow(),a.setParamsForColumn(),(_.widthMode==="adaptive"||_.options.autoWrapText&&(_.heightMode==="adaptive"||_.heightMode==="autoHeight"))&&(T=_.colCount-1),A=Math.min(a.firstScreenColLimit,_.colCount-1),_.heightMode==="adaptive"&&(M=_.rowCount-1),R=Math.min(a.firstScreenRowLimit,_.rowCount-1),_.internalProps._widthResizedColMap.size===0&&Ui(_,0,T??A),_.internalProps._heightResizedRowMap.size===0&&Gi(_,0,M??R),A<_.colCount-_.rightFrozenColCount&&Ui(_,_.colCount-_.rightFrozenColCount,_.colCount-1),R<_.rowCount-_.bottomFrozenRowCount&&Gi(_,_.rowCount-_.bottomFrozenRowCount,_.rowCount-1),_.scenegraph.colHeaderGroup.setAttribute("x",_.getFrozenColsWidth()),_.scenegraph.rowHeaderGroup.setAttribute("y",_.getFrozenRowsHeight()),_.scenegraph.bottomFrozenGroup.setAttribute("x",_.getFrozenColsWidth()),_.scenegraph.rightFrozenGroup.setAttribute("y",_.getFrozenRowsHeight()),_.scenegraph.bodyGroup.setAttributes({x:_.getFrozenColsWidth(),y:_.getFrozenRowsHeight()}),je(n,s,l,0,_.frozenColCount-1,0,_.frozenRowCount-1,_.isListTable()?"columnHeader":"cornerHeader",_),A-_.rightFrozenColCount>=_.frozenColCount&&je(t,s,l,_.frozenColCount,A-_.rightFrozenColCount,0,_.frozenRowCount-1,"columnHeader",_),_.frozenColCount>0&&(_.leftRowSeriesNumberCount>0&&je(e,s,l,0,_.leftRowSeriesNumberCount-1,_.frozenRowCount,R-_.bottomFrozenRowCount,"rowHeader",_),_.rowHeaderLevelCount>0&&je(e,s,l,_.leftRowSeriesNumberCount,_.leftRowSeriesNumberCount+_.rowHeaderLevelCount-1,_.frozenRowCount,R-_.bottomFrozenRowCount,"rowHeader",_),_.frozenColCount>_.rowHeaderLevelCount+_.leftRowSeriesNumberCount&&je(e,s,l,_.rowHeaderLevelCount+_.leftRowSeriesNumberCount,_.frozenColCount-1,_.frozenRowCount,R-_.bottomFrozenRowCount,"body",_)),_.bottomFrozenRowCount>0&&(_.frozenColCount>0&&(_.leftRowSeriesNumberCount>0&&je(y,s,l,0,_.leftRowSeriesNumberCount-1,_.rowCount-1-_.bottomFrozenRowCount+1,_.rowCount-1,"rowHeader",_),_.rowHeaderLevelCount>0&&je(y,s,l,_.leftRowSeriesNumberCount,_.leftRowSeriesNumberCount+_.rowHeaderLevelCount-1,_.rowCount-1-_.bottomFrozenRowCount+1,_.rowCount-1,"rowHeader",_),_.frozenColCount>_.rowHeaderLevelCount+_.leftRowSeriesNumberCount&&je(y,s,l,_.rowHeaderLevelCount+_.leftRowSeriesNumberCount,_.frozenColCount-1,_.rowCount-1-_.bottomFrozenRowCount+1,_.rowCount-1,"body",_)),A-_.rightFrozenColCount>=_.frozenColCount&&je(o,s,l,_.frozenColCount,A-_.rightFrozenColCount,_.rowCount-1-_.bottomFrozenRowCount+1,_.rowCount-1,_.isPivotChart()?"rowHeader":"body",_)),_.rightFrozenColCount>0&&(je(x,s,l,_.colCount-1-_.rightFrozenColCount+1,_.colCount-1,0,_.frozenRowCount-1,"columnHeader",_),je(i,s,l,_.colCount-1-_.rightFrozenColCount+1,_.colCount-1,_.frozenRowCount,R-_.bottomFrozenRowCount,_.isPivotChart()?"rowHeader":"body",_)),_.bottomFrozenRowCount>0&&_.rightFrozenColCount>0&&je(S,s,l,_.colCount-1-_.rightFrozenColCount+1,_.colCount-1,_.rowCount-1-_.bottomFrozenRowCount+1,_.rowCount-1,"body",_),A-_.rightFrozenColCount>=_.frozenColCount&&je(r,s,l,_.frozenColCount,A-_.rightFrozenColCount,_.frozenRowCount,R-_.bottomFrozenRowCount,"body",_),r.firstChild||t.firstChild||n.firstChild||e.firstChild?(a.currentRow=(c=(d=(h=r.firstChild)===null||h===void 0?void 0:h.rowNumber)!==null&&d!==void 0?d:(u=e.firstChild)===null||u===void 0?void 0:u.rowNumber)!==null&&c!==void 0?c:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=(C=(b=(v=(f=(g=r.lastChild)===null||g===void 0?void 0:g.col)!==null&&f!==void 0?f:(p=t.lastChild)===null||p===void 0?void 0:p.col)!==null&&v!==void 0?v:(m=e.lastChild)===null||m===void 0?void 0:m.col)!==null&&b!==void 0?b:(w=n.lastChild)===null||w===void 0?void 0:w.col)!==null&&C!==void 0?C:a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2),a.progress()):(a.currentRow=a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2))}function E_(n){let t=n.firstChild;for(;t.type!=="group";)t=t._next;return t}function L_(n){let t=n.lastChild;for(;t.type!=="group";)t=t._prev;return t}function QL(n){let t=n._prev;for(;t&&t.type!=="group";)t=t._prev;return t}function tF(n){let t=n._next;for(;t&&t.type!=="group";)t=t._next;return t}function Wg(n,t,e,i="left"){for(let l=n;l<=t;l++){const a=e.scenegraph.getColGroup(l);a&&Ng(a,e,i);const h=e.scenegraph.getColGroup(l,!0);h&&Ng(h,e,i);const d=e.scenegraph.getColGroupInBottom(l);d&&Ng(d,e,i)}const o=Math.min(e.scenegraph.proxy.colLimit,e.scenegraph.proxy.bodyRightCol-e.scenegraph.proxy.bodyLeftCol+1),r=e.getColsWidth(e.frozenColCount,e.frozenColCount+o),s=e.getColsWidth(e.frozenColCount,e.colCount-1);e.scenegraph.proxy.xLimitLeft=r/2,e.scenegraph.proxy.xLimitRight=s-r/2}function Ng(n,t,e="left"){if(e==="left"){let i;const o=QL(n);i=o?o.attribute.x+t.getColWidth(n._prev.col):t.getColsWidth(t.frozenColCount,n.col-1),n.setAttribute("x",i)}else{let i;const o=tF(n);i=o?o.attribute.x-t.getColWidth(n.col):t.getColsWidth(t.frozenColCount,n.col-1),n.setAttribute("x",i)}}var F_=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};function eF(n,t,e,i){return F_(this,void 0,void 0,function*(){if(!t)return;const o=t.col,r=t.left;let s;if(s=e?i.bodyRightCol-i.colEnd:i.screenLeftCol-i.referenceCol,iF(s,o,r,n,i),e){const l=i.table.scenegraph.getColGroup(i.colEnd);if(l){const a=l.attribute.x+l.attribute.width-(i.table.tableNoFrameWidth-i.table.getFrozenColsWidth()-i.table.getRightFrozenColsWidth())-n;i.deltaX=-a,i.table.scenegraph.setBodyAndColHeaderX(-n+i.deltaX)}}i.table.scenegraph.updateNextFrame()})}function iF(n,t,e,i,o){n>0?(k_(n,"left",o.screenLeftCol,e,i,o),o.updateDeltaX(i,e,t),o.table.scenegraph.setBodyAndColHeaderX(-i+o.deltaX)):n<0?(k_(-n,"right",o.screenLeftCol,e,i,o),o.updateDeltaX(i,e,t),o.table.scenegraph.setBodyAndColHeaderX(-i+o.deltaX)):(o.updateDeltaX(i,e,t),o.table.scenegraph.setBodyAndColHeaderX(-i+o.deltaX))}function k_(n,t,e,i,o,r){return F_(this,void 0,void 0,function*(){if(t==="left"&&r.colEnd+n>r.bodyRightCol?n=r.bodyRightCol-r.colEnd:t==="right"&&r.colStart-n<r.bodyLeftCol&&(n=r.colStart-r.bodyLeftCol),n!==0)if(n<0&&(t=t==="left"?"right":"left",n=-n),n<r.colEnd-r.colStart){const s=t==="left"?r.colStart:r.colEnd-n+1,l=t==="left"?r.colStart+n-1:r.colEnd,a=t==="left"?r.colEnd+1:r.colStart-n,h=t==="left"?r.colEnd+n:r.colStart-1;Ui(r.table,a,h),oF(s,l,t,r);const d=a,u=h;r.colStart=t==="left"?r.colStart+n:r.colStart-n,r.colEnd=t==="left"?r.colEnd+n:r.colEnd-n,vl(d,u,r),Wg(d,u,r.table,t);const c=r.table.scenegraph.getColGroup(e)||r.table.scenegraph.getColGroup(e,!0),g=i-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=g,r.currentCol=t==="left"?r.currentCol+n:r.currentCol-n,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,t==="left"?r.totalCol+n:r.totalCol-n)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=a,r.colUpdateDirection=t,r.table.scenegraph.updateNextFrame()}else{const s=t==="left"?r.colStart+n:r.colStart-n,l=t==="left"?r.colEnd+n:r.colEnd-n;Ui(r.table,s,l),rF(r.table.getColsWidth(r.bodyLeftCol,s-1),n,t,r);const a=s,h=l;r.colStart=s,r.colEnd=l,vl(a,h,r),Wg(a,h,r.table,l>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol=t==="left"?r.currentCol+n:r.currentCol-n,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,t==="left"?r.totalCol+n:r.totalCol-n)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=l>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}})}function pl(n,t,e){n.col=t,n.forEachChildren(i=>{i.col=t,i.needUpdate=!0}),n.setAttribute("x",e),n.needUpdate=!0}function wd(n,t){if(!n)return;let e=n.firstChild;for(;e;)e=t.updateCellGroupContent(e)._next;n.needUpdate=!1,n.setAttribute("width",t.table.getColWidth(n.col))}function nF(n,t){if(!n)return;const e=t.screenTopRow,i=Math.max(t.bodyTopRow,e-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,e+2*t.screenRowCount,t.table.rowCount-1);for(let r=i;r<=o;r++){const s=t.highPerformanceGetCell(n.col,r,!0);t.updateCellGroupContent(s)}t.rowUpdatePos=t.rowStart,n.needUpdate=!1,n.setAttribute("width",t.table.getColWidth(n.col))}function oF(n,t,e,i){for(let o=n;o<=t;o++)i.table.scenegraph.bodyGroup.childrenCount>0&&i.table.scenegraph.bodyGroup.firstChild.type==="group"&&Vg(i.table.scenegraph.bodyGroup,e,i),i.table.scenegraph.colHeaderGroup.childrenCount>0&&i.table.scenegraph.colHeaderGroup.firstChild.type==="group"&&Vg(i.table.scenegraph.colHeaderGroup,e,i),i.table.scenegraph.bottomFrozenGroup.childrenCount>0&&i.table.scenegraph.bottomFrozenGroup.firstChild.type==="group"&&Vg(i.table.scenegraph.bottomFrozenGroup,e,i)}function Vg(n,t,e){if(t==="left"){const i=E_(n),o=L_(n);pl(i,o.col+1,o.attribute.x+e.table.getColWidth(o.col)),n.appendChild(i),n.border&&n.appendChild(n.border)}else{const i=L_(n),o=E_(n);pl(i,o.col-1,o.attribute.x-e.table.getColWidth(o.col-1)),n.insertBefore(i,n.firstChild)}}function vl(n,t,e){for(let i=n;i<=t;i++){const o=e.table.scenegraph.getColGroup(i,!0);o&&wd(o,e);const r=e.table.scenegraph.getColGroupInBottom(i);r&&wd(r,e);const s=e.table.scenegraph.getColGroupInRightTopCorner(i);s&&wd(s,e);const l=e.table.scenegraph.getColGroupInRightBottomCorner(i);l&&wd(l,e);const a=e.table.scenegraph.getColGroup(i);a&&nF(a,e)}e.progress()}function rF(n,t,e,i){i.table.scenegraph.colHeaderGroup.forEachChildren((o,r)=>{o.type==="group"&&pl(o,e==="left"?o.col+t:o.col-t,r===0?n:o._prev.attribute.x+i.table.getColWidth(o._prev.col))}),i.table.scenegraph.bottomFrozenGroup.forEachChildren((o,r)=>{o.type==="group"&&pl(o,e==="left"?o.col+t:o.col-t,r===0?n:o._prev.attribute.x+i.table.getColWidth(o._prev.col))}),i.table.scenegraph.bodyGroup.forEachChildren((o,r)=>{o.type==="group"&&pl(o,e==="left"?o.col+t:o.col-t,r===0?n:o._prev.attribute.x+i.table.getColWidth(o._prev.col))})}function Pi(n,t,e,i,o,r="up",s){var l,a;if(r==="up")for(let c=n;c<=t;c++)for(let g=e;g<=i;g++){const f=o.scenegraph.highPerformanceGetCell(c,g,!0);if(f.role!=="cell"||!f.row)continue;let p;if(f._prev)p=((l=f._prev)===null||l===void 0?void 0:l.attribute.y)+o.getRowHeight(f._prev.row);else if(s){if(p=o.scenegraph.highPerformanceGetCell(c,i+1,!0).attribute.y,I(p))for(let v=g;v<=i;v++)p-=o.getRowHeight(v)}else p=I_(f.row,o);I(p)&&f.setAttribute("y",p)}else for(let c=n;c<=t;c++)for(let g=i;g>=e;g--){const f=o.scenegraph.highPerformanceGetCell(c,g,!0);if(f.role!=="cell"||!f.row)continue;let p;if(f._next)p=((a=f._next)===null||a===void 0?void 0:a.attribute.y)-o.getRowHeight(f.row);else if(s){p=o.scenegraph.highPerformanceGetCell(c,e-1,!0).attribute.y;for(let v=e-1;v<g;v++)p+=o.getRowHeight(v)}else p=I_(f.row,o);I(p)&&f.setAttribute("y",p)}const h=Math.min(o.scenegraph.proxy.rowLimit,o.scenegraph.proxy.bodyBottomRow-o.scenegraph.proxy.bodyTopRow+1),d=o.getRowsHeight(o.frozenRowCount,o.frozenRowCount+h),u=o.getRowsHeight(o.frozenRowCount,o.rowCount-1);o.scenegraph.proxy.yLimitTop=d/2,o.scenegraph.proxy.yLimitBottom=u-d/2}function I_(n,t){let e;return e=n<t.frozenRowCount?t.getRowsHeight(0,n-1):n>=t.rowCount-t.bottomFrozenRowCount?t.getRowsHeight(t.rowCount-t.bottomFrozenRowCount,n-1):t.getRowsHeight(t.frozenRowCount,n-1),e}var z_=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};function sF(n,t,e,i){return z_(this,void 0,void 0,function*(){if(!t)return;const o=t.row,r=t.top;let s;if(s=e?i.bodyBottomRow-i.rowEnd:o-i.referenceRow,lF(s,o,r,n,i),e){const l=i.table.scenegraph.highPerformanceGetCell(i.colStart,i.rowEnd,!0);if(l.role==="cell"){const a=l.attribute.y+l.attribute.height-(i.table.tableNoFrameHeight-i.table.getFrozenRowsHeight()-i.table.getBottomFrozenRowsHeight())-n;i.deltaY=-a,i.updateBody(n-i.deltaY)}}})}function lF(n,t,e,i,o){n>0?(D_(n,"up",t,e,i,o),o.updateDeltaY(i,e,t),o.updateBody(i-o.deltaY)):n<0?(D_(-n,"down",t,e,i,o),o.updateDeltaY(i,e,t),o.updateBody(i-o.deltaY)):(o.updateDeltaY(i,e,t),o.updateBody(i-o.deltaY))}function D_(n,t,e,i,o,r){return z_(this,void 0,void 0,function*(){if(t==="up"&&r.rowEnd+n>r.bodyBottomRow?n=r.bodyBottomRow-r.rowEnd:t==="down"&&r.rowStart-n<r.bodyTopRow&&(n=r.rowStart-r.bodyTopRow),n!==0)if(n<0&&(t=t==="up"?"down":"up",n=-n),n<r.rowEnd-r.rowStart){const s=t==="up"?r.rowStart:r.rowEnd-n+1,l=t==="up"?r.rowStart+n-1:r.rowEnd,a=t==="up"?r.rowEnd+1:r.rowStart-n,h=t==="up"?r.rowEnd+n:r.rowStart-1;let d,u;r.table.heightMode==="autoHeight"?(d=a,u=h):(d=Math.max(r.bodyTopRow,e-1*r.screenRowCount),u=Math.min(r.bodyBottomRow,e+2*r.screenRowCount,r.table.rowCount-1)),Gi(r.table,d,u,!1),aF(s,l,t,r),r.rowStart=t==="up"?r.rowStart+n:r.rowStart-n,r.rowEnd=t==="up"?r.rowEnd+n:r.rowEnd-n;const c=ml(d,u,r,!0);r.table.heightMode==="autoHeight"&&(Pi(r.bodyLeftCol,r.bodyRightCol,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),Pi(0,r.table.frozenColCount-1,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),Pi(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,d,u,r.table,h>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow=t==="up"?r.currentRow+n:r.currentRow-n,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,t==="up"?r.totalRow+n:r.totalRow-n,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),r.table.heightMode==="autoHeight"&&c?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,a),r.rowUpdateDirection=t,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const s=t==="up"?r.rowStart+n:r.rowStart-n,l=Math.min(r.table.rowCount-1,t==="up"?r.rowEnd+n:r.rowEnd-n),a=r.table.getRowsHeight(r.bodyTopRow,s-1);let h,d;r.table.heightMode==="autoHeight"?(h=s,d=l):(h=Math.max(r.bodyTopRow,e-1*r.screenRowCount),d=Math.min(r.bodyBottomRow,e+2*r.screenRowCount,r.table.rowCount-1)),Gi(r.table,h,d,!1),hF(a,n,t,r),r.rowStart=s,r.rowEnd=l;const u=ml(h,d,r,!0);r.table.heightMode==="autoHeight"&&(Pi(r.bodyLeftCol,r.bodyRightCol,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),Pi(0,r.table.frozenColCount-1,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),Pi(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,h,d,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow=t==="up"?r.currentRow+n:r.currentRow-n,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,t==="up"?r.totalRow+n:r.totalRow-n,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),r.table.heightMode==="autoHeight"&&u?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}})}function aF(n,t,e,i){for(let o=0;o<i.table.frozenColCount;o++){const r=i.table.scenegraph.getColGroup(o);if(r)for(let s=n;s<=t;s++)jg(r,e,i)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++){const r=i.table.scenegraph.getColGroup(o);if(r)for(let s=n;s<=t;s++)jg(r,e,i)}for(let o=i.bodyLeftCol;o<=i.bodyRightCol;o++){const r=i.table.scenegraph.getColGroup(o);if(r)for(let s=n;s<=t;s++)jg(r,e,i)}}function jg(n,t,e){if(n.childrenCount>=1)if(t==="up"){const i=n.firstChild;e.updateCellGroupPosition(i,n.lastChild.row+1,n.lastChild.attribute.y+e.table.getRowHeight(n.lastChild.row)),n.appendChild(i)}else{const i=n.lastChild;e.updateCellGroupPosition(i,n.firstChild.row-1,n.firstChild.attribute.y-e.table.getRowHeight(i.row)),n.insertBefore(i,n.firstChild)}}function hF(n,t,e,i){for(let o=0;o<i.table.frozenColCount;o++){const r=i.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{i.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?n:s._prev.attribute.y+i.table.getRowHeight(s._prev.row))})}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++){const r=i.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{i.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?n:s._prev.attribute.y+i.table.getRowHeight(s._prev.row))})}for(let o=i.bodyLeftCol;o<=i.bodyRightCol;o++){const r=i.table.scenegraph.getColGroup(o);r==null||r.forEachChildren((s,l)=>{i.updateCellGroupPosition(s,e==="up"?s.row+t:s.row-t,l===0?n:s._prev.attribute.y+i.table.getRowHeight(s._prev.row))})}}function ml(n,t,e,i=!1){for(let l=0;l<e.table.frozenColCount;l++)for(let a=n;a<=t;a++){const h=e.highPerformanceGetCell(l,a,!0);e.updateCellGroupContent(h)}for(let l=e.table.colCount-e.table.rightFrozenColCount;l<e.table.colCount;l++)for(let a=n;a<=t;a++){const h=e.highPerformanceGetCell(l,a);e.updateCellGroupContent(h)}let o=e.bodyLeftCol,r=e.bodyRightCol,s=!0;if(i){const l=e.screenLeftCol;o=Math.max(e.bodyLeftCol,l-1*e.screenColCount),r=Math.min(e.bodyRightCol,l+2*e.screenColCount),o===e.bodyLeftCol&&r===e.bodyRightCol||(s=!1)}for(let l=o;l<=r;l++)for(let a=n;a<=t;a++){const h=e.highPerformanceGetCell(l,a);e.updateCellGroupContent(h)}return e.table.scenegraph.updateNextFrame(),s}var dF=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};function uF(n){var t;return dF(this,void 0,void 0,function*(){let e,i;n.table.scenegraph.bodyGroup.forEachChildren((s,l)=>{s.type==="group"&&(s.needUpdate=!0,s==null||s.forEachChildren(a=>{a.needUpdate=!0}))}),n.table.heightMode==="autoHeight"?(e=n.rowStart,i=n.rowEnd):(e=Math.max(n.bodyTopRow,n.screenTopRow-1*n.screenRowCount),i=Math.min(n.bodyBottomRow,n.screenTopRow+2*n.screenRowCount,n.table.rowCount-1));const o=n.table.getAllRowsHeight();Gi(n.table,e,i);const r=n.table.getAllRowsHeight();o!==r&&n.table.scenegraph.updateContainerHeight(n.table.frozenRowCount,r-o);for(let s=0;(t=s<n.table.frozenColCount)!==null&&t!==void 0&&t;s++){const l=n.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=n.rowStart;a<=n.rowEnd;a++)n.table.scenegraph.updateCellContent(s,a);for(let a=n.table.rowCount-n.table.bottomFrozenRowCount;a<n.table.rowCount;a++)n.table.scenegraph.updateCellContent(s,a)}for(let s=n.colStart;s<=n.colEnd;s++){const l=n.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=n.table.rowCount-n.table.bottomFrozenRowCount;a<n.table.rowCount;a++)n.table.scenegraph.updateCellContent(s,a)}for(let s=n.table.colCount-n.table.rightFrozenColCount;s<n.table.colCount;s++){const l=n.table.scenegraph.getColGroup(s);l==null||l.setAttribute("chartInstance",void 0);for(let a=n.rowStart;a<=n.rowEnd;a++)n.table.scenegraph.updateCellContent(s,a);for(let a=n.table.rowCount-n.table.bottomFrozenRowCount;a<n.table.rowCount;a++)n.table.scenegraph.updateCellContent(s,a)}ml(e,i,n),n.table.heightMode==="autoHeight"&&Pi(n.bodyLeftCol,n.bodyRightCol,e,i,n.table,n.rowEnd>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up"),n.rowUpdatePos=n.rowStart,n.rowUpdateDirection=n.rowEnd>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",n.table.scenegraph.updateNextFrame(),n.table.heightMode!=="autoHeight"&&(yield n.progress())})}var cF=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};function gF(n){return cF(this,void 0,void 0,function*(){n.table.scenegraph.bodyGroup.forEachChildren((i,o)=>{i.type==="group"&&(i.needUpdate=!0,i==null||i.forEachChildren(r=>{r.needUpdate=!0}))});const t=Math.max(n.bodyLeftCol,n.screenLeftCol-1*n.screenColCount),e=Math.min(n.bodyRightCol,n.screenLeftCol+2*n.screenColCount);Ui(n.table,t,e);for(let i=n.colStart;i<=n.colEnd;i++){const o=n.table.scenegraph.getColGroup(i);o==null||o.setAttribute("chartInstance",void 0);for(let r=n.table.rowCount-n.table.bottomFrozenRowCount;r<n.table.rowCount;r++)n.table.scenegraph.updateCellContent(i,r)}for(let i=n.table.colCount-n.table.rightFrozenColCount;i<n.table.colCount;i++){const o=n.table.scenegraph.getColGroup(i);o==null||o.setAttribute("chartInstance",void 0);for(let r=n.rowStart;r<=n.rowEnd;r++)n.table.scenegraph.updateCellContent(i,r);for(let r=n.table.rowCount-n.table.bottomFrozenRowCount;r<n.table.rowCount;r++)n.table.scenegraph.updateCellContent(i,r)}vl(t,e,n),n.colUpdatePos=n.colStart,n.colUpdateDirection=n.colEnd>n.bodyRightCol-(n.colEnd-n.colStart+1)?"right":"left",n.table.scenegraph.updateNextFrame(),yield n.progress()})}function bl(n){const{changedCells:t}=n.internalProps.stick;t.forEach(f=>{n.scenegraph.getCell(f.col,f.row).forEachChildren(p=>{p.setAttributes({dx:f.dx,dy:f.dy})})}),t.clear();const{scrollTop:e,scrollLeft:i,frozenRowCount:o,frozenColCount:r}=n,s=n.getFrozenRowsHeight(),l=n.getFrozenColsWidth(),{row:a}=n.getRowAt(e+s+1),{col:h}=n.getColAt(i+l+1),d=Math.max(a,n.frozenRowCount),u=Math.max(h,n.frozenColCount),c=n.getAllRowsHeight()>n.tableNoFrameHeight?n.getRowAt(e+n.tableNoFrameHeight-n.getBottomFrozenRowsHeight()-1).row:n.rowCount-n.bottomFrozenRowCount-1,g=n.getAllColsWidth()>n.tableNoFrameWidth?n.getColAt(i+n.tableNoFrameWidth-n.getRightFrozenColsWidth()-1).col:n.colCount-n.rightFrozenColCount-1;if(!(g<0||c<0)){for(let f=0;f<o&&!(g<u);f++)[u,g].forEach(p=>{const v=n._getCellStyle(p,f);v!=null&&v.textStick&&(v==null?void 0:v.textStick)!=="vertical"&&N_(n.scenegraph.getCell(p,f),l+n.tableX,n.tableNoFrameWidth-n.getRightFrozenColsWidth()+n.tableX,t,v==null?void 0:v.textStickBaseOnAlign,n)});for(let f=0;f<r&&!(c<d);f++)[d,c].forEach(p=>{const v=n._getCellStyle(f,p);v!=null&&v.textStick&&n.internalProps.layoutMap.rowHierarchyType!=="tree"&&(v==null?void 0:v.textStick)!=="horizontal"&&O_(n.scenegraph.getCell(f,p),s+n.tableY,n.tableNoFrameHeight-n.getBottomFrozenRowsHeight()+n.tableY,t,v==null?void 0:v.textStickBaseOnAlign,n)});for(let f=u;f<=g&&!(c<d);f++)[d,c].forEach(p=>{const v=n._getCellStyle(f,p);v!=null&&v.textStick&&(v==null?void 0:v.textStick)!=="horizontal"&&O_(n.scenegraph.getCell(f,p),s+n.tableY,n.tableNoFrameHeight-n.getBottomFrozenRowsHeight()+n.tableY,t,v==null?void 0:v.textStickBaseOnAlign,n)});for(let f=d;f<=c&&!(g<u);f++)[u,g].forEach(p=>{const v=n._getCellStyle(p,f);v!=null&&v.textStick&&(v==null?void 0:v.textStick)!=="vertical"&&N_(n.scenegraph.getCell(p,f),l+n.tableX,n.tableNoFrameWidth-n.getRightFrozenColsWidth()+n.tableX,t,v==null?void 0:v.textStickBaseOnAlign,n)})}}function O_(n,t,e,i,o,r){if(nt(n.mergeStartCol)&&nt(n.mergeStartRow)&&nt(n.mergeEndCol)&&nt(n.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=fo(n,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)W_(r.scenegraph.getCell(d,u),t,e,i,o)}else W_(n,t,e,i,o)}function W_(n,t,e,i,o){var r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_;const y=n.getChildByName("text",!0)||n.getChildByName("image",!0);if(!y)return;if(y.type==="image"){const{image:R}=y.attribute;if(!R||!y.resources||y.resources.get(R).state!=="success")return}const x=(r=y.textBaseline)!==null&&r!==void 0?r:"top";y.AABBBounds.width();const S=y.globalAABBBounds.y1,A=y.globalAABBBounds.y2;if(x==="middle"&&o){const R=n.globalAABBBounds.y1+((l=(s=n.firstChild)===null||s===void 0?void 0:s.attribute.dy)!==null&&l!==void 0?l:0),T=R+((h=(a=n.contentHeight)!==null&&a!==void 0?a:n.attribute.height)!==null&&h!==void 0?h:0);if(R<t||T>e){const M=Math.max(R,t),P=Math.min(T,e),k=y.globalTransMatrix.f-(P+M)/2+y.AABBBounds.height()/2;!i.has(`${n.col}-${n.row}`)&&i.set(`${n.col}-${n.row}`,{col:n.col,row:n.row,dx:(u=(d=n.firstChild)===null||d===void 0?void 0:d.attribute.dx)!==null&&u!==void 0?u:0,dy:(g=(c=n.firstChild)===null||c===void 0?void 0:c.attribute.dy)!==null&&g!==void 0?g:0}),n.forEachChildren(B=>{var H;B.setAttribute("dy",((H=B.attribute.dy)!==null&&H!==void 0?H:0)-k+2)})}}else if(S<t){const R=S-t;!i.has(`${n.col}-${n.row}`)&&i.set(`${n.col}-${n.row}`,{col:n.col,row:n.row,dx:(p=(f=n.firstChild)===null||f===void 0?void 0:f.attribute.dx)!==null&&p!==void 0?p:0,dy:(m=(v=n.firstChild)===null||v===void 0?void 0:v.attribute.dy)!==null&&m!==void 0?m:0}),n.forEachChildren(T=>{var M;T.setAttribute("dy",((M=T.attribute.dy)!==null&&M!==void 0?M:0)-R+2)})}else if(A>e){const R=A-e;!i.has(`${n.col}-${n.row}`)&&i.set(`${n.col}-${n.row}`,{col:n.col,row:n.row,dx:(w=(b=n.firstChild)===null||b===void 0?void 0:b.attribute.dx)!==null&&w!==void 0?w:0,dy:(_=(C=n.firstChild)===null||C===void 0?void 0:C.attribute.dy)!==null&&_!==void 0?_:0}),n.forEachChildren(T=>{var M;T.setAttribute("dy",((M=T.attribute.dy)!==null&&M!==void 0?M:0)-R)})}}function N_(n,t,e,i,o,r){if(nt(n.mergeStartCol)&&nt(n.mergeStartRow)&&nt(n.mergeEndCol)&&nt(n.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=fo(n,r.scenegraph);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)V_(r.scenegraph.getCell(d,u),t,e,i,o)}else V_(n,t,e,i,o)}function V_(n,t,e,i,o){var r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y;const x=n.getChildByName("text",!0)||n.getChildByName("image",!0);if(!x)return;if(x.type==="image"){const{image:T}=x.attribute;if(!T||!x.resources||x.resources.get(T).state!=="success")return}const S=(s=(r=x.attribute.textAlign)!==null&&r!==void 0?r:x.textAlign)!==null&&s!==void 0?s:"left";x.AABBBounds.width();const A=x.globalAABBBounds.x1,R=x.globalAABBBounds.x2;if(S==="center"&&o){const T=n.globalAABBBounds.x1+((a=(l=n.firstChild)===null||l===void 0?void 0:l.attribute.dx)!==null&&a!==void 0?a:0),M=T+((d=(h=n.contentWidth)!==null&&h!==void 0?h:n.attribute.width)!==null&&d!==void 0?d:0);if(T<t||M>e){const P=Math.max(T,t),k=Math.min(M,e),B=x.globalTransMatrix.e-(k+P)/2;!i.has(`${n.col}-${n.row}`)&&i.set(`${n.col}-${n.row}`,{col:n.col,row:n.row,dx:(c=(u=n.firstChild)===null||u===void 0?void 0:u.attribute.dx)!==null&&c!==void 0?c:0,dy:(f=(g=n.firstChild)===null||g===void 0?void 0:g.attribute.dy)!==null&&f!==void 0?f:0}),n.forEachChildren(H=>{var E;H.setAttribute("dx",((E=H.attribute.dx)!==null&&E!==void 0?E:0)-B+2)})}}else if(A<t){const T=A-t;!i.has(`${n.col}-${n.row}`)&&i.set(`${n.col}-${n.row}`,{col:n.col,row:n.row,dx:(v=(p=n.firstChild)===null||p===void 0?void 0:p.attribute.dx)!==null&&v!==void 0?v:0,dy:(b=(m=n.firstChild)===null||m===void 0?void 0:m.attribute.dy)!==null&&b!==void 0?b:0}),n.forEachChildren(M=>{var P;M.setAttribute("dx",((P=M.attribute.dx)!==null&&P!==void 0?P:0)-T+2)})}else if(R>e){const T=R-e;!i.has(`${n.col}-${n.row}`)&&i.set(`${n.col}-${n.row}`,{col:n.col,row:n.row,dx:(C=(w=n.firstChild)===null||w===void 0?void 0:w.attribute.dx)!==null&&C!==void 0?C:0,dy:(y=(_=n.firstChild)===null||_===void 0?void 0:_.attribute.dy)!==null&&y!==void 0?y:0}),n.forEachChildren(M=>{var P;M.setAttribute("dx",((P=M.attribute.dx)!==null&&P!==void 0?P:0)-T)})}}function j_(n){var t,e;const i=n.internalProps.layoutMap.headerObjects,o=n.internalProps.layoutMap.columnObjects;for(let r=0;r<i.length;r++){const s=i[r];if(s&&(!((t=s.style)===null||t===void 0)&&t.textStick))return!0}for(let r=0;r<o.length;r++){const s=o[r];if(s&&(!((e=s.style)===null||e===void 0)&&e.textStick))return!0}return!!(n.theme.headerStyle.textStick||n.theme.rowHeaderStyle.textStick||n.theme.bodyStyle.textStick)}var Ki=globalThis&&globalThis.__awaiter||function(n,t,e,i){return new(e||(e=Promise))(function(o,r){function s(h){try{a(i.next(h))}catch(d){r(d)}}function l(h){try{a(i.throw(h))}catch(d){r(d)}}function a(h){var d;h.done?o(h.value):(d=h.value,d instanceof e?d:new e(function(u){u(d)})).then(s,l)}a((i=i.apply(n,t||[])).next())})};class fF{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):this.table.heightMode==="autoHeight"?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):(this.table.widthMode==="autoWidth"||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const r=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(r/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const r=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(r/e))),this.rowUpdatePos=this.bodyBottomRow}refreshRowCount(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.rowStart+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow}refreshColCount(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,r,s,l,a){JL(t,e,i,o,r,s,l,a,this)}progress(){return Ki(this,void 0,void 0,function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise((t,e)=>{setTimeout(()=>Ki(this,void 0,void 0,function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),bl(this.table),this.table.scenegraph.updateNextFrame(),t())}),16)})})}createRow(){return Ki(this,void 0,void 0,function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)})}createCol(){return Ki(this,void 0,void 0,function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)})}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(Gi(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let o=0;for(let r=0;r<this.table.frozenColCount;r++){const s=this.table.scenegraph.getColGroup(r),{height:l}=(this.table.isListTable(),yd(s,r,s.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));o=Math.max(o,l),this.table.scenegraph.rowHeaderGroup.setAttribute("height",o)}}if(this.table.rightFrozenColCount){let o=0;for(let r=this.table.colCount-this.table.rightFrozenColCount;r<this.table.colCount;r++){const s=this.table.scenegraph.getColGroup(r),{height:l}=(this.table.isPivotChart(),yd(s,r,s.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));o=Math.max(o,l),this.table.scenegraph.rightFrozenGroup.setAttribute("height",o)}}let i=0;for(let o=this.bodyLeftCol;o<=this.bodyRightCol;o++){const r=this.table.scenegraph.getColGroup(o);if(!r)continue;this.table.rowHeaderLevelCount;const{height:s}=yd(r,o,r.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table);i=Math.max(i,s)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);Ui(this.table,this.currentCol+1,e),this.colEnd=e;for(let s=0;s<this.table.rowCount;s++){const l=this.highPerformanceGetCell(this.currentCol,s);l.role==="cell"&&nt(l.mergeStartCol)&&l.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(l.col,l.row)}if(this.table.frozenRowCount){const s=this.table.scenegraph.colHeaderGroup.lastChild instanceof Kt?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,l=s.attribute.x+s.attribute.width,a=s.attribute.y;je(this.table.scenegraph.colHeaderGroup,l,a,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const s=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof Kt?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,l=s.attribute.x+s.attribute.width,a=s.attribute.y;je(this.table.scenegraph.bottomFrozenGroup,l,a,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof Kt?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof Kt?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,r=i.attribute.y;je(this.table.scenegraph.bodyGroup,o,r,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t,e=!1){return Ki(this,void 0,void 0,function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,r=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);r&&(this.screenTopRow=r.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&this.table.scenegraph.bodyGroup.firstChild.childrenCount!==0||this.table.scenegraph.rowHeaderGroup.firstChild&&this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount!==0?this.dynamicSetY(t,r,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))})}setX(t,e=!1){return Ki(this,void 0,void 0,function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,r=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);r&&(this.screenLeftCol=r.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&this.table.scenegraph.bodyGroup.firstChild.childrenCount===0?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,r,e)})}dynamicSetY(t,e,i=!1){return Ki(this,void 0,void 0,function*(){sF(t,e,i,this)})}dynamicSetX(t,e,i=!1){return Ki(this,void 0,void 0,function*(){eF(t,e,i,this)})}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return Ki(this,void 0,void 0,function*(){this.updateCellGroups(this.taskRowCount)})}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);this.table.heightMode==="autoHeight"&&Gi(this.table,this.rowUpdatePos,e,!1),ml(this.rowUpdatePos,e,this),this.table.heightMode==="autoHeight"&&(Pi(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Pi(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Pi(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;this.table.heightMode==="autoHeight"&&Gi(this.table,t,e,!1),ml(t,e,this),this.table.heightMode==="autoHeight"&&(Pi(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),Pi(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),Pi(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;this.table.widthMode==="autoWidth"&&Ui(this.table,t,e,!1),vl(t,e,this),this.table.heightMode==="autoHeight"&&Wg(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return Ki(this,void 0,void 0,function*(){this.updateColGroups(this.taskRowCount)})}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);Ui(this.table,this.colUpdatePos,e),vl(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||t.role!=="cell")return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return Ki(this,void 0,void 0,function*(){yield uF(this)})}sortCellHorizontal(){return Ki(this,void 0,void 0,function*(){yield gF(this)})}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd)||t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return _d;if(this.cellCache.get(t)){const r=this.cellCache.get(t);if((r._next||r._prev)&&Math.abs(r.row-e)<e){let l=Gg(r,e);return l&&(i||l.role!=="shadow-cell")||(l=this.table.scenegraph.getCell(t,e,i)),l.row&&this.cellCache.set(t,l),l}const s=this.table.scenegraph.getCell(t,e,i);return s.col===t&&s.row&&this.cellCache.set(t,s),s}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const o=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if(o.role==="cell"){const r=o.attribute.y;this.deltaY=-r}}else if(this.rowEnd===this.bodyBottomRow){const o=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if(o.role==="cell"){const r=o.attribute.y+o.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-r}}else if(I(e)&&I(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);o.role!=="cell"&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const r=t-this.deltaY,s=e-r,l=o.attribute.y-r+this.table.getFrozenRowsHeight();this.deltaY=s-l}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const o=this.table.scenegraph.getColGroup(this.colStart);if(o){const r=o.attribute.x;this.deltaX=-r}}else if(this.colEnd===this.bodyRightCol){const o=this.table.scenegraph.getColGroup(this.colEnd);if(o){const r=o.attribute.x+o.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-r}}else if(I(e)&&I(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),r=t-this.deltaX,s=e-r,l=o.attribute.x-r+this.table.getFrozenColsWidth();this.deltaX=s-l}}release(){this.isRelease=!0}}function Gg(n,t){if(!n)return null;if(n.row===t)return n;const e=n._prev,i=n._next;return n.row>t&&e&&e.row===n.row-1?Gg(e,t):n.row<t&&i&&i.row===n.row+1?Gg(i,t):null}function pF(n,t,e,i,o,r){const s=r.scenegraph;for(let l=n;l<=t;l++){const a=r.getColWidth(l),h=r.scenegraph.getColGroup(l,!0),d=r.scenegraph.getColGroup(l),u=r.scenegraph.getColGroupInBottom(l),c=r.scenegraph.getColGroupInLeftBottomCorner(l),g=r.scenegraph.getColGroupInRightBottomCorner(l);h&&(h.setAttribute("width",a),h.forEachChildren(f=>{f.setAttribute("width",a)})),d&&(d.setAttribute("width",a),d.forEachChildren(f=>{f.setAttribute("width",a)})),u&&(u.setAttribute("width",a),u.forEachChildren(f=>{f.setAttribute("width",a)})),g&&(g.setAttribute("width",a),g.forEachChildren(f=>{f.setAttribute("width",a)})),c&&(c.setAttribute("width",a),c.forEachChildren(f=>{f.setAttribute("width",a)}))}if(s.updateContainer(),o==="column")for(let l=n;l<=t;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=0;h<=r.frozenRowCount-1;h++)s.updateCellContent(l,h);for(let h=s.bodyRowStart;h<=s.bodyRowEnd;h++)s.updateCellContent(l,h);for(let h=r.rowCount-r.bottomFrozenRowCount;h<=r.rowCount-1;h++)s.updateCellContent(l,h)}else{for(let l=0;l<=r.frozenColCount-1;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=i;h++)s.updateCellContent(l,h)}for(let l=s.bodyColStart;l<=s.bodyColEnd;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=i;h++)s.updateCellContent(l,h)}for(let l=r.colCount-r.rightFrozenColCount;l<=r.colCount-1;l++){const a=r.scenegraph.getColGroup(l);a==null||a.setAttribute("chartInstance",void 0);for(let h=e;h<=i;h++)s.updateCellContent(l,h)}}}function G_(n){n.customSelectedRangeComponents.forEach((t,e)=>{Ug(t,e,n)}),n.selectingRangeComponents.forEach((t,e)=>{Ug(t,e,n)}),n.selectedRangeComponents.forEach((t,e)=>{Ug(t,e,n)})}function Ug(n,t,e){var i,o,r,s,l,a,h,d,u;const c=e.table,[g,f,p,v]=t.split("-"),m=parseInt(g,10),b=parseInt(f,10),w=parseInt(p,10),C=parseInt(v,10);let _,y=m,x=b,S=w,A=C;switch(n.role){case"rowHeader":_=c.getBodyVisibleRowRange(),_&&(x=Math.max(b,_.rowStart-1),A=Math.min(C,_.rowEnd+1));break;case"columnHeader":case"bottomFrozen":_=c.getBodyVisibleCellRange(),_&&(y=Math.max(m,_.colStart-1),S=Math.min(w,_.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":_=c.getBodyVisibleCellRange(),_&&(x=Math.max(b,_.rowStart-1),A=Math.min(C,_.rowEnd+1));break;default:_=c.getBodyVisibleCellRange(),_&&(x=Math.max(b,_.rowStart-1),A=Math.min(C,_.rowEnd+1),y=Math.max(m,_.colStart-1),S=Math.min(w,_.colEnd+1))}const R=c.getColsWidth(y,S),T=c.getRowsHeight(x,A),M=e.highPerformanceGetCell(y,x).globalAABBBounds,P=e.highPerformanceGetCell(S,A).globalAABBBounds;n.rect.setAttributes({x:M.x1-e.tableGroup.attribute.x,y:M.y1-e.tableGroup.attribute.y,width:R,height:T,visible:!0}),n.fillhandle&&((i=n.fillhandle)===null||i===void 0||i.setAttributes({x:P.x2-e.tableGroup.attribute.x-3,y:P.y2-e.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let k=!!c.frozenColCount&&m===c.frozenColCount;!k&&c.frozenColCount&&c.scrollLeft>0&&m>=c.frozenColCount&&c.getColsWidth(0,m-1)-c.scrollLeft<c.getFrozenColsWidth()&&(k=!0);let B=!!c.rightFrozenColCount&&c.rightFrozenColCount>0&&w===c.colCount-c.rightFrozenColCount-1;!B&&c.rightFrozenColCount&&w<c.colCount-c.rightFrozenColCount&&c.getColsWidth(0,w)-c.scrollLeft>c.tableNoFrameWidth-c.getRightFrozenColsWidth()&&(B=!0);let H=!c.frozenRowCount||b===c.frozenRowCount;!H&&c.frozenRowCount&&c.scrollTop>0&&b>=c.frozenRowCount&&c.getRowsHeight(0,b-1)-c.scrollTop<c.getFrozenRowsHeight()&&(H=!0);let E=!!c.bottomFrozenRowCount&&C===c.rowCount-c.bottomFrozenRowCount-1;if(!E&&c.bottomFrozenRowCount&&C<c.rowCount-c.bottomFrozenRowCount&&c.getRowsHeight(0,C)-c.scrollTop>c.tableNoFrameHeight-c.getBottomFrozenRowsHeight()&&(E=!0),k&&n.rect.attribute.stroke[3]||B&&n.rect.attribute.stroke[1]||H&&n.rect.attribute.stroke[0]||E&&n.rect.attribute.stroke[2]){if(k&&n.rect.attribute.stroke[3]&&e.tableGroup.insertAfter(n.rect,n.role==="columnHeader"?e.cornerHeaderGroup:n.role==="bottomFrozen"?e.leftBottomCornerGroup:e.rowHeaderGroup),E&&n.rect.attribute.stroke[2]&&e.tableGroup.insertAfter(n.rect,n.role==="rowHeader"?e.leftBottomCornerGroup:n.role==="rightFrozen"?e.rightBottomCornerGroup:e.bottomFrozenGroup),H&&n.rect.attribute.stroke[0]&&e.tableGroup.insertAfter(n.rect,n.role==="rowHeader"?e.cornerHeaderGroup:n.role==="rightFrozen"?e.rightTopCornerGroup:e.colHeaderGroup),B&&n.rect.attribute.stroke[1]&&e.tableGroup.insertAfter(n.rect,n.role==="columnHeader"?e.rightTopCornerGroup:n.role==="bottomFrozen"?e.rightBottomCornerGroup:e.rightFrozenGroup),n.rect.attribute.x<c.getFrozenColsWidth()&&c.scrollLeft>0&&(n.role==="body"||n.role==="columnHeader"||n.role==="bottomFrozen")){const L=n.rect.attribute.width-(c.getFrozenColsWidth()-n.rect.attribute.x);n.rect.setAttributes({x:n.rect.attribute.x+(c.getFrozenColsWidth()-n.rect.attribute.x),width:L>0?L:0}),(o=n.fillhandle)===null||o===void 0||o.setAttributes({visible:L>0})}if(c.getRightFrozenColsWidth()>0&&e.rightFrozenGroup.attribute.height>0&&n.rect.attribute.x+n.rect.attribute.width>e.rightFrozenGroup.attribute.x&&(n.role==="body"||n.role==="columnHeader"||n.role==="bottomFrozen")){const L=e.rightFrozenGroup.attribute.x-n.rect.attribute.x;n.rect.setAttributes({x:n.rect.attribute.x,width:L>0?L:0}),(r=n.fillhandle)===null||r===void 0||r.setAttributes({visible:L-R>0})}if(n.rect.attribute.y<e.colHeaderGroup.attribute.height&&c.scrollTop>0&&(n.role==="body"||n.role==="rowHeader"||n.role==="rightFrozen")){const L=n.rect.attribute.height-(e.colHeaderGroup.attribute.height-n.rect.attribute.y);n.rect.setAttributes({y:n.rect.attribute.y+(e.colHeaderGroup.attribute.height-n.rect.attribute.y),height:L>0?L:0}),(s=n.fillhandle)===null||s===void 0||s.setAttributes({visible:L>0})}if(e.bottomFrozenGroup.attribute.width>0&&e.bottomFrozenGroup.attribute.height>0&&n.rect.attribute.y+n.rect.attribute.height>e.bottomFrozenGroup.attribute.y&&(n.role==="body"||n.role==="rowHeader"||n.role==="rightFrozen")){const L=e.bottomFrozenGroup.attribute.y-n.rect.attribute.y;n.rect.setAttributes({y:n.rect.attribute.y,height:L>0?L:0}),(l=n.fillhandle)===null||l===void 0||l.setAttributes({visible:L-T>0})}}else e.tableGroup.insertAfter(n.rect,n.role==="body"?e.bodyGroup:n.role==="columnHeader"?e.colHeaderGroup:n.role==="rowHeader"?e.rowHeaderGroup:n.role==="cornerHeader"?e.cornerHeaderGroup:n.role==="rightTopCorner"?e.rightTopCornerGroup:n.role==="rightFrozen"?e.rightFrozenGroup:n.role==="leftBottomCorner"?e.leftBottomCornerGroup:n.role==="bottomFrozen"?e.bottomFrozenGroup:e.rightBottomCornerGroup);let F=0;typeof n.rect.attribute.lineWidth=="number"&&(F=Math.ceil(n.rect.attribute.lineWidth/2)),w===c.colCount-1&&(Array.isArray(n.rect.attribute.lineWidth)&&(F=Math.ceil(((a=n.rect.attribute.lineWidth[1])!==null&&a!==void 0?a:0)/2)),n.rect.setAttributes({width:n.rect.attribute.width-F})),m===0&&(Array.isArray(n.rect.attribute.lineWidth)&&(F=Math.ceil(((h=n.rect.attribute.lineWidth[3])!==null&&h!==void 0?h:0)/2)),n.rect.setAttributes({x:n.rect.attribute.x+F,width:n.rect.attribute.width-F})),C===c.rowCount-1&&(Array.isArray(n.rect.attribute.lineWidth)&&(F=Math.ceil(((d=n.rect.attribute.lineWidth[2])!==null&&d!==void 0?d:0)/2)),n.rect.setAttributes({height:n.rect.attribute.height-F})),b===0&&(Array.isArray(n.rect.attribute.lineWidth)&&(F=Math.ceil(((u=n.rect.attribute.lineWidth[0])!==null&&u!==void 0?u:0)/2)),n.rect.setAttributes({y:n.rect.attribute.y+F,height:n.rect.attribute.height-F}))}function U_(n,t,e=!0){const i=n.table,o=t.start.col,r=t.start.row,s=t.end.col,l=t.end.row,a=t.skipBodyMerge;let h=Math.max(Math.min(s,o),0),d=Math.max(Math.min(l,r),0),u=Math.min(Math.max(s,o),i.colCount-1),c=Math.min(Math.max(l,r),i.rowCount-1);const g=()=>{let x=!1;for(let S=h;S<=u;S++){if(S===h)for(let A=d;A<=c;A++){if(!i.isHeader(S,A)&&a)continue;const R=ke(i,S,A);if(R&&R.start.col<h){h=R.start.col,x=!0;break}}if(!x&&S===u)for(let A=d;A<=c;A++){if(!i.isHeader(S,A)&&a)continue;const R=ke(i,S,A);if(R&&Math.min(R.end.col,i.colCount-1)>u){u=R.end.col,x=!0;break}}if(x)break}if(!x)for(let S=d;S<=c;S++){if(S===d)for(let A=h;A<=u;A++){if(!i.isHeader(A,S)&&a)continue;const R=ke(i,A,S);if(R&&R.start.row<d){d=R.start.row,x=!0;break}}if(!x&&S===c)for(let A=h;A<=u;A++){if(!i.isHeader(A,S)&&a)continue;const R=ke(i,A,S);if(R&&Math.min(R.end.row,i.rowCount-1)>c){c=R.end.row,x=!0;break}}if(x)break}x&&g()};e&&g(),n.selectingRangeComponents.forEach((x,S)=>{var A;x.rect.delete(),(A=x.fillhandle)===null||A===void 0||A.delete()}),n.selectingRangeComponents=new Map;let f=!1,p=!1,v=!1,m=!1,b=!1,w=!1,C=!1,_=!1,y=!1;if(h<=i.frozenColCount-1&&d<=i.frozenRowCount-1&&(w=!0),u>=i.colCount-i.rightFrozenColCount&&d<=i.frozenRowCount-1&&(C=!0),h<=i.frozenColCount-1&&c>=i.rowCount-i.bottomFrozenRowCount&&(y=!0),u>=i.colCount-i.rightFrozenColCount&&c>=i.rowCount-i.bottomFrozenRowCount&&(_=!0),h<=i.frozenColCount-1&&c>=i.frozenRowCount&&d<=i.rowCount-i.bottomFrozenRowCount-1&&(f=!0),u>=i.colCount-i.rightFrozenColCount&&c>=i.frozenRowCount&&d<=i.rowCount-i.bottomFrozenRowCount-1&&(p=!0),d<=i.frozenRowCount-1&&u>=i.frozenColCount&&h<=i.colCount-i.rightFrozenColCount-1&&(v=!0),c>=i.rowCount-i.bottomFrozenRowCount&&u>=i.frozenColCount&&h<=i.colCount-i.rightFrozenColCount-1&&(m=!0),h<=i.colCount-i.rightFrozenColCount-1&&u>=i.frozenColCount&&d<=i.rowCount-i.bottomFrozenRowCount-1&&c>=i.frozenRowCount&&(b=!0),w){const x=Math.min(u,i.frozenColCount-1),S=Math.min(c,i.frozenRowCount-1),A=[!0,!v,!f,!0];n.createCellSelectBorder(h,d,x,S,"cornerHeader",`${h}${d}${u}${c}`,A)}if(C){const x=Math.max(h,i.colCount-i.rightFrozenColCount),S=Math.min(c,i.frozenRowCount-1),A=[!0,!0,!p,!v];n.createCellSelectBorder(x,d,u,S,"rightTopCorner",`${h}${d}${u}${c}`,A)}if(y){const x=Math.min(u,i.frozenColCount-1),S=Math.max(d,i.rowCount-i.bottomFrozenRowCount),A=[!f,!m,!0,!0];n.createCellSelectBorder(h,S,x,c,"leftBottomCorner",`${h}${d}${u}${c}`,A)}if(_){const x=Math.max(h,i.colCount-i.rightFrozenColCount),S=Math.max(d,i.rowCount-i.bottomFrozenRowCount),A=[!p,!0,!0,!m];n.createCellSelectBorder(x,S,u,c,"rightBottomCorner",`${h}${d}${u}${c}`,A)}if(v){const x=Math.max(h,i.frozenColCount),S=Math.min(u,i.colCount-i.rightFrozenColCount-1),A=Math.min(c,i.frozenRowCount-1),R=[!0,!C,!b,!w];n.createCellSelectBorder(x,d,S,A,"columnHeader",`${h}${d}${u}${c}`,R)}if(m){const x=Math.max(h,i.frozenColCount),S=Math.min(u,i.colCount-i.rightFrozenColCount-1),A=Math.max(d,i.rowCount-i.bottomFrozenRowCount),R=[!b,!_,!0,!y];n.createCellSelectBorder(x,A,S,c,"bottomFrozen",`${h}${d}${u}${c}`,R)}if(f){const x=Math.max(d,i.frozenRowCount),S=Math.min(c,i.rowCount-i.bottomFrozenRowCount-1),A=Math.min(u,i.frozenColCount-1),R=[!w,!b,!y,!0];n.createCellSelectBorder(h,x,A,S,"rowHeader",`${h}${d}${u}${c}`,R)}if(p){const x=Math.max(d,i.frozenRowCount),S=Math.min(c,i.rowCount-i.bottomFrozenRowCount-1),A=Math.max(h,i.colCount-i.rightFrozenColCount),R=[!C,!0,!_,!b];n.createCellSelectBorder(A,x,u,S,"rightFrozen",`${h}${d}${u}${c}`,R)}if(b){const x=Math.max(h,i.frozenColCount),S=Math.max(d,i.frozenRowCount),A=Math.min(u,i.colCount-i.rightFrozenColCount-1),R=Math.min(c,i.rowCount-i.bottomFrozenRowCount-1),T=[!v,!p,!m,!f];n.createCellSelectBorder(x,S,A,R,"body",`${h}${d}${u}${c}`,T)}}function K_(n){n.selectingRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",0)}),n.selectedRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",0)})}function $_(n){n.selectingRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",1)}),n.selectedRangeComponents.forEach((t,e)=>{t.rect.setAttribute("opacity",1)})}function vF(n,t,e,i,o,r,s,l){var a,h,d,u,c,g,f,p;let v=!!(!((a=n.table.options.excelOptions)===null||a===void 0)&&a.fillHandle);if(((h=n.table.stateManager.select.ranges)===null||h===void 0?void 0:h.length)>1)v=!1,n.removeFillHandleFromSelectComponents();else if(((d=n.table.stateManager.select.ranges)===null||d===void 0?void 0:d.length)===1){const M=Math.max(n.table.stateManager.select.ranges[0].start.row,n.table.stateManager.select.ranges[0].end.row),P=Math.max(n.table.stateManager.select.ranges[0].start.col,n.table.stateManager.select.ranges[0].end.col);n.table.isHeader(P,M)&&(v=!1)}!Array.isArray(l)||l[1]!==!1&&l[2]!==!1||(v=!1);const m=Math.min(t,i),b=Math.min(e,o),w=Math.max(t,i),C=Math.max(e,o),_=n.highPerformanceGetCell(m,b).globalAABBBounds,y=n.highPerformanceGetCell(w,C).globalAABBBounds,x=n.table.theme,S=(u=x.selectionStyle)===null||u===void 0?void 0:u.cellBorderColor,A=(c=x.selectionStyle)===null||c===void 0?void 0:c.cellBorderLineWidth,R=ve({pickable:!1,fill:((g=x.selectionStyle)===null||g===void 0?void 0:g.selectionFillMode)!=="replace"&&((p=(f=x.selectionStyle)===null||f===void 0?void 0:f.cellBgColor)!==null&&p!==void 0?p:"rgba(0, 0, 255,0.1)"),lineWidth:A,stroke:l.map(M=>!!M&&S),x:_.x1-n.tableGroup.attribute.x,y:_.y1-n.tableGroup.attribute.y,width:0,height:0,visible:!0});let T;v&&(T=ve({pickable:!1,fill:S,stroke:S,x:y.x2-3,y:y.y2-3,width:6,height:6,visible:!0})),n.lastSelectId=s,n.selectingRangeComponents.set(`${m}-${b}-${w}-${C}-${s}`,{rect:R,fillhandle:T,role:r}),n.tableGroup.insertAfter(R,r==="body"?n.bodyGroup:r==="columnHeader"?n.colHeaderGroup:r==="rowHeader"?n.rowHeaderGroup:r==="cornerHeader"?n.cornerHeaderGroup:r==="rightTopCorner"?n.rightTopCornerGroup:r==="rightFrozen"?n.rightFrozenGroup:r==="leftBottomCorner"?n.leftBottomCornerGroup:r==="bottomFrozen"?n.bottomFrozenGroup:n.rightBottomCornerGroup),v&&n.tableGroup.insertAfter(T,r==="body"?n.bodyGroup:r==="columnHeader"?n.colHeaderGroup:r==="rowHeader"?n.rowHeaderGroup:r==="cornerHeader"?n.cornerHeaderGroup:r==="rightTopCorner"?n.rightTopCornerGroup:r==="rightFrozen"?n.rightFrozenGroup:r==="leftBottomCorner"?n.leftBottomCornerGroup:r==="bottomFrozen"?n.bottomFrozenGroup:n.rightBottomCornerGroup)}function Y_(n){n.selectingRangeComponents.forEach((t,e)=>{var i;n.selectedRangeComponents.get(e)&&(n.selectingRangeComponents.get(e).rect.delete(),(i=n.selectingRangeComponents.get(e).fillhandle)===null||i===void 0||i.delete()),n.selectedRangeComponents.set(e,t)}),n.selectingRangeComponents=new Map,n.updateNextFrame()}function mF(n){n.selectedRangeComponents.forEach((t,e)=>{var i;e.split("-")[4]===n.lastSelectId&&(t.rect.delete(),(i=t.fillhandle)===null||i===void 0||i.delete(),n.selectedRangeComponents.delete(e))})}function X_(n){n.selectedRangeComponents.forEach((t,e)=>{var i;t.rect.delete(),(i=t.fillhandle)===null||i===void 0||i.delete()}),n.selectedRangeComponents=new Map}function q_(n){n.selectingRangeComponents.forEach((t,e)=>{var i;t.rect.delete(),(i=t.fillhandle)===null||i===void 0||i.delete()}),n.selectingRangeComponents=new Map}function bF(n){n.selectedRangeComponents.forEach((t,e)=>{var i;(i=t.fillhandle)===null||i===void 0||i.delete(),t.fillhandle=void 0})}function CF(n,t,e,i){const o=i.scenegraph,r=Xs(n.map(g=>g.row)).sort((g,f)=>f-g),s=Xs(t.map(g=>g.row)).sort((g,f)=>g-f),l=Xs(e.map(g=>g.row)).sort((g,f)=>g-f);let a;if(l.length&&(a=$g(l[0]-1,l[l.length-1]+1,o)),s.length){const g=$g(s[0]-1,s[s.length-1]+1,o);a=I(a)?I(g)?Math.min(a,g):a:g}if(r.length){const g=$g(r[0]-1,r[r.length-1]+1,o);a=I(a)?I(g)?Math.min(a,g):a:g}r.forEach(g=>{_F(g,o)});const h=i.rowHeightsMap;if(r.forEach(g=>{h.delete(g)}),r.length){wF(o);const g=Kg(r[r.length-1]-1,r[0]-r.length+1,o);a=I(a)?I(g)?Math.min(a,g):a:g}let d;if(o.table._clearRowRangeHeightsMap(),s.forEach(g=>{const f=yF(g,o);d=d??f,h.insert(g)}),SF(o),s.length){const g=Kg(s[0]-1,s[s.length-1]+1,o);a=I(a)?I(g)?Math.min(a,g):a:g}for(let g=0;g<i.colCount;g++)l.forEach(f=>{if(f<i.frozenRowCount){const p=ke(o.table,g,f);if(p)for(let v=p.start.col;v<=p.end.col;v++)for(let m=p.start.row;m<=p.end.row;m++)co(v,m,o.table,!1);else co(g,f,o.table,!1)}else if(f>i.rowCount-1||f<o.table.rowCount-o.table.bottomFrozenRowCount&&(f<o.proxy.rowStart||f>o.proxy.rowEnd))J_(f,o);else{const p=ke(o.table,g,f);if(p)for(let v=p.start.col;v<=p.end.col;v++)for(let m=p.start.row;m<=p.end.row;m++)co(v,m,o.table,!1);else co(g,f,o.table,!1)}});if(l.length){const g=Kg(l[0]-1,l[l.length-1]+1,o);a=I(a)?I(g)?Math.min(a,g):a:g}if(nt(d)){for(let g=0;g<i.colCount;g++)for(let f=d;f<i.rowCount;f++){const p=o.highPerformanceGetCell(g,f,!0);p&&(p.needUpdate=!0)}a=I(a)?I(d)?Math.min(a,d):a:d}if(nt(a)&&(o.proxy.rowUpdatePos=Math.min(o.proxy.rowUpdatePos,a)),s.length){if(!nt(d)){const g=Math.min(...s);o.proxy.rowUpdatePos=Math.min(g,o.proxy.rowUpdatePos)}o.proxy.rowUpdateDirection="up",o.proxy.updateCellGroups(2*o.proxy.screenRowCount),c()}else r.length&&(xF(r[r.length-1],o),o.proxy.updateCellGroups(2*o.proxy.screenRowCount),c());o.proxy.progress();const u=i.getRowsHeight(i.frozenRowCount,i.rowCount-1-i.bottomFrozenRowCount);function c(){if((s==null?void 0:s[(s==null?void 0:s.length)-1])>=i.rowCount-i.bottomFrozenRowCount||(l==null?void 0:l[(l==null?void 0:l.length)-1])>=i.rowCount-i.bottomFrozenRowCount||(r==null?void 0:r[0])>=i.rowCount-i.bottomFrozenRowCount){for(let g=0;g<i.colCount;g++)for(let f=i.rowCount-i.bottomFrozenRowCount;f<i.rowCount;f++){const p=o.highPerformanceGetCell(g,f,!0);p&&(p.needUpdate=!0)}o.proxy.updateBottomFrozenCellGroups()}}o.updateContainerHeight(o.table.frozenRowCount,u-o.bodyGroup.attribute.height)}function _F(n,t){const e=t.proxy;n>=e.rowStart&&n<=e.rowEnd&&(J_(n,t),e.rowEnd--,e.currentRow--),e.bodyBottomRow--;const i=Math.min(e.rowLimit,e.bodyBottomRow-e.bodyTopRow+1);e.totalActualBodyRowCount=i,e.totalRow=Math.min(e.table.rowCount-1,e.rowStart+i-1)}function yF(n,t){const e=t.proxy;e.bodyBottomRow++;const i=Math.min(e.rowLimit,e.bodyBottomRow-e.bodyTopRow+1);if(e.totalActualBodyRowCount=i,e.totalRow=e.rowStart+i-1,!(n<e.rowStart))return n>e.rowEnd?e.rowEnd-e.rowStart+1<e.rowLimit?(e.rowEnd++,e.currentRow++,Z_(n,t),n):void 0:(e.rowEnd-e.rowStart+1<e.rowLimit&&(e.rowEnd++,e.currentRow++,Z_(n,t)),n)}function wF(n){function t(e,i){e.row=i;const o=ke(n.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}n.bodyGroup.forEachChildren(e=>{let i=n.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,i),i++})}),n.rowHeaderGroup.forEachChildren(e=>{let i=n.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,i),i++})}),n.rightFrozenGroup.forEachChildren(e=>{let i=n.bodyRowStart;e==null||e.forEachChildren(o=>{t(o,i),i++})}),n.bottomFrozenGroup.forEachChildren(e=>{let i=n.table.rowCount-n.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,i),i++})}),n.leftBottomCornerGroup.forEachChildren(e=>{let i=n.table.rowCount-n.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,i),i++})}),n.rightBottomCornerGroup.forEachChildren(e=>{let i=n.table.rowCount-n.table.bottomFrozenRowCount;e==null||e.forEachChildren(o=>{t(o,i),i++})})}function SF(n){function t(e,i,o){e.row=i,e.setAttribute("y",o);const r=ke(n.table,e.col,e.row);r?(e.mergeStartCol=r.start.col,e.mergeEndCol=r.end.col,e.mergeStartRow=r.start.row,e.mergeEndRow=r.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}n.bodyGroup.forEachChildren(e=>{let i=n.bodyRowStart,o=n.getCellGroupY(i);e==null||e.forEachChildren(r=>{t(r,i,o),i++,o+=r.attribute.height})}),n.rowHeaderGroup.forEachChildren(e=>{let i=n.bodyRowStart,o=n.getCellGroupY(i);e==null||e.forEachChildren(r=>{t(r,i,o),i++,o+=r.attribute.height})}),n.rightFrozenGroup.forEachChildren(e=>{let i=n.bodyRowStart,o=n.getCellGroupY(i);e==null||e.forEachChildren(r=>{t(r,i,o),i++,o+=r.attribute.height})}),n.bottomFrozenGroup.forEachChildren(e=>{let i=n.table.rowCount-n.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,i,o),i++,o+=r.attribute.height})}),n.leftBottomCornerGroup.forEachChildren(e=>{let i=n.table.rowCount-n.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,i,o),i++,o+=r.attribute.height})}),n.rightBottomCornerGroup.forEachChildren(e=>{let i=n.table.rowCount-n.table.bottomFrozenRowCount,o=0;e==null||e.forEachChildren(r=>{t(r,i,o),i++,o+=r.attribute.height})})}function Z_(n,t){for(let e=0;e<t.table.colCount;e++){const i=new Kt({x:0,y:0,width:t.table.getColWidth(e),height:t.table.getRowHeight(n)});if(i.role="cell",i.col=e,i.row=n,i.needUpdate=!0,!i)continue;const o=t.getColGroup(e);if(o)if(o.firstChild&&n<o.firstChild.row)o.insertBefore(i,o.firstChild),o.firstChild.row=o.firstChild.row+1;else if(o.lastChild&&n>o.lastChild.row)o.appendChild(i);else{const r=t.highPerformanceGetCell(e,n,!0);r!==i&&(o.insertBefore(i,r),r&&(r.row=r.row+1),r!==o.lastChild&&o.lastChild&&(o.lastChild.row=o.lastChild.row+1))}}}function J_(n,t){for(let e=0;e<t.table.colCount;e++){const i=t.getColGroup(e,!1);if(!i)continue;let o;i.forEachChildren(r=>r.row===n&&(o=r,!0)),o&&(i.updateColumnHeight(-o.attribute.height),i.removeChild(o))}}function Kg(n,t,e){let i;for(let o=0;o<e.table.colCount;o++){const r=e.table.getCellRange(o,n);let s;r.start.row<=n+1&&r.end.row>=n+1&&(Sd(r,e),s=r.start.row);const l=e.table.getCellRange(o,t);l.start.row<=t+1&&l.end.row>=t+1&&(Sd(l,e),s=l.start.row),I(s)&&(i=I(i)?Math.min(i,s):s)}return i}function $g(n,t,e){let i;for(let o=0;o<e.table.colCount;o++){let r;const s=e.highPerformanceGetCell(o,n);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>n&&(Sd({start:{row:s.mergeStartRow,col:e.table.heightMode==="autoHeight"?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:e.table.heightMode==="autoHeight"?e.table.colCount-1:s.mergeEndCol}},e),r=s.mergeStartRow);const l=e.highPerformanceGetCell(o,t);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<t&&(Sd({start:{row:l.mergeStartRow,col:e.table.heightMode==="autoHeight"?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:e.table.heightMode==="autoHeight"?e.table.colCount-1:l.mergeEndCol}},e),r=l.mergeStartRow),I(r)&&(i=I(i)?Math.min(i,r):r)}return i}function Sd(n,t){const{start:e,end:i}=n;for(let o=e.col;o<=i.col;o++)for(let r=e.row;r<=i.row;r++){const s=t.highPerformanceGetCell(o,r,!0);s&&(s.needUpdate=!0)}}function xF(n,t){if(t.table.isHasSeriesNumber())for(let e=n;e<=t.table.rowCount-1;e++)co(0,e,t.table,!1)}function AF(n){const{internalProps:t}=n;t.bodyDomContainer=document.createElement("div"),t.bodyDomContainer.id="vtable-body-dom-container",t.bodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.bodyDomContainer),t.headerDomContainer=document.createElement("div"),t.headerDomContainer.id="vtable-header-dom-container",t.headerDomContainer.classList.add("table-component-container"),t.element.appendChild(t.headerDomContainer),t.frozenBodyDomContainer=document.createElement("div"),t.frozenBodyDomContainer.id="vtable-frozen-body-dom-container",t.frozenBodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenBodyDomContainer),t.frozenHeaderDomContainer=document.createElement("div"),t.frozenHeaderDomContainer.id="vtable-frozen-header-dom-container",t.frozenHeaderDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenHeaderDomContainer),t.rightFrozenBodyDomContainer=document.createElement("div"),t.rightFrozenBodyDomContainer.id="vtable-right-frozen-body-dom-container",t.rightFrozenBodyDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenBodyDomContainer),t.rightFrozenHeaderDomContainer=document.createElement("div"),t.rightFrozenHeaderDomContainer.id="vtable-right-frozen-header-dom-container",t.rightFrozenHeaderDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenHeaderDomContainer),t.frozenBottomDomContainer=document.createElement("div"),t.frozenBottomDomContainer.id="vtable-frozen-bottom-dom-container",t.frozenBottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.frozenBottomDomContainer),t.bottomDomContainer=document.createElement("div"),t.bottomDomContainer.id="vtable-bottom-dom-container",t.bottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.bottomDomContainer),t.rightFrozenBottomDomContainer=document.createElement("div"),t.rightFrozenBottomDomContainer.id="vtable-right-frozen-bottom-dom-container",t.rightFrozenBottomDomContainer.classList.add("table-component-container"),t.element.appendChild(t.rightFrozenBottomDomContainer)}function RF(n){const{headerDomContainer:t,bodyDomContainer:e,frozenBodyDomContainer:i,frozenHeaderDomContainer:o,rightFrozenBodyDomContainer:r,rightFrozenHeaderDomContainer:s,bottomDomContainer:l,frozenBottomDomContainer:a,rightFrozenBottomDomContainer:h}=n.internalProps;if(!(t||e||i||o||r||s||l||a||h))return;const d=n.getAllColsWidth(),u=Math.min(d,n.tableNoFrameWidth),c=n.getFrozenColsWidth(),g=n.getRightFrozenColsWidth(),f=c+g,p=Math.min(d-f,u-f),v=n.getAllRowsHeight(),m=Math.min(v,n.tableNoFrameHeight),b=n.getFrozenRowsHeight(),w=n.getBottomFrozenRowsHeight(),C=b+w,_=Math.min(v-C,m-C);n.frozenColCount>0?(t.style.left=`${n.tableX+c}px`,e.style.left=`${n.tableX+c}px`,l.style.left=`${n.tableX+c}px`):n.frozenColCount===0&&(t.style.left=`${n.tableX}px`,e.style.left=`${n.tableX}px`,l.style.left=`${n.tableX}px`),i.style.left=`${n.tableX}px`,o.style.left=`${n.tableX}px`,t.style.width=`${p}px`,t.style.height=`${b}px`,e.style.top=`${n.tableY}px`,e.style.width=`${p}px`,e.style.height=`${_}px`,e.style.top=`${n.tableY+b}px`,i.style.width=`${c}px`,i.style.height=`${_}px`,i.style.top=`${n.tableY+b}px`,o.style.width=`${c}px`,o.style.height=`${b}px`,o.style.top=`${n.tableY}px`,r.style.width=`${g}px`,r.style.height=`${_}px`,r.style.top=`${n.tableY+b}px`,r.style.left=n.tableX+u-g+"px",s.style.width=`${g}px`,s.style.height=`${b}px`,s.style.top=`${n.tableY}px`,s.style.left=n.tableX+u-g+"px",l.style.width=`${p}px`,l.style.height=`${w}px`,l.style.top=n.tableY+m-w+"px",a.style.width=`${c}px`,a.style.height=`${w}px`,a.style.top=n.tableY+m-w+"px",h.style.width=`${g}px`,h.style.height=`${w}px`,h.style.top=n.tableY+m-w+"px",h.style.left=n.tableX+u-g+"px"}function TF(n){if(!n.table.reactCustomLayout)return;const{table:t,stage:e}=n,i=e.pluginService.findPluginsByName("ReactAttributePlugin")[0],{htmlMap:o}=i;for(const r in o){const s=o[r],{graphic:l,wrapContainer:a}=s;let h;if(n.frozenColCount>t.frozenColCount){const{col:d,row:u}=il(l);u>=t.rowCount-t.bottomFrozenRowCount&&d<n.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenBottomDomContainer?h=t.bottomDomContainer:u>=t.frozenRowCount&&d<n.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenBodyDomContainer?h=t.bodyDomContainer:u<t.frozenRowCount&&d<n.frozenColCount&&d>=t.frozenColCount&&l.attribute.react.container===t.frozenHeaderDomContainer&&(h=t.headerDomContainer)}else if(n.frozenColCount<t.frozenColCount){const{col:d,row:u}=il(l);u>=t.rowCount-t.bottomFrozenRowCount&&d<t.frozenColCount&&d>=n.frozenColCount&&l.attribute.react.container===t.bottomDomContainer?h=t.frozenBottomDomContainer:u>=t.frozenRowCount&&d<t.frozenColCount&&d>=n.frozenColCount&&l.attribute.react.container===t.bodyDomContainer?h=t.frozenBodyDomContainer:u<t.frozenRowCount&&d<t.frozenColCount&&d>=n.frozenColCount&&l.attribute.react.container===t.headerDomContainer&&(h=t.frozenHeaderDomContainer)}h&&(h.appendChild(a),s.nativeContainer=h,s.container=h,l.attribute.react.container=h,i.updateStyleOfWrapContainer(l,e,a,h,l.attribute.react))}}function MF(n){var t,e;if(n.table.frozenColCount>n.table.rowHeaderLevelCount){n.rowHeaderGroup.setAttribute("height",n.bodyGroup.attribute.height),n.rowHeaderGroup.setAttribute("y",n.bodyGroup.attribute.y),n.cornerHeaderGroup.setAttribute("height",n.colHeaderGroup.attribute.height);for(let i=0;i<n.table.frozenColCount-n.table.rowHeaderLevelCount;i++)Q_(n),ty(n),ny(n)}else if(n.table.frozenColCount<n.table.rowHeaderLevelCount){n.bodyGroup.setAttribute("height",n.rowHeaderGroup.attribute.height),n.bodyGroup.setAttribute("y",n.rowHeaderGroup.attribute.y),n.colHeaderGroup.setAttribute("height",n.cornerHeaderGroup.attribute.height);for(let i=0;i<n.table.rowHeaderLevelCount-n.table.frozenColCount;i++)ey(n),iy(n),oy(n)}n.bodyGroup.setAttribute("x",n.rowHeaderGroup.attribute.width),n.colHeaderGroup.setAttribute("x",n.cornerHeaderGroup.attribute.width),n.updateContainer(),n.updateBorderSizeAndPosition(),n.isPivot||n.table.transpose?n.table.options.frozenColCount?n.component.setFrozenColumnShadow(n.table.frozenColCount-1):n.table.options.frozenColCount&&n.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount):(n.component.setFrozenColumnShadow(n.table.frozenColCount-1),n.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount)),n.hasFrozen=!0,n.frozenColCount=n.table.frozenColCount,n.frozenRowCount=(e=(t=n.colHeaderGroup.firstChild)===null||t===void 0?void 0:t.childrenCount)!==null&&e!==void 0?e:0}function BF(n){var t,e,i,o;if(n.frozenColCount>n.table.frozenColCount){n.bodyGroup.setAttribute("height",n.rowHeaderGroup.attribute.height),n.bodyGroup.setAttribute("y",n.rowHeaderGroup.attribute.y),n.colHeaderGroup.setAttribute("height",n.cornerHeaderGroup.attribute.height);for(let r=0;r<n.frozenColCount-n.table.frozenColCount;r++)ey(n),iy(n),oy(n)}else if(n.frozenColCount<n.table.frozenColCount){n.rowHeaderGroup.setAttribute("height",n.bodyGroup.attribute.height),n.rowHeaderGroup.setAttribute("y",n.bodyGroup.attribute.y),n.cornerHeaderGroup.setAttribute("height",n.colHeaderGroup.attribute.height);for(let r=0;r<n.table.frozenColCount-n.frozenColCount;r++)Q_(n),ty(n),ny(n)}TF(n),n.recreateAllSelectRangeComponents(),n.frozenColCount=n.table.frozenColCount,n.frozenRowCount=(e=(t=n.colHeaderGroup.firstChild)===null||t===void 0?void 0:t.childrenCount)!==null&&e!==void 0?e:0,n.proxy.colStart=(o=(i=n.bodyGroup.firstChild)===null||i===void 0?void 0:i.col)!==null&&o!==void 0?o:n.table.frozenColCount,n.bodyGroup.setAttribute("x",n.rowHeaderGroup.attribute.width),n.colHeaderGroup.setAttribute("x",n.cornerHeaderGroup.attribute.width),n.updateContainer(),n.updateBorderSizeAndPosition(),n.isPivot||n.table.transpose?n.table.options.frozenColCount?n.component.setFrozenColumnShadow(n.table.frozenColCount-1):n.table.options.rightFrozenColCount&&n.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount):(n.component.setFrozenColumnShadow(n.table.frozenColCount-1),n.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount)),n.hasFrozen=!0}function Q_(n){const t=n.bodyGroup.firstChild instanceof Kt?n.bodyGroup.firstChild:null;t&&(n.rowHeaderGroup.appendChild(t),n.rowHeaderGroup.setAttribute("width",n.rowHeaderGroup.attribute.width+t.attribute.width),n.bodyGroup.setAttribute("width",n.bodyGroup.attribute.width-t.attribute.width))}function ty(n){const t=n.colHeaderGroup.firstChild instanceof Kt?n.colHeaderGroup.firstChild:null;t&&(n.cornerHeaderGroup.appendChild(t),n.cornerHeaderGroup.setAttribute("width",n.cornerHeaderGroup.attribute.width+t.attribute.width),n.colHeaderGroup.setAttribute("width",n.colHeaderGroup.attribute.width-t.attribute.width))}function ey(n){var t;const e=n.rowHeaderGroup.lastChild instanceof Kt?n.rowHeaderGroup.lastChild:(t=n.rowHeaderGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(Gn(n.bodyGroup,e,n.bodyGroup.firstChild),n.bodyGroup.setAttribute("width",n.bodyGroup.attribute.width+e.attribute.width),n.rowHeaderGroup.setAttribute("width",n.rowHeaderGroup.attribute.width-e.attribute.width))}function iy(n){var t;const e=n.cornerHeaderGroup.lastChild instanceof Kt?n.cornerHeaderGroup.lastChild:(t=n.cornerHeaderGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(Gn(n.colHeaderGroup,e,n.colHeaderGroup.firstChild),n.colHeaderGroup.setAttribute("width",n.colHeaderGroup.attribute.width+e.attribute.width),n.cornerHeaderGroup.setAttribute("width",n.cornerHeaderGroup.attribute.width-e.attribute.width))}function ny(n){const t=n.bottomFrozenGroup.firstChild instanceof Kt?n.bottomFrozenGroup.firstChild:null;t&&(n.leftBottomCornerGroup.appendChild(t),n.leftBottomCornerGroup.setAttribute("width",n.leftBottomCornerGroup.attribute.width+t.attribute.width),n.bottomFrozenGroup.setAttribute("width",n.bottomFrozenGroup.attribute.width-t.attribute.width),n.table.isPivotChart()&&t.forEachChildren(e=>{e.setAttributes({stroke:!1,fill:!1})}))}function oy(n){var t;const e=n.leftBottomCornerGroup.lastChild instanceof Kt?n.leftBottomCornerGroup.lastChild:(t=n.leftBottomCornerGroup.lastChild)===null||t===void 0?void 0:t._prev;e&&(Gn(n.bottomFrozenGroup,e,n.bottomFrozenGroup.firstChild),n.bottomFrozenGroup.setAttribute("width",n.bottomFrozenGroup.attribute.width+e.attribute.width),n.leftBottomCornerGroup.setAttribute("width",n.leftBottomCornerGroup.attribute.width-e.attribute.width),n.table.isPivotChart()&&e.forEachChildren(i=>{var o,r,s,l;const a=n.table._getCellStyle(i.col,i.row),h=n.table.getCellRange(i.col,i.row),d=ho(a,n.table,h?h.start.col:i.col,h?h.start.row:i.row,lt).theme;i.setAttributes({fill:(r=(o=d==null?void 0:d.group)===null||o===void 0?void 0:o.fill)!==null&&r!==void 0?r:void 0,stroke:(l=(s=d==null?void 0:d.group)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:void 0})}))}function PF(n,t){const{table:e,proxy:i,rightTopCornerGroup:o,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=t,d=t.table.rightFrozenColCount;if(n>d){for(let c=e.colCount-d-1;c>=e.colCount-n;c--)Gn(r,t.getColGroup(c),r.firstChild),Gn(o,t.getColGroup(c,!0),o.firstChild),Gn(s,t.getColGroupInBottom(c),s.firstChild);let u=0;r.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,o.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,s.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width})}else if(n<d){for(let c=e.colCount-d;c<e.colCount-n;c++){const g=t.getColGroup(c);g.setAttribute("x",a.lastChild.attribute.x+e.getColWidth(a.lastChild.col)),a.appendChild(g);const f=t.getColGroupInRightTopCorner(c);f.setAttribute("x",h.lastChild.attribute.x+e.getColWidth(h.lastChild.col)),h.appendChild(f);const p=t.getColGroupInRightBottomCorner(c);p.setAttribute("x",l.lastChild.attribute.x+e.getColWidth(l.lastChild.col)),l.appendChild(p)}let u=0;r.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,o.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width}),u=0,s.forEachChildren(c=>{c.setAttribute("x",u),u+=c.attribute.width})}r.setAttribute("width",e.getColsWidth(e.colCount-n,e.colCount-1)),o.setAttribute("width",e.getColsWidth(e.colCount-n,e.colCount-1)),s.setAttribute("width",e.getColsWidth(e.colCount-n,e.colCount-1)),e.internalProps.rightFrozenColCount=n,t.updateContainer(),t.component.updateScrollBar(),t.updateNextFrame()}function HF(n,t){const{table:e,proxy:i,bottomFrozenGroup:o,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=t;o.childrenCount||(i.table.isPivotChart()||(je(r,0,0,0,e.frozenColCount-1,0,-1,"rowHeader",e),je(s,0,0,e.colCount-e.rightFrozenColCount,e.colCount-1,0,-1,"body",e)),je(o,0,0,i.colStart,i.colEnd,0,-1,"body",e));const l=t.table.bottomFrozenRowCount;if(n>l){for(let a=0;a<e.frozenColCount;a++){const h=t.getColGroupInLeftBottomCorner(a);for(let u=e.rowCount-l-1;u>=e.rowCount-n;u--)Gn(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}for(let a=i.colStart;a<=i.colEnd;a++){const h=t.getColGroupInBottom(a);for(let u=e.rowCount-l-1;u>=e.rowCount-n;u--)Gn(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}if(e.rightFrozenColCount>0)for(let a=e.colCount-e.rightFrozenColCount;a<e.colCount;a++){const h=t.getColGroupInRightBottomCorner(a);for(let u=e.rowCount-l-1;u>=e.rowCount-n;u--)Gn(h,t.getCell(a,u,!0),h.firstChild);let d=0;h.forEachChildren(u=>{u.setAttribute("y",d),d+=e.getRowHeight(u.row)})}}else if(n<l){for(let a=0;a<e.rowHeaderLevelCount;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-n;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInLeftBottomCorner(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}for(let a=i.colStart;a<=i.colEnd;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-n;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInBottom(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}if(e.rightFrozenColCount>0)for(let a=e.colCount-e.rightFrozenColCount;a<e.colCount;a++){const h=t.getColGroup(a);for(let c=e.rowCount-l;c<e.rowCount-n;c++){const g=t.getCell(a,c,!0);g.setAttribute("y",h.lastChild.attribute.y+e.getRowHeight(h.lastChild.row)),h.appendChild(g)}const d=t.getColGroupInRightBottomCorner(a);let u=0;d.forEachChildren(c=>{c.setAttribute("y",u),u+=e.getRowHeight(c.row)})}}o.setAttribute("height",e.getRowsHeight(e.rowCount-n,e.rowCount-1)),r.setAttribute("height",e.getRowsHeight(e.rowCount-n,e.rowCount-1)),s.setAttribute("height",e.getRowsHeight(e.rowCount-n,e.rowCount-1)),e.internalProps.bottomFrozenRowCount=n,t.updateContainer(),t.component.updateScrollBar(),t.updateNextFrame()}function Gn(n,t,e){t&&n&&(e?n.insertBefore(t,e):n.appendChild(t))}function EF(n,t){const{table:e}=n,i=e.internalProps.layoutMap,o=t===-1?"all":e.internalProps.columnResizeType;if(o==="column"){const r=n.getColGroup(t);if(r==null||r.forEachChildren(s=>{Ur(s,e.getColWidth(s.col),e.getRowHeight(s.row))}),e.widthMode==="adaptive"&&t<e.colCount-1){const s=n.getColGroup(t+1);s==null||s.forEachChildren(l=>{Ur(l,e.getColWidth(l.col),e.getRowHeight(l.row))})}}else{let r,s,l,a=e.rowHeaderLevelCount,h=e.colCount-1;if(o==="indicator")if(i.indicatorsAsCol)r=i.getIndicatorKey(t,e.columnHeaderLevelCount);else{const d=i.getCellHeaderPaths(t,e.columnHeaderLevelCount-1),u=d.colHeaderPaths[d.colHeaderPaths.length-1];s=u.dimensionKey,l=u.value}else if(o==="indicatorGroup"){const d=e.internalProps.layoutMap,u=d.getCellHeaderPaths(e.stateManager.columnResize.col,e.columnHeaderLevelCount),c=d.getHeadNodeByRowOrColDimensions(u.colHeaderPaths.slice(0,u.colHeaderPaths.length-1));a=c.startInTotal+e.frozenColCount,h=c.startInTotal+e.frozenColCount+c.size-1}for(let d=a;d<=h;d++){const u=n.getColGroup(d);if(u){if(o==="indicator"){const c=i.getIndicatorKey(d,e.columnHeaderLevelCount);if(i.indicatorsAsCol&&c!==r)continue;if(!i.indicatorsAsCol){const g=i.getCellHeaderPaths(d,e.columnHeaderLevelCount-1),f=g==null?void 0:g.colHeaderPaths[g.colHeaderPaths.length-1];if(!f||s!==f.dimensionKey||l!==f.value)continue}}u.forEachChildren(c=>{Ur(c,e.getColWidth(c.col),e.getRowHeight(c.row))})}}}}function LF(n,t){var e;const{table:i}=n,o=i.internalProps.layoutMap,r=i.stateManager,s=t===-1?"all":i.internalProps.rowResizeType;let l,a,h,d=i.columnHeaderLevelCount,u=i.rowCount-1;if(s==="indicator")if(o.indicatorsAsCol){const c=o.getCellHeaderPaths(i.rowHeaderLevelCount-1,t),g=(e=c.rowHeaderPaths)===null||e===void 0?void 0:e[c.rowHeaderPaths.length-1];a=g==null?void 0:g.dimensionKey,h=g==null?void 0:g.value}else l=o.getIndicatorKey(i.rowHeaderLevelCount,t);else if(s==="indicatorGroup"){const c=i.internalProps.layoutMap,g=c.getCellHeaderPaths(i.rowHeaderLevelCount,t),f=c.getHeadNodeByRowOrColDimensions(g.rowHeaderPaths.slice(0,g.rowHeaderPaths.length-1));d=f.startInTotal+i.frozenRowCount,u=f.startInTotal+i.frozenRowCount+f.size-1}for(let c=n.proxy.colStart;c<=n.proxy.colEnd;c++)if(s==="row"){const g=n.highPerformanceGetCell(c,t);if(g.role!=="cell")continue;if(Ur(g,i.getColWidth(g.col),i.getRowHeight(g.row)),i.heightMode==="adaptive"&&t<i.rowCount-1){const f=n.highPerformanceGetCell(c,t+1);Ur(f,i.getColWidth(f.col),i.getRowHeight(f.row))}}else for(let g=d;g<=u;g++){if(s==="indicator"){const p=o.getIndicatorKey(r.table.rowHeaderLevelCount,g);if(!o.indicatorsAsCol&&p!==l)continue;if(o.indicatorsAsCol){const v=o.getCellHeaderPaths(r.table.rowHeaderLevelCount-1,g),m=v==null?void 0:v.rowHeaderPaths[v.rowHeaderPaths.length-1];if(!m||a!==m.dimensionKey||h!==m.value)continue}}const f=n.highPerformanceGetCell(c,g);f.role==="cell"&&Ur(f,i.getColWidth(f.col),i.getRowHeight(f.row))}}function Yg(n){var t;for(let e=n.proxy.colStart;e<=n.proxy.colEnd;e++){const i=n.getColGroup(e);(t=i==null?void 0:i.getChildren())===null||t===void 0||t.forEach(o=>{o.children.forEach(r=>{r.type==="chart"&&(r.cacheCanvas=null,r.addUpdateBoundTag())})})}}function FF(n,t){const e=n.table;if(e.isPivotChart()){const i=e._selectedDataItemsInChart.length;if((t===null||(t==null?void 0:t.length)===0||Object.keys(t).length===0)&&i===0)return;const o=[];if(Array.isArray(t))t.forEach(r=>{if(r&&r.key!==0&&Object.keys(r).length>0){const s={};for(const l in r)l.startsWith("VGRAMMAR_")||l.startsWith("__VCHART")||(s[l]=r[l]);o.push(s)}});else if(t&&t.key!==0&&Object.keys(t).length>0){const r={};for(const s in t)s.startsWith("VGRAMMAR_")||s.startsWith("__VCHART")||(r[s]=t[s]);o.push(r)}es(e._selectedDataItemsInChart,o)||(e._selectedDataItemsInChart=o,e.internalProps.layoutMap.updateDataStateToChartInstance(),Yg(n),e.scenegraph.updateNextFrame())}}function Ur(n,t,e){n.forEachChildren(i=>{i.type==="chart"&&(i.cacheCanvas=null,i.setAttributes({width:Math.ceil(t-i.attribute.cellPadding[3]-i.attribute.cellPadding[1]),height:Math.ceil(e-i.attribute.cellPadding[0]-i.attribute.cellPadding[2])}))})}function kF(n){const t=n.table.tableNoFrameWidth,e=n.table.tableNoFrameHeight;n.tableGroup=new Kt({x:0,y:0,width:t,height:e,clip:!0,pickable:!1}),n.tableGroup.role="table";const i=Sn(0,0,!n.table.options.enableTreeStickCell);i.role="col-header",n.colHeaderGroup=i;const o=Sn(0,0,!n.table.options.enableTreeStickCell);o.role="corner-header",n.cornerHeaderGroup=o;const r=Sn(0,0,!0);r.role="row-header",n.rowHeaderGroup=r;const s=Sn(t,0,!0);s.role="body",n.bodyGroup=s;const l=Sn(0,0,!0);l.role="right-frozen",n.rightFrozenGroup=l;const a=Sn(0,0,!0);a.role="bottom-frozen",n.bottomFrozenGroup=a;const h=Sn(0,0);h.role="component",n.componentGroup=h;const d=Sn(0,0,!0);d.role="corner-right-top-header",n.rightTopCornerGroup=d;const u=Sn(0,0,!0);u.role="corner-right-bottom-header",n.rightBottomCornerGroup=u;const c=Sn(0,0,!0);c.role="corner-left-bottom-header",n.leftBottomCornerGroup=c,n.tableGroup.addChild(s),n.tableGroup.addChild(r),n.tableGroup.addChild(a),n.tableGroup.addChild(i),n.tableGroup.addChild(l),n.tableGroup.addChild(u),n.tableGroup.addChild(d),n.tableGroup.addChild(c),n.tableGroup.addChild(o),n.tableGroup.addChild(h)}function Sn(n,t,e){return new Kt({x:0,y:0,width:n,height:t,clip:e!=null&&e,pickable:!1})}function Un(n,t){return n.forEachChildrenSkipChild((e,i)=>{e.setAttribute("x",t),t+=e.attribute.width}),t}function IF(n,t,e){n!==-1&&t!==-1&&(un(n,t,i=>i.attribute.visibleTime==="mouseenter_cell",i=>{i.setAttribute("opacity",0);const o=i.parent.getChildByName("icon-back");o&&o.setAttribute("visible",!1)},e),e.updateNextFrame())}function zF(n,t,e){n!==-1&&t!==-1&&(un(n,t,i=>i.attribute.visibleTime==="mouseenter_cell",i=>{i.setAttribute("opacity",1)},e),e.updateNextFrame())}function DF(n,t,e){n!==-1&&t!==-1&&(un(n,t,i=>i.attribute.visibleTime==="click_cell",i=>{i.setAttribute("opacity",0)},e),e.updateNextFrame())}function OF(n,t,e){n!==-1&&t!==-1&&(un(n,t,i=>i.attribute.visibleTime==="click_cell",i=>{i.setAttribute("opacity",1)},e),e.updateNextFrame())}function WF(n,t,e,i,o){let r;return o.getCell(n,t).forEachChildren(s=>{s.role&&s.role.startsWith("icon")&&s.containsPoint(e,i,rs.GLOBAL)&&(r=s)}),r}function NF(n,t,e,i,o){var r,s;if((n.attribute.backgroundColor||n.attribute.hoverImage)&&un(t,e,l=>l.name===n.name,l=>{var a,h,d,u,c,g,f,p;if(l.attribute.backgroundColor){let v=l.parent.getChildByName("icon-back");v?v.setAttributes({x:((a=l.attribute.x)!==null&&a!==void 0?a:0)+(l.AABBBounds.width()-l.backgroundWidth)/2,y:((h=l.attribute.y)!==null&&h!==void 0?h:0)+(l.AABBBounds.height()-l.backgroundHeight)/2,dx:(d=l.attribute.dx)!==null&&d!==void 0?d:0,dy:(u=l.attribute.dy)!==null&&u!==void 0?u:0,width:l.backgroundWidth,height:l.backgroundHeight,fill:l.attribute.backgroundColor,cornerRadius:5,visible:!0}):(v=ve({x:((c=l.attribute.x)!==null&&c!==void 0?c:0)+(l.AABBBounds.width()-l.backgroundWidth)/2,y:((g=l.attribute.y)!==null&&g!==void 0?g:0)+(l.AABBBounds.height()-l.backgroundHeight)/2,dx:(f=l.attribute.dx)!==null&&f!==void 0?f:0,dy:(p=l.attribute.dy)!==null&&p!==void 0?p:0,width:l.backgroundWidth,height:l.backgroundHeight,fill:l.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),v.name="icon-back"),l.parent.insertBefore(v,l)}l.attribute.hoverImage&&l.attribute.image!==l.attribute.hoverImage&&(l.image=l.attribute.hoverImage)},o),n.tooltip){const{x1:l,x2:a,y1:h,y2:d}=n.globalAABBBounds,u={content:n.tooltip.title,referencePosition:{rect:{left:l,right:a,top:h,bottom:d,width:n.globalAABBBounds.width(),height:n.globalAABBBounds.height()},placement:n.tooltip.placement},disappearDelay:n.tooltip.disappearDelay,style:Object.assign({},(r=o.table.internalProps.theme)===null||r===void 0?void 0:r.tooltipStyle,(s=n.tooltip)===null||s===void 0?void 0:s.style)};o.table.internalProps.tooltipHandler.isBinded(u)||o.table.showTooltip(t,e,u)}}function VF(n,t,e,i){(n.attribute.backgroundColor||n.attribute.hoverImage)&&un(t,e,o=>o.name===n.name,o=>{const r=o.parent.getChildByName("icon-back");r&&r.setAttribute("visible",!1),o.attribute.hoverImage&&o.attribute.image!==o.attribute.originImage&&(o.image=o.attribute.originImage)},i)}function ry(n,t,e,i,o){const r=n.name;un(e,i,s=>s.name===r,s=>{ji(t,s),s.name=t.name},o),o.updateNextFrame()}function jF(n,t,e,i){const o=i.getCell(n,t);if(I(o.mergeStartCol)&&I(o.mergeStartRow)&&I(o.mergeEndCol)&&I(o.mergeEndRow))for(let r=o.mergeStartCol;r<=o.mergeEndCol;r++)for(let s=o.mergeStartRow;s<=o.mergeEndRow;s++){let l;i.getCell(r,s).forEachChildren(a=>a.attribute.funcType==="sort"&&(l=a,!0)),l&&(ji(e,l),l.name=e.name)}else{let r;cg(o,"children",s=>s.attribute.funcType==="sort"&&(r=s,!0)),r&&(ji(e,r),r.name=e.name)}}function GF(n,t,e,i,o){const r=o.getCellRange(n,t),s=o.getCellRange(e,i);return r.start.col===s.start.col&&r.start.row===s.start.row&&r.end.col===s.end.col&&r.end.row===s.end.row}function UF(n){const{col:t,row:e,iconMark:i,order:o,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:a}=n,h=a.table.internalProps.headerHelper.getSortIcon(o,a.table,t,e);if(i&&ry(i,h,t,e,a),!GF(t,e,r,s,a.table)){const d=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,s);l?ry(l,d,r,s,a):jF(r,s,d,a)}}function KF(n){for(let t=0;t<n.table.colCount;t++)for(let e=0;e<n.table.columnHeaderLevelCount;e++)un(t,e,i=>i.attribute.funcType==="frozen",i=>{const o=n.table.internalProps.headerHelper.getFrozenIcon(t,e);ji(o,i),i.name=o.name},n)}function $F(n,t,e){let i;i=e.table.isHeader(n,t)?e.table.internalProps.headerHelper.getHierarchyIcon(n,t):e.table.internalProps.bodyHelper.getHierarchyIcon(n,t),un(n,t,o=>o.attribute.funcType===Zt.collapse||o.attribute.funcType===Zt.expand,o=>{ji(i,o),o.name=i.name},e)}function Xg(n,t,e){n.forEachChildren(i=>{i.type==="group"?Xg(i,t,e):t(i)&&e(i)})}function un(n,t,e,i,o){const r=o.getCell(n,t);if(r.role==="cell"&&I(r.mergeStartCol)&&I(r.mergeStartRow)&&I(r.mergeEndCol)&&I(r.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=fo(r,o);for(let d=s;d<=l;d++)for(let u=a;u<=h;u++)Xg(o.highPerformanceGetCell(d,u),e,i)}else Xg(r,e,i)}function YF(n,t,e){un(n,t,i=>i.attribute.funcType===Zt.dropDown,i=>{i.oldVisibleTime=i.attribute.visibleTime,i.setAttribute("visibleTime","always"),i.setAttribute("opacity",1)},e)}function XF(n,t,e){un(n,t,i=>i.attribute.funcType===Zt.dropDown,i=>{i.oldVisibleTime&&i.setAttribute("visibleTime",i.oldVisibleTime),i.setAttribute("opacity",i.attribute.visibleTime==="always"?1:0)},e)}function qg(n,t){const{bgColor:e,borderColor:i,borderLineWidth:o,borderLineDash:r}=t,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:e};return s.stroke=Fg(i,void 0),s.lineWidth=o,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(i)&&(s.strokeArrayColor=kt(i)),Array.isArray(o)&&(s.strokeArrayWidth=kt(o),s.lineWidth=1),n.setAttributes(s),n.role="corner-frozen",n}function qF(n,t,e,i){const o=i.scenegraph,r=Zg(n.map(c=>c.col)).sort((c,g)=>g-c),s=Zg(t.map(c=>c.col)).sort((c,g)=>c-g),l=Zg(e.map(c=>c.col)).sort((c,g)=>c-g);r.forEach(c=>{ZF(c,o)});const a=i.colWidthsMap;let h;if(r.forEach(c=>{a.delAndReorder(c)}),r.length&&sy(o),o.table._clearColRangeWidthsMap(),s.forEach(c=>{const g=JF(c,o);sy(o),h=h??g,a.addAndReorder(c)}),QF(o),l.forEach(c=>{for(let g=0;g<i.rowCount;g++){const f=ke(o.table,c,g);if(f)for(let p=f.start.col;p<=f.end.col;p++)for(let v=f.start.col;v<=f.end.col;v++)co(v,g,o.table,!1);else co(c,g,o.table,!1)}}),nt(h)){for(let c=h;c<i.colCount;c++)for(let g=0;g<i.rowCount;g++){const f=o.highPerformanceGetCell(c,g,!0);f&&(f.needUpdate=!0)}o.proxy.colUpdatePos=h}if(s.length){if(!nt(h)){const c=Math.min(...s);o.proxy.colUpdatePos=c}o.proxy.colUpdateDirection="left",o.proxy.updateColGroups(2*o.proxy.screenColCount),u(),o.proxy.progress()}else r.length&&(o.proxy.updateColGroups(2*o.proxy.screenColCount),u(),o.proxy.progress());const d=i.getColsWidth(i.frozenColCount,i.colCount-1);function u(){if((s==null?void 0:s[(s==null?void 0:s.length)-1])>=i.colCount-i.rightFrozenColCount||(l==null?void 0:l[(l==null?void 0:l.length)-1])>=i.colCount-i.rightFrozenColCount||(r==null?void 0:r[0])>=i.colCount-i.rightFrozenColCount){for(let c=i.colCount-i.rightFrozenColCount;c<i.colCount;c++)for(let g=0;g<i.rowCount;g++){const f=o.highPerformanceGetCell(c,g,!0);f&&(f.needUpdate=!0)}o.proxy.updateRightFrozenCellGroups()}}o.updateContainerWidth(o.table.frozenColCount,d-o.bodyGroup.attribute.width)}function ZF(n,t){const e=t.proxy;if(n>=t.table.rowHeaderLevelCount&&!(n>=t.table.colCount-t.table.rightFrozenColCount)){const o=t.getColGroup(n,!1);o&&o.parent===t.bodyGroup&&t.bodyGroup.removeChild(o);const r=t.getColGroupInBottom(n);r&&r.parent===t.bottomFrozenGroup&&t.bottomFrozenGroup.removeChild(r)}n>=e.colStart&&n<=e.colEnd&&(e.colEnd--,e.currentCol--),e.bodyRightCol--;const i=Math.min(e.colLimit,e.bodyRightCol-e.bodyLeftCol+1);e.totalActualBodyColCount=i,e.totalCol=e.colStart+i-1}function JF(n,t){const e=t.proxy;e.bodyRightCol++;const i=Math.min(e.colLimit,e.bodyRightCol-e.bodyLeftCol+1);if(e.totalActualBodyColCount=i,e.totalCol=e.colStart+i-1,!(n<e.colStart))return n>e.colEnd?e.colEnd-e.colStart+1<e.colLimit?(e.colEnd++,e.currentCol++,ly(n,t),n):void 0:(e.colEnd-e.colStart+1<e.colLimit&&(e.colEnd++,e.currentCol++,ly(n,t)),n)}function Zg(n){const t=[];for(let e=0;e<n.length;e++)t.indexOf(n[e])===-1&&t.push(n[e]);return t}function sy(n){let t=n.bodyColStart;function e(i){i.col=t;const o=ke(n.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}n.bodyGroup.forEachChildren(i=>{i.col=t,i==null||i.forEachChildren(o=>{e(o)}),t++}),t=n.bodyColStart,n.colHeaderGroup.forEachChildren(i=>{i.col=t,i==null||i.forEachChildren(o=>{e(o)}),t++}),t=n.bodyColStart,n.bottomFrozenGroup.forEachChildren(i=>{i.col=t,i==null||i.forEachChildren(o=>{e(o)}),t++})}function QF(n){let t=n.bodyColStart,e=n.getCellGroupX(t);function i(o){o.col=t;const r=ke(n.table,o.col,o.row);r&&(o.mergeStartCol=r.start.col,o.mergeStartCol=r.start.col,o.mergeEndCol=r.end.col,o.mergeEndCol=r.end.col),o.role}n.bodyGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{i(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=n.bodyColStart,e=n.getCellGroupX(t),n.colHeaderGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{i(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=n.bodyColStart,e=n.getCellGroupX(t),n.bottomFrozenGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{i(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=n.table.colCount-n.table.rightFrozenColCount,e=0,n.rightFrozenGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{i(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=n.table.colCount-n.table.rightFrozenColCount,e=0,n.rightTopCornerGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{i(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++}),t=n.table.colCount-n.table.rightFrozenColCount,e=0,n.rightBottomCornerGroup.forEachChildren(o=>{o.col=t,o==null||o.forEachChildren(r=>{i(r)}),o.setAttribute("x",e),e+=o.attribute.width,t++})}function ly(n,t){if(t.colHeaderGroup&&t.table.columnHeaderLevelCount>0){const i=new Kt({x:0,y:0,width:t.table.getColWidth(n),height:0,clip:!1,pickable:!1});i.role="column",i.col=n;const o=t.getColGroup(n,!0);o?t.colHeaderGroup.insertBefore(i,o):t.colHeaderGroup.appendChild(i),e(i,n,0,t.table.columnHeaderLevelCount-1)}if(t.bodyGroup){const i=new Kt({x:0,y:0,width:t.table.getColWidth(n),height:0,clip:!1,pickable:!1});i.role="column",i.col=n;const o=t.getColGroup(n,!1);o?t.bodyGroup.insertBefore(i,o):t.bodyGroup.appendChild(i),e(i,n,t.bodyRowStart,t.bodyRowEnd)}if(t.bottomFrozenGroup&&t.table.bottomFrozenRowCount>0){const i=new Kt({x:0,y:0,width:t.table.getColWidth(n),height:0,clip:!1,pickable:!1});i.role="column",i.col=n;const o=t.getColGroupInBottom(n);o?t.bottomFrozenGroup.insertBefore(i,o):t.bottomFrozenGroup.appendChild(i),e(i,n,t.table.rowCount-t.table.bottomFrozenRowCount,t.table.rowCount-1)}function e(i,o,r,s){for(let l=r;l<=s;l++){const a=new Kt({x:0,y:0,width:t.table.getColWidth(o),height:t.table.getRowHeight(l)});a.role="cell",a.col=o,a.row=l,a.needUpdate=!0,i.appendChild(a)}}}function tk(n){var t,e,i,o;if(!n.options.animationAppear)return;let r,s,l,a;n.options.animationAppear===!0?(r=500,s=0,l="one-by-one",a="column"):(r=(t=n.options.animationAppear.duration)!==null&&t!==void 0?t:500,s=(e=n.options.animationAppear.delay)!==null&&e!==void 0?e:0,l=(i=n.options.animationAppear.type)!==null&&i!==void 0?i:"one-by-one",a=(o=n.options.animationAppear.direction)!==null&&o!==void 0?o:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:u}=n,{colStart:c,colEnd:g,rowStart:f,rowEnd:p}=h.proxy;for(let v=0;v<=g;v++)for(let m=0;m<=p;m++){const b=h.highPerformanceGetCell(v,m);b&&b.role==="cell"&&b.forEachChildren(w=>{w.setAttribute("opacity",0),w.animate().wait(l==="one-by-one"?(a==="row"?m:v)*(r-s):s).to({opacity:1},r,"linear")})}}function ek(n,t){const{selectedRangeComponents:e}=t;e.forEach((i,o)=>{i.rect.setAttributes(n)}),t.updateNextFrame()}XH(),Tt.load(UL),Tt.load(gL);class ik{constructor(t){let e,i;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,sP(this.table.theme.textPopTipStyle),t.options.canvas&&t.options.viewBox?(Ce.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,i=t.options.viewBox.y2-t.options.viewBox.y1):Wt.mode==="node"?(Ce.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(Ce.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=CT(Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:o=>{this.table.options.beforeRender&&this.table.options.beforeRender(o),this.table.animationManager.ticker.start()},afterRender:o=>{this.table.options.afterRender&&this.table.options.afterRender(o),this.table.fireListeners("after_render",null)},canvasControled:!t.options.canvas,viewBox:t.options.viewBox},t.options.renderOption)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.width)!==null&&e!==void 0?e:0}get height(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.height)!==null&&e!==void 0?e:0}get x(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.x)!==null&&e!==void 0?e:0}get y(){var t,e;return(e=(t=this.tableGroup.attribute)===null||t===void 0?void 0:t.y)!==null&&e!==void 0?e:0}get bodyRowStart(){var t;return(t=this.proxy.rowStart)!==null&&t!==void 0?t:0}get bodyRowEnd(){var t;return(t=this.proxy.rowEnd)!==null&&t!==void 0?t:this.table.rowCount-1}get bodyColStart(){var t;return(t=this.proxy.colStart)!==null&&t!==void 0?t:0}get bodyColEnd(){var t;return(t=this.proxy.colEnd)!==null&&t!==void 0?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),kF(this)}clearCells(){var t,e;this.table.animationManager.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach(i=>{i.deactivate(this.stage.pluginService)}),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),(t=this.proxy)===null||t===void 0||t.release(),(e=this.table.reactCustomLayout)===null||e===void 0||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new ML(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map,this.customSelectedRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(t=!1){t||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach(e=>{e.name==="poptipForText"&&this.stage.pluginService.register(e)}),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new fF(this.table),Nr(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(qg(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),qg(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),qg(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,r,s,l,a,h;let d;if(d=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?(o=this.rightTopCornerGroup.getColGroup(t))===null||o===void 0?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?(r=this.leftBottomCornerGroup.getColGroup(t))===null||r===void 0?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?(s=this.rightBottomCornerGroup.getColGroup(t))===null||s===void 0?void 0:s.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?(l=this.rightFrozenGroup.getColGroup(t))===null||l===void 0?void 0:l.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?(a=this.bottomFrozenGroup.getColGroup(t))===null||a===void 0?void 0:a.getRowGroup(e):(h=this.getColGroup(t,e<this.frozenRowCount))===null||h===void 0?void 0:h.getRowGroup(e),d&&d.role==="shadow-cell"&&!i){const u=this.table.getCellRange(t,e);u.start.col===t&&u.start.row===e||(d=this.getCell(u.start.col,u.start.row))}return d||_d}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t,e=!1){let i;return i=t<this.frozenColCount&&e?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):e&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!e&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):e?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),i||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=ke(this.table,t,e);let r=i.attribute.width,s=i.attribute.height;return o&&(r/=o.end.col-o.start.col+1,s/=o.end.row-o.start.row+1),{width:r,height:s}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i,o;(((e=(t=this.table.stateManager.select)===null||t===void 0?void 0:t.ranges)===null||e===void 0?void 0:e.length)>0||((o=(i=this.table.stateManager.select)===null||i===void 0?void 0:i.customSelectRanges)===null||o===void 0?void 0:o.length)>0)&&G_(this)}hideHoverIcon(t,e){IF(t,e,this)}showHoverIcon(t,e){zF(t,e,this)}hideClickIcon(t,e){DF(t,e,this)}showClickIcon(t,e){OF(t,e,this)}getIcon(t,e,i,o){return WF(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){NF(t,e,i,o,this)}updateSortIcon(t){const{col:e,row:i,iconMark:o,order:r,oldSortCol:s,oldSortRow:l,oldIconMark:a}=t;UF({col:e,row:i,iconMark:o,order:r,oldSortCol:s,oldSortRow:l,oldIconMark:a,scene:this})}updateFrozenIcon(t,e){KF(this)}updateHierarchyIcon(t,e){$F(t,e,this)}setIconNormalStyle(t,e,i){VF(t,e,i,this)}residentHoverIcon(t,e){YF(t,e,this)}resetResidentHoverIcon(t,e){XF(t,e,this)}deactivateChart(t,e){var i,o;if(t===-1||e===-1)return;const r=this.getCell(t,e);(o=(i=r==null?void 0:r.firstChild)===null||i===void 0?void 0:i.deactivate)===null||o===void 0||o.call(i)}activateChart(t,e){var i,o;if(t===-1||e===-1)return;const r=this.getCell(t,e);(o=(i=r==null?void 0:r.firstChild)===null||i===void 0?void 0:i.activate)===null||o===void 0||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,r,s,l){vF(this,t,e,i,o,r,s,l)}moveSelectingRangeComponentsToSelectedRangeComponents(){Y_(this)}deleteLastSelectedRangeComponents(){mF(this)}deleteAllSelectBorder(){X_(this),q_(this)}updateCellSelectBorder(t,e=!0){U_(this,t,e)}removeFillHandleFromSelectComponents(){bF(this)}recreateAllSelectRangeComponents(){X_(this),this.table.stateManager.select.ranges.forEach(t=>{U_(this,t),Y_(this)})}updateColWidth(t,e,i,o){SL(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){EF(this,t)}updateChartSizeForResizeRowHeight(t){LF(this,t)}updateChartState(t){this.table.isPivotChart()&&FF(this,t)}updateCheckboxCellState(t,e,i){var o,r;if(this.table.transpose)(o=this.bodyGroup.children)===null||o===void 0||o.forEach(s=>{var l;(l=s.getChildAt(e))===null||l===void 0||l.getChildren().forEach(a=>{a.name==="checkbox"&&a.setAttribute("checked",i)})});else{const s=this.getColGroup(t);(r=s==null?void 0:s.children)===null||r===void 0||r.forEach(l=>{l.getChildren().find(a=>{a.name==="checkbox"&&a.setAttribute("checked",i)})})}}updateHeaderCheckboxCellState(t,e,i){var o,r;this.table.transpose?(o=this.rowHeaderGroup.children)===null||o===void 0||o.forEach(s=>{s.getChildAt(e).getChildren().forEach(l=>{l.name==="checkbox"&&(i==="indeterminate"?(l.setAttribute("indeterminate",!0),l.setAttribute("checked",void 0)):(l.setAttribute("indeterminate",void 0),l.setAttribute("checked",i)))})}):(r=this.getColGroup(t,!0).children)===null||r===void 0||r.forEach(s=>{s.getChildren().find(l=>{l.name==="checkbox"&&(i==="indeterminate"?(l.setAttribute("indeterminate",!0),l.setAttribute("checked",void 0)):(l.setAttribute("indeterminate",void 0),l.setAttribute("checked",i)))})})}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=Gr(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;t.widthMode==="adaptive"||t.autoFillWidth||t.internalProps.transpose?Ui(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&Ui(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&Ui(this.table,t.rightFrozenColCount,t.colCount-1,!0),Ui(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,t.heightMode==="adaptive"||t.autoFillHeight?Gi(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&Gi(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&Gi(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),Gi(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),(this.table.widthMode==="adaptive"||this.table.autoFillWidth)&&(this.table.internalProps._widthResizedColMap.size===0?this.recalculateColWidths():this.dealWidthMode()),this.table.heightMode==="adaptive"?this.table.internalProps._heightResizedRowMap.size===0?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),(this.table.widthMode==="adaptive"||this.table.heightMode==="adaptive"||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o,r,s,l,a,h,d,u,c,g;if(this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border){const f=(t=this.tableGroup.border)===null||t===void 0?void 0:t.attribute;let p,v,m,b;f!=null&&f.strokeArrayWidth?(p=f.strokeArrayWidth?f.strokeArrayWidth[0]:(e=f.lineWidth)!==null&&e!==void 0?e:0,v=f.strokeArrayWidth?f.strokeArrayWidth[1]:(i=f.lineWidth)!==null&&i!==void 0?i:0,m=f.strokeArrayWidth?f.strokeArrayWidth[2]:(o=f.lineWidth)!==null&&o!==void 0?o:0,b=f.strokeArrayWidth?f.strokeArrayWidth[3]:(r=f.lineWidth)!==null&&r!==void 0?r:0):(p=(s=f==null?void 0:f.lineWidth)!==null&&s!==void 0?s:0,v=(l=f==null?void 0:f.lineWidth)!==null&&l!==void 0?l:0,m=(a=f==null?void 0:f.lineWidth)!==null&&a!==void 0?a:0,b=(h=f==null?void 0:f.lineWidth)!==null&&h!==void 0?h:0),this.tableGroup.border.type==="rect"?!((d=this.table.theme.frameStyle)===null||d===void 0)&&d.innerBorder?this.tableGroup.border.setAttributes({x:this.table.tableX+b/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-b/2-v/2,height:this.tableGroup.attribute.height-p/2-m/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-b/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+b/2+v/2,height:this.tableGroup.attribute.height+p/2+m/2}):this.tableGroup.border.type==="group"&&(!((u=this.table.theme.frameStyle)===null||u===void 0)&&u.innerBorder?(this.tableGroup.border.setAttributes({x:this.table.tableX+b/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-b/2-v/2,height:this.tableGroup.attribute.height-p/2-m/2}),(c=this.tableGroup.border.firstChild)===null||c===void 0||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-b/2-v/2,height:this.tableGroup.attribute.height-p/2-m/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-b/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+b/2+v/2,height:this.tableGroup.attribute.height+p/2+m/2}),(g=this.tableGroup.border.firstChild)===null||g===void 0||g.setAttributes({x:b/2,y:p/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height})))}this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){e=Math.round(e),c_(this,t,e,i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const r=t[o];if(r>=this.proxy.rowStart&&r<=this.proxy.rowEnd){const s=e[o];c_(this,r,Math.round(s),i),this._updateContainerHeight(r,s)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t,e=!1){this.table.scenegraph.proxy.setX(-t,e)}setY(t,e=!1){this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=(e=this.bodyGroup.firstChild)===null||e===void 0?void 0:e.firstChild,r=(i=this.bodyGroup.firstChild)===null||i===void 0?void 0:i.lastChild;t===0&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:r&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&r.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&r.attribute.y+r.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-r.attribute.y-r.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;t===0&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),bl(this.table),this.table.options.animationAppear&&tk(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if(t.widthMode==="adaptive"){t._clearColRangeWidthsMap();const s=t.tableNoFrameWidth;let l=0;for(let d=0;d<t.colCount;d++)(d<t.rowHeaderLevelCount||t.isPivotChart()&&d>=t.colCount-t.rightFrozenColCount)&&(l+=t.getColWidth(d));const a=t.rowHeaderLevelCount,h=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount;Cd(s-l,a,h,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const s=t.tableNoFrameWidth;let l=0,a=0;for(let h=0;h<t.colCount;h++){const d=t.getColWidth(h);(h<t.rowHeaderLevelCount||t.isPivotChart()&&h>=t.colCount-t.rightFrozenColCount)&&(l+=d),a+=d}if(a<s&&a>l){const h=t.rowHeaderLevelCount,d=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount;Cd(s-l,h,d,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild(s=>{e+=s.attribute.width}),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild(s=>{i+=s.attribute.width}),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild(s=>{o+=s.attribute.width}),this.rowHeaderGroup.setAttribute("width",o);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild(s=>{r+=s.attribute.width}),this.cornerHeaderGroup.setAttribute("width",r),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if(e.heightMode==="adaptive"){e._clearRowRangeHeightsMap();const i=e.getRowsHeight(0,e.columnHeaderLevelCount-1),o=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,r=e.tableNoFrameHeight-i-o,s=e.columnHeaderLevelCount,l=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let a=0;for(let d=s;d<l;d++)a+=e.getRowHeight(d);const h=r/a;for(let d=s;d<l;d++){let u;u=d===l-1?r-e.getRowsHeight(s,l-2):Math.round(e.getRowHeight(d)*h),this.setRowHeight(d,u)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,r=0;for(let s=0;s<e.rowCount;s++){const l=e.getRowHeight(s);(s<e.columnHeaderLevelCount||e.isPivotChart()&&s>=e.rowCount-e.bottomFrozenRowCount)&&(r+=l),o+=l}if(((t=this._dealAutoFillHeightOriginRowsHeight)!==null&&t!==void 0?t:o)<i&&o-r>0){const s=e.columnHeaderLevelCount,l=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,a=(i-r)/(o-r);for(let h=s;h<l;h++){let d;d=h===l-1?i-r-e.getRowsHeight(s,l-2):Math.round(e.getRowHeight(h)*a),this.setRowHeight(h,d)}}}}dealFrozen(){MF(this)}resetFrozen(){BF(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let r=!1;return t.forEachChildren((s,l)=>{l+=e;const a=ke(this.table,i,l);a?s=this.getCell(a.start.col,a.start.row):s.setAttribute("width",o);const h=this.table._getCellStyle(i,l),d=kt(lt("padding",h,i,l,this.table)),u=s.getChildByName("text");let c=0,g=0;if(u)c=u.AABBBounds.height()+(d[0]+d[2]),u.setAttribute("maxLineWidth",o-(d[1]+d[3])),g=u.AABBBounds.height()+(d[0]+d[2]);else{const p=s.getChildAt(1);c=p.AABBBounds.height()+(d[0]+d[2]),p._cellWidth=o-(d[1]+d[3]),p.layout(),g=p.AABBBounds.height()+(d[0]+d[2])}const f=this.table.getRowHeight(l);s.attribute.height!==g&&(s.setAttribute("height",g),(f===c||g>f)&&(r=!0))}),r}updateHeaderPosition(t,e,i,o,r){pF(t,e,i,o,r,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=Un(this.cornerHeaderGroup,0),r=Un(this.rowHeaderGroup,0),s=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?Un(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth((t=this.table.frozenColCount)!==null&&t!==void 0?t:0,this.colHeaderGroup.firstChild.col-1):0):0,l=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?Un(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth((e=this.table.frozenColCount)!==null&&e!==void 0?e:0,this.bodyGroup.firstChild.col-1):0):0,a=Un(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&Un(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth((i=this.table.frozenColCount)!==null&&i!==void 0?i:0,this.bottomFrozenGroup.firstChild.col-1):0),Un(this.leftBottomCornerGroup,0),Un(this.rightTopCornerGroup,0),Un(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(s-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(r-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(s-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(a-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(a-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(a-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(l-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(t=!1){t?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout(()=>{this.updateContainerSync()},0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){var i;const o=!((i=this.table.getCellRawRecord(t,e))===null||i===void 0)&&i.vtableMerge?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),r=this.getCell(t,e);o!=="image"&&o!=="video"||hl(r,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;Nr(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),Nr(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),Nr(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),Nr(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),Nr(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i,o=fC/2){let r;if(!i){const s=this.table.getDrawRange();return e>=s.top&&e<=s.bottom&&(r=this.table.getCellAtRelativePosition(t-o,e),r.col===this.table.colCount-1)?r:{col:-1,row:-1}}return i.stage?(t<i.globalAABBBounds.x1+o?r={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-o<t&&(r={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),r&&this.table.rightFrozenColCount>0&&r.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(r.col=r.col+1,r.rightFrozen=!0),r||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,i,o=G2/2){if(i){let r;if(e<i.globalAABBBounds.y1+o?r={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(r={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),r&&this.table.bottomFrozenRowCount>0&&r.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(r.row=r.row+1,r.bottomFrozen=!0),r)return r}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:PF(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:HF(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),ed(this.bodyGroup),this.rowHeaderGroup.attribute.width,b_(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),ed(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,b_(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),ed(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),ed(this.cornerHeaderGroup)),BL(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const r=this.getCell(t,e).getChildByName("text",!0);if(r&&r.type==="text"){if(r.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const s=it(r.attribute.text)?r.attribute.text.join(""):r.attribute.text;let l="";if(Qt(r.cache.clipedText)?l=r.cache.clipedText:(o=(i=r.cache.layoutData)===null||i===void 0?void 0:i.lines)===null||o===void 0||o.forEach(a=>{l+=a.str}),l!==s)return this.table.getCellValue(t,e)}else if(r&&r.type==="richtext"){const s=r;if(s.attribute.ellipsis&&s._frameCache&&s.attribute.height<s._frameCache.actualHeight)return s.attribute.textConfig.find(l=>l.text),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,r){this.component.drillIcon.update(t,e,i,o,r,this)}updateCellContent(t,e){if(!this.clear)return co(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e,i=[],o=!0){this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const r=Xs(e.map(a=>a.row)).sort((a,h)=>a-h),s=Xs(i.map(a=>a.row)).sort((a,h)=>a-h),l=this.table.getAllRowsHeight()-[...r,...s].reduce((a,h)=>a+this.table.getRowHeight(h),0)<=this.table.tableNoFrameHeight;if(CF(t,e,i,this.table),o&&this.recalculateColWidths(),this.table.heightMode==="adaptive"||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||l))this.table.scenegraph.recalculateRowHeights();else if(this.table.heightMode==="autoHeight")for(let a=0;a<s.length;a++){const h=s[a],d=this.table.getRowHeight(h),u=dn(h,0,this.table.colCount-1,this.table);(h>=this.proxy.rowStart&&h<=this.proxy.rowEnd||h>=this.table.rowCount-this.table.bottomFrozenRowCount&&h<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(h,u-d)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e,i=[]){qF(t,e,i,this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){RF(this.table)}setLoadingHierarchyState(t,e){const i=this.getCell(t,e).getChildByName("collapse",!0);if(i){const o=an()[ui.loadingIconName];ji(o,i,t,e)}}temporarilyUpdateSelectRectStyle(t){ek(t,this)}resetSelectRectStyle(){this.recreateAllSelectRangeComponents()}}function nk(n,t,e){for(let i=0;i<e.length;i++){const o=e[i];if(Ti(o,n,t))return!0}return!1}function ok(n,t,e,i){for(let o=0;o<e.length;o++){const r=e[o];if(w2(r,{start:n,end:t}))return!0}return!1}function Kr(n,t,e){const i=n.highPerformanceGetCell(t,e);if(i.role==="cell"&&I(i.mergeStartCol)&&I(i.mergeStartRow)&&I(i.mergeEndCol)&&I(i.mergeEndRow)){const{colStart:o,colEnd:r,rowStart:s,rowEnd:l}=fo(i,n);for(let a=o;a<=r;a++)for(let h=s;h<=l;h++)n.highPerformanceGetCell(a,h).addUpdateBoundTag()}else i.addUpdateBoundTag()}function ay(n,t,e,i,o){const r=n.table;for(let l=0;l<r.columnHeaderLevelCount;l++)Kr(n,t,l);const s=n.getColGroup(t);return s==null||s.addUpdateBoundTag(),!0}function hy(n,t,e,i,o,r){const s=n.table;for(let a=0;a<s.columnHeaderLevelCount;a++)Kr(n,t,a);const l=n.getColGroup(t);return l==null||l.addUpdateBoundTag(),!0}function dy(n,t,e,i,o){const r=n.table;for(let s=0;s<r.colCount;s++)Kr(n,s,e);return!0}function uy(n,t,e,i,o,r){const s=n.table;for(let l=0;l<s.colCount;l++)Kr(n,l,e);return!0}function rk(n,t,e,i,o){return Kr(n,t,e),!0}function sk(n,t,e,i,o){return Kr(n,t,e),!0}function lk(n,t,e){const{table:i}=n,{scenegraph:o}=i,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=n.hover,d=a.col,u=a.row;if(r===Nt.none||l&&(h.col!==t||h.row!==e)){const p=h.col,v=h.row;o.hideHoverIcon(p,v),o.showHoverIcon(t,e),h.col=t,h.row=e}if((l&&i.isHeader(t,e)||r===Nt.none)&&(t=-1,e=-1),d===t&&u===e)return;o.deactivateChart(d,u),o.activateChart(t,e);let c=!1;const{ranges:g,highlightScope:f}=n.select;if(d!==-1&&u!==-1&&(c=ak(o,d,u,g,s,r),l||o.hideHoverIcon(d,u)),t===-1||e===-1)return a.col=-1,a.row=-1,void(!c||d===t&&u===e||n.table.scenegraph.updateNextFrame());r===Nt.single?c=!!sk(o,t,e):r===Nt.row?c=!!uy(o,t,e):r===Nt.column?c=!!hy(o,t):r===Nt.cross&&(c=!!uy(o,t,e),c=!!hy(o,t)),r===Nt.none||l||o.showHoverIcon(t,e),a.col=t,a.row=e,c&&n.table.scenegraph.updateNextFrame()}function ak(n,t,e,i,o,r,s){let l=!1;return r===Nt.single?l=!!rk(n,t,e):r===Nt.row?l=!!dy(n,t,e):r===Nt.column?l=!!ay(n,t):r===Nt.cross&&(l=!!dy(n,t,e),l=!!ay(n,t)),l}function hk(n,t,e){e.frozenColCount>0?n!==e.frozenColCount-1?e.setFrozenColCount(n+1):e.setFrozenColCount(0):e.setFrozenColCount(n+1)}function dk(n,t,e,i){var o;let r,s=null,l=!1;if(Array.isArray(e.sortState))for(let c=0;c<e.sortState.length&&(r=e.sortState[c],r&&(s=e._getHeaderCellBySortState(r)),s&&(l=cy(n,t,s.col,s.row,e)),!l);c++);else r=e.sortState,r&&(s=e._getHeaderCellBySortState(r)),s&&(l=cy(n,t,s.col,s.row,e));const a=e.getHeaderDefine(n,t);if(r&&l&&(a!=null&&a.sort)?r.order=r.order==="asc"?"desc":r.order==="desc"?"normal":"asc":a!=null&&a.sort?r={field:e.getHeaderField(n,t),order:"asc"}:l&&(a!=null&&a.showSort)||(r={field:e.getHeaderField(n,t),order:"normal"}),r.event=i,e.fireListeners(J.SORT_CLICK,r).includes(!1))return;let h=!1,d=e.internalProps.sortState?Array.isArray(e.internalProps.sortState)&&(h=!0)?e.internalProps.sortState:[e.internalProps.sortState]:[];if(Array.isArray(d)){const c=d.findIndex(g=>g.field===r.field);c>=0?d[c]=r:d.push(r)}d=d.filter(c=>c.order!=="normal"),d=e.internalProps.multipleSort&&(h=!0)?d:d.splice(-1),d=h&&d.length?d:d[0],e.internalProps.sortState=d,e.stateManager.setSortState(d),a!=null&&a.sort&&uk(d,e),e.internalProps.useOneRowHeightFillAll=!1,e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.sortCell();const u=!!(!((o=e.stateManager.select.ranges)===null||o===void 0)&&o.length);e.stateManager.updateSelectPos(-1,-1),e.stateManager.endSelectCells(!0,u)}function uk(n,t,e){n=Array.isArray(n)||!n?n:[n],t.dataSource.sort((n||[]).map(i=>{var o,r;const s=t.internalProps.layoutMap.headerObjects.find(l=>l&&l.field===i.field);return{field:i.field,order:i.order||"asc",orderFn:typeof((o=s==null?void 0:s.define)===null||o===void 0?void 0:o.sort)=="function"?(r=s==null?void 0:s.define)===null||r===void 0?void 0:r.sort:d2}}))}function cy(n,t,e,i,o){return o._getLayoutCellId(n,t)===o._getLayoutCellId(e,i)}function ck(n,t,e,i,o,r,s=!1,l=!1,a=!1){var h,d;const{table:u,interactionState:c}=n,{scenegraph:g}=u,{highlightScope:f,disableHeader:p,cellPos:v}=n.select;if((p&&u.isHeader(t,e)||f==="none")&&a===!1&&(t===-1||e===-1||s||u._makeVisibleCell(t,e),t=-1,e=-1),t!==-1&&e!==-1&&!s)if(c===Rt.grabing&&n.select.ranges.length>0){const m=n.select.ranges[n.select.ranges.length-1];t>m.start.col&&t>m.end.col&&u._makeVisibleCell(t+1,e),e>m.start.row&&e>m.end.row&&u._makeVisibleCell(t,e+1),t<m.start.col&&t<m.end.col&&u._makeVisibleCell(t-1,e),e<m.start.row&&e<m.end.row&&u._makeVisibleCell(t,e-1)}else u._makeVisibleCell(t,e);if(r){n.select.ranges=[],g.deleteAllSelectBorder();let m=0,b=0;const{disableHeaderSelect:w,disableRowSeriesNumberSelect:C}=((h=u.options.keyboardOptions)===null||h===void 0?void 0:h.selectAllOnCtrlA)||{};w&&(m=u.rowHeaderLevelCount,b=u.columnHeaderLevelCount),(C||w&&u.transpose)&&u.options.rowSeriesNumber&&(m+=1),n.select.ranges.push({start:{col:m,row:b},end:{col:u.colCount-1,row:u.rowCount-1}});const _=n.select.ranges[n.select.ranges.length-1];g.updateCellSelectBorder(_,!1)}else if(v.col===-1||v.row===-1||t!==-1&&e!==-1)if(c!==Rt.default||u.eventManager.isDraging||u.stateManager.isResizeCol()){if((c===Rt.grabing||u.eventManager.isDraging)&&!u.stateManager.isResizeCol()){let m=!0;v.col===-1&&(v.col=t),v.row===-1&&(v.row=e),v.col=t,v.row=e;const b=n.select.ranges[n.select.ranges.length-1];if(b){if(u.internalProps.layoutMap.isSeriesNumberInBody(b.start.col,b.start.row))m=!1,b.end={col:u.colCount-1,row:e};else if(n.fillHandle.isFilling){if(n.fillHandle.direction==="top")if(e===n.fillHandle.beforeFillMinRow&&e===n.fillHandle.beforeFillMaxRow)b.start.row=b.end.row=e;else if(e<=n.fillHandle.beforeFillMinRow){if(b.start.row<b.end.row){const w=b.start.row;b.start.row=b.end.row,b.end.row=w}b.end.row=e}else e===n.fillHandle.beforeFillMaxRow&&(b.start.row>b.end.row?b.start.row=e:b.end.row=e);else if(n.fillHandle.direction==="bottom"){if(e>=n.fillHandle.beforeFillMaxRow){if(b.start.row>b.end.row){const w=b.start.row;b.start.row=b.end.row,b.end.row=w}b.end.row=e}}else if(n.fillHandle.direction==="left")if(t===n.fillHandle.beforeFillMinCol&&t===n.fillHandle.beforeFillMaxCol)b.start.col=b.end.col=t;else if(t<=n.fillHandle.beforeFillMinCol){if(b.start.col<b.end.col){const w=b.start.col;b.start.col=b.end.col,b.end.col=w}b.end.col=t}else t===n.fillHandle.beforeFillMaxCol&&(b.start.col>b.end.col?b.start.col=t:b.end.col=t);else if(n.fillHandle.direction==="right"&&t>=n.fillHandle.beforeFillMaxCol){if(b.start.col>b.end.col){const w=b.start.col;b.start.col=b.end.col,b.end.col=w}b.end.col=t}}else{b.end={col:t,row:e};const w=l?{start:{col:t,row:e},end:{col:t,row:e}}:u.getCellRange(t,e);b.start.col<w.end.col?b.end.col=w.end.col:b.start.col>w.start.col&&(b.end.col=w.start.col),b.start.row<w.end.row?b.end.row=w.end.row:b.start.row>w.start.row&&(b.end.row=w.start.row),n.select.headerSelectMode==="body"&&(u.isRowHeader(t,e)?(b.start.col=u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,b.end.col=u.colCount-1):u.isColumnHeader(t,e)?(b.start.row=u.columnHeaderLevelCount,b.end.row=u.rowCount-1):u.internalProps.layoutMap.isSeriesNumberInBody(t,e)?(b.start.col=u.leftRowSeriesNumberCount,b.end.col=u.colCount-1):u.isCornerHeader(t,e)?(b.start.col=u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,b.start.row=u.columnHeaderLevelCount,b.end.col=u.colCount-1,b.end.row=u.rowCount-1):u.isSeriesNumber(t,e)&&(b.start.col=u.leftRowSeriesNumberCount,b.start.row=u.columnHeaderLevelCount,b.end.col=u.colCount-1,b.end.row=u.rowCount-1)),l&&(b.skipBodyMerge=!0)}g.updateCellSelectBorder(b,m)}}}else{const m=n.select.ranges[n.select.ranges.length-1];if(i&&m){if(o||(v.col=t,v.row=e),n.select.headerSelectMode!=="cell"&&u.isColumnHeader(t,e)){const b=Math.min(m.start.col,m.end.col,t),w=Math.max(m.start.col,m.end.col,t),C=Math.min(m.start.row,m.end.row,e),_=u.rowCount-1;n.select.headerSelectMode==="body"?(m.start={col:b,row:u.columnHeaderLevelCount},m.end={col:w,row:u.rowCount-1}):(m.start={col:b,row:C},m.end={col:w,row:_})}else if(n.select.headerSelectMode!=="cell"&&u.isRowHeader(t,e)){const b=Math.min(m.start.col,m.end.col,t),w=u.colCount-1,C=Math.min(m.start.row,m.end.row,e),_=Math.max(m.start.row,m.end.row,e);n.select.headerSelectMode==="body"?(m.start={col:u.leftRowSeriesNumberCount+u.rowHeaderLevelCount,row:C},m.end={col:u.colCount-1,row:_}):(m.start={col:b,row:C},m.end={col:w,row:_})}else if(n.select.headerSelectMode!=="cell"&&u.isSeriesNumberInBody(t,e)){const b=Math.min(m.start.col,m.end.col,t),w=u.colCount-1,C=Math.min(m.start.row,m.end.row,e),_=Math.max(m.start.row,m.end.row,e);n.select.headerSelectMode==="body"?(m.start={col:u.leftRowSeriesNumberCount,row:C},m.end={col:u.colCount-1,row:_}):(m.start={col:b,row:C},m.end={col:w,row:_})}else m.end={col:t,row:e};g.deleteLastSelectedRangeComponents(),g.updateCellSelectBorder(m)}else{let b=!0;if(v.col===-1||v.row===-1||o||(n.select.ranges=[],g.deleteAllSelectBorder()),n.select.headerSelectMode!=="cell"&&u.isColumnHeader(t,e)){const C=u.getCellRange(t,e);n.select.headerSelectMode==="body"?n.select.ranges.push({start:{col:C.start.col,row:u.columnHeaderLevelCount},end:{col:C.end.col,row:u.rowCount-1},skipBodyMerge:!0}):n.select.ranges.push({start:{col:C.start.col,row:e},end:{col:C.end.col,row:u.rowCount-1},skipBodyMerge:!0})}else if(n.select.headerSelectMode!=="cell"&&u.isRowHeader(t,e)){const C=u.getCellRange(t,e);n.select.headerSelectMode==="body"?n.select.ranges.push({start:{col:u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,row:C.start.row},end:{col:u.colCount-1,row:C.end.row},skipBodyMerge:!0}):n.select.ranges.push({start:{col:t,row:C.start.row},end:{col:u.colCount-1,row:C.end.row},skipBodyMerge:!0})}else if(u.internalProps.layoutMap.isSeriesNumberInHeader(t,e))b=!1,n.select.headerSelectMode==="body"?n.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:u.columnHeaderLevelCount},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0}):n.select.ranges.push({start:{col:0,row:0},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0});else if(u.internalProps.layoutMap.isSeriesNumberInBody(t,e))b=!1,n.select.headerSelectMode==="body"?n.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:e},end:{col:u.colCount-1,row:e},skipBodyMerge:!0}):n.select.ranges.push({start:{col:t,row:e},end:{col:u.colCount-1,row:e},skipBodyMerge:!0});else if(u.internalProps.layoutMap.isCornerHeader(t,e))b=!1,n.select.headerSelectMode==="body"?n.select.ranges.push({start:{col:u.rowHeaderLevelCount+u.leftRowSeriesNumberCount,row:u.columnHeaderLevelCount},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0}):n.select.ranges.push({start:{col:u.leftRowSeriesNumberCount,row:0},end:{col:u.colCount-1,row:u.rowCount-1},skipBodyMerge:!0});else if(t>=0&&e>=0){const C=l?{start:{col:t,row:e},end:{col:t,row:e}}:u.getCellRange(t,e);n.select.ranges.push({start:{col:C.start.col,row:C.start.row},end:{col:C.end.col,row:C.end.row},skipBodyMerge:l||void 0})}v.col=t,v.row=e;const w=(d=n.select.ranges)===null||d===void 0?void 0:d[n.select.ranges.length-1];w&&g.updateCellSelectBorder(w,b)}}else v.col=-1,v.row=-1,n.select.ranges=[],g.deleteAllSelectBorder();g.updateNextFrame()}function gk(n){n.moveSelectingRangeComponentsToSelectedRangeComponents()}const po=qs(J,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});qs(J,{VCHART_EVENT_TYPE:"vchart_event_type"});function fk(n,t,e,i,o){const r=o.getCellLocation(n,t);let s=0,l=0,a=!1;r==="columnHeader"?(s=o.getColsWidth(0,o.rowHeaderLevelCount-1)-(o.frozenColCount===0?o.scrollLeft:0),l=o.getRowsHeight(0,t-1)+o.getRowHeight(t)/2,a=!0):r==="rowHeader"&&(l=o.getRowsHeight(0,o.columnHeaderLevelCount-1),s=o.getColsWidth(0,n-1)+o.getColWidth(n)/2,a=!0),o.scenegraph.updateDrill(a,s,l,e,i)}function pk(n,t,e){const i=e.scenegraph.getCell(n,t).getChildByName("sparkline"),o=i==null?void 0:i.getChildByName("highlight-line"),r=i==null?void 0:i.getChildByName("highlight-symbol");o&&o.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),e.scenegraph.updateNextFrame()}function vk(n,t,e,i,o){var r,s;const l=o.scenegraph.getCell(n,t).getChildByName("sparkline"),a=l==null?void 0:l.getChildByName("sparkline-line"),h=l==null?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,u=a.min,c=a.max,g=a.attribute.points;let f;e-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let p=0;p<g.length;p++){const{x:v,y:m,defined:b,rawData:w}=g[p];if(Math.abs(e-v)<d/2&&(f={point:g[p],points:g,pointsBandWidth:d,pointData:w},b)){const C=l.getChildByName("highlight-line");if(C)C.setAttributes({points:[{x:v,y:c},{x:v,y:u}],visible:!0,pickable:!0});else{const y=Si({points:[{x:v,y:c},{x:v,y:u}],lineWidth:(r=a.hover)===null||r===void 0?void 0:r.strokeWidth,stroke:(s=a.hover)===null||s===void 0?void 0:s.stroke});y.name="highlight-line",l.addChild(y)}const _=l.getChildByName("highlight-symbol");if(_)_.setAttributes({x:v,y:m,visible:!0,pickable:!0});else{const y=Ms({x:v,y:m,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});y.name="highlight-symbol",l.addChild(y)}break}}if(o.scenegraph.updateNextFrame(),f){const p={col:n,row:t,field:o.getHeaderField(n,t),value:o.getCellValue(n,t),dataValue:o.getCellOriginValue(n,t),cellHeaderPaths:o.internalProps.layoutMap.getCellHeaderPaths(n,t),title:o.getBodyColumnDefine(n,t).title,cellRange:o.getCellRelativeRect(n,t),sparkline:{pointData:f.pointData},scaleRatio:o.canvas.getBoundingClientRect().width/o.canvas.offsetWidth};o.fireListeners(J.MOUSEOVER_CHART_SYMBOL,p)}return!0}function mk(n,t,e){const i=e.getCellRange(n.col,n.row);if(e.isColumnHeader(n.col,n.row)){const o=e.getCellRange(t.col,i.start.row);t.row>=e.columnHeaderLevelCount&&(t.row=e.columnHeaderLevelCount-1),t.col>=n.col?t.col=o.end.col:t.col=o.start.col}else if(e.isRowHeader(n.col,n.row)){const o=e.internalProps.layoutMap,r=e.getCellRange(i.start.col,t.row);if(t.col>=e.rowHeaderLevelCount+o.leftRowSeriesNumberColumnCount&&(t.col=e.rowHeaderLevelCount+o.leftRowSeriesNumberColumnCount-1),o.rowHierarchyType==="tree"){const s=o.getCellHeaderPathsWithTreeNode(n.col,n.row).rowHeaderPaths,l=o.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths;if(s.length<=l.length){const a=l[s.length-1];a&&(t.row>=n.row?t.row=a.startInTotal+a.size-1+e.columnHeaderLevelCount:t.row=a.startInTotal+e.columnHeaderLevelCount)}}else t.row>=n.row?t.row=r.end.row:t.row=r.start.row}return t}function bk(n,t,e,i,o,r){var s;if(!("canMoveHeaderPosition"in o.table.internalProps.layoutMap))return;o.columnMove.moving=!0,o.columnMove.colSource=n,o.columnMove.rowSource=t,o.columnMove.x=e-o.table.tableX,o.columnMove.y=i-o.table.tableY;const l=o.table.getCellLocation(n,t),a=l==="columnHeader"?o.columnMove.x:l==="rowHeader"||o.table.internalProps.layoutMap.isSeriesNumberInBody(n,t)?o.columnMove.y:0,{backX:h,lineX:d,backY:u,lineY:c}=o.table.scenegraph.component.showMoveCol(n,t,a);o.table.fireListeners(J.CHANGE_HEADER_POSITION_START,{col:n,row:t,x:e,y:i,backX:h,lineX:d,backY:u,lineY:c,event:r});const g=!!(!((s=o.select.ranges)===null||s===void 0)&&s.length);o.table.stateManager.updateSelectPos(-1,-1),o.table.stateManager.endSelectCells(!0,g),o.table.scenegraph.updateNextFrame()}function Ck(n,t,e,i,o,r){if(!("canMoveHeaderPosition"in o.table.internalProps.layoutMap))return;const s=mk({col:o.columnMove.colSource,row:o.columnMove.rowSource},{col:n,row:t},o.table);if(o.table.internalProps.layoutMap.canMoveHeaderPosition({col:o.columnMove.colSource,row:o.columnMove.rowSource},{col:s.col,row:s.row})){let l,a,h,d;o.columnMove.x=e-o.table.tableX,o.columnMove.y=i-o.table.tableY,o.columnMove.colTarget=s.col,o.columnMove.rowTarget=s.row,o.updateCursor("grabbing");const u=o.table.getCellLocation(o.columnMove.colSource,o.columnMove.rowSource);u==="columnHeader"?(a=o.columnMove.x,l=o.table.isLeftFrozenColumn(n)?o.columnMove.colTarget>=o.columnMove.colSource?o.table.getColsWidth(0,o.columnMove.colTarget):o.table.getColsWidth(0,o.columnMove.colTarget-1):o.table.isRightFrozenColumn(n)?o.table.tableNoFrameWidth-o.table.getColsWidth(s.col+1,o.table.colCount-1):(o.columnMove.colTarget>=o.columnMove.colSource?o.table.getColsWidth(0,o.columnMove.colTarget):o.table.getColsWidth(0,o.columnMove.colTarget-1))-o.table.stateManager.scroll.horizontalBarPos):(u==="rowHeader"||o.table.internalProps.layoutMap.isSeriesNumberInBody(n,t))&&(d=o.columnMove.y,h=o.table.isFrozenRow(t)?o.columnMove.rowTarget>=o.columnMove.rowSource?o.table.getRowsHeight(0,o.columnMove.rowTarget):o.table.getRowsHeight(0,o.columnMove.rowTarget-1):o.table.isBottomFrozenRow(t)?o.table.tableNoFrameHeight-o.table.getRowsHeight(s.row+1,o.table.rowCount-1):(o.columnMove.rowTarget>=o.columnMove.rowSource?o.table.getRowsHeight(0,o.columnMove.rowTarget):o.table.getRowsHeight(0,o.columnMove.rowTarget-1))-o.table.stateManager.scroll.verticalBarPos),o.table.scenegraph.component.updateMoveCol(a,l,d,h),o.table.fireListeners(J.CHANGING_HEADER_POSITION,{col:n,row:t,x:e,y:i,backX:a,lineX:l,backY:d,lineY:h,event:r}),o.table.scenegraph.updateNextFrame()}else o.updateCursor("not-allowed"),o.columnMove.colTarget=o.columnMove.colSource,o.columnMove.rowTarget=o.columnMove.rowSource}function _k(n){var t,e;let i=!1;if("canMoveHeaderPosition"in n.table.internalProps.layoutMap&&n.columnMove.moving&&n.columnMove.colSource>=0&&n.columnMove.rowSource>=0&&n.columnMove.colTarget>=0&&n.columnMove.rowTarget>=0&&((t=n.table.options.customConfig)===null||t===void 0?void 0:t.notUpdateInColumnRowMove)!==!0){const o=n.table.getCellRange(n.columnMove.colSource,n.columnMove.rowSource),r=n.table.getCellRange(n.columnMove.colTarget,n.columnMove.rowTarget),s=n.table._moveHeaderPosition({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:n.columnMove.colTarget,row:n.columnMove.rowTarget});if(!s||s.targetIndex===s.sourceIndex)return n.updateCursor(),n.columnMove.moving=!1,delete n.columnMove.colSource,delete n.columnMove.rowSource,delete n.columnMove.colTarget,delete n.columnMove.rowTarget,n.table.scenegraph.component.hideMoveCol(),n.table.scenegraph.updateNextFrame(),!1;{n.table.internalProps.useOneRowHeightFillAll=!1,n.table.internalProps.layoutMap.clearCellRangeMap();const l=n.table.getCellRange(n.columnMove.colSource,n.columnMove.rowSource),a=n.table.getCellRange(n.columnMove.colTarget,n.columnMove.rowTarget),h=Math.min(l.start.col,a.start.col,o.start.col,r.start.col),d=Math.max(l.end.col,a.end.col,o.end.col,r.end.col),u=Math.min(l.start.row,a.start.row,o.start.row,r.start.row);let c=Math.max(l.end.row,a.end.row,o.end.row,r.end.row);s.moveType==="row"&&n.table.internalProps.layoutMap.rowHierarchyType==="tree"&&(c=s.targetIndex>s.sourceIndex?c+s.targetSize-1:c+s.sourceSize-1),!n.table.transpose&&n.table.internalProps.layoutMap.isSeriesNumberInBody(n.columnMove.colSource,n.columnMove.rowSource)&&(n.table.changeRecordOrder(s.sourceIndex,s.targetIndex),n.changeCheckboxAndRadioOrder(s.sourceIndex,s.targetIndex)),s.moveType==="column"?gy(h,d,0,-1,n.table):gy(0,-1,u,c,n.table),n.table.clearCellStyleCache(),n.table.internalProps.layoutMap.isSeriesNumberInBody(n.columnMove.colSource,n.columnMove.rowSource)?n.table.scenegraph.updateHeaderPosition(n.table.scenegraph.proxy.colStart,n.table.scenegraph.proxy.colEnd,n.table.scenegraph.proxy.rowStart,n.table.scenegraph.proxy.rowEnd,s.moveType):s.moveType==="column"?n.table.scenegraph.updateHeaderPosition(h,d,0,-1,s.moveType):n.table.scenegraph.updateHeaderPosition(0,-1,u,c,s.moveType),n.table.internalProps.frozenColDragHeaderMode==="adjustFrozenCount"&&n.table.isListTable()&&(n.table.isLeftFrozenColumn(n.columnMove.colTarget)&&!n.table.isLeftFrozenColumn(n.columnMove.colSource)?n.table.frozenColCount+=l.end.col-l.start.col+1:n.table.isLeftFrozenColumn(n.columnMove.colSource)&&!n.table.isLeftFrozenColumn(n.columnMove.colTarget)&&(n.table.frozenColCount-=l.end.col-l.start.col+1),n.table.isRightFrozenColumn(n.columnMove.colTarget)&&!n.table.isRightFrozenColumn(n.columnMove.colSource)?n.table.rightFrozenColCount+=l.end.col-l.start.col+1:n.table.isRightFrozenColumn(n.columnMove.colSource)&&!n.table.isRightFrozenColumn(n.columnMove.colTarget)&&(n.table.rightFrozenColCount-=l.end.col-l.start.col+1)),i=!0}}return n.columnMove.moving=!1,setTimeout(()=>{delete n.columnMove.colSource,delete n.columnMove.rowSource,delete n.columnMove.colTarget,delete n.columnMove.rowTarget},0),n.table.scenegraph.component.hideMoveCol(),n.columnResize.col<n.table.frozenColCount&&!n.table.isPivotTable()&&!n.table.transpose?(n.table.scenegraph.component.setFrozenColumnShadow(n.table.frozenColCount-1,n.columnResize.isRightFrozen),n.table.scenegraph.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount)):n.columnResize.col>=n.table.colCount-n.table.rightFrozenColCount&&!n.table.isPivotTable()&&!n.table.transpose?n.table.scenegraph.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount):n.table.options.frozenColCount?n.table.scenegraph.component.setFrozenColumnShadow(n.table.frozenColCount-1):n.table.options.rightFrozenColCount&&n.table.scenegraph.component.setRightFrozenColumnShadow(n.table.colCount-n.table.rightFrozenColCount),n.table.scenegraph.updateNextFrame(),((e=n.table.options.customConfig)===null||e===void 0?void 0:e.notUpdateInColumnRowMove)===!0||i}function gy(n,t,e,i,o){for(let r=n;r<=t;r++)o._clearColRangeWidthsMap(r);for(let r=e;r<=i;r++)o._clearRowRangeHeightsMap(r)}function Cl(n){var t;if(!n)return;const e=!((t=n.role)===null||t===void 0)&&t.startsWith("icon")?n:n.type==="richtext"?n._currentHoverIcon:void 0;return e?n.type==="richtext"?{icon:e,position:{left:n.globalAABBBounds.x1+e.globalAABBBounds.x1,right:n.globalAABBBounds.x1+e.globalAABBBounds.x2,top:n.globalAABBBounds.y1+e.globalAABBBounds.y1,bottom:n.globalAABBBounds.y1+e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"richtext-icon"}:{icon:e,position:{left:e.globalAABBBounds.x1,right:e.globalAABBBounds.x2,top:e.globalAABBBounds.y1,bottom:e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"icon"}:void 0}function yk(n,t,e){n=Math.ceil(n),t=Math.ceil(t);let i=e.columnResize.isRightFrozen?e.columnResize.x-n:n-e.columnResize.x;if(Math.abs(i)<1)return;const o=e.table.getColWidth(e.columnResize.col);let r=o;r+=i;const s=e.table.getMinColWidth(e.columnResize.col),l=e.table.getMaxColWidth(e.columnResize.col);if(r<s||r>l){if(o===s||o===l)return;i=o-s>l-o?l-o:s-o}let a=e.table.getColWidth(e.columnResize.col)+i;if(a<e.table.internalProps.limitMinWidth&&(a=e.table.internalProps.limitMinWidth,i=a-e.table.getColWidth(e.columnResize.col)),e.table.widthMode==="adaptive"&&e.columnResize.col<e.table.colCount-1){const h=e.table.getColWidth(e.columnResize.col+1),d=e.table.getMinColWidth(e.columnResize.col+1),u=e.table.getMaxColWidth(e.columnResize.col+1);let c=h;if(c-=i,c<d||c>u){if(h===d||h===u)return;i=h-d>u-h?u-h:d-h}c-i<e.table.internalProps.limitMinWidth&&(i=c-e.table.internalProps.limitMinWidth)}i=Math.ceil(i),e.columnResize.col<e.table.rowHeaderLevelCount||e.columnResize.col>=e.table.colCount-e.table.rightFrozenColCount?fy(i,e):e.table.internalProps.columnResizeType==="indicator"?Sk(i,e):e.table.internalProps.columnResizeType==="indicatorGroup"?xk(i,e):e.table.internalProps.columnResizeType==="all"?wk(i,e):fy(i,e),e.columnResize.x=n,e.table.scenegraph.component.updateResizeCol(e.columnResize.col,t,e.columnResize.isRightFrozen),e.columnResize.col<e.table.frozenColCount&&!e.table.isPivotTable()&&!e.table.transpose?e.table.scenegraph.component.setFrozenColumnShadow(e.table.frozenColCount-1,e.columnResize.isRightFrozen):e.table.options.frozenColCount&&e.table.scenegraph.component.setFrozenColumnShadow(e.table.frozenColCount-1),(e.columnResize.col>=e.table.colCount-e.table.rightFrozenColCount&&!e.table.isPivotTable()&&!e.table.transpose||e.table.options.rightFrozenColCount)&&e.table.scenegraph.component.setRightFrozenColumnShadow(e.table.colCount-e.table.rightFrozenColCount),e.table.scenegraph.updateNextFrame()}function fy(n,t){t.table.widthMode==="adaptive"&&t.columnResize.col<t.table.colCount-1?(t.table.scenegraph.updateColWidth(t.columnResize.col,n),t.table.scenegraph.updateColWidth(t.columnResize.col+1,-n),t.table.internalProps._widthResizedColMap.add(t.columnResize.col),t.table.internalProps._widthResizedColMap.add(t.columnResize.col+1)):(t.table.scenegraph.updateColWidth(t.columnResize.col,n),t.table.internalProps._widthResizedColMap.add(t.columnResize.col))}function wk(n,t){const e=t.table.internalProps.layoutMap;for(let i=t.table.frozenColCount;i<t.table.colCount-t.table.rightFrozenColCount;i++){if(!(t.table.internalProps.transpose||t.table.isPivotTable()&&!e.indicatorsAsCol)){const o=e.getBody(i,t.table.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)continue}t.table.scenegraph.updateColWidth(i,n),t.table.internalProps._widthResizedColMap.add(i)}}function Sk(n,t){const e=t.table.internalProps.layoutMap;let i,o,r;if(e.indicatorsAsCol)i=e.getIndicatorKey(t.columnResize.col,t.table.columnHeaderLevelCount);else{const s=e.getCellHeaderPaths(t.columnResize.col,t.table.columnHeaderLevelCount-1),l=s.colHeaderPaths[s.colHeaderPaths.length-1];o=l.dimensionKey,r=l.value}for(let s=t.table.rowHeaderLevelCount;s<t.table.colCount-t.table.rightFrozenColCount;s++){const l=e.getIndicatorKey(s,t.table.columnHeaderLevelCount);if(e.indicatorsAsCol&&l===i)t.table.scenegraph.updateColWidth(s,n),t.table.internalProps._widthResizedColMap.add(s);else if(!e.indicatorsAsCol){const a=e.getCellHeaderPaths(s,t.table.columnHeaderLevelCount-1),h=a==null?void 0:a.colHeaderPaths[a.colHeaderPaths.length-1];h&&o===h.dimensionKey&&r===h.value&&(t.table.scenegraph.updateColWidth(s,n),t.table.internalProps._widthResizedColMap.add(s))}}}function xk(n,t){const e=t.table.internalProps.layoutMap,i=e.getCellHeaderPaths(t.columnResize.col,t.table.columnHeaderLevelCount),o=e.getHeadNodeByRowOrColDimensions(i.colHeaderPaths.slice(0,i.colHeaderPaths.length-1)),r=o.startInTotal+t.table.frozenColCount,s=o.startInTotal+t.table.frozenColCount+o.size-1,l=t.table.getColsWidth(r,s),a=n;for(let h=r;h<=s;h++){if(!(t.table.internalProps.transpose||t.table.isPivotTable()&&!e.indicatorsAsCol)){const u=e.getBody(h,t.table.columnHeaderLevelCount);if(u!=null&&u.disableColumnResize)continue}let d=t.table.getColWidth(h)/l*a;d>0&&d<.5?d=.5:d<0&&d>=-.5&&(d=-.5),t.table.scenegraph.updateColWidth(h,d),t.table.internalProps._widthResizedColMap.add(h)}}function Ak(n,t,e,i,o,r){const s=r.table.getRecordShowIndexByCell(n,t);if(s>=0){const l=r.table.dataSource.getIndexKey(s);i==="column"?nt(o)?(r.radioState[e]={},r.radioState[e][l]=o):r.radioState[e]=l:(r.radioState[e]||(r.radioState[e]={}),nt(o)?r.radioState[e][l]=o:r.radioState[e][l]=!0)}}function Rk(n,t,e,i,o,r,s){var l,a,h,d,u;const c=s.table.getRecordShowIndexByCell(n,t);if(c>=0){const g=s.table.dataSource.getIndexKey(c);if(i==="column"){if(!I(s.radioState[e])&&r)return nt(o)?(s.radioState[e]={},s.radioState[e][g]=o):s.radioState[e]=g,!0;if(nt(s.radioState[e])&&!nt(o))return s.radioState[e]===g;if(nt(s.radioState[e])&&nt(o)||$t(s.radioState[e])&&!nt(o))return!1;if($t(s.radioState[e])&&nt(o))return s.radioState[e][g]===o}else if(i==="cell"){if(!I(s.radioState[e])&&r)return s.radioState[e]={},nt(o)?s.radioState[e][g]=o:s.radioState[e][g]=!0,!0;if(!I((l=s.radioState[e])===null||l===void 0?void 0:l[g])&&r)return nt(o)?s.radioState[e][g]=o:s.radioState[e][g]=!0,!0;if(ze((a=s.radioState[e])===null||a===void 0?void 0:a[g])&&!nt(o))return s.radioState[e][g];if(ze((h=s.radioState[e])===null||h===void 0?void 0:h[g])&&nt(o)||nt((d=s.radioState[e])===null||d===void 0?void 0:d[g])&&!nt(o))return!1;if(nt((u=s.radioState[e])===null||u===void 0?void 0:u[g])&&nt(o))return s.radioState[e][g]===o}}return r}function Tk(n,t,e){const{radioState:i,table:o}=e;if(o.internalProps.transpose?(n=o.getRecordShowIndexByCell(n,0),t=o.getRecordShowIndexByCell(t,0)):(n=o.getRecordShowIndexByCell(0,n),t=o.getRecordShowIndexByCell(0,t)),n>t){const r=i[n];for(let s=n;s>t;s--)i[s]=i[s-1];i[t]=r}else if(n<t){const r=i[n];for(let s=n;s<t;s++)i[s]=i[s+1];i[t]=r}}function Mk(n,t,e,i,o){const r=o.table.getRecordShowIndexByCell(n,t);if(r>=0){const s=o.table.dataSource.getIndexKey(r);o.checkedState[s]||(o.checkedState[s]={}),o.checkedState[s][e]=i}}function Bk(n,t,e){var i;e.headerCheckedState[n]=t,(i=e.checkedState)===null||i===void 0||i.forEach(o=>{o[n]=t})}function Pk(n,t,e,i,o){var r,s;if(o.table.isHeader(n,t)){if(I(o.headerCheckedState[e]))return o.headerCheckedState[e];if(typeof i=="function")return;if(I(i))o.headerCheckedState[e]=i;else if(((r=o.checkedState)===null||r===void 0?void 0:r.length)>0)return o.updateHeaderCheckedState(e,n,t);return o.headerCheckedState[e]}const l=o.table.getRecordShowIndexByCell(n,t);if(l>=0){const a=o.table.dataSource.getIndexKey(l);if(I((s=o.checkedState[a])===null||s===void 0?void 0:s[e]))return o.checkedState[a][e];o.checkedState[a]||(o.checkedState[a]={}),o.checkedState[a][e]=i}return i}function Hk(n,t){t.checkedState=[],t.headerCheckedState={},t.radioState={};let e=!1;t._checkboxCellTypeFields=[],t._headerCheckFuncs={},t.table.internalProps.layoutMap.headerObjects.forEach((i,o)=>{if(i.headerType==="checkbox"){const r=i.define.checked;r==null||typeof r=="function"?(e=!0,typeof r=="function"&&(t._headerCheckFuncs[i.field]=r)):t.headerCheckedState[i.field]=r,i.define.cellType!=="checkbox"||i.fieldFormat||t._checkboxCellTypeFields.push(i.field)}}),e&&n.forEach((i,o)=>{t._checkboxCellTypeFields.forEach(r=>{const s=i[r];let l;if($t(s)?l=s.checked:typeof s=="boolean"&&(l=s),l==null){const a=t._headerCheckFuncs[r];if(a){const h=t.table.getCellAddrByFieldRecord(r,o);l=xe(a,{col:h.col,row:h.row,table:t.table,context:null,value:s})}}t.checkedState[o]||(t.checkedState[o]={}),t.checkedState[o][r]=l})})}function Ek(n,t,e,i){const o=t.checkedState.every((r,s)=>{const l=t.table.getTableIndexByRecordIndex(s);return!!(t.table.transpose?t.table.getCustomMerge(l,i):t.table.getCustomMerge(e,l))||(r==null?void 0:r[n])===!0});return o?(t.headerCheckedState[n]=!0,o):t.checkedState.every((r,s)=>{const l=t.table.getTableIndexByRecordIndex(s);return!!(t.table.transpose?t.table.getCustomMerge(l,i):t.table.getCustomMerge(e,l))||(r==null?void 0:r[n])===!1})?(t.headerCheckedState[n]=!1,!1):!!t.checkedState.find(r=>(r==null?void 0:r[n])===!0)&&(t.headerCheckedState[n]="indeterminate","indeterminate")}function Lk(n,t){for(let e=t.checkedState.length;e<n.length;e++){const i=n[e];t._checkboxCellTypeFields.forEach(o=>{const r=i[o];let s;$t(r)?s=r.checked:typeof r=="boolean"&&(s=r),t.checkedState[e]||(t.checkedState[e]={}),t.checkedState[e][o]=s})}}function Fk(n,t,e){const{checkedState:i,table:o}=e;if(o.internalProps.transpose?(n=o.getRecordShowIndexByCell(n,0),t=o.getRecordShowIndexByCell(t,0)):(n=o.getRecordShowIndexByCell(0,n),t=o.getRecordShowIndexByCell(0,t)),n>t){const r=i[n];for(let s=n;s>t;s--)i[s]=i[s-1];i[t]=r}else if(n<t){const r=i[n];for(let s=n;s<t;s++)i[s]=i[s+1];i[t]=r}}function kk(n,t,e){n=Math.ceil(n),t=Math.ceil(t);let i=e.rowResize.isBottomFrozen?e.rowResize.y-t:t-e.rowResize.y;if(Math.abs(i)<1)return;e.table.getRowHeight(e.rowResize.row);let o=e.table.getRowHeight(e.rowResize.row)+i;if(o<e.table.internalProps.limitMinHeight&&(o=e.table.internalProps.limitMinHeight,i=o-e.table.getRowHeight(e.rowResize.row)),e.table.heightMode==="adaptive"&&e.rowResize.row<e.table.rowCount-1){let r=e.table.getRowHeight(e.rowResize.row+1);r-=i,r-i<e.table.internalProps.limitMinHeight&&(i=r-e.table.internalProps.limitMinHeight)}i=Math.ceil(i),e.rowResize.row<e.table.columnHeaderLevelCount||e.rowResize.row>=e.table.rowCount-e.table.bottomFrozenRowCount?py(i,e):e.table.internalProps.rowResizeType==="indicator"?zk(i,e):e.table.internalProps.rowResizeType==="indicatorGroup"?Dk(i,e):e.table.internalProps.rowResizeType==="all"?Ik(i,e):py(i,e),e.rowResize.y=t,e.table.scenegraph.component.updateResizeRow(e.rowResize.row,n,e.rowResize.isBottomFrozen),e.table.scenegraph.updateNextFrame()}function py(n,t){t.table.heightMode==="adaptive"&&t.rowResize.row<t.table.rowCount-1?(t.table.scenegraph.updateRowHeight(t.rowResize.row,n),t.table.scenegraph.updateRowHeight(t.rowResize.row+1,-n),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row+1)):(t.table.scenegraph.updateRowHeight(t.rowResize.row,n),t.table.internalProps._heightResizedRowMap.add(t.rowResize.row))}function Ik(n,t){for(let e=t.table.frozenRowCount;e<t.table.rowCount-t.table.bottomFrozenRowCount;e++)t.table.scenegraph.updateRowHeight(e,n),t.table.internalProps._heightResizedRowMap.add(e)}function zk(n,t){var e,i;const o=t.table.internalProps.layoutMap;let r,s,l;if(o.indicatorsAsCol){const a=o.getCellHeaderPaths(t.table.rowHeaderLevelCount-1,t.rowResize.row),h=(e=a.rowHeaderPaths)===null||e===void 0?void 0:e[a.rowHeaderPaths.length-1];s=h==null?void 0:h.dimensionKey,l=h==null?void 0:h.value}else r=o.getIndicatorKey(t.table.rowHeaderLevelCount,t.rowResize.row);for(let a=t.table.columnHeaderLevelCount;a<t.table.rowCount-t.table.bottomFrozenRowCount;a++){const h=o.getIndicatorKey(t.table.rowHeaderLevelCount,a);if(o.indicatorsAsCol||h!==r){if(o.indicatorsAsCol){const d=o.getCellHeaderPaths(t.table.rowHeaderLevelCount-1,a),u=(i=d==null?void 0:d.rowHeaderPaths)===null||i===void 0?void 0:i[d.rowHeaderPaths.length-1];u&&s===u.dimensionKey&&l===u.value&&(t.table.scenegraph.updateRowHeight(a,n),t.table.internalProps._heightResizedRowMap.add(a))}}else t.table.scenegraph.updateRowHeight(a,n),t.table.internalProps._heightResizedRowMap.add(a)}}function Dk(n,t){const e=t.table.internalProps.layoutMap,i=e.getCellHeaderPaths(t.table.rowHeaderLevelCount,t.rowResize.row),o=e.getHeadNodeByRowOrColDimensions(i.rowHeaderPaths.slice(0,i.rowHeaderPaths.length-1)),r=o.startInTotal+t.table.frozenRowCount,s=o.startInTotal+t.table.frozenRowCount+o.size-1,l=t.table.getRowsHeight(r,s),a=n;for(let h=r;h<=s;h++){let d=t.table.getRowHeight(h)/l*a;d>0&&d<.5?d=.5:d<0&&d>=-.5&&(d=-.51),t.table.scenegraph.updateRowHeight(h,d),t.table.internalProps._heightResizedRowMap.add(h)}}function Ok(n){const{customSelectedRangeComponents:t}=n.table.scenegraph;t.forEach((e,i)=>{e.rect.delete()}),t.clear(),n.select.customSelectRanges=[]}function Wk(n,t){const{customSelectedRangeComponents:e}=t.table.scenegraph;n.forEach(i=>{var o,r,s,l;const{range:a,style:h}=i,d=ve({fill:(o=h.cellBgColor)!==null&&o!==void 0&&o,stroke:(r=h.cellBorderColor)!==null&&r!==void 0&&r,lineWidth:(s=h.cellBorderLineWidth)!==null&&s!==void 0?s:0,lineDash:(l=h.cellBorderLineDash)!==null&&l!==void 0?l:[],pickable:!1});e.set(`${a.start.col}-${a.start.row}-${a.end.col}-${a.end.row}`,{rect:d,role:"body"})}),t.select.customSelectRanges=n,G_(t.table.scenegraph),t.table.scenegraph.updateNextFrame()}class Nk{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=sC(e=>{this.updateInteractionState(e??Rt.default)},100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=Rt.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Ci,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=Rt.default,this.select={highlightScope:Nt.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:Nt.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Ci,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=(t=this.table.options.hover)!==null&&t!==void 0?t:{highlightMode:"cell"};i?this.hover.highlightScope=Nt.none:e==="cross"?this.hover.highlightScope=Nt.cross:e==="row"?this.hover.highlightScope=Nt.row:e==="column"?this.hover.highlightScope=Nt.column:e==="cell"&&(this.hover.highlightScope=Nt.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===Nt.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o,highlightInRange:r}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell",highlightInRange:!1},this.table.options.select);this.select.highlightScope=e?Nt.none:o==="cross"?Nt.cross:o==="row"?Nt.row:o==="column"?Nt.column:Nt.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t,this.select.highlightInRange=r}isSelected(t,e){let i=!1;return this.select.ranges.forEach(o=>{Ti(o,t,e)&&(i=!0)}),i}setSortState(t){const e=this,i=(t=!t||Array.isArray(t)?t:[t])&&t.reduce((o,r)=>{var s,l,a;const h=(s=function(d){const u=[];return function c(g,f=0){g.forEach(p=>{var v;const m=p.startInTotal?(v=p.startInTotal+e.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&v!==void 0?v:0:f;p.columns?c(p.columns,m):u.push(Object.assign(Object.assign({},p),{startIndex:m}))})}(d),u}(this.table.internalProps.columns))===null||s===void 0?void 0:s.find(d=>(d==null?void 0:d.field)===(r==null?void 0:r.field));return this.table.internalProps.transpose?o.push({field:r.field,order:r.order,row:(l=(h==null?void 0:h.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&l!==void 0?l:0,col:h==null?void 0:h.level}):o.push({field:r.field,order:r.order,col:(a=(h==null?void 0:h.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&a!==void 0?a:0,row:h==null?void 0:h.level}),o},[]);this.sort=i||[]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;t===Rt.scrolling&&(this.interactionStateBeforeScroll=this.interactionState);const e=this.interactionState;this.interactionState=t,e===Rt.scrolling&&Rt.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){lk(this,t,e)}updateSelectPos(t,e,i=!1,o=!1,r=!1,s=!1,l=!1,a=!1){e!==-1&&e!==-1&&(this.select.selecting=!0),ck(this,t,e,i,o,r,s,l,a)}checkCellRangeInSelect(t,e){return ok(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o){var r,s,l,a,h,d,u,c,g;if(!((r=this.residentHoverIcon)===null||r===void 0)&&r.icon&&i===((s=this.residentHoverIcon)===null||s===void 0?void 0:s.icon))return;const f=Cl(i);if(f)if(f.type==="richtext-icon"){const p=f.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==((a=this.residentHoverIcon)===null||a===void 0?void 0:a.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),p.attribute.tooltip){const v={content:p.attribute.tooltip.title,referencePosition:{rect:f.position,placement:p.attribute.tooltip.placement},style:Object.assign({},(h=this.table.internalProps.theme)===null||h===void 0?void 0:h.tooltipStyle,(d=p.tooltip)===null||d===void 0?void 0:d.style,(c=(u=p.attribute)===null||u===void 0?void 0:u.tooltip)===null||c===void 0?void 0:c.style),disappearDelay:p.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(v)||this.table.showTooltip(t,e,v)}}else{const p=f.icon;p!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==((g=this.residentHoverIcon)===null||g===void 0?void 0:g.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=p,this.table.scenegraph.setIconHoverStyle(p,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==((l=this.residentHoverIcon)===null||l===void 0?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(t=!0,e=!0){if(this.select.selecting){if(this.select.selecting=!1,this.select.ranges.length===0)return;const i=this.select.ranges[this.select.ranges.length-1];let o=!1;for(let l=0;l<this.select.ranges.length-1;l++){const a=this.select.ranges[l];if(a&&a.start.col===i.start.col&&a.start.row===i.start.row&&a.end.col===i.end.col&&a.end.row===i.end.row){o=!0;break}}o?(this.select.ranges.pop(),q_(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):gk(this.table.scenegraph);const r=this.select.ranges[this.select.ranges.length-1].end.col,s=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(J.SELECTED_CELL,{ranges:this.select.ranges,col:r,row:s})}else e&&this.select.ranges.length===0&&this.table.fireListeners(J.SELECTED_CLEAR,{})}endResizeCol(){setTimeout(()=>{this.columnResize.resizing=!1},0),this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var r;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const s=!!(!((r=this.select.ranges)===null||r===void 0)&&r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,s),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){yk(t,e,this)}endResizeRow(){setTimeout(()=>{this.rowResize.resizing=!1},0),this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var r;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const s=!!(!((r=this.select.ranges)===null||r===void 0)&&r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,s),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){kk(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(J.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(J.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o,r){bk(t,e,i,o,this,r)}updateMoveCol(t,e,i,o,r){Ck(t,e,i,o,this,r)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return _k(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?(t=this.table.rowHeaderLevelCount)!==null&&t!==void 0?t:0:Math.max(((e=this.table.rowHeaderLevelCount)!==null&&e!==void 0?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,(i=this.table.options.frozenColCount)!==null&&i!==void 0?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,r=this.table.tableNoFrameHeight;o+r>=i&&this.table.fireListeners(J.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(t=this.table.theme.scrollStyle)===null||t===void 0?void 0:t.width,scrollWidth:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,viewHeight:r,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,r=this.table.tableNoFrameWidth;o+r>=i&&this.table.fireListeners(J.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:(t=this.table.theme.scrollStyle)===null||t===void 0?void 0:t.width,scrollWidth:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:r})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),I(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,t===1),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(J.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,scrollWidth:(i=this.table.theme.scrollStyle)===null||i===void 0?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),r!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),I(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,t===1),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(J.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(e=this.table.theme.scrollStyle)===null||e===void 0?void 0:e.width,scrollWidth:(i=this.table.theme.scrollStyle)===null||i===void 0?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),r!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e,i=!0){var o,r,s;const l=this.table.getAllRowsHeight(),a=!((o=this.table.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?1:0;t=Math.max(0,Math.min(t,l-this.table.scenegraph.height-a)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const h=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,I(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const d=t/(l-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(d),h!==t&&i&&(this.table.fireListeners(J.SCROLL,{event:e==null?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(r=this.table.theme.scrollStyle)===null||r===void 0?void 0:r.width,scrollWidth:(s=this.table.theme.scrollStyle)===null||s===void 0?void 0:s.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:d}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e,i=!0){var o,r,s;this.table.scrollLeft;const l=this.table.getAllColsWidth(),a=(this.table.getFrozenColsWidth(),!((o=this.table.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?1:0);t=Math.max(0,Math.min(t,l-this.table.scenegraph.width-a)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const h=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,I(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const d=t/(l-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(d),h!==t&&i&&(this.table.fireListeners(J.SCROLL,{event:e==null?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:(r=this.table.theme.scrollStyle)===null||r===void 0?void 0:r.width,scrollWidth:(s=this.table.theme.scrollStyle)===null||s===void 0?void 0:s.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:d}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout(()=>{var e;(e=this.table.scenegraph)===null||e===void 0||e.component.hideVerticalScrollBar()},1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout(()=>{var e;(e=this.table.scenegraph)===null||e===void 0||e.component.hideHorizontalScrollBar()},1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var r;!((r=this.table.internalProps.menu)===null||r===void 0)&&r.contextMenuItems&&(this.table.internalProps.menu.renderMode==="html"?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,Bi.contextmenu)),this.table.fireListeners(J.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,r){this.table.fireListeners(J.DROPDOWN_ICON_CLICK,{col:t,row:e,event:r}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){this.table.internalProps.menu.renderMode==="html"?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,Bi.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(J.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let s;r.forEachChildren(l=>l.attribute.funcType===Zt.dropDown&&(s=l,!0)),s&&(this.residentHoverIcon={col:t,row:e,icon:s},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(J.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(J.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],r=this.table.getCellRange(i,o);if(r)for(let s=r.start.col;s<=r.end.col;s++)for(let l=r.start.row;l<=r.end.row;l++)this.table.scenegraph.updateCellContent(s,l)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let r=0;r<o.length;r++){const s=o[r];let{col:l,row:a}=s;const{field:h,menuKey:d}=s;if(typeof l!="number"||typeof a!="number")if(this.table.isPivotTable()){const u=this.table.internalProps.layoutMap.getPivotCellAdress(h);if(!u)continue;l=u.col,a=u.row}else{const u=this.table.internalProps.layoutMap.getHeaderCellAddressByField(h);if(!u)continue;l=u.col,a=u.row}if(I(l)&&I(a)&&this.table.isCellRangeEqual(t,e,l,a)){const u=this.table._getHeaderLayoutMap(l??t,a??e).dropDownMenu||this.table.globalDropDownMenu;if(u)for(let c=0;c<u.length;c++){const g=u[c];if($t(g)&&(g.menuKey||g.text)===(d||"")&&c===i||Qt(g)&&g===d&&c===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const c=this.table.getPivotSortState(t,e),g=c?c.toUpperCase():"NORMAL",f=g==="ASC"?"DESC":g==="DESC"?"NORMAL":"ASC";return this.table.sort(t,e,f),void this.table.fireListeners(po.PIVOT_SORT_CLICK,{col:t,row:e,order:g||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const r=[...this.sort],s=this.table.internalProps.multipleSort||!r.length?null:this.sort[this.sort.length-1];dk(t,e,this.table,o);const l=this.table.getCellRange(t,e),a=this.sort.find(c=>c.col===l.start.col&&c.row===l.start.row),h=this.table.internalProps.multipleSort||!s?null:s.col,d=this.table.internalProps.multipleSort||!s?null:s.row,u=r.findIndex(c=>c.col===t&&c.row===e);u>=0&&r.splice(u,1),this.table.scenegraph.updateSortIcon({col:t,row:e,iconMark:i,order:a==null?void 0:a.order,oldSortCol:h,oldSortRow:d,oldIconMark:s==null?void 0:s.icon}),a&&(a.icon=i),this.table.internalProps.multipleSort||r.forEach(c=>{this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:"normal",oldSortCol:c.col,oldSortRow:c.row,oldIconMark:null})}),this.table.fireListeners(po.AFTER_SORT,{order:a==null?void 0:a.order,field:this.table.getHeaderField(t,e),event:o})}updateSortState(t){var e,i,o,r,s,l,a,h;t=Array.isArray(t)?t:[t];for(let u=0;u<t.length;u++){if(t[u].field===((e=this.sort[u])===null||e===void 0?void 0:e.field)&&t[t.length-1].order===((i=this.sort[u])===null||i===void 0?void 0:i.order))return;const c=this.table.internalProps.multipleSort?null:((o=this.sort[u])===null||o===void 0?void 0:o.col)||null,g=this.table.internalProps.multipleSort?null:((r=this.sort[u])===null||r===void 0?void 0:r.row)||null;((s=this.sort[u])===null||s===void 0?void 0:s.order)==="asc"||(l=this.sort[u])===null||l===void 0||l.order,this.setSortState(t.slice(0,u+1));const f=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t[u].field);this.sort[u].col=f.col,this.sort[u].row=f.row;const p=this.table.scenegraph.getCell(this.sort[u].col,this.sort[u].row);let v;cg(p,"children",m=>m.attribute.funcType==="sort"&&(v=m,!0)),this.table.scenegraph.updateSortIcon({col:this.sort[u].col,row:this.sort[u].row,iconMark:v,order:this.sort[u].order,oldSortCol:c,oldSortRow:g,oldIconMark:(a=this.sort[u])===null||a===void 0?void 0:a.icon})}const d=[];this.table.internalProps.layoutMap.columnTree.tree.children.forEach(u=>{t.some(c=>c.field===u.field)||d.push(u)});for(let u=0;u<d.length;u++){const c=d[u];this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:null,oldSortCol:(h=c.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)!==null&&h!==void 0?h:0,oldSortRow:c.level,oldIconMark:null})}}triggerFreeze(t,e,i){if(!this.table.isPivotTable()&&!this.table.transpose){if(hk(t,e,this.table),this.table.hasListeners(po.FREEZE_CLICK)){const o=this.table.internalProps.layoutMap.columnObjects.slice(0,t+1);this.table.fireListeners(po.FREEZE_CLICK,{col:t,row:e,fields:o.reduce((r,s)=>r.concat(s.field),[]),colCount:this.table.frozenColCount})}this.frozen.icon=i}}updateCursor(t="default"){this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,r,s){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=r,this.drill.row=s,fk(r,s,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){this.sparkLine.col!==-1&&this.sparkLine.row!==-1&&pk(this.sparkLine.col,this.sparkLine.row,this.table);let r=!1;t!==-1&&e!==-1&&(r=vk(t,e,i,o,this.table)),r?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return Mk(t,e,i,o,this)}setHeaderCheckedState(t,e){return Bk(t,e,this)}syncCheckedState(t,e,i,o){return Pk(t,e,i,o,this)}initCheckedState(t){return Hk(t,this)}updateHeaderCheckedState(t,e,i){return Ek(t,this,e,i)}initLeftRecordsCheckState(t){return Lk(t,this)}setRadioState(t,e,i,o,r){Ak(t,e,i,o,r,this)}syncRadioState(t,e,i,o,r,s){return Rk(t,e,i,o,r,s,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&Fk(t,e,this),this.radioState.length&&Tk(t,e,this)}setCustomSelectRanges(t){Ok(this),Wk(t,this)}}function Vk(n){Wt.mode==="browser"&&n.on(J.CLICK_CELL,t=>{const{col:e,row:i}=t;if(t.target.type==="image"&&t.target.role&&t.target.role.startsWith("icon"))return;let o;o=n.internalProps.layoutMap.isHeader(e,i)?n.isPivotTable()?n._getHeaderLayoutMap(e,i).headerType:n.getHeaderDefine(e,i).headerType:n.getBodyColumnType(e,i);const r=n.isHeader(e,i)?n.getHeaderDefine(e,i):n.getBodyColumnDefine(e,i),s=n.getCellValue(e,i),l=n.getCellOriginValue(e,i);if(o==="link"){if(r.linkJump===!1)return;const a=r.templateLink,h=r.linkDetect!==!1;let d;if(a){const g=n.getCellOriginRecord(e,i),f=Object.assign({__value:s,__dataValue:l},g),p=/\{\s*(\S+?)\s*\}/g;d=a.replace(p,(v,m)=>f[m])}else if(h){if(!pg.test(s))return;d=s}else d=s;const u=r.linkTarget,c=r.linkWindowFeatures;window.open(d,u,c)}else if(o==="image"){const{clickToPreview:a}=r;if(a===!1)return;const h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.backgroundColor="rgba(30, 30, 30, 0.4)",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.overflow="hidden",h.style.zIndex="9999",h.addEventListener("click",u=>{u.target===h&&document.body.removeChild(h)});const d=new Image;d.src=s,d.style.maxWidth="80%",d.style.maxHeight="80%",h.appendChild(d),document.body.appendChild(h)}else if(o==="video"){const{clickToPreview:a}=r;if(a===!1)return;const h=document.createElement("div");h.style.width="100%",h.style.height="100%",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.backgroundColor="rgba(30, 30, 30, 0.4)",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center",h.style.overflow="hidden",h.style.zIndex="9999",h.addEventListener("click",u=>{u.target===h&&document.body.removeChild(h)});const d=document.createElement("video");d.src=s,d.style.maxWidth="80%",d.style.maxHeight="80%",d.setAttribute("preload","auto"),d.setAttribute("controls","true"),h.appendChild(d),document.body.appendChild(h)}})}function jk(n){n.on(J.MOUSEENTER_CELL,t=>{const{col:e,row:i}=t;if(e===-1||i===-1)return;const o=n.internalProps.layoutMap.getHeaderDimension(e,i);o!=null&&o.drillDown||o!=null&&o.drillUp?n.stateManager.updateDrillState(o.dimensionKey,o.title,o.drillDown,o.drillUp,e,i):n.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}),n.on(J.MOUSELEAVE_TABLE,t=>{n.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})}function Gk(n){n.fireListeners(po.DRILLMENU_CLICK,n.stateManager.drill)}function Uk(n){const t=n.internalProps.layoutMap.rowsDefine,e=n.internalProps.layoutMap.columnsDefine;for(let i=0;i<t.length;i++){const o=t[i];if(typeof o!="string"&&(o.drillDown||o.drillUp))return!0}for(let i=0;i<e.length;i++){const o=e[i];if(typeof o!="string"&&(o.drillDown||o.drillUp))return!0}return!1}function vy(n){if(n.eventManager.bindSparklineHoverEvent)return;let t=!1;n.isPivotTable()?t=n.internalProps.layoutMap.indicatorsDefine.some(e=>typeof e!="string"&&e.cellType==="sparkline"):t=n.internalProps.layoutMap.columnObjects.some(e=>e.cellType==="sparkline"||typeof e.cellType=="function"),t&&(n.eventManager.bindSparklineHoverEvent=!0,n.on(J.MOUSEMOVE_CELL,e=>{const{col:i,row:o,x:r,y:s}=e;n.getBodyColumnType(i,o)!=="sparkline"&&n.stateManager.updateSparklineHoverPose(-1,-1,0,0),n.stateManager.updateSparklineHoverPose(i,o,r,s)}),n.on(J.MOUSELEAVE_TABLE,e=>{n.stateManager.updateSparklineHoverPose(-1,-1,0,0)}))}function xd(n,t,e=!0){var i;let{deltaX:o,deltaY:r}=n;n.shiftKey&&n.deltaY&&(o=r,r=0);const[s,l]=Kk(o,r,{horizontal:1,vertical:1});(s||l)&&t.interactionState!==Rt.scrolling&&t.updateInteractionState(Rt.scrolling),s&&(t.setScrollLeft(t.scroll.horizontalBarPos+s,n),t.showHorizontalScrollBar(!0)),l&&(t.setScrollTop(t.scroll.verticalBarPos+l,n),t.showVerticalScrollBar(!0)),e&&t.resetInteractionState(t.interactionStateBeforeScroll),!((i=n.nativeEvent)===null||i===void 0)&&i.cancelable&&(t.table.internalProps.overscrollBehavior==="none"||Math.abs(r)>=Math.abs(o)&&r!==0&&my(r,t)||Math.abs(r)<=Math.abs(o)&&o!==0&&by(o,t))&&n.nativeEvent.preventDefault()}function Kk(n,t,e){var i,o;const r=Math.abs(n/t),s=r<=.5?0:n,l=r>2?0:t;return[Math.ceil(s*((i=e.horizontal)!==null&&i!==void 0?i:0)),Math.ceil(l*((o=e.vertical)!==null&&o!==void 0?o:0))]}function my(n,t){return t.table.getAllRowsHeight()-t.table.scenegraph.height!=0&&!$k(n,t)&&!Yk(n,t)}function by(n,t){return t.table.getAllColsWidth()-t.table.scenegraph.width!=0&&!Xk(n,t)&&!qk(n,t)}function $k(n,t){return t.table.getAllRowsHeight()-t.table.scenegraph.height!==0&&n<=0&&t.scroll.verticalBarPos<1}function Yk(n,t){var e;const i=!((e=t.table.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound?1:0,o=t.table.getAllRowsHeight()-t.table.scenegraph.height;return o!==0&&n>=0&&Math.abs(t.scroll.verticalBarPos-o)<1+i}function Xk(n,t){return t.table.getAllColsWidth()-t.table.scenegraph.width!==0&&n<=0&&t.scroll.horizontalBarPos<1}function qk(n,t){var e;const i=!((e=t.table.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound?1:0,o=t.table.getAllColsWidth()-t.table.scenegraph.width;return o!==0&&n>=0&&Math.abs(t.scroll.horizontalBarPos-o)<1+i}class Zk{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const r=Math.pow(this.friction,i/16),s=r*this.speedX,l=r*this.speedY;let a=0,h=0;Math.abs(s)>.05&&(o=!1,a=(this.speedX+s)/2*i),Math.abs(l)>.05&&(o=!1,h=(this.speedY+l)/2*i),(t=this.scrollHandle)===null||t===void 0||t.call(this,a,h),o?this.runingId=null:(this.lastTime=e,this.speedX=s,this.speedY=l,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function Jg(n,t,e){var i,o,r,s;t&&((i=n.stateManager.columnMove)===null||i===void 0?void 0:i.colSource)!==-1&&((o=n.stateManager.columnMove)===null||o===void 0?void 0:o.rowSource)!==-1&&((r=n.stateManager.columnMove)===null||r===void 0?void 0:r.colTarget)!==-1&&((s=n.stateManager.columnMove)===null||s===void 0?void 0:s.rowTarget)!==-1?n.hasListeners(J.CHANGE_HEADER_POSITION)&&n.fireListeners(J.CHANGE_HEADER_POSITION,{target:{col:n.stateManager.columnMove.colTarget,row:n.stateManager.columnMove.rowTarget},source:{col:n.stateManager.columnMove.colSource,row:n.stateManager.columnMove.rowSource},event:e}):t||n.hasListeners(J.CHANGE_HEADER_POSITION_FAIL)&&n.fireListeners(J.CHANGE_HEADER_POSITION_FAIL,{target:{col:n.stateManager.columnMove.colTarget,row:n.stateManager.columnMove.rowTarget},source:{col:n.stateManager.columnMove.colSource,row:n.stateManager.columnMove.rowSource},event:e})}function Jk(n){const t=n.table,e=t.stateManager;t.scenegraph.tableGroup.addEventListener("pointermove",r=>{var s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S;const A=(l=(s=t.eventManager.LastPointerXY)===null||s===void 0?void 0:s.x)!==null&&l!==void 0?l:r.x,R=(h=(a=t.eventManager.LastPointerXY)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:r.y;t.eventManager.LastPointerXY={x:r.x,y:r.y},n.touchSetTimeout&&(clearTimeout(n.touchSetTimeout),n.touchSetTimeout=void 0);const T=$e(r);if(T.eventArgs&&t.hasListeners(J.MOUSEMOVE_TABLE)&&t.fireListeners(J.MOUSEMOVE_TABLE,{col:T.eventArgs.col,row:T.eventArgs.row,x:T.abstractPos.x,y:T.abstractPos.y,event:r.nativeEvent,target:(d=T==null?void 0:T.eventArgs)===null||d===void 0?void 0:d.target,mergeCellInfo:(u=T.eventArgs)===null||u===void 0?void 0:u.mergeInfo}),e.interactionState===Rt.grabing&&!(!((c=t.editorManager)===null||c===void 0)&&c.editingEditor))return void(Math.abs(A-r.x)+Math.abs(R-r.y)>=1&&(e.isResizeCol()||(e.isMoveCol()?n.dealColumnMover(T):e.isFillHandle()?n.dealFillSelect(T,!0):((g=t.options.select)===null||g===void 0?void 0:g.disableDragSelect)||n.dealTableSelect(T,!0))));!(!((f=t.options.select)===null||f===void 0)&&f.disableDragSelect)&&t.eventManager.isDraging&&e.isSelecting()&&!(!((p=t.editorManager)===null||p===void 0)&&p.editingEditor)&&n.dealTableSelect(T,!0);const M=r.path.find(P=>P.role==="cell");if(t.hasListeners(J.MOUSELEAVE_CELL)&&(t.stateManager.hover.cellPos.col===-1||t.stateManager.hover.cellPos.row===-1||(M==null?void 0:M.col)===t.stateManager.hover.cellPos.col&&(M==null?void 0:M.row)===t.stateManager.hover.cellPos.row||t.fireListeners(J.MOUSELEAVE_CELL,{col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row,cellRange:t.getCellRangeRelativeRect({col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:(v=T==null?void 0:T.eventArgs)===null||v===void 0?void 0:v.target})),t.hasListeners(J.MOUSEENTER_CELL)&&((M==null?void 0:M.role)!=="cell"||!I(M.col)||!I(M.row)||M.col===t.stateManager.hover.cellPos.col&&M.row===t.stateManager.hover.cellPos.row||M.col===((m=t.stateManager.hover.cellPosContainHeader)===null||m===void 0?void 0:m.col)&&M.row===((b=t.stateManager.hover.cellPosContainHeader)===null||b===void 0?void 0:b.row)||t.fireListeners(J.MOUSEENTER_CELL,{col:M.col,row:M.row,cellRange:t.getCellRangeRelativeRect({col:M.col,row:M.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:(w=T==null?void 0:T.eventArgs)===null||w===void 0?void 0:w.target,mergeCellInfo:(C=T.eventArgs)===null||C===void 0?void 0:C.mergeInfo})),n.dealIconHover(T),n.dealTableHover(T),T.eventArgs&&t.hasListeners(J.MOUSEMOVE_CELL)){let P,k;if(!((_=T.eventArgs)===null||_===void 0)&&_.target){const B=Cl((y=T.eventArgs)===null||y===void 0?void 0:y.target);B&&(P=B.icon,k=B.position)}t.fireListeners(J.MOUSEMOVE_CELL,{col:T.eventArgs.col,row:T.eventArgs.row,x:T.abstractPos.x,y:T.abstractPos.y,event:r.nativeEvent,targetIcon:P?{name:P.name,position:k,funcType:P.attribute.funcType}:void 0,target:(x=T==null?void 0:T.eventArgs)===null||x===void 0?void 0:x.target,mergeCellInfo:(S=T.eventArgs)===null||S===void 0?void 0:S.mergeInfo})}}),t.scenegraph.tableGroup.addEventListener("pointerout",r=>{var s;const l=$e(r),a=(s=l==null?void 0:l.eventArgs)===null||s===void 0?void 0:s.target;(a==null?void 0:a.role)==="table"&&n.dealTableHover()}),t.scenegraph.tableGroup.addEventListener("pointerover",r=>{var s,l;const a=$e(r),h=(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target;if(h&&t.hasListeners(J.MOUSEOVER_CHART_SYMBOL)&&h.type==="symbol"){const d=r.composedPath().find(u=>u.roll==="cell");if(d){const{col:u,row:c}=d,g={col:u,row:c,field:t.getHeaderField(u,c),value:t.getCellValue(u,c),dataValue:t.getCellOriginValue(u,c),cellHeaderPaths:t.internalProps.layoutMap.getCellHeaderPaths(u,c),title:t.getBodyColumnDefine(u,c).title,cellRange:t.getCellRelativeRect(u,c),event:r.nativeEvent,sparkline:{pointData:void 0},scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.target};t.fireListeners(J.MOUSEOVER_CHART_SYMBOL,g)}}}),t.scenegraph.tableGroup.addEventListener("pointerenter",r=>{(t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.horizontalVisible==="focus"||!t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.visible==="focus")&&e.showHorizontalScrollBar(),(t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.verticalVisible==="focus"||!t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.visible==="focus")&&e.showVerticalScrollBar(),t.hasListeners(J.MOUSEENTER_TABLE)&&t.fireListeners(J.MOUSEENTER_TABLE,{event:r.nativeEvent})}),t.scenegraph.tableGroup.addEventListener("pointerleave",r=>{e.isResizeCol()||e.isMoveCol()||e.isSelecting()||(e.updateInteractionState(Rt.default),e.updateCursor()),(t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.horizontalVisible==="focus"||!t.theme.scrollStyle.horizontalVisible&&t.theme.scrollStyle.visible==="focus")&&e.hideHorizontalScrollBar(),(t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.verticalVisible==="focus"||!t.theme.scrollStyle.verticalVisible&&t.theme.scrollStyle.visible==="focus")&&e.hideVerticalScrollBar(),t.hasListeners(J.MOUSELEAVE_CELL)&&t.stateManager.hover.cellPos.col!==-1&&t.stateManager.hover.cellPos.row!==-1&&t.fireListeners(J.MOUSELEAVE_CELL,{col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row,cellRange:t.getCellRangeRelativeRect({col:t.stateManager.hover.cellPos.col,row:t.stateManager.hover.cellPos.row}),scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,event:r.nativeEvent,target:void 0}),n.dealTableHover();const s=r.target;s&&!s.isDescendantsOf(t.scenegraph.tableGroup)&&t.fireListeners(J.MOUSELEAVE_TABLE,{event:r.nativeEvent})});const i=r=>{var s;const l=r.target;if(!t.getElement().contains(l)){const a=(s=t.editorManager)===null||s===void 0?void 0:s.completeEdit(r);Hh(a,h=>{h!==!1&&(e.updateInteractionState(Rt.default),n.dealTableHover())})}},o=r=>{var s;const l=r.target;if(!t.getElement().contains(l)){const a=(s=t.editorManager)===null||s===void 0?void 0:s.completeEdit(r);Hh(a,h=>{var d,u;if(h!==!1&&(!((d=t.options.select)===null||d===void 0)&&d.outsideClickDeselect)){const c=!!(!((u=e.select.ranges)===null||u===void 0)&&u.length);n.dealTableSelect(),e.endSelectCells(!0,c)}})}};n.globalEventListeners.push({name:"pointerup",env:"document",callback:i}),n.globalEventListeners.push({name:"pointerdown",env:"document",callback:o}),Ce.addEventListener("pointerup",i),Ce.addEventListener("pointerdown",o),t.scenegraph.tableGroup.addEventListener("pointerdown",r=>{var s,l,a,h,d;if(t.hasListeners(J.MOUSEDOWN_TABLE)&&t.fireListeners(J.MOUSEDOWN_TABLE,{event:r.nativeEvent}),t.eventManager.isDown=!0,t.eventManager.LastBodyPointerXY={x:r.x,y:r.y},t.eventManager.LastPointerXY={x:r.x,y:r.y},r.button!==0)return;const u=$e(r);if(n.downIcon=void 0,e.interactionState!==Rt.default||(t.isPivotChart()&&((s=u==null?void 0:u.eventArgs)===null||s===void 0?void 0:s.target.type)!=="chart"&&t.scenegraph.updateChartState(null),((l=u.eventArgs)===null||l===void 0?void 0:l.target)!==((a=e.residentHoverIcon)===null||a===void 0?void 0:a.icon)&&e.hideMenu(),((h=u==null?void 0:u.eventArgs)===null||h===void 0?void 0:h.target.type)==="chart"))return;const c=(d=t.editorManager)===null||d===void 0?void 0:d.completeEdit(r.nativeEvent);Hh(c,g=>{var f,p,v,m,b,w,C;if(g===!1)return;const _=!((v=(p=(f=u==null?void 0:u.eventArgs)===null||f===void 0?void 0:f.target)===null||p===void 0?void 0:p.role)===null||v===void 0)&&v.startsWith("icon")?u.eventArgs.target:!((m=r.target.role)===null||m===void 0)&&m.startsWith("icon")?r.target:void 0;if(n.downIcon=_,_&&_.attribute.interactive!==!1)_.attribute.funcType===Zt.dragReorder&&(e.startMoveCol(u.eventArgs.col,u.eventArgs.row,u.abstractPos.x,u.abstractPos.y,(w=(b=u.eventArgs)===null||b===void 0?void 0:b.event)===null||w===void 0?void 0:w.nativeEvent),e.updateInteractionState(Rt.grabing));else if(r.pointerType==="touch")n.touchEnd=!1,n.touchSetTimeout=setTimeout(()=>{n.isTouchdown=!1,n.touchMove=!0,(n.touchEnd||!n.checkColumnResize(u,!0)&&!n.checkRowResize(u,!0))&&(n.touchEnd||!n.chechColumnMover(u))?n.dealTableSelect(u)&&!n.touchEnd&&e.updateInteractionState(Rt.grabing):e.updateInteractionState(Rt.grabing)},500),n.dealTableHover(u);else{if(!n.checkCellFillhandle(u)&&(n.checkColumnResize(u,!0)||n.checkRowResize(u,!0)))return t.scenegraph.updateChartState(null),void e.updateInteractionState(Rt.grabing);if(n.chechColumnMover(u)||n.checkCellFillhandle(u,!0)&&n.dealFillSelect(u))return void e.updateInteractionState(Rt.grabing);n.dealTableSelect(u)&&e.updateInteractionState(Rt.grabing)}if(t.hasListeners(J.MOUSEDOWN_CELL)){const y=$e(r);y.eventArgs&&t.fireListeners(J.MOUSEDOWN_CELL,{col:y.eventArgs.col,row:y.eventArgs.row,event:r.nativeEvent,target:(C=y==null?void 0:y.eventArgs)===null||C===void 0?void 0:C.target,mergeCellInfo:y.eventArgs.mergeInfo})}})}),t.scenegraph.tableGroup.addEventListener("pointerup",r=>{var s,l,a,h;if(r.button===0){if(e.interactionState==="grabing"){if(e.updateInteractionState(Rt.default),e.isResizeCol())Ad(t);else if(e.isResizeRow())Qg(t);else if(e.isMoveCol()){const d=t.stateManager.endMoveCol();Jg(t,d,r.nativeEvent)}else if(e.isSelecting()){t.stateManager.endSelectCells(),t.stateManager.isFillHandle()&&t.stateManager.endFillSelect();const d=$e(r);if(t.eventManager.isDraging&&d.eventArgs&&t.hasListeners(J.DRAG_SELECT_END)){const u={event:r.nativeEvent,cells:[],col:d.eventArgs.target.col,row:d.eventArgs.target.row,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:(s=d==null?void 0:d.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=d.eventArgs)===null||l===void 0?void 0:l.mergeInfo};u.cells=t.getSelectedCellInfos(),t.fireListeners(J.DRAG_SELECT_END,u)}}}else e.interactionState===Rt.scrolling&&e.updateInteractionState(Rt.default);if(t.hasListeners(J.MOUSEUP_CELL)){const d=$e(r);d.eventArgs&&t.fireListeners(J.MOUSEUP_CELL,{col:d.eventArgs.col,row:d.eventArgs.row,event:r.nativeEvent,target:(a=d==null?void 0:d.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=d.eventArgs)===null||h===void 0?void 0:h.mergeInfo})}}}),t.scenegraph.tableGroup.addEventListener("rightdown",r=>{var s,l,a,h;const d=$e(r);if(d.eventArgs){e.triggerContextMenu(d.eventArgs.col,d.eventArgs.row,d.abstractPos.x,d.abstractPos.y);const{col:u,row:c}=d.eventArgs;if(t.hasListeners(J.CONTEXTMENU_CELL)){const g=t.getCellInfo(u,c);let f,p;if(!((s=d.eventArgs)===null||s===void 0)&&s.target){const m=Cl((l=d.eventArgs)===null||l===void 0?void 0:l.target);m&&(f=m.icon,p=m.position)}const v=Object.assign(Object.assign({},g),{event:r.nativeEvent,cells:[],targetIcon:f?{name:f.name,position:p,funcType:f.attribute.funcType}:void 0,target:(a=d==null?void 0:d.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=d.eventArgs)===null||h===void 0?void 0:h.mergeInfo});y2(t.stateManager.select.ranges,u,c)?v.cells=t.getSelectedCellInfos():v.cells=[[g]],t.fireListeners(J.CONTEXTMENU_CELL,v)}}}),t.scenegraph.tableGroup.addEventListener("pointertap",r=>{var s,l,a,h,d;if(t.stateManager.columnResize.resizing)return;const u=$e(r);if(!n.touchMove&&r.button===0&&u.eventArgs&&t.hasListeners(J.CLICK_CELL)){const{col:c,row:g}=u.eventArgs,f=t.getCellInfo(c,g);let p,v;if(!((s=u.eventArgs)===null||s===void 0)&&s.target){const b=Cl((l=u.eventArgs)===null||l===void 0?void 0:l.target);b&&(p=b.icon,v=b.position)}const m=Object.assign(Object.assign({},f),{event:r.nativeEvent,federatedEvent:r,cells:[],targetIcon:p?{name:p.name,position:v,funcType:p.attribute.funcType}:void 0,target:(a=u==null?void 0:u.eventArgs)===null||a===void 0?void 0:a.target,mergeCellInfo:(h=u.eventArgs)===null||h===void 0?void 0:h.mergeInfo});t.fireListeners(J.CLICK_CELL,m)}if(!t.stateManager.columnResize.resizing&&!t.stateManager.columnMove.moving&&(n.dealIconClick(r,u),(u==null?void 0:u.eventArgs)&&n.touchSetTimeout&&r.pointerType==="touch")){const c=$e(r);if(n.touchSetTimeout){clearTimeout(n.touchSetTimeout);const g=!!(!((d=e.select.ranges)===null||d===void 0)&&d.length);n.dealTableSelect(c),e.endSelectCells(!0,g),n.touchSetTimeout=void 0}}}),t.scenegraph.stage.addEventListener("pointerdown",r=>{var s,l,a,h;const d=$e(r);!((s=d.eventArgs)===null||s===void 0)&&s.target&&((l=d.eventArgs)===null||l===void 0?void 0:l.target)===((a=e.residentHoverIcon)===null||a===void 0?void 0:a.icon)||e.hideMenu();const u=(h=t.editorManager)===null||h===void 0?void 0:h.completeEdit(r.nativeEvent);Hh(u,c=>{var g;if(c===!1)return;const f=!((g=r.target.role)===null||g===void 0)&&g.startsWith("icon")?r.target:void 0;if(n.downIcon=f,!(f||n.checkCellFillhandle(d)||e.columnResize.resizing||!n.checkColumnResize(d,!0))){t.scenegraph.updateChartState(null),e.updateInteractionState(Rt.grabing);const{eventArgs:p}=d;p!=null&&p.targetCell||t.getCellAt(d.abstractPos.x-fC/2,d.abstractPos.y)&&t.hasListeners(J.MOUSEDOWN_TABLE)&&t.fireListeners(J.MOUSEDOWN_TABLE,{event:r.nativeEvent})}})}),t.scenegraph.stage.addEventListener("pointerup",r=>{e.interactionState==="grabing"&&(e.updateInteractionState(Rt.default),e.isResizeCol()&&Ad(t))}),t.scenegraph.stage.addEventListener("pointertap",r=>{var s,l,a;const h=r.target;if(t.eventManager.isDraging||!h||!h.isDescendantsOf(t.scenegraph.stage)&&h.stage!==h||h.isDescendantsOf(t.scenegraph.tableGroup))t.eventManager.isDraging&&e.isSelecting()&&e.endSelectCells();else{e.updateInteractionState(Rt.default),n.dealTableHover();const d=!!(!((s=e.select.ranges)===null||s===void 0)&&s.length);((a=(l=t.options.select)===null||l===void 0?void 0:l.blankAreaClickDeselect)===null||a===void 0||a)&&n.dealTableSelect(),e.endSelectCells(!0,d),e.updateCursor(),t.scenegraph.updateChartState(null)}}),t.scenegraph.stage.addEventListener("pointermove",r=>{const s=$e(r);e.isResizeCol()||n.checkColumnResize(s)?t.stateManager.select&&n.checkCellFillhandle(s)?e.updateCursor("crosshair"):e.updateCursor("col-resize"):e.isResizeRow()||n.checkRowResize(s)?t.stateManager.select&&n.checkCellFillhandle(s)?e.updateCursor("crosshair"):e.updateCursor("row-resize"):e.isMoveCol()||e.updateCursor()}),t.scenegraph.tableGroup.addEventListener("checkbox_state_change",r=>{var s,l;const a=$e(r),{col:h,row:d}=a.eventArgs,u=t.getCellInfo(h,d),c=ke(t,h,d);if(c)for(let f=c.start.col;f<=c.end.col;f++)for(let p=c.start.row;p<=c.end.row;p++)t.scenegraph.getCell(f,p).forEachChildren(v=>{v.name==="checkbox"&&v.setAttributes({checked:r.target.attribute.checked,indeterminate:r.target.attribute.indeterminate})});const g=Object.assign(Object.assign({},u),{event:r.nativeEvent,target:(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.mergeInfo,checked:r.detail.checked});if(t.isHeader(h,d))t.stateManager.setHeaderCheckedState(u.field,r.detail.checked),t.getCellType(h,d)==="checkbox"&&t.scenegraph.updateCheckboxCellState(h,d,r.detail.checked);else if(t.stateManager.setCheckedState(h,d,u.field,r.detail.checked),t.getCellType(h,d)==="checkbox"){const f=t.stateManager.headerCheckedState[u.field],p=t.stateManager.updateHeaderCheckedState(u.field,h,d);f!==p&&t.scenegraph.updateHeaderCheckboxCellState(h,d,p)}t.fireListeners(J.CHECKBOX_STATE_CHANGE,g),t.scenegraph.updateNextFrame()}),t.scenegraph.tableGroup.addEventListener("radio_checked",r=>{var s,l,a;const h=$e(r),{col:d,row:u,target:c}=h.eventArgs,g=t.getCellInfo(d,u),f=(s=$E.exec(c.id))===null||s===void 0?void 0:s[1],p=ke(t,d,u);if(p)for(let w=p.start.col;w<=p.end.col;w++)for(let C=p.start.row;C<=p.end.row;C++)t.scenegraph.getCell(w,C).forEachChildren(_=>{_.name==="radio"&&_.id===c.id&&_.setAttributes({checked:!0})});const v=t.getBodyColumnDefine(d,u).radioCheckType||"column";if(v==="cell")if(p)for(let w=p.start.col;w<=p.end.col;w++)for(let C=p.start.row;C<=p.end.row;C++)t.scenegraph.getCell(w,C).forEachChildren(_=>{_.name==="radio"&&_.id!==c.id&&_.setAttributes({checked:!1})});else t.scenegraph.getCell(d,u).forEachChildren(w=>{w.name==="radio"&&w.id!==c.id&&w.setAttributes({checked:!1})});else v==="column"&&t.scenegraph.getColGroup(d).forEachChildren(w=>{w.forEachChildren(C=>{C.name==="radio"&&C.id!==c.id&&C.setAttributes({checked:!1})})});const m=f?Number(f):void 0;t.stateManager.setRadioState(d,u,g.field,v,m);const b=Object.assign(Object.assign({},g),{event:r.nativeEvent,target:(l=h==null?void 0:h.eventArgs)===null||l===void 0?void 0:l.target,mergeCellInfo:(a=h==null?void 0:h.eventArgs)===null||a===void 0?void 0:a.mergeInfo,radioIndexInCell:m});t.fireListeners(J.RADIO_STATE_CHANGE,b),t.scenegraph.updateNextFrame()}),t.scenegraph.stage.addEventListener("wheel",r=>{var s;r.path.find(l=>l.role==="table")&&((s=t.editorManager)===null||s===void 0||s.completeEdit(),t.eventManager._enableTableScroll&&xd(r,e))})}function Qk(n){const t=n.table;n.gesture=new QT(t.scenegraph.tableGroup,{tap:{interval:300}}),n.gesture.on("doubletap",e=>{tI(e,t)})}function Ad(n){n.stateManager.endResizeCol();const t=[];for(let e=0;e<n.colCount;e++)t.push(n.getColWidth(e));n.fireListeners(J.RESIZE_COLUMN_END,{col:n.stateManager.columnResize.col,colWidths:t})}function Qg(n){n.stateManager.endResizeRow(),n.fireListeners(J.RESIZE_ROW_END,{row:n.stateManager.rowResize.row,rowHeight:n.getRowHeight(n.stateManager.rowResize.row)})}function tI(n,t){var e,i,o,r,s,l;const a=$e(n);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const u=t.getCellValue(h,d),c=(i=(e=a.eventArgs)===null||e===void 0?void 0:e.targetCell)===null||i===void 0?void 0:i.globalAABBBounds;if(c&&t.internalProps.focusControl.setFocusRect(new _n(c.x1+t.scrollLeft,c.y1+t.scrollTop,c.x2-c.x1,c.y2-c.y1),u),t.hasListeners(J.DBLCLICK_CELL)){const g=t.getCellInfo(h,d);let f,p;if(!((o=a.eventArgs)===null||o===void 0)&&o.target){const m=Cl((r=a.eventArgs)===null||r===void 0?void 0:r.target);m&&(f=m.icon,p=m.position)}const v=Object.assign(Object.assign({},g),{event:n.nativeEvent,federatedEvent:n,cells:[],targetIcon:f?{name:f.name,position:p,funcType:f.attribute.funcType}:void 0,target:(s=a==null?void 0:a.eventArgs)===null||s===void 0?void 0:s.target,mergeCellInfo:(l=a==null?void 0:a.eventArgs)===null||l===void 0?void 0:l.mergeInfo});t.fireListeners(J.DBLCLICK_CELL,v)}}function eI(n){const t=n.table,e=t.stateManager,i=t.scenegraph;i.component.vScrollBar.addEventListener("pointerover",s=>{e.showVerticalScrollBar()}),i.component.hScrollBar.addEventListener("pointerover",s=>{e.showHorizontalScrollBar()}),i.component.vScrollBar.addEventListener("pointerout",s=>{e.interactionState!==Rt.scrolling&&e.hideVerticalScrollBar()}),i.component.hScrollBar.addEventListener("pointerout",s=>{e.interactionState!==Rt.scrolling&&e.hideHorizontalScrollBar()}),i.component.vScrollBar.addEventListener("pointermove",s=>{i.table.stateManager.updateCursor("default"),s.stopPropagation()}),i.component.vScrollBar.addEventListener("pointerdown",s=>{s.stopPropagation(),i.table.hasListeners(J.MOUSEDOWN_TABLE)&&i.table.fireListeners(J.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),i.component.vScrollBar.addEventListener("scrollDown",s=>{var l;i.table.eventManager.LastBodyPointerXY={x:s.x,y:s.y},i.table.eventManager.isDown=!0,e.interactionState!==Rt.scrolling&&e.updateInteractionState(Rt.scrolling),i.table.stateManager.hideMenu(),(l=i.table.editorManager)===null||l===void 0||l.completeEdit(),i.table.hasListeners(J.MOUSEDOWN_TABLE)&&i.table.fireListeners(J.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),i.component.vScrollBar.addEventListener("pointerup",()=>{e.fastScrolling=!1,i.table.eventManager.isDraging=!1,e.interactionState===Rt.scrolling&&e.updateInteractionState(Rt.default)}),i.component.vScrollBar.addEventListener("pointerupoutside",()=>{e.fastScrolling=!1,e.interactionState===Rt.scrolling&&e.updateInteractionState(Rt.default)}),i.component.vScrollBar.addEventListener("scrollUp",s=>{i.table.eventManager.isDraging=!1}),i.component.hScrollBar.addEventListener("pointermove",s=>{i.table.stateManager.updateCursor("default"),s.stopPropagation()}),i.component.hScrollBar.addEventListener("pointerdown",s=>{s.stopPropagation(),i.table.hasListeners(J.MOUSEDOWN_TABLE)&&i.table.fireListeners(J.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),i.component.hScrollBar.addEventListener("scrollDown",s=>{var l;i.table.eventManager.LastBodyPointerXY={x:s.x,y:s.y},i.table.eventManager.isDown=!0,e.interactionState!==Rt.scrolling&&e.updateInteractionState(Rt.scrolling),i.table.stateManager.hideMenu(),(l=i.table.editorManager)===null||l===void 0||l.completeEdit(),i.table.hasListeners(J.MOUSEDOWN_TABLE)&&i.table.fireListeners(J.MOUSEDOWN_TABLE,{event:s.nativeEvent})}),i.component.hScrollBar.addEventListener("pointerup",()=>{e.fastScrolling=!1,i.table.eventManager.isDraging=!1,e.interactionState===Rt.scrolling&&e.updateInteractionState(Rt.default)}),i.component.hScrollBar.addEventListener("pointerupoutside",()=>{e.fastScrolling=!1,e.interactionState===Rt.scrolling&&e.updateInteractionState(Rt.default)}),i.component.hScrollBar.addEventListener("scrollUp",s=>{i.table.eventManager.isDraging=!1});const o=Zb(e.updateVerticalScrollBar,20),r=Zb(e.updateHorizontalScrollBar,20);i.component.vScrollBar.addEventListener("scrollDrag",s=>{i.table.eventManager.isDown&&(i.table.eventManager.isDraging=!0),e.fastScrolling=!0,e.interactionState!==Rt.scrolling&&e.updateInteractionState(Rt.scrolling);const l=s.detail.value[0]/(1-s.detail.value[1]+s.detail.value[0]);o(l,s)}),i.component.hScrollBar.addEventListener("scrollDrag",s=>{i.table.eventManager.isDown&&(i.table.eventManager.isDraging=!0),e.fastScrolling=!0,e.interactionState!==Rt.scrolling&&e.updateInteractionState(Rt.scrolling);const l=s.detail.value[0]/(1-s.detail.value[1]+s.detail.value[0]);r(l)})}let Yo=1;function Cy(){return Jb?Yo=1:(Yo=Math.ceil(window.devicePixelRatio||1),Yo>1&&Yo%2!=0&&(Yo+=1)),Yo}Cy();function iI(n){const t=n.table,e=t.stateManager,i=t.internalProps.handler;function o(f){var p;if(t.hasListeners(J.KEYDOWN)){const v={keyCode:(p=f.keyCode)!==null&&p!==void 0?p:f.which,code:f.code,event:f,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth};t.fireListeners(J.KEYDOWN,v)}}i.on(t.getElement(),"blur",f=>{n.dealTableHover()}),i.on(t.getElement(),"keydown",f=>{var p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E;if(f.key==="a"&&(f.ctrlKey||f.metaKey))!((p=t.keyboardOptions)===null||p===void 0)&&p.selectAllOnCtrlA&&(f.preventDefault(),n.deelTableSelectAll());else if(e.select.cellPos.col>=0&&e.select.cellPos.row>=0&&(f.key==="ArrowUp"||f.key==="ArrowDown"||f.key==="ArrowLeft"||f.key==="ArrowRight")){if(((m=(v=t.options.keyboardOptions)===null||v===void 0?void 0:v.moveEditCellOnArrowKeys)===null||m===void 0||!m)&&(!((b=t.editorManager)===null||b===void 0)&&b.editingEditor))return;let F,L;if(f.preventDefault(),f.stopPropagation(),f.key==="ArrowUp"?f.ctrlKey||f.metaKey?(F=e.select.cellPos.col,L=0):(f.shiftKey,F=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row-1))):f.key==="ArrowDown"?f.ctrlKey||f.metaKey?(F=e.select.cellPos.col,L=t.rowCount-1):(f.shiftKey,F=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1))):f.key==="ArrowLeft"?f.ctrlKey||f.metaKey?(F=0,L=e.select.cellPos.row):(f.shiftKey,L=e.select.cellPos.row,F=Math.min(t.colCount-1,Math.max(0,e.select.cellPos.col-1))):f.key==="ArrowRight"&&(f.ctrlKey||f.metaKey?(F=t.colCount-1,L=e.select.cellPos.row):(f.shiftKey,L=e.select.cellPos.row,F=Math.min(t.colCount-1,Math.max(0,e.select.cellPos.col+1)))),ld(t,F,L))return;t.selectCell(F,L,f.shiftKey),(C=(w=t.options.keyboardOptions)===null||w===void 0?void 0:w.moveEditCellOnArrowKeys)!==null&&C!==void 0&&C&&(!((_=t.editorManager)===null||_===void 0)&&_.editingEditor)&&(t.editorManager.completeEdit(),t.getElement().focus(),t.getEditor(F,L)&&t.editorManager.startEditCell(F,L))}else if(f.key==="Escape")(y=t.editorManager)===null||y===void 0||y.cancelEdit(),t.getElement().focus();else if(f.key==="Enter"){if(!((x=t.editorManager)===null||x===void 0)&&x.editingEditor){if(o(f),t.editorManager.completeEdit(),t.getElement().focus(),((S=t.options.keyboardOptions)===null||S===void 0?void 0:S.moveFocusCellOnEnter)===!0){const F=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1));if(ld(t,F,L))return;t.selectCell(F,L,f.shiftKey)}return}if(((A=t.options.keyboardOptions)===null||A===void 0?void 0:A.moveFocusCellOnEnter)===!0){const F=e.select.cellPos.col,L=Math.min(t.rowCount-1,Math.max(0,e.select.cellPos.row+1));if(ld(t,F,L))return;t.selectCell(F,L,f.shiftKey)}else if(((T=(R=t.options.keyboardOptions)===null||R===void 0?void 0:R.editCellOnEnter)===null||T===void 0||T)&&((P=(M=t.stateManager.select.ranges)===null||M===void 0?void 0:M.length)!==null&&P!==void 0?P:0)===1){const F=t.stateManager.select.ranges[0].start.col,L=t.stateManager.select.ranges[0].start.row,z=t.stateManager.select.ranges[0].end.col,D=t.stateManager.select.ranges[0].end.row;F===z&&L===D&&t.getEditor(F,L)&&t.editorManager.startEditCell(F,L)}}else if(f.key==="Tab"){if(((B=(k=t.options.keyboardOptions)===null||k===void 0?void 0:k.moveFocusCellOnTab)===null||B===void 0||B)&&e.select.cellPos.col>=0&&e.select.cellPos.row>=0){if(e.select.cellPos.col===t.colCount-1&&e.select.cellPos.row===t.rowCount-1)return;let F,L;if(f.preventDefault(),e.select.cellPos.col===t.colCount-1?(L=Math.min(t.rowCount-1,e.select.cellPos.row+1),F=t.rowHeaderLevelCount):(L=e.select.cellPos.row,F=e.select.cellPos.col+1),ld(t,F,L))return;t.selectCell(F,L),!((H=t.editorManager)===null||H===void 0)&&H.editingEditor&&(t.editorManager.completeEdit(),t.getElement().focus(),t.getEditor(F,L)&&t.editorManager.startEditCell(F,L))}}else if(!(f.ctrlKey||f.metaKey||f.shiftKey)){const F=t.options.editCellTrigger;if((F==="keydown"||Array.isArray(F)&&F.includes("keydown"))&&!(!((E=t.editorManager)===null||E===void 0)&&E.editingEditor)){const L=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;f.key.match(L)&&t.editorManager.startEditCell(e.select.cellPos.col,e.select.cellPos.row,"")}}o(f)}),i.on(t.getElement(),"copy",f=>{var p,v;if(!((p=t.keyboardOptions)===null||p===void 0)&&p.copySelected){const m=t.getCopyValue();if(I(m)){if(f.preventDefault(),(v=navigator.clipboard)===null||v===void 0?void 0:v.write){const b=C=>{const _=["<table>"],y=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),x=C.split(`\r
|
|
124
|
+
`);return x.forEach(function(S,A){const R=S.split(" "),T=[];A===0&&_.push("<tbody>"),R.forEach(function(M,P){const k=M?M.toString().replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
|
|
125
|
+
`).replace(/\x20{2,}/gi,B=>`<span style="mso-spacerun: yes">${" ".repeat(B.length-1)} </span>`).replace(/\t/gi,"	"):" ";T.push(`<td>${k}</td>`)}),_.push("<tr>",...T,"</tr>"),A===x.length-1&&_.push("</tbody>")}),_.push("</table>"),[y,_.join("")].join("")},w=b(m);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([w],{type:"text/html"}),"text/plain":new Blob([m],{type:"text/plain"})})])}else S2.IE?window.clipboardData.setData("Text",m):f.clipboardData.setData("text/plain",m);t.fireListeners(J.COPY_DATA,{cellRange:t.stateManager.select.ranges,copyData:m})}}}),i.on(t.getElement(),"paste",f=>{var p,v,m,b;if(!((p=t.keyboardOptions)===null||p===void 0)&&p.pasteValueToCell&&t.changeCellValues){if(!((v=t.editorManager)===null||v===void 0)&&v.editingEditor)return;if(((m=t.stateManager.select.ranges)===null||m===void 0?void 0:m.length)>0)if(!((b=navigator.clipboard)===null||b===void 0)&&b.read)navigator.clipboard.read().then(w=>{for(const C of w)C.types.includes("text/html")?l(C):C.types.length===1&&C.types[0]==="text/plain"&&h(C)});else{const w=t.stateManager.select.ranges,C=Math.min(w[0].start.col,w[0].end.col),_=Math.min(w[0].start.row,w[0].end.row),y=(f.clipboardData||window.Clipboard).getData("text").split(`
|
|
126
|
+
`),x=[];y.forEach(function(S,A){const R=S.split(" "),T=[];x.push(T),R.forEach(function(M,P){P===R.length-1&&(M=M.trim()),T.push(M)})}),t.changeCellValues(C,_,x)}}}),i.on(t.getElement(),"contextmenu",f=>{var p;((p=t.eventOptions)===null||p===void 0?void 0:p.preventDefaultContextMenu)!==!1&&f.preventDefault()}),t.options.canvas||i.on(t.getContainer(),"resize",f=>{var p;f.width===0&&f.height===0||((t.autoFillWidth||t.autoFillHeight)&&((p=t.editorManager)===null||p===void 0||p.completeEdit()),I(t.options.pixelRatio)||t.setPixelRatio(Cy()),f.windowSizeNotChange||t.resize())});const r=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function l(f){const p=t.stateManager.select.ranges,v=p.length,m=Math.min(p[v-1].start.col,p[v-1].end.col),b=Math.min(p[v-1].start.row,p[v-1].end.row),w=Math.max(p[v-1].start.col,p[v-1].end.col),C=Math.max(p[v-1].start.row,p[v-1].end.row);let _=0,y=0,x=[];f.getType("text/html").then(S=>{S.text().then(A=>{var R,T;if(A&&/(<table)|(<TABLE)/g.test(A)){const M=Array.from(A.matchAll(r));for(const P of M){const k=P[1],B=Array.from(k.matchAll(s)).map(H=>H[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,`
|
|
127
|
+
`).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/	/gi," ").replace(/ /g," "));x.push(B),_=Math.max(_,(R=B==null?void 0:B.length)!==null&&R!==void 0?R:0)}y=(T=x.length)!==null&&T!==void 0?T:0,x=d(x,y,_,C-b+1,w-m+1),t.changeCellValues(m,b,x,!0)}else navigator.clipboard.read().then(M=>{for(const P of M)P.types.includes("text/plain")&&P.getType("text/plain").then(k=>{k.text().then(a)})})})})}function a(f){var p;const v=t.stateManager.select.ranges,m=v.length,b=Math.min(v[m-1].start.col,v[m-1].end.col),w=Math.min(v[m-1].start.row,v[m-1].end.row),C=Math.max(v[m-1].start.col,v[m-1].end.col),_=Math.max(v[m-1].start.row,v[m-1].end.row);let y=0,x=0,S=[];f.split(`
|
|
128
|
+
`).forEach(function(A,R){var T;const M=A.split(" "),P=[];S.push(P),M.forEach(function(k,B){B===M.length-1&&(k=k.trim()),P.push(k)}),y=Math.max(y,(T=P==null?void 0:P.length)!==null&&T!==void 0?T:0)}),x=(p=S.length)!==null&&p!==void 0?p:0,S=d(S,x,y,_-w+1,C-b+1),t.changeCellValues(b,w,S,!0)}function h(f){const p=t.stateManager.select.ranges,v=p.length,m=Math.min(p[v-1].start.col,p[v-1].end.col),b=Math.min(p[v-1].start.row,p[v-1].end.row),w=Math.max(p[v-1].start.col,p[v-1].end.col),C=Math.max(p[v-1].start.row,p[v-1].end.row);let _=0,y=0;f.getType("text/plain").then(x=>{x.text().then(S=>{var A;const R=S.replace(/\r(?!\n)/g,`\r
|
|
129
|
+
`).split(`\r
|
|
130
|
+
`);let T=[];R.length>1&&R[R.length-1]===""&&R.pop(),R.forEach(function(M,P){var k;const B=M.split(" "),H=[];T.push(H),B.forEach(function(E,F){E.includes(`
|
|
131
|
+
`)&&(E=E.replace(/^"(.*)"$/,"$1").replace(/["]*/g,L=>new Array(Math.floor(L.length/2)).fill('"').join(""))),H.push(E)}),_=Math.max(_,(k=H==null?void 0:H.length)!==null&&k!==void 0?k:0)}),y=(A=T.length)!==null&&A!==void 0?A:0,T=d(T,y,_,C-b+1,w-m+1),t.changeCellValues(m,b,T,!0)})})}function d(f,p,v,m,b){if(b>v||m>p){if(b%v==0&&m%p==0){const w=[];for(let C=0;C<m;C++){const _=[];w.push(_);for(let y=0;y<b;y++){const x=C%p,S=y%v;_.push(f[x][S])}}return w}return f}return f}const u=f=>{t.eventManager.LastBodyPointerXY={x:f.x,y:f.y},t.eventManager.isDown=!0};n.globalEventListeners.push({name:"pointerdown",env:"body",callback:u}),document.body.addEventListener("pointerdown",u);const c=f=>{if(f.target!==t.canvas&&(p=>{var v,m;if(e.menu.isShow&&setTimeout(()=>{t.internalProps.menuHandler.pointInMenuElement(p.clientX,p.clientY)||e.menu.isShow&&e.hideMenu()},0),e.isResizeCol())Ad(t);else if(e.isResizeRow())Qg(t);else if(e.isMoveCol()){const b=t.stateManager.endMoveCol();Jg(t,b,p)}else if(e.isSelecting()&&(!((m=(v=t.stateManager.select)===null||v===void 0?void 0:v.ranges)===null||m===void 0)&&m.length)){const b=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end.col,w=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end.row;if(t.stateManager.endSelectCells(),t.hasListeners(J.DRAG_SELECT_END)){const C={event:p,cells:[],col:b,row:w,scaleRatio:t.canvas.getBoundingClientRect().width/t.canvas.offsetWidth,target:void 0};C.cells=t.getSelectedCellInfos(),t.fireListeners(J.DRAG_SELECT_END,C)}}})(f),t.eventManager.LastBodyPointerXY=null,t.eventManager.isDown=!1,t.eventManager.isDraging=!1,t.eventManager.inertiaScroll.endInertia(),e.interactionState==="grabing"&&e.isResizeCol())Ad(t);else if(e.interactionState==="grabing"&&e.isResizeRow())Qg(t);else if(e.isMoveCol()){const p=t.stateManager.endMoveCol();Jg(t,p,f)}};n.globalEventListeners.push({name:"pointerup",env:"document",callback:c}),document.addEventListener("pointerup",c);const g=f=>{var p,v,m,b,w;if(t.eventManager.isDown&&t.eventManager.LastBodyPointerXY){const x=(v=(p=t.eventManager.LastBodyPointerXY)===null||p===void 0?void 0:p.x)!==null&&v!==void 0?v:f.x,S=(b=(m=t.eventManager.LastBodyPointerXY)===null||m===void 0?void 0:m.y)!==null&&b!==void 0?b:f.y;(Math.abs(x-f.x)>1||Math.abs(S-f.y)>1)&&(t.eventManager.isDraging=!0)}const{x:C,y:_}=t._getMouseAbstractPoint(f,!1);e.interactionState===Rt.grabing&&(e.isResizeCol()?(n.dealColumnResize(C,_),t.hasListeners(J.RESIZE_COLUMN)&&t.fireListeners(J.RESIZE_COLUMN,{col:t.stateManager.columnResize.col,colWidth:t.getColWidth(t.stateManager.columnResize.col)})):e.isResizeRow()&&(n.dealRowResize(C,_),t.hasListeners(J.RESIZE_ROW)&&t.fireListeners(J.RESIZE_ROW,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})));const y=t.stateManager.isSelecting();if(n._enableTableScroll&&n.isDraging&&y&&((w=t.stateManager.select.ranges)===null||w===void 0?void 0:w.length)>0){const x=t.getDrawRange(),S=t.getFrozenRowsHeight(),A=t.getBottomFrozenRowsHeight(),R=t.getFrozenColsWidth(),T=t.getRightFrozenColsWidth(),M=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].start;if(t.isSeriesNumber(M.col,M.row))return;const P=t.stateManager.select.ranges[t.stateManager.select.ranges.length-1].end,k=(t.isFrozenRow(M.row)===!1||t.isFrozenRow(P.row)===!1)&&t.getAllRowsHeight()>t.tableNoFrameHeight,B=(t.isFrozenColumn(M.col)===!1||t.isFrozenColumn(P.col)===!1)&&t.getAllColsWidth()>t.tableNoFrameWidth;if((_>x.bottom-A||_<x.top+S)&&k||(C>x.right-T||C<x.left+R)&&B){t.eventManager.scrollXSpeed=0,t.eventManager.scrollYSpeed=0;let H=!1,E=!1,F=!1,L=!1;_>x.bottom-A&&k&&t.scrollTop+t.tableNoFrameHeight<t.getAllRowsHeight()?(H=!0,t.eventManager.scrollYSpeed=-(_-x.bottom+A)/50):_<x.top+S&&k&&t.scrollTop>0&&(E=!0,t.eventManager.scrollYSpeed=-(_-x.top-S)/50),C>x.right-T&&B&&t.scrollLeft+t.tableNoFrameWidth<t.getAllColsWidth()?(F=!0,t.eventManager.scrollXSpeed=-(C-x.right+T)/50):C<x.left+R&&B&&t.scrollLeft>0&&(L=!0,t.eventManager.scrollXSpeed=-(C-x.left-R)/50),t.eventManager.inertiaScroll.startInertia(t.eventManager.scrollXSpeed,t.eventManager.scrollYSpeed,1),t.eventManager.inertiaScroll.setScrollHandle((z,D)=>{let N,V;xd({deltaX:-z,deltaY:-D},t.stateManager,!1),H?V=t.scrollTop+x.height-A-20:E&&(V=t.scrollTop+S+20),F?N=t.scrollLeft+x.width-T-20:L&&(N=t.scrollLeft+R+20);let G=!1,U=!1;F||L||(C>t.tableNoFrameWidth-t.getRightFrozenColsWidth()&&C<t.tableNoFrameWidth||C>0&&C<t.getFrozenColsWidth()?(N=C,U=!0):N=t.scrollLeft+C),H||E||(_>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()&&_<t.tableNoFrameHeight||_>0&&_<t.getFrozenRowsHeight()?(V=_,G=!0):V=t.scrollTop+_),t.stateManager.updateInteractionState(Rt.grabing);const Z=t.getTargetColAtConsiderRightFrozen(N,U),q=t.getTargetRowAtConsiderBottomFrozen(V,G);I(Z)&&I(q)&&t.stateManager.updateSelectPos(Z.col,q.row,!1,!1,!1,!0)})}else t.eventManager.inertiaScroll.isInertiaScrolling()?t.eventManager.inertiaScroll.endInertia():t.eventManager.scrollYSpeed=0}};n.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}function nI(n){const t=n.table,e=t.stateManager,i=t.scenegraph;n.touchMovePoints=[],t.scenegraph.tableGroup.addEventListener("touchstart",l=>{l.target.isChildOf(i.component.vScrollBar)||l.target.isChildOf(i.component.vScrollBar)||(n.isTouchdown=!0,n.touchMovePoints.push({x:l.page.x,y:l.page.y,timestamp:Date.now()}))});const o=l=>{var a,h;if(n.touchMove&&l.preventDefault(),n.isTouchdown&&_y(l)){if(((h=(a=n.downIcon)===null||a===void 0?void 0:a.attribute)===null||h===void 0?void 0:h.funcType)===Zt.dragReorder)l.preventDefault();else if(n.touchMovePoints.length>4&&n.touchMovePoints.shift(),n.touchMovePoints.push({x:l.changedTouches[0].pageX,y:l.changedTouches[0].pageY,timestamp:Date.now()}),n._enableTableScroll){const d=-n.touchMovePoints[n.touchMovePoints.length-1].x+n.touchMovePoints[n.touchMovePoints.length-2].x,u=-n.touchMovePoints[n.touchMovePoints.length-1].y+n.touchMovePoints[n.touchMovePoints.length-2].y;xd({deltaX:d,deltaY:u},e),l.cancelable&&(t.internalProps.overscrollBehavior==="none"||Math.abs(u)>=Math.abs(d)&&u!==0&&my(u,e)||Math.abs(u)<=Math.abs(d)&&d!==0&&by(d,e))&&l.preventDefault()}}};window.addEventListener("touchmove",o,{passive:!1}),n.globalEventListeners.push({name:"touchmove",env:"window",callback:o});const r=l=>{var a,h,d,u;if(n.touchEnd=!0,n.touchMove=!1,n.isTouchdown&&_y(l)){if(((h=(a=n.downIcon)===null||a===void 0?void 0:a.attribute)===null||h===void 0?void 0:h.funcType)===Zt.dragReorder)l.preventDefault();else if(!((d=n.touchMovePoints)===null||d===void 0)&&d.length&&(n.touchMovePoints.length>4&&n.touchMovePoints.shift(),n.touchMovePoints.push({x:l.changedTouches[0].pageX,y:l.changedTouches[0].pageY,timestamp:Date.now()}),n._enableTableScroll)){const c=n.touchMovePoints[0],g=n.touchMovePoints[((u=n.touchMovePoints)===null||u===void 0?void 0:u.length)-1],f=(g.x-c.x)/(g.timestamp-c.timestamp),p=(g.y-c.y)/(g.timestamp-c.timestamp);n.inertiaScroll.startInertia(f,p,.95),t.eventManager.inertiaScroll.setScrollHandle((v,m)=>{xd({deltaX:-v,deltaY:-m},t.stateManager)})}n.isTouchdown=!1,n.touchMovePoints=[]}};window.addEventListener("touchend",r),n.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=l=>{n.touchEnd=!0,n.touchMove=!1,n.isTouchdown&&(n.isTouchdown=!1,n.touchMovePoints=[])};window.addEventListener("touchcancel",s),n.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}function _y(n){return!!n.changedTouches}function oI(n){n.isPivotChart()&&n.scenegraph.tableGroup.addEventListener("click",t=>{var e;if(!n.stateManager.columnMove.moving&&!n.stateManager.columnResize.resizing)if(t.target.name==="axis-label"){const i=$e(t),{col:o,row:r}=i.eventArgs,s=n.internalProps.layoutMap;let l,a;s.indicatorsAsCol?(l=s.getDimensionKeyInChartSpec(s.rowHeaderLevelCount,r),a=s.getCellHeaderPaths(s.rowHeaderLevelCount-2,r).rowHeaderPaths):(l=s.getDimensionKeyInChartSpec(o,s.columnHeaderLevelCount),a=s.getCellHeaderPaths(o,s.columnHeaderLevelCount-1).colHeaderPaths);const h=a.map(d=>({key:d.dimensionKey,value:d.value})).filter(d=>d.key);if(h.push({key:l,value:t.target.attribute.text}),n._selectedDimensionInChart.length&&rI(n._selectedDimensionInChart,h))return;n._selectedDimensionInChart=h,s.updateDataStateToChartInstance(),Yg(n.scenegraph),n.scenegraph.updateNextFrame()}else!((e=n._selectedDimensionInChart)===null||e===void 0)&&e.length&&(n._selectedDimensionInChart.length=0,n.internalProps.layoutMap.updateDataStateToChartInstance(),Yg(n.scenegraph),n.scenegraph.updateNextFrame())})}function rI(n,t){if(n.length!==t.length)return!1;for(let e=0;e<n.length;e++)if(n[e].key!==t[e].key||n[e].value!==t[e].value)return!1;return!0}function sI(n){n.isPivotChart()&&(n.on(J.MOUSEENTER_CELL,t=>{n.scenegraph.getCell(t.col,t.row).forEachChildren(e=>{if(e.name==="axis"){const i=yy(t.col,t.row,n.internalProps.layoutMap);t.axisPosition=i,n.fireListeners(J.MOUSEENTER_AXIS,t)}})}),n.on(J.MOUSELEAVE_CELL,t=>{n.scenegraph.getCell(t.col,t.row).forEachChildren(e=>{if(e.name==="axis"){const i=yy(t.col,t.row,n.internalProps.layoutMap);t.axisPosition=i,n.fireListeners(J.MOUSELEAVE_AXIS,t)}})}))}function yy(n,t,e){if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount)return"top";if(t===e.rowCount-e.bottomFrozenRowCount&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount)return"bottom";if(n===e.rowHeaderLevelCount-1&&t>=e.rowHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"left"}else{if(n===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"left";if(n===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return"right";if(t===e.rowCount-e.bottomFrozenRowCount&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount)return"bottom"}return"bottom"}class lI{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new Zk(t.stateManager),Wt.mode==="node"||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout(()=>{this.bindSelfEvent()},0))}bindOuterEvent(){Jk(this),iI(this),eI(this),nI(this),Qk(this)}updateEventBinder(){setTimeout(()=>{var t;this.table.isReleased||(j_(this.table)&&((t=this.handleTextStickBindId)===null||t===void 0?void 0:t.length)===0?(this.handleTextStickBindId.push(this.table.on(J.SCROLL,e=>{bl(this.table)})),this.handleTextStickBindId.push(this.table.on(J.RESIZE_COLUMN_END,e=>{bl(this.table)})),this.handleTextStickBindId.push(this.table.on(J.RESIZE_ROW_END,e=>{bl(this.table)}))):!j_(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach(e=>{this.table.off(e)}),this.handleTextStickBindId=[]),vy(this.table))},0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;this.table.on(J.ICON_CLICK,e=>{var i;const{col:o,row:r,x:s,y:l,funcType:a,icon:h,event:d}=e;if(a===Zt.dropDown)t.triggerDropDownMenu(o,r,s,l,d);else if(a===Zt.sort)t.triggerSort(o,r,h,d);else if(a===Zt.frozen)t.triggerFreeze(o,r,h);else if(a===Zt.drillDown)Gk(this.table);else if(a===Zt.collapse||a===Zt.expand){const u=!!(!((i=t.select.ranges)===null||i===void 0)&&i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,u),this.table.toggleHierarchyState(o,r)}}),this.table.on(J.DROPDOWN_MENU_CLICK,()=>{t.hideMenu()}),this.updateEventBinder(),Vk(this.table),this.table.on(J.DBLCLICK_CELL,e=>{var i;if(e.federatedEvent){const o=$e(e.federatedEvent),r=this.table.scenegraph.getResizeColAt(o.abstractPos.x,o.abstractPos.y,(i=o.eventArgs)===null||i===void 0?void 0:i.targetCell);if(this.table.eventManager.checkCellFillhandle(o))this.table.fireListeners(J.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0){this.table.scenegraph.updateAutoColWidth(r.col),this.table.internalProps._widthResizedColMap.add(r.col),this.table.scenegraph.updateChartSizeForResizeColWidth(r.col);const s=this.table.stateManager;s.columnResize.col<s.table.frozenColCount&&!s.table.isPivotTable()&&!s.table.transpose&&s.table.scenegraph.component.setFrozenColumnShadow(s.table.frozenColCount-1,s.columnResize.isRightFrozen);const l=[];for(let a=0;a<this.table.colCount;a++)l.push(this.table.getColWidth(a));this.table.fireListeners(J.RESIZE_COLUMN_END,{col:r.col,colWidths:l})}}}),this.table.isPivotTable()&&Uk(this.table)&&jk(this.table),vy(this.table),oI(this.table),sI(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,r,s;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:l}=t;if(l){if(l.target.name==="checkbox"||l.target.name==="radio")return!1;const a=this.table.getBodyColumnDefine(l.col,l.row);if(this.table.isHeader(l.col,l.row)&&(a!=null&&a.disableHeaderSelect||!((i=this.table.stateManager.select)===null||i===void 0)&&i.disableHeader))return e||this.table.stateManager.updateSelectPos(-1,-1),!1;if(!this.table.isHeader(l.col,l.row)&&(a!=null&&a.disableSelect)){if(!e){const h=!!(!((o=this.table.stateManager.select.ranges)===null||o===void 0)&&o.length);this.table.stateManager.updateSelectPos(-1,-1),h&&this.table.stateManager.endSelectCells(!0,h)}return!1}return!this.table.isPivotChart()||((r=t==null?void 0:t.eventArgs)===null||r===void 0?void 0:r.target.name)!=="axis-label"&&((s=t==null?void 0:t.eventArgs)===null||s===void 0?void 0:s.target.type)!=="chart"?(this.table.stateManager.updateSelectPos(l.col,l.row,l.event.shiftKey,l.event.ctrlKey||l.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:r}=t;if(r){if(!((o=(i=this.table.stateManager.select)===null||i===void 0?void 0:i.ranges)===null||o===void 0)&&o.length&&this.table.stateManager.isFillHandle()){let s,l;const a=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(I(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(s=r.row,l=a.end.col):(s=a.end.row,l=r.col)),this.table.stateManager.updateSelectPos(e?l:a.end.col,e?s:a.end.row,!0,r.event.ctrlKey||r.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0),this.table.fireListeners(J.SELECTED_CELL,{ranges:this.table.stateManager.select.ranges,col:0,row:0})}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t;if(this.table.options.enableTreeStickCell&&!i)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,i==null?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,r,s;if(!((i=this.table.options.excelOptions)===null||i===void 0)&&i.fillHandle){const{eventArgs:l}=t;if(l&&(!((r=(o=this.table.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0)&&r.length)){const a=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),h=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),d=this.table.scenegraph.highPerformanceGetCell(a,h).globalAABBBounds,u=Math.abs(t.abstractPos.x-d.x2),c=Math.abs(t.abstractPos.y-d.y2),g=18;if(!((s=this.table.stateManager.fillHandle)===null||s===void 0)&&s.isFilling||u<=g/2&&c<=g/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i,o;const{eventArgs:r}=t;return!!(r&&this.table.isHeader(r.col,r.row)&&(nk(r.col,r.row,this.table.stateManager.select.ranges)||!((e=this.table.options.select)===null||e===void 0)&&e.disableHeaderSelect||!((i=this.table.options.select)===null||i===void 0)&&i.disableSelect)&&this.table._canDragHeaderPosition(r.col,r.row))&&(this.table.stateManager.startMoveCol(r.col,r.row,t.abstractPos.x,t.abstractPos.y,(o=r==null?void 0:r.event)===null||o===void 0?void 0:o.nativeEvent),!0)}dealColumnMover(t){var e;const{eventArgs:i}=t;I(i.col)&&I(i.row)&&this.table.stateManager.updateMoveCol(i.col,i.row,t.abstractPos.x,t.abstractPos.y,(e=i==null?void 0:i.event)===null||e===void 0?void 0:e.nativeEvent)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:r,col:s,row:l}=i||{target:t.target,event:t,col:-1,row:-1},a=o;if(a.role&&a.role.startsWith("icon-"))return this.table.fireListeners(J.ICON_CLICK,{name:a.name,x:(a.globalAABBBounds.x1+a.globalAABBBounds.x2)/2,y:a.globalAABBBounds.y2,col:s,row:l,funcType:a.attribute.funcType,icon:a,event:r}),!0;if(o instanceof rn){const h=o.pickIcon(r.global);if(h)return this.table.fireListeners(J.ICON_CLICK,{name:h.attribute.id,x:h.globalX+h.globalAABBBounds.width()/2,y:h.globalY+h.AABBBounds.height(),col:s,row:l,funcType:h.attribute.funcType,icon:h,event:r}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach(t=>{t.env==="document"?document.removeEventListener(t.name,t.callback):t.env==="body"?document.body.removeEventListener(t.name,t.callback):t.env==="window"&&window.removeEventListener(t.name,t.callback)}),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}let wy;const aI=n=>{const t=n.value;return Number(t)>80?"#20a8d8":Number(t)>50?"#4dbd74":Number(t)>20?"#ffc107":"#f86c6b"};class Rd extends ro{static get DEFAULT(){return wy||(wy=new Rd)}constructor(t={},e={}){var i,o,r,s,l,a,h,d,u,c,g,f,p,v,m;super(t,e),this._showBar=(i=t.showBar)===null||i===void 0||i,this._barColor=(o=t.barColor)!==null&&o!==void 0?o:aI,this._barPositiveColor=(r=t.barPositiveColor)!==null&&r!==void 0?r:"#4dbd74",this._barNegativeColor=(s=t.barNegativeColor)!==null&&s!==void 0?s:"#f86c6b",this._barAxisColor=(l=t.barAxisColor)!==null&&l!==void 0?l:"black",this._barBgColor=t.barBgColor,this._barHeight=(a=t.barHeight)!==null&&a!==void 0?a:3,this._barHeight=(h=t.barHeight)!==null&&h!==void 0?h:3,this._barBottom=(d=t.barBottom)!==null&&d!==void 0?d:0,this._barPadding=(u=t.barPadding)!==null&&u!==void 0?u:[0,0,0,0],this._showBarMark=(c=t.showBarMark)!==null&&c!==void 0&&c,this._barMarkPositiveColor=(g=t.barMarkPositiveColor)!==null&&g!==void 0?g:"#4dbd74",this._barMarkNegativeColor=(f=t.barMarkNegativeColor)!==null&&f!==void 0?f:"#f86c6b",this._barMarkWidth=(p=t.barMarkWidth)!==null&&p!==void 0?p:2,this._barMarkPosition=(v=t.barMarkPosition)!==null&&v!==void 0?v:"right",this._barRightToLeft=(m=t.barRightToLeft)!==null&&m!==void 0&&m}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new Rd(this,null)}}const hI=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive","isGif"];class dI{constructor(t){this._table=t;const e=an();this.expandIcon=e[ui.expandIconName],this.collapseIcon=e[ui.collapseIconName]}getIcons(t,e,i,o,r){const s=[],l=this.getHierarchyIcon(t,e);l&&s.push(l);const{icon:a}=this._table.getBodyColumnDefine(t,e);if(a){let h;typeof a=="function"?h=a({col:t,row:e,value:i,dataValue:o,table:this._table}):h=a;const d=an(),u=c=>{let g;g=typeof c=="string"?d[c]:c,g&&s.push(g)};Array.isArray(h)?h.forEach((c,g)=>{u(c)}):u(h)}return r&&s.forEach((h,d)=>{(h.content||h.src)&&(s[d]=this.getCellIconFromRecordValue(h,t,e))}),s}getStyleClass(t){switch(t){case"text":case"link":return Ys;case"image":case"video":return JH;case"chart":case"sparkline":return ro;case"progressbar":return Rd;case"checkbox":return rg;case"radio":return zo}return Ys}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map(s=>this.getCellIconFromRecordValue(s,e,i));if(!rC.isObject(t)||typeof t=="function")return this._table.getFieldData(t,e,i);const o={},r=t;return hI.forEach(s=>{var l,a;if(r[s]!==void 0){const h=this._table.getFieldData(r[s],e,i);I(h)?o[s]=h:!((a=(l=this._table)._hasField)===null||a===void 0)&&a.call(l,r[s],e,i)||(o[s]=r[s])}}),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===Pt.expand?this.expandIcon:i===Pt.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+((t=this.expandIcon.marginLeft)!==null&&t!==void 0?t:0)+((e=this.expandIcon.marginRight)!==null&&e!==void 0?e:0)}}function xn(n,t){const e=document.createElement(n);return t&&e.classList.add(...t),e}function uI(){if(Wt.mode==="node")return;const n=document.createElement("style");n.id="vtable-menu-styleSheet",n.textContent=`
|
|
132
|
+
@keyframes vtable__menu-element--shown-animation {
|
|
133
|
+
0% {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
}
|
|
136
|
+
100% {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.vtable__menu-element {
|
|
141
|
+
position: absolute;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
border-radius: 4px;
|
|
144
|
+
background-color: #fff;
|
|
145
|
+
padding: 6px 0;
|
|
146
|
+
/* pointer-events: none; */
|
|
147
|
+
user-select: none;
|
|
148
|
+
color: #000;
|
|
149
|
+
max-width: 300px;
|
|
150
|
+
z-index: 99999;
|
|
151
|
+
border: #CCC 0.5px solid;
|
|
152
|
+
cursor: default;
|
|
153
|
+
width: max-content;
|
|
154
|
+
box-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);
|
|
155
|
+
max-height: 100%;
|
|
156
|
+
overflow-y: auto;
|
|
157
|
+
}
|
|
158
|
+
.vtable__menu-element--hidden {
|
|
159
|
+
opacity: 0;
|
|
160
|
+
/* transform: translate(-50%, -50%); */
|
|
161
|
+
transition: opacity 75ms linear;
|
|
162
|
+
z-index: -9999;
|
|
163
|
+
}
|
|
164
|
+
.vtable__menu-element--shown {
|
|
165
|
+
opacity: 1;
|
|
166
|
+
/* transform: translate(-50%, -50%); */
|
|
167
|
+
animation: vtable__menu-element--shown-animation 150ms ease-out;
|
|
168
|
+
}
|
|
169
|
+
.vtable__menu-element__content {
|
|
170
|
+
font-family: Roboto;
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
display: inline-block;
|
|
174
|
+
/* height: 100%; */
|
|
175
|
+
line-height: 30px;
|
|
176
|
+
}
|
|
177
|
+
.vtable__menu-element__item {
|
|
178
|
+
height: 32px;
|
|
179
|
+
padding: 0px 12px;
|
|
180
|
+
cursor: pointer;
|
|
181
|
+
position: relative;
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: flex-start;
|
|
185
|
+
}
|
|
186
|
+
.vtable__menu-element__item:hover {
|
|
187
|
+
background-color: rgba(27, 31, 35, 0.06);
|
|
188
|
+
}
|
|
189
|
+
.vtable__menu-element__icon{
|
|
190
|
+
/* vertical-align: top; */
|
|
191
|
+
display: flex;
|
|
192
|
+
/* line-height: 30px; */
|
|
193
|
+
margin-right: 6px;
|
|
194
|
+
}
|
|
195
|
+
.vtable__menu-element__no-event {
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
}
|
|
198
|
+
.vtable__menu-element--select {
|
|
199
|
+
color: #2E68CF;
|
|
200
|
+
}.vtable__menu-element--normal {
|
|
201
|
+
color: rgba(20, 20, 20, 0.9);;
|
|
202
|
+
}
|
|
203
|
+
.vtable__menu-element__split {
|
|
204
|
+
height: 0px;
|
|
205
|
+
border: 1px solid rgb(209, 213, 218);
|
|
206
|
+
margin: 5px 0;
|
|
207
|
+
}
|
|
208
|
+
.vtable__menu-element__title {
|
|
209
|
+
color: rgb(149, 149, 149);
|
|
210
|
+
}
|
|
211
|
+
.vtable__menu-element__arrow {
|
|
212
|
+
position: absolute;
|
|
213
|
+
right: 3px;
|
|
214
|
+
font-weight: bold;
|
|
215
|
+
margin-top: 1px;
|
|
216
|
+
}
|
|
217
|
+
.vtable__menu-element__item-text {
|
|
218
|
+
margin-right: 15px;
|
|
219
|
+
}
|
|
220
|
+
`,document.head.appendChild(n)}uI();const Hi="vtable__menu-element",cI=`${Hi}__item`,tf=`${Hi}__content`,mi=`${Hi}--hidden`,Kn=`${Hi}--shown`,gI=`${Hi}--normal`,fI=`${Hi}--select`,pI=`${Hi}__icon`,vI=`${Hi}__split`,mI=`${Hi}__title`,bI=`${Hi}__arrow`,_l=`${Hi}__no-event`,Sy=`${Hi}__item-text`;function xy(){return xn("div",[Hi,mi])}function yl(n,t,e,i,o,r){const s=n.getCellRange(i,o);for(let l=0;l<t.length;l++){const a=t[l];let{col:h,row:d}=a;const{field:u,menuKey:c}=a;if(typeof h!="number"||typeof d!="number")if(n.isPivotTable()){const g=n.internalProps.layoutMap.getPivotCellAdress(u);if(!g)continue;h=g.col,d=g.row}else{const g=n.internalProps.layoutMap.getHeaderCellAddressByField(u);if(!g)continue;h=g.col,d=g.row}if(I(h)&&I(d)&&Ti(s,h,d)&&e===c)return!0}return!1}class CI{constructor(t){var e,i,o,r,s,l,a,h,d,u;this._handler=new Lh,this._rootElement=xy(),this._secondElement=xy(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",c=>{c.stopPropagation()}),(e=this._rootElement)===null||e===void 0||e.addEventListener("mousedown",c=>{c.stopPropagation(),c.preventDefault()}),(i=this._rootElement)===null||i===void 0||i.addEventListener("touchend",c=>{if(c.stopPropagation(),c.preventDefault(),this._rootElement.classList.contains(mi))return;const{col:g,row:f,dropDownIndex:p,menuKey:v,text:m,hasChildren:b}=c.target;if(typeof p!="number"||b)return void c.stopPropagation();const w=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f),C=t._dropDownMenuIsHighlight(g,f,p);t.fireListeners(J.DROPDOWN_MENU_CLICK,{col:g,row:f,field:w,menuKey:v,text:m,highlight:C,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(J.DROPDOWN_MENU_CLEAR,null),t.fireListeners(J.HIDE_MENU,null),c.stopPropagation()}),(o=this._rootElement)===null||o===void 0||o.addEventListener("click",c=>{if(c.stopPropagation(),c.preventDefault(),this._rootElement.classList.contains(mi))return;const{col:g,row:f,dropDownIndex:p,menuKey:v,text:m,hasChildren:b}=c.target;if(typeof p!="number"||b)return void c.stopPropagation();const w=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f),C=t._dropDownMenuIsHighlight(g,f,p);t.fireListeners(J.DROPDOWN_MENU_CLICK,{col:g,row:f,field:w,menuKey:v,text:m,highlight:C,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(J.DROPDOWN_MENU_CLEAR,null),t.fireListeners(J.HIDE_MENU,null),c.stopPropagation()}),(r=this._rootElement)===null||r===void 0||r.addEventListener("mousemove",c=>{var g,f;if(this._rootElement.classList.contains(mi))return;c.stopPropagation();const{hasChildren:p,dropDownIndex:v,col:m,row:b,sub:w}=c.target;if(p){this._showChildrenIndex=v;const C=this._secondElement;C==null||C.classList.remove(mi),C==null||C.classList.add(Kn),C.innerHTML="";const _=(g=this._menuInstanceInfo.content[v])===null||g===void 0?void 0:g.children;for(let x=0;x<_.length;x++){const S=_[x],A=Ay(S,!!t.stateManager.menu.dropDownMenuHighlight&&yl(t,t.stateManager.menu.dropDownMenuHighlight,typeof S=="object"?(S==null?void 0:S.menuKey)||(S==null?void 0:S.text):S,m,b));A.col=m,A.row=b,A.dropDownIndex=x,typeof S=="string"?(A.text=S,A.menuKey=S):typeof S=="object"&&(A.text=S.text,A.menuKey=S.menuKey||S.text),A.sub=!0,A.sub=!0,C.appendChild(A)}const y=c.target.getBoundingClientRect();this._bindSecondElement(t,m,b,y.right,y.top)}else if(p&&this._showChildrenIndex===v){const C=this._secondElement;C==null||C.classList.remove(mi),C==null||C.classList.add(Kn)}else!w&&(!((f=this._secondElement)===null||f===void 0)&&f.classList.contains(Kn))&&setTimeout(()=>{if(this._mouseEnterSecondElement!==!0){this._showChildrenIndex=-1;const C=this._secondElement;C==null||C.classList.remove(Kn),C==null||C.classList.add(mi)}},300)}),(s=this._secondElement)===null||s===void 0||s.addEventListener("wheel",c=>{c.stopPropagation()}),(l=this._secondElement)===null||l===void 0||l.addEventListener("mousemove",c=>{this._rootElement.classList.contains(mi)||c.stopPropagation()}),(a=this._secondElement)===null||a===void 0||a.addEventListener("mouseenter",c=>{this._mouseEnterSecondElement=!0}),(h=this._secondElement)===null||h===void 0||h.addEventListener("mouseleave",c=>{this._mouseEnterSecondElement=!1}),(d=this._secondElement)===null||d===void 0||d.addEventListener("mousedown",c=>{c.stopPropagation(),c.preventDefault()}),(u=this._secondElement)===null||u===void 0||u.addEventListener("click",c=>{if(c.stopPropagation(),c.preventDefault(),this._secondElement.classList.contains(mi))return;const{col:g,row:f,dropDownIndex:p,menuKey:v,text:m,hasChildren:b}=c.target;if(typeof p!="number"||b)return void c.stopPropagation();const w=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(g,f):t.getHeaderField(g,f);let C=!1;this._menuInstanceInfo.content.forEach((_,y)=>{if(typeof _=="object"&&_.children&&_.children.length)for(let x=0;x<_.children.length;x++){const S=_.children[x];if(yl(t,t.stateManager.menu.dropDownMenuHighlight,typeof S=="object"?S==null?void 0:S.menuKey:S,g,f)&&v===(typeof S=="object"?S==null?void 0:S.menuKey:S))return void(C=!0)}}),t.fireListeners(J.DROPDOWN_MENU_CLICK,{col:g,row:f,field:w,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(g,f):void 0,menuKey:v,text:m,highlight:C,cellLocation:t.getCellLocation(g,f),event:c}),t.fireListeners(J.DROPDOWN_MENU_CLEAR,null),t.fireListeners(J.HIDE_MENU,null),c.stopPropagation()})}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;t!=null&&t.parentElement&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){var r,s;const l=this._rootElement,a=this._secondElement;if(this._menuInstanceInfo=o,l==null||l.classList.remove(Kn),l==null||l.classList.add(mi),a==null||a.classList.remove(Kn),a==null||a.classList.add(mi),this._canBindToCell(t,e,i)){if(l.innerHTML="",Array.isArray(o.content)){const h=o.content;for(let d=0;(r=d<(h==null?void 0:h.length))!==null&&r!==void 0&&r;d++){const u=h[d];let c=!!t.stateManager.menu.dropDownMenuHighlight&&yl(t,t.stateManager.menu.dropDownMenuHighlight,typeof u=="object"?(u==null?void 0:u.menuKey)||(u==null?void 0:u.text):u,e,i);if(t.stateManager.menu.dropDownMenuHighlight&&typeof u=="object"&&Array.isArray(u.children)&&u.children.length)for(let f=0;f<u.children.length;f++){const p=u.children[f];if(yl(t,t.stateManager.menu.dropDownMenuHighlight,typeof p=="object"?(p==null?void 0:p.menuKey)||(p==null?void 0:p.text):p,e,i)){c=!0;break}}const g=Ay(u,c);g.col=e,g.row=i,g.dropDownIndex=d,typeof u=="string"?(g.text=u,g.menuKey=u):typeof u=="object"&&(g.text=u.text,g.menuKey=u.menuKey||u.text,!((s=u.children)===null||s===void 0)&&s.length&&(g.hasChildren=!0)),l.appendChild(g)}}if(this._bindToCell(t,e,i,o.position,o.referencePosition))return l==null||l.classList.add(Kn),l==null||l.classList.remove(mi),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,t!=null&&t.parentElement&&(t.classList.remove(Kn),t.classList.add(mi)),e!=null&&e.parentElement&&(e.classList.remove(Kn),e.classList.add(mi))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),r=t.getElement(),{top:s,bottom:l,left:a,right:h}=o;if(t.isFrozenCell(e,i))return!0;if(l<t.getFrozenRowsHeight()||h<t.getFrozenColsWidth()||a>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||s>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(d<s)&&!(u<a)}_bindToCell(t,e,i,o,r){const s=this._rootElement,l=t.getElement(),{width:a,height:h}=t.internalProps.element.getBoundingClientRect();if(s){s.parentElement!==l&&l.appendChild(s),s.style.left="0px";const d=.8*a;s.style.maxWidth=`${d}px`;const u=s.offsetWidth,c=s.offsetHeight;let g,f;o?(g=o.x,f=o.y):r&&(g=r.rect.right-u,f=r.rect.bottom);const p=l.getBoundingClientRect(),v=p.width/l.offsetWidth,m=p.height/l.offsetHeight;return f*m+c>h&&(f=(h-c)/m),f<0&&(f/=2),s.style.top=`${f}px`,g<0?g=0:g*v+u>a&&(g=(a-u)/v),s.style.left=`${g}px`,!0}return!1}_bindSecondElement(t,e,i,o,r){const s=this._secondElement,l=this._rootElement,a=t.getElement(),{width:h,left:d,top:u}=t.internalProps.element.getBoundingClientRect(),{x:c,y:g,width:f}=l.getBoundingClientRect();if(s){s.parentElement!==a&&a.appendChild(s),s.style.left="0px";const p=.8*h;s.style.maxWidth=`${p}px`;const v=s.clientWidth,m=r-4-u,b=o-d;s.style.top=`${m}px`;let w=b;return w+v>h?w=w-v-f:w+=4,s.style.left=`${w}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:r,width:s,height:l}=i.getBoundingClientRect();if(t>o-5&&t<o+s+5&&e>r-5&&e<r+l+5)return!0;if(this._secondElement){const{x:a,y:h,width:d,height:u}=i.getBoundingClientRect();if(t>a-5&&t<a+d+5&&e>h-5&&e<h+u+5)return!0}return!1}}function Ay(n,t){var e,i,o;const r=xn("div",[cI,t?fI:gI]);if(typeof n=="string"){const s=xn("span",[tf,_l,Sy]);s.innerHTML=n,r.appendChild(s)}else if(typeof n=="object"){const s=(e=n.type)!==null&&e!==void 0?e:"item";if(s==="split")return r==null||r.classList.add(vI),r;if(!((i=n==null?void 0:n.icon)===null||i===void 0)&&i.svg)if(pg.test(n.icon.svg)){const a=new Image;n.icon.width?a.style.width=n.icon.width.toString()+"px":a.style.width="16px",n.icon.height?a.style.height=n.icon.height.toString()+"px":a.style.height="16px",a.src=n.icon.svg,r.appendChild(a)}else{const a=xn("span",[pI,_l]);a.innerHTML=t&&n.selectedIcon&&n.selectedIcon.svg?n.selectedIcon.svg:n.icon.svg,n.icon.width&&a.children[0].setAttribute("width",n.icon.width.toString()),n.icon.height&&a.children[0].setAttribute("height",n.icon.height.toString()),r.appendChild(a)}const l=xn("span",[tf,_l,Sy]);if(l.innerHTML=n.text,r.appendChild(l),s==="title")r==null||r.classList.add(_l,mI);else if(!((o=n==null?void 0:n.children)===null||o===void 0)&&o.length){const a=xn("span",[tf,_l,bI]);a.innerHTML=t?'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#2E68CF" fill-opacity="0.65"></path></svg>':'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#141414" fill-opacity="0.65"></path></svg>',r.appendChild(a)}}return r}let Ry;const _I={CHANGE_STYLE:"change_style"};class Xo extends Th{static get EVENT_TYPE(){return _I}static get DEFAULT(){return Ry||(Ry=new Xo)}constructor(t={},e={}){var i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F;super(),this._defaultPadding=[10,16,10,16],this._color=(i=t.color)!==null&&i!==void 0?i:e==null?void 0:e.color,this._strokeColor=(o=t==null?void 0:t.strokeColor)!==null&&o!==void 0?o:e==null?void 0:e.strokeColor,this._fontSize=(r=t.fontSize)!==null&&r!==void 0?r:e==null?void 0:e.fontSize,this._fontFamily=(s=t.fontFamily)!==null&&s!==void 0?s:e==null?void 0:e.fontFamily,this._fontWeight=(l=t.fontWeight)!==null&&l!==void 0?l:e==null?void 0:e.fontWeight,this._fontVariant=(a=t.fontVariant)!==null&&a!==void 0?a:e==null?void 0:e.fontVariant,this._fontStyle=(h=t.fontStyle)!==null&&h!==void 0?h:e==null?void 0:e.fontStyle,this._textOverflow=((d=t.textOverflow)!==null&&d!==void 0?d:e==null?void 0:e.textOverflow)||"ellipsis",this._textStick=(c=(u=t.textStick)!==null&&u!==void 0?u:e==null?void 0:e.textStick)!==null&&c!==void 0&&c,this._textStickBaseOnAlign=(f=(g=t.textStickBaseOnAlign)!==null&&g!==void 0?g:e==null?void 0:e.textStickBaseOnAlign)!==null&&f!==void 0&&f,this._marked=(v=(p=t.marked)!==null&&p!==void 0?p:e==null?void 0:e.marked)!==null&&v!==void 0&&v,this._textAlign=((m=t.textAlign)!==null&&m!==void 0?m:e==null?void 0:e.textAlign)||"left",this._textBaseline=((b=t.textBaseline)!==null&&b!==void 0?b:e==null?void 0:e.textBaseline)||"middle",this._bgColor=(w=t.bgColor)!==null&&w!==void 0?w:e==null?void 0:e.bgColor,this._padding=(_=(C=t.padding)!==null&&C!==void 0?C:e==null?void 0:e.padding)!==null&&_!==void 0?_:this._defaultPadding,this._borderColor=(y=t.borderColor)!==null&&y!==void 0?y:e==null?void 0:e.borderColor,this._lineHeight=(x=t.lineHeight)!==null&&x!==void 0?x:e==null?void 0:e.lineHeight,this._underline=(S=t.underline)!==null&&S!==void 0?S:e==null?void 0:e.underline,this._underlineColor=(A=t.underlineColor)!==null&&A!==void 0?A:e==null?void 0:e.underlineColor,this._underlineDash=(R=t.underlineDash)!==null&&R!==void 0?R:e==null?void 0:e.underlineDash,this._underlineOffset=(T=t.underlineOffset)!==null&&T!==void 0?T:e==null?void 0:e.underlineOffset,this._lineThrough=(M=t.lineThrough)!==null&&M!==void 0?M:e==null?void 0:e.lineThrough,this._lineThroughColor=(P=t.lineThroughColor)!==null&&P!==void 0?P:e==null?void 0:e.lineThroughColor,this._lineThroughDash=(k=t.lineThroughDash)!==null&&k!==void 0?k:e==null?void 0:e.lineThroughDash,this._linkColor=(B=t.linkColor)!==null&&B!==void 0?B:e==null?void 0:e.linkColor,this._cursor=(H=t.cursor)!==null&&H!==void 0?H:e==null?void 0:e.cursor,this._borderLineWidth=(E=t.borderLineWidth)!==null&&E!==void 0?E:e==null?void 0:e.borderLineWidth,this._borderLineDash=(F=t.borderLineDash)!==null&&F!==void 0?F:e==null?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return(t=this._padding)!==null&&t!==void 0?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new Xo(this)}}let Ty;class Td extends Xo{static get DEFAULT(){return Ty||(Ty=new Td)}constructor(t={},e={}){var i;super(t,e),this.textAlign=((i=t.textAlign)!==null&&i!==void 0?i:e==null?void 0:e.textAlign)||"center"}clone(){return new Td(this)}}let My;class Md extends Xo{static get DEFAULT(){return My||(My=new Md)}constructor(t={},e=null){var i,o;super(t,e),this._autoWrapText=(i=t==null?void 0:t.autoWrapText)!==null&&i!==void 0?i:e==null?void 0:e.autoWrapText,this._lineClamp=(o=t==null?void 0:t.lineClamp)!==null&&o!==void 0?o:e==null?void 0:e.lineClamp}clone(){return new Md(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let By;class qo extends Xo{static get DEFAULT(){return By||(By=new qo)}constructor(t={},e={},i={}){var o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A;super(t,e),this._size=((r=(o=t==null?void 0:t.size)!==null&&o!==void 0?o:e==null?void 0:e.size)!==null&&r!==void 0?r:i==null?void 0:i.size)||14,this._spaceBetweenTextAndIcon=((l=(s=t==null?void 0:t.spaceBetweenTextAndIcon)!==null&&s!==void 0?s:e==null?void 0:e.spaceBetweenTextAndIcon)!==null&&l!==void 0?l:i==null?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=(h=(a=t==null?void 0:t.checkboxStyle)===null||a===void 0?void 0:a.defaultFill)!==null&&h!==void 0?h:i==null?void 0:i.defaultFill,this._defaultStroke=(u=(d=t==null?void 0:t.checkboxStyle)===null||d===void 0?void 0:d.defaultStroke)!==null&&u!==void 0?u:i==null?void 0:i.defaultStroke,this._disableFill=(g=(c=t==null?void 0:t.checkboxStyle)===null||c===void 0?void 0:c.disableFill)!==null&&g!==void 0?g:i==null?void 0:i.disableFill,this._checkedFill=(p=(f=t==null?void 0:t.checkboxStyle)===null||f===void 0?void 0:f.checkedFill)!==null&&p!==void 0?p:i==null?void 0:i.checkedFill,this._checkedStroke=(m=(v=t==null?void 0:t.checkboxStyle)===null||v===void 0?void 0:v.checkedStroke)!==null&&m!==void 0?m:i==null?void 0:i.checkedStroke,this._disableCheckedFill=(w=(b=t==null?void 0:t.checkboxStyle)===null||b===void 0?void 0:b.disableCheckedFill)!==null&&w!==void 0?w:i==null?void 0:i.disableCheckedFill,this._disableCheckedStroke=(_=(C=t==null?void 0:t.checkboxStyle)===null||C===void 0?void 0:C.disableCheckedStroke)!==null&&_!==void 0?_:i==null?void 0:i.disableCheckedStroke,this._checkIconImage=(x=(y=t==null?void 0:t.checkboxStyle)===null||y===void 0?void 0:y.checkIconImage)!==null&&x!==void 0?x:i==null?void 0:i.checkIconImage,this._indeterminateIconImage=(A=(S=t==null?void 0:t.checkboxStyle)===null||S===void 0?void 0:S.indeterminateIconImage)!==null&&A!==void 0?A:i==null?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new qo(t,this)}clone(){return new qo(this)}}function Bd(n,t,e,i,o,r){var s;return n||t?n instanceof Xo?n:typeof n=="function"?Bd(n(e),t,e,i,o,r):(n||(n={}),o&&!I(n.autoWrapText)&&(n.autoWrapText=!0),i===qo?new qo(n??{},t??{},(s=r.checkboxStyle)!==null&&s!==void 0?s:{}):new i(n??{},t??{})):i.DEFAULT}class yI{constructor(t){this._table=t;const e=an();this.freezeIcon=e[ui.freezeIconName],this.frozenIcon=e[ui.frozenIconName],this.frozenCurrentIcon=e[ui.frozenCurrentIconName],this.normalIcon=e[ui.normalIconName],this.upIcon=e[ui.upwardIconName],this.downIcon=e[ui.downwardIconName],this.dropDownAbsoluteIcon=e[ui.dropdownIconName],this.expandIcon=e[ui.expandIconName],this.collapseIcon=e[ui.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:l,sort:a}=this._table.internalProps.layoutMap.getHeader(t,e);if(l){let h=this._table.getPivotSortState(t,e);h&&(h=h.toUpperCase());const d=h==="ASC"?this.upIcon:h==="DESC"?this.downIcon:this.normalIcon;d&&i.push(d)}else if(a){const h=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);h&&i.push(h)}}else{const l=this._table.sortState;let a;a=void 0;const h=this._table.getCellRange(t,e);if(l)if(Array.isArray(l))for(let u=0;u<l.length;u++){const c=l[u],g=this._table._getHeaderCellBySortState(c);if(g&&Ti(h,g.col,g.row)){({order:a}=c);break}}else{const u=this._table._getHeaderCellBySortState(l);u&&Ti(h,u.col,u.row)&&({order:a}=l)}const d=this.getSortIcon(a,this._table,t,e);d&&i.push(d)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const l=this.getFrozenIcon(t,e);l&&i.push(l)}if(this.checkDropDownIcon(this._table,t,e)){const l=this.dropDownAbsoluteIcon;i.push(l)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:r}=this._table._getHeaderLayoutMap(t,e),s=this.getHierarchyIcon(t,e);if(s&&i.push(s),r){let l;typeof r=="function"?l=r({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):l=r;const a=an(),h=d=>{let u;u=typeof d=="string"?a[d]:d,u&&i.push(u)};Array.isArray(l)?l.forEach((d,u)=>{h(d)}):h(l)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose||this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const r=t==="asc"?this.upIcon:t==="desc"?this.downIcon:this.normalIcon,s=e.getHeaderDefine(i,o);return!s||s.showSort===!1||!I(s.showSort)&&!s.sort||s.columns&&s.columns.length>0?null:r}getSortIconForPivotTable(t,e,i,o){const r=e.getHeaderDefine(i,o);return!r||r.showSort===!1||!I(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:(t==null?void 0:t.toUpperCase())==="ASC"?this.upIcon:(t==null?void 0:t.toUpperCase())==="DESC"?this.downIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,r,s;const l=t.getHeaderDefine(e,i),a=t._getHeaderLayoutMap(e,i),{dropDownMenu:h}=a,d=[];if(Array.isArray(h)&&h.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(!((o=l==null?void 0:l.columns)===null||o===void 0)&&o.length)){const u=h||t.globalDropDownMenu;let c=-1,g=-1;for(let f=0;f<u.length;f++){const p=u[f];if(typeof p=="object"&&p.children&&p.children.length)for(let v=0;v<p.children.length;v++){const m=p.children[v];if(!((r=t.stateManager.menu)===null||r===void 0)&&r.dropDownMenuHighlight&&yl(t,(s=t.stateManager.menu)===null||s===void 0?void 0:s.dropDownMenuHighlight,typeof m=="object"?m==null?void 0:m.menuKey:m,e,i)){c=f,g=v;break}}if(t._dropDownMenuIsHighlight(e,i,f)){c=f;break}}if(c!==-1){let f;f=g!==-1?(h||t.globalDropDownMenu)[c].children[g]:(h||t.globalDropDownMenu)[c],f.stateIcon&&(f.stateIcon.svg?d.push({type:"svg",name:f.stateIcon.src||f.stateIcon.svg,width:f.stateIcon.width||22,height:f.stateIcon.height||22,svg:f.stateIcon.svg,positionType:Yt.right,marginRight:0,funcType:Zt.dropDownState,interactive:!1}):f.stateIcon.src&&d.push({type:"image",name:f.stateIcon.src||f.stateIcon.svg,width:f.stateIcon.width||22,height:f.stateIcon.height||22,src:f.stateIcon.src,positionType:Yt.right,marginRight:0,funcType:Zt.dropDownState,interactive:!1}))}}return d}getDropDownIconRect(t,e,i){var o,r,s,l,a,h,d,u;const c=(l=(r=(o=this.downIcon.hover)===null||o===void 0?void 0:o.width)!==null&&r!==void 0?r:(s=this.downIcon)===null||s===void 0?void 0:s.width)!==null&&l!==void 0?l:0,g=(u=(h=(a=this.downIcon.hover)===null||a===void 0?void 0:a.height)!==null&&h!==void 0?h:(d=this.downIcon)===null||d===void 0?void 0:d.height)!==null&&u!==void 0?u:0,f=t.right-2-c,p=t.right-2;let v;return v=i==="middle"?t.top+t.height/2-c/2:i==="top"?t.top+e/2:i==="bottom"?t.bottom-2*e:t.top,{left:f,right:p,top:v,bottom:g+v,width:c,height:g}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===Pt.expand)return this.expandIcon;if(i===Pt.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+((t=this.expandIcon.marginLeft)!==null&&t!==void 0?t:0)+((e=this.expandIcon.marginRight)!==null&&e!==void 0?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const r=t._getHeaderLayoutMap(e,i);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length)return!0}else{const r=t.getHeaderDefine(e,i);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length||(!Array.isArray(r.dropDownMenu)||r.dropDownMenu.length!==0)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(!((o=r==null?void 0:r.columns)===null||o===void 0)&&o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return Md;case"image":case"video":return Td;case"checkbox":return qo}}setTableColumnsEditor(){const t=(e,i)=>{e==null||e.forEach((o,r)=>{o.editor&&(i[r].editor=o.editor),o.columns&&t(o.columns,i[r].columns)})};t(this._table.options.columns,this._table.internalProps.columns)}}class Py extends EventTarget{constructor(t,e){if(super(),this._table=t,Wt.mode==="node")return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i),this._container=i}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${r.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;(t=this._container.parentElement)===null||t===void 0||t.removeChild(this._container)}}class Hy{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){if(!I(e))return;const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);i!==-1&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(I(e))if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort((e,i)=>e<i?-1:e>i?1:0),this._sorted=!0)}updateDifference(t,e){var i;const o=(i=this.difference.get(t))!==null&&i!==void 0?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=(e=this.data.get(o))!==null&&e!==void 0?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout(()=>{this.dealDiffenence(),this.isUpdate=!1},0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const o=this.cumulativeSum.get(t);this.cumulativeSum.set(t,o+i)}this.difference.clear()}insert(t,e){for(let o=t;o<=this.getLastIndex();o++)this.cumulativeSum.delete(o);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),I(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let i=t;i<=this.getLastIndex();i++)this.cumulativeSum.delete(i);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const s=[];for(let l=Pd(o,t+i-1);l>=0;l--){const a=o[l];if(a>=t)s.push(this.get(a));else if(e<=a&&a<t)this.put(a+i,this.get(a));else if(a<e)break}for(let l=0;l<i;l++)this.put(e+l,s[i-1-l])}const{length:r}=o;if(t<e){const s=[];for(let l=Pd(o,t);l<r;l++){const a=o[l];if(a>=t&&a<t+i)s.push(this.get(a));else if(t+i<=a&&a<=e)this.put(a-i,this.get(a));else if(a>e)break}for(let l=0;l<i;l++)this.put(e+l,s[l])}}exchangeOrder(t,e,i,o,r){const{_keys:s}=this;if(this._sorted||(s.sort((l,a)=>l<a?-1:l>a?1:0),this._sorted=!0),t>i){const l=[],a=[];for(let h=Pd(s,i);h<t+e;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(r+e+h,l[h])}else{const l=[],a=[];for(let h=Pd(s,t);h<i+o;h++){const d=s[h];d>=t&&d<t+e?a.push(this.get(d)):l.push(this.get(d))}for(let h=0;h<e;h++)this.put(r+h,a[h]);for(let h=0;h<l.length;h++)this.put(t+h,l[h])}}}function Pd(n,t){let e=0,i=n.length-1;for(;e<=i;){const o=Math.floor((e+i)/2);if(n[o]===t)return o;n[o]>t?i=o-1:e=o+1}return i<0?0:i}class wI{constructor(t){this._table=t;const e=an();this.dragReorderIconName=e[ui.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class SI{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const o=this.getCustomCellStyleOption(i);return o==null?void 0:o.style}}getCustomCellStyleId(t,e){let i;const o=this.table.getCellRange(t,e);for(let r=o.start.col;r<=o.end.col;r++)for(let s=o.start.row;s<=o.end.row;s++)this.customCellStyleArrangement.forEach(l=>{l.cellPosition.range?l.cellPosition.range.start.col<=r&&l.cellPosition.range.end.col>=r&&l.cellPosition.range.start.row<=s&&l.cellPosition.range.end.row>=s&&(i=l.customStyleId):l.cellPosition.col===r&&l.cellPosition.row===s&&(i=l.customStyleId)});return i}getCustomCellStyleOption(t){return this.customCellStyle.find(e=>e.id===t)}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex(o=>o.id===t);i===-1?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach(o=>{const r=o.cellPosition;if(o.customStyleId===t)if(r.range)for(let s=r.range.start.col;s<=r.range.end.col;s++)for(let l=r.range.start.row;l<=r.range.end.row;l++)this.table.scenegraph.updateCellContent(s,l);else this.table.scenegraph.updateCellContent(r.col,r.row)}),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex(o=>o.cellPosition.range&&t.range?o.cellPosition.range.start.col===t.range.start.col&&o.cellPosition.range.start.row===t.range.start.row&&o.cellPosition.range.end.col===t.range.end.col&&o.cellPosition.range.end.row===t.range.end.row:o.cellPosition.col===t.col&&o.cellPosition.row===t.row);if(i!==-1||e){if(i===-1&&e)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[i].customStyleId===e)return;e?this.customCellStyleArrangement[i].customStyleId=e:this.customCellStyleArrangement.splice(i,1)}if(t.range)for(let o=t.range.start.col;o<=t.range.end.col;o++)for(let r=t.range.start.row;r<=t.range.end.row;r++){const s=this.table.getCellRange(o,r);for(let l=s.start.col;l<=s.end.col;l++)for(let a=s.start.row;a<=s.end.row;a++)this.table.scenegraph.updateCellContent(l,a)}else this.table.scenegraph.updateCellContent(t.col,t.row);this.table.scenegraph.updateNextFrame()}}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach(i=>{this.registerCustomCellStyle(i.id,i.style)}),e.forEach(i=>{this.arrangeCustomCellStyle(i.cellPosition,i.customStyleId)})}hasCustomCellStyle(t){return this.customCellStyle.some(e=>e.id===t)}}function wl(n,t){n=n.clone();for(const e in t){const i=t[e];i&&(n[`_${e}`]=i)}return n}class ci{constructor(t,e,i="grid",o=void 0){this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new lo,this.dimensionKeysIncludeVirtual=new lo,this.cache=new Map,this.sizeIncludeParent=o!=null,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t,e=!1){this.cache.clear(),this.dimensionKeys=new lo,this.dimensionKeysIncludeVirtual=new lo,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,r;t.startIndex=e,t.startInTotal=((o=i.startInTotal)!==null&&o!==void 0?o:0)+t.startIndex,((r=t.dimensionKey)!==null&&r!==void 0?r:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?ln:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?ln:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?ln:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?ln:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let s=t.dimensionKey&&this.sizeIncludeParent?1:0;const l=t.children||t.columns;return this.hierarchyType==="grid"?(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)}):s=1:t.hierarchyState===Pt.expand&&(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)}):t.hierarchyState===Pt.collapse&&(l==null?void 0:l.length)>=1?l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),this.setTreeNode(a,s,t)}):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((l==null?void 0:l.length)>=1||l===!0)?(t.hierarchyState=Pt.expand,(l==null?void 0:l.length)>=1&&l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),s+=this.setTreeNode(a,s,t)})):(l==null?void 0:l.length)>=1||l===!0?(t.hierarchyState=Pt.collapse,(l==null?void 0:l.length)>=1&&l.forEach(a=>{var h;a.level=((h=t.level)!==null&&h!==void 0?h:0)+1,this.totalLevel=Math.max(this.totalLevel,a.level+1),this.setTreeNode(a,s,t)})):(t.hierarchyState=Pt.none,s=1),t.size=s,s}getTreePath(t,e=30){const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const r=t[o],s=this.findNodeById(i,r);if(!s)break;e.push(s),i=s.children}return e}findNodeById(t,e){return t.find(i=>i.id===e)}searchPath(t,e,i,o){if(!e||t<e.startIndex||t>=e.startIndex+e.size||(i.push(e),!e.children||e.children.length===0||e.level>=o))return;const r=t-e.startIndex;if(this.cache.has(e.level+1)){const a=this.cache.get(e.level+1);if(r>=a.startIndex&&r<a.startIndex+a.size)return void this.searchPath(r,a,i,o)}let s=0,l=e.children.length-1;for(;s<=l;){const a=Math.floor((s+l)/2),h=e.children[a];if(r>=h.startIndex&&r<h.startIndex+h.size){this.cache.set(h.level,h);const d=[];this.cache.forEach((u,c)=>{c>h.level&&d.push(c)}),d.forEach(u=>{this.cache.delete(u)}),this.searchPath(r,h,i,o);break}r<h.startIndex?l=a-1:s=a+1}}movePosition(t,e,i){let o,r,s;const l=(d,u)=>{if(r!==void 0&&s!==void 0)return;d.level===t&&(d.startInTotal===e&&(r=u),d.startInTotal<=i&&i<=d.startInTotal+d.size-1&&(s=u));const c=d.children||d.columns;if(c&&d.level<t){o=d;for(let g=0;g<c.length;g++)(e>=c[g].startInTotal&&e<=c[g].startInTotal+c[g].size||i>=c[g].startInTotal&&i<=c[g].startInTotal+c[g].size)&&l(c[g],g)}};l(this.tree,0);const a=o.children||o.columns,h=a.splice(r,1);h.unshift(s,0),Array.prototype.splice.apply(a,h)}getCopiedTree(){const t=Be(this.tree.children);return Ey(t),t}}function ef(n,t){t==null||t.forEach(e=>{var i,o;const r={dimensionKey:e.dimensionKey,indicatorKey:e.indicatorKey,value:e.value,hierarchyState:e.hierarchyState,children:void 0,virtual:(i=e.virtual)!==null&&i!==void 0&&i,levelSpan:(o=e.levelSpan)!==null&&o!==void 0?o:1};n.push(r),e.children&&(r.children=[],ef(r.children,e.children))})}function Hd(n,t){let e=0;return n==null||n.forEach(i=>{t?e++:i.children&&i.children.length!==0||e++,i.children&&(e+=Hd(i.children,t))}),e}function xI(n,t,e,i,o,r){var s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P;const k=n.id,B=(l=(s=r.rowsDefine)===null||s===void 0?void 0:s.find(F=>typeof F!="string"&&F.dimensionKey===n.dimensionKey))!==null&&l!==void 0?l:(a=r.columnsDefine)===null||a===void 0?void 0:a.find(F=>typeof F!="string"&&F.dimensionKey===n.dimensionKey),H=(h=r.indicatorsDefine)===null||h===void 0?void 0:h.find(F=>typeof F!="string"&&(n.indicatorKey?F.indicatorKey===n.indicatorKey:F.title===n.value&&!n.dimensionKey)),E={id:k,title:(d=n.value)!==null&&d!==void 0?d:H==null?void 0:H.title,field:n.dimensionKey,style:typeof((u=H??B)===null||u===void 0?void 0:u.headerStyle)=="function"?(c=H??B)===null||c===void 0?void 0:c.headerStyle:Object.assign({},(g=H??B)===null||g===void 0?void 0:g.headerStyle),headerType:(p=(f=H==null?void 0:H.headerType)!==null&&f!==void 0?f:B==null?void 0:B.headerType)!==null&&p!==void 0?p:"text",headerIcon:(v=H==null?void 0:H.headerIcon)!==null&&v!==void 0?v:B==null?void 0:B.headerIcon,define:Object.assign({},n,H??Object.assign({},B,{sort:void 0})),fieldFormat:(m=H==null?void 0:H.headerFormat)!==null&&m!==void 0?m:B==null?void 0:B.headerFormat,dropDownMenu:(b=H==null?void 0:H.dropDownMenu)!==null&&b!==void 0?b:B==null?void 0:B.dropDownMenu,pivotInfo:{value:n.value,dimensionKey:n.dimensionKey,isPivotCorner:!1},width:B==null?void 0:B.width,minWidth:B==null?void 0:B.minWidth,maxWidth:B==null?void 0:B.maxWidth,showSort:(w=H==null?void 0:H.showSort)!==null&&w!==void 0?w:B==null?void 0:B.showSort,sort:H==null?void 0:H.sort,description:B==null?void 0:B.description};H?(H.customRender&&(n.customRender=H.customRender),I((C=r._indicators)===null||C===void 0?void 0:C.find(F=>F.indicatorKey===H.indicatorKey))||(_=r._indicators)===null||_===void 0||_.push({id:++r.sharedVar.seqId,indicatorKey:H.indicatorKey,field:H.indicatorKey,fieldFormat:H==null?void 0:H.format,cellType:(x=(y=H==null?void 0:H.cellType)!==null&&y!==void 0?y:H==null?void 0:H.columnType)!==null&&x!==void 0?x:"text",chartModule:"chartModule"in H?H.chartModule:null,chartSpec:"chartSpec"in H?H.chartSpec:null,noDataRenderNothing:"noDataRenderNothing"in H&&H.noDataRenderNothing,sparklineSpec:"sparklineSpec"in H?H.sparklineSpec:null,style:H==null?void 0:H.style,icon:H==null?void 0:H.icon,define:Object.assign({},n,H,{dragHeader:B==null?void 0:B.dragHeader}),width:H==null?void 0:H.width,minWidth:H==null?void 0:H.minWidth,maxWidth:H==null?void 0:H.maxWidth,disableColumnResize:H==null?void 0:H.disableColumnResize})):n.indicatorKey&&(I((S=r._indicators)===null||S===void 0?void 0:S.find(F=>F.indicatorKey===n.indicatorKey))||(A=r._indicators)===null||A===void 0||A.push({id:++r.sharedVar.seqId,indicatorKey:n.indicatorKey,field:n.indicatorKey,cellType:"text",define:Object.assign({},n)})),e[k]=E,r._headerObjects[k]=E;for(let F=o-1;F>=0;F--)t[F][r.colIndex]=i[F];if(t[o][r.colIndex]=k,n.levelSpan>1)for(let F=1;F<n.levelSpan;F++){if(!t[o+F]){t[o+F]=[];for(let L=0;L<r.colIndex;L++)t[o+F][L]=t[o][L]}t[o+F][r.colIndex]=k}if(((R=n.children)===null||R===void 0?void 0:R.length)>=1)r._addHeaders(t,o+((T=n.levelSpan)!==null&&T!==void 0?T:1),(M=n.children)!==null&&M!==void 0?M:[],[...i,...Array((P=n.levelSpan)!==null&&P!==void 0?P:1).fill(k)],e);else{for(let F=o+1;F<t.length;F++)t[F][r.colIndex]=k;r.colIndex++}}function AI(n,t,e,i,o,r,s,l,a){var h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z;const D=n.id,N=l.find(U=>typeof U!="string"&&U.dimensionKey===n.dimensionKey),V=(h=a.indicatorsDefine)===null||h===void 0?void 0:h.find(U=>typeof U!="string"&&(n.indicatorKey?U.indicatorKey===n.indicatorKey:U.title===n.value)),G={id:D,title:(d=n.value)!==null&&d!==void 0?d:V.title,field:n.dimensionKey,style:n.level+1===r||typeof((u=V??N)===null||u===void 0?void 0:u.headerStyle)=="function"?(c=V??N)===null||c===void 0?void 0:c.headerStyle:Object.assign({},(g=V??N)===null||g===void 0?void 0:g.headerStyle,{textAlign:"left"}),headerType:(p=(f=V==null?void 0:V.headerType)!==null&&f!==void 0?f:N==null?void 0:N.headerType)!==null&&p!==void 0?p:"text",headerIcon:(v=V==null?void 0:V.headerIcon)!==null&&v!==void 0?v:N==null?void 0:N.headerIcon,define:Object.assign(n,{linkJump:(m=V??N)===null||m===void 0?void 0:m.linkJump,linkDetect:(b=V??N)===null||b===void 0?void 0:b.linkDetect,templateLink:(w=V??N)===null||w===void 0?void 0:w.templateLink,keepAspectRatio:(_=(C=V??N)===null||C===void 0?void 0:C.keepAspectRatio)!==null&&_!==void 0&&_,imageAutoSizing:(y=V??N)===null||y===void 0?void 0:y.imageAutoSizing,headerCustomRender:(x=V??N)===null||x===void 0?void 0:x.headerCustomRender,headerCustomLayout:(S=V??N)===null||S===void 0?void 0:S.headerCustomLayout,dragHeader:N==null?void 0:N.dragHeader,disableHeaderHover:!!(!((A=V??N)===null||A===void 0)&&A.disableHeaderHover),disableHeaderSelect:!!(!((R=V??N)===null||R===void 0)&&R.disableHeaderSelect)}),fieldFormat:(T=V==null?void 0:V.headerFormat)!==null&&T!==void 0?T:N==null?void 0:N.headerFormat,dropDownMenu:(M=V==null?void 0:V.dropDownMenu)!==null&&M!==void 0?M:N==null?void 0:N.dropDownMenu,pivotInfo:{value:n.value,dimensionKey:n.dimensionKey,isPivotCorner:!1},hierarchyLevel:n.level,dimensionTotalLevel:r,hierarchyState:n.hierarchyState,width:N==null?void 0:N.width,minWidth:N==null?void 0:N.minWidth,maxWidth:N==null?void 0:N.maxWidth,parentCellId:i[i.length-1]};V?(V.customRender&&(n.customRender=V.customRender),I((P=a._indicators)===null||P===void 0?void 0:P.find(U=>U.indicatorKey===V.indicatorKey))||(k=a._indicators)===null||k===void 0||k.push({id:++a.sharedVar.seqId,indicatorKey:V.indicatorKey,field:V.indicatorKey,fieldFormat:V==null?void 0:V.format,cellType:(H=(B=V==null?void 0:V.cellType)!==null&&B!==void 0?B:V==null?void 0:V.columnType)!==null&&H!==void 0?H:"text",chartModule:"chartModule"in V?V.chartModule:null,chartSpec:"chartSpec"in V?V.chartSpec:null,noDataRenderNothing:"noDataRenderNothing"in V&&V.noDataRenderNothing,sparklineSpec:"sparklineSpec"in V?V.sparklineSpec:null,style:V==null?void 0:V.style,icon:V==null?void 0:V.icon,define:Object.assign({},n,V,{dragHeader:N==null?void 0:N.dragHeader}),width:V==null?void 0:V.width,minWidth:V==null?void 0:V.minWidth,maxWidth:V==null?void 0:V.maxWidth,disableColumnResize:V==null?void 0:V.disableColumnResize})):n.indicatorKey&&(I((E=a._indicators)===null||E===void 0?void 0:E.find(U=>U.indicatorKey===n.indicatorKey))||(F=a._indicators)===null||F===void 0||F.push({id:++a.sharedVar.seqId,indicatorKey:n.indicatorKey,field:n.indicatorKey,cellType:"text",define:Object.assign({},n)})),e[D]=G,a._headerObjects[D]=G,t[o][a.colIndex]=D;for(let U=o-1;U>=0;U--)t[U][a.colIndex]=i[U];if(n.hierarchyState===Pt.expand&&((L=n.children)===null||L===void 0?void 0:L.length)>=1)s&&a.colIndex++,a._addHeadersForTreeMode(t,o,(z=n.children)!==null&&z!==void 0?z:[],[...i,D],r,s&&n.hierarchyState===Pt.expand,l,e);else{s&&a.colIndex++;for(let U=o+1;U<t.length;U++)t[U][a.colIndex]=D}}function Ey(n){for(let t=0;t<n.length;t++){const e=n[t];delete e.level,delete e.startIndex,delete e.id,delete e.levelSpan,delete e.size,delete e.startInTotal;const i=e.children||e.columns;i&&Ey(i)}}function RI(n){const{columns:t,rows:e,indicators:i}=n.options;if(n.isPivotTable()){if(it(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if(!Qt(r)&&(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}if(it(e)&&e.length>0)for(let o=0;o<e.length;o++){const r=e[o];if(!Qt(r)&&(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}if(it(i)&&i.length>0)for(let o=0;o<i.length;o++){const r=i[o];if(!Qt(r)&&((r.cellType==="image"||r.cellType==="video"||typeof r.cellType=="function")&&r.imageAutoSizing||(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing))return!0}}else if(it(t)&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((r.cellType==="image"||r.cellType==="video"||typeof r.cellType=="function")&&r.imageAutoSizing||(r.headerType==="image"||r.headerType==="video"||typeof r.headerType=="function")&&r.imageAutoSizing)return!0}return!1}function Ly(n,t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p;let v,m;t.columnTree&&(n.options.indicatorsAsCol!==!1&&n.options.supplementIndicatorNodes!==!1&&(n.internalProps.columnTree=$r(n.internalProps.columnTree,t.indicators)),v=new ci((e=n.internalProps.columnTree)!==null&&e!==void 0?e:[],n.layoutNodeId)),t.rowTree&&(n.options.indicatorsAsCol===!1&&n.options.supplementIndicatorNodes!==!1&&(n.internalProps.rowTree=$r(n.internalProps.rowTree,t.indicators)),m=new ci((i=n.internalProps.rowTree)!==null&&i!==void 0?i:[],n.layoutNodeId,n.options.rowHierarchyType,n.options.rowHierarchyType==="tree"?(o=n.options.rowExpandLevel)!==null&&o!==void 0?o:1:void 0));const b=!((r=m==null?void 0:m.dimensionKeys)===null||r===void 0)&&r.count?m.dimensionKeys.valueArr():(l=(s=t.rows)===null||s===void 0?void 0:s.reduce((_,y)=>(typeof y=="string"?_.push(y):_.push(y.dimensionKey),_),[]))!==null&&l!==void 0?l:[],w=!((a=v==null?void 0:v.dimensionKeys)===null||a===void 0)&&a.count?v.dimensionKeys.valueArr():(d=(h=t.columns)===null||h===void 0?void 0:h.reduce((_,y)=>(typeof y=="string"?_.push(y):_.push(y.dimensionKey),_),[]))!==null&&d!==void 0?d:[],C=(c=(u=t.indicators)===null||u===void 0?void 0:u.reduce((_,y)=>{var x;return typeof y=="string"?_.push(y):(_.push(y.indicatorKey),(y.chartSpec||y.sparklineSpec)&&(!((x=n.internalProps.dataConfig)===null||x===void 0)&&x.aggregationRules?n.internalProps.dataConfig.aggregationRules.find(S=>S.indicatorKey===y.indicatorKey)||n.internalProps.dataConfig.aggregationRules.push({field:y.indicatorKey,indicatorKey:y.indicatorKey,aggregationType:Mt.NONE}):n.internalProps.dataConfig?n.internalProps.dataConfig.aggregationRules=[{field:y.indicatorKey,indicatorKey:y.indicatorKey,aggregationType:Mt.NONE}]:n.internalProps.dataConfig={aggregationRules:[{field:y.indicatorKey,indicatorKey:y.indicatorKey,aggregationType:Mt.NONE}]})),_},[]))!==null&&c!==void 0?c:[];return t.rowHierarchyType==="tree"&&((f=(g=t.extensionRows)===null||g===void 0?void 0:g.length)!==null&&f!==void 0?f:0)>=1&&((p=t.extensionRows)===null||p===void 0||p.forEach(_=>{const y=[];_.rows.forEach(x=>{typeof x=="string"?y.push(x):y.push(x.dimensionKey)}),b.push(...y)})),{rowKeys:b,columnKeys:w,indicatorKeys:C,columnDimensionTree:v,rowDimensionTree:m}}function $r(n,t){const e=(i,o)=>{i.forEach(r=>{var s;r.indicatorKey||o||!((s=r.children)===null||s===void 0)&&s.length&&r.children?r.children&&Array.isArray(r.children)&&e(r.children,o||!!r.indicatorKey):r.children=t==null?void 0:t.map(l=>{var a;return typeof l=="string"?{indicatorKey:l,value:l}:{indicatorKey:l.indicatorKey,value:(a=l.title)!==null&&a!==void 0?a:l.indicatorKey}})})};return n!=null&&n.length?e(n,!1):n=t==null?void 0:t.map(i=>{var o;return typeof i=="string"?{indicatorKey:i,value:i}:{indicatorKey:i.indicatorKey,value:(o=i.title)!==null&&o!==void 0?o:i.indicatorKey}}),n}function Fy(n,t){const e=OE(t,n);if(e)return e;let i=of(n,t);return i||(i={top:-1,row:-1,bottom:-1,height:-1}),i}function ky(n,t){const e=WE(t,n);if(e)return e;let i=nf(n,t);return i||(i={left:-1,col:-1,right:-1,width:1}),i}function TI(n,t,e){const i=Fy(t,e),{row:o,top:r,bottom:s,height:l}=i,a=ky(n,e),{col:h,left:d,right:u,width:c}=a;return{row:o,col:h,rect:{left:d,right:u,top:r,bottom:s,width:c,height:l}}}function nf(n,t){if(n===0)return{left:0,col:0,right:0,width:0};const e=BI(n,t),i=t.getColsWidth(0,e);return n>=i?((o,r)=>{let s=r-t.getColWidth(o);const{colCount:l}=t.internalProps;for(let a=o;a<l;a++){const h=t.getColWidth(a),d=s+h;if(Math.round(s)<=Math.round(n)&&Math.round(n)<Math.round(d))return{left:s,col:a,right:d,width:h};s=d}return null})(e,i):((o,r)=>{let s=r;for(let l=o;l>=0;l--){const a=t.getColWidth(l),h=s-a;if(Math.round(h)<=Math.round(n)&&Math.round(n)<Math.round(s))return{left:h,col:l,right:s,width:a};s=h}return null})(e,i)}function of(n,t){if(n===0)return{top:0,row:0,bottom:0,height:0};const e=MI(n,t),i=t.getRowsHeight(0,e);return n>=i?((o,r)=>{let s=r-t.getRowHeight(o);const{rowCount:l}=t.internalProps;for(let a=o;a<l;a++){const h=t.getRowHeight(a),d=s+h;if(Math.round(s)<=Math.round(n)&&Math.round(n)<Math.round(d))return{top:s,row:a,bottom:d,height:h};s=d}return null})(e,i):((o,r)=>{let s=r;for(let l=o;l>=0;l--){const a=t.getRowHeight(l),h=s-a;if(Math.round(h)<=Math.round(n)&&Math.round(n)<Math.round(s))return{top:h,row:l,bottom:s,height:a};s=h}return null})(e,i)}function Iy(n,t,e){if(n===0)return{left:0,col:0,right:0,width:0};if(t&&n>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&n<e.tableNoFrameWidth&&n<=e.getAllColsWidth()){for(let i=0;i<e.rightFrozenColCount;i++)if(n>e.tableNoFrameWidth-e.getColsWidth(e.colCount-i-1,e.colCount-1))return{col:e.colCount-i-1,left:void 0,right:void 0,width:void 0}}return nf(n,e)}function zy(n,t,e){if(n===0)return{top:0,row:0,bottom:0,height:0};if(n-=e.tableY,t&&n>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&n<e.tableNoFrameHeight){for(let i=0;i<e.rightFrozenColCount;i++)if(n>e.tableNoFrameHeight-e.getRowsHeight(e.rowCount-i-1,e.rowCount-1))return{row:e.rowCount-i-1,top:void 0,bottom:void 0,height:void 0}}return of(n,e)}function MI(n,t){let e=t.internalProps.defaultRowHeight;return t._rowRangeHeightsMap.get("$0$"+(t.rowCount-1))&&(e=t._rowRangeHeightsMap.get("$0$"+(t.rowCount-1))/t.rowCount),Math.min(Math.ceil(n/e),t.rowCount-1)}function BI(n,t){if(t._colRangeWidthsMap.get("$0$"+(t.colCount-1))){let e=0,i=t.colCount-1;for(;i-e>1;){const o=Math.floor((e+i)/2);if(n<t._colRangeWidthsMap.get(`$0$${o}`))i=o;else{if(!(n>t._colRangeWidthsMap.get(`$0$${o}`)))return o;e=o}}return i}return Math.min(Math.ceil(n/t.internalProps.defaultColWidth),t.colCount-1)}function PI(n,t,e){n-=e.tableX;let i=!1;(t-=e.tableY)>0&&t<e.getFrozenRowsHeight()&&(i=!0);let o=!1;n>0&&n<e.getFrozenColsWidth()&&(o=!0);let r=!1;t>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&t<e.tableNoFrameHeight&&t<=e.getAllRowsHeight()&&(r=!0);let s=!1;n>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&n<e.tableNoFrameWidth&&n<=e.getAllColsWidth()&&(s=!0);const l=Iy(o||s?n:n+e.scrollLeft,s,e),a=zy(i||r?t:t+e.scrollTop,r,e);if(l&&a){const{row:h,top:d,bottom:u,height:c}=a,{col:g,left:f,right:p,width:v}=l;return{row:h,col:g,rect:{left:f,right:p,top:d,bottom:u,width:v,height:c}}}return{col:-1,row:-1}}function Dy(n){return n.length===2&&ie(n[0])&&ie(n[1])&&n[1]>=n[0]}function Oy(n){const t=n[1]-n[0],e=n[1]*n[0]<0;let i=n[0]<=0?0-n[0]:0,o=n[1]>0?n[1]-0:0;return t===0?n[0]<0?(i=1,o=0):n[0]>0&&(i=0,o=1):(i/=t,o/=t),{total:t,negative:i,positive:o,includeZero:e,domain:n,extendable_min:!0,extendable_max:!0}}function Wy(n,t){const{positive:e,negative:i,extendable_min:o,extendable_max:r,domain:s}=n,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:u}=t;if(l>0){if(!h)return!1;let c=i/e;r&&(c=i/Math.max(e,l),s[1]=-s[0]/c),u[0]=-u[1]*c}else if(a>0){if(!d)return!1;let c=e/i;o&&(c=e/Math.max(i,i),s[0]=-s[1]/c),u[1]=-u[0]*c}return!0}function Ny(n,t){const{extendable_min:e,extendable_max:i,domain:o}=n,{positive:r,negative:s,domain:l}=t;return(r!==0||s!==0)&&!(r>0&&!i)&&!(s>0&&!e)&&(o[0]=l[0],o[1]=l[1],!0)}function Vy(n,t){const{positive:e,negative:i,extendable_max:o,domain:r}=n,{positive:s,negative:l,extendable_min:a,domain:h}=t;if(o&&a){const d=Math.max(i,l)/Math.max(e,s);r[1]=-r[0]/d,h[0]=-h[1]*d}else if(a){const d=i/e;h[0]=-h[1]*d}else{if(!o)return!1;{const d=l/s;r[1]=-r[0]/d}}return!0}function jy(n,t){const{extendable_min:e,domain:i}=n,{extendable_max:o,domain:r}=t;return!(!e||!o)&&(i[0]=-i[1],r[1]=-r[0],!0)}function Yr(n,t){const e=[n.min,n.max],i=[t.min,t.max];if(!Dy(e)||!Dy(i))return;const o=Oy(e),r=Oy(i),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=o,{positive:u,negative:c,extendable_min:g,extendable_max:f,includeZero:p}=r;if(s===0&&l===0){if(!Ny(o,r))return}else if(u===0&&c===0){if(!Ny(r,o))return}else if(d||p)if(d&&!p){if(!Wy(o,r))return}else if(p&&!d){if(!Wy(r,o))return}else{if(l===c)return;if(l>c){if(!Vy(o,r))return}else if(!Vy(r,o))return}else{if(l===0&&u===0){if(!jy(o,r))return}else if(c===0&&s===0&&!jy(r,o))return;if(l===0&&c===0)if(e[0]===0&&i[0]>0){if(!g)return;i[0]=0}else{if(!(i[0]===0&&e[0]>0)||!a)return;e[0]=0}if(s===0&&u===0)if(e[1]===0&&i[1]>0){if(!f)return;i[1]=0}else{if(!(i[1]===0&&e[1]>0)||!h)return;e[1]=0}}return{range1:e,range2:i}}function HI(n,t,e){var i,o,r,s,l,a,h;if(e._table.isPivotChart())if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount){const d=vo("top",n,t+1,n,e.columnHeaderLevelCount-1,n,t,1,e);if(!d)return;const u=e._table._getCellStyle(n,t+1),c=kt(lt("padding",u,n,t+1,e._table)),{range:g,ticks:f,axisOption:p,isZeroAlign:v,theme:m}=d;if(v){const b=vo("bottom",n,t+1,n,e.columnHeaderLevelCount-1,n,t,0,e);if(b){const{range:w}=b,C=Yr(g,w);C&&(g.min=C.range1[0],g.max=C.range1[1])}}return nt(p==null?void 0:p.min)&&(g.min=p.min,g.min>0&&(p.zero=!1)),nt(p==null?void 0:p.max)&&(g.max=p.max,g.max<0&&(p.zero=!1)),dt({range:g},p,{orient:"top",type:(p==null?void 0:p.type)||"linear",label:{flush:!0},__ticksForVTable:f,__vtableChartTheme:m,__vtablePadding:c})}if(t===e.rowCount-e.bottomFrozenRowCount&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount){const d=e.getIndicatorKeyInChartSpec(n,t).slice(0,2);let u=null;d==null||d.forEach(C=>{const _=e.getIndicatorInfo(C);_&&(u=_)});const c=vo("bottom",n,t-1,n,t,n,t,0,e);if(!c)return;const g=e._table._getCellStyle(n,t-1),f=kt(lt("padding",g,n,t-1,e._table)),{range:p,ticks:v,axisOption:m,isZeroAlign:b,theme:w}=c;if(b){const C=vo("top",n,t-1,n,t,n,t,1,e);if(C){const{range:_}=C,y=Yr(p,_);y&&(p.min=y.range1[0],p.max=y.range1[1])}}return nt(m==null?void 0:m.min)&&(p.min=m.min,p.min>0&&(m.zero=!1)),nt(m==null?void 0:m.max)&&(p.max=m.max,p.max<0&&(m.zero=!1)),dt({title:{visible:!0,text:u==null?void 0:u.title},range:p},m,{orient:"bottom",type:(m==null?void 0:m.type)||"linear",label:{flush:!0},__ticksForVTable:v,__vtableChartTheme:w,__vtablePadding:f})}if(n===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){let d=e.getDimensionKeyInChartSpec(e.rowHeaderLevelCount,t);it(d)&&(d=d[0]);const u=(i=e.dataset.collectedValues[d])!==null&&i!==void 0?i:[],c=e.getRowKeysPath(n,t),g=(o=u[c??""])!==null&&o!==void 0?o:[],{axisOption:f,theme:p,chartType:v}=Xr(n+1,t,"left",e);if((f==null?void 0:f.visible)===!1)return;const m=e._table._getCellStyle(n+1,t),b=kt(lt("padding",m,n+1,t,e._table)),w=e.getRawChartSpec(n+1,t);return dt({domain:(f==null?void 0:f.type)==="linear"?void 0:Array.from(g),range:(f==null?void 0:f.type)==="linear"?g:void 0,title:{autoRotate:!0}},f,{orient:"left",type:(r=f==null?void 0:f.type)!==null&&r!==void 0?r:"band",__vtableChartTheme:p,inverse:FI(f,((s=w==null?void 0:w.direction)!==null&&s!==void 0?s:v==="scatter"?"vertical":"horizontal")==="horizontal"),__vtablePadding:b})}}else{if(n===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){const d=e.getIndicatorKeyInChartSpec(n,t).slice(0,2);let u=null;d==null||d.forEach(C=>{const _=e.getIndicatorInfo(C);_&&(u=_)});const c=vo("left",n+1,t,n,t,n,t,0,e);if(!c)return;const g=e._table._getCellStyle(n+1,t),f=kt(lt("padding",g,n+1,t,e._table)),{range:p,ticks:v,axisOption:m,isZeroAlign:b,theme:w}=c;if(b){const C=vo("right",n+1,t,n,t,n,t,1,e);if(C){const{range:_}=C,y=Yr(p,_);y&&(p.min=y.range1[0],p.max=y.range1[1])}}return nt(m==null?void 0:m.min)&&(p.min=m.min,p.min>0&&(m.zero=!1)),nt(m==null?void 0:m.max)&&(p.max=m.max,p.max<0&&(m.zero=!1)),dt({title:{visible:!0,text:u==null?void 0:u.title,autoRotate:!0},range:p},m,{orient:"left",type:(m==null?void 0:m.type)||"linear",label:{flush:!0},__ticksForVTable:v,__vtableChartTheme:w,__vtablePadding:f})}if(n===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount){const d=vo("right",n-1,t,e.rowHeaderLevelCount-1,t,n,t,1,e);if(!d)return;const u=e._table._getCellStyle(n-1,t),c=kt(lt("padding",u,n-1,t,e._table)),{range:g,ticks:f,axisOption:p,isZeroAlign:v,theme:m}=d;if(v){const b=vo("left",n-1,t,e.rowHeaderLevelCount-1,t,n,t,0,e);if(b){const{range:w}=b,C=Yr(g,w);C&&(g.min=C.range1[0],g.max=C.range1[1])}}return nt(p==null?void 0:p.min)&&(g.min=p.min,g.min>0&&(p.zero=!1)),nt(p==null?void 0:p.max)&&(g.max=p.max,g.max<0&&(p.zero=!1)),dt({range:g,title:{autoRotate:!0}},p,{orient:"right",type:(p==null?void 0:p.type)||"linear",label:{flush:!0},__ticksForVTable:f,__vtableChartTheme:m,__vtablePadding:c})}if(t===e.rowCount-e.bottomFrozenRowCount&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount){let d=e.getDimensionKeyInChartSpec(n,e.columnHeaderLevelCount);it(d)&&(d=d[0]);const u=(l=e.dataset.collectedValues[d])!==null&&l!==void 0?l:[],c=e.getColKeysPath(n,t),g=(a=u==null?void 0:u[c??""])!==null&&a!==void 0?a:[],{axisOption:f,isPercent:p,theme:v,chartType:m}=Xr(n,t-1,"bottom",e);if((f==null?void 0:f.visible)===!1)return;const b=e._table._getCellStyle(n,t-1),w=kt(lt("padding",b,n,t-1,e._table));return dt({domain:(f==null?void 0:f.type)==="linear"?void 0:Array.from(g),range:(f==null?void 0:f.type)==="linear"?g:void 0},f,{orient:"bottom",type:(h=f==null?void 0:f.type)!==null&&h!==void 0?h:"band",__vtableChartTheme:v,__vtablePadding:w})}}}function Xr(n,t,e,i){var o,r;const s=i.getRawChartSpec(n,t),l=(o=s.axes)!==null&&o!==void 0?o:[];if(i._table.pivotChartAxes.forEach(a=>{l.findIndex(h=>a.orient===h.orient)===-1&&l.push(a)}),s&&it(l)){const a=l.find(h=>h.orient===e);if(a){const{seriesIndex:h,seriesId:d}=a;let u,c;return I(d)&&it(s.series)?u=(it(d)?d:[d]).map(g=>{const f=s.series.findIndex(p=>p.id===g);return f>=0&&(c=s.series[f]),f}):I(h)&&it(s.series)&&(u=h),{axisOption:a,isPercent:s.percent,isZeroAlign:Gy(s,e,i),seriesIndice:u,theme:s.theme,chartType:(r=c==null?void 0:c.type)!==null&&r!==void 0?r:s.type}}}return{axisOption:i._table.pivotChartAxes.find(a=>a.orient===e),isPercent:!1,isZeroAlign:Gy(s,e,i),theme:s.theme,chartType:s.type}}function Gy(n,t,e){const i=[];let o;if(t==="left"||t==="right"?i.push("left","right"):t!=="top"&&t!=="bottom"||i.push("top","bottom"),o=n&&it(n.axes)?n.axes:e._table.pivotChartAxes,it(o)){const r=[];o.forEach(s=>{i.includes(s.orient)&&r.push(s)});for(let s=0;s<r.length;s++){const l=r[s];if(l.sync&&l.sync.zeroAlign&&l.sync.axisId&&r.find(a=>a.id===l.sync.axisId))return!0}}return!1}function rf(n,t,e,i,o){var r;if(it(o)){const h={min:1/0,max:-1/0};for(let d=0;d<o.length;d++){const u=rf(n,t,e,i,o[d]);u&&(h.min=Math.min(h.min,u.min),h.max=Math.max(h.max,u.max))}return isFinite(h.min)&&isFinite(h.max)?h:null}let s=t==null?void 0:t[o];if(it(s)&&(s=s[0]),!s)return null;const l=n[s],a=dt({},(r=l==null?void 0:l[i??""])!==null&&r!==void 0?r:{min:0,max:1});return a.positiveMax&&a.positiveMax>a.max&&(a.max=a.positiveMax),a.negativeMin&&a.negativeMin<a.min&&(a.min=a.negativeMin),a.min===a.max&&(a.min>0?a.min=0:a.max=0),a}function vo(n,t,e,i,o,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:u,seriesIndice:c,theme:g,chartType:f}=Xr(t,e,n,a);if((h==null?void 0:h.visible)===!1)return;const p=a.getIndicatorKeyInChartSpec(i,o).slice(0,2);let v;v=n==="top"||n==="bottom"?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const m=rf(a.dataset.collectedValues,p,u,v,c??l);if(!m)return;d&&(m.min=m.min<0?-1:0,m.max=m.max>0?1:0);const b=St.getFunction("getAxisDomainRangeAndLabels"),{range:w,ticks:C}=b(m.min,m.max,h,u,n==="bottom"||n==="top"?a._table.getColWidth(r)||a._table.tableNoFrameWidth:a._table.getRowHeight(s)||a._table.tableNoFrameHeight);return m.min=isNaN(w[0])?0:w[0],m.max=isNaN(w[1])?1:w[1],nt(h==null?void 0:h.min)&&(m.min=h.min,m.min>0&&(h.zero=!1)),nt(h==null?void 0:h.max)&&(m.max=h.max,m.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:u,range:m,ticks:C,theme:g,chartType:f}}function EI(n,t,e){if(!e._table.isPivotChart())return!1;if(e.indicatorsAsCol){if(e.hasTwoIndicatorAxes&&t===e.columnHeaderLevelCount-1&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount||t===e.rowCount-e.bottomFrozenRowCount&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount)return!0}else if(t===e.rowCount-e.bottomFrozenRowCount&&n>=e.rowHeaderLevelCount&&n<e.colCount-e.rightFrozenColCount)return!0;return!1}function LI(n,t,e){if(!e._table.isPivotChart())return!1;if(e.indicatorsAsCol){if(n===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return!0}else if(n===e.rowHeaderLevelCount-1&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount||n===e.colCount-e.rightFrozenColCount&&t>=e.columnHeaderLevelCount&&t<e.rowCount-e.bottomFrozenRowCount)return!0;return!1}var Uy;function FI(n,t){let e=n==null?void 0:n.inverse;return t&&!kI(n==null?void 0:n.orient)&&(e=!I(n==null?void 0:n.inverse)||!(n!=null&&n.inverse)),e}function kI(n){return n==="bottom"||n==="top"}(function(n){n.vertical="vertical",n.horizontal="horizontal"})(Uy||(Uy={}));const II={};function zI(n,t,e){var i,o,r,s,l,a,h,d,u;const c=e.customCellStylePlugin.getCustomCellStyle(n,t),{layoutMap:g}=e.internalProps;if(g.isHeader(n,t)){let y;if(!e.isPivotTable()||e.isBottomFrozenRow(t)||e.isRightFrozenColumn(n))y=`${n}-${t}`;else{const T=e.getHeaderDefine(n,t),M=e.isCornerHeader(n,t);y=T!=null&&T.dimensionKey?M?`dim-cor-${T.dimensionKey}`:`dim-${T.dimensionKey}`:T!=null&&T.indicatorKey?`ind-${T.indicatorKey}`:`${n}-${t}`}let x=e.headerStyleCache.get(y);if(x)return c?wl(x,c):x;const S=g.getHeader(n,t);let A;if(e.isPivotChart()&&EI(n,t,g)&&g.isAxisCell(n,t)?A=(o=(i=g.getBody(n,e.rowHeaderLevelCount).style)===null||i===void 0?void 0:i.padding)!==null&&o!==void 0?o:e.theme.bodyStyle.padding:e.isPivotChart()&&LI(n,t,g)&&g.isAxisCell(n,t)&&(A=(s=(r=g.getBody(e.columnHeaderLevelCount,t).style)===null||r===void 0?void 0:r.padding)!==null&&s!==void 0?s:e.theme.bodyStyle.padding),(!S||S.isEmpty)&&(g.isLeftBottomCorner(n,t)||g.isRightBottomCorner(n,t)||g.isCornerHeader(n,t)||g.isRightTopCorner(n,t)))return II;const R=e.internalProps.headerHelper.getStyleClass((S==null?void 0:S.headerType)||"text");if(g.isBottomFrozenRow(n,t)&&e.theme.bottomFrozenStyle)x=Bd(A?{padding:A}:{},e.theme.bottomFrozenStyle,{col:n,row:t,table:e,value:e.getCellValue(n,t),dataValue:e.getCellOriginValue(n,t),cellHeaderPaths:e.getCellHeaderPaths(n,t)},R,e.options.autoWrapText,e.theme);else if(g.isRightFrozenColumn(n,t)&&e.theme.rightFrozenStyle)x=Bd(A?{padding:A}:{},e.theme.rightFrozenStyle,{col:n,row:t,table:e,value:e.getCellValue(n,t),dataValue:e.getCellOriginValue(n,t),cellHeaderPaths:e.getCellHeaderPaths(n,t)},R,e.options.autoWrapText,e.theme);else{const T=(S==null?void 0:S.style)||{};A&&(T.padding=A),x=Bd(T,g.isColumnHeader(n,t)||g.isBottomFrozenRow(n,t)?e.theme.headerStyle:g.isRowHeader(n,t)||g.isRightFrozenColumn(n,t)?e.theme.rowHeaderStyle:e.theme.cornerHeaderStyle,{col:n,row:t,table:e,value:e.getCellValue(n,t),dataValue:e.getCellOriginValue(n,t),cellHeaderPaths:e.getCellHeaderPaths(n,t)},R,e.options.autoWrapText,e.theme)}return e.headerStyleCache.set(y,x),c?wl(x,c):x}let f,p;!((a=(l=e.internalProps)===null||l===void 0?void 0:l.dataConfig)===null||a===void 0)&&a.mappingRules&&!e.isHeader(n,t)&&((u=(d=(h=e.internalProps)===null||h===void 0?void 0:h.dataConfig)===null||d===void 0?void 0:d.mappingRules)===null||u===void 0||u.forEach((y,x)=>{y.bgColor&&e.internalProps.layoutMap.getIndicatorKey(n,t)===y.bgColor.indicatorKey&&(f=y.bgColor.mapping)}));const v=e.getCellType(n,t),m=e.getCellOriginRecord(n,t);let b;if(p=m!=null&&m.vtableMerge?"merge-title":e.isSeriesNumberInBody(n,t)?`${n}-series-`+v:e.isListTable()&&!e.transpose||e.isPivotTable()&&e.internalProps.layoutMap.indicatorsAsCol?n+v:t+v,b=m!=null&&m.vtableMerge?e.bodyMergeTitleCache.get(p):g.isBottomFrozenRow(t)?e.bodyBottomStyleCache.get(p):e.bodyStyleCache.get(p),b)return c?wl(b,c):b;const w=g.getBody(n,t),C=e.internalProps.bodyHelper.getStyleClass(e.getCellType(n,t)),_=w==null?void 0:w.style;return b=sg(_,m!=null&&m.vtableMerge&&e.theme.groupTitleStyle?e.theme.groupTitleStyle:g.isBottomFrozenRow(t)&&e.theme.bottomFrozenStyle?e.theme.bottomFrozenStyle:g.isRightFrozenColumn(n)&&e.theme.rightFrozenStyle?e.theme.rightFrozenStyle:e.theme.bodyStyle,{col:n,row:t,table:e,value:e.getCellValue(n,t),dataValue:e.getCellOriginValue(n,t),cellHeaderPaths:e.getCellHeaderPaths(n,t)},C,e.options.autoWrapText,e.theme),f&&(b=wl(b,{bgColor:f})),jt(_)||(g.isBottomFrozenRow(t)?e.bodyBottomStyleCache.set(p,b):e.bodyStyleCache.set(p,b)),c?wl(b,c):b}class DI extends M0{onUpdate(t,e,i){if(this.from.x!==this.to.x){const o=t?this.to.x:this.from.x+Math.floor((this.to.x-this.from.x)*e);this.params.table.scrollLeft=o}if(this.from.y!==this.to.y){const o=t?this.to.y:this.from.y+Math.floor((this.to.y-this.from.y)*e);this.params.table.scrollTop=o}}}class OI{constructor(t){this.table=t,this.timeline=new xu,this.ticker=new R0,this.ticker.addTimeline(this.timeline),this.ticker.setFPS(60),this.tempGraphic=ve({})}scrollTo(t,e){var i,o,r,s;const l={x:this.table.scrollLeft,y:this.table.scrollTop},a=this.table.getCellRect((i=t.col)!==null&&i!==void 0?i:0,(o=t.row)!==null&&o!==void 0?o:0),h={x:nt(t.col)?a.left-this.table.getFrozenColsWidth():this.table.scrollLeft,y:nt(t.row)?a.top-this.table.getFrozenRowsHeight():this.table.scrollTop},d=ze(e)?e?3e3:0:(r=e==null?void 0:e.duration)!==null&&r!==void 0?r:3e3,u=ze(e)?e?"linear":"":(s=e==null?void 0:e.easing)!==null&&s!==void 0?s:"linear";new Bn(Te.GenAutoIncrementId(),this.timeline).bind(this.tempGraphic).play(new DI(l,h,d,u,{graphic:this.tempGraphic,table:this.table})),this.ticker.start()}clear(){this.timeline.clear(),this.ticker.stop()}}const{toBoxArray:Ky}=A2,{isTouchEvent:WI}=x2,NI=/^\$(\d+)\$(\d+)$/;t2();class VI extends Th{static get EVENT_TYPE(){return J}constructor(t,e={}){var i,o,r,s,l,a,h,d,u,c;if(super(),this.showFrozenIcon=!0,this.version="1.11.1",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=h2(this.render.bind(this),200),!t&&e.mode!=="node"&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:g=0,frozenRowCount:f,defaultRowHeight:p=40,defaultHeaderRowHeight:v,defaultColWidth:m=80,defaultHeaderColWidth:b,widthMode:w="standard",heightMode:C="standard",autoFillWidth:_=!1,autoFillHeight:y=!1,widthAdaptiveMode:x="only-body",heightAdaptiveMode:S="only-body",keyboardOptions:A,eventOptions:R,rowSeriesNumber:T,columnResizeMode:M,rowResizeMode:P="none",dragHeaderMode:k,showFrozenIcon:B,allowFrozenColCount:H,padding:E,hover:F,menu:L,select:z,customRender:D,pixelRatio:N=Yo,renderChartAsync:V,renderChartAsyncBatchCount:G,mode:U,modeParams:Z,canvasWidth:q,canvasHeight:j,overscrollBehavior:rt,limitMinWidth:ht,limitMinHeight:gt,clearDOM:vt=!0}=e;this.container=t,this.options=e,this._widthMode=w,this._heightMode=C,this._widthAdaptiveMode=x,this._heightAdaptiveMode=S,this._autoFillWidth=_,this._autoFillHeight=y,this.customRender=D,this.padding={top:0,right:0,left:0,bottom:0},E&&(typeof E=="number"?(this.padding.top=E,this.padding.left=E,this.padding.bottom=E,this.padding.right=E):(E.top&&(this.padding.top=E.top),E.bottom&&(this.padding.bottom=E.bottom),E.left&&(this.padding.left=E.left),E.right&&(this.padding.right=E.right))),I(j)&&I(q)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=q,this.canvasHeight=j,this.columnWidthComputeMode=(i=e.columnWidthComputeMode)!==null&&i!==void 0?i:"normal";const W=this.internalProps={};if(B!==void 0&&(this.showFrozenIcon=B),typeof H=="number"&&H<=0&&(this.showFrozenIcon=!1),this.options.canvas?(W.element=this.options.canvas.parentElement,W.element.style.position="relative",W.focusControl=new Py(this,W.element),W.canvas=this.options.canvas,W.context=W.canvas.getContext("2d")):Wt.mode!=="node"&&(W.element=kE(this.padding),W.focusControl=new Py(this,W.element),W.canvas=document.createElement("canvas"),W.element.appendChild(W.canvas),W.context=W.canvas.getContext("2d"),!((o=e.customConfig)===null||o===void 0)&&o.createReactContainer&&AF(this)),W.handler=new Lh,nt(this.options.resizeTime)&&(W.handler.resizeTime=this.options.resizeTime),W.pixelRatio=N,W.frozenColCount=g,W.frozenRowCount=f,W.defaultRowHeight=p,W.defaultHeaderRowHeight=v??p,W.defaultColWidth=m,W.defaultHeaderColWidth=b??m,W.keyboardOptions=A,W.eventOptions=R,W.rowSeriesNumber=T,W.columnResizeMode=M,W.rowResizeMode=P,W.dragHeaderMode=k??"none",W.renderChartAsync=V,__(G),W.overscrollBehavior=rt??"auto",W._rowHeightsMap=new Hy(this),W._rowRangeHeightsMap=new Map,W._colRangeWidthsMap=new Map,W._widthResizedColMap=new Set,W._heightResizedRowMap=new Set,this.colWidthsMap=new lo,this.colContentWidthsMap=new lo,this.colWidthsLimit={},W.calcWidthContext={_:W,get full(){var O;return Wt.mode==="node"?q/(N??1):this._.canvas.width/((O=this._.context.pixelRatio)!==null&&O!==void 0?O:window.devicePixelRatio)}},W.cellTextOverflows={},W.focusedTable=!1,W.theme=ao.of((r=e.theme)!==null&&r!==void 0?r:ao.DEFAULT),W.theme.isPivot=this.isPivotTable(),Gh(W.theme.functionalIconsStyle),t?(vt&&(t.innerHTML=""),t.appendChild(W.element),this._updateSize()):this._updateSize(),W.bodyHelper=new dI(this),W.headerHelper=new yI(this),W.rowSeriesNumberHelper=new wI(this),W.autoWrapText=e.autoWrapText,W.enableLineBreak=e.enableLineBreak,W.allowFrozenColCount=(s=e.allowFrozenColCount)!==null&&s!==void 0?s:0,W.limitMaxAutoWidth=(l=e.limitMaxAutoWidth)!==null&&l!==void 0?l:450,W.limitMinWidth=ht!=null?typeof ht=="number"?ht:ht?10:0:10,W.limitMinHeight=gt!=null?typeof gt=="number"?gt:gt?10:0:10,this.scenegraph=new ik(this),this.stateManager=new Nk(this),this.eventManager=new lI(this),this.animationManager=new OI(this),e.legends){W.legends=[];const O=St.getFunction("createLegend");if(Array.isArray(e.legends)){for(let Y=0;Y<e.legends.length;Y++)W.legends.push(O(e.legends[Y],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else W.legends.push(O(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(W.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),W.tooltip.renderMode==="html"){const O=St.getComponent("tooltipHandler");O&&(W.tooltipHandler=new O(this,W.tooltip.confine))}if(W.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray((a=e.menu)===null||a===void 0?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight((h=e.menu)===null||h===void 0?void 0:h.dropDownMenuHighlight),Array.isArray((d=e.menu)===null||d===void 0?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),W.menu.renderMode==="html"){const O=St.getComponent("menuHandler");W.menuHandler=new O(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,W.stick={changedCells:new Map},W.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new SI(this,(u=e.customCellStyle)!==null&&u!==void 0?u:[],(c=e.customCellStyleArrangement)!==null&&c!==void 0?c:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.options.canvasHeight=e,this.options.canvasWidth=t,this.resize()}resize(){var t;this._updateSize(),(t=this.internalProps.legends)===null||t===void 0||t.forEach(e=>{e==null||e.resize()}),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return(t=this.internalProps.colCount)!==null&&t!==void 0?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,r;return(r=(i=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.frozenColCount)!==null&&i!==void 0?i:(o=this.internalProps)===null||o===void 0?void 0:o.frozenColCount)!==null&&r!==void 0?r:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,r;return(r=(i=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.frozenRowCount)!==null&&i!==void 0?i:(o=this.internalProps)===null||o===void 0?void 0:o.frozenRowCount)!==null&&r!==void 0?r:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,r;return(r=(i=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.rightFrozenColCount)!==null&&i!==void 0?i:(o=this.internalProps)===null||o===void 0?void 0:o.rightFrozenColCount)!==null&&r!==void 0?r:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,r;return(r=(i=(e=(t=this.internalProps)===null||t===void 0?void 0:t.layoutMap)===null||e===void 0?void 0:e.bottomFrozenRowCount)!==null&&i!==void 0?i:(o=this.internalProps)===null||o===void 0?void 0:o.bottomFrozenRowCount)!==null&&r!==void 0?r:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return(t=this.internalProps.keyboardOptions)!==null&&t!==void 0?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=t??void 0}get eventOptions(){var t;return(t=this.internalProps.eventOptions)!==null&&t!==void 0?t:null}set eventOptions(t){this.internalProps.eventOptions=t??void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return t==="auto"?0:tl(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=tl(this,e.min),i.minDef=e.min),e.max&&(i.max=tl(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(NE(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return Wt.mode==="node"?e/(t??1):this._.canvas.width/((i=this._.context.pixelRatio)!==null&&i!==void 0?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R;const{padding:T}=this;let M=0,P=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)M=this.options.viewBox.x2-this.options.viewBox.x1,P=this.options.viewBox.y2-this.options.viewBox.y1,!((t=this==null?void 0:this.scenegraph)===null||t===void 0)&&t.stage&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(M,P));else if(Wt.mode==="browser"){const H=this.getElement();let E=0,F=0;if(this.canvasSizeSeted)E=this.canvasWidth,F=this.canvasHeight;else if(H.parentElement){const N=H.parentElement.style||window.getComputedStyle(H.parentElement);E=H.parentElement.offsetWidth-parseInt(N.paddingLeft||"0px",10)-parseInt(N.paddingRight||"0px",10),F=H.parentElement.offsetHeight-parseInt(N.paddingTop||"0px",10)-parseInt(N.paddingBottom||"0px",20)}const L=E??0,z=F??0;H.style.width=L&&L-T.left-T.right+"px"||"0px",H.style.height=z&&z-T.top-T.bottom+"px"||"0px";const{canvas:D}=this.internalProps;M=(i=(e=D.parentElement)===null||e===void 0?void 0:e.offsetWidth)!==null&&i!==void 0?i:0,P=(r=(o=D.parentElement)===null||o===void 0?void 0:o.offsetHeight)!==null&&r!==void 0?r:0,!((s=this==null?void 0:this.scenegraph)===null||s===void 0)&&s.stage?this.scenegraph.stage.resize(M,P):(D.style.width="",D.style.height="",D.width=M,D.height=P,D.style.width=`${M}px`,D.style.height=`${P}px`)}else Wt.mode==="node"&&(M=this.canvasWidth-1,P=this.canvasHeight-1);const k=Math.floor(M-i2(this.getTheme().scrollStyle)),B=Math.floor(P-e2(this.getTheme().scrollStyle));if(!((l=this.internalProps.theme)===null||l===void 0)&&l.frameStyle){const H=Ky((h=(a=this.internalProps.theme.frameStyle)===null||a===void 0?void 0:a.borderLineWidth)!==null&&h!==void 0?h:[null]),E=Ky((u=(d=this.internalProps.theme.frameStyle)===null||d===void 0?void 0:d.shadowBlur)!==null&&u!==void 0?u:[0]);!((c=this.theme.frameStyle)===null||c===void 0)&&c.innerBorder?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=k-((g=E[1])!==null&&g!==void 0?g:0),this.tableNoFrameHeight=B-((f=E[2])!==null&&f!==void 0?f:0)):(this.tableX=((p=H[3])!==null&&p!==void 0?p:0)+((v=E[3])!==null&&v!==void 0?v:0),this.tableY=((m=H[0])!==null&&m!==void 0?m:0)+((b=E[0])!==null&&b!==void 0?b:0),this.tableNoFrameWidth=k-(((w=H[1])!==null&&w!==void 0?w:0)+((C=E[1])!==null&&C!==void 0?C:0))-(((_=H[3])!==null&&_!==void 0?_:0)+((y=E[3])!==null&&y!==void 0?y:0)),this.tableNoFrameHeight=B-(((x=H[0])!==null&&x!==void 0?x:0)+((S=E[0])!==null&&S!==void 0?S:0))-(((A=H[2])!==null&&A!==void 0?A:0)+((R=E[2])!==null&&R!==void 0?R:0)))}}updateViewBox(t){var e,i,o,r,s,l,a,h;const d=(r=(i=(e=this.options)===null||e===void 0?void 0:e.viewBox.x2)!==null&&i!==void 0?i:0-((o=this.options)===null||o===void 0?void 0:o.viewBox.x1))!==null&&r!==void 0?r:0,u=(h=(l=(s=this.options)===null||s===void 0?void 0:s.viewBox.y2)!==null&&l!==void 0?l:0-((a=this.options)===null||a===void 0?void 0:a.viewBox.y1))!==null&&h!==void 0?h:0,c=t.x2-t.x1,g=t.y2-t.y1;this.options.viewBox=t,d!==c||u!==g?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,i,o,r,s){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,i,o,r,s)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,((i=this.colCount)!==null&&i!==void 0?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(o!=null)return o;const r=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(r!=null){const l=r+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(l)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(l)),Math.round(l)}let s=0;for(let l=t;l<=e;l++)s+=this.getColWidth(l);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(s)),Math.round(s)}getRowHeight(t){var e;if(I(this.rowHeightsMap.get(t))){if(!((e=this.options.customConfig)===null||e===void 0)&&e._disableColumnAndRowSizeRound){const o=this.rowHeightsMap.get(t);let r;return r=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),r=Number(r.toFixed(2)),Number.isInteger(r)?Math.ceil(o):Math.floor(o)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return nt(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?(e=this.defaultHeaderColWidth[t])!==null&&e!==void 0?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])!==null&&i!==void 0?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?(e=this.defaultHeaderRowHeight[t])!==null&&e!==void 0?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])!==null&&i!==void 0?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,!((o=this.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||this.rowCount===0)return 0;t=Math.max(t,0),e=Math.min(e,((i=this.rowCount)!==null&&i!==void 0?i:1/0)-1);let r=0;if(this.heightMode!=="standard"||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||this.internalProps._heightResizedRowMap.size!==0){if(!((o=this.options.customConfig)===null||o===void 0)&&o._disableColumnAndRowSizeRound){const s=this.rowHeightsMap.getSumInRange(t,e);let l;return l=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),l=Number(l.toFixed(2)),Number.isInteger(l)?Math.ceil(s):Math.floor(s)}r=this.rowHeightsMap.getSumInRange(t,e)}else{for(let s=t;s<Math.min(e+1,this.columnHeaderLevelCount);s++)r+=this.getRowHeight(s);e>=this.columnHeaderLevelCount&&(r+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let s=this.rowCount-this.bottomFrozenRowCount;s<e+1;s++)r+=this.getRowHeight(s)}return Math.round(r)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if(this.widthMode==="autoWidth")return"auto";const{width:o}=(e=i==null?void 0:i.getColumnWidthDefined(t))!==null&&e!==void 0?e:{};return typeof o=="number"&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return this.heightMode==="autoHeight"||t>=0&&t<this.columnHeaderLevelCount&&this.getDefaultRowHeight(t)==="auto"}getColWidth(t){var e;const i=(e=this.colWidthsMap.get(t))!==null&&e!==void 0?e:this.getDefaultColumnWidth(t);return this.widthMode==="adaptive"&&typeof i=="number"||this.transpose&&typeof i=="number"?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,typeof e=="number"?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.scenegraph.updateChartSizeForResizeColWidth(t),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if(typeof t!="number")this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const o=NI.exec(i);if(o){const r=Number(o[1]),s=Number(o[2]);t>=r&&t<=s&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=(e=i&&i.max)!==null&&e!==void 0?e:1/0;return typeof o=="string"&&(o=tl(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=(e=i&&i.min)!==null&&e!==void 0?e:0;return typeof o=="string"&&(o=tl(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const r=this.isFrozenCell(t,e);let s;const l=this.getColWidth(t);let a;s=r&&r.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-((i=this.getColsWidth(t,this.colCount-1))!==null&&i!==void 0?i:0):this.getColsWidth(0,t-1)||0;const h=this.getRowHeight(e);return a=r&&r.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-((o=this.getRowsHeight(e,this.rowCount-1))!==null&&o!==void 0?o:0):this.getRowsHeight(0,e-1),new _n(Math.round(s),Math.round(a),Math.round(l),Math.round(h))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,r=this.getColsWidth(i.start.col,i.end.col),s=this.getRowsHeight(0,i.start.row-1)||0,l=this.getRowsHeight(i.start.row,i.end.row);return new _n(Math.round(o),Math.round(s),Math.round(r),Math.round(l))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,r=!0;i!=null&&i.col&&(i!=null&&i.row)?(o=!1,r=!1):i!=null&&i.col?o=!1:i!=null&&i.row&&(r=!1);const s=this.getCellRect(t,e);return this._toRelativeRect(s,o,r)}getCellRangeRelativeRect(t){if(t.start){const s=this.isFrozenCell(t.start.col,t.start.row);let l=!0,a=!0;return s!=null&&s.col&&(s!=null&&s.row)?(l=!1,a=!1):s!=null&&s.col?l=!1:s!=null&&s.row&&(a=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),l,a)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,r=!0;return i!=null&&i.col&&(i!=null&&i.row)?(o=!1,r=!1):i!=null&&i.col?o=!1:i!=null&&i.row&&(r=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,r)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=i,r.right=o;const s=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,l=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=s,r.bottom=l,r}getCellsRect(t,e,i,o){var r,s,l,a,h,d;let u=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const g=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-((r=this.getColsWidth(t+1,this.colCount-1))!==null&&r!==void 0?r:0)-u:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-g,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(u=Math.min(u-g,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-((s=this.getColsWidth(t+1,this.colCount-1))!==null&&s!==void 0?s:0)-u):this.isRightFrozenColumn(t)&&(u=this.tableNoFrameWidth-((l=this.getColsWidth(t,this.colCount-1))!==null&&l!==void 0?l:0));let f=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const v=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-((a=this.getRowsHeight(e+1,this.rowCount-1))!==null&&a!==void 0?a:0)-f:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-v,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(f=Math.min(f-v,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-((h=this.getRowsHeight(e+1,this.rowCount-1))!==null&&h!==void 0?h:0)-f):this.isBottomFrozenRow(e)&&(f=this.tableNoFrameHeight-((d=this.getRowsHeight(e,this.rowCount-1))!==null&&d!==void 0?d:0)),new _n(Math.round(u),Math.round(f),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const r=this.isFrozenCell(t,e),s=this.isFrozenCell(i,o);let l=this.getColsWidth(t,i);if(r&&r.col){const a=this.scrollLeft;s&&s.col||(l-=a,l=Math.max(l,this.getColsWidth(t,this.frozenColCount-1)))}return l}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return Fy(t,this)}getColAt(t){return ky(t,this)}getCellAt(t,e){return TI(t,e,this)}getCellAtRelativePosition(t,e){return PI(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),r=VE(this);if(r.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<r.left?this.scrollLeft-=r.left-o.left:r.right<o.right&&(this.scrollLeft-=r.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<r.top?this.scrollTop-=r.top-o.top:r.bottom<o.bottom&&(this.scrollTop-=r.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise((t,e)=>{setTimeout(()=>{t()},0)})}_toRelativeRect(t,e=!0,i=!0){var o,r,s,l;const a=t.copy(),h=this.getVisibleRect();return a.offsetLeft(this.tableX-(e?h.left:0)),a.offsetTop(this.tableY-(i?h.top:0)),a.offsetLeft((r=(o=this.options.viewBox)===null||o===void 0?void 0:o.x1)!==null&&r!==void 0?r:0),a.offsetTop((l=(s=this.options.viewBox)===null||s===void 0?void 0:s.y1)!==null&&l!==void 0?l:0),a}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new _n(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const r=Math.max(o.top>=i?o.row:o.row+1,t);let s=this.getRowsHeight(0,r-1),l=0;const{rowCount:a}=this;for(let h=r;h<a;h++){const d=s+this.getRowHeight(h);if(e.bottom<d)break;l++,s=d}return l}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),r=this.getBottomFrozenRowsHeight(),s=this.getRightFrozenColsWidth(),{row:l}=this.getRowAt(t+i+1),{col:a}=this.getColAt(e+o+1),h=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-r).row:this.rowCount-1,d=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-s).col:this.colCount-1;return d<0||h<0?null:{rowStart:l,colStart:a,rowEnd:h,colEnd:d}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),r=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return r<0?null:{rowStart:o,rowEnd:r}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),r=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return r<0?null:{colStart:o,colEnd:r}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const r=Math.max(o.left>=i?o.col:o.col+1,t);let s=this.getColsWidth(0,r-1),l=0;const{colCount:a}=this;for(let h=r;h<a;h++){const d=s+this.getColWidth(h);if(e.right<d)break;l++,s=d}return l}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||typeof t.release!="function")throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v;const m=this.internalProps;if(this.isReleased)return;(e=(t=m.tooltipHandler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),(o=(i=m.menuHandler)===null||i===void 0?void 0:i.release)===null||o===void 0||o.call(i),UC.clearAll(),(r=super.release)===null||r===void 0||r.call(this),(l=(s=m.handler)===null||s===void 0?void 0:s.release)===null||l===void 0||l.call(s),this.eventManager.release(),(h=(a=m.focusControl)===null||a===void 0?void 0:a.release)===null||h===void 0||h.call(a),(d=m.legends)===null||d===void 0||d.forEach(w=>{w==null||w.release()}),(u=m.title)===null||u===void 0||u.release(),m.title=null,(c=m.emptyTip)===null||c===void 0||c.release(),m.emptyTip=null,m.layoutMap.release(),m.releaseList&&(m.releaseList.forEach(w=>{var C;return(C=w==null?void 0:w.release)===null||C===void 0?void 0:C.call(w)}),m.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),m.focusControl.release();const{parentElement:b}=m.element;b&&!this.options.canvas&&b.removeChild(m.element),(p=(f=(g=this.editorManager)===null||g===void 0?void 0:g.editingEditor)===null||f===void 0?void 0:f.onEnd)===null||p===void 0||p.call(f),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,(v=this.reactCustomLayout)===null||v===void 0||v.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,r,s,l,a,h,d,u,c,g;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:f=0,defaultRowHeight:p=40,defaultHeaderRowHeight:v,defaultColWidth:m=80,defaultHeaderColWidth:b=80,keyboardOptions:w,eventOptions:C,rowSeriesNumber:_,columnResizeMode:y,rowResizeMode:x="none",dragHeaderMode:S,showFrozenIcon:A,allowFrozenColCount:R,padding:T,hover:M,menu:P,select:k,pixelRatio:B,widthMode:H,heightMode:E,autoFillWidth:F,autoFillHeight:L,widthAdaptiveMode:z,heightAdaptiveMode:D,customRender:N,renderChartAsync:V,renderChartAsyncBatchCount:G,overscrollBehavior:U,limitMinWidth:Z,limitMinHeight:q}=t;B&&B!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=B),T&&(typeof T=="number"?(this.padding.top=T,this.padding.left=T,this.padding.bottom=T,this.padding.right=T):(T.top&&(this.padding.top=T.top),T.bottom&&(this.padding.bottom=T.bottom),T.left&&(this.padding.left=T.left),T.right&&(this.padding.right=T.right))),this.showFrozenIcon=typeof A!="boolean"||A,typeof R=="number"&&R<=0&&(this.showFrozenIcon=!1),this.widthMode=H??"standard",this.heightMode=E??"standard",this._widthAdaptiveMode=z??"only-body",this._heightAdaptiveMode=D??"only-body",this.autoFillWidth=F!=null&&F,this.autoFillHeight=L!=null&&L,this.customRender=N;const j=this.internalProps;if(Wt.mode==="node"||t.canvas||IE(j.element,this.padding),this.columnWidthComputeMode=(e=t.columnWidthComputeMode)!==null&&e!==void 0?e:"normal",j.frozenColCount=f,j.defaultRowHeight=p,j.defaultHeaderRowHeight=v??p,j.defaultColWidth=m,j.defaultHeaderColWidth=b??m,j.keyboardOptions=w,j.eventOptions=C,j.rowSeriesNumber=_,j.columnResizeMode=y,j.rowResizeMode=x,j.dragHeaderMode=S??"none",j.renderChartAsync=V,__(G),j.overscrollBehavior=U??"auto",j.cellTextOverflows={},j._rowHeightsMap=new Hy(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new lo,this.colContentWidthsMap=new lo,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=ao.of((i=t.theme)!==null&&i!==void 0?i:ao.DEFAULT),j.theme.isPivot=this.isPivotTable(),Gh(j.theme.functionalIconsStyle),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=(o=t.allowFrozenColCount)!==null&&o!==void 0?o:0,j.limitMaxAutoWidth=(r=t.limitMaxAutoWidth)!==null&&r!==void 0?r:450,j.limitMinWidth=Z!=null?typeof Z=="number"?Z:Z?10:0:10,j.limitMinHeight=q!=null?typeof q=="number"?q:q?10:0:10,(s=j.legends)===null||s===void 0||s.forEach(rt=>{rt==null||rt.release()}),(l=j.title)===null||l===void 0||l.release(),j.title=null,(a=j.emptyTip)===null||a===void 0||a.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const rt=St.getFunction("createLegend");if(Array.isArray(t.legends)){for(let ht=0;ht<t.legends.length;ht++)j.legends.push(rt(t.legends[ht],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(rt(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),j.tooltip.renderMode==="html"&&!j.tooltipHandler){const rt=St.getComponent("tooltipHandler");j.tooltipHandler=new rt(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray((h=t.menu)===null||h===void 0?void 0:h.dropDownMenuHighlight)&&this.setDropDownMenuHighlight((d=t.menu)===null||d===void 0?void 0:d.dropDownMenuHighlight),Array.isArray((u=t.menu)===null||u===void 0?void 0:u.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),j.menu.renderMode==="html"&&!j.menuHandler){const rt=St.getComponent("menuHandler");j.menuHandler=new rt(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell((c=t.customCellStyle)!==null&&c!==void 0?c:[],(g=t.customCellStyleArrangement)!==null&&g!==void 0?g:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new _n(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t,e=!0){var i,o,r,s;let l;if(!t)return{inTable:!1,x:void 0,y:void 0};l=WI(t)?t.changedTouches[0]:t;const a=l.clientX||l.pageX+window.scrollX,h=l.clientY||l.pageY+window.scrollY,d=this.internalProps.canvas.getBoundingClientRect();let u=!0;d.right<=a&&(u=!1),d.bottom<=h&&(u=!1);const c=d.width,g=c/(this.canvas.offsetWidth||c),f=d.height,p=f/(this.canvas.offsetHeight||f),v={x:(a-d.left)/g+(e?this.scrollLeft:0)-((o=(i=this.options.viewBox)===null||i===void 0?void 0:i.x1)!==null&&o!==void 0?o:0),y:(h-d.top)/p+(e?this.scrollTop:0)-((s=(r=this.options.viewBox)===null||r===void 0?void 0:r.y1)!==null&&s!==void 0?s:0),inTable:u};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(v,v),v}getTheme(){return this.internalProps.theme}getTargetColAt(t){return nf(t,this)}getTargetRowAt(t){const e=of(t,this);return e&&(e.row=Math.min(e.row,this.rowCount-1)),e}getTargetColAtConsiderRightFrozen(t,e){return Iy(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return zy(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o,r=!0,s=!1,l=!1){var a;const h=!!(!((a=this.stateManager.select.ranges)===null||a===void 0)&&a.length);this.stateManager.updateSelectPos(t,e,i,o,!1,!r,s,l),this.stateManager.endSelectCells(!0,h)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach((o,r)=>{o.start.col===o.end.col&&o.start.row===o.end.row?this.stateManager.updateSelectPos(o.start.col,o.start.row,!1,r>=1,!1,!1,!0):(this.stateManager.updateSelectPos(o.start.col,o.start.row,!1,r>=1,!1,!1,!0),this.stateManager.updateInteractionState(Rt.grabing),this.stateManager.updateSelectPos(o.end.col,o.end.row,!1,r>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(Rt.default)}),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),DE(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=ao.of(t??ao.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,Gh(this.internalProps.theme.functionalIconsStyle)}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=ao.of(t??ao.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),Gh(this.internalProps.theme.functionalIconsStyle),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return i==null?void 0:i.define}getBodyColumnType(t,e){var i,o;const r=(o=(i=this.internalProps.layoutMap.getBody(t,e))===null||i===void 0?void 0:i.cellType)!==null&&o!==void 0?o:"text";return lt("cellType",{cellType:r},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,lt("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return i==null?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find(o=>o&&o.field===t.field);if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const o=this.internalProps.customMergeCell(t,e,this);if(o&&o.range&&(I(o.text)||o.customLayout||o.customRender))return o.range}return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(I(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),r=i.style,s=sg(r,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=s}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),r=o==null?void 0:o.define,s=(i=r==null?void 0:r.description)!==null&&i!==void 0?i:o==null?void 0:o.description;return typeof s=="function"?s({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):s}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return(i=this.internalProps.layoutMap)===null||i===void 0?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:i==null?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(t===null||this.internalProps.layoutMap.isHeader(e,i))return!1;const r=this.getRecordShowIndexByCell(e,i);return(o=this.internalProps.dataSource)===null||o===void 0?void 0:o.hasField(r,t)}_getCellStyle(t,e){return zI(t,e,this)}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyMergeTitleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0)||this.isCellRangeEqual(t,e,t+1,e)||this.internalProps.columnResizeMode==="none")return!1;if(this.internalProps.columnResizeMode==="header"){if(!this.isHeader(t,e))return!1}else if(this.internalProps.columnResizeMode==="body"&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0)||this.isCellRangeEqual(t,e,t,e+1)||this.internalProps.rowResizeMode==="none")return!1;if(this.internalProps.rowResizeMode==="header"){if(!this.isHeader(t,e))return!1}else if(this.internalProps.rowResizeMode==="body"&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||!((i=this.options.select)===null||i===void 0)&&i.disableHeaderSelect||!((o=this.options.select)===null||o===void 0)&&o.disableSelect)){if(this.internalProps.frozenColDragHeaderMode==="disabled"&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const s=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(s.end.row!==this.rowCount-1)return!1}else if(!this.isRowHeader(t,e)||s.end.col!==this.colCount-1)return!1}const r=this.getHeaderDefine(t,e);if(!r)return!1;if(r.dragHeader===void 0){if(this.internalProps.dragHeaderMode==="all")return!0;if(this.internalProps.dragHeaderMode==="column"){if(this.isColumnHeader(t,e))return!0}else if(this.internalProps.dragHeaderMode==="row"&&this.isRowHeader(t,e))return!0;return!1}return r.dragHeader}return!1}getCellIcons(t,e){var i,o,r;let s;if(this.isHeader(t,e))s=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){(!this.options.groupBy||!(!((i=this.getCellRawRecord(t,e))===null||i===void 0)&&i.vtableMerge))&&!((r=(o=this.internalProps.layoutMap.getSeriesNumberBody(t,e))===null||o===void 0?void 0:o.define)===null||r===void 0)&&r.dragOrder&&(s=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const l=this.getCellValue(t,e),a=this.getCellOriginValue(t,e),h=this.internalProps.context,d=this.internalProps.bodyHelper.getIcons(t,e,l,a,h);(s==null?void 0:s.length)>0?s=s.concat(d):(d==null?void 0:d.length)>0&&(s=d)}else{const l=this.getCellValue(t,e),a=this.getCellOriginValue(t,e),h=this.internalProps.context;s=this.internalProps.bodyHelper.getIcons(t,e,l,a,h)}return s}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),this.internalProps.menu.renderMode==="html"&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){this.internalProps.tooltip.renderMode==="html"&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=ho(i,this,t,e,lt).theme,{autoWrapText:r,lineClamp:s,textOverflow:l}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:ze(o.group.fill)?lt("bgColor",i,t,e,this):o.group.fill,color:ze(o.text.fill)?lt("color",i,t,e,this):o.text.fill,strokeColor:ze(o.text.stroke)?lt("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:r!=null&&r,lineClamp:s??"auto",textOverflow:l,borderColor:ze(o.group.stroke)?lt("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:lt("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,r=this.colCount-1,s=this.rowCount-1;return Array(Math.min(e??2e3,s-o+1,this.rowCount)).fill(0).map((l,a)=>Array(Math.min(t??2e3,r-i+1,this.colCount)).fill(0).map((h,d)=>this.getCellInfo(d+i,a+o)))}getAllCells(t,e){const r=this.colCount-1,s=this.rowCount-1;return Array(Math.min(e??2e3,s-0+1,this.rowCount)).fill(0).map((l,a)=>Array(Math.min(t??2e3,r-0+1,this.colCount)).fill(0).map((h,d)=>this.getCellInfo(d+0,a+0)))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=0,i=this.colCount-1,o=this.columnHeaderLevelCount-1;return Array(o-e+1).fill(0).map((r,s)=>Array(i-t+1).fill(0).map((l,a)=>this.getCellInfo(a+t,s+e)))}getAllRowHeaderCells(){const e=this.columnHeaderLevelCount,i=this.rowHeaderLevelCount-1,o=this.rowCount-1;return Array(o-e+1).fill(0).map((r,s)=>Array(i-0+1).fill(0).map((l,a)=>this.getCellInfo(a+0,s+e)))}getCopyValue(){var t,e,i;if(((e=(t=this.stateManager.select)===null||t===void 0?void 0:t.ranges)===null||e===void 0?void 0:e.length)>0){const o=this.stateManager.select.ranges;let r=Math.min(o[0].start.col,o[0].end.col),s=Math.max(o[0].start.col,o[0].end.col),l=Math.min(o[0].start.row,o[0].end.row),a=Math.max(o[0].start.row,o[0].end.row);o.forEach(f=>{r=Math.min(r,f.start.col,f.end.col),s=Math.max(s,f.start.col,f.end.col),l=Math.min(l,f.start.row,f.end.row),a=Math.max(a,f.start.row,f.end.row)});const h=f=>{let p=!1;return o.forEach(v=>{const m=Math.min(v.start.row,v.end.row),b=Math.max(v.start.row,v.end.row);m<=f&&b>=f&&(p=!0)}),p},d=f=>{let p=!1;return o.forEach(v=>{const m=Math.min(v.start.col,v.end.col),b=Math.max(v.start.col,v.end.col);m<=f&&b>=f&&(p=!0)}),p},u=(f,p)=>{let v;return o.forEach(m=>{const b=Math.min(m.start.row,m.end.row),w=Math.max(m.start.row,m.end.row),C=Math.min(m.start.col,m.end.col),_=Math.max(m.start.col,m.end.col);C<=f&&_>=f&&b<=p&&w>=p&&(v=m)}),v},c=(f,p,v)=>{const m=this.getCellRange(f,p);let b=m.start.col,w=m.start.row;if(v){const C=Math.min(v.start.col,v.end.col),_=Math.min(v.start.row,v.end.row);b=Math.max(C,m.start.col),w=Math.max(_,m.start.row)}return b!==f||w!==p?"":this.getCellValue(f,p)};let g="";for(let f=l;f<=a;f++)if(h(f)){for(let p=r;p<=s;p++)if(d(p)){const v=u(p,f);if(v){const m=c(p,f,v);if(!(typeof Promise<"u"&&m instanceof Promise)){const b=I(m)?`${m}`:"";/^\[object .*\]$/.exec(b)||(g+=b)}(p<v.end.col||p<s)&&(g+=" ")}else g+=" "}f<a&&(g+=`\r
|
|
221
|
+
`)}return!((i=this.options)===null||i===void 0)&&i.formatCopyValue&&(g=this.options.formatCopyValue(g)),g}return""}getSelectedCellInfos(){var t;if(!(!((t=this.stateManager.select)===null||t===void 0)&&t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),r=Math.min(e[0].start.row,e[0].end.row),s=Math.max(e[0].start.row,e[0].end.row);e.forEach(u=>{i=Math.min(i,u.start.col,u.end.col),o=Math.max(o,u.start.col,u.end.col),r=Math.min(r,u.start.row,u.end.row),s=Math.max(s,u.start.row,u.end.row)});const l=u=>{let c=!1;return e.forEach(g=>{const f=Math.min(g.start.row,g.end.row),p=Math.max(g.start.row,g.end.row);f<=u&&p>=u&&(c=!0)}),c},a=u=>{let c=!1;return e.forEach(g=>{const f=Math.min(g.start.col,g.end.col),p=Math.max(g.start.col,g.end.col);f<=u&&p>=u&&(c=!0)}),c},h=(u,c)=>{let g;return e.forEach(f=>{const p=Math.min(f.start.row,f.end.row),v=Math.max(f.start.row,f.end.row),m=Math.min(f.start.col,f.end.col),b=Math.max(f.start.col,f.end.col);m<=u&&b>=u&&p<=c&&v>=c&&(g=f)}),g},d=[];for(let u=r;u<=s;u++)if(l(u)){const c=[];for(let g=i;g<=o;g++)if(a(g)&&h(g,u)){const f=this.getCellInfo(g,u);c.push(f)}d.push(c)}return d}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?Be(t):[]}measureText(t,e){return a_.measureText(t,e)}measureTextBounds(t){return d_(t)}getCustomRender(t,e){let i;if(this.getCellLocation(t,e)!=="body"){const o=this.getHeaderDefine(t,e);i=o==null?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(o==null?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if(this.getCellLocation(t,e)!=="body"){const o=this.getHeaderDefine(t,e);i=o==null?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=o==null?void 0:o.customLayout}return i}hasAutoImageColumn(){return this._hasAutoImageColumn===void 0&&(this._hasAutoImageColumn=RI(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,r,s;const l=this.scenegraph.getCell((e=(t=this.stateManager.hover)===null||t===void 0?void 0:t.cellPos)===null||e===void 0?void 0:e.col,(o=(i=this.stateManager.hover)===null||i===void 0?void 0:i.cellPos)===null||o===void 0?void 0:o.row);return((s=(r=l==null?void 0:l.getChildren())===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.type)==="chart"?l.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,r,s;const l=this.getDrawRange(),a=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let h,d,u,c;return this.frozenRowCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(u=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),!!(a.top>=l.top&&a.bottom<=l.bottom&&a.left>=l.left&&a.right<=l.right&&(this.isFrozenCell(t,e)||a.top>=((i=h==null?void 0:h.bottom)!==null&&i!==void 0?i:a.top)&&a.left>=((o=d==null?void 0:d.right)!==null&&o!==void 0?o:a.left)&&a.bottom<=((r=u==null?void 0:u.top)!==null&&r!==void 0?r:a.bottom)&&a.right<=((s=c==null?void 0:c.left)!==null&&s!==void 0?s:a.right)))}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:o}=i;return o}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,r,s,l;const a=this.cellIsInVisualView(t,e),{scrollTop:h,scrollLeft:d}=this;a||this.scrollToCell({col:t,row:e});const u=this.getCellRelativeRect(t,e);((r=(o=this.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0?void 0:r.length)>0&&K_(this.scenegraph);const{col:c,row:g}=this.stateManager.hover.cellPos;let f,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),i==null?void 0:i.disableBackground){const b=this.scenegraph.getCell(t,e);f=b.attribute.fill,b.setAttribute("fill","transparent")}if(i!=null&&i.disableBorder){const b=this.scenegraph.getCell(t,e);p=b.attribute.stroke,b.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let v=0;this.theme.cellBorderClipDirection==="bottom-right"&&(v=1);const m=this.scenegraph.stage.toCanvas(!1,new he().set(u.left+this.tableX+1,u.top+this.tableY+1,u.right+this.tableX-v,u.bottom+this.tableY-v));return a||(this.setScrollTop(h),this.setScrollLeft(d)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),f&&this.scenegraph.getCell(t,e).setAttribute("fill",f),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),((l=(s=this.stateManager.select)===null||s===void 0?void 0:s.ranges)===null||l===void 0?void 0:l.length)>0&&$_(this.scenegraph),this.stateManager.updateHoverPos(c,g),this.scenegraph.updateNextFrame(),m.toDataURL()}exportCellRangeImg(t){var e,i,o,r;const{scrollTop:s,scrollLeft:l}=this,a=Math.min(t.start.col,t.end.col),h=Math.min(t.start.row,t.end.row),d=Math.max(t.start.col,t.end.col),u=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(a,h),g=this.cellIsInVisualView(d,u);c&&g||this.scrollToCell({col:a,row:h});const f=this.getCellRangeRelativeRect({start:{col:a,row:h},end:{col:d,row:u}});((i=(e=this.stateManager.select)===null||e===void 0?void 0:e.ranges)===null||i===void 0?void 0:i.length)>0&&K_(this.scenegraph);const{col:p,row:v}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const m=this.scenegraph.stage.toCanvas(!1,new he().set(f.left+this.tableX+1,f.top+this.tableY+1,f.right+this.tableX,f.bottom+this.tableY)).toDataURL();return c&&g||(this.setScrollTop(s),this.setScrollLeft(l)),((r=(o=this.stateManager.select)===null||o===void 0?void 0:o.ranges)===null||r===void 0?void 0:r.length)>0&&$_(this.scenegraph),this.stateManager.updateHoverPos(p,v),m}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(t="image/png"){if(this.options.mode!=="node")return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,new he().set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),typeof e=="function"?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter(i=>i.callback!==e):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach(i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)})}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return((t=this.internalProps.layoutMap)===null||t===void 0?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return(e=(t=this.internalProps.layoutMap)===null||t===void 0?void 0:t.leftRowSeriesNumberColumnCount)!==null&&e!==void 0?e:0}setMinMaxLimitWidth(t=!1){var e,i;const o=this.internalProps;for(let r=0;r<o.layoutMap.columnWidths.length;r++){if(this.internalProps._widthResizedColMap.has(r))continue;const{width:s,minWidth:l,maxWidth:a}=(i=(e=o.layoutMap.columnWidths)===null||e===void 0?void 0:e[r])!==null&&i!==void 0?i:{};t&&s&&(typeof s=="string"&&s!=="auto"||typeof s=="number"&&s>0)&&this._setColWidth(r,s),l&&(typeof l=="number"&&l>0||typeof l=="string")&&this.setMinColWidth(r,l),a&&(typeof a=="number"&&a>0||typeof a=="string")&&this.setMaxColWidth(r,a)}}setSortedIndexMap(t,e){var i;(i=this.dataSource)===null||i===void 0||i.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new jE(t,this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}get frozenBodyDomContainer(){return this.internalProps.frozenBodyDomContainer}get frozenHeaderDomContainer(){return this.internalProps.frozenHeaderDomContainer}get rightFrozenBodyDomContainer(){return this.internalProps.rightFrozenBodyDomContainer}get rightFrozenHeaderDomContainer(){return this.internalProps.rightFrozenHeaderDomContainer}get frozenBottomDomContainer(){return this.internalProps.frozenBottomDomContainer}get bottomDomContainer(){return this.internalProps.bottomDomContainer}get rightFrozenBottomDomContainer(){return this.internalProps.rightFrozenBottomDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}getGroupTitleLevel(t,e){}scrollToRow(t,e){e?this.animationManager.scrollTo({row:t},e):this.scrollToCell({row:t})}scrollToCol(t,e){e?this.animationManager.scrollTo({col:t},e):this.scrollToCell({col:t})}scrollToCell(t,e){if(e)return void this.animationManager.scrollTo(t,e);const i=this.getDrawRange();if(I(t.col)&&t.col>=this.frozenColCount){const o=this.getFrozenColsWidth(),r=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(r-o,this.getAllColsWidth()-i.width)}if(I(t.row)&&t.row>=this.frozenRowCount){const o=this.getFrozenRowsHeight(),r=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(r-o,this.getAllRowsHeight()-i.height)}this.render()}}const jI={},$y={};function GI(n){if($y[n])return $y[n]}const UI=(n,t)=>{var e,i;if(!(t!=null&&t.fields)||n.length===0)return n;const o=t.fields,r=n[0],s={},l=[];for(const a in o)if(Object.prototype.hasOwnProperty.call(o,a)){const h=o[a];if(!h.type){let u=r;a in r||(u=(e=n.find(c=>a in c))!==null&&e!==void 0?e:r),h.type=typeof u[a]=="number"?"linear":"ordinal"}let d;if(typeof h.sortIndex=="number"&&(d={key:a,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:h.sortReverse===!0},l.push(d)),((i=h.domain)===null||i===void 0?void 0:i.length)>0)if(h.type==="ordinal"){h._domainCache={},s[a]=h;const u={};h.domain.forEach((c,g)=>{u[c]=g,h._domainCache[c]=g}),d&&(d.sortIndex=u,d.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(s[a]=h)}return Object.keys(s).length>0&&(n=n.filter(a=>{for(const h in s){const d=s[h];if(d.type==="ordinal"){if(!(a[h]in d._domainCache))return!1}else if(d.domain[0]>a[h]||d.domain[1]<a[h])return!1}return!0})),l.sort((a,h)=>a.index-h.index),n.sort((a,h)=>KI(a,h,l)),n};function KI(n,t,e){for(let i=0;i<e.length;i++){const o=e[i];let r=0;if(o.type==="ordinal"?(o.sortIndex[t[o.key]]===void 0&&(o.sortIndex[t[o.key]]=o.sortIndexCount++),o.sortIndex[n[o.key]]===void 0&&(o.sortIndex[n[o.key]]=o.sortIndexCount++),r=o.sortIndex[n[o.key]]-o.sortIndex[t[o.key]]):o.type==="linear"&&(r=n[o.key]-t[o.key]),o.sortReverse&&(r=-r),r!==0)return r}return 0}let sf=0;const $I=1e8;function Yy(n="dataset"){return sf>$I&&(sf=0),n+"_"+sf++}class YI{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new _o,i=t!=null&&t.name?t.name:Yy("dataset"),this.name=i,this._logger=(e=t==null?void 0:t.logger)!==null&&e!==void 0?e:ne.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&((i=this._logger)===null||i===void 0||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]&&((i=this._logger)===null||i===void 0||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]&&((i=this._logger)===null||i===void 0||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 o=this._callMap.get(i);o||(o=()=>{t.some(r=>r.isRunning)||i()}),t.forEach(r=>{r.target.addListener(e,o)}),this._callMap.set(i,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const o=this._callMap.get(i);o&&t.forEach(r=>{r.target.removeListener(e,o)}),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.markRunning()}),t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.parseNewData(e.data,e.options)})}multipleDataViewUpdateInRawData(t){t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.markRunning()}),t.forEach(e=>{var i;return(i=this.getDataView(e.name))===null||i===void 0?void 0:i.updateRawData(e.data,e.options)})}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const lf="_data-view-diff-rank";class Ed{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new _o,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(o={pushHistory:!0,emitMessage:!0})=>(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach(r=>{this.executeTransform(r,{pushHistory:o.pushHistory,emitMessage:!1}),this.isLastTransform(r)&&this.diffLastData()}),this.isRunning=!1,o.emitMessage!==!1&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=e!=null&&e.name?e.name:Yy("dataview"),this.name=i,e!=null&&e.history&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(e==null?void 0:e.fields)}parse(t,e,i=!1){var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const r=this.cloneParseData(t,e);if(e!=null&&e.type){const s=((o=this.dataSet.getParser(e.type))!==null&&o!==void 0?o:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=s,this.history&&this.historyData.push(r,s),this.latestData=s}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;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(t.type==="fields"){this._fields=t.options.fields;const o=this.transformsArr.findIndex(r=>r.type===t.type);o>=0&&(i=!1,this.transformsArr[o].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const o=this.isLastTransform(t);this.executeTransform(t),o&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort((t,e)=>{var i,o;return((i=t.level)!==null&&i!==void 0?i:0)-((o=e.level)!==null&&o!==void 0?o:0)})}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:i,emitMessage:o}=e,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&i!==!1&&this.historyData.push(r),this.latestData=r,o!==!1&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData||!this.latestData.forEach||!(!((t=this._diffKeys)===null||t===void 0)&&t.length))return;const e=this._diffRank+1;if(this._diffRank===0)this.latestData.forEach(i=>{i[lf]=e,this._diffMap.set(this._diffKeys.reduce((o,r)=>o+i[r],""),i)}),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let i;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach(o=>{o[lf]=e,i=this._diffKeys.reduce((r,s)=>r+o[s],""),this._diffMap.get(i)?this.latestDataAUD.update.push(o):this.latestDataAUD.add.push(o),this._diffMap.set(i,o)}),this._diffMap.forEach((o,r)=>{o[lf]<e&&(this.latestDataAUD.del.push(o),this._diffMap.delete(r))})}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof Ed||(e==null?void 0:e.clone)!==!0||(i=!0),i?Be(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:((t=this.parseOption)===null||t===void 0?void 0:t.type)==="dataview"&&this.rawData.length===1&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?dt({},this._fields,t):t;const i=this.transformsArr.find(o=>o.type==="fields");!ct(this._fields)&&ct(i)?(this.dataSet.registerTransform("fields",UI),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function XI(n){return n instanceof Ed}function Ld(n,t=["data"]){const e=n;let i;if(!I(e)||typeof e!="object"||XI(e)||dw(e))return e;const o=it(e),r=e.length;i=o?new Array(r):typeof e=="object"?{}:ze(e)||nt(e)||Qt(e)?e:Hf(e)?new Date(+e):void 0;const s=o?void 0:Object.keys(Object(e));let l=-1;if(i)for(;++l<(s||e).length;){const a=s?s[l]:l,h=e[a];t!=null&&t.includes(a.toString())?i[a]=h:i[a]=Ld(h,t)}return i}function Xy(n){var t,e;const i=Object.assign({},n);return Et(n.style)||(i.textStyle=Ae(n.style)),Et(n.textStyle)||dt(i.textStyle,Ae(n.textStyle)),!((t=n.shape)===null||t===void 0)&&t.style&&Ae(i.shape.style),!((e=n.background)===null||e===void 0)&&e.style&&Ae(i.background.style),i}function Ae(n){return Et(n)||n.angle&&(n.angle=Li(n.angle)),n}function cn(n={}){return Et(n.style)||(n.style=Ae(n.style)),Et(n.state)||Object.keys(n.state).forEach(t=>{Et(n.state[t])||(n.state[t]=Ae(n.state[t]))}),n}function Zo(n){return Et(n)?null:(Object.keys(n).forEach(t=>{Et(n[t])||(n[t]=Ae(n[t]))}),n)}function qI(n){return cn(n),cn(n.startSymbol),cn(n.endSymbol),n}const ZI={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},Jo="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",An=14,Sl={FONT_FAMILY:Jo,LABEL_FONT_SIZE:14,MAP_LABEL_FONT_SIZE:10,TITLE_FONT_SIZE:18,AXIS_TICK_SIZE:4},Fd={domainLine:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,tickSize:Sl.AXIS_TICK_SIZE,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:Sl.AXIS_TICK_SIZE/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:Sl.LABEL_FONT_SIZE,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:Sl.LABEL_FONT_SIZE,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function JI(n){var t,e;return!((e=(t=n==null?void 0:n.colorScheme)===null||t===void 0?void 0:t.default)===null||e===void 0)&&e.palette?dt({},Fd,{tick:{style:{stroke:n.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:n.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:n.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:n.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):Fd}function qy(n){var t,e,i,o,r,s,l,a,h,d,u,c,g;const f=dt({},n);let p,v=(e=(t=f.title)===null||t===void 0?void 0:t.angle)!==null&&e!==void 0?e:0;f.orient!=="left"&&f.orient!=="right"||!((i=f.title)===null||i===void 0)&&i.autoRotate&&ct(f.title.angle)&&(v=f.orient==="left"?-90:90,p=ZI[f.orient]);const m=z1(f.label,["style","formatMethod","state"]);return{orient:f.orient,select:f.select,hover:f.hover,line:qI(f.domainLine),label:Object.assign({style:Ae(f.label.style),formatMethod:f.label.formatMethod?(b,w,C)=>f.label.formatMethod(w.rawValue,w):null,state:Zo(f.label.state)},m),tick:{visible:f.tick.visible,length:f.tick.tickSize,inside:f.tick.inside,alignWithLabel:f.tick.alignWithLabel,style:Ae(f.tick.style),state:Zo(f.tick.state),dataFilter:f.tick.dataFilter},subTick:{visible:f.subTick.visible,length:f.subTick.tickSize,inside:f.subTick.inside,count:f.subTick.tickCount,style:Ae(f.subTick.style),state:Zo(f.subTick.state)},grid:{type:"line",visible:f.grid.visible,alternateColor:f.grid.alternateColor,alignWithLabel:f.grid.alignWithLabel,style:Ae(f.grid.style)},subGrid:{type:"line",visible:f.subGrid.visible,alternateColor:f.subGrid.alternateColor,style:Ae(f.subGrid.style)},title:{visible:f.title.visible,position:f.title.position,space:f.title.space,autoRotate:!1,angle:v?Li(v):null,textStyle:dt({},p,Ae(f.title.style)),padding:f.title.padding,shape:{visible:(o=f.title.shape)===null||o===void 0?void 0:o.visible,space:(r=f.title.shape)===null||r===void 0?void 0:r.space,style:Ae((s=f.title.shape)===null||s===void 0?void 0:s.style)},background:{visible:(l=f.title.background)===null||l===void 0?void 0:l.visible,style:Ae((a=f.title.background)===null||a===void 0?void 0:a.style)},state:{text:Zo(f.title.state),shape:Zo((h=f.title.shape)===null||h===void 0?void 0:h.state),background:Zo((d=f.title.background)===null||d===void 0?void 0:d.state)}},panel:{visible:(u=f.background)===null||u===void 0?void 0:u.visible,style:Ae((c=f.background)===null||c===void 0?void 0:c.style),state:Zo((g=f.background)===null||g===void 0?void 0:g.state)}}}const Zy="NO_AXISID_FRO_VTABLE";function QI(n,t,e){var i,o;const r=e.getCellHeaderPaths(n,t);let s;if(e.indicatorsAsCol){const a=(i=r.colHeaderPaths.find(h=>h.indicatorKey))===null||i===void 0?void 0:i.indicatorKey;s=e.columnObjects.find(h=>h.indicatorKey===a)}else{const a=(o=r.rowHeaderPaths.find(h=>h.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(h=>h.indicatorKey===a)}const l=s==null?void 0:s.chartSpec;return typeof l=="function"?l({col:n,row:t,dataValue:e._table.getCellOriginValue(n,t)||"",value:e._table.getCellValue(n,t)||"",rect:e._table.getCellRangeRelativeRect(e._table.getCellRange(n,t)),table:e._table}):l}function t3(n,t,e){var i,o;const r=e.getCellHeaderPaths(n,t);let s;if(e.indicatorsAsCol){const l=(i=r.colHeaderPaths.find(a=>a.indicatorKey))===null||i===void 0?void 0:i.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}else{const l=(o=r.rowHeaderPaths.find(a=>a.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}return typeof(s==null?void 0:s.chartSpec)!="function"}function e3(n,t,e){var i,o;const r=e.getCellHeaderPaths(n,t);let s;if(e.indicatorsAsCol){const l=(i=r.colHeaderPaths.find(a=>a.indicatorKey))===null||i===void 0?void 0:i.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}else{const l=(o=r.rowHeaderPaths.find(a=>a.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;s=e.columnObjects.find(a=>a.indicatorKey===l)}return s==null?void 0:s.noDataRenderNothing}function af(n){let t=!1;for(let e=0;e<n.length;e++){const i=n[e];if(i.chartSpec&&i.chartSpec.type!=="wordCloud"&&i.chartSpec.type!=="radar"&&i.chartSpec.type!=="gauge"&&i.chartSpec.type!=="pie"&&i.chartSpec.type!=="funnel"&&i.chartSpec.type!=="rose"){t=!0;break}}return t}function i3(n,t,e){let i=!0;const o=e.getRawChartSpec(n,t);return o&&o.type!=="pie"&&o.type!=="radar"&&o.type!=="gauge"&&o.type!=="wordCloud"&&o.type!=="funnel"&&o.type!=="rose"||(i=!1),i}function qr(n,t,e,i){let o=!1;if(i.indicatorsAsCol&&e==="row"||!i.indicatorsAsCol&&e==="col")for(let r=0;r<i.indicatorsDefine.length;r++){const s=i.indicatorsDefine[r];if(s.chartSpec&&s.chartSpec.type!=="pie"&&s.chartSpec.type!=="wordCloud"&&s.chartSpec.type!=="radar"&&s.chartSpec.type!=="gauge"&&s.chartSpec.type!=="funnel"&&s.chartSpec.type!=="rose"){o=!0;break}}else{const r=i.getRawChartSpec(n,t);r?r.type!=="pie"&&r.type!=="radar"&&r.type!=="gauge"&&r.type!=="wordCloud"&&r.type!=="funnel"&&r.type!=="rose"&&(o=!0):o=!1}return o}function n3(n,t,e){let i=e.getRawChartSpec(n,t);return i?(e._table.isPivotChart()&&(i=Ld(i),i.sortDataByAxis=!0,it(i.series)&&i.series.forEach(o=>{o.sortDataByAxis=!0}),i.type!=="gauge"&&i.type!=="rose"&&i.type!=="radar"&&(i.axes=e.getChartAxes(n,t)),i.padding=0,i.dataZoom=[]),i):null}function o3(n,t,e){var i,o,r;const s=[];if(e.indicatorsAsCol){const l=e.getIndicatorKeyInChartSpec(n,t).slice(0,2),a=e.getColKeysPath(n,t);l.forEach((v,m)=>{const{range:b,isZeroAlign:w,axisOption:C}=kd(n,t,m,m===0?"bottom":"top",l,a,e);if(w){const _=kd(n,t,l.length-1-m,m===0?"top":"bottom",l,a,e);if(_){const{range:y}=_,x=Yr(b,y);x&&(b.min=x.range1[0],b.max=x.range1[1])}}nt(C==null?void 0:C.min)&&(b.min=C.min),nt(C==null?void 0:C.max)&&(b.max=C.max),s.push(dt({range:b,label:{style:{fontSize:An}}},C,{type:(C==null?void 0:C.type)||"linear",orient:m===0?"bottom":"top",label:{visible:!1,flush:!0},title:{visible:!1},domainLine:{visible:!1},seriesIndex:C!=null&&C.seriesId?void 0:m,sync:{axisId:Zy}}))});let h=e.getDimensionKeyInChartSpec(e.rowHeaderLevelCount,t);it(h)&&(h=h[0]);const d=e.dataset.cacheCollectedValues[h]||e.dataset.collectedValues[h]||[],u=e.getRowKeysPath(n,t),c=d[u??""],{axisOption:g,isPercent:f,chartType:p}=Xr(n,t,"left",e);s.push(dt({domain:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?Array.from(c??[]):void 0,range:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?void 0:c,label:{style:{fontSize:An}}},g,{type:(i=g==null?void 0:g.type)!==null&&i!==void 0?i:"band",orient:"left",label:{visible:!1},domainLine:{visible:!1},tick:{visible:!1},subTick:{visible:!1},title:{visible:!1}}))}else{const l=e.getIndicatorKeyInChartSpec(n,t).slice(0,2),a=e.getRowKeysPath(n,t);l.forEach((v,m)=>{const{range:b,isZeroAlign:w,axisOption:C}=kd(n,t,m,m===0?"left":"right",l,a,e);if(w){const _=kd(n,t,l.length-1-m,m===0?"right":"left",l,a,e);if(_){const{range:y}=_,x=Yr(b,y);x&&(b.min=x.range1[0],b.max=x.range1[1])}}nt(C==null?void 0:C.min)&&(b.min=C.min),nt(C==null?void 0:C.max)&&(b.max=C.max),s.push(dt({range:b,label:{style:{fontSize:An}}},C,{type:(C==null?void 0:C.type)||"linear",orient:m===0?"left":"right",label:{visible:!1,flush:!0},title:{visible:!1},domainLine:{visible:!1},seriesIndex:C!=null&&C.seriesId?void 0:m,sync:{axisId:Zy}}))});let h=e.getDimensionKeyInChartSpec(n,e.columnHeaderLevelCount);it(h)&&(h=h[0]);const d=e.dataset.cacheCollectedValues[h]||e.dataset.collectedValues[h]||[],u=e.getColKeysPath(n,t),c=(o=d==null?void 0:d[u??""])!==null&&o!==void 0?o:[],{axisOption:g,isPercent:f,chartType:p}=Xr(n,t,"bottom",e);s.push(dt({domain:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?Array.from(c??[]):void 0,range:(g==null?void 0:g.type)!=="linear"||Array.isArray(c)?void 0:c,label:{style:{fontSize:An}}},g,{type:(r=g==null?void 0:g.type)!==null&&r!==void 0?r:"band",orient:"bottom",visible:!0,label:{visible:!1},domainLine:{visible:!1},tick:{visible:!1},subTick:{visible:!1},title:{visible:!1}}))}return s}function r3(n,t,e){var i;const o=e.getRawChartSpec(n,t);if(o!=null&&o.series){const r={};return!((i=o.data)===null||i===void 0)&&i.id&&(r[o.data.id]=void 0),o==null||o.series.forEach(s=>{var l,a,h,d,u,c,g,f,p,v,m;if(!(!((l=s.data)===null||l===void 0)&&l.fromDataId))if(!((a=s.data)===null||a===void 0)&&a.transforms)r[(m=(p=(f=s.data)===null||f===void 0?void 0:f.id)!==null&&p!==void 0?p:(v=o.data)===null||v===void 0?void 0:v.id)!==null&&m!==void 0?m:"data"]=void 0;else{const b=s.direction==="horizontal"?s.xField:s.yField;r[(c=(d=(h=s.data)===null||h===void 0?void 0:h.id)!==null&&d!==void 0?d:(u=o.data)===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:"data"]=!((g=s.data)===null||g===void 0)&&g.id?b:void 0}}),r}return o.data.id}function kd(n,t,e,i,o,r,s){const{axisOption:l,isPercent:a,isZeroAlign:h,seriesIndice:d}=Xr(n,t,i,s),u=rf(s.dataset.collectedValues,o,h,r,d??e);if(a&&(u.min=u.min<0?-1:0,u.max=u.max>0?1:0),(l!=null&&l.zero||u.min===u.max)&&(u.min=Math.min(u.min,0),u.max=Math.max(u.max,0)),l==null?void 0:l.nice){const c=St.getFunction("getAxisDomainRangeAndLabels"),{range:g}=c(u.min,u.max,l,h,i==="bottom"||i==="top"?s._table.getColWidth(n)||s._table.tableNoFrameWidth:s._table.getRowHeight(t)||s._table.tableNoFrameHeight);u.min=g[0],u.max=g[1]}return nt(l==null?void 0:l.min)&&(u.min=l.min),nt(l==null?void 0:l.max)&&(u.max=l.max),{range:u,isZeroAlign:h,axisOption:l}}function s3(n){let t=!1;for(let e=0;e<n.columnObjects.length;e++)if(n.columnObjects[e].chartSpec){t=!0;break}return t}class l3{constructor(t){this.isValidatingValue=!1,this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(J.DBLCLICK_CELL,e=>{var i;if(!t||t==="doubleclick"||Array.isArray(t)&&t.includes("doubleclick")){const{col:o,row:r}=e,s=$e(e.federatedEvent),l=this.table.scenegraph.getResizeColAt(s.abstractPos.x,s.abstractPos.y,(i=s.eventArgs)===null||i===void 0?void 0:i.targetCell);if(this.table._canResizeColumn(l.col,l.row)&&l.col>=0)return;this.startEditCell(o,r)}}),this.table.on(J.CLICK_CELL,e=>{if(t==="click"||Array.isArray(t)&&t.includes("click")){const{col:i,row:o}=e;this.startEditCell(i,o)}})}startEditCell(t,e,i){var o,r,s,l,a;if(this.editingEditor)return;const h=this.table.getEditor(t,e);if(h){if(!((r=(o=this.table.internalProps.layoutMap)===null||o===void 0?void 0:o.isAggregation)===null||r===void 0)&&r.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=h;const d=I(i)?i:this.table.getCellOriginValue(t,e),u=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:u.left,top:u.top,width:u.width,height:u.height}};h.beginEditing,(s=h.beginEditing)===null||s===void 0||s.call(h,this.table.getElement(),c,d),h.bindSuccessCallback,(l=h.bindSuccessCallback)===null||l===void 0||l.call(h,()=>{this.completeEdit()}),(a=h.onStart)===null||a===void 0||a.call(h,{value:d,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;if(this.isValidatingValue)return!1;const o=t==null?void 0:t.target,{editingEditor:r}=this;if(o){if(r.targetIsOnEditor){if(r.targetIsOnEditor(o))return!1}else if(!r.isEditorElement||r.isEditorElement(o))return!1}if(this.editingEditor.getValue,this.editingEditor.validateValue){this.isValidatingValue=!0;const s=(i=(e=this.editingEditor).validateValue)===null||i===void 0?void 0:i.call(e);return Cn(s)?new Promise((l,a)=>{s.then(h=>{h?(this.doExit(),l(!0)):(this.isValidatingValue=!1,l(!1))}).catch(h=>{this.isValidatingValue=!1,a(h)})}):!!s&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,r,s;const l=(e=(t=this.editingEditor).getValue)===null||e===void 0?void 0:e.call(t),a=this.table.getCellRange(this.editCell.col,this.editCell.row),h=[];for(let d=a.start.row;d<=a.end.row;d++){const u=[];for(let c=a.start.col;c<=a.end.col;c++)u.push(l);h.push(u)}this.table.changeCellValues(a.start.col,a.start.row,h),this.editingEditor.exit,(o=(i=this.editingEditor).exit)===null||o===void 0||o.call(i),(s=(r=this.editingEditor).onEnd)===null||s===void 0||s.call(r),this.editingEditor=null,this.isValidatingValue=!1}cancelEdit(){var t,e,i,o;this.editingEditor&&((e=(t=this.editingEditor).exit)===null||e===void 0||e.call(t),(o=(i=this.editingEditor).onEnd)===null||o===void 0||o.call(i),this.editingEditor=null)}}function hf(n){return n==="bottom"||n==="top"}function a3(n){return n==="left"||n==="right"}class h3{constructor(){this._scale=new ch,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,i=this._scale;if(this._scales.length===1||t.length===1)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let r=0;r<o;r++)e+=this._scales[r].scale(t[r]);i=this._scales[o-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,o;const{bandPadding:r,paddingInner:s,paddingOuter:l}=this,a=it(r),h=it(s),d=it(l);for(let u=0;u<this._scales.length;u++){const c=a?r[u]:r,g=h?s[u]:s,f=d?l[u]:l;this._scales[u].paddingInner((i=g??c)!==null&&i!==void 0?i:t,!0).paddingOuter((o=f??c)!==null&&o!==void 0?o:e)}}dataToPosition(t,e={}){var i;if(t.length===0||this._scales.length===0)return 0;const{position:o,bandScale:r}=this.getPosition(t);return o+r.bandwidth()*((i=e.bandPosition)!==null&&i!==void 0?i:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}function d3(n,t,e){n.getTransform(t)||n.registerTransform(t,e)}function u3(n,t,e){n.getParser(t)||n.registerParser(t,e)}const c3=Math.sqrt(50),g3=Math.sqrt(10),f3=Math.sqrt(2);class p3{constructor(t){this._extend={},this.type=t??"linear",this._scale=t==="log"?new js:t==="symlog"?new Gs:new ko,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,i,o,r,s){this.nice=!1,this.zero=e,this.zero&&(i.min=Math.min(i.min,0),i.max=Math.max(i.max,0)),this.domain=i,this.expand=o,this.type==="log"?this._scale.base(r??10):this.type==="symlog"&&this._scale.constant(s??10)}transformScaleDomain(){this.type==="symlog"||this.type==="log"||this.setScaleNice()}setScaleNice(){this.type==="log"?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,i,o,r,s;ct((t=this.domain)===null||t===void 0?void 0:t.min)&&ct((e=this.domain)===null||e===void 0?void 0:e.max)?this.nice&&this._scale.nice():I((i=this.domain)===null||i===void 0?void 0:i.min)&&ct((o=this.domain)===null||o===void 0?void 0:o.max)?this.nice&&this._scale.niceMax():ct((r=this.domain)===null||r===void 0?void 0:r.min)&&I((s=this.domain)===null||s===void 0?void 0:s.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,i,o,r,s,l,a;let h=(e=(t=this.forceTickCount)!==null&&t!==void 0?t:this.tickCount)!==null&&e!==void 0?e:10;this.niceType==="accurateFirst"&&(h=Math.max(10,h)),ct((i=this.domain)===null||i===void 0?void 0:i.min)&&ct((o=this.domain)===null||o===void 0?void 0:o.max)?this.nice&&this._scale.nice(h):I((r=this.domain)===null||r===void 0?void 0:r.min)&&ct((s=this.domain)===null||s===void 0?void 0:s.max)?this.nice&&this._scale.niceMax(h):ct((l=this.domain)===null||l===void 0?void 0:l.min)&&I((a=this.domain)===null||a===void 0?void 0:a.max)?this.nice&&this._scale.niceMin(h):this.nice&&this._scale.nice(h)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach(i=>{const{min:o,max:r}=i;e[0]=e[0]===void 0?o:Math.min(e[0],o),e[1]=e[1]===void 0?r:Math.max(e[1],r)}),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],i=t[t.length-1];I(this.expand.min)&&(t[0]=e-(i-e)*this.expand.min),I(this.expand.max)&&(t[t.length-1]=i+(i-e)*this.expand.max)}niceDomain(t){if(I(t[0])||I(t[1])||this.type!=="linear")return t;if(Math.abs(Pl(t)-Kd(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let o=e/5;const r=Math.floor(Math.log(o)/Math.LN10),s=o/Math.pow(10,r);o=(s>=c3?10:s>=g3?5:s>=f3?2:1)*Math.pow(10,r),t[0]=0,t[1]=10*o}i<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,i,o,r,s,l,a;if(this.nice){let h=(e=(t=this.forceTickCount)!==null&&t!==void 0?t:this.tickCount)!==null&&e!==void 0?e:10;this.niceType==="accurateFirst"&&(h=Math.max(10,h)),ct((i=this.domain)===null||i===void 0?void 0:i.min)&&ct((o=this.domain)===null||o===void 0?void 0:o.max)?this._scale.nice(h):I((r=this.domain)===null||r===void 0?void 0:r.min)&&ct((s=this.domain)===null||s===void 0?void 0:s.max)?this._scale.niceMax(h):ct((l=this.domain)===null||l===void 0?void 0:l.min)&&I((a=this.domain)===null||a===void 0?void 0:a.max)?this._scale.niceMin(h):this._scale.nice(h)}}includeZero(t){this.zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(e===void 0)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this.nice),this.niceMinMax()}extendDomain(t){let e;const i=t.length-1,o=t[0]-t[i]>0,r=o?i:0,s=o?0:i;for(const l in this._extend)e=this._extend[l],e>t[s]&&(t[s]=e),e<t[r]&&(t[r]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:i}=this.domain;I(e)&&(t[0]=e),I(i)&&(t[1]=i)}setZero(t){this.zero!==t&&(this.zero=t,this.updateScaleDomain())}updateScaleDomain(){const t=this.computeDomain([this.domain]);this.updateScaleDomainByModel(t)}computeDomain(t){return this.computeLinearDomain(t)}updateScaleDomainByModel(t){t=t??this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this.nice),this.niceMinMax()}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}function v3(n,t){const e=n.find(o=>o.name==="axis-label-container-layer-0",!0),i=n.find(o=>o.name==="axis-label-container-layer-1",!0);Jy(e?e.getChildren():[],t),Jy(i?i.getChildren():[],t)}function m3(n,t){const{width:e,height:i}=t.getLayoutRect(),o=hf(t.orient),r=t.option.inverse===!0,s=n[0],l=yo(n);if(o)if(r){const a=e,h=0,d=s.AABBBounds.x2,u=l.AABBBounds.x1;d>a&&s.setAttributes({x:a,textAlign:"right"}),u<h&&l.setAttributes({x:h,textAlign:"left"})}else{const h=e,d=s.AABBBounds.x1,u=l.AABBBounds.x2;d<0&&s.setAttributes({x:0,textAlign:"left"}),u>h&&l.setAttributes({x:h,textAlign:"right"})}else if(r){const a=s.AABBBounds.y1,h=l.AABBBounds.y2,d=0,u=i;a<d&&s.setAttributes({y:d,textBaseline:"top"}),h>u&&l.setAttributes({y:u,textBaseline:"bottom"})}else{const a=i,h=0,d=s.AABBBounds.y2,u=l.AABBBounds.y1;d>a&&s.setAttributes({y:a,textBaseline:"bottom"}),u<h&&l.setAttributes({y:h,textBaseline:"top"})}}function Jy(n,t){var e;const i=t.option;Et(n)||!((e=i==null?void 0:i.label)===null||e===void 0)&&e.flush&&m3(n,t)}const b3=n=>n;class C3{constructor(t,e,i,o,r){var s,l,a;this.x=0,this.y=0,this.padding=o,this.table=r,this.orient=(s=t.orient)!==null&&s!==void 0?s:"left",this.type=(l=t.type)!==null&&l!==void 0?l:"band",this.option=dt({},JI(t.__vtableChartTheme),_3(this.orient,r.theme),y3(this.orient,this.type,t.__vtableChartTheme),t),this.orient==="left"||this.orient==="right"?(this.width=e,this.height=i-o[0]-o[2]-0,this.y=o[0]+0):(this.orient==="top"||this.orient==="bottom")&&(this.width=e-o[1]-o[3]-0,this.height=i,this.x=o[3]+0),this.visible=(a=t.visible)===null||a===void 0||a,this.inverse="inverse"in t&&!!t.inverse,t.type==="band"&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;this.type==="band"||this.type==="point"?(this.scale=new h3,this.scale.bandPadding=t.bandPadding,this.scale.paddingInner=t.paddingInner,this.scale.paddingOuter=t.paddingOuter,this.scale.calcScales(.1,.3),this.scale.updateScaleDomain(this.data),this.updateScaleRange()):this.type!=="linear"&&this.type!=="time"&&this.type!=="log"&&this.type!=="symlog"||(this.scale=new p3(this.type),this.scale.setExtraAttrFromSpec(t.nice,t.zero,t.range,t.expand,t.base,t.constant),this.scale.transformScaleDomain(),this.scale.updateScaleDomain(),this.updateScaleRange())}initData(){this.table._vDataSet||(this.table._vDataSet=new YI),u3(this.table._vDataSet,"scale",b3),d3(this.table._vDataSet,"ticks",gH);const t=this.option.label||{},e=this.option.tick||{},i=new Ed(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:this.option.sampling!==!1,tickCount:e.tickCount,forceTickCount:e.forceTickCount,tickStep:e.tickStep,tickMode:e.tickMode,noDecimals:e.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:t.style,labelFormatter:t.formatMethod,labelGap:t.minGap,labelLastVisible:t.lastVisible,labelFlush:t.flush}},!1);this.tickData=i,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=qy(this.option),e=this.getUpdateAttribute();e.verticalFactor=this.orient==="top"||this.orient==="right"?-1:1,this.component=new Vs(dt({disableTriggerEvent:this.table.options.disableInteraction},t,e)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.component.originAxis=this}resize(t,e){this.width=t-(this.orient==="top"||this.orient==="bottom"?this.padding[1]+this.padding[3]:0),this.height=e-(this.orient==="left"||this.orient==="right"?this.padding[2]+this.padding[0]:0),this.updateScaleRange(),this.computeData();const i=qy(this.option),o=this.getUpdateAttribute();o.verticalFactor=this.orient==="top"||this.orient==="right"?-1:1,this.component.setAttributes(dt({},i,o)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.overlap()}overlap(){v3(this.component,this)}getLayoutRect(){return{width:this.width,height:this.height}}getUpdateAttribute(){this.table.tableNoFrameHeight,this.table.tableNoFrameWidth;const{width:t,height:e}=this.getLayoutRect(),i=hf(this.orient),o=a3(this.orient);let r={x:0,y:0},s=0;i?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l=this.orient==="top"||this.orient==="bottom"?e:t;return{start:{x:0,y:0},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(i)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map(e=>({id:e.value,label:e.value,value:t===0?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value})).filter(e=>e.value>=0&&e.value<=1)]}updateScaleRange(){var t,e,i,o,r,s,l,a;const h=(e=(t=this.option.innerOffset)===null||t===void 0?void 0:t.right)!==null&&e!==void 0?e:0,d=(o=(i=this.option.innerOffset)===null||i===void 0?void 0:i.left)!==null&&o!==void 0?o:0,u=(s=(r=this.option.innerOffset)===null||r===void 0?void 0:r.top)!==null&&s!==void 0?s:0,c=(a=(l=this.option.innerOffset)===null||l===void 0?void 0:l.bottom)!==null&&a!==void 0?a:0,{width:g,height:f}=this.getLayoutRect(),p=this.option.inverse||!1;let v=[0,0];hf(this.orient)?ie(g)&&(v=p?[g-h,d]:[d,g-h]):ie(f)&&(v=p?[u,f-c]:[f-c,u]),this.scale.updateRange(v)}setLayoutStartPosition(t){let{x:e,y:i}=t;return ie(e)&&(e+=+(this.orient==="left")*this.getLayoutRect().width),ie(i)&&(i+=+(this.orient==="top")*this.getLayoutRect().height),{x:e,y:i}}_getTitleLimit(t){var e,i,o;if(this.option.title.visible&&ct((e=this.option.title.style)===null||e===void 0?void 0:e.maxLineWidth)){let r=((i=this.option.title.style)===null||i===void 0?void 0:i.angle)||0;if(!((o=this.option.title)===null||o===void 0)&&o.autoRotate&&ct(this.option.title.angle)&&(r=this.option.orient==="left"?-90:90),t){const a=this.getLayoutRect().width,h=Math.abs(Math.cos(Li(r)));return h<1e-6?1/0:a/h}const s=this.getLayoutRect().height,l=Math.abs(Math.sin(Li(r)));return l<1e-6?1/0:s/l}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function _3(n,t){let e;return n==="left"?e=t.axisStyle.leftAxisStyle:n==="right"?e=t.axisStyle.rightAxisStyle:n==="top"?e=t.axisStyle.topAxisStyle:n==="bottom"&&(e=t.axisStyle.bottomAxisStyle),dt({},t.axisStyle.defaultAxisStyle,e)}function y3(n,t,e){if(!e)return{};const i=e.axis;let o,r;return t==="linear"||t==="log"||t==="symlog"?o=e.axisLinear:t==="band"&&(o=e.axisBand),n==="top"||n==="bottom"?r=e.axisX:n!=="left"&&n!=="right"||(r=e.axisY),dt({},i,o,r)}function w3(n,t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m;const b=dt({},Fd,n);let w=0;b.tick.visible!==!1&&(w=(e=b.tick.width)!==null&&e!==void 0?e:4);let C=0;if(b.label.visible){if(b.type==="band")b.domain.forEach(y=>{var x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N;b.label.formatMethod&&(y=b.label.formatMethod(y));const{width:V,height:G}=t.measureText(y,{fontSize:(A=(S=(x=b.label)===null||x===void 0?void 0:x.style)===null||S===void 0?void 0:S.fontSize)!==null&&A!==void 0?A:An,fontWeight:(M=(T=(R=b.label)===null||R===void 0?void 0:R.style)===null||T===void 0?void 0:T.fontWeight)!==null&&M!==void 0?M:"normal",fontFamily:(B=(k=(P=b.label)===null||P===void 0?void 0:P.style)===null||k===void 0?void 0:k.fontFamily)!==null&&B!==void 0?B:Jo}),U=((E=(H=b.label)===null||H===void 0?void 0:H.style)===null||E===void 0?void 0:E.maxLineWidth)||1/0,Z=((z=(L=(F=b.label)===null||F===void 0?void 0:F.style)===null||L===void 0?void 0:L.angle)!==null&&z!==void 0?z:0)+(((N=(D=b.label)===null||D===void 0?void 0:D.style)===null||N===void 0?void 0:N.direction)==="vertical"?90:0);C=Math.max(C,Zr(Math.min(V,U),G,Z).width)});else{let y;if(it(n.__ticksForVTable))y=n.__ticksForVTable;else{const x=b.range,S=Math.abs(x.min)>1?Math.round(x.min):x.min,A=Math.abs(x.max)>1?Math.round(x.max):x.max;y=[Id(S),Id(A)]}y.forEach(x=>{var S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V;b.label.formatMethod&&(x=b.label.formatMethod(x));const{width:G,height:U}=t.measureText(x,{fontSize:(R=(A=(S=b.label)===null||S===void 0?void 0:S.style)===null||A===void 0?void 0:A.fontSize)!==null&&R!==void 0?R:An,fontWeight:(P=(M=(T=b.label)===null||T===void 0?void 0:T.style)===null||M===void 0?void 0:M.fontWeight)!==null&&P!==void 0?P:"normal",fontFamily:(H=(B=(k=b.label)===null||k===void 0?void 0:k.style)===null||B===void 0?void 0:B.fontFamily)!==null&&H!==void 0?H:Jo}),Z=((F=(E=b.label)===null||E===void 0?void 0:E.style)===null||F===void 0?void 0:F.maxLineWidth)||1/0,q=((D=(z=(L=b.label)===null||L===void 0?void 0:L.style)===null||z===void 0?void 0:z.angle)!==null&&D!==void 0?D:0)+(((V=(N=b.label)===null||N===void 0?void 0:N.style)===null||V===void 0?void 0:V.direction)==="vertical"?90:0);C=Math.max(C,Zr(Math.min(G,Z),U,q).width)})}C+=(i=b.label.space)!==null&&i!==void 0?i:4}let _=0;if(b.title.visible&&Qt(b.title.text)){const{width:y,height:x}=t.measureText(b.title.text,{fontSize:(s=(r=(o=b.title)===null||o===void 0?void 0:o.style)===null||r===void 0?void 0:r.fontSize)!==null&&s!==void 0?s:An,fontWeight:(h=(a=(l=b.title)===null||l===void 0?void 0:l.style)===null||a===void 0?void 0:a.fontWeight)!==null&&h!==void 0?h:"normal",fontFamily:(c=(u=(d=b.title)===null||d===void 0?void 0:d.style)===null||u===void 0?void 0:u.fontFamily)!==null&&c!==void 0?c:Jo}),S=((f=(g=b.label)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.maxLineWidth)||1/0,A=Zr(Math.min(y,S),x,(v=(p=b.title)===null||p===void 0?void 0:p.style)===null||v===void 0?void 0:v.angle);_=n.orient!=="left"&&n.orient!=="right"||!b.title.autoRotate?A.width:A.height,_+=(m=b.title.space)!==null&&m!==void 0?m:4}return w+C+_+1}function S3(n,t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m;const b=dt({},Fd,n);let w=0;b.tick.visible!==!1&&(w=(e=b.tick.width)!==null&&e!==void 0?e:4);let C=0;if(b.label.visible){if(b.type==="band")b.domain.forEach(y=>{var x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N;b.label.formatMethod&&(y=b.label.formatMethod(y));const{width:V,height:G}=t.measureText(y,{fontSize:(A=(S=(x=b.label)===null||x===void 0?void 0:x.style)===null||S===void 0?void 0:S.fontSize)!==null&&A!==void 0?A:An,fontWeight:(M=(T=(R=b.label)===null||R===void 0?void 0:R.style)===null||T===void 0?void 0:T.fontWeight)!==null&&M!==void 0?M:"normal",fontFamily:(B=(k=(P=b.label)===null||P===void 0?void 0:P.style)===null||k===void 0?void 0:k.fontFamily)!==null&&B!==void 0?B:Jo}),U=((E=(H=b.label)===null||H===void 0?void 0:H.style)===null||E===void 0?void 0:E.maxLineWidth)||1/0,Z=((z=(L=(F=b.label)===null||F===void 0?void 0:F.style)===null||L===void 0?void 0:L.angle)!==null&&z!==void 0?z:0)+(((N=(D=b.label)===null||D===void 0?void 0:D.style)===null||N===void 0?void 0:N.direction)==="vertical"?90:0);C=Math.max(C,Zr(Math.min(V,U),G,Z).height)});else{let y;if(it(n.__ticksForVTable))y=n.__ticksForVTable;else{const x=b.range,S=Math.abs(x.min)>1?Math.round(x.min):x.min,A=Math.abs(x.max)>1?Math.round(x.max):x.max;y=[Id(S),Id(A)]}y.forEach(x=>{var S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V;b.label.formatMethod&&(x=b.label.formatMethod(x));const{width:G,height:U}=t.measureText(x,{fontSize:(R=(A=(S=b.label)===null||S===void 0?void 0:S.style)===null||A===void 0?void 0:A.fontSize)!==null&&R!==void 0?R:An,fontWeight:(P=(M=(T=b.label)===null||T===void 0?void 0:T.style)===null||M===void 0?void 0:M.fontWeight)!==null&&P!==void 0?P:"normal",fontFamily:(H=(B=(k=b.label)===null||k===void 0?void 0:k.style)===null||B===void 0?void 0:B.fontFamily)!==null&&H!==void 0?H:Jo}),Z=((F=(E=b.label)===null||E===void 0?void 0:E.style)===null||F===void 0?void 0:F.maxLineWidth)||1/0,q=((D=(z=(L=b.label)===null||L===void 0?void 0:L.style)===null||z===void 0?void 0:z.angle)!==null&&D!==void 0?D:0)+(((V=(N=b.label)===null||N===void 0?void 0:N.style)===null||V===void 0?void 0:V.direction)==="vertical"?90:0);C=Math.max(C,Zr(Math.min(G,Z),U,q).height)})}C+=(i=b.label.space)!==null&&i!==void 0?i:4}let _=0;if(b.title.visible&&b.title.text){const{width:y,height:x}=t.measureText(b.title.text,{fontSize:(s=(r=(o=b.title)===null||o===void 0?void 0:o.style)===null||r===void 0?void 0:r.fontSize)!==null&&s!==void 0?s:An,fontWeight:(h=(a=(l=b.title)===null||l===void 0?void 0:l.style)===null||a===void 0?void 0:a.fontWeight)!==null&&h!==void 0?h:"normal",fontFamily:(c=(u=(d=b.title)===null||d===void 0?void 0:d.style)===null||u===void 0?void 0:u.fontFamily)!==null&&c!==void 0?c:Jo}),S=((f=(g=b.label)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.maxLineWidth)||1/0,A=Zr(Math.min(y,S),x,(v=(p=b.title)===null||p===void 0?void 0:p.style)===null||v===void 0?void 0:v.angle);_=n.orient!=="bottom"&&n.orient!=="top"||!b.title.autoRotate?A.height:A.width,_+=(m=b.title.space)!==null&&m!==void 0?m:4}return w+C+_+1}function Id(n){return typeof n!="number"&&(n=Number(n)),Number(n.toPrecision(1)).toString()}function Zr(n,t,e=0){const i=e*Math.PI/180,o=-n/2,r=-t/2,s=n/2,l=-t/2,a=n/2,h=t/2,d=-n/2,u=t/2,c={x:o*Math.cos(i)-r*Math.sin(i),y:o*Math.sin(i)+r*Math.cos(i)},g={x:s*Math.cos(i)-l*Math.sin(i),y:s*Math.sin(i)+l*Math.cos(i)},f={x:a*Math.cos(i)-h*Math.sin(i),y:a*Math.sin(i)+h*Math.cos(i)},p={x:d*Math.cos(i)-u*Math.sin(i),y:d*Math.sin(i)+u*Math.cos(i)},v=Math.min(c.x,g.x,f.x,p.x),m=Math.max(c.x,g.x,f.x,p.x),b=Math.min(c.y,g.y,f.y,p.y);return{width:m-v,height:Math.max(c.y,g.y,f.y,p.y)-b}}const x3='<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>';class A3{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:x3,width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,t===!0?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)es(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new Db(t);e.name="emptyTip",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._emptyTipComponent=e}return this._emptyTipComponent}resize(){var t;if(!this._emptyTipComponent)return;const e=this.table.transpose||this.table.options.indicatorsAsCol===!1?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,r=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:r,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:(t=this._emptyTipOption.textStyle)===null||t===void 0?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)})}release(){this._emptyTipComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent),this._emptyTipComponent=null,this.isReleased=!0}resetVisible(){(this.table.recordsCount&&this.table.recordsCount!==0||this.table.internalProps.layoutMap.rowCount!==this.table.internalProps.layoutMap.columnHeaderLevelCount)&&this.table.internalProps.layoutMap.colCount!==this.table.internalProps.layoutMap.rowHeaderLevelCount?this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent):this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)||this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent)}_getEmptyTipAttrs(){var t;const e=this.table.transpose||this.table.options.indicatorsAsCol===!1?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,r=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:r,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:(t=this._emptyTipOption.textStyle)===null||t===void 0?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var R3=globalThis&&globalThis.__rest||function(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(i=Object.getOwnPropertySymbols(n);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(n,i[o])&&(e[i[o]]=n[i[o]])}return e};const T3={orient:"bottom",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fill:"#000000",fontWeight:"normal"},space:12},item:{visible:!0,spaceCol:10,spaceRow:10,padding:2,background:{state:{selectedHover:{fill:"gray",fillOpacity:.7},unSelectedHover:{fill:"gray",fillOpacity:.2}}},shape:{space:4,state:{unSelected:{fillOpacity:.5}}},label:{space:4,style:{fill:"#89909D",fontSize:14},state:{unSelected:{fillOpacity:.5}}}},allowAllCanceled:!0,visible:!0};function M3(n,t){const e=dt({},T3,n),{title:i={},item:o={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:u,data:c,filter:g,regionId:f,regionIndex:p,seriesIndex:v,seriesId:m,padding:b}=e,w=R3(e,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return i.visible&&(w.title=Xy(i)),Et(o.focusIconStyle)||Ae(o.focusIconStyle),cn(o.shape),cn(o.label),cn(o.value),cn(o.background),_g(o.maxWidth)&&(o.maxWidth=Number(o.maxWidth.substring(0,o.maxWidth.length-1))*t.width/100),_g(o.width)&&(o.width=Number(o.width.substring(0,o.width.length-1))*t.width/100),_g(o.height)&&(o.height=Number(o.height.substring(0,o.height.length-1))*t.width/100),w.item=o,Et(r.textStyle)||Ae(r.textStyle),cn(r.handler),w.pager=r,s.visible&&!Et(s.style)&&(dt(w,s.style),I(s.padding)&&(w.padding=s.padding)),w}class B3{constructor(t,e){var i,o,r,s;this.table=e,this.option=Be(t),this.orient=(i=t.orient)!==null&&i!==void 0?i:"left",this.visible=(o=t.visible)===null||o===void 0||o,this.position=(r=t.position)!==null&&r!==void 0?r:"middle",this.selectedData=(s=t.defaultSelected)!==null&&s!==void 0?s:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new _h(dt({},t,{defaultSelected:this.selectedData,disableTriggerEvent:this.table.options.disableInteraction}));e.name="legend",this.legendComponent=e,this.visible===!1&&(e.setAttributes({maxWidth:0,width:0,maxHeight:0,height:0,clip:!0}),e.hideAll()),this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({maxWidth:this.table.tableNoFrameWidth,maxHeight:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,r=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||r<=0)return;const s=this.table.tableNoFrameWidth,l=this.table.tableNoFrameHeight,a=kt((i=(e=t.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&i!==void 0?i:10);let h=0,d=0;this.orient==="left"?(h=a[3],d=0,o+=a[1]+a[3]):this.orient==="top"?(h=0,d=a[0],r+=a[0]+a[2]):this.orient==="right"?(h=s-o-a[1],d=0,o+=a[1]+a[3]):this.orient==="bottom"&&(h=0,d=l-r-a[2],r+=a[0]+a[2]);const u=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",c=this.position;let g=0,f=0;u==="horizontal"?g=c==="middle"?(s-o)/2:c==="end"?s-o-a[1]:a[3]:f=c==="middle"?(l-r)/2:c==="end"?l-r-a[2]:a[0],this.legendComponent.setAttributes({dx:g,dy:f,x:h,y:d}),this.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):this.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r),this.table.tableY+=Math.ceil(r)):this.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):this.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r))}getLegendAttributes(t){var e,i;const o=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",r=M3(this.option,t),s=kt((i=(e=r.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&i!==void 0?i:10);return Object.assign({layout:o,items:this.getLegendItems(),maxWidth:t.width-s[1]-s[3],maxHeight:t.height-s[0]-s[2]},r)}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(Vi.legendItemClick,t=>{const e=De(t,"detail.currentSelected");this.table.fireListeners(J.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})}),this.legendComponent.addEventListener(Vi.legendItemHover,t=>{const e=De(t,"detail");this.table.fireListeners(J.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})}),this.legendComponent.addEventListener(Vi.legendItemUnHover,t=>{const e=De(t,"detail");this.table.fireListeners(J.LEGEND_ITEM_UNHOVER,{model:this,value:e,event:t})}),this.legendComponent.addEventListener("legendItemAttributeUpdate",t=>{this.table.scenegraph.updateNextFrame()}))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}var P3=globalThis&&globalThis.__rest||function(n,t){var e={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(e[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(i=Object.getOwnPropertySymbols(n);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(n,i[o])&&(e[i[o]]=n[i[o]])}return e};const zd={orient:"right",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"titleFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},endText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},handlerText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}}},H3={horizontal:Object.assign(Object.assign({},zd),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},zd),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},E3={horizontal:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:200,height:4,style:{fill:"rgba(0,0,0,0.04)"}}},zd),vertical:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:4,height:200,style:{fill:"rgba(0,0,0,0.04)"}}},zd)};function L3(n,t){const e=dt({},(n.type==="color"?H3:E3)[n.orient==="bottom"||n.orient==="top"?"horizontal":"vertical"],n),{title:i={},handler:o={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:u={},type:c,id:g,visible:f,orient:p,position:v,data:m,defaultSelected:b,field:w,filter:C,regionId:_,regionIndex:y,seriesIndex:x,seriesId:S,padding:A}=e,R=P3(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return i.visible&&(R.title=Xy(i)),R.showHandler=o.visible!==!1,Et(o.style)||(R.handlerStyle=Ae(o.style)),I(r.width)&&(R.railWidth=r.width),I(r.height)&&(R.railHeight=r.height),Et(r.style)||(R.railStyle=Ae(r.style)),Et(s.style)||(R.trackStyle=Ae(s.style)),R.startText=cn(l),R.endText=cn(a),R.handlerText=cn(h),Et(d)||(R.sizeBackground=Ae(d)),u.visible&&!Et(u.style)&&(dt(R,u.style),I(u.padding)&&(R.padding=u.padding)),R}class F3{constructor(t,e){var i,o,r,s;this.table=e,this.option=Be(t),this.orient=(i=t.orient)!==null&&i!==void 0?i:"left",this.visible=(o=t.visible)===null||o===void 0||o,this.position=(r=t.position)!==null&&r!==void 0?r:"middle",this.selectedData=(s=t.defaultSelected)!==null&&s!==void 0?s:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e=this.option.type==="color"?new wh(dt({},t,{slidable:!0})):new Sh(dt({},t,{slidable:!0})),e.name="legend",this.legendComponent=e,this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,r=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||r<=0)return;const s=this.table.tableNoFrameWidth,l=this.table.tableNoFrameHeight,a=kt((i=(e=t.padding)!==null&&e!==void 0?e:this.option.padding)!==null&&i!==void 0?i:10);let h=0,d=0;this.orient==="left"?(h=a[3],d=0,o+=a[1]+a[3]):this.orient==="top"?(h=0,d=a[0],r+=a[0]+a[2]):this.orient==="right"?(h=s-o-a[1],d=0,o+=a[1]+a[3]):this.orient==="bottom"&&(h=0,d=l-r-a[2],r+=a[0]+a[2]);const u=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",c=this.position;let g=0,f=0;u==="horizontal"?g=c==="middle"?(s-o)/2:c==="end"?s-o-a[1]:a[3]:f=c==="middle"?(l-r)/2:c==="end"?l-r-a[2]:a[0],this.legendComponent.setAttributes({dx:g,dy:f,x:h,y:d}),this.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):this.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r),this.table.tableY+=Math.ceil(r)):this.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):this.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(r))}getLegendAttributes(t){const e=this.orient==="bottom"||this.orient==="top"?"horizontal":"vertical",i=e==="horizontal"?"bottom":this.orient;return Object.assign(Object.assign({},L3(this.option)),{layout:e,align:i,min:this.option.min,max:this.option.max,value:this.option.value,[this.option.type==="color"?"colors":"sizeRange"]:this.option.type==="color"?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",t=>{const e=De(t,"detail.value");this.table.fireListeners(J.LEGEND_CHANGE,{model:this,value:e,event:t}),this.table.scenegraph.updateNextFrame()})}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}function k3(n,t){return n.type==="color"||n.type==="size"?new F3(n,t):new B3(n,t)}class Qy{constructor(t){this._table=t}release(){this.unbindMenuElement(),this._menuElement&&this._menuElement.release(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,i){return this._getMenuElement().bindToCell(this._table,t,e,i)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const df="vtable__menu-element",Jr=`${df}--hidden`,uf=`${df}--shown`;function I3(){return xn("div",[df,Jr])}class z3{constructor(t){var e,i,o;this._handler=new Lh,this._rootElement=I3(),this._rootElement.addEventListener("wheel",r=>{r.stopPropagation()}),(e=this._rootElement)===null||e===void 0||e.addEventListener("mousedown",r=>{r.stopPropagation(),r.preventDefault()}),(i=this._rootElement)===null||i===void 0||i.addEventListener("click",r=>{if(r.stopPropagation(),r.preventDefault(),this._rootElement.classList.contains(Jr))return;const{col:s,row:l,dropDownIndex:a,menuKey:h,text:d,hasChildren:u}=r.target;if(typeof a!="number"||u)return void r.stopPropagation();const c=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(s,l):t.getHeaderField(s,l),g=t._dropDownMenuIsHighlight(s,l,a);t.fireListeners(J.DROPDOWN_MENU_CLICK,{col:s,row:l,field:c,menuKey:h,text:d,highlight:g,cellLocation:t.getCellLocation(s,l),event:r}),t.fireListeners(J.DROPDOWN_MENU_CLEAR,null),t.fireListeners(J.HIDE_MENU,null),r.stopPropagation()}),(o=this._rootElement)===null||o===void 0||o.addEventListener("mousemove",r=>{this._rootElement.classList.contains(Jr)||r.stopPropagation()})}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;t!=null&&t.parentElement&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){const r=this._rootElement;if(this._menuInstanceInfo=o,r==null||r.classList.remove(uf),r==null||r.classList.add(Jr),this._canBindToCell(t,e,i)){if(r.innerHTML="",r.appendChild(o.content),this._bindCell(t,e,i,o.position,o.referencePosition))return r==null||r.classList.add(uf),r==null||r.classList.remove(Jr),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,t!=null&&t.parentElement&&(t.classList.remove(uf),t.classList.add(Jr))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),r=t.getElement(),{top:s,bottom:l,left:a,right:h}=o;if(t.isFrozenCell(e,i))return!0;if(l<t.getFrozenRowsHeight()||h<t.getFrozenColsWidth()||a>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||s>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(d<s)&&!(u<a)}_bindCell(t,e,i,o,r){const s=this._rootElement,l=t.getElement(),{width:a,height:h}=t.internalProps.element.getBoundingClientRect();if(s){s.parentElement!==l&&l.appendChild(s),s.style.left="0px";const d=.8*a;s.style.maxWidth=`${d}px`;const u=s.clientWidth,c=s.clientHeight;let g,f;return o&&(g=o.x,f=o.y),r&&(g=r.rect.right-u,f=r.rect.bottom),f+c>h&&(f=h-c,g+=u-2),f<0&&(f/=2),s.style.top=`${f}px`,g<0?g=0:g+u>a&&(g=a-u),s.style.left=`${g}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:r,width:s,height:l}=i.getBoundingClientRect();return t>o-5&&t<o+s+5&&e>r-5&&e<r+l+5}}class t1 extends Qy{createMenuElementInternal(){return new CI(this._table)}}class D3 extends Qy{createMenuElementInternal(){return new z3(this._table)}}const O3={"dropdown-menu":function(n){return new t1(n)},"context-menu":function(n){return new t1(n)},container:n=>new D3(n)};function W3(n,t,e,i,o){var r;const{lineHeight:s,textBaseline:l,textStick:a}=n._getCellStyle(t,e);let h=n.getCellRangeRelativeRect(n.getCellRange(t,e));a&&(h=n.getVisibleCellRangeRelativeRect({col:t,row:e}));let{left:d,right:u,bottom:c,top:g,width:f,height:p}=h;if(n.isHeader(t,e)&&({left:d,right:u,bottom:c,top:g,width:f,height:p}=n.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),o==null?void 0:o.content)return{type:i,position:o.position,referencePosition:(r=o.referencePosition)!==null&&r!==void 0?r:{rect:{left:d,right:u,top:g,bottom:c,width:f,height:p}},content:o.content};if(i==="dropdown-menu"){const{dropDownMenu:v=n.globalDropDownMenu,pivotInfo:m}=n._getHeaderLayoutMap(t,e);return{type:i,referencePosition:{rect:{left:d,right:u,top:g,bottom:c,width:f,height:p}},content:v,pivotInfo:m}}return null}class N3{constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}release(){const t=this._menuInstances;for(const e in t)t[e].release();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,i,o){var r;const s=this._attachInfo,l=this._getMenuInstanceInfo(t,e,i,o);if(!s||l&&s.instance===l.instance||((r=s.instance)===null||r===void 0||r.unbindMenuElement(),this._attachInfo=null),!l)return;const{instance:a,info:h}=l;if(a&&a.bindMenuElement(t,e,h)){const d=this._table.getCellRange(t,e);this._attachInfo={range:d,instance:a}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e==null||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const i=this._attachInfo;return!!i&&Ti(i.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const i=this._attachInfo,{instance:o}=i;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(J.DROPDOWN_ICON_CLICK,e=>{this._attachInfo&&this._isBindToCell(e.col,e.row)?this._unbindFromCell():this._bindToCell(e.col,e.row,"dropdown-menu")}),t.on(J.DROPDOWN_MENU_CLEAR,e=>{this._unbindFromCell()}),t.on(J.CONTEXTMENU_CELL,e=>{var i,o,r,s;if(((i=t.internalProps.menu)===null||i===void 0?void 0:i.renderMode)==="html"){const l=t._getMouseAbstractPoint(e.event,!1);let a=null;l.inTable&&typeof((o=t.internalProps.menu)===null||o===void 0?void 0:o.contextMenuItems)=="function"?a=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col,t):l.inTable&&Array.isArray((r=t.internalProps.menu)===null||r===void 0?void 0:r.contextMenuItems)&&(a=(s=t.internalProps.menu)===null||s===void 0?void 0:s.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:a,position:{x:l.x,y:l.y}})}})}_getMenuInstanceInfo(t,e,i,o){const r=this._table,s=this._menuInstances,l=W3(r,t,e,i,o);return l?{instance:s&&s[i]||s&&(s[i]=O3[i](r)),type:i,info:l}:null}}class V3{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=dt({orient:"top"},t),t.visible!==!1&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)es(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new zb(t);e.name="title",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._titleComponent=e}return this._adjustTableSize(this._titleComponent.attribute),this._titleComponent}resize(){var t,e,i,o,r;if(!this._titleComponent)return;const s=kt((t=this._titleOption.padding)!==null&&t!==void 0?t:10),l=(e=this._titleOption.width)!==null&&e!==void 0?e:(this.table.widthMode==="adaptive"?this.table.tableNoFrameWidth:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width))-s[1]-s[3],a=(i=this._titleOption.height)!==null&&i!==void 0?i:(this.table.heightMode==="adaptive"?this.table.tableNoFrameHeight:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height))-s[0]-s[2];this._titleComponent.setAttributes({x:((o=this._titleOption.x)!==null&&o!==void 0?o:this._titleOption.orient==="right")?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:((r=this._titleOption.y)!==null&&r!==void 0?r:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:this._titleOption.orient==="top"||this._titleOption.orient==="bottom"?l:this._titleOption.width,height:this._titleOption.orient==="left"||this._titleOption.orient==="right"?a:this._titleOption.height,textStyle:Object.assign({width:l},this._titleOption.textStyle),subtextStyle:Object.assign({width:l},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,i,o,r;const s=isFinite((e=this._titleComponent)===null||e===void 0?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,l=isFinite((i=this._titleComponent)===null||i===void 0?void 0:i.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;this._titleOption.orient==="left"?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(s),this.table.tableX+=Math.ceil(s)):this._titleOption.orient==="top"?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(l),this.table.tableY+=Math.ceil(l)):this._titleOption.orient==="right"?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(s):this._titleOption.orient==="bottom"&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(l)),this._cacheAttrs=t,this._titleOption.orient!=="right"&&this._titleOption.orient!=="bottom"||this._titleComponent.setAttributes({x:((o=this._titleOption.x)!==null&&o!==void 0?o:this._titleOption.orient==="right")?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:((r=this._titleOption.y)!==null&&r!==void 0?r:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY})}release(){this._titleComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent),this._titleComponent=null,this.isReleased=!0}_getTitleAttrs(){var t,e,i,o,r,s,l,a,h,d,u;const c=this._titleOption.text||this._titleOption.subtext?10:0,g=kt((t=this._titleOption.padding)!==null&&t!==void 0?t:c),f=(e=this._titleOption.width)!==null&&e!==void 0?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-g[1]-g[3],p=(i=this._titleOption.height)!==null&&i!==void 0?i:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-g[0]-g[2];return{text:(o=this._titleOption.text)!==null&&o!==void 0?o:"",subtext:(r=this._titleOption.subtext)!==null&&r!==void 0?r:"",x:((s=this._titleOption.x)!==null&&s!==void 0?s:this._titleOption.orient==="right")?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:((l=this._titleOption.y)!==null&&l!==void 0?l:this._titleOption.orient==="bottom")?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:this._titleOption.orient==="top"||this._titleOption.orient==="bottom"?f:this._titleOption.width,height:this._titleOption.orient==="left"||this._titleOption.orient==="right"?p:this._titleOption.height,minWidth:this._titleOption.minWidth,maxWidth:this._titleOption.maxWidth,minHeight:this._titleOption.minHeight,maxHeight:this._titleOption.maxHeight,padding:this._titleOption.padding,align:(a=this._titleOption.align)!==null&&a!==void 0?a:"left",verticalAlign:(h=this._titleOption.verticalAlign)!==null&&h!==void 0?h:"top",textStyle:Object.assign({width:f},this._titleOption.textStyle),subtextStyle:Object.assign({width:f},this._titleOption.subtextStyle),dx:(d=this._titleOption.dx)!==null&&d!==void 0?d:0,dy:(u=this._titleOption.dy)!==null&&u!==void 0?u:0}}getComponentGraphic(){return this._titleComponent}}class j3{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&((e=(t=this._tooltipElement).release)===null||e===void 0||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,i,o){return this._getTooltipElement().bindToCell(this._table,t,e,i,o)}moveTooltipElement(t,e,i,o){this._getTooltipElement().move(this._table,t,e,i,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,i,o,r){this._getTooltipElement()._locate(this._table,t,e,i,o,r)}}function G3(){if(Wt.mode==="node")return;const n=document.createElement("style");n.id="vtable-tooltip-styleSheet",n.textContent=`
|
|
222
|
+
@keyframes vtable__bubble-tooltip-element--shown-animation {
|
|
223
|
+
0% {
|
|
224
|
+
opacity: 0;
|
|
225
|
+
}
|
|
226
|
+
100% {
|
|
227
|
+
opacity: 1;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
.vtable__bubble-tooltip-element {
|
|
231
|
+
position: absolute;
|
|
232
|
+
|
|
233
|
+
// pointer-events: none;
|
|
234
|
+
//user-select: none;
|
|
235
|
+
max-width: 300px;
|
|
236
|
+
z-index: 99999;
|
|
237
|
+
|
|
238
|
+
background: #FFFFFF;
|
|
239
|
+
border: 1px solid #E6E8ED;
|
|
240
|
+
box-sizing: border-box;
|
|
241
|
+
border-radius: 4px;
|
|
242
|
+
box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);
|
|
243
|
+
color: #141414;
|
|
244
|
+
font-size: 13px;
|
|
245
|
+
}
|
|
246
|
+
.vtable__bubble-tooltip-element--hidden {
|
|
247
|
+
opacity: 0;
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
user-select: none;
|
|
250
|
+
/* transform: translate(-50%, -50%); */
|
|
251
|
+
transition: opacity 75ms linear;
|
|
252
|
+
}
|
|
253
|
+
.vtable__bubble-tooltip-element--shown {
|
|
254
|
+
opacity: 1;
|
|
255
|
+
/* transform: translate(-50%, -50%); */
|
|
256
|
+
animation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;
|
|
257
|
+
}
|
|
258
|
+
.vtable__bubble-tooltip-element__content {
|
|
259
|
+
/* font-size: .75rem; */
|
|
260
|
+
padding: 6px 8px;
|
|
261
|
+
min-height: 1em;
|
|
262
|
+
line-height: 1.5;
|
|
263
|
+
width: 100%;
|
|
264
|
+
display: block;
|
|
265
|
+
white-space: pre-wrap;
|
|
266
|
+
margin: 0;
|
|
267
|
+
box-sizing: border-box;
|
|
268
|
+
overflow: auto;
|
|
269
|
+
word-wrap: break-word;
|
|
270
|
+
position: relative;
|
|
271
|
+
background-color: #FFF;
|
|
272
|
+
z-index: 2;
|
|
273
|
+
border-radius: 4px;
|
|
274
|
+
}
|
|
275
|
+
/* WebKit Microsoft Edge(新版): */
|
|
276
|
+
.vtable__bubble-tooltip-element__content::-webkit-scrollbar {
|
|
277
|
+
width: 0;
|
|
278
|
+
height: 0;
|
|
279
|
+
background-color: transparent;
|
|
280
|
+
}
|
|
281
|
+
/* Opera Firefox */
|
|
282
|
+
.vtable__bubble-tooltip-element__content > scrollbar-track {
|
|
283
|
+
width: 0;
|
|
284
|
+
height: 0;
|
|
285
|
+
background-color: transparent;
|
|
286
|
+
}
|
|
287
|
+
/* Internet Explorer 11 和 Microsoft Edge(旧版) */
|
|
288
|
+
.vtable__bubble-tooltip-element__content > scrollbar {
|
|
289
|
+
width: 0;
|
|
290
|
+
height: 0;
|
|
291
|
+
background-color: transparent;
|
|
292
|
+
}
|
|
293
|
+
.vtable__bubble-tooltip-element__triangle {
|
|
294
|
+
/* font-size: .75rem; */
|
|
295
|
+
position: absolute;
|
|
296
|
+
width: 10px;
|
|
297
|
+
height: 10px;
|
|
298
|
+
display: block;
|
|
299
|
+
transform: rotate(45deg);
|
|
300
|
+
transform-origin: 50% 50% 0;
|
|
301
|
+
z-index: 1;
|
|
302
|
+
background-color: #FFF;
|
|
303
|
+
border: 1px solid #E6E8ED;
|
|
304
|
+
}
|
|
305
|
+
`,document.head.appendChild(n)}G3();const xl="vtable__bubble-tooltip-element",e1=`${xl}__content`,i1=`${xl}__triangle`,Qr=`${xl}--hidden`,Al=`${xl}--shown`;class U3{constructor(){this._handler=new Lh;const t=this._rootElement=xn("div",[xl,Qr]),e=xn("div",[e1]),i=xn("span",[i1]);t.appendChild(i),t.appendChild(e),this._messageElement=t.querySelector(`.${e1}`)||void 0,this._triangleElement=t.querySelector(`.${i1}`)||void 0,t.addEventListener("mousemove",()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)}),t.addEventListener("mouseleave",()=>{this._disappearDelay=void 0,this.unbindFromCell()}),e.addEventListener("wheel",o=>{o.stopPropagation()}),e.addEventListener("copy",o=>{c2(e)&&o.stopPropagation()})}bindToCell(t,e,i,o,r){var s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S;this._disappearDelay=o==null?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const A=this._rootElement,R=this._messageElement,T=this._triangleElement;if(A==null||A.classList.remove(Al),A==null||A.classList.add(Qr),this._canBindToCell(t,e,i)){if(R.setAttribute("style",""),T.setAttribute("style",""),o!=null&&o.className&&A.classList.add(o.className),!((s=o==null?void 0:o.style)===null||s===void 0)&&s.bgColor&&(R.style.backgroundColor=(l=o==null?void 0:o.style)===null||l===void 0?void 0:l.bgColor),!((a=o==null?void 0:o.style)===null||a===void 0)&&a.bgColor&&(T.style.backgroundColor=(h=o==null?void 0:o.style)===null||h===void 0?void 0:h.bgColor),T.style.display=((d=o==null?void 0:o.style)===null||d===void 0?void 0:d.arrowMark)===!0?"block":"none",!((u=o==null?void 0:o.style)===null||u===void 0)&&u.fontSize&&(R.style.fontSize=((g=(c=o==null?void 0:o.style)===null||c===void 0?void 0:c.fontSize)!==null&&g!==void 0?g:12)+"px"),!((f=o==null?void 0:o.style)===null||f===void 0)&&f.fontFamily&&(R.style.fontFamily=(p=o==null?void 0:o.style)===null||p===void 0?void 0:p.fontFamily),!((v=o==null?void 0:o.style)===null||v===void 0)&&v.color&&(R.style.color=(m=o==null?void 0:o.style)===null||m===void 0?void 0:m.color),!((b=o==null?void 0:o.style)===null||b===void 0)&&b.padding&&(R.style.padding=`${(w=o==null?void 0:o.style)===null||w===void 0?void 0:w.padding.join("px ")}px`),!((C=o==null?void 0:o.style)===null||C===void 0)&&C.maxHeight&&(R.style.maxHeight=`${(_=o==null?void 0:o.style)===null||_===void 0?void 0:_.maxHeight}px`),!((y=o==null?void 0:o.style)===null||y===void 0)&&y.maxWidth&&(R.style.maxWidth=`${(x=o==null?void 0:o.style)===null||x===void 0?void 0:x.maxWidth}px`),R&&(R.textContent=o==null?void 0:o.content),this._bindToCell(t,e,i,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r,(S=o==null?void 0:o.style)===null||S===void 0?void 0:S.arrowMark))return A==null||A.classList.add(Al),A==null||A.classList.remove(Qr),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const i=this._rootElement;i!=null&&i.parentElement&&i.parentElement.removeChild(i),(e=(t=this._handler)===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,i,o,r){const s=this._rootElement;this._canBindToCell(t,e,i)?(this._bindToCell(t,e,i,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r),s==null||s.classList.add(Al),s==null||s.classList.remove(Qr)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout(()=>{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Al),e.classList.add(Qr))},(t=this._disappearDelay)!==null&&t!==void 0?t:0);else{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Al),e.classList.add(Qr))}}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),r=t.getElement(),{bottom:s,left:l,right:a,top:h}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||h>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:d,offsetWidth:u}=r;return!(h>d)&&!(l>u)}_bindToCell(t,e,i,o,r,s,l){const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:i}),d=t.internalProps.tooltip.parentElement,u=t.internalProps.element.offsetWidth,{width:c}=h;if(a){let g,f;a.parentElement!==d&&d.appendChild(a),a.style.left="0px";const p=Math.min(.8*u,4*c);a.style.maxWidth=`${p}px`;const v=a.clientWidth,m=a.clientHeight;if(!o&&!r)return!1;{const R=this.getComputedPosition(t,e,i,o,r,s,l);f=R.x,g=R.y}a.style.left=`${f}px`,a.style.top=`${g}px`,dg()&&(a.style.fontSize="11px");const{x1:b,x2:w,y1:C,y2:_}=t.stateManager.menu.bounds,y=f,x=y+v,S=g,A=y+m;return!(t.stateManager.menu.isShow&&b<x&&w>y&&_>S&&C<A)}return!1}getComputedPosition(t,e,i,o,r,s,l){var a;const h=this._rootElement,d=t.getCellRangeRelativeRect({col:e,row:i}),{x:u,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:g,height:f,x:p,y:v}=t.internalProps.element.getBoundingClientRect(),{width:m}=d;let b,w;const C=Math.min(.8*g,4*m);h.style.maxWidth=`${C}px`;const _=h.clientWidth,y=h.clientHeight,x=l?6:0;if(o)w=o.x,b=o.y+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(r){let S=(a=r.placement)!==null&&a!==void 0?a:Ri.bottom;const A=r.rect.left+r.rect.width/2,R=r.rect.top+r.rect.height/2,T=r.rect.top,M=r.rect.bottom,P=r.rect.left,k=r.rect.right;let B=0;const H=()=>{B++,B>=4||(this.removeStyleFromTriangle(),S===Ri.top?(w=A-_/2,b=T-y-x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",s&&b<0&&(S=Ri.right,H())):S===Ri.bottom?(w=A-_/2,b=M+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",s&&b+y>f&&(S=Ri.left,H())):S===Ri.left?(b=R-y/2,w=P-_-x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",s&&w<0&&(S=Ri.top,H())):S===Ri.right&&(b=R-y/2,w=k+x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",s&&w+_>g&&(S=Ri.bottom,H())))};H()}return s&&(w<0?w=0:w+h.offsetWidth>g&&(w=g-h.offsetWidth)),{x:w+p-u,y:b+v-c}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,i,o,r,s){const l=this.getComputedPosition(t,e,i,o,r,s),a=l.x,h=l.y;this._rootElement.style.left=`${a}px`,this._rootElement.style.top=`${h}px`}}class K3 extends j3{createTooltipElementInternal(){return new U3}}const $3={"bubble-tooltip":function(n){return new K3(n)}};class Y3{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const i=this._tooltipInstances;for(const o in i)(e=(t=i[o])===null||t===void 0?void 0:t.release)===null||e===void 0||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,i){var o;const r=this._attachInfo,s=this._getTooltipInstanceInfo(t,e);if(!r||s&&r.instance===s||((o=r.instance)===null||o===void 0||o.unbindTooltipElement(),this._attachInfo=null),!!s&&s&&s.bindTooltipElement(t,e,i,this.confine)){const l=this._table.getCellRange(t,e);this._attachInfo={range:l,instance:s,tooltipOptions:i}}}_move(t,e,i){const o=this._attachInfo;if(!o||!Ti(o.range,t,e))return;const{instance:r}=o;r==null||r.moveTooltipElement(t,e,i,this.confine)}moveToPosition(t,e,i,o){const r=this._attachInfo;if(!r||!Ti(r.range,t,e))return;const{instance:s}=r;this._attachInfo.tooltipOptions.position=i,this._attachInfo.tooltipOptions.referencePosition=o,s==null||s.locateTooltipElement(t,e,i,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e==null||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const i=this._attachInfo;return!!i&&Ti(i.range,t,e)}_bindTableEvent(t){t.on(J.MOUSEENTER_CELL,e=>{if(dg())return;const{x1:i,x2:o,y1:r,y2:s}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&typeof e.x=="number"&&typeof e.y=="number"&&e.x>i&&e.x<o&&e.y>r&&e.y<s)return;const{col:l,row:a}=e;this.showTooltip(l,a)}),t.on(J.MOUSEMOVE_CELL,e=>{var i,o;if(!dg()){if(!((o=(i=this._attachInfo)===null||i===void 0?void 0:i.tooltipOptions)===null||o===void 0)&&o.referencePosition){const r=this._attachInfo.tooltipOptions.referencePosition,{event:s}=e,{left:l,right:a,top:h,bottom:d}=r.rect,u=t._getMouseAbstractPoint(s,!1);u.inTable&&u.x>=l-5&&u.x<=a+5&&u.y>=h-5&&u.y<=d+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}}),t.on(J.MOUSELEAVE_CELL,e=>{this._unbindFromCell()}),t.on(J.SELECTED_CELL,e=>{this._isBindCell(e.col,e.row)&&this._unbindFromCell()}),t.on(J.MOUSELEAVE_TABLE,e=>{this._unbindFromCell()}),t.on(J.SCROLL,e=>{this._unbindFromCell()})}showTooltip(t,e){var i,o,r;let s;const l=this._table,a=l.getHeaderDescription(t,e);if(a){const h=l.getCellRangeRelativeRect({col:t,row:e});s={content:a,referencePosition:{placement:Ri.bottom,rect:h},disappearDelay:(i=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&i!==void 0?i:0,style:l.theme.tooltipStyle}}else if(jt((o=l.internalProps.tooltip)===null||o===void 0?void 0:o.isShowOverflowTextTooltip)?l.internalProps.tooltip.isShowOverflowTextTooltip(t,e,l):l.internalProps.tooltip.isShowOverflowTextTooltip){const h=l.getCellOverflowText(t,e),d=l.getCellRangeRelativeRect({col:t,row:e});h&&(s={content:a?`${a}
|
|
306
|
+
${h}`:h,referencePosition:{placement:Ri.bottom,rect:d},disappearDelay:(r=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&r!==void 0?r:0,style:l.theme.tooltipStyle})}s?this._bindToCell(t,e,s):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const i=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=$3["bubble-tooltip"](i))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const X3=()=>{St.registerComponent("axis",C3),St.registerFunction("computeAxisComponentWidth",w3),St.registerFunction("computeAxisComponentHeight",S3),St.registerFunction("getAxisConfigInPivotChart",HI)},q3=()=>{St.registerComponent("emptyTip",A3)},Z3=()=>{St.registerFunction("createLegend",k3)},J3=()=>{St.registerComponent("menuHandler",N3)},Q3=()=>{St.registerComponent("title",V3)},tz=()=>{St.registerComponent("tooltipHandler",Y3)},ez={};function iz(){return qs(ez,jI)}function nz(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b){var w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q;const j=iz()[d],rt=f._getCellStyle(o,r),ht=Kh("padding",rt,o,r,f);if(I(ht)&&(a=ht),!n){const gt=$o(o,r,p,f);m&&(n=f.scenegraph.highPerformanceGetCell(o,r,!0))&&n.role==="cell"&&n.setAttributes({x:e,y:i,width:s,height:l,lineWidth:(C=(w=p==null?void 0:p.group)===null||w===void 0?void 0:w.lineWidth)!==null&&C!==void 0?C:void 0,fill:(y=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.fill)!==null&&y!==void 0?y:void 0,stroke:(S=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.stroke)!==null&&S!==void 0?S:void 0,strokeArrayWidth:gt,strokeArrayColor:(R=(A=p==null?void 0:p.group)===null||A===void 0?void 0:A.strokeArrayColor)!==null&&R!==void 0?R:void 0,cursor:(M=(T=p==null?void 0:p.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(k=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&k!==void 0?k:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),n&&n.role==="cell"||((n=new Kt({x:e,y:i,width:s,height:l,lineWidth:(H=(B=p==null?void 0:p.group)===null||B===void 0?void 0:B.lineWidth)!==null&&H!==void 0?H:void 0,fill:(F=(E=p==null?void 0:p.group)===null||E===void 0?void 0:E.fill)!==null&&F!==void 0?F:void 0,stroke:(z=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&z!==void 0?z:void 0,strokeArrayWidth:gt,strokeArrayColor:(N=(D=p==null?void 0:p.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&N!==void 0?N:void 0,cursor:(G=(V=p==null?void 0:p.group)===null||V===void 0?void 0:V.cursor)!==null&&G!==void 0?G:void 0,lineDash:(Z=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Z!==void 0?Z:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",n.col=o,n.row=r,t==null||t.addCellGroup(n))}if(n.AABBBounds.width(),b&&Array.isArray(f.getCellValue(o,r))||!b){const gt=new Vr(v,{stroke:!1,x:a[3],y:a[0],canvas:(q=f.canvas)!==null&&q!==void 0?q:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:j,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:c,dataId:g,data:f.getCellValue(o,r)||[],cellPadding:a,dpr:f.internalProps.pixelRatio,axes:f.isPivotChart()?f.internalProps.layoutMap.getChartAxes(o,r):[],tableChartOption:f.options.chartOption});n.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return n}function oz(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m){var b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U;if(!n){const ht=$o(o,r,f,g);m&&(n=g.scenegraph.highPerformanceGetCell(o,r,!0))&&n.role==="cell"&&n.setAttributes({x:e,y:i,width:l,height:a,lineWidth:(w=(b=f==null?void 0:f.group)===null||b===void 0?void 0:b.lineWidth)!==null&&w!==void 0?w:void 0,fill:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.fill)!==null&&_!==void 0?_:void 0,stroke:(x=(y=f==null?void 0:f.group)===null||y===void 0?void 0:y.stroke)!==null&&x!==void 0?x:void 0,strokeArrayWidth:ht,strokeArrayColor:(A=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.strokeArrayColor)!==null&&A!==void 0?A:void 0,cursor:(T=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.cursor)!==null&&T!==void 0?T:void 0,lineDash:(P=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),n&&n.role==="cell"||((n=new Kt({x:e,y:i,width:l,height:a,lineWidth:(B=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineWidth)!==null&&B!==void 0?B:void 0,fill:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.fill)!==null&&E!==void 0?E:void 0,stroke:(L=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:ht,strokeArrayColor:(D=(z=f==null?void 0:f.group)===null||z===void 0?void 0:z.strokeArrayColor)!==null&&D!==void 0?D:void 0,cursor:(V=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.cursor)!==null&&V!==void 0?V:void 0,lineDash:(U=(G=f==null?void 0:f.group)===null||G===void 0?void 0:G.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",n.col=o,n.row=r,t==null||t.addCellGroup(n))}let Z;if(c){let ht=o,gt=r;v&&(ht=v.start.col,gt=v.start.row),Z=g.getCellIcons(ht,gt)}let q=0,j=0;if(Array.isArray(Z)&&Z.length!==0){const{leftIconWidth:ht,rightIconWidth:gt,absoluteLeftIconWidth:vt,absoluteRightIconWidth:W}=qh(Z,n,v,g);q=ht+gt,j=ht,n.forEachChildren(O=>{O.role==="icon-left"?O.setAttribute("x",O.attribute.x+h[3]):O.role==="icon-right"?O.setAttribute("x",O.attribute.x+l-gt-h[1]):O.role==="icon-absolute-right"&&O.setAttribute("x",O.attribute.x+l-W-h[1])}),n.forEachChildren(O=>{u==="middle"?O.setAttribute("y",(a-O.AABBBounds.height())/2):u==="bottom"?O.setAttribute("y",a-O.AABBBounds.height()-h[2]):O.setAttribute("y",h[0])})}const rt=rz(o,r,s-q,l,a,h,f,p,g);return rt&&n.appendChild(rt),rt.render(),l-=h[1]+h[3]+q,a-=h[0]+h[2],d==="center"?rt.setAttribute("x",h[3]+j+(l-rt.AABBBounds.width())/2):d==="right"?rt.setAttribute("x",h[3]+j+l-rt.AABBBounds.width()):rt.setAttribute("x",h[3]+j),u==="middle"?rt.setAttribute("y",h[0]+(a-rt.AABBBounds.height())/2):u==="bottom"?rt.setAttribute("y",h[0]+a-rt.AABBBounds.height()):rt.setAttribute("y",h[0]),n}function rz(n,t,e,i,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(n,t),f=lt("size",g,n,t,a),p=lt("spaceBetweenTextAndIcon",g,n,t,a),v=lt("defaultFill",g,n,t,a),m=lt("defaultStroke",g,n,t,a),b=lt("disableFill",g,n,t,a),w=lt("checkedFill",g,n,t,a),C=lt("checkedStroke",g,n,t,a),_=lt("disableCheckedFill",g,n,t,a),y=lt("disableCheckedStroke",g,n,t,a),x=lt("checkIconImage",g,n,t,a),S=lt("indeterminateIconImage",g,n,t,a),A=a.getCellValue(n,t),R=a.getCellOriginValue(n,t);let T,M,P=(h=A)!==null&&h!==void 0?h:"";$t(A)?(T=A.checked,M=A.disable,P=(d=A.text)!==null&&d!==void 0?d:""):typeof A=="boolean"&&(T=A,P=""),T=a.stateManager.syncCheckedState(n,t,l.field,T);const k=hn(n,t,a),B=a._getCellStyle(n,t),H=(u=B.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:E}=B,{checked:F,disable:L}=l;if(T==null||typeof T=="function"){const Z=xe(F,{col:n,row:t,table:a,context:null,value:A,dataValue:R});T=a.stateManager.syncCheckedState(n,t,l.field,Z)}const z=xe(L,{col:n,row:t,table:a,context:null,value:A,dataValue:R}),D=e==="auto",N=a.isAutoRowHeight(t),V={text:P.length===1?P[0]:P,maxLineWidth:D?1/0:i-(r[1]+r[3]+k)-f-p,textBaseline:"top",autoWrapText:H,lineClamp:E,wordBreak:"break-word",heightLimit:N?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:k,whiteSpace:P.length!==1||H?"normal":"no-wrap"},G={x:0,y:0,text:s.text?Object.assign({},s.text,V):V,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=M??z)!==null&&c!==void 0&&c};T==="indeterminate"?(G.checked=void 0,G.indeterminate=!0):(G.checked=T,G.indeterminate=void 0),v&&(G.box.fill=v),m&&(G.box.stroke=m),b&&(G.box.disableFill=b),w&&(G.box.checkedFill=w),C&&(G.box.checkedStroke=C),_&&(G.box.disableCheckedFill=_),y&&(G.box.disableCheckedStroke=y),x&&(G.icon.checkIconImage=x),S&&(G.icon.indeterminateIconImage=S);const U=new kr(G);return U.name="checkbox",U}function sz(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f){var p,v,m,b,w,C,_,y,x,S,A,R;if(!n){const P=$o(o,r,g,c);(n=new Kt({x:e,y:i,width:l,height:a,lineWidth:(v=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&v!==void 0?v:void 0,fill:(b=(m=g==null?void 0:g.group)===null||m===void 0?void 0:m.fill)!==null&&b!==void 0?b:void 0,stroke:(C=(w=g==null?void 0:g.group)===null||w===void 0?void 0:w.stroke)!==null&&C!==void 0?C:void 0,strokeArrayWidth:P,strokeArrayColor:(y=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.strokeArrayColor)!==null&&y!==void 0?y:void 0,cursor:(S=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.cursor)!==null&&S!==void 0?S:void 0,lineDash:(R=(A=g==null?void 0:g.group)===null||A===void 0?void 0:A.lineDash)!==null&&R!==void 0?R:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",n.col=o,n.row=r,t==null||t.addCellGroup(n)}const{width:T,height:M}=lz(o,r,s,l,a,h,g,f,n,c);return l-=h[1]+h[3],a-=h[0]+h[2],n.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-T)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-T):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-M)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-M):P.setAttribute("y",h[0]+P.attribute.y)}),n}function lz(n,t,e,i,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(n,t);let g=lt("size",c,n,t,h),f=lt("innerRadius",c,n,t,h),p=lt("outerRadius",c,n,t,h);const v=lt("spaceBetweenTextAndIcon",c,n,t,h),m=lt("spaceBetweenRadio",c,n,t,h),b=lt("defaultFill",c,n,t,h),w=lt("defaultStroke",c,n,t,h),C=lt("disableFill",c,n,t,h),_=lt("checkedFill",c,n,t,h),y=lt("checkedStroke",c,n,t,h),x=lt("disableCheckedFill",c,n,t,h),S=lt("disableCheckedStroke",c,n,t,h);nt(p)?g=2*p:p=Math.round(g/2),(!nt(f)||f<0)&&(f=Math.round(p/7*3));const A=h.getCellValue(n,t),R=h.getCellOriginValue(n,t),T=hn(n,t,h),M=h._getCellStyle(n,t),P=(d=M.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:k}=M,B=e==="auto",H=h.heightMode==="autoHeight",E={maxLineWidth:B?1/0:i-(r[1]+r[3]+T)-g-v,textBaseline:"top",autoWrapText:P,lineClamp:k,wordBreak:"break-word",heightLimit:H?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:T},F={x:0,y:0,text:s.text?Object.assign({},s.text,E):E,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:v};b&&(F.circle.fill=b),w&&(F.circle.stroke=w),C&&(F.circle.disableFill=C),_&&(F.circle.checkedFill=_),y&&(F.circle.checkedStroke=y),x&&(F.circle.disableCheckedFill=x),S&&(F.circle.disableCheckedStroke=S);let L=0,z=0;const D=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(it(A))A.forEach((N,V)=>{const G=n1(N,R,V,n,t,l,P,F,h);G&&a.appendChild(G),G.id=`radio-${n}-${t}-${V}`,G.render();const U=G.AABBBounds;D==="vertical"?(G.setAttribute("y",z),z+=U.height()+(V!==A.length-1?m:0),L=Math.max(L,U.width())):D==="horizontal"&&(G.setAttribute("x",L),L+=U.width()+(V!==A.length-1?m:0),z=Math.max(z,U.height()))});else{const N=n1(A,R,void 0,n,t,l,P,F,h);N&&a.appendChild(N),N.id=`radio-${n}-${t}`,N.render();const V=N.AABBBounds;L=V.width(),z=V.height()}return{width:L,height:z}}function n1(n,t,e,i,o,r,s,l,a){const h=az(n,t,e,i,o,r,a),d=hz(n,t,i,o,r,a),u=$t(n)?n.text:ze(n)?"":n??"",c=dt({},l,{checked:h,disabled:d,text:{text:u.length===1?u[0]:u,whiteSpace:u.length!==1||s?"normal":"no-wrap"},boundsPadding:0}),g=new Ir(c);return g.name="radio",g}function az(n,t,e,i,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return $t(n)?d=n.checked:typeof n=="boolean"&&(d=n),d=s.stateManager.syncRadioState(i,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=xe(r.checked,{col:i,row:o,table:s,context:null,value:n,dataValue:t}),d=s.stateManager.syncRadioState(i,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function hz(n,t,e,i,o,r){var s;let l;$t(n)&&(l=n.disable);const a=xe(o.disable,{col:e,row:i,table:r,context:null,value:n,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const mo=new sH,bo=new ko;function dz(n,t,e,i,o,r,s,l,a,h,d,u){var c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L;if(!n){const D=$o(o,r,d,h);u&&(n=h.scenegraph.highPerformanceGetCell(o,r,!0))&&n.role==="cell"&&n.setAttributes({x:e,y:i,width:s,height:l,lineWidth:(g=(c=d==null?void 0:d.group)===null||c===void 0?void 0:c.lineWidth)!==null&&g!==void 0?g:void 0,fill:(p=(f=d==null?void 0:d.group)===null||f===void 0?void 0:f.fill)!==null&&p!==void 0?p:void 0,stroke:(m=(v=d==null?void 0:d.group)===null||v===void 0?void 0:v.stroke)!==null&&m!==void 0?m:void 0,strokeArrayWidth:D,strokeArrayColor:(w=(b=d==null?void 0:d.group)===null||b===void 0?void 0:b.strokeArrayColor)!==null&&w!==void 0?w:void 0,cursor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.cursor)!==null&&_!==void 0?_:void 0,lineDash:(x=(y=d==null?void 0:d.group)===null||y===void 0?void 0:y.lineDash)!==null&&x!==void 0?x:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),n&&n.role==="cell"||((n=new Kt({x:e,y:i,width:s,height:l,lineWidth:(A=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineWidth)!==null&&A!==void 0?A:void 0,fill:(T=(R=d==null?void 0:d.group)===null||R===void 0?void 0:R.fill)!==null&&T!==void 0?T:void 0,stroke:(P=(M=d==null?void 0:d.group)===null||M===void 0?void 0:M.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:D,strokeArrayColor:(B=(k=d==null?void 0:d.group)===null||k===void 0?void 0:k.strokeArrayColor)!==null&&B!==void 0?B:void 0,cursor:(E=(H=d==null?void 0:d.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(L=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",n.col=o,n.row=r,t==null||t.addCellGroup(n))}const z=uz(o,r,s,l,a,h);return z&&n.appendChild(z),n}function uz(n,t,e,i,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(n,t).sparklineSpec,h=r.getCellValue(n,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=i-=o[0]+o[2];if(typeof a=="function"){const w={col:n,row:t,dataValue:r.getCellOriginValue(n,t)||"",value:r.getCellValue(n,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(n,t)),table:r};s=a(w),l=o1(s,d,u,e,i)}else s=a,l=o1(a,d,u,e,i);const g=[],f=[];let p,v;if(typeof s.xField=="object")mo.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const w=h.map(C=>C[s.xField]);mo.domain(w),p=s.xField}else Array.isArray(h)&&(mo.domain(Array.from({length:h.length},(w,C)=>C)),p=s.xField);if(mo.range([0,e]),typeof s.yField=="object")bo.domain(s.yField.domain),v=s.yField.field;else if(typeof s.yField=="string"){const w=r1(h,s.yField);bo.domain([Math.min(...w),Math.max(...w)]),v=s.yField}else if(Array.isArray(h)){const w=r1(h);bo.domain([Math.min(...w),Math.max(...w)]),v=s.yField}if(bo.range([0,i]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const w=h.map(_=>_[s.xField.field]),C=s.xField.domain;for(let _=0;_<C.length;_++){let y=!1;for(let x=0;x<w.length;x++)if(C[_]===w[x]){const S=h[x];if(!I(S[p])||!I(S[v]))break;g.push({x:0+mo.scale(S[p]),y:c-bo.scale(S[v]),defined:I(S[v])}),f.push(S),y=!0;break}y||(g.push({x:0+mo.scale(C[_]),y:0,defined:!1}),f.push({[p]:C[_],[v]:null}))}}else for(let w=0;w<h.length;w++){const C=h[w];g.push({x:0+mo.scale(p?C[p]:w),y:c-bo.scale(v?C[v]:C),defined:I(v?C[v]:C),rawData:C}),f.push(C)}const m=l.getChildByName("sparkline-line");m&&m.setAttribute("points",g),m.bandwidth=mo.step(),m.min=bo.range()[0],m.max=bo.range()[1];const b=l.getChildByName("sparkline-symbol-group");if(b){const w=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let C=0;C<g.length;C++){const{x:_,y,defined:x}=g[C];if(x){const S=Ms({x:_,y});b.appendChild(S)}}else if(w)for(let C=0;C<g.length;C++){const{x:_,y,defined:x}=g[C];if(x&&(!g[C-1]||!g[C-1].defined)&&(!g[C+1]||!g[C+1].defined)){const S=Ms({x:_,y});b.appendChild(S)}}}return l}function o1(n,t,e,i,o){var r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R;let T;T=typeof n=="function"?n(null):n;const M=new Kt({x:t,y:e,width:i,height:o,stroke:!1,fill:!1});if(M.name="sparkline",T.type==="line"){const P=Si({x:0,y:0,curveType:T.smooth?"monotoneX":"linear",stroke:(l=(s=(r=T.line)===null||r===void 0?void 0:r.style)===null||s===void 0?void 0:s.stroke)!==null&&l!==void 0?l:"blue",lineWidth:(d=(h=(a=T.line)===null||a===void 0?void 0:a.style)===null||h===void 0?void 0:h.strokeWidth)!==null&&d!==void 0?d:2});P.name="sparkline-line",M.addChild(P),T.crosshair&&(P.hover=(c=(u=T.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const k=new Kt({x:0,y:0,width:i,height:o,stroke:!1,fill:!1});k.name="sparkline-symbol-group",k.setTheme({symbol:{stroke:(p=(f=(g=T.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(b=(m=(v=T.point)===null||v===void 0?void 0:v.style)===null||m===void 0?void 0:m.strokeWidth)!==null&&b!==void 0?b:1,fill:(_=(C=(w=T.point)===null||w===void 0?void 0:w.style)===null||C===void 0?void 0:C.fill)!==null&&_!==void 0?_:"#000",size:2*((S=(x=(y=T.point)===null||y===void 0?void 0:y.style)===null||x===void 0?void 0:x.size)!==null&&S!==void 0?S:3),symbolType:"circle"}}),M.addChild(k),k.hover=(R=(A=T.point)===null||A===void 0?void 0:A.hover)!==null&&R!==void 0&&R}return M}function r1(n,t){const e=[];for(let i=0;i<n.length;i++){const o=n[i];I(t)&&I(o[t])?e.push(o[t]):!I(t)&&I(o)&&e.push(o)}return e}const cf=an();function cz(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v){var m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht;const gt=g._getCellStyle(i,o),vt=Kh("padding",gt,i,o,g);!((m=g.options.customConfig)===null||m===void 0)&&m.imageMargin?h=kt((b=g.options.customConfig)===null||b===void 0?void 0:b.imageMargin):I(vt)&&(h=vt),!((w=f==null?void 0:f.text)===null||w===void 0)&&w.textAlign&&(d=(C=f==null?void 0:f.text)===null||C===void 0?void 0:C.textAlign),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textBaseline&&(u=(y=f==null?void 0:f.text)===null||y===void 0?void 0:y.textBaseline);const W=$o(i,o,f,g);let O,Y;if(v&&(O=g.scenegraph.highPerformanceGetCell(i,o,!0),O&&O.role==="cell"&&O.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(S=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.lineWidth)!==null&&S!==void 0?S:void 0,fill:(R=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.fill)!==null&&R!==void 0?R:void 0,stroke:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.stroke)!==null&&M!==void 0?M:void 0,strokeArrayWidth:W,strokeArrayColor:(k=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&k!==void 0?k:void 0,cursor:(H=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.cursor)!==null&&H!==void 0?H:void 0,lineDash:(F=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),O&&O.role==="cell"||(O=new Kt({x:t,y:e,width:r,height:s,lineWidth:(z=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&z!==void 0?z:void 0,fill:(N=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.fill)!==null&&N!==void 0?N:void 0,stroke:(G=(V=f==null?void 0:f.group)===null||V===void 0?void 0:V.stroke)!==null&&G!==void 0?G:void 0,strokeArrayWidth:W,strokeArrayColor:(Z=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Z!==void 0?Z:void 0,cursor:(j=(q=f==null?void 0:f.group)===null||q===void 0?void 0:q.cursor)!==null&&j!==void 0?j:void 0,lineDash:(ht=(rt=f==null?void 0:f.group)===null||rt===void 0?void 0:rt.lineDash)!==null&&ht!==void 0?ht:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),O.role="cell",O.col=i,O.row=o,n==null||n.addCellGroup(O)),c){let at=i,tt=o;p&&(at=p.start.col,tt=p.start.row),Y=g.getCellIcons(at,tt)}let $=0,Q=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:at,rightIconWidth:tt,absoluteLeftIconWidth:_t,absoluteRightIconWidth:yt}=qh(Y,O,p,g);$=at,Q=tt,O.forEachChildren(ut=>{ut.role==="icon-left"?ut.setAttribute("x",ut.attribute.x+h[3]):ut.role==="icon-right"?ut.setAttribute("x",ut.attribute.x+r-tt-h[1]):ut.role==="icon-absolute-right"&&ut.setAttribute("x",ut.attribute.x+r-yt-h[1])}),O.forEachChildren(ut=>{u==="middle"?ut.setAttribute("y",(s-ut.AABBBounds.height())/2):u==="bottom"?ut.setAttribute("y",s-ut.AABBBounds.height()-h[2]):ut.setAttribute("y",h[0])}),O._cellLeftIconWidth=$,O._cellRightIconWidth=Q}const et=g.getCellValue(i,o),ot=document.createElement("video");ot.addEventListener("loadeddata",()=>{a&&t_(i,o,ot.videoWidth,ot.videoHeight,g.scenegraph,h,O);const{width:at,height:tt,isMerge:_t}=Or(O,g);if(l){const{width:Qe,height:$i}=Uh(ot.videoWidth,ot.videoHeight,at-h[1]-h[3],tt-h[0]-h[2]),si=Tg(0,0,at,tt,Qe,$i,d,u,h);K.setAttributes({width:Qe,height:$i,x:si.x,y:si.y,dx:0})}else K.setAttributes({x:h[3],y:h[0],width:at-h[1]-h[3],height:tt-h[2]-h[0],dy:0});_t&&Mg(O.mergeStartCol,O.mergeEndCol,O.mergeStartRow,O.mergeEndRow,g);const{width:yt,height:ut}=Or(O,g),xt=Math.floor(Math.min(yt-h[1]-h[3],ut-h[2]-h[0])/2),de=0+(yt>K.attribute.width?K.attribute.x-0+K.attribute.width/2:yt/2),Re=0+(ut>K.attribute.height?K.attribute.y-0+K.attribute.height/2:ut/2),Ge=new Wo({x:de-xt/2,y:Re-xt/2,width:xt,height:xt,image:cf.play.svg,cursor:cf.play.cursor});Ge.name="play-icon",O.appendChild(Ge),g.scenegraph.updateNextFrame()}),ot.onerror=()=>{K.image=cf.damage_pic.svg},ot.src=et,ot.setAttribute("preload","auto");const K=Pa({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ot,cursor:"pointer"});return K.name="image",K.keepAspectRatio=l,K.textAlign=d,K.textBaseline=u,O.appendChild(K),O}function gz(n,t,e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b){var w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht,gt,vt,W,O;const Y=n._getCellStyle(r,s),$=Kh("padding",Y,r,s,n);I($)&&(d=$),!((w=v==null?void 0:v.text)===null||w===void 0)&&w.textAlign&&(u=(C=v==null?void 0:v.text)===null||C===void 0?void 0:C.textAlign),!((_=v==null?void 0:v.text)===null||_===void 0)&&_.textBaseline&&(c=(y=v==null?void 0:v.text)===null||y===void 0?void 0:y.textBaseline);const Q=n.isAutoRowHeight(s),et=l==="auto",ot=(x=Y.autoWrapText)!==null&&x!==void 0?x:n.internalProps.autoWrapText,K=Y.lineClamp,at=$o(r,s,v,n);let tt;if(b&&(tt=n.scenegraph.getCell(r,s,!0),tt&&tt.role==="cell"&&tt.setAttributes({x:i,y:o,width:a,height:h,lineWidth:(A=(S=v==null?void 0:v.group)===null||S===void 0?void 0:S.lineWidth)!==null&&A!==void 0?A:void 0,fill:(T=(R=v==null?void 0:v.group)===null||R===void 0?void 0:R.fill)!==null&&T!==void 0?T:void 0,stroke:(P=(M=v==null?void 0:v.group)===null||M===void 0?void 0:M.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:at??void 0,strokeArrayColor:(B=(k=v==null?void 0:v.group)===null||k===void 0?void 0:k.strokeArrayColor)!==null&&B!==void 0?B:void 0,cursor:(E=(H=v==null?void 0:v.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(L=(F=v==null?void 0:v.group)===null||F===void 0?void 0:F.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius})),tt&&tt.role==="cell"||(tt=new Kt({x:i,y:o,width:a,height:h,lineWidth:(D=(z=v==null?void 0:v.group)===null||z===void 0?void 0:z.lineWidth)!==null&&D!==void 0?D:void 0,fill:(V=(N=v==null?void 0:v.group)===null||N===void 0?void 0:N.fill)!==null&&V!==void 0?V:void 0,stroke:(U=(G=v==null?void 0:v.group)===null||G===void 0?void 0:G.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:at??void 0,strokeArrayColor:(q=(Z=v==null?void 0:v.group)===null||Z===void 0?void 0:Z.strokeArrayColor)!==null&&q!==void 0?q:void 0,cursor:(rt=(j=v==null?void 0:v.group)===null||j===void 0?void 0:j.cursor)!==null&&rt!==void 0?rt:void 0,lineDash:(gt=(ht=v==null?void 0:v.group)===null||ht===void 0?void 0:ht.lineDash)!==null&>!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius}),tt.role="cell",tt.col=r,tt.row=s,e==null||e.addCellGroup(tt)),f&&tt.appendChild(f),p){const _t=t;let yt;if(g){let ut=r,xt=s;m&&(ut=m.start.col,xt=m.start.row),yt=n.getCellIcons(ut,xt)}if(iL(tt,yt,_t,d,et,Q,ot,typeof K=="number"?K:void 0,tt.attribute.width,tt.attribute.height,u,c,n,v,m),(vt=v==null?void 0:v._vtable)===null||vt===void 0?void 0:vt.marked){const ut=ac({x:tt.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});ut.name="mark",tt.appendChild(ut)}}return f&&tt.setAttributes({width:Math.max(tt.attribute.width,(W=f.attribute.width)!==null&&W!==void 0?W:0),height:Math.max(tt.attribute.height,(O=f.attribute.height)!==null&&O!==void 0?O:0)}),tt}function fz(n,t,e,i,o,r,s,l,a,h){var d,u,c,g,f,p;n.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[n.dependField])!==null&&u!==void 0?u:o),n.barType=(c=n.barType)!==null&&c!==void 0?c:"default",n.min=(g=xe(n.min,{col:r,row:s,table:a,value:i,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,n.max=(f=xe(n.max,{col:r,row:s,table:a,value:i,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:n.min+100;let v=0;v=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let m=e,b=v,w=0;nt(a.theme._contentOffset)&&(w=a.theme._contentOffset);const C=new Kt({x:-w,y:-w,width:m,height:b});C.name="progress-bar";const{showBar:_,barColor:y,barBgColor:x,barPositiveColor:S,barNegativeColor:A,barAxisColor:R,barRightToLeft:T,showBarMark:M,barMarkPositiveColor:P,barMarkNegativeColor:k,barMarkWidth:B,barMarkPosition:H}=t;let{barHeight:E,barBottom:F,barPadding:L}=t;L.length===1?L=[L[0],L[0],L[0],L[0]]:L.length===2?L=[L[0],L[1],L[0],L[1]]:L.length===3&&(L=[L[0],L[1],L[2],L[1]]),L=L.map((j,rt)=>{if(typeof j=="string"&&Eh.endsWith(j,"%")){const ht=Number(j.substr(0,j.length-1));return rt===0||rt===2?v*ht/100:e*ht/100}return Number(j)});const z=kt(lt("borderLineWidth",t,r,s,a)),D=Math.max(L[0],Math.ceil(z[0]/2)),N=Math.max(L[1],Math.floor(z[1]/2)),V=Math.max(L[2],Math.floor(z[2]/2)),G=Math.max(L[3],Math.ceil(z[3]/2));m-=N+G,b-=V+D,s===a.rowCount-1&&[0,"0"].includes(F)&&(b-=1);const U=D,Z=G,q=m;if(typeof E=="string"&&Eh.endsWith(E,"%")?(E=Number(E.substr(0,E.length-1)),E=b*E/100):E=Number(E),typeof F=="string"&&Eh.endsWith(F,"%")?(F=Number(F.substr(0,F.length-1)),F=b*F/100):F=Number(F),xe(_,{col:r,row:s,table:a,context:null,value:i,dataValue:o})){let j=`${o}`;Eh.endsWith(j,"%")&&(j=j.substr(0,j.length-1));const rt=Number(j);if(isNaN(rt))return C;if(((p=n.barType)!==null&&p!==void 0?p:"default")==="default"){const ht=rt<n.min?0:rt>n.max?1:(rt-n.min)/(n.max-n.min),gt=m,vt=U+b-E-F;let W=Math.min(gt*ht,gt);const O=T?Z+q-W:Z;r!==a.colCount-1||ht!==1||T||(W-=1);const Y=xe(x,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:ht});if(Y){const et=ve({x:O,y:vt,width:gt,height:E,fill:Y});C.addChild(et)}const $=xe(y,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:ht})||"#20a8d8",Q=ve({x:O,y:vt,width:W,height:E,fill:$});C.addChild(Q)}else if(n.barType==="negative"){const ht=n.min<0?-n.min:0,gt=n.max>0?n.max:0,vt=ht/(ht+gt),W=1-vt,O=rt>0?rt/gt:0,Y=rt<0?-rt/ht:0,$=m,Q=U+b-E-F,et=Z,ot=xe(x,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:O});if(ot){const si=ve({x:et,y:Q,width:$,height:E,fill:ot});C.addChild(si)}const K=T?W*$:vt*$,at=Math.min($*vt*Y,$),tt=T?{left:et+K,top:Q,width:at,height:E}:{left:et+K-at,top:Q,width:at,height:E},_t=xe(A,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:Y})||"#20a8d8",yt=ve({x:tt.left,y:tt.top,width:tt.width,height:tt.height,fill:_t});C.addChild(yt);let ut=Math.min($*W*O,$);r!==a.colCount-1||O!==1||T||(ut-=1);const xt=T?{left:et+K-ut,top:Q,width:ut,height:E}:{left:et+K,top:Q,width:ut,height:E},de=xe(S,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:O})||"#20a8d8",Re=ve({x:xt.left,y:xt.top,width:xt.width,height:xt.height,fill:de});C.addChild(Re);const Ge=T?tt.left:xt.left,Qe=xe(R,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:O}),$i=Si({x:0,y:0,stroke:Qe,lineWidth:1,lineDash:[2,2],points:[{x:Ge,y:0},{x:Ge,y:v}]});if(C.addChild($i),M&&(O||Y)){const si=B,ti=[];let ue;if(O>0)if(ue=xe(P,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:O})||"#20a8d8",H==="right"){const mt=T?xt.left+B/2:xt.left+xt.width-B/2;ti.push({x:mt,y:xt.top}),ti.push({x:mt,y:xt.top+xt.height})}else H==="bottom"&&(ti.push({x:xt.left,y:xt.top+xt.height-B/2}),ti.push({x:xt.left+xt.width,y:xt.top+xt.height-B/2}));else if(Y>0)if(ue=xe(k,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:Y})||"#20a8d8",H==="right"){const mt=T?tt.left+tt.width-B/2:tt.left+B/2;ti.push({x:mt,y:tt.top}),ti.push({x:mt,y:tt.top+tt.height})}else H==="bottom"&&(ti.push({x:tt.left,y:tt.top+tt.height-B/2}),ti.push({x:tt.left+tt.width,y:tt.top+tt.height-B/2}));const pt=Si({x:0,y:0,stroke:ue,lineWidth:si,points:ti});C.addChild(pt)}}else if(n.barType==="negative_no_axis"){const ht=n.min<0?-n.min:0,gt=n.max>0?n.max:0,vt=Math.max(ht,gt),W=vt===0?0:Math.abs(rt)/vt,O=m;let Y=Math.min(O*W,O);r!==a.colCount-1||W!==1||T||(Y-=1);const $=U+b-E-F,Q=T?Z+q-Y:Z,et=xe(x,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:W});if(et){const tt=ve({x:Q,y:$,width:O,height:E,fill:et});C.addChild(tt)}const ot={left:Q,top:$,width:Y,height:E};let K;K=rt>=0?xe(S,{col:r,row:s,table:a,context:null,value:i,percentile:W,dataValue:o})||"#20a8d8":xe(A,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:W})||"#20a8d8";const at=ve({x:ot.left,y:ot.top,width:ot.width,height:ot.height,fill:K});if(C.addChild(at),M&&rt){const tt=B,_t=[];let yt;if(yt=rt>=0?xe(P,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:W})||"#20a8d8":xe(k,{col:r,row:s,table:a,context:null,value:i,dataValue:o,percentile:W})||"#20a8d8",H==="right"){const xt=T?ot.left+B/2:ot.left+ot.width-B/2;_t.push({x:xt,y:ot.top}),_t.push({x:xt,y:ot.top+ot.height})}else H==="bottom"&&(_t.push({x:ot.left,y:ot.top+ot.height-B/2}),_t.push({x:ot.left+ot.width,y:ot.top+ot.height-B/2}));const ut=Si({x:0,y:0,stroke:yt,lineWidth:tt,points:_t});C.addChild(ut)}}}return C}function pz(n,t,e,i,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(n=Math.min(n,0),t=Math.max(t,0)),e==null?void 0:e.expand){const m=n,b=t;I(e.expand.min)&&(n=m-(b-m)*e.expand.min),I(e.expand.max)&&(t=b+(b-m)*e.expand.max)}let p,v;if(nt(e==null?void 0:e.min)&&(n=e.min),nt(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new js,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Gs,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new ko,p.domain([n,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let m=(u=(h=(a=e.tick)===null||a===void 0?void 0:a.forceTickCount)!==null&&h!==void 0?h:(d=e.tick)===null||d===void 0?void 0:d.tickCount)!==null&&u!==void 0?u:10;jt(m)&&(m=m({axisLength:o,labelStyle:(g=(c=e==null?void 0:e.label)===null||c===void 0?void 0:c.style)!==null&&g!==void 0?g:{fontSize:Sl.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(m=Math.max(10,m)),ct(e.min)&&ct(e.max)?p.nice(m):I(e.min)&&ct(e.max)?p.niceMax(m):ct(e.min)&&I(e.max)&&p.niceMin(m)}return delete p._niceType,r||(v=p.ticks(nt(e==null?void 0:e.tickCount)?e==null?void 0:e.tickCount:5,{noDecimals:(f=e==null?void 0:e.tick)===null||f===void 0?void 0:f.noDecimals})),{range:p.domain(),ticks:v}}const vz=()=>{St.registerFunction("createChartCellGroup",nz),St.registerFunction("getAxisDomainRangeAndLabels",pz)},mz=()=>{St.registerFunction("createCheckboxCellGroup",oz)},bz=()=>{St.registerFunction("createImageCellGroup",rL)},Cz=()=>{St.registerFunction("createProgressBarCell",fz)},_z=()=>{St.registerFunction("createRadioCellGroup",sz)},yz=()=>{St.registerFunction("createSparkLineCellGroup",dz)},wz=()=>{St.registerFunction("createTextCellGroup",gz)},Sz=()=>{St.registerFunction("createVideoCellGroup",cz)};function xz(n,t,e,i,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)i.includes(e[c])||a.push(o[c]);for(let c=0;c<i.length;c++)if(!e.includes(i[c])){const g={col:n,row:s+c};l.push(g)}let h=r.getParentCellId(n,t),d=r.getRowHeaderCellAddressByCellId(h);const u=[];for(d&&u.push(d);h;)h=r.getParentCellId(d.col,d.row),h&&(d=r.getRowHeaderCellAddressByCellId(h),u.push(d));return{addCellPositions:l,removeCellPositions:a,updateCellPositions:u}}const s1={startInTotal:0,level:0};class Rl{constructor(t,e,i,o){var r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_;this.colIndex=0,this._showHeader=!0,this.columnHeaderObjs=[],this.rowHeaderObjs=[],this._cornerHeaderCellFullPathIds=[],this._columnHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds=[],this._rowHeaderCellFullPathIds_FULL=[],this._cornerHeaderCellIds=[],this._columnHeaderCellIds=[],this._rowHeaderCellIds=[],this._rowHeaderCellIds_FULL=[],this._columnWidths=[],this.columnPaths=[],this._headerObjects=[],this._headerObjectMap={},this._indicators=[],this.indicatorsAsCol=!0,this.hideIndicatorName=!1,this._showRowHeader=!0,this._showColumnHeader=!0,this._indicatorShowType="column",this.rowHierarchyTextStartAlignment=!1,this.rowDimensionKeys=[],this.colDimensionKeys=[],this.indicatorKeys=[],this.indicatorDimensionKey=ln,this._rowHeaderExtensionTree={},this._extensionRowDimensionKeys=[],this.fullRowDimensionKeys=[],this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this._useGetBodyCache=!1,this._getBodyCache=new Map,this._useHeaderPathCache=!1,this._colHeaderPathCache=new Map,this._rowHeaderPathCache=new Map,this.sharedVar=t.layoutNodeId,this._table=t,t.options.rowHierarchyType==="tree"&&(this.extensionRows=t.options.extensionRows),this.dataset=e,this._largeCellRangeCache=[],this._CellHeaderPathMap=new Map,this.rowTree=t.internalProps.rowTree,this.columnTree=t.internalProps.columnTree,this.rowsDefine=(r=t.internalProps.rows)!==null&&r!==void 0?r:[],this.columnsDefine=(s=t.internalProps.columns)!==null&&s!==void 0?s:[],this.indicatorsDefine=(l=t.internalProps.indicators)!==null&&l!==void 0?l:[],this.indicatorTitle=t.options.indicatorTitle,this.indicatorsAsCol=(a=t.options.indicatorsAsCol)===null||a===void 0||a,this.hideIndicatorName=(h=t.options.hideIndicatorName)!==null&&h!==void 0&&h,this.showRowHeader=(d=t.options.showRowHeader)===null||d===void 0||d,this.showColumnHeader=(u=t.options.showColumnHeader)===null||u===void 0||u,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=(c=t.options.rowHierarchyType)!==null&&c!==void 0?c:"grid",this.rowExpandLevel=(g=t.options.rowExpandLevel)!==null&&g!==void 0?g:1,this.rowHierarchyIndent=(f=t.options.rowHierarchyIndent)!==null&&f!==void 0?f:20,this.rowHierarchyTextStartAlignment=t.options.rowHierarchyTextStartAlignment,this.cornerSetting=Object.assign({titleOnDimension:"column",forceShowHeader:!1},t.options.corner),e&&(this.rowTree=e.rowHeaderTree,this.columnTree=e.colHeaderTree),(p=this.indicatorsDefine)===null||p===void 0||p.forEach(A=>{typeof A=="string"?this.indicatorKeys.push(A):this.indicatorKeys.push(A.indicatorKey)}),this.columnDimensionTree=i,this.rowDimensionTree=o,this.colDimensionKeys=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this.resetRowHeaderLevelCount(),this._table.isPivotChart()&&(this.hasTwoIndicatorAxes=this.indicatorsDefine.some(A=>{var R,T;if(A.chartSpec&&A.chartSpec.series&&A.chartSpec.series.length>1){const M=(T=(R=A.chartSpec.axes)!==null&&R!==void 0?R:this._table.pivotChartAxes)!==null&&T!==void 0?T:[];if(!M.length||M.every(P=>P.orient!==(this.indicatorsAsCol?"top":"right")||P.visible!==!1))return!0}return!1})),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=lg(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((v=this.extensionRows)===null||v===void 0?void 0:v.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(A=>{const R=[];A.rows.forEach(T=>{typeof T=="string"?R.push(T):R.push(T.dimensionKey)}),this._extensionRowDimensionKeys.push(R),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(R)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let y,x=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((b=(m=this.dataset.records)===null||m===void 0?void 0:m.length)!==null&&b!==void 0?b:0)!==0||this.dataset.customColTree||(x=this.columnsDefine.map(A=>typeof A=="string"?A:A.dimensionKey),this.indicatorsAsCol&&x.push(this.indicatorDimensionKey)),x=this.columnHeaderTitle?[""].concat(x):x;let S=[];if(this.rowHierarchyType==="tree"&&((w=this.extensionRows)===null||w===void 0?void 0:w.length)>=1){const A=[];A.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(R=>{A.push(R[0])}),S=this.extensionRows.reduce((R,T)=>R.concat(T.rows),[]),y=this.rowHeaderTitle?[""].concat(A):A}else y=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((_=(C=this.dataset.records)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)!==0||this.dataset.customRowTree||(y=this.rowsDefine.map(A=>typeof A=="string"?A:A.dimensionKey),this.indicatorsAsCol||y.push(this.indicatorDimensionKey)),y=this.rowHeaderTitle?[""].concat(y):y;this.cornerHeaderObjs=this._addCornerHeaders(x,y,this.columnsDefine.concat(...this.rowsDefine,...S)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((A,R)=>(A[R.id]=R,A),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.generateCellIdsConsiderHideHeader(),this.setPagination(t.options.pagination),this._table.isPivotChart()&&(this._chartItemSpanSize=0,this._chartItemBandSize=0,this._indicators.find(A=>{var R,T,M,P,k,B,H,E;!((R=A==null?void 0:A.style)===null||R===void 0)&&R.padding&&(this._chartPadding=A.style.padding),!((T=A.chartSpec)===null||T===void 0)&&T.barWidth&&typeof A.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(M=A.chartSpec)===null||M===void 0?void 0:M.barWidth);const F=(k=(P=A.chartSpec)===null||P===void 0?void 0:P.axes)===null||k===void 0?void 0:k.find(L=>L.type==="band");return F!=null&&F.bandSize&&(this._chartItemBandSize=F==null?void 0:F.bandSize,this._chartPaddingInner=(B=it(F.paddingInner)?F.paddingInner[0]:F.paddingInner)!==null&&B!==void 0?B:0,this._chartPaddingOuter=(H=it(F.paddingOuter)?F.paddingOuter[0]:F.paddingOuter)!==null&&H!==void 0?H:0),this._chartItemSpanSize>0||((E=A.chartSpec.series)===null||E===void 0||E.find(L=>(L.barWidth&&typeof L.barWidth=="number"&&(this._chartItemSpanSize=L.barWidth),this._chartItemSpanSize>0)),!1)})),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber),this.setColumnWidths()}handleRowSeriesNumber(t){var e,i;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map(o=>{var r,s;return{id:"",title:o.title,define:o,cellType:(r=o.cellType)!==null&&r!==void 0?r:"text",headerType:(s=o.cellType)!==null&&s!==void 0?s:"text",width:o.width,style:o.style,format:o.format,field:o.field,icon:o.icon}}):this.rowSeriesNumberColumn=[{id:"",title:t.title,define:t,cellType:(e=t.cellType)!==null&&e!==void 0?e:"text",headerType:(i=t.cellType)!==null&&i!==void 0?i:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!0),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter(o=>!1),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}_generateColHeaderIds(){var t,e,i,o,r,s,l,a;if(((t=this.columnDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1){let h=0;if(this.dataset&&!this._table.isPivotChart()&&((i=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&this.indicatorsAsCol&&this.columnDimensionTree.totalLevel<this.columnHeaderLevelCount){h=this.columnHeaderLevelCount-this.columnDimensionTree.totalLevel;for(let d=0;d<h;d++)this._columnHeaderCellFullPathIds.unshift([])}this._addHeaders(this._columnHeaderCellFullPathIds,h,this.columnDimensionTree.tree.children,[],this.columnHeaderObjs)}if(this.columnHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const h=++this.sharedVar.seqId,d=Array(this.colCount-this.rowHeaderLevelCount-this.rightFrozenColCount).fill(h);this._columnHeaderCellFullPathIds.unshift(d);const u={id:h,title:typeof this.columnHeaderTitle.title=="string"?this.columnHeaderTitle.title:this.columnsDefine.reduce((c,g)=>typeof g=="string"?c:c+(c?`/${g.title}`:`${g.title}`),""),field:void 0,headerType:(r=(o=this.columnHeaderTitle)===null||o===void 0?void 0:o.headerType)!==null&&r!==void 0?r:"text",style:(s=this.columnHeaderTitle)===null||s===void 0?void 0:s.headerStyle,define:{id:h,disableHeaderHover:!!(!((l=this.columnHeaderTitle)===null||l===void 0)&&l.disableHeaderHover),disableHeaderSelect:!!(!((a=this.columnHeaderTitle)===null||a===void 0)&&a.disableHeaderSelect)}};this.columnHeaderObjs.push(u),this._headerObjects[h]=u}}_generateRowHeaderIds(){var t,e,i,o,r,s,l,a,h,d;if(((t=this.rowDimensionTree.tree.children)===null||t===void 0?void 0:t.length)>=1)if(this.rowHierarchyType==="tree")this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs);else{let u=0;if(this.dataset&&!this._table.isPivotChart()&&((i=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&i!==void 0?i:0)===0&&!this.dataset.customColTree&&!this.dataset.customRowTree&&!this.indicatorsAsCol&&this.rowDimensionTree.totalLevel<this.rowHeaderLevelCount){u=this.rowHeaderLevelCount-this.rowDimensionTree.totalLevel;for(let c=0;c<u;c++)this._rowHeaderCellFullPathIds_FULL.unshift([])}this._addHeaders(this._rowHeaderCellFullPathIds_FULL,u,this.rowDimensionTree.tree.children,[],this.rowHeaderObjs)}if(this.rowHeaderTitle){this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);const u=++this.sharedVar.seqId,c=Array((r=(o=this._rowHeaderCellFullPathIds_FULL[0])===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:this.rowDimensionTree.tree.size).fill(u);this._rowHeaderCellFullPathIds_FULL.unshift(c);const g={id:u,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((f,p)=>typeof p=="string"?f:f+(f?`/${p.title}`:`${p.title}`),""),field:void 0,headerType:(l=(s=this.rowHeaderTitle)===null||s===void 0?void 0:s.headerType)!==null&&l!==void 0?l:"text",style:(a=this.rowHeaderTitle)===null||a===void 0?void 0:a.headerStyle,define:{id:u,disableHeaderHover:!!(!((h=this.rowHeaderTitle)===null||h===void 0)&&h.disableHeaderHover),disableHeaderSelect:!!(!((d=this.rowHeaderTitle)===null||d===void 0)&&d.disableHeaderSelect)}};this.rowHeaderObjs.push(g),this._headerObjects[u]=g}}_addHeaders(t,e,i,o,r){const s=this;t[e]||function(l){const a=t[l]=[];if(s.colIndex===0)return a;const h=t[l-1];for(let d=0;d<(h==null?void 0:h.length);d++)a[d]=h[d]}(e);for(let l=0;l<i.length;l++){const a=i[l];xI(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,i,o,r,s,l,a){const h=this;t[e]||function(d){const u=t[d]=[];if(h.colIndex===0)return u;const c=t[d-1];for(let g=0;g<(c==null?void 0:c.length);g++)u[g]=c[g]}(e);for(let d=0;d<i.length;d++){const u=i[d];AI(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,i){var o,r;const s=[];if(this.cornerSetting.titleOnDimension==="all")if(this.indicatorsAsCol){let l=-1;t&&t.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=i.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}),e&&e.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=i.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[l]||(this._cornerHeaderCellFullPathIds[l]=[]),this._cornerHeaderCellFullPathIds[l][h]=c})}else{let l=-1;e&&e.forEach((a,h)=>{var d,u;a===this.indicatorDimensionKey&&(l=h);const c=++this.sharedVar.seqId,g=i.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f;for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c}),t&&t.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=i.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};s[c]=f,this._headerObjects[c]=f,this._cornerHeaderCellFullPathIds[h][l]=c})}else if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="column"){const l=((o=this.cornerSetting)===null||o===void 0?void 0:o.titleOnDimension)==="row"?e:t;l&&l.forEach((a,h)=>{var d,u;const c=++this.sharedVar.seqId,g=i.find(p=>typeof p!="string"&&p.dimensionKey===a),f={id:c,title:a===this.indicatorDimensionKey?this.indicatorTitle:g?g.title:a==="axis"?"":a,field:a,style:this.cornerSetting.headerStyle,headerType:(d=this.cornerSetting.headerType)!==null&&d!==void 0?d:"text",showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,define:{showSort:g==null?void 0:g.showSortInCorner,sort:g==null?void 0:g.sort,dimensionKey:a,id:c,value:a,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,headerEditor:this.cornerSetting.headerEditor,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect},dropDownMenu:g==null?void 0:g.cornerDropDownMenu,headerIcon:g==null?void 0:g.cornerHeaderIcon,pivotInfo:{value:(u=g==null?void 0:g.title)!==null&&u!==void 0?u:"",dimensionKey:a,isPivotCorner:!0},description:g==null?void 0:g.cornerDescription};if(s[c]=f,this._headerObjects[c]=f,this.cornerSetting.titleOnDimension==="column"){this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]);for(let p=0;p<this.rowHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[h][p]=c}else if(this.cornerSetting.titleOnDimension==="row")for(let p=0;p<this.columnHeaderLevelCount;p++)this._cornerHeaderCellFullPathIds[p]||(this._cornerHeaderCellFullPathIds[p]=[]),this._cornerHeaderCellFullPathIds[p][h]=c})}else{const l=++this.sharedVar.seqId,a={id:l,title:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:(r=this.cornerSetting.headerType)!==null&&r!==void 0?r:"text",define:{dimensionKey:"维度名称",id:l,headerCustomRender:this.cornerSetting.customRender,headerCustomLayout:this.cornerSetting.customLayout,disableHeaderHover:!!this.cornerSetting.disableHeaderHover,disableHeaderSelect:!!this.cornerSetting.disableHeaderSelect}};s[l]=a,this._headerObjects[l]=a;for(let h=0;h<this.columnHeaderLevelCount;h++)for(let d=0;d<this.rowHeaderLevelCount;d++)this._cornerHeaderCellFullPathIds[h]||(this._cornerHeaderCellFullPathIds[h]=[]),this._cornerHeaderCellFullPathIds[h][d]=l}return s}generateExtensionRowTree(){this.extensionRows.forEach((t,e)=>{const i=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],i.forEach((o,r)=>{const s=o[o.length-1];let l,a;if(this.colIndex=0,typeof t.rowTree=="function"){const d=this.findFullCellIds(o);l=t.rowTree(d.map(u=>({dimensionKey:this._headerObjects[u].field,value:this._headerObjects[u].title})))}else l=Be(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new ci(l??[],this.sharedVar,this.rowHierarchyType,void 0),this._rowHeaderExtensionTree[s]=a);const h=[];this._addHeadersForTreeMode(h,0,a.tree.children,[],a.totalLevel,!0,t.rows,this.rowHeaderObjs);for(let d=0;d<h[0].length;d++)this._rowHeaderCellFullPathIds_FULL.push(o.concat(h[0][d]))})})}setColumnWidths(){var t,e,i;const o=new Array(this.colCount).fill(void 0);if(this.leftRowSeriesNumberColumnCount&&(o[0]=this.leftRowSeriesNumberColumn[0]),this.showHeader&&this.showRowHeader)if(this.rowHeaderTitle&&(o[0+this.leftRowSeriesNumberColumnCount]={}),this.rowHierarchyType==="tree"){const r=this.rowDimensionKeys[0];if(r){const s=(t=this.rowsDefine)===null||t===void 0?void 0:t.find(l=>typeof l!="string"&&l.dimensionKey===r);s&&(o[0+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:s.width,minWidth:s.minWidth,maxWidth:s.maxWidth})}(e=this._extensionRowDimensionKeys)===null||e===void 0||e.forEach((s,l)=>{var a;const h=s[0];if(h){const d=(a=this.extensionRows[l].rows)===null||a===void 0?void 0:a.find(u=>typeof u!="string"&&u.dimensionKey===h);d&&(o[l+1+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:d.width,minWidth:d.minWidth,maxWidth:d.maxWidth})}})}else(this.rowDimensionTree.totalLevel>0?this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr():this.rowsDefine.map(r=>typeof r=="string"?r:r.dimensionKey)).forEach((r,s)=>{var l;const a=(l=this.rowsDefine)===null||l===void 0?void 0:l.find(h=>typeof h!="string"&&h.dimensionKey===r);a&&(o[s+(this.rowHeaderTitle?1:0)+this.leftRowSeriesNumberColumnCount]={width:a.width,minWidth:a.minWidth,maxWidth:a.maxWidth})});if(this.indicatorsAsCol)for(let r=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;r<this.colCount;r++){const s=this.getBody(r,this.columnHeaderLevelCount);o[r]={width:s==null?void 0:s.width,minWidth:s==null?void 0:s.minWidth,maxWidth:s==null?void 0:s.maxWidth}}else{let r,s,l,a=0;(i=this._indicators)===null||i===void 0||i.forEach((h,d)=>{var u,c;typeof h.width=="number"?a=Math.max(h.width,a):h.width==="auto"&&(l=!0),typeof h.minWidth=="number"&&(s=Math.max(h.minWidth,(u=s)!==null&&u!==void 0?u:0)),typeof h.maxWidth=="number"&&(r=Math.min(h.maxWidth,(c=r)!==null&&c!==void 0?c:Number.MAX_VALUE))}),a=a>0?a:l?"auto":void 0,o.fill({width:a,minWidth:s,maxWidth:r},this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount,this.colCount-this.rightFrozenColCount)}this._columnWidths=o}get columnWidths(){return this._columnWidths}getColumnWidthDefined(t){return this._columnWidths[t]}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellLocation(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||e>=0&&e<this.columnHeaderLevelCount||t>=this.colCount-this.rightHeaderColCount||e>=this.rowCount-this.bottomHeaderRowCount}isCornerHeader(t,e){return t>=0&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=0&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t>=this.leftRowSeriesNumberColumnCount&&t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount&&e>=this.columnHeaderLevelCount}isFrozen(t,e){return this.isFrozenColumn(t)||this.isRightFrozenColumn(t)||this.isBottomFrozenRow(e)||this.isFrozenRow(e)||this.isSeriesNumberInBody(t,e)||this.isSeriesNumberInHeader(t,e)}isFrozenColumn(t,e){if(I(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(I(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(I(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(I(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get headerLevelCount(){return this.columnHeaderLevelCount}resetColumnHeaderLevelCount(){var t,e,i,o,r,s,l,a,h,d,u;if(this.showHeader&&this.showColumnHeader){if(this._table.isPivotChart()&&this.indicatorsAsCol&&!(!((e=(t=this.dataset)===null||t===void 0?void 0:t.colKeys)===null||e===void 0)&&e.length)&&((o=(i=this.columnDimensionTree)===null||i===void 0?void 0:i.tree)===null||o===void 0?void 0:o.level)===0&&!this.hasTwoIndicatorAxes)return void(this.columnHeaderLevelCount=0);let c=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return c===0&&this.dataset&&!(!((r=this.dataset.customColTree)===null||r===void 0)&&r.length)?this.cornerSetting.titleOnDimension==="row"&&this.cornerSetting.forceShowHeader?c=1:this._table.isPivotChart()||((l=(s=this.dataset.records)===null||s===void 0?void 0:s.length)!==null&&l!==void 0?l:0)!==0||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(a=this.columnsDefine.length)!==null&&a!==void 0?a:0):!this.dataset||this._table.isPivotChart()||((d=(h=this.dataset.records)===null||h===void 0?void 0:h.length)!==null&&d!==void 0?d:0)!==0||this.dataset.customColTree||this.cornerSetting.titleOnDimension!=="column"&&this.cornerSetting.titleOnDimension!=="all"||(c=(u=this.columnsDefine.length)!==null&&u!==void 0?u:0,!this.hideIndicatorName&&this.indicatorsAsCol&&c++),this.columnHeaderTitle&&(c+=1),this._table.isPivotChart()&&this.indicatorsAsCol&&!this.hasTwoIndicatorAxes&&af(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,i,o,r,s,l,a;if(this.showHeader&&this.showRowHeader){if(this.rowHierarchyType==="tree"){const u=(e=(t=this.extensionRows)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0;return this.rowHeaderTitle?void(this.rowHeaderLevelCount=2+u):void(this.rowHeaderLevelCount=1+u)}const h=this.rowDimensionTree.totalLevel;let d=h;return d===0&&this.dataset&&!(!((i=this.dataset.customRowTree)===null||i===void 0)&&i.length)?this.cornerSetting.titleOnDimension==="column"&&this.cornerSetting.forceShowHeader?d=1:this._table.isPivotChart()||((r=(o=this.dataset.records)===null||o===void 0?void 0:o.length)!==null&&r!==void 0?r:0)!==0||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=(s=this.rowsDefine.length)!==null&&s!==void 0?s:0):!this.dataset||this._table.isPivotChart()||((a=(l=this.dataset.records)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)!==0||this.dataset.customRowTree||this.cornerSetting.titleOnDimension!=="row"&&this.cornerSetting.titleOnDimension!=="all"||(d=this.rowsDefine.length,this.hideIndicatorName||this.indicatorsAsCol||d++),!this.indicatorsAsCol&&this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey&&(d=h-1),this.rowHeaderTitle&&(d+=1),void(this.rowHeaderLevelCount=d)}this.rowHeaderLevelCount=this.indicatorsAsCol||this.hideIndicatorName?0:1}get columnHeaderLevelCount(){return this._columnHeaderLevelCount}set columnHeaderLevelCount(t){this._columnHeaderLevelCount=t}get rowHeaderLevelCount(){return this._rowHeaderLevelCount}set rowHeaderLevelCount(t){this._rowHeaderLevelCount=t}get colCount(){var t;return(this.columnDimensionTree.totalLevel>0||this._table.isPivotChart()||((t=this.dataset.records)===null||t===void 0?void 0:t.length)>0||this.dataset.records&&!Array.isArray(this.dataset.records)?this.columnDimensionTree.tree.size:0)+this.rowHeaderLevelCount+this.rightHeaderColCount+this.leftRowSeriesNumberColumnCount}get rowCount(){var t,e,i,o;return((this._table.records||this.dataset.records)&&(!Array.isArray(this._table.records)||this._table.records.length>0)&&((t=this._indicators)===null||t===void 0?void 0:t.length)>0&&!(!((e=this._rowHeaderCellIds)===null||e===void 0)&&e.length)?1:(o=(i=this._rowHeaderCellIds)===null||i===void 0?void 0:i.length)!==null&&o!==void 0?o:0)+this.columnHeaderLevelCount+this.bottomHeaderRowCount}get bodyRowSpanCount(){return this.rowDimensionTree.tree.size}get bottomFrozenRowCount(){if(!this._table.isPivotChart())return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0;if(this.indicatorKeys.length>=1&&af(this.indicatorsDefine)){const t=this._table.pivotChartAxes.find(e=>e.orient==="bottom");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}return 0}get rightFrozenColCount(){if(!this._table.isPivotChart())return this._table.internalProps.rightFrozenColCount?this.colCount-this.rowHeaderLevelCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:this.colCount-this.rowHeaderLevelCount:0;const t=this._table.pivotChartAxes.find(e=>e.orient==="right");return(t==null?void 0:t.visible)===!1||this.indicatorsAsCol?0:this.hasTwoIndicatorAxes?1:0}get bodyRowCount(){return this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){var i,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(i=this._cornerHeaderCellIds[e])===null||i===void 0?void 0:i[t-this.leftRowSeriesNumberColumnCount];if(this.isColumnHeader(t,e))return(o=this._columnHeaderCellIds[e])===null||o===void 0?void 0:o[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount];if(this.isRowHeader(t,e))return(r=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||r===void 0?void 0:r[t-this.leftRowSeriesNumberColumnCount];if(this.isRightFrozenColumn(t,e))return(s=this._rowHeaderCellIds[e-this.columnHeaderLevelCount])===null||s===void 0?void 0:s[this.rowHeaderLevelCount-1];if(this.isBottomFrozenRow(t,e))return(l=this._columnHeaderCellIds[this.columnHeaderLevelCount-1])===null||l===void 0?void 0:l[t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount]}}getHeader(t,e){var i;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(i=this._headerObjectMap[o])!==null&&i!==void 0?i:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var i,o;const r=this.getCellId(t,e);return((i=this._headerObjectMap[r])===null||i===void 0?void 0:i.field)||((o=this.getBody(t,e))===null||o===void 0?void 0:o.field)}getHeaderCellAdressById(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const i=this._columnHeaderCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const i=this._rowHeaderCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const i=this._cornerHeaderCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(i=>i&&i.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var i,o,r,s,l,a,h,d,u,c;const g=this.getBodyWidthCache(t,e);if(g)return g;if(this.isSeriesNumber(t,e)){const m=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,m),m}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const m=(o=(i=f.colHeaderPaths)===null||i===void 0?void 0:i.find(w=>w.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,b=I(m)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(w=>w.indicatorKey===m))!==null&&s!==void 0?s:this._indicators[0])!==null&&l!==void 0?l:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,b),b}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(m=>m.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,v=I(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(m=>m.indicatorKey===p))!==null&&u!==void 0?u:this._indicators[0])!==null&&c!==void 0?c:{id:"",field:void 0,indicatorKey:void 0,cellType:"text",define:void 0};return this.setBodyWidthCache(t,e,v),v}getCellRange(t,e){var i,o;const r={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||t===-1||e===-1||this.isRightFrozenColumn(t,e)||this.isBottomFrozenRow(t,e))return r;if(this._table.isPivotChart()){if(this.isLeftBottomCorner(t,e))return{start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.frozenColCount-1,row:this.rowCount-1}};if(this.isRightTopCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}};if(this.isRightBottomCorner(t,e))return{start:{col:this.colCount-this.rightFrozenColCount,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}}}for(let s=0;s<this._largeCellRangeCache.length;s++){const l=this._largeCellRangeCache[s];if(t>=l.start.col&&t<=l.end.col&&e>=l.start.row&&e<=l.end.row)return l}if(this.isHeader(t,e)&&t!==-1&&e!==-1){const s=this.getCellId(t,e);for(let l=t-1;l>=0&&s===this.getCellId(l,e);l--)r.start.col=l;for(let l=t+1;l<((i=this.colCount)!==null&&i!==void 0?i:0)&&s===this.getCellId(l,e);l++)r.end.col=l;for(let l=e-1;l>=0&&s===this.getCellId(t,l);l--)r.start.row=l;for(let l=e+1;l<((o=this.rowCount)!==null&&o!==void 0?o:0)&&!(s!==this.getCellId(t,l)||this.isSeriesNumberInHeader(t,e)&&l>=this.columnHeaderLevelCount);l++)r.end.row=l}return(r.end.col-r.start.col>100||r.end.row-r.start.row>100)&&this._largeCellRangeCache.push(r),r}isCellRangeEqual(t,e,i,o){const r=this.getCellRange(t,e),s=this.getCellRange(i,o);return r.start.col===s.start.col&&r.end.col===s.end.col&&r.start.row===s.start.row&&r.end.row===s.end.row}getBodyIndexByRow(t){return t<this.columnHeaderLevelCount||t>=this.rowCount-this.bottomHeaderRowCount?-1:t-this.columnHeaderLevelCount}get bottomHeaderRowCount(){return this._table.isPivotChart()?this.bottomFrozenRowCount:0}get rightHeaderColCount(){return this._table.isPivotChart()?this.rightFrozenColCount:0}getBodyIndexByCol(t){return t<this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount||t>=this.colCount-this.rightHeaderColCount?-1:t-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getRecordShowIndexByCell(t,e){}getCellHeaderPathsWithTreeNode(t,e){for(let l=0;l<this._largeCellRangeCache.length;l++){const a=this._largeCellRangeCache[l];if(t>=a.start.col&&t<=a.end.col&&e>=a.start.row&&e<=a.end.row)break}let i=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!i&&e>=0&&r>=0&&(i=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,i)),!o&&t>=0&&s>=0){if(o=[],this.rowHierarchyType==="tree"){const l=this._rowHeaderCellFullPathIds[s];let a=this.rowDimensionTree,h=0;for(;a;){const d=[];let u=l[h];for(d.push(u);;){const g=this._headerObjectMap[u];if(!(g!=null&&g.parentCellId))break;d.unshift(g.parentCellId),u=g.parentCellId}const c=a.getTreePathByCellIds(d);o.push(...c),a=this._rowHeaderExtensionTree[l[h]],h++}}else o=this.rowDimensionTree.getTreePath(s,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0)-this.leftRowSeriesNumberColumnCount:this.rowDimensionTree.totalLevel);this.setRowHeaderPathCache(t,e,o)}return{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var i,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(i=r.colHeaderPaths)===null||i===void 0||i.forEach(l=>{var a,h,d;const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.colHeaderPaths.push(u)}),(o=r.rowHeaderPaths)===null||o===void 0||o.forEach(l=>{var a,h,d;if(l.dimensionKey!=="axis"){const u={};u.dimensionKey=l.dimensionKey,u.indicatorKey=l.indicatorKey,u.value=(d=(a=l.value)!==null&&a!==void 0?a:(h=this.getIndicatorInfoByIndicatorKey(l.indicatorKey))===null||h===void 0?void 0:h.title)!==null&&d!==void 0?d:"",u.virtual=l.virtual,s.rowHeaderPaths.push(u)}}),s}getIndicatorInfoByIndicatorKey(t){var e;return(e=this.indicatorsDefine)===null||e===void 0?void 0:e.find(i=>typeof i!="string"&&!!t&&i.indicatorKey===t)}findFullCellIds(t){const e=[];for(let i=0;i<t.length;i++){let o=t[i];for(e.push(o);;){const r=this._headerObjectMap[o];if(!(r!=null&&r.parentCellId))break;e.unshift(r.parentCellId),o=r.parentCellId}}return e}getHeaderDimension(t,e){var i,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(i=this.rowsDefine)===null||i===void 0?void 0:i.find(l=>typeof l!="string"&&l.dimensionKey===s.field))!==null&&o!==void 0?o:(r=this.columnsDefine)===null||r===void 0?void 0:r.find(l=>typeof l!="string"&&l.dimensionKey===s.field)}}isColumnIndicatorHeader(t,e){return this._indicatorShowType==="column"&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return this._indicatorShowType==="row"&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){var i,o,r,s,l,a;this.colIndex=0;const h=this._rowHeaderCellFullPathIds_FULL.slice(0),d=h.map((g,f)=>({col:t,row:f+this.columnHeaderLevelCount})),u=this.getHeader(t,e);if(u.define.hierarchyState=u.define.hierarchyState===Pt.collapse?Pt.expand:Pt.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellFullPathIds_FULL=[],this.rowDimensionKeys=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),this.fullRowDimensionKeys=[],this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(this.rowDimensionKeys),this._addHeadersForTreeMode(this._rowHeaderCellFullPathIds_FULL,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0,this.rowsDefine,this.rowHeaderObjs),this.rowHeaderTitle){const g=++this.sharedVar.seqId,f=Array(this.rowCount-this.columnHeaderLevelCount).fill(g);this._rowHeaderCellFullPathIds_FULL.unshift(f);const p={id:g,title:typeof this.rowHeaderTitle.title=="string"?this.rowHeaderTitle.title:this.rowsDefine.reduce((v,m)=>typeof m=="string"?v:v+(v?`/${m.title}`:`${m.title}`),""),field:void 0,headerType:(o=(i=this.rowHeaderTitle)===null||i===void 0?void 0:i.headerType)!==null&&o!==void 0?o:"text",style:(r=this.rowHeaderTitle)===null||r===void 0?void 0:r.headerStyle,define:{field:"",headerType:"text",cellType:"text",disableHeaderHover:!!(!((s=this.rowHeaderTitle)===null||s===void 0)&&s.disableHeaderHover),disableHeaderSelect:!!(!((l=this.rowHeaderTitle)===null||l===void 0)&&l.disableHeaderSelect)}};this.rowHeaderObjs.push(p),this._headerObjects[g]=p}this._rowHeaderCellFullPathIds_FULL=lg(this._rowHeaderCellFullPathIds_FULL),this.rowHierarchyType==="tree"&&((a=this.extensionRows)===null||a===void 0?void 0:a.length)>=1&&this.generateExtensionRowTree(),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((g,f)=>(g[f.id]=f,g),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0;const c=xz(t,e,h.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),this._rowHeaderCellFullPathIds_FULL.map(g=>g[t-this.leftRowSeriesNumberColumnCount]),d,this);return this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination),c}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){var e;if(!Array.isArray(t))return;let i,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!I(d.value))&&h===t.length-1){if(((e=this==null?void 0:this.cornerSetting)===null||e===void 0?void 0:e.titleOnDimension)==="row"){let g=0;return this.rowHierarchyType==="grid"&&(g=this.rowDimensionKeys.indexOf(d.dimensionKey)),g===-1?void 0:{col:(this.rowHeaderTitle?g+1:g)+this.leftRowSeriesNumberColumnCount,row:0}}const c=this.colDimensionKeys.indexOf(d.dimensionKey);return c===-1?void 0:{col:0+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderTitle?c+1:c}}let u=!1;for(let c=0;c<s.length;c++){const g=s[c];if((I(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||I(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){s=g.children,o=g,u=!0;break}}if(!u)for(let c=0;c<r.length;c++){const g=r[c];if((I(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||I(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,i=g;break}}}let l=0,a=0;if(i){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=i;return a+=h,l=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?d+1:d)+this.leftRowSeriesNumberColumnCount:0+this.leftRowSeriesNumberColumnCount,{col:l,row:a}}if(o){l=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:h,level:d}=o;return l+=h,a=this.columnHeaderTitle?d+1:d,{col:l,row:a}}}getPivotDimensionInfo(t,e){var i;const{colHeaderPaths:o,rowHeaderPaths:r}=this.getCellHeaderPaths(t,e),s=[];return o.length?o.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):r.length?r.forEach((l,a)=>{s.push({dimensionKey:l.dimensionKey,value:l.value,isPivotCorner:!1,indicatorKey:l.indicatorKey})}):this.isCornerHeader(t,e)&&(((i=this==null?void 0:this.cornerSetting)===null||i===void 0?void 0:i.titleOnDimension)==="row"?s.push({dimensionKey:this.rowDimensionKeys[(this.rowHeaderTitle?t-1:t)-this.leftRowSeriesNumberColumnCount],isPivotCorner:!0}):s.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),s}getIndicatorKey(t,e){var i;return(i=this.getBody(t,e))===null||i===void 0?void 0:i.indicatorKey}getParentCellId(t,e){if(e!==0)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}getRowHeaderCellAddressByCellId(t){let e,i;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(i=r,!0)),I(e)&&I(i))return{col:e,row:i+this.columnHeaderLevelCount}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row)||this.isCornerHeader(e.col,e.row)||t.col<0||t.row<0||e.col<0||e.row<0)return!1;this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1);const i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row);{const o=Be(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Be(this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths);if(o.pop(),r.pop(),o.length<=r.length){if(o.length===r.length)return!o.find((s,l)=>s.dimensionKey!==r[l].dimensionKey||s.value!==r[l].value);if(o.length>0){for(let s=0;s<o.length;s++)if(o[s].startInTotal!==r[s].startInTotal)return!1}return!0}}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let r;const s=this.getCellRange(e.col,i.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===i.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(i.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,o);h.unshift(r-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnHeaderCellFullPathIds[a],h)}const l=this._columnWidths.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return l.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columnWidths,l),this.columnDimensionTree.movePosition(this.getCellHeaderPathsWithTreeNode(t.col,t.row).colHeaderPaths.length-1,i.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount,s.start.col-this.rowHeaderLevelCount-this.leftRowSeriesNumberColumnCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:i.start.col,targetIndex:r,sourceSize:o,targetSize:s.end.col-s.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let o;const r=this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,s=this.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths,l=r[r.length-1],a=s[r.length-1],h=l.size;if(o=e.row>=t.row?a.startInTotal+a.size-h:a.startInTotal,o===i.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(i.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(i.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(i.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);c.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellIds_FULL,c);const g=this._rowHeaderCellFullPathIds_FULL.splice(i.start.row-this.columnHeaderLevelCount+this.currentPageStartIndex,h);return g.unshift(o,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds_FULL,g),this.rowDimensionTree.movePosition(r.length-1,i.start.row-this.columnHeaderLevelCount,o+(e.row>t.row?l.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,{sourceIndex:i.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,i,o,r,s,l;let a,h,d=!1,u=!1;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;a=t.filter(_=>this.colDimensionKeys.indexOf(_.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&_.indicatorKey),h=t.filter(_=>this.rowDimensionKeys.indexOf(_.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&_.indicatorKey)}else a=t.colHeaderPaths,h=t.rowHeaderPaths,(t==null?void 0:t.cellLocation)==="body"&&this._table.isPivotTable()&&(u=!0);if(!Array.isArray(a)&&!Array.isArray(h))return;if(a==null||a.sort((_,y)=>{var x,S;return this.colDimensionKeys.indexOf((x=_.dimensionKey)!==null&&x!==void 0?x:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((S=y.dimensionKey)!==null&&S!==void 0?S:this.indicatorDimensionKey)}),h==null||h.sort((_,y)=>{var x,S;return this.fullRowDimensionKeys.indexOf((x=_.dimensionKey)!==null&&x!==void 0?x:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((S=y.dimensionKey)!==null&&S!==void 0?S:this.indicatorDimensionKey)}),a==null||a.forEach(_=>{_.isPivotCorner&&(d=!0)}),h==null||h.forEach(_=>{_.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let _=0;_<this.rowDimensionKeys.length;_++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[_])return{col:_+this.leftRowSeriesNumberColumnCount,row:this.columnHeaderLevelCount-1}}else if(this.cornerSetting.titleOnDimension!=="all"||this.indicatorsAsCol||h.length!==0){if(this.cornerSetting.titleOnDimension==="row"||this.cornerSetting.titleOnDimension==="all"&&!this.indicatorsAsCol){for(let _=0;_<this.rowDimensionKeys.length;_++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[_])return{col:_+this.leftRowSeriesNumberColumnCount,row:0}}else for(let _=0;_<this.colDimensionKeys.length;_++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[_])return{col:0,row:_}}else for(let _=0;_<this.colDimensionKeys.length;_++)if(((i=a[0])===null||i===void 0?void 0:i.dimensionKey)===this.colDimensionKeys[_])return{col:this.rowHeaderLevelCount-1,row:_}}let c,g,f,p,v=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(v=!0);let m,b,w=this.rowTree,C=this.columnTree;if(a)for(let _=0;_<a.length;_++){const y=a[_];for(let x=0;x<C.length;x++){const S=C[x];if(!I(y.indicatorKey)&&S.dimensionKey===y.dimensionKey&&S.value===y.value||I(y.indicatorKey)&&S.indicatorKey===y.indicatorKey){C=S.children,v&&!C?b=S:v||(b=S);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const _=h[h.length-1],y=this.headerObjects.filter(S=>((S==null?void 0:S.field)===_.dimensionKey||(S==null?void 0:S.field)===_.indicatorKey)&&(S==null?void 0:S.title)===_.value).map(S=>S.id),x=this._rowHeaderCellIds.filter(S=>y.indexOf(S[S.length-1])>=0).find(S=>{const A=this.findFullCellIds(S);return A.length===h.length&&A.every(R=>{const T=this._headerObjectMap[R];return h.find(M=>M.dimensionKey===T.field&&M.value===T.title)})});g=this._rowHeaderCellIds.indexOf(x)+this.columnHeaderLevelCount}else for(let _=0;_<h.length;_++){const y=h[_];for(let x=0;x<w.length;x++){const S=w[x];if(!I(y.indicatorKey)&&S.dimensionKey===y.dimensionKey&&S.value===y.value||I(y.indicatorKey)&&S.indicatorKey===y.indicatorKey&&(!I(y.value)||S.value===y.value)){w=S.children,(!v||w&&!w.some(A=>A.dimensionKey==="axis"))&&v||(m=S);break}}}if(u||!v||(m||I(g))&&b){if(m||u){g=this.columnHeaderLevelCount;const{startInTotal:_,level:y}=(s=m)!==null&&s!==void 0?s:s1;g+=_??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?y+1:y)+this.leftRowSeriesNumberColumnCount:0}if(b||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:_,level:y}=(l=b)!==null&&l!==void 0?l:s1;c+=_??0,p=this.columnHeaderTitle?y+1:y}return I(c)||I(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,i){var o,r,s,l;const a=this.getCellHeaderPaths(t,e);let h;if(this.indicatorsAsCol){const d=(o=a.colHeaderPaths.find(u=>u.indicatorKey))===null||o===void 0?void 0:o.indicatorKey;h=(r=this._indicators)===null||r===void 0?void 0:r.find(u=>u.indicatorKey===d)}else{const d=(s=a.rowHeaderPaths.find(u=>u.indicatorKey))===null||s===void 0?void 0:s.indicatorKey;h=(l=this._indicators)===null||l===void 0?void 0:l.find(u=>u.indicatorKey===d)}typeof(h==null?void 0:h.chartSpec)!="function"&&h&&(h.chartInstance=i)}getChartInstance(t,e){var i,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(i=l.colHeaderPaths.find(d=>d.indicatorKey))===null||i===void 0?void 0:i.indicatorKey;a=(o=this._indicators)===null||o===void 0?void 0:o.find(d=>d.indicatorKey===h)}else{const h=(r=l.rowHeaderPaths.find(d=>d.indicatorKey))===null||r===void 0?void 0:r.indicatorKey;a=(s=this._indicators)===null||s===void 0?void 0:s.find(d=>d.indicatorKey===h)}return a==null?void 0:a.chartInstance}checkHasChart(){return s3(this)}getDimension(t,e){var i,o;return e==="column"?(i=this.columnsDefine)===null||i===void 0?void 0:i.find(r=>typeof r!="string"&&r.dimensionKey===t):e==="row"?(o=this.rowsDefine)===null||o===void 0?void 0:o.find(r=>typeof r!="string"&&r.dimensionKey===t):void 0}getAxisConfigInPivotChart(t,e){if((this.isFrozenColumn(t,e)||this.isRightFrozenColumn(t,e))&&qr(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&qr(t,e,"col",this))return St.getFunction("getAxisConfigInPivotChart")(t,e,this)}isEmpty(t,e){return!!this._table.isPivotChart()&&(!!this.isLeftBottomCorner(t,e)||!!this.isRightBottomCorner(t,e)||!!this.isRightTopCorner(t,e))}isAxisCell(t,e){return this._table.isPivotChart()?!!(this.indicatorKeys.length>=1&&af(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&qr(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&qr(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&qr(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&qr(t,e,"col",this))):!1}getChartAxes(t,e){if(i3(t,e,this)||this.isAxisCell(t,e))return o3(t,e,this)}getRawChartSpec(t,e){return QI(t,e,this)}getChartSpec(t,e){return n3(t,e,this)}isShareChartSpec(t,e){return t3(t,e,this)}getChartDataId(t,e){return r3(t,e,this)}isNoChartDataRenderNothing(t,e){return e3(t,e,this)}setPagination(t){var e,i,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&I((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&I((i=this.pagination)===null||i===void 0?void 0:i.currentPage)){this.indicatorsAsCol===!1&&(this.pagination.perPageCount=Math.ceil(this.pagination.perPageCount/this.indicatorKeys.length)*this.indicatorKeys.length);const{perPageCount:h,currentPage:d}=this.pagination;this.currentPageStartIndex=h*(d||0),this.currentPageEndIndex=this.currentPageStartIndex+h,this._rowHeaderCellIds=(o=this._rowHeaderCellIds_FULL)===null||o===void 0?void 0:o.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(r=this._rowHeaderCellFullPathIds_FULL)===null||r===void 0?void 0:r.slice(this.currentPageStartIndex,this.currentPageEndIndex)}else this.currentPageStartIndex=0,this.currentPageEndIndex=this._rowHeaderCellIds_FULL.length,this._rowHeaderCellIds=(s=this._rowHeaderCellIds_FULL)===null||s===void 0?void 0:s.slice(this.currentPageStartIndex,this.currentPageEndIndex),this._rowHeaderCellFullPathIds=(l=this._rowHeaderCellFullPathIds_FULL)===null||l===void 0?void 0:l.slice(this.currentPageStartIndex,this.currentPageEndIndex);this.pagination&&(this.pagination.totalCount=(a=this._rowHeaderCellIds_FULL)===null||a===void 0?void 0:a.length)}release(){var t;const e=this._table._getActiveChartInstance();e==null||e.release(),(t=this._indicators)===null||t===void 0||t.forEach(i=>{var o;(o=i.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var i,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(i=l.rowHeaderPaths)===null||i===void 0?void 0:i.length)!==null&&o!==void 0?o:0)>0?s=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.slice(0,l.rowHeaderPaths.length):l.colHeaderPaths&&l.colHeaderPaths.length>0&&(s=l.colHeaderPaths.slice(0,l.colHeaderPaths.length)),this.getHeadNodeByRowOrColDimensions(s,t,e)}getHeadNodeByRowOrColDimensions(t,e,i){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(I(i)&&I(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,i);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!I(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(I(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||I(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!I(d.value)||!I(g.value))){a=g.children,s=g,u=!0;break}}if(!u)for(let c=0;(o=c<(l==null?void 0:l.length))!==null&&o!==void 0&&o;c++){const g=l[c];if(I(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||I(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!I(d.value)||!I(g.value))){l=g.children,r=g;break}}}return r||s||void 0}clearCellRangeMap(){this._largeCellRangeCache.length=0,this._CellHeaderPathMap=new Map}getDimensionKeyInChartSpec(t,e){var i,o,r,s,l,a;let h;if(this.indicatorsAsCol===!1)for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(i=u.xField)!==null&&i!==void 0?i:(r=(o=u==null?void 0:u.series)===null||o===void 0?void 0:o[0])===null||r===void 0?void 0:r.xField,h))return h}else for(let d=0;d<this.indicatorsDefine.length;d++){const u=this.indicatorsDefine[d].chartSpec;if(u&&(h=(s=u.yField)!==null&&s!==void 0?s:(a=(l=u==null?void 0:u.series)===null||l===void 0?void 0:l[0])===null||a===void 0?void 0:a.yField,h))return h}return null}_generateChartState(){return{vtable_selected:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!!this._table._selectedDataItemsInChart.find(i=>{for(const o in i)if(typeof i[o]!="object"&&i[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(i=>typeof i.value=="object"||t[i.key]===i.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(i=>{for(const o in i)if(typeof i[o]!="object"&&i[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(i=>typeof i.value=="object"||t[i.key]===i.value):!1}}}}updateDataStateToChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const i=this._generateChartState();this._indicators.forEach(o=>{var r;const s=o.chartInstance;((r=o.chartSpec.select)===null||r===void 0?void 0:r.enable)!==!1&&s.updateState(i)}),t==null||t.updateState(i)}}updateDataStateToActiveChartInstance(t){var e;if(((e=t==null?void 0:t.getSpec().select)===null||e===void 0?void 0:e.enable)!==!1){t||(t=this._table._getActiveChartInstance());const i=this._generateChartState();t==null||t.updateState(i)}}getIndicatorKeyInChartSpec(t,e){const i=this.getRawChartSpec(t,e),o=[];if(i){if(i.series||i.xField||i.yField)return this.indicatorsAsCol===!1?i.series?i.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(i.yField):i.series?i.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(i.xField),o;if(i.valueField&&o.push(i.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,i,o,r,s;const l=this.getCellHeaderPaths(this.rowHeaderLevelCount,t).rowHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="yField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=l1((i=a==null?void 0:a.length)!==null&&i!==void 0?i:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=kt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[0]+d[2]}getOptimunWidthForChart(t){var e,i,o,r,s;const l=this.getCellHeaderPaths(t,this.columnHeaderLevelCount).colHeaderPaths;let a,h;for(const u in this.dataset.collectValuesBy)if(this.dataset.collectValuesBy[u].type==="xField"&&!this.dataset.collectValuesBy[u].range){a=(e=this.dataset.collectedValues[u])===null||e===void 0?void 0:e[l.map(c=>c.value).join(this.dataset.stringJoinChar)];break}if(this._chartItemBandSize)h=l1((i=a==null?void 0:a.length)!==null&&i!==void 0?i:0,this._chartItemBandSize,this._chartPaddingInner,this._chartPaddingOuter);else{const u=this._chartItemSpanSize||25;h=((o=a==null?void 0:a.length)!==null&&o!==void 0?o:0)*(u+u/3)}const d=kt((s=(r=this._chartPadding)!==null&&r!==void 0?r:this._table.theme.bodyStyle.padding)!==null&&s!==void 0?s:0);return h+d[1]+d[3]}get leftAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="left");return(t==null?void 0:t.visible)===!1?0:(this.indicatorsAsCol,1)}get topAxesCount(){if(!this._table.isPivotChart())return 0;const t=this._table.pivotChartAxes.find(e=>e.orient==="top");return(t==null?void 0:t.visible)===!1?0:this.indicatorsAsCol&&this.hasTwoIndicatorAxes?1:0}get rightAxesCount(){return this.rightFrozenColCount}get bottomAxesCount(){return this.bottomFrozenRowCount}getColKeysPath(t,e){const i=this.getCellHeaderPaths(t,e),o=[];return i.colHeaderPaths.length&&i.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const i=this.getCellHeaderPaths(t,e),o=[];return i.rowHeaderPaths.length&&i.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var i;return(i=this.indicatorsDefine)===null||i===void 0?void 0:i.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return ef(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return ef(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return Hd(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let i=Hd(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=Hd(o.rowTree,!0);i*=r}}),i}resetHeaderTree(){var t,e,i;this.colIndex=0,this._rowHeaderCellFullPathIds_FULL=[],this._columnHeaderCellFullPathIds=[],this._columnHeaderCellIds=[];const o=this.dataset;this.rowTree=o.rowHeaderTree,this.columnTree=o.colHeaderTree;const r=this.rowDimensionTree.tree.children;(t=this.rowTree)===null||t===void 0||t.forEach((s,l)=>{const a=r.find(h=>h.dimensionKey===s.dimensionKey&&h.value===s.value);a&&this._table._syncHierarchyState(a,s)}),this.columnDimensionTree=new ci((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new ci((i=this.rowTree)!==null&&i!==void 0?i:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=lg(this._rowHeaderCellFullPathIds_FULL),this._headerObjectMap=this._headerObjects.reduce((s,l)=>(s[l.id]=l,s),{}),this._CellHeaderPathMap=new Map,this._largeCellRangeCache.length=0,this.generateCellIdsConsiderHideHeader(),this.setPagination(this.pagination)}isSeriesNumberInHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount}isSeriesNumberInBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount||this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount}isSeriesNumber(t,e){return!!(I(t)&&I(e)&&(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount))}getSeriesNumberHeader(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e<this.headerLevelCount?Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle}):this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount&&e<this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}getSeriesNumberBody(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.leftRowSeriesNumberColumn[t]:this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e>=this.headerLevelCount?this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]:void 0}changeTreeNodeTitle(t,e,i){this.getHeadNode(t,e).value=i;const o=this.getCellId(t,e);this._headerObjectMap[o].title=i}changeCornerTitle(t,e,i){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=i}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(ln),e=this._columnHeaderCellIds.splice(t,1);this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length),this._columnHeaderCellIds.push(e[0])}else this._columnHeaderCellIds.splice(0,this._columnHeaderCellIds.length);if(this._rowHeaderCellIds_FULL=this._rowHeaderCellFullPathIds_FULL.slice(),!this.showRowHeader)if(this.indicatorsAsCol||this.hideIndicatorName)this._rowHeaderCellIds_FULL.forEach((t,e)=>{const i=t.slice();i.splice(0,i.length),this._rowHeaderCellIds_FULL[e]=i});else{const t=this.rowDimensionKeys.indexOf(ln);this._rowHeaderCellIds_FULL.forEach((e,i)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[i]=o})}if(this._rowHeaderCellIds=this._rowHeaderCellIds_FULL.slice(),this._cornerHeaderCellIds=this._cornerHeaderCellFullPathIds.slice(),this.rowHeaderLevelCount===0||this.columnHeaderLevelCount===0)this._cornerHeaderCellIds=[];else if(this.cornerSetting.titleOnDimension!=="row"||this.showRowHeader){if(this.cornerSetting.titleOnDimension==="column"&&!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(ln),e=this._cornerHeaderCellIds.splice(t,1);this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length),this._cornerHeaderCellIds.push(e[0])}else this._cornerHeaderCellIds.splice(0,this._cornerHeaderCellIds.length)}else if(this.indicatorsAsCol||this.hideIndicatorName)this._cornerHeaderCellIds.forEach((t,e)=>{const i=t.slice();i.splice(0,i.length),this._cornerHeaderCellIds[e]=i});else{const t=this.rowDimensionKeys.indexOf(ln);this._cornerHeaderCellIds.forEach((e,i)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[i]=o})}}enableUseGetBodyCache(){this._useGetBodyCache=!0,this._getBodyCache.clear()}disableUseGetBodyCache(){this._useGetBodyCache=!1,this._getBodyCache.clear()}enableUseHeaderPathCache(){this._useHeaderPathCache=!0,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}disableUseHeaderPathCache(){this._useHeaderPathCache=!1,this._colHeaderPathCache.clear(),this._rowHeaderPathCache.clear()}getBodyWidthCache(t,e){if(this._useGetBodyCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e))return this.indicatorsAsCol&&this._getBodyCache.has(t)?this._getBodyCache.get(t):!this.indicatorsAsCol&&this._getBodyCache.has(e)?this._getBodyCache.get(e):void 0}setBodyWidthCache(t,e,i){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,i):this._getBodyCache.set(e,i))}getColHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._colHeaderPathCache.has(t))return this._colHeaderPathCache.get(t)}setColHeaderPathCache(t,e,i){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,i)}getRowHeaderPathCache(t,e){if(this._useHeaderPathCache&&!this.isHeader(t,e)&&!this.isSeriesNumber(t,e)&&this._rowHeaderPathCache.has(e))return this._rowHeaderPathCache.get(e)}setRowHeaderPathCache(t,e,i){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,i)}}function l1(n,t,e,i){e===1&&(e=0);const o=Az(n,e,i),r=t/(1-e);return Math.ceil(o*r)}function Az(n,t,e){let i;return i=n===1?n+2*e:n-t+2*e,n?i>0?i:1:0}class gf{constructor(t,e){this.tree={},this.beforeChangedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.dataConfig=t,e&&(this.records=e,typeof window<"u"&&window.performance.now(),this.setRecords(e),typeof window<"u"&&window.performance.now())}changeDataConfig(t){this.dataConfig=t}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const i=this.records[t];this.processRecord(i)}}processRecord(t){var e;const i=[],o=[];for(let r=0,s=this.dataConfig.rows.length;r<s;r++){const l=this.dataConfig.rows[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&o.push(t[l])}for(let r=0,s=this.dataConfig.columns.length;r<s;r++){const l=this.dataConfig.columns[r];t[l]!==void 0&&l!==this.dataConfig.indicatorDimensionKey&&i.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?i.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=i.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),i.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),i.length===0&&o.length===0||(this.tree[l]||(this.tree[l]={}),s!==void 0&&(this.tree[l][a]={value:s,record:t},this.dataConfig.indicatorsAsCol?i.pop():o.pop()))})}getTreeNode(t=[],e=[],i,o=!0){var r,s,l,a;let h,d;if(typeof t=="string")h=t;else{let u=!1;t.map((c,g)=>{c===i&&(t.splice(g,1),u=!0)}),u&&t.push(i),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===i&&(e.splice(g,1),u=!0)}),u&&e.push(i),d=e.join(this.stringJoinChar)}return o?(l=(s=(r=this.tree)===null||r===void 0?void 0:r[h])===null||s===void 0?void 0:s[d])!==null&&l!==void 0?l:void 0:I((a=this.beforeChangedTree[h])===null||a===void 0?void 0:a[d])?{value:this.beforeChangedTree[h][d].value,record:this.beforeChangedTree[h][d].record}:void 0}changeTreeNodeValue(t=[],e=[],i,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let v=!1;t.map((m,b)=>{m===i&&(t.splice(b,1),v=!0)}),v&&t.push(i),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let v=!1;e.map((m,b)=>{m===i&&(e.splice(b,1),v=!0)}),v&&e.push(i),g=e.join(this.stringJoinChar)}const f=(s=(r=this.tree[c])===null||r===void 0?void 0:r[g])===null||s===void 0?void 0:s.value,p=Object.assign({},(a=(l=this.tree[c])===null||l===void 0?void 0:l[g])===null||a===void 0?void 0:a.record);!((d=(h=this.tree[c])===null||h===void 0?void 0:h[g])===null||d===void 0)&&d.record?(this.tree[c][g].record[i]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,i,o),value:o}),!((u=this.beforeChangedTree[c])===null||u===void 0)&&u[g]||(this.beforeChangedTree[c]={},this.beforeChangedTree[c][g]={record:void 0,value:void 0},this.beforeChangedTree[c][g].record=p,this.beforeChangedTree[c][g].value=f)}_buildRecord(t=[],e=[],i,o){const r={},s=this.dataConfig.rows,l=this.dataConfig.columns;return s.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=t[h])}),l.forEach((a,h)=>{a!==this.dataConfig.indicatorDimensionKey&&(r[a]=e[h])}),r[i]=o,this.records.push(r),r}addRecords(t){for(let e=0,i=t.length;e<i;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,i){let o=!1;for(let r=0;r<this.dataConfig.indicators.length;r++)this.dataConfig.indicators[r]===t&&(o=!0);if(!o){for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=i)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function a1(n,t){let e="";for(let i=0;i<n.length;i++)e+=n[i],i!==n.length-1&&(e+=t);return e}class h1{constructor(t,e,i,o,r,s,l,a,h,d,u,c,g){var f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht,gt,vt,W,O,Y;this.tree={},this.changedTree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.colKeys_normal=[],this.rowKeys_normal=[],this.rowOrder="key_a_to_z",this.colOrder="key_a_to_z",this.sorted=!1,this.indicatorStatistics=[],this.aggregators={},this.stringJoinChar=String.fromCharCode(0),this.rowsIsTotal=[],this.colsIsTotal=[],this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.registerAggregators(),this.dataConfig=t,this.filterRules=(f=this.dataConfig)===null||f===void 0?void 0:f.filterRules,this.rowHierarchyType=a??"grid",this.sortRules=(p=this.dataConfig)===null||p===void 0?void 0:p.sortRules,this.aggregationRules=(v=this.dataConfig)===null||v===void 0?void 0:v.aggregationRules,this.derivedFieldRules=(m=this.dataConfig)===null||m===void 0?void 0:m.derivedFieldRules,this.mappingRules=(b=this.dataConfig)===null||b===void 0?void 0:b.mappingRules,this.calculatedFieldRules=(w=this.dataConfig)===null||w===void 0?void 0:w.calculatedFieldRules,this.calculatedFiledKeys=(_=(C=this.calculatedFieldRules)===null||C===void 0?void 0:C.map($=>$.key))!==null&&_!==void 0?_:[],this.calculatedFieldDependIndicatorKeys=(x=(y=this.calculatedFieldRules)===null||y===void 0?void 0:y.reduce(($,Q)=>{for(let et=0;et<Q.dependIndicatorKeys.length;et++)$.indexOf(Q.dependIndicatorKeys[et])===-1&&$.push(Q.dependIndicatorKeys[et]);return $},[]))!==null&&x!==void 0?x:[],this.totals=(S=this.dataConfig)===null||S===void 0?void 0:S.totals,this.rows=e,this.columns=i,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let $=0;$<this.calculatedFieldDependIndicatorKeys.length;$++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[$])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[$]);if(this.indicatorsAsCol=s,this.indicators=r,this.customColTree=h,this.customRowTree=d,this.hasExtensionRowTree=c,this.parseCustomTreeToMatchRecords=g,this.parseCustomTreeToMatchRecords&&(this.customColTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customColTree,"col"),this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))),this.colGrandTotalLabel=(T=(R=(A=this.totals)===null||A===void 0?void 0:A.column)===null||R===void 0?void 0:R.grandTotalLabel)!==null&&T!==void 0?T:"总计",this.colSubTotalLabel=(k=(P=(M=this.totals)===null||M===void 0?void 0:M.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&k!==void 0?k:"小计",this.rowGrandTotalLabel=(E=(H=(B=this.totals)===null||B===void 0?void 0:B.row)===null||H===void 0?void 0:H.grandTotalLabel)!==null&&E!==void 0?E:"总计",this.rowSubTotalLabel=(z=(L=(F=this.totals)===null||F===void 0?void 0:F.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&z!==void 0?z:"小计",this.collectValuesBy=(D=this.dataConfig)===null||D===void 0?void 0:D.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((V=(N=this.rows)===null||N===void 0?void 0:N.length)!==null&&V!==void 0?V:0).fill(!1),this.colsIsTotal=new Array((U=(G=this.columns)===null||G===void 0?void 0:G.length)!==null&&U!==void 0?U:0).fill(!1),((Z=this.totals)===null||Z===void 0?void 0:Z.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let $=0,Q=(ht=(rt=(j=(q=this.totals)===null||q===void 0?void 0:q.row)===null||j===void 0?void 0:j.subTotalsDimensions)===null||rt===void 0?void 0:rt.length)!==null&&ht!==void 0?ht:0;$<Q;$++){const et=this.totals.row.subTotalsDimensions[$],ot=this.rows.indexOf(et);this.rowsIsTotal[ot]=!0}if(!((gt=this.totals)===null||gt===void 0)&>.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let $=0,Q=(Y=(O=(W=(vt=this.totals)===null||vt===void 0?void 0:vt.column)===null||W===void 0?void 0:W.subTotalsDimensions)===null||O===void 0?void 0:O.length)!==null&&Y!==void 0?Y:0;$<Q;$++){const et=this.totals.column.subTotalsDimensions[$],ot=this.columns.indexOf(et);this.colsIsTotal[ot]=!0}this.setRecords(l)}setRecords(t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C;this.records=t,this.collectedValues={},this.cacheCollectedValues={},this.totalRecordsTree={},this.tree={},this.colFlatKeys={},this.rowFlatKeys={},this.colKeys=[],this.rowKeys=[],this.rowsHasValue=[],this.columnsHasValue=[],t&&(this.records=t,typeof window<"u"&&window.performance.now(),this.processRecords(),this.processCollectedValuesWithSumBy(),this.generateCollectedValuesSortRule(),this.processCollectedValuesWithSortBy(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.totalStatistics(),typeof window<"u"&&window.performance.now(),this.rowKeys_normal=this.rowKeys.slice(),this.colKeys_normal=this.colKeys.slice(),typeof window<"u"&&window.performance.now(),this.sortKeys(),typeof window<"u"&&window.performance.now(),typeof window<"u"&&window.performance.now(),this.customRowTree?this.rowHeaderTree=this.customRowTree:this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((_,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((i=(e=this.totals)===null||e===void 0?void 0:e.row)===null||i===void 0?void 0:i.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((_,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u),this.customColTree?this.colHeaderTree=this.customColTree:this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((_,y)=>this.columnsHasValue[y]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(v=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&v!==void 0&&v,(w=(b=(m=this.totals)===null||m===void 0?void 0:m.column)===null||b===void 0?void 0:b.showSubTotalsOnLeft)!==null&&w!==void 0&&w),typeof window<"u"&&window.performance.now(),!((C=this.dataConfig)===null||C===void 0)&&C.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(Mt.RECORD,wC),this.registerAggregator(Mt.SUM,xC),this.registerAggregator(Mt.COUNT,AC),this.registerAggregator(Mt.MAX,TC),this.registerAggregator(Mt.MIN,MC),this.registerAggregator(Mt.AVG,RC),this.registerAggregator(Mt.NONE,SC),this.registerAggregator(Mt.RECALCULATE,eE)}processCollectedValuesWithSumBy(){var t,e,i,o,r,s;for(const l in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[l])===null||e===void 0)&&e.sumBy)for(const a in this.collectedValues[l]){let h;((i=this.collectValuesBy[l])===null||i===void 0?void 0:i.extendRange)==="sum"?(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>g+f.value(),0),h+=Math.round(h/20)):(h=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()>g?f.value():g,Number.MIN_SAFE_INTEGER),((o=this.collectValuesBy[l])===null||o===void 0?void 0:o.extendRange)==="max"?h+=Math.round(h/20):typeof((r=this.collectValuesBy[l])===null||r===void 0?void 0:r.extendRange)=="number"&&(h=Math.max(h,(s=this.collectValuesBy[l])===null||s===void 0?void 0:s.extendRange)));const d=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.value()<g?f.value():g,Number.MAX_SAFE_INTEGER);let u,c;this.needSplitPositiveAndNegative&&(u=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.positiveValue()>g?f.positiveValue():g,Number.MIN_SAFE_INTEGER),c=Object.values(this.collectedValues[l][a]).reduce((g,f)=>f.negativeValue()<g?f.negativeValue():g,Number.MAX_SAFE_INTEGER)),this.collectedValues[l][a]={},this.collectedValues[l][a].max=h,this.collectedValues[l][a].min=d,this.needSplitPositiveAndNegative&&(this.collectedValues[l][a].positiveMax=u,this.collectedValues[l][a].negativeMin=c)}}processCollectedValuesWithSortBy(){var t,e;const i=this;for(const o in this.collectedValues)if(!((e=(t=this.collectValuesBy)===null||t===void 0?void 0:t[o])===null||e===void 0)&&e.sortBy)for(const r in this.collectedValues[o])this.collectedValues[o][r]=this.collectedValues[o][r].sort((s,l)=>{var a,h,d,u;return((h=(a=i.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=i.collectValuesBy[o].sortBy)===null||d===void 0?void 0:d.indexOf(l))!==null&&u!==void 0?u:-1)})}generateCollectedValuesSortRule(){for(const t in this.collectedValues)if(this.collectValuesBy&&this.collectValuesBy[t]&&!this.collectValuesBy[t].sortBy){let e=[];for(const i in this.collectedValues[t])Array.isArray(this.collectedValues[t][i])&&(e.push(...this.collectedValues[t][i]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let i=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(i=!0),Array.isArray(this.records)){this.filteredRecords||(this.filteredRecords=[]);for(let o=0,r=this.records.length;o<r;o++){const s=this.records[o];i&&!this.filterRecord(s)||(this.filteredRecords.push(s),this.processRecord(s))}}else{this.filteredRecords||(this.filteredRecords={});for(const o in this.records)for(let r=0,s=this.records[o].length;r<s;r++){const l=this.records[o][r];i&&!this.filterRecord(l)||(this.filteredRecords[o]||(this.filteredRecords[o]=[]),this.filteredRecords[o].push(l),this.processRecord(l,o))}}this.rowFlatKeys={},this.colFlatKeys={}}filterRecord(t){var e,i;let o=!0;if(this.filterRules)for(let r=0;r<this.filterRules.length;r++){const s=this.filterRules[r];if(s.filterKey){const l=t[s.filterKey];if(((e=s.filteredValues)===null||e===void 0?void 0:e.indexOf(l))===-1){o=!1;break}}else if(!(!((i=s.filterFunc)===null||i===void 0)&&i.call(s,t))){o=!1;break}}return o}processRecord(t,e){var i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht,gt,vt,W,O,Y,$,Q,et,ot,K,at,tt,_t,yt,ut,xt,de,Re,Ge,Qe,$i;(i=this.derivedFieldRules)===null||i===void 0||i.forEach((pt,mt)=>{pt.fieldName&&pt.derivedFunc&&(t[pt.fieldName]=pt.derivedFunc(t))});for(const pt in this.collectValuesBy)if(I(t[pt])){this.collectedValues[pt]||(this.collectedValues[pt]={});const mt=this.collectValuesBy[pt].by.map(It=>t[It]).join(this.stringJoinChar);if(this.collectedValues[pt][mt]||(this.collectValuesBy[pt].sumBy?this.collectedValues[pt][mt]={}:this.collectValuesBy[pt].range?this.collectedValues[pt][mt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[pt][mt]=[]),this.collectValuesBy[pt].sumBy){const It=this.collectValuesBy[pt].sumBy.map(Vt=>t[Vt]).join(this.stringJoinChar);this.collectedValues[pt][mt][It]||(this.collectedValues[pt][mt][It]=new this.aggregators[Mt.SUM]({key:pt,dimension:pt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[pt][mt][It].push(t)}else if(this.collectValuesBy[pt].range){const It=this.collectedValues[pt][mt],Vt=Math.max(t[pt],It.max),se=Math.min(t[pt],It.min);isNaN(Vt)||(It.max=Vt,It.min=se)}else{const It=this.collectedValues[pt][mt];It.indexOf(t[pt])===-1&&It.push(t[pt])}}let si=!1;const ti=[],ue=[];if(!this.parseCustomTreeToMatchRecords||!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart||!(!((r=this.customRowTree)===null||r===void 0)&&r.length)||e||this.hasExtensionRowTree){const pt=[];ue.push({rowKey:pt,indicatorKey:e});for(let mt=0,It=this.rows.length;mt<It;mt++){const Vt=this.rows[mt];if(Vt in t)this.rowsHasValue[mt]=!0,pt.push(t[Vt]);else if(Vt!==ln){if(!((a=(l=(s=this.dataConfig)===null||s===void 0?void 0:s.totals)===null||l===void 0?void 0:l.row)===null||a===void 0)&&a.showGrandTotals&&mt===0&&!this.rows.find(se=>se in t)){pt.push(this.rowGrandTotalLabel),si=!0;break}if(!((u=(d=(h=this.dataConfig)===null||h===void 0?void 0:h.totals)===null||d===void 0?void 0:d.row)===null||u===void 0)&&u.subTotalsDimensions&&((f=(g=(c=this.dataConfig)===null||c===void 0?void 0:c.totals)===null||g===void 0?void 0:g.row)===null||f===void 0?void 0:f.subTotalsDimensions.indexOf(this.rows[mt-1]))>=0){this.rowHierarchyType==="grid"&&pt.push(this.rowSubTotalLabel),si=!0;break}}}}else{const pt=this.getFieldMatchRowDimensionPaths(t);if(pt.length>0)for(let mt=0,It=pt.length;mt<It;mt++){const Vt=pt[mt],se=[];let zt;for(let At=0,le=Vt.length;At<le;At++)I(Vt[At].indicatorKey)?zt=Vt[At].indicatorKey:se.push(Vt[At].value);ue.push({rowKey:se,indicatorKey:zt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((v=this.customColTree)===null||v===void 0)&&v.length)||e||this.hasExtensionRowTree){const pt=[];ti.push({colKey:pt,indicatorKey:e});for(let mt=0,It=this.columns.length;mt<It;mt++){const Vt=this.columns[mt];if(Vt in t)this.columnsHasValue[mt]=!0,pt.push(t[Vt]);else if(Vt!==ln){if(!((w=(b=(m=this.dataConfig)===null||m===void 0?void 0:m.totals)===null||b===void 0?void 0:b.column)===null||w===void 0)&&w.showGrandTotals&&mt===0&&!this.columns.find(se=>se in t)){pt.push(this.colGrandTotalLabel),si=!0;break}if(!((y=(_=(C=this.dataConfig)===null||C===void 0?void 0:C.totals)===null||_===void 0?void 0:_.column)===null||y===void 0)&&y.subTotalsDimensions&&((A=(S=(x=this.dataConfig)===null||x===void 0?void 0:x.totals)===null||S===void 0?void 0:S.column)===null||A===void 0?void 0:A.subTotalsDimensions.indexOf(this.columns[mt-1]))>=0){pt.push(this.colSubTotalLabel),si=!0;break}}}}else{const pt=this.getFieldMatchColDimensionPaths(t);if(pt.length>0)for(let mt=0,It=pt.length;mt<It;mt++){const Vt=pt[mt],se=[];let zt;for(let At=0,le=Vt.length;At<le;At++)I(Vt[At].indicatorKey)?zt=Vt[At].indicatorKey:se.push(Vt[At].value);ti.push({colKey:se,indicatorKey:zt})}}for(let pt=0;pt<ue.length;pt++){const mt=ue[pt].rowKey;let It;this.indicatorsAsCol||(It=ue[pt].indicatorKey);for(let Vt=0;Vt<ti.length;Vt++){const se=ti[Vt].colKey;this.indicatorsAsCol&&(It=ti[Vt].indicatorKey);const zt=mt.join(this.stringJoinChar),At=se.join(this.stringJoinChar);if(si){this.totalRecordsTree[zt]||(this.totalRecordsTree[zt]={}),this.totalRecordsTree[zt][At]||(this.totalRecordsTree[zt][At]=[]);const wt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Lt=0;Lt<wt.length;Lt++)if(this.calculatedFiledKeys.indexOf(wt[Lt])>=0){const ge=(R=this.calculatedFieldRules)===null||R===void 0?void 0:R.find(Yi=>Yi.key===wt[Lt]);!((M=(T=this.totalRecordsTree[zt])===null||T===void 0?void 0:T[At])===null||M===void 0)&&M[Lt]||(this.totalRecordsTree[zt][At][Lt]=new this.aggregators[Mt.RECALCULATE]({key:wt[Lt],dimension:wt[Lt],isRecord:!0,formatFun:(k=(P=this.indicators)===null||P===void 0?void 0:P.find(Yi=>typeof Yi!="string"&&Yi.indicatorKey===wt[Lt]))===null||k===void 0?void 0:k.format,calculateFun:ge==null?void 0:ge.calculateFun,dependAggregators:this.totalRecordsTree[zt][At],dependIndicatorKeys:ge==null?void 0:ge.dependIndicatorKeys})),wt[Lt]in t&&((H=(B=this.totalRecordsTree[zt])===null||B===void 0?void 0:B[At])===null||H===void 0||H[Lt].push(t))}else{const ge=this.getAggregatorRule(wt[Lt]);!((F=(E=this.totalRecordsTree[zt])===null||E===void 0?void 0:E[At])===null||F===void 0)&&F[Lt]||(this.totalRecordsTree[zt][At][Lt]=new this.aggregators[(L=ge==null?void 0:ge.aggregationType)!==null&&L!==void 0?L:Mt.SUM]({key:wt[Lt],dimension:(z=ge==null?void 0:ge.field)!==null&&z!==void 0?z:wt[Lt],formatFun:(D=ge==null?void 0:ge.formatFun)!==null&&D!==void 0?D:(V=(N=this.indicators)===null||N===void 0?void 0:N.find(Yi=>typeof Yi!="string"&&Yi.indicatorKey===wt[Lt]))===null||V===void 0?void 0:V.format})),wt[Lt]in t&&((U=(G=this.totalRecordsTree[zt])===null||G===void 0?void 0:G[At])===null||U===void 0||U[Lt].push(t))}return}mt.length!==0&&(this.rowFlatKeys[zt]||(this.rowKeys.push(mt),this.rowFlatKeys[zt]=1)),se.length!==0&&(this.colFlatKeys[At]||(this.colKeys.push(se),this.colFlatKeys[At]=1)),this.tree[zt]||(this.tree[zt]={}),!((Z=this.tree[zt])===null||Z===void 0)&&Z[At]||(this.tree[zt][At]=[]);const le=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let wt=0;wt<le.length;wt++)if(this.calculatedFiledKeys.indexOf(le[wt])>=0){const Lt=(q=this.calculatedFieldRules)===null||q===void 0?void 0:q.find(ge=>ge.key===le[wt]);!((rt=(j=this.tree[zt])===null||j===void 0?void 0:j[At])===null||rt===void 0)&&rt[wt]||(this.tree[zt][At][wt]=new this.aggregators[Mt.RECALCULATE]({key:le[wt],dimension:le[wt],isRecord:!0,formatFun:(gt=(ht=this.indicators)===null||ht===void 0?void 0:ht.find(ge=>typeof ge!="string"&&ge.indicatorKey===le[wt]))===null||gt===void 0?void 0:gt.format,calculateFun:Lt==null?void 0:Lt.calculateFun,dependAggregators:this.tree[zt][At],dependIndicatorKeys:Lt==null?void 0:Lt.dependIndicatorKeys})),(W=(vt=this.tree[zt])===null||vt===void 0?void 0:vt[At])===null||W===void 0||W[wt].push(t)}else{const Lt=this.getAggregatorRule(le[wt]);let ge=!1;It?e===It?le[wt]===It&&(ge=!0):le[wt]===It&&le[wt]in t&&(ge=!0):Lt!=null&&Lt.field?typeof(Lt==null?void 0:Lt.field)=="string"?(Lt==null?void 0:Lt.field)in t&&(ge=!0):Lt!=null&&Lt.field.find(Yi=>Yi in t)&&(ge=!0):le[wt]in t&&(ge=!0),!(!((Y=(O=this.tree[zt])===null||O===void 0?void 0:O[At])===null||Y===void 0)&&Y[wt])&&ge&&(this.tree[zt][At][wt]=new this.aggregators[($=Lt==null?void 0:Lt.aggregationType)!==null&&$!==void 0?$:Mt.SUM]({key:le[wt],dimension:(Q=Lt==null?void 0:Lt.field)!==null&&Q!==void 0?Q:le[wt],formatFun:(et=Lt==null?void 0:Lt.formatFun)!==null&&et!==void 0?et:(K=(ot=this.indicators)===null||ot===void 0?void 0:ot.find(Yi=>typeof Yi!="string"&&Yi.indicatorKey===le[wt]))===null||K===void 0?void 0:K.format})),ge&&((tt=(at=this.tree[zt])===null||at===void 0?void 0:at[At])===null||tt===void 0||tt[wt].push(t))}if(this.mappingRules)for(let wt=0;wt<this.indicatorKeys.length;wt++){if(!this.indicatorStatistics[wt]){const Lt=this.getAggregatorRule(this.indicatorKeys[wt]);this.indicatorStatistics[wt]={max:new this.aggregators[Mt.MAX]({key:this.indicatorKeys[wt],dimension:this.indicatorKeys[wt]}),min:new this.aggregators[Mt.MIN]({key:this.indicatorKeys[wt],dimension:this.indicatorKeys[wt]}),total:new this.aggregators[(_t=Lt==null?void 0:Lt.aggregationType)!==null&&_t!==void 0?_t:Mt.SUM]({key:this.indicatorKeys[wt],dimension:(yt=Lt==null?void 0:Lt.field)!==null&&yt!==void 0?yt:this.indicatorKeys[wt],formatFun:(ut=Lt==null?void 0:Lt.formatFun)!==null&&ut!==void 0?ut:(de=(xt=this.indicators)===null||xt===void 0?void 0:xt.find(ge=>typeof ge!="string"&&ge.indicatorKey===this.indicatorKeys[wt]))===null||de===void 0?void 0:de.format})}}this.indicatorStatistics[wt].max.push((Ge=(Re=this.tree[zt])===null||Re===void 0?void 0:Re[At])===null||Ge===void 0?void 0:Ge[wt].value()),this.indicatorStatistics[wt].min.push(($i=(Qe=this.tree[zt])===null||Qe===void 0?void 0:Qe[At])===null||$i===void 0?void 0:$i[wt].value()),this.indicatorStatistics[wt].total.push(t)}}}}updateSortRules(t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((C,_)=>this.rowsHasValue[_]),this.indicatorsAsCol?void 0:this.indicators,((i=(e=this.totals)===null||e===void 0?void 0:e.row)===null||i===void 0?void 0:i.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((C,_)=>this.rowsHasValue[_]),this.indicatorsAsCol?void 0:this.indicators,this.rowsIsTotal,((r=(o=this.totals)===null||o===void 0?void 0:o.row)===null||r===void 0?void 0:r.showGrandTotals)||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel,this.rowSubTotalLabel,(a=(l=(s=this.totals)===null||s===void 0?void 0:s.row)===null||l===void 0?void 0:l.showGrandTotalsOnTop)!==null&&a!==void 0&&a,(u=(d=(h=this.totals)===null||h===void 0?void 0:h.row)===null||d===void 0?void 0:d.showSubTotalsOnTop)!==null&&u!==void 0&&u)),this.customColTree||(this.colHeaderTree=this.ArrToTree(this.colKeys,this.columns.filter((C,_)=>this.columnsHasValue[_]),this.indicatorsAsCol?this.indicators:void 0,this.colsIsTotal,((g=(c=this.totals)===null||c===void 0?void 0:c.column)===null||g===void 0?void 0:g.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0,this.colGrandTotalLabel,this.colSubTotalLabel,(v=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&v!==void 0&&v,(w=(b=(m=this.totals)===null||m===void 0?void 0:m.column)===null||b===void 0?void 0:b.showSubTotalsOnLeft)!==null&&w!==void 0&&w))}updateFilterRules(t,e=!1){var i,o;if(this.filterRules=t,this.filteredRecords=void 0,e)this.tree={};else for(const r in this.tree)for(const s in this.tree[r])for(let l=0;l<this.tree[r][s].length;l++)(i=this.tree[r][s][l])===null||i===void 0||i.reset();this.collectedValues={},this.processRecords(),this.processCollectedValuesWithSumBy(),this.processCollectedValuesWithSortBy(),this.totalStatistics(),!((o=this.dataConfig)===null||o===void 0)&&o.isPivotChart&&this.cacheDeminsionCollectedValues()}getAggregatorRule(t){var e;return(e=this.aggregationRules)===null||e===void 0?void 0:e.find((i,o)=>t===i.indicatorKey)}getAggregator(t=[],e=[],i,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(i);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==i||I(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=a1(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==i||I(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=a1(e,this.stringJoinChar));const g=(l=(s=this.tree[u])===null||s===void 0?void 0:s[c])===null||l===void 0?void 0:l[d];if(o&&I((h=(a=this.changedTree[u])===null||a===void 0?void 0:a[c])===null||h===void 0?void 0:h[d])){const f=this.changedTree[u][c][d];return g?{value:()=>f,formatValue:g.formatValue,formatFun:g.formatFun,records:g.records,className:"",recalculate(){},push(){},deleteRecord(){},updateRecord(){},clearCacheValue(){},reset(){}}:{value:()=>f,className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},formatValue:()=>f,clearCacheValue(){},reset(){}}}return g||{className:"",push(){},deleteRecord(){},updateRecord(){},recalculate(){},value:()=>null,clearCacheValue(){},reset(){}}}sortKeys(){if(this.colKeys=this.colKeys_normal.slice(),this.rowKeys=this.rowKeys_normal.slice(),!this.sorted){this.sorted=!0,this.rowKeys.sort(this.arrSort(this.rows,!0));const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}arrSort(t,e){let i;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(i=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===i&&l.push({field:i,fieldIndex:a,sortRule:o.sortRules[d],func:o.getSort(o.sortRules[d],e)});return l}.call(this);return function(s,l){var a,h,d,u;let c,g;for(let f=0;f<r.length;f++){if(g=r[f],(a=g.sortRule)===null||a===void 0?void 0:a.sortByIndicator){let p=s,v=l;g.fieldIndex<t.length-1&&(p=s.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?p.push(o.rowSubTotalLabel):e||p.push(o.colSubTotalLabel),v=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?v.push(o.rowSubTotalLabel):e||v.push(o.colSubTotalLabel)),c=g.func(p,v,(h=g.sortRule)===null||h===void 0?void 0:h.sortType)}else c=(d=g.func)===null||d===void 0?void 0:d.call(g,s[g.fieldIndex],l[g.fieldIndex],(u=g.sortRule)===null||u===void 0?void 0:u.sortType);if(c!==0)return c}return 0}}getSort(t,e){const i=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return i.rowHierarchyType==="grid"&&a.length<i.rows.length&&a[a.length-1]!==i.rowSubTotalLabel&&a[a.length-1]!==i.rowGrandTotalLabel&&a.push(i.rowSubTotalLabel),h.length<i.columns.length&&h[h.length-1]!==i.colSubTotalLabel&&h[h.length-1]!==i.colGrandTotalLabel&&h.push(i.colSubTotalLabel),i.getAggregator(a,h,t.sortByIndicator).value()};return e?Fh(l(o,t.query),l(r,t.query),s):Fh(l(t.query,o),l(t.query,r),s)}:t.sortBy?nE(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?iE:Fh}totalStatistics(){var t,e,i,o,r,s,l,a,h,d,u,c,g,f;const p=this,v=(m,b)=>{var w,C,_,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht,gt,vt,W,O,Y,$,Q,et,ot,K,at,tt,_t,yt,ut,xt,de,Re,Ge,Qe,$i,si;if(!((C=(w=this.totalRecordsTree)===null||w===void 0?void 0:w[m])===null||C===void 0)&&C[b])return this.tree[m]||(this.tree[m]={}),void(this.tree[m][b]=(y=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[m])===null||y===void 0?void 0:y[b]);const ti=b.split(this.stringJoinChar);if(!((S=(x=p.totals)===null||x===void 0?void 0:x.column)===null||S===void 0)&&S.subTotalsDimensions&&((T=(R=(A=p.totals)===null||A===void 0?void 0:A.column)===null||R===void 0?void 0:R.subTotalsDimensions)===null||T===void 0?void 0:T.length)>0&&p.totals.column.showSubTotals!==!1)for(let ue=0,pt=(k=(P=(M=p.totals)===null||M===void 0?void 0:M.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||k===void 0?void 0:k.length;ue<pt;ue++){const mt=p.totals.column.subTotalsDimensions[ue],It=p.columns.indexOf(mt);if(It>=0){const Vt=ti.slice(0,It+1);Vt.push(p.colSubTotalLabel);const se=Vt.join(this.stringJoinChar);if(!((H=(B=this.totalRecordsTree)===null||B===void 0?void 0:B[m])===null||H===void 0)&&H[se])return void(this.tree[m][se]=(F=(E=this.totalRecordsTree)===null||E===void 0?void 0:E[m])===null||F===void 0?void 0:F[se]);this.tree[m][se]||(this.tree[m][se]=[]);const zt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let At=0;At<zt.length;At++)if(this.calculatedFiledKeys.indexOf(zt[At])>=0){const le=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(wt=>wt.key===zt[At]);!((D=(z=this.tree[m])===null||z===void 0?void 0:z[se])===null||D===void 0)&&D[At]||(this.tree[m][se][At]=new this.aggregators[Mt.RECALCULATE]({key:zt[At],dimension:zt[At],isRecord:!0,formatFun:(V=(N=this.indicators)===null||N===void 0?void 0:N.find(wt=>typeof wt!="string"&&wt.indicatorKey===zt[At]))===null||V===void 0?void 0:V.format,calculateFun:le==null?void 0:le.calculateFun,dependAggregators:this.tree[m][se],dependIndicatorKeys:le==null?void 0:le.dependIndicatorKeys})),se!==b&&this.tree[m][se][At].push((U=(G=p.tree[m])===null||G===void 0?void 0:G[b])===null||U===void 0?void 0:U[At])}else{if(!this.tree[m][se][At]){const le=this.getAggregatorRule(zt[At]);this.tree[m][se][At]=new this.aggregators[(Z=le==null?void 0:le.aggregationType)!==null&&Z!==void 0?Z:Mt.SUM]({key:zt[At],dimension:(q=le==null?void 0:le.field)!==null&&q!==void 0?q:zt[At],formatFun:(j=le==null?void 0:le.formatFun)!==null&&j!==void 0?j:(ht=(rt=this.indicators)===null||rt===void 0?void 0:rt.find(wt=>typeof wt!="string"&&wt.indicatorKey===zt[At]))===null||ht===void 0?void 0:ht.format})}se!==b&&this.tree[m][se][At].push((vt=(gt=p.tree[m])===null||gt===void 0?void 0:gt[b])===null||vt===void 0?void 0:vt[At])}}}if(!((O=(W=p.totals)===null||W===void 0?void 0:W.column)===null||O===void 0)&&O.showGrandTotals||this.rows.length===0){const ue=p.colGrandTotalLabel;if(!(($=(Y=this.totalRecordsTree)===null||Y===void 0?void 0:Y[m])===null||$===void 0)&&$[ue])return void(this.tree[m][ue]=(et=(Q=this.totalRecordsTree)===null||Q===void 0?void 0:Q[m])===null||et===void 0?void 0:et[ue]);this.tree[m][ue]||(this.tree[m][ue]=[]);const pt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let mt=0;mt<pt.length;mt++)if(this.calculatedFiledKeys.indexOf(pt[mt])>=0){const It=(ot=this.calculatedFieldRules)===null||ot===void 0?void 0:ot.find(Vt=>Vt.key===pt[mt]);!((at=(K=this.tree[m])===null||K===void 0?void 0:K[ue])===null||at===void 0)&&at[mt]||(this.tree[m][ue][mt]=new this.aggregators[Mt.RECALCULATE]({key:pt[mt],dimension:pt[mt],isRecord:!0,formatFun:(_t=(tt=this.indicators)===null||tt===void 0?void 0:tt.find(Vt=>typeof Vt!="string"&&Vt.indicatorKey===pt[mt]))===null||_t===void 0?void 0:_t.format,calculateFun:It==null?void 0:It.calculateFun,dependAggregators:this.tree[m][ue],dependIndicatorKeys:It==null?void 0:It.dependIndicatorKeys})),ue!==b&&this.tree[m][ue][mt].push((ut=(yt=p.tree[m])===null||yt===void 0?void 0:yt[b])===null||ut===void 0?void 0:ut[mt])}else{if(!this.tree[m][ue][mt]){const It=this.getAggregatorRule(pt[mt]);this.tree[m][ue][mt]=new this.aggregators[(xt=It==null?void 0:It.aggregationType)!==null&&xt!==void 0?xt:Mt.SUM]({key:pt[mt],dimension:(de=It==null?void 0:It.field)!==null&&de!==void 0?de:pt[mt],formatFun:(Re=It==null?void 0:It.formatFun)!==null&&Re!==void 0?Re:(Qe=(Ge=this.indicators)===null||Ge===void 0?void 0:Ge.find(Vt=>typeof Vt!="string"&&Vt.indicatorKey===pt[mt]))===null||Qe===void 0?void 0:Qe.format})}ue!==b&&this.tree[m][ue][mt].push((si=($i=p.tree[m])===null||$i===void 0?void 0:$i[b])===null||si===void 0?void 0:si[mt])}}};if(!((e=(t=p==null?void 0:p.totals)===null||t===void 0?void 0:t.column)===null||e===void 0)&&e.subTotalsDimensions&&((r=(o=(i=p==null?void 0:p.totals)===null||i===void 0?void 0:i.column)===null||o===void 0?void 0:o.subTotalsDimensions)===null||r===void 0?void 0:r.length)>=1||!((l=(s=p==null?void 0:p.totals)===null||s===void 0?void 0:s.row)===null||l===void 0)&&l.subTotalsDimensions&&((d=(h=(a=p==null?void 0:p.totals)===null||a===void 0?void 0:a.row)===null||h===void 0?void 0:h.subTotalsDimensions)===null||d===void 0?void 0:d.length)>=1||!((c=(u=p==null?void 0:p.totals)===null||u===void 0?void 0:u.column)===null||c===void 0)&&c.showGrandTotals||!((f=(g=p==null?void 0:p.totals)===null||g===void 0?void 0:g.row)===null||f===void 0)&&f.showGrandTotals){const m=[];Object.keys(p.tree).forEach(b=>{const w=b.split(this.stringJoinChar);Object.keys(p.tree[b]).forEach(C=>{var _,y,x,S,A,R,T,M,P,k,B,H,E,F,L,z,D,N,V,G,U,Z,q,j,rt,ht,gt,vt,W,O;if(!((y=(_=p.totals)===null||_===void 0?void 0:_.row)===null||y===void 0)&&y.subTotalsDimensions&&((A=(S=(x=p.totals)===null||x===void 0?void 0:x.row)===null||S===void 0?void 0:S.subTotalsDimensions)===null||A===void 0?void 0:A.length)>0&&p.totals.row.showSubTotals!==!1)for(let Y=0,$=(M=(T=(R=p.totals)===null||R===void 0?void 0:R.row)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length;Y<$;Y++){const Q=p.totals.row.subTotalsDimensions[Y],et=p.rows.indexOf(Q);if(et>=0&&et<p.rows.length-1){const ot=w.slice(0,et+1);this.rowHierarchyType==="grid"&&ot.push(p.rowSubTotalLabel);const K=ot.join(this.stringJoinChar);this.tree[K]||(this.tree[K]={},m.push(K)),this.tree[K][C]||(this.tree[K][C]=[]);const at=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let tt=0;tt<at.length;tt++){if(!this.tree[K][C][tt])if(this.calculatedFiledKeys.indexOf(at[tt])>=0){const _t=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(yt=>yt.key===at[tt]);this.tree[K][C][tt]=new this.aggregators[Mt.RECALCULATE]({key:at[tt],dimension:at[tt],isRecord:!0,formatFun:(B=(k=this.indicators)===null||k===void 0?void 0:k.find(yt=>typeof yt!="string"&&yt.indicatorKey===at[tt]))===null||B===void 0?void 0:B.format,calculateFun:_t==null?void 0:_t.calculateFun,dependAggregators:this.tree[K][C],dependIndicatorKeys:_t==null?void 0:_t.dependIndicatorKeys})}else{const _t=this.getAggregatorRule(at[tt]);this.tree[K][C][tt]=new this.aggregators[(H=_t==null?void 0:_t.aggregationType)!==null&&H!==void 0?H:Mt.SUM]({key:at[tt],dimension:(E=_t==null?void 0:_t.field)!==null&&E!==void 0?E:at[tt],formatFun:(F=_t==null?void 0:_t.formatFun)!==null&&F!==void 0?F:(z=(L=this.indicators)===null||L===void 0?void 0:L.find(yt=>typeof yt!="string"&&yt.indicatorKey===at[tt]))===null||z===void 0?void 0:z.format})}K!==b&&this.tree[K][C][tt].push((N=(D=p.tree[b])===null||D===void 0?void 0:D[C])===null||N===void 0?void 0:N[tt])}}}if(!((G=(V=p.totals)===null||V===void 0?void 0:V.row)===null||G===void 0)&&G.showGrandTotals||this.columns.length===0){const Y=p.rowGrandTotalLabel;this.tree[Y]||(this.tree[Y]={},m.push(Y)),this.tree[Y][C]||(this.tree[Y][C]=[]);const $=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Q=0;Q<$.length;Q++){if(!this.tree[Y][C][Q])if(this.calculatedFiledKeys.indexOf($[Q])>=0){const et=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ot=>ot.key===$[Q]);this.tree[Y][C][Q]=new this.aggregators[Mt.RECALCULATE]({key:$[Q],dimension:$[Q],isRecord:!0,formatFun:(q=(Z=this.indicators)===null||Z===void 0?void 0:Z.find(ot=>typeof ot!="string"&&ot.indicatorKey===$[Q]))===null||q===void 0?void 0:q.format,calculateFun:et==null?void 0:et.calculateFun,dependAggregators:this.tree[Y][C],dependIndicatorKeys:et==null?void 0:et.dependIndicatorKeys})}else{const et=this.getAggregatorRule($[Q]);this.tree[Y][C][Q]=new this.aggregators[(j=et==null?void 0:et.aggregationType)!==null&&j!==void 0?j:Mt.SUM]({key:$[Q],dimension:(rt=et==null?void 0:et.field)!==null&&rt!==void 0?rt:$[Q],formatFun:(ht=et==null?void 0:et.formatFun)!==null&&ht!==void 0?ht:(vt=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ot=>typeof ot!="string"&&ot.indicatorKey===$[Q]))===null||vt===void 0?void 0:vt.format})}Y!==b&&this.tree[Y][C][Q].push((O=(W=p.tree[b])===null||W===void 0?void 0:W[C])===null||O===void 0?void 0:O[Q])}}v(b,C)})}),m.forEach(b=>{Object.keys(p.tree[b]).forEach(w=>{v(b,w)})})}for(const m in p.totalRecordsTree)for(const b in p.totalRecordsTree[m])v(m,b)}ArrToTree1(t,e,i,o,r){const s=[],l=this.stringJoinChar,a=new Map;function h(d){const u=[];let c;d.forEach((g,f)=>{var p;u.push(g);const v=u.join(l);let m=a.get(v);m||(m={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=i==null?void 0:i.length)!==null&&p!==void 0?p:0)>=1?i==null?void 0:i.map(b=>typeof b=="string"?{indicatorKey:b,value:b}:{indicatorKey:b.indicatorKey,value:b.title}):[]},a.set(v,m),c?c.children.push(m):s.push(m)),c=m})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,i,o,r,s,l,a,h){var d;let u=[];const c=this.stringJoinChar,g=new Map;if(t!=null&&t.length?t.forEach(f=>function(p){const v=[];let m;p.forEach((b,w)=>{var C,_,y,x;v.push(b);const S=v.join(c);let A=g.get(S);if(!A){if(A={value:b,dimensionKey:e[w],children:w===p.length-1&&((C=i==null?void 0:i.length)!==null&&C!==void 0?C:0)>=1?i==null?void 0:i.map(R=>typeof R=="string"?{indicatorKey:R,value:R}:{indicatorKey:R.indicatorKey,value:R.title}):[]},o[w]){let R=(_=A.children)!==null&&_!==void 0?_:[];const T={value:l,dimensionKey:e[w+1],levelSpan:o.length-w-1,children:((y=i==null?void 0:i.length)!==null&&y!==void 0?y:0)>=1?i==null?void 0:i.map(M=>typeof M=="string"?{indicatorKey:M,value:M}:{indicatorKey:M.indicatorKey,value:M.title}):[]};R.push(T),R=(x=T.children)!==null&&x!==void 0?x:[]}g.set(S,A),m?o[w-1]&&!h?m.children.splice(m.children.length-1,0,A):m.children.push(A):u.push(A)}m=A})}(f)):i&&(u=i==null?void 0:i.map(f=>{var p;return typeof f=="string"?{indicatorKey:f,value:f}:{indicatorKey:f.indicatorKey,value:(p=f.title)!==null&&p!==void 0?p:f.indicatorKey}})),r&&(t==null?void 0:t.length)){const f={value:s,dimensionKey:e[0],levelSpan:o.length,children:(d=i==null?void 0:i.map(p=>typeof p=="string"?{indicatorKey:p,value:p}:{indicatorKey:p.indicatorKey,value:p.title}))!==null&&d!==void 0?d:[]};a?u.unshift(f):u.push(f)}return u}cacheDeminsionCollectedValues(){for(const t in this.collectValuesBy)this.collectValuesBy[t].type!=="xField"&&this.collectValuesBy[t].type!=="yField"||(this.dataConfig.dimensionSortArray?this.cacheCollectedValues[t]=Rz(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],i,o){var r,s,l;const a=this.indicatorKeys.indexOf(i);let h,d;h=typeof t=="string"?t:t.join(this.stringJoinChar),d=typeof e=="string"?e:e.join(this.stringJoinChar),!((r=this.changedTree[h])===null||r===void 0)&&r[d]?this.changedTree[h][d][a]=o:this.changedTree[h]?(this.changedTree[h][d]=[],this.changedTree[h][d][a]=o):(this.changedTree[h]={},this.changedTree[h][d]=[],this.changedTree[h][d][a]=o);const u=(l=(s=this.tree[h])===null||s===void 0?void 0:s[d])===null||l===void 0?void 0:l[a];(u==null?void 0:u.records.length)===1&&(u.records[0][this.indicatorKeys[a]]=o)}changeRecordFieldValue(t,e,i){let o=!1;for(let r=0;r<this.indicatorKeys.length;r++)this.indicatorKeys[r]===t&&(o=!0);if(!o){if(Array.isArray(this.records))for(let r=0,s=this.records.length;r<s;r++){const l=this.records[r];l[t]===e&&(l[t]=i)}else for(const r in this.records)for(let s=0,l=this.records[r].length;s<l;s++){const a=this.records[r][s];a[t]===e&&(a[t]=i)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}_rowTreeHasChanged(){this.hasExtensionRowTree||(this.customRowTreeDimensionPaths=this.customTreeToDimensionPathArr(this.customRowTree,"row"))}changeDataConfig(t){this.rows=t.rows,this.columns=t.columns}addRecords(t){for(let e=0,i=t.length;e<i;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const i=[],o=this;function r(s,l){var a,h,d;s.virtual||(!((a=l[l.length-1])===null||a===void 0)&&a.childKeys&&s.dimensionKey&&l[l.length-1].childKeys.indexOf(s.dimensionKey)===-1&&s.dimensionKey!==l[l.length-1].dimensionKey&&l[l.length-1].childKeys.push(s.dimensionKey),l.push({dimensionKey:I(s.indicatorKey)?void 0:s.dimensionKey,value:s.value,indicatorKey:s.indicatorKey,virtual:s.virtual})),((h=s.children)===null||h===void 0?void 0:h.length)>0?(o.rowHierarchyType==="tree"&&e==="row"&&(l[l.length-1].childKeys=[],i.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):i.push(l)}return t==null||t.forEach(s=>r(s,[])),i}getFieldMatchColDimensionPaths(t){var e,i;const o=[];for(let r=0;(i=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&i!==void 0&&i;r++){const s=this.customColTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}}l&&o.push(s)}return o}getFieldMatchRowDimensionPaths(t){var e,i;const o=[];for(let r=0;(i=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&i!==void 0&&i;r++){const s=this.customRowTreeDimensionPaths[r];let l=!0;for(let a=0;a<s.length;a++){const h=s[a];if(h.dimensionKey&&t[h.dimensionKey]!==h.value||h.indicatorKey&&t[h.indicatorKey]===void 0){l=!1;break}if(h.childKeys&&a===s.length-1&&h.childKeys.length>0&&h.childKeys.find(d=>I(t[d]))){l=!1;break}}l&&(this.indicatorsAsCol||this.rowHierarchyType!=="tree"||s.find(a=>a.indicatorKey)||(l=!1)),l&&o.push(s)}return o}}function Rz(n,t){return n.sort((e,i)=>{const o=t.indexOf(e),r=t.indexOf(i);return o<r?-1:o>r?1:0})}let Tz=class extends VI{constructor(t,e){var i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b;if(Wt.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},e){e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Be(e.columns),this.internalProps.rows=Be(e.rows),this.internalProps.indicators=Ld(e.indicators),(i=e.indicators)===null||i===void 0||i.forEach((C,_)=>{typeof C=="object"&&(C!=null&&C.editor)&&(this.internalProps.indicators[_].editor=C.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Be(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Be(e.rowTree):[],this.internalProps.records=e.records,this.pagination=e.pagination,this.internalProps.columnResizeType=(s=e.columnResizeType)!==null&&s!==void 0?s:"column",this.internalProps.rowResizeType=(l=e.rowResizeType)!==null&&l!==void 0?l:"row",this.internalProps.dataConfig=Be(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const w=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=w==null?void 0:w[0])===null||a===void 0?void 0:a.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((h=e.customConfig)===null||h===void 0?void 0:h.enableDataAnalysis)===!1){const C=new ci((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),_=new ci((u=this.internalProps.rowTree)!==null&&u!==void 0?u:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(c=this.options.rowExpandLevel)!==null&&c!==void 0?c:1:void 0);this.internalProps.layoutMap=new Rl(this,null,C,_),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new gf({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey},w))}else{const C=Ly(this,e),{rowKeys:_,columnKeys:y,indicatorKeys:x}=C;let{columnDimensionTree:S,rowDimensionTree:A}=C;this.dataset=new h1(this.internalProps.dataConfig,_,y,x,this.internalProps.indicators,(g=e.indicatorsAsCol)===null||g===void 0||g,e.records,e.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!e.extensionRows,!!e.parseCustomTreeToMatchRecords),e.columnTree||(e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=$r(this.dataset.colHeaderTree,e.indicators)),S=new ci((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=$r(this.dataset.rowHeaderTree,e.indicators)),A=new ci((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(v=this.options.rowExpandLevel)!==null&&v!==void 0?v:1:void 0)),this.internalProps.layoutMap=new Rl(this,this.dataset,S,A)}if(this._changePivotSortStateBySortRules(),((b=(m=e.pivotSortState)===null||m===void 0?void 0:m.length)!==null&&b!==void 0?b:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),Wt.mode!=="node"&&(this.editorManager=new l3(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(w),this.scenegraph.createSceneGraph(),e.title){const C=St.getComponent("title");this.internalProps.title=new C(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const C=St.getComponent("emptyTip");this.internalProps.emptyTip=new C(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(J.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return po}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!1}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i){if(this.internalProps.layoutMap.isSeriesNumber(t,e)&&this.internalProps.rowSeriesNumber.disableColumnResize===!0)return!1;if(!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}}return i}updateOption(t){var e,i,o,r,s,l,a,h,d,u,c,g,f,p,v,m,b,w;const C=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Be(t.columns),this.internalProps.rows=Be(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?Ld(t.indicators):[],(i=t.indicators)===null||i===void 0||i.forEach((y,x)=>{typeof y=="object"&&(y!=null&&y.editor)&&(this.internalProps.indicators[x].editor=y.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Be(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Be(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.stateManager.initCheckedState(this.internalProps.records),this.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1),this.pagination=t.pagination,C.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",C.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",C.dataConfig=Be(t.dataConfig),this.internalProps.columnWidthConfig=t.columnWidthConfig,(t==null?void 0:t.rowHierarchyType)==="tree"&&this.internalProps.layoutMap.rowHierarchyType==="tree"&&this.internalProps.layoutMap.rowExpandLevel===(t==null?void 0:t.rowExpandLevel)){const y=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((x,S)=>{const A=y.find(R=>R.dimensionKey===x.dimensionKey&&R.value===x.value);A&&this._syncHierarchyState(A,x)})}const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=_==null?void 0:_[0])===null||h===void 0?void 0:h.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0),((d=t.customConfig)===null||d===void 0?void 0:d.enableDataAnalysis)===!1){let y,x;t.columnTree&&(y=new ci((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(x=new ci((c=this.internalProps.rowTree)!==null&&c!==void 0?c:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(g=this.options.rowExpandLevel)!==null&&g!==void 0?g:1:void 0)),C.layoutMap=new Rl(this,null,y,x),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new gf({rows:C.layoutMap.fullRowDimensionKeys,columns:C.layoutMap.colDimensionKeys,indicators:C.layoutMap.indicatorKeys,indicatorsAsCol:C.layoutMap.indicatorsAsCol,indicatorDimensionKey:C.layoutMap.indicatorDimensionKey},_))}else{const y=Ly(this,t),{rowKeys:x,columnKeys:S,indicatorKeys:A}=y;let{columnDimensionTree:R,rowDimensionTree:T}=y;this.dataset=new h1(C.dataConfig,x,S,A,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,_,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=$r(this.dataset.colHeaderTree,t.indicators)),R=new ci((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=$r(this.dataset.rowHeaderTree,t.indicators)),T=new ci((v=this.dataset.rowHeaderTree)!==null&&v!==void 0?v:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),C.layoutMap=new Rl(this,this.dataset,R,T)}if(this._changePivotSortStateBySortRules(),((w=(b=t.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&w!==void 0?w:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,C.releaseList&&(C.releaseList.forEach(y=>{var x;return(x=y==null?void 0:y.release)===null||x===void 0?void 0:x.call(y)}),C.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const y=St.getComponent("title");this.internalProps.title=new y(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const y=St.getComponent("emptyTip");this.internalProps.emptyTip=new y(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(y=>{setTimeout(y,0)})}updatePagination(t){t?(this.pagination||(this.pagination={currentPage:0,perPageCount:0}),typeof t.currentPage=="number"&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()):this.pagination&&(this.pagination=void 0,this.scenegraph.clearCells(),this.internalProps.layoutMap.setPagination(void 0),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render())}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,r,s,l,a,h;const d=this,{layoutMap:u}=d.internalProps;u&&(d.colCount=(t=u.colCount)!==null&&t!==void 0?t:0,d.rowCount=(e=u.rowCount)!==null&&e!==void 0?e:0,this.internalProps.frozenColCount=Math.max(((i=u.rowHeaderLevelCount)!==null&&i!==void 0?i:0)+u.leftRowSeriesNumberColumnCount,(o=this.options.frozenColCount)!==null&&o!==void 0?o:0),d.frozenRowCount=Math.max(u.headerLevelCount,(r=this.options.frozenRowCount)!==null&&r!==void 0?r:0),d.bottomFrozenRowCount!==((s=this.options.bottomFrozenRowCount)!==null&&s!==void 0?s:0)&&(d.bottomFrozenRowCount=(l=this.options.bottomFrozenRowCount)!==null&&l!==void 0?l:0),d.rightFrozenColCount!==((a=this.options.rightFrozenColCount)!==null&&a!==void 0?a:0)&&(d.rightFrozenColCount=(h=this.options.rightFrozenColCount)!==null&&h!==void 0?h:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,i){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var i,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(i=e.hierarchyState)!==null&&i!==void 0?i:e!=null&&e.children?t.hierarchyState:void 0,(o=e==null?void 0:e.children)===null||o===void 0||o.forEach((r,s)=>{var l;if(!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r){const a=t.children.find(h=>h.dimensionKey===r.dimensionKey&&h.value===r.value);a&&this._syncHierarchyState(a,r)}}))}getRecordShowIndexByCell(t,e){}getTableIndexByRecordIndex(t){}getTableIndexByField(t){}getCellAddrByFieldRecord(t,e){}getBodyIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByRow(t)}getBodyIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getBodyIndexByCol(t)}getFieldData(t,e,i){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,i)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(i),a=this.getBodyIndexByCol(e);return(o=this.records[l])===null||o===void 0?void 0:o[a]}if(this.dataset){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,i);if(l){let a;const h=(r=l.colHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(s=l.rowHeaderPaths)===null||s===void 0?void 0:s.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(a={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(e,i),!0,a);if(u.records&&u.records.length>=1)return u.records[0][t]}}else if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(e,i),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(e,i).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,i){var o,r,s,l,a,h,d;if(!i){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isSeriesNumber(t,e)){if(this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:c}=this.internalProps.layoutMap.getSeriesNumberHeader(t,e);return c}const{format:u}=this.internalProps.layoutMap.getSeriesNumberBody(t,e);return typeof u=="function"?u(t,e,this):e-this.columnHeaderLevelCount+1}if(this.internalProps.layoutMap.isHeader(t,e)){const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.internalProps.recordsIsTwoDimensionalArray){const{fieldFormat:u}=this.internalProps.layoutMap.getBody(t,e),c=this.getBodyIndexByRow(e),g=this.getBodyIndexByCol(t),f=(o=this.records[c])===null||o===void 0?void 0:o[g];return typeof u=="function"?u(f,t,e,this):f}if(this.dataset){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e);let c;const g=(s=(r=u.colHeaderPaths)===null||r===void 0?void 0:r.filter(m=>!m.virtual))===null||s===void 0?void 0:s.map((m,b)=>{var w;return m.indicatorKey&&(c={position:"col",index:b}),(w=m.indicatorKey)!==null&&w!==void 0?w:m.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(m=>!m.virtual))===null||a===void 0?void 0:a.map((m,b)=>{var w;return m.indicatorKey&&(c={position:"row",index:b}),(w=m.indicatorKey)!==null&&w!==void 0?w:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:v}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof v=="function"?v(p==null?void 0:p.value(),t,e,this):(h=p==null?void 0:p.value())!==null&&h!==void 0?h:""}if(this.flatDataToObjects){const u=this.internalProps.layoutMap.getCellHeaderPaths(t,e),c=u.colHeaderPaths.map(v=>{var m;return(m=v.indicatorKey)!==null&&m!==void 0?m:v.value}),g=u.rowHeaderPaths.map(v=>{var m;return(m=v.indicatorKey)!==null&&m!==void 0?m:v.value}),f=this.flatDataToObjects.getTreeNode(g,c,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:p}=this.internalProps.layoutMap.getBody(t,e);return typeof p=="function"?p(f==null?void 0:f.value,t,e,this):(d=f==null?void 0:f.value)!==null&&d!==void 0?d:""}}getCellOriginValue(t,e){var i,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(i=this.records[l])===null||i===void 0?void 0:i[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return d==null?void 0:d.value}}getCellRawValue(t,e){var i,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){const{title:l}=s.internalProps.layoutMap.getHeader(t,e);return typeof l=="function"?l():l}if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(i=this.records[l])===null||i===void 0?void 0:i[a]}if(this.dataset){let l;const a=this.internalProps.layoutMap.getCellHeaderPaths(t,e),h=(o=a.colHeaderPaths)===null||o===void 0?void 0:o.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"col",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),d=(r=a.rowHeaderPaths)===null||r===void 0?void 0:r.filter(c=>!c.virtual).map((c,g)=>{var f;return c.indicatorKey&&(l={position:"row",index:g}),(f=c.indicatorKey)!==null&&f!==void 0?f:c.value}),u=this.dataset.getAggregator(d,h,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,l);return u.value?u.value():void 0}if(this.flatDataToObjects){const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=l.colHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),h=l.rowHeaderPaths.map(u=>{var c;return(c=u.indicatorKey)!==null&&c!==void 0?c:u.value}),d=this.flatDataToObjects.getTreeNode(h,a,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return d==null?void 0:d.value}}getCellOriginRecord(t,e){var i,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(i=this.records[s])===null||i===void 0?void 0:i[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return h==null?void 0:h.record}}}getCellRawRecord(t,e){var i,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(i=this.records[s])===null||i===void 0?void 0:i[l]}if(this.dataset){let s;const l=this.internalProps.layoutMap.getCellHeaderPaths(t,e),a=(o=l.colHeaderPaths)===null||o===void 0?void 0:o.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"col",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value}),h=(r=l.rowHeaderPaths)===null||r===void 0?void 0:r.filter(d=>!d.virtual).map((d,u)=>{var c;return d.indicatorKey&&(s={position:"row",index:u}),(c=d.indicatorKey)!==null&&c!==void 0?c:d.value});return this.dataset.getAggregator(h,a,this.internalProps.layoutMap.getIndicatorKey(t,e),!1,s).records}if(this.flatDataToObjects){const s=this.internalProps.layoutMap.getCellHeaderPaths(t,e),l=s.colHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),a=s.rowHeaderPaths.map(d=>{var u;return(u=d.indicatorKey)!==null&&u!==void 0?u:d.value}),h=this.flatDataToObjects.getTreeNode(a,l,this.internalProps.layoutMap.getBody(t,e).indicatorKey,!1);return h==null?void 0:h.record}}}updateSortRules(t,e,i){this.internalProps.dataConfig?this.internalProps.dataConfig.sortRules=t:this.internalProps.dataConfig={sortRules:t},this.dataset.updateSortRules(t),this._changePivotSortStateBySortRules();const{layoutMap:o}=this.internalProps;o.resetHeaderTree(),this.scenegraph.clearCells(),nt(e)&&nt(i)?(this.isRowHeader(e,i)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,i)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,i)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,i,o;this.pivotSortState=[];const r=(e=(t=this.internalProps.dataConfig)===null||t===void 0?void 0:t.sortRules)!==null&&e!==void 0?e:[];for(let s=0;s<r.length;s++){const l=r[s],a=[];if(l.sortByIndicator&&l.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])){for(let d=0;d<l.query.length;d++)a.push({dimensionKey:this.dataset.indicatorsAsCol?this.dataset.columns[d]:this.dataset.rows[d],value:l.query[d]});a.push({indicatorKey:l.sortByIndicator,value:(o=(i=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||i===void 0?void 0:i.title)!==null&&o!==void 0?o:l.sortByIndicator})}else a.push({dimensionKey:l.sortField,isPivotCorner:!0,value:l.sortField});const h=l.sortType?l.sortType.toUpperCase():"ASC";this.pivotSortState.push({dimensions:a,order:Ve[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const i=t[e],o=i.dimensions,r=i.width,s=this.getCellAddressByHeaderPaths(o);s&&!this.internalProps._widthResizedColMap.has(s.col)&&(this._setColWidth(s.col,r),this.internalProps._widthResizedColMap.add(s.col))}}updatePivotSortState(t){this.pivotSortState=t}sort(t,e,i){var o;let r;if(this.isCornerHeader(t,e)){const a=this.getHeaderDefine(t,e);r=[];const h={isPivotCorner:!0,dimensionKey:a.value,value:a.value};r.push(h)}else r=this.isColumnHeader(t,e)?this.getCellHeaderPaths(t,e).colHeaderPaths:this.getCellHeaderPaths(t,e).rowHeaderPaths;const s=r[r.length-1].indicatorKey,l=this.getHeaderDefine(t,e);if(l.sort){if(this.dataset.sortRules){const a={};for(let h=this.dataset.sortRules.length-1;h>=0;h--){const d=this.dataset.sortRules[h];l.dimensionKey&&d.sortField===l.dimensionKey?(a[d.sortField]=d,this.dataset.sortRules.splice(h,1)):s&&d.sortField===(this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1])&&this.dataset.sortRules.splice(h,1)}s?this.dataset.sortRules.push({sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:Ve[i],sortByIndicator:s,query:r.reduce((h,d)=>(d.dimensionKey&&h.push(d.value),h),[])}):this.dataset.sortRules.push(Object.assign((o=a[l.dimensionKey])!==null&&o!==void 0?o:{},{sortField:l.dimensionKey,sortType:Ve[i]}))}else this.dataset.sortRules=s?[{sortField:this.dataset.indicatorsAsCol?this.dataset.rows[this.dataset.rows.length-1]:this.dataset.columns[this.dataset.columns.length-1],sortType:Ve[i],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:Ve[i]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const i=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const r=this.pivotSortState[o],s=r.dimensions,l=this.getCellAddressByHeaderPaths(s),a=r.order;if(l&&Ti(i,l.col,l.row))return a}}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(r){if(r.moveType==="column"){if(this.internalProps.recordsIsTwoDimensionalArray)for(let s=0;s<this.internalProps.records.length;s++){const l=this.internalProps.records[s].splice(r.sourceIndex-this.rowHeaderLevelCount,r.sourceSize);l.unshift(r.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[s],l)}this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.setMinMaxLimitWidth()}else if(r.moveType==="row"){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.internalProps.records.splice(r.sourceIndex-this.columnHeaderLevelCount,r.sourceSize);s.unshift(r.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,s)}r.targetIndex>r.sourceIndex?this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex+r.sourceSize-r.targetSize,r.targetSize,r.targetIndex):this.rowHeightsMap.exchangeOrder(r.sourceIndex,r.sourceSize,r.targetIndex,r.targetSize,r.targetIndex)}return r}return null}toggleHierarchyState(t,e,i=!0){const o=this.getHierarchyState(t,e);if(o===Pt.expand)this._refreshHierarchyState(t,e,i),this.fireListeners(po.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Pt.collapse});else if(o===Pt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,i),this.fireListeners(po.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Pt.expand,originData:r})}}_refreshHierarchyState(t,e,i=!0,o){let r=!1,s=!1;this.stateManager.updateHoverIcon(t,e,void 0,void 0);const l=this.internalProps.layoutMap.checkHasChart();l&&(this.autoFillWidth&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight));const a=this.internalProps.layoutMap.toggleHierarchyState(t,e);o&&o(),this.refreshRowColCount(),this.clearCellStyleCache(),this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions,a.updateCellPositions,i),l&&(this.autoFillWidth&&!r&&(r=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!s&&(s=this.getAllRowsHeight()<=this.tableNoFrameHeight),(this.widthMode==="adaptive"||r||this.heightMode==="adaptive"||s)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;return e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1),this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){var i;return(i=this._getHeaderLayoutMap(t,e))===null||i===void 0?void 0:i.hierarchyState}getLayoutColumnTree(){return this.internalProps.layoutMap.getLayoutColumnTree()}getLayoutColumnTreeCount(){return this.internalProps.layoutMap.getLayoutColumnTreeCount()}getLayoutRowTree(){return this.internalProps.layoutMap.getLayoutRowTree()}getLayoutRowTreeCount(){return this.internalProps.layoutMap.getLayoutRowTreeCount()}getCellHeaderTreeNodes(t,e){return this.internalProps.layoutMap.getCellHeaderPathsWithTreeNode(t,e)}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,i){const o=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:o[o.length-1].dimensionKey,value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),isPivotCorner:this.isCornerHeader(t,e),event:void 0}}setRecords(t){var e,i,o,r,s;const l={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t,this.internalProps.recordsIsTwoDimensionalArray=!1,((e=t==null?void 0:t[0])===null||e===void 0?void 0:e.constructor)===Array&&(this.internalProps.recordsIsTwoDimensionalArray=!0);const a=this.options,h=this.internalProps;if(((i=this.options.customConfig)===null||i===void 0?void 0:i.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new gf({rows:h.layoutMap.fullRowDimensionKeys,columns:h.layoutMap.colDimensionKeys,indicators:h.layoutMap.indicatorKeys,indicatorsAsCol:h.layoutMap.indicatorsAsCol,indicatorDimensionKey:h.layoutMap.indicatorDimensionKey},t));else{let d,u;this.dataset.setRecords(t),d=a.columnTree?h.layoutMap.columnDimensionTree:new ci((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new ci((r=this.dataset.rowHeaderTree)!==null&&r!==void 0?r:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(s=this.options.rowExpandLevel)!==null&&s!==void 0?s:1:void 0),h.layoutMap=new Rl(this,this.dataset,d,u),this.pivotSortState=[],a.pivotSortState&&(this.pivotSortState=a.pivotSortState)}if(this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(l.col,l.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder(),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const d=St.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,i){var o;if(I(t)&&I(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;I(r)&&I(s)&&this.editorManager.startEditCell(r,s,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(i=l==null?void 0:l.headerEditor)!==null&&i!==void 0?i:this.options.headerEditor}else if(this.isHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(o=l==null?void 0:l.headerEditor)!==null&&o!==void 0?o:this.options.headerEditor}else{const l=this.getBodyColumnDefine(t,e);s=(r=l==null?void 0:l.editor)!==null&&r!==void 0?r:this.options.editor}return typeof s=="function"&&(s=s({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),typeof s=="string"?GI(s):s}isHasEditorDefine(t,e){var i;const o=this.getBodyColumnDefine(t,e);let r=(i=o==null?void 0:o.editor)!==null&&i!==void 0?i:this.options.editor;return typeof r=="function"&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),I(r)}changeCellValue(t,e,i,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=i;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&ug(i)&&(r=parseFloat(i)),this._changeCellValueToDataSet(t,e,s,r);const a=this.getCellRange(t,e);for(let h=a.start.col;h<=a.end.col;h++)for(let d=a.start.row;d<=a.end.row;d++)this.scenegraph.updateCellContent(h,d);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else if(!this.internalProps._widthResizedColMap.has(t)){const h=this.getColWidth(t),d=Gr(t,0,this.rowCount-1,this,!1);d!==h&&this.scenegraph.updateColWidth(t,d-h)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.internalProps._heightResizedRowMap.size===0&&this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"&&!this.internalProps._heightResizedRowMap.has(e)){const h=this.getRowHeight(e),d=dn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(J.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,i,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<i.length&&!(e+u>this.rowCount-1);u++){const c=i[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const v=this.getCellRawValue(t+p,e+u);g.push(v);const m=this.getCellOriginValue(t+p,e+u);f.push(m)}}for(let u=0;u<i.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=i[u];let g=t;for(let f=0;f<c.length&&!(t+f>this.colCount-1);f++)if(g=t+f,o&&this.isHasEditorDefine(t+f,e+u)||o===!1){const p=c[f];let v=p;const m=a[u][f],b=l[u][f];typeof b=="number"&&ug(p)&&(v=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,m,v),this.fireListeners(J.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:b,currentValue:m,changedValue:this.getCellOriginValue(t+f,e+u)})}r=Math.max(r,g)}const h=this.getCellRange(t,e),d=this.getCellRange(r,s);for(let u=h.start.col;u<=d.end.col;u++)for(let c=h.start.row;c<=d.end.row;c++)this.scenegraph.updateCellContent(u,c);if(this.widthMode==="adaptive"||this.autoFillWidth&&this.getAllColsWidth()<=this.tableNoFrameWidth)this.internalProps._widthResizedColMap.size===0&&this.scenegraph.recalculateColWidths();else for(let u=t;u<=d.end.col;u++)if(!this.internalProps._widthResizedColMap.has(u)){const c=this.getColWidth(u),g=Gr(u,0,this.rowCount-1,this,!1);g!==c&&this.scenegraph.updateColWidth(u,g-c)}if(this.heightMode==="adaptive"||this.autoFillHeight&&this.getAllRowsHeight()<=this.tableNoFrameHeight)this.scenegraph.recalculateRowHeights();else if(this.heightMode==="autoHeight"){const u=[],c=[];for(let g=e;g<=d.end.row;g++)if(this.rowHeightsMap.get(g)){const f=this.getRowHeight(g),p=dn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,i,o){var r,s,l,a,h,d,u,c;if(this.internalProps.recordsIsTwoDimensionalArray){const g=this.getBodyIndexByRow(e),f=this.getBodyIndexByCol(t);this.records[g][f]=o}else if(this.dataset){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isCornerHeader(t,e))this.internalProps.layoutMap.changeCornerTitle(t,e,o);else if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.dataset.changeRecordFieldValue(!((r=g.colHeaderPaths)===null||r===void 0)&&r.length?(s=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&s!==void 0?s:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(l=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&l!==void 0?l:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,i,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(v=>!v.virtual).map(v=>{var m;return(m=v.indicatorKey)!==null&&m!==void 0?m:v.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(v=>!v.virtual).map(v=>{var m;return(m=v.indicatorKey)!==null&&m!==void 0?m:v.value});this.dataset.changeTreeNodeValue(this.internalProps.layoutMap.indicatorsAsCol?p:p.slice(0,-1),this.internalProps.layoutMap.indicatorsAsCol?f.slice(0,-1):f,this.internalProps.layoutMap.getIndicatorKey(t,e),o)}}else if(this.flatDataToObjects){const g=this.internalProps.layoutMap.getCellHeaderPaths(t,e);if(this.isHeader(t,e))this.internalProps.layoutMap.changeTreeNodeTitle(t,e,o),!this.isCornerHeader(t,e)&&this.flatDataToObjects.changeRecordFieldValue(!((d=g.colHeaderPaths)===null||d===void 0)&&d.length?(u=g.colHeaderPaths[g.colHeaderPaths.length-1].indicatorKey)!==null&&u!==void 0?u:g.colHeaderPaths[g.colHeaderPaths.length-1].dimensionKey:(c=g.rowHeaderPaths[g.rowHeaderPaths.length-1].indicatorKey)!==null&&c!==void 0?c:g.rowHeaderPaths[g.rowHeaderPaths.length-1].dimensionKey,i,o);else{const f=g.colHeaderPaths.map(v=>{var m;return(m=v.indicatorKey)!==null&&m!==void 0?m:v.value}),p=g.rowHeaderPaths.map(v=>{var m;return(m=v.indicatorKey)!==null&&m!==void 0?m:v.value});this.flatDataToObjects.changeTreeNodeValue(p,f,this.internalProps.layoutMap.getBody(t,e).indicatorKey,o)}}}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:i}=this.internalProps.layoutMap;for(let o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<e.length;o++){const r=e[o];if(typeof r!="string"&&(r.headerCustomLayout||r.headerCustomRender))return!0}for(let o=0;o<i.length;o++){const r=i[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,i,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(i,o).children=t,this._refreshHierarchyState(i,o,!0,()=>{this.flatDataToObjects.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys,indicators:this.internalProps.layoutMap.indicatorKeys,indicatorsAsCol:this.internalProps.layoutMap.indicatorsAsCol,indicatorDimensionKey:this.internalProps.layoutMap.indicatorDimensionKey}),this.flatDataToObjects.addRecords(e)})):(this.internalProps.layoutMap.getHeadNode(i,o).children=t,this._refreshHierarchyState(i,o,!0,()=>{this.dataset._rowTreeHasChanged(),this.dataset.changeDataConfig({rows:this.internalProps.layoutMap.fullRowDimensionKeys,columns:this.internalProps.layoutMap.colDimensionKeys}),this.dataset.addRecords(e)}))}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),this.renderWithRecreateCells()}getFilteredRecords(){var t;return(t=this.dataset)===null||t===void 0?void 0:t.filterRules}};X3(),q3(),Z3(),J3(),Q3(),tz(),vz(),mz(),bz(),Cz(),_z(),yz(),wz(),Sz();class Mz extends Tz{}const Bz=ft.defineComponent({name:"PivotTable",components:{},props:{...p1,pageMode:String},setup(n,{expose:t}){const e=ft.ref(),i=ft.ref(""),o=ft.ref({}),r=ft.ref(),s=ft.ref({}),l=ft.ref({}),a=ft.ref(),h=ft.ref(),d=ft.ref({}),u=ft.ref(),c=ft.ref(),g=ft.ref(),f=ft.ref(),p=ft.ref(),v=ft.ref(),m={sqz:"上期值",tqz:"同期值",zje:"增减额",hb:"环比(%)",tb:"同比(%)",zb:"占比(%)"},b=[{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"},{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"删除",menuKey:"delete"}],w={SUM:"合计",AVG:"平均值",COUNT:"计数",MAX:"Max",MIN:"最小值",VAR:"方差",STDEV:"标准差"},C=ft.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row",headerStyle:{textStick:!0}},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",menu:{renderMode:"html",dropDownMenuHighlight:[]}}),_=ft.ref([]);function y(W,O=!0,Y=-1){if(Y>-1)C.indicators.splice(Y,0,...W);else for(const $ of W)C.indicators.push($);O&&ft.unref(e).updateOption(C)}function x(W="",O=[]){const Y=[],$=Object.keys(m),Q=$.map(et=>`${W}-${et}`);return O.forEach(et=>{let ot=et;typeof et=="object"&&(ot=et.indicatorKey);const K=Q.indexOf(ot);K>-1&&$.splice(K,1)}),$.forEach(et=>{Y.push({text:m[et],menuKey:et})}),[{text:"计算",menuKey:"calculate",children:Y},...b]}function S(){const W=C.rows.map(Y=>Y.dimensionKey),O=C.columns.map(Y=>Y.dimensionKey);return W.concat(O)}function A(){const W=[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"行列互换",menuKey:"trans"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"钻取",menuKey:"drill"},{text:"删除",menuKey:"delete"}],O=[],Y=S(),$=ft.unref(_).filter(Q=>!Y.includes(Q));if($!=null&&$.length)for(const Q of $)O.push({text:Q,menuKey:Q});return W[6].children=O,W}function R(W){var Y,$;if(!W){(Y=C.aggregate)!=null&&Y.type&&(C.records.splice(-C.aggregate.len),C.aggregate={});return}const O=ft.unref(e).getAllBodyCells();if(O.length>0&&O[0][0]){let Q=O.length;($=C.aggregate)!=null&&$.type&&C.aggregate.len&&(Q=O.length-1,C.records.splice(-C.aggregate.len));const et=O[0].length;console.log(O[0][0]);const{rowHeaderPaths:ot}=O[0][0].cellHeaderPaths,K={};ot.forEach(tt=>{K[tt.dimensionKey]=w[W]});const at=[];for(let tt=0;tt<et;tt++){const{colHeaderPaths:_t}=O[0][tt].cellHeaderPaths,yt=O[0][tt].field,ut={};_t.forEach(Re=>{Re.dimensionKey&&(ut[Re.dimensionKey]=Re.value)});let xt=0;const de=[];if(W!=="COUNT"){let Re=0;for(let Ge=0;Ge<Q;Ge++){const Qe=O[Ge][tt].dataValue;Re+=Qe,de.push(Qe)}if(W==="SUM")xt=Re;else if(W==="AVG")xt=Re/Q;else if(W==="MAX")xt=Math.max(...de);else if(W==="MIN")xt=Math.min(...de);else if(W==="VAR"||W==="STDEV"){const Ge=Re/Q;de.forEach(Qe=>{xt+=Math.pow(Qe-Ge,2)}),xt=xt/(Q-1),W==="STDEV"&&(xt=Math.sqrt(xt))}}else xt=Q;at.push({...K,...ut,[yt]:xt})}C.aggregate={type:W,len:at.length,rowPathObj:K},C.records=[...C.records,...at]}ft.unref(e).updateOption(C)}function T(W,O=!0){var Y,$,Q,et;for(const ot of W){const{key:K,name:at,type:tt}=ot,_t=n.dimensionList.find(yt=>yt.key===K);if(C[tt].push({dimensionKey:K,title:at,width:_t!=null&&_t.width?`${_t.width}%`:"auto"}),(Y=C[tt])!=null&&Y.length)for(const yt of C[tt])yt.cornerDropDownMenu=A();C.dataConfig.sortRules.push({sortField:K,sortType:ft.unref(i)})}O&&(ft.unref(e).updateOption(C),($=C.aggregate)!=null&&$.type&&((Q=C.aggregate)==null?void 0:Q.type)!=="SUM"&&R((et=C.aggregate)==null?void 0:et.type)),ft.nextTick(()=>{P()})}function M(W){const O={},Y=C.records;for(const $ of Y)for(const Q of W)yf(O,Q)?O[Q].find(et=>et.value===$[Q])||O[Q].push({value:$[Q]}):O[Q]=[{value:$[Q]}];return O}function P(){console.log("unref(tableInstance)",ft.unref(e));const{dataset:{columns:W,rows:O}}=ft.unref(e),Y=O.concat(W);o.value=M(Y)}const k=W=>{const{data:{rows:O}}=(W==null?void 0:W.data)||{};console.log("rows",O),C.records=O;const{queryColumnList:Y=[],indicators:$=[]}=n.graphicConfig||{},Q=x(),et=[],ot=[];for(const K of Y){if(!K.show)continue;const at=n.dimensionList.find(tt=>tt.key===K.label);_.value.push(K.label),ot.push({key:K.label,name:K.label,type:(at==null?void 0:at.position)||"rows"})}for(const K of $){if(!K.show)continue;const at=n.indicatorList.find(tt=>tt.key===K.label);et.push({indicatorKey:K.label,title:K.label,width:at!=null&&at.width?`${at.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},style:{padding:[16,28,16,28],bgColor(tt){var yt,ut;const _t=tt.cellHeaderPaths.rowHeaderPaths;if(((yt=_t==null?void 0:_t[1])==null?void 0:yt.value)==="Sub Totals")return"#ba54ba";if(((ut=_t==null?void 0:_t[0])==null?void 0:ut.value)==="Row Totals")return"#ff9900"}},dropDownMenu:Q})}if(C.indicators=[],C.rows=[],C.columns=[],y(et,!1),T(ot,!1),ft.unref(e))ft.unref(e).updateOption(C);else{const K=document.getElementById(`pivotTableContainer_${n.id}`);e.value=new Mz(K,C),ht()}};function B(W){const{aggregate:O}=C;if(O!=null&&O.type&&(O!=null&&O.len)){const Y=O.rowPathObj||{};for(const $ in Y)if(W[$]===Y[$])return!0}}function H(){if(ft.unref(e)){const{dataset:{rows:W}}=ft.unref(e),O={};for(const Y of W)O[Y]="";ft.unref(e).updateOption({...C,dataConfig:{...C.dataConfig,filterRules:[]},records:[O]})}}function E(){var $;const{type:W,len:O}=C.aggregate||{};W&&(C.records.splice(-O),C.aggregate={type:W,len:0});const Y=[];if(Object.keys(s.value))for(const Q in s.value)Y.push({filterFunc:et=>{const ot=B(et);return ot||ft.unref(s)[Q].includes(et[Q])}});C.dataConfig.filterRules=Y,ft.unref(e).updateOption(C),($=C.aggregate)!=null&&$.type&&R(C.aggregate.type),ft.nextTick(()=>{const{dataset:{rowHeaderTree:Q}}=ft.unref(e);Q!=null&&Q.length||H()})}function F(W,O){var Q,et,ot;const Y=C[O].findIndex(K=>K.dimensionKey===W),$=C.dataConfig.sortRules.findIndex(K=>K.sortField===W);if(Y!==-1){C[O].splice(Y,1);for(const K of C[O])K.cornerDropDownMenu=A()}$!==-1&&(C.dataConfig.sortRules[$].sortType=i),ft.unref(e).updateOption(C),(Q=C.aggregate)!=null&&Q.type&&((et=C.aggregate)==null?void 0:et.type)!=="SUM"&&R((ot=C.aggregate)==null?void 0:ot.type),ft.nextTick(()=>{P(),delete s.value[W],E()})}function L(W){const{indicators:O}=C,Y=O.findIndex($=>$.indicatorKey===W);if(Y!==-1){const $=O[Y];if(O.splice(Y,1),$.calculateType){const Q=$.indicatorKey.split("-"+$.calculateType)[0],et=O.findIndex(ot=>ot.indicatorKey===Q);O[et].dropDownMenu=x(Q,O)}}ft.unref(e).updateOption(C)}function z(W,O,Y,$){var _t;let{dataConfig:{sortRules:Q},menu:{dropDownMenuHighlight:et}}=C;const ot=ft.unref(e).getAllCells();$=$+1;let K=[];const at=(_t=C.aggregate)!=null&&_t.type?ot.length-1:ot.length;for(let yt=$;yt<at;yt++){const{cellLocation:ut,dataValue:xt}=ot[yt][Y];ut==="rowHeader"&&K.push(xt)}W==="asc"?K=K.sort((yt,ut)=>yt.localeCompare(ut)):W==="desc"&&(K=K.sort((yt,ut)=>ut.localeCompare(yt)));const tt={sortField:O,sortBy:K};Q=Q.filter(yt=>yt.sortField!==O),Q.push(tt),C.dataConfig.sortRules=Q,et=et.filter(yt=>!(yt.type==="dimension"&&yt.field===O)||yt.type==="indicator"),et.push({col:Y,row:$-1,field:O,type:"dimension",menuKey:W}),C.menu.dropDownMenuHighlight=et,ft.unref(e).updateOption(C)}function D(W,O,Y,$,Q){var xt;const{dataConfig:et,menu:ot}=C;let K=et.sortRules,at=ot.dropDownMenuHighlight;const tt=Y.filter((de,Re)=>Re<Y.length-1).map(de=>de.value);let _t="";(xt=C.rows)!=null&&xt.length&&(_t=C.rows[C.rows.length-1].dimensionKey);const yt=K.findIndex(de=>de.sortField===_t);yt!==-1&&K.splice(yt,1);const ut=at.findIndex(de=>de.field===_t&&de.type==="dimension");ut!==-1&&at.splice(ut,1),K=K.filter(de=>!yf(de,"sortByIndicator")),at=at.filter(de=>de.type==="dimension"),(W==="asc"||W==="desc")&&K.push({sortField:_t,sortByIndicator:O,sortType:W.toUpperCase(),query:tt}),at.push({col:$,row:Q,field:O,type:"indicator",menuKey:W}),C.dataConfig.sortRules=K,C.menu.dropDownMenuHighlight=at,ft.unref(e).updateOption(C)}function N(W,O,Y){const $=ft.unref(e).getCellValue(O,Y),Q={};ft.unref(s)[W]&&(Q.filterData=ft.unref(s)[W]),a.value={tableInstance:e,fieldName:$,key:W,valueList:ft.unref(o)[W]||[],type:"dimension",...Q},ft.nextTick(()=>{h.value.show()})}function V(W,O){a.value={tableInstance:e,fieldName:O,key:W,type:"indicators",filterData:ft.unref(l)[W]},ft.nextTick(()=>{h.value.show()})}function G({indicatorKey:W,menuKey:O}){const Y=C.indicators.map(et=>et.indicatorKey);let $=C.indicators.length-1;const Q=`${W}-${O}`;C.indicators.forEach((et,ot)=>{et.indicatorKey===W&&($=ot+1,et.dropDownMenu=x(W,[...Y,Q]))}),y([{indicatorKey:Q,title:m[O],calculateType:O,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},style:{padding:[16,28,16,28],bgColor(et){var K,at;const ot=et.cellHeaderPaths.rowHeaderPaths;if(((K=ot==null?void 0:ot[1])==null?void 0:K.value)==="Sub Totals")return"#ba54ba";if(((at=ot==null?void 0:ot[0])==null?void 0:at.value)==="Row Totals")return"#ff9900"}},dropDownMenu:[{text:"删除",menuKey:"delete"}]}],!0,$)}function U(){var ot;const W=C.rows[0]?C.rows[0].cornerDropDownMenu:[],O=C.columns[0]?C.columns[0].cornerDropDownMenu:[],Y=C.rows.map(K=>({...K,cornerDropDownMenu:O})),$=C.columns.map(K=>({...K,cornerDropDownMenu:W}));C.columns=Y,C.rows=$;const{type:Q,len:et}=C.aggregate||{};Q&&(C.records.splice(-et),C.aggregate={type:Q,len:0}),C.menu.dropDownMenuHighlight=[],s.value={},l.value={},d.value={},C.dataConfig.filterRules=[],ft.unref(e).updateOption(C),z("",$[0].dimensionKey,0,0),(ot=C.aggregate)!=null&&ot.type&&R(C.aggregate.type)}function Z({indicatorKey:W,fieldName:O}){const Y=j(W);if(Y>-1){const $=C.indicators[Y].formatConfig||{};ft.unref(u).showModal({...$,indicatorKey:W,fieldName:O})}}function q(W){const O=j(W);if(O>-1){const Y=C.indicators[O].conditionalConfig||[];ft.unref(c).showModal(W,Y)}}function j(W){return C.indicators.findIndex(O=>O.indicatorKey===W)}function rt(W){const O=ft.unref(_)[0],Y=M(ft.unref(_)),$={xLabel:O,yLabel:W,dimensionData:Y,records:C.records};console.log($),ft.unref(p).showModal($)}function ht(){e.value.on("dropdown_menu_click",W=>{var at;const{menuKey:O,field:Y,col:$,row:Q}=W,{dimensionKey:et,indicatorKey:ot,value:K}=Y[Y.length-1];switch(r.value=W,ft.unref(_).includes(O)&&T([{key:O,name:O,type:"rows"}]),O){case"drill":alert("无维度可钻取");break;case"delete":et?F(et,"rows"):ot&&L(ot);break;case"asc":case"desc":case"default-sort":et?z(O,et,$,Q):ot&&D(O,ot,Y,$,Q);break;case"filter":et?N(et,$,Q):ot&&V(ot,K);break;case"sqz":case"tqz":case"zje":case"hb":case"tb":case"zb":G({indicatorKey:ot,menuKey:O});break;case"trans":U();break;case"property":Z({indicatorKey:ot,fieldName:K});break;case"conditionalProperty":q(ot);break;case"aggregate":ft.unref(g).showModal((at=C.aggregate)==null?void 0:at.type,$,Q);break;case"top":ft.unref(f).showModal(C.topNum);break;case"graph":rt(ot);break}setTimeout(()=>{console.log("option",C)},500)})}const gt=W=>{k(W)},vt=()=>{};return t({refreshData:gt,click:vt}),ft.onMounted(()=>{}),{pivotTableRef:v,click:vt}}}),dD="",Pz=(n,t)=>{const e=n.__vccOpts||n;for(const[i,o]of t)e[i]=o;return e},Hz={key:0,class:"design-template"},Ez=["id"];function Lz(n,t,e,i,o,r){return n.pageMode==="design"?(ft.openBlock(),ft.createElementBlock("div",Hz," 透视表格 ")):(ft.openBlock(),ft.createElementBlock("div",{key:1,class:"table-instance",id:n.pageMode!=="design"?`pivotTableContainer_${n.id}`:"",ref:"pivotTableRef"},null,8,Ez))}const d1=f1(Pz(Bz,[["render",Lz],["__scopeId","data-v-1c33b89f"]])),u1=Object.freeze(Object.defineProperty({__proto__:null,EcanPivotTable:d1},Symbol.toStringTag,{value:"Module"})),Fz={install:(n,t)=>{const{request:e}=t;n.provide("$request",e),Object.keys(u1).forEach(i=>{const o=u1[i];o.install&&n.use(o)})}};$n.EcanPivotTable=d1,$n.default=Fz,Object.defineProperties($n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
307
|
+
//# sourceMappingURL=index.umd.js.map
|