@ecan-bi/pivot-table 1.0.72 → 1.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @ecan-bi/pivot-table@1.0.72 */
1
+ /*! @ecan-bi/pivot-table@1.0.74 */
2
2
  (function(Je,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("vue"),require("dayjs"),require("lodash-es"),require("axios"),require("ant-design-vue"),require("ant-design-vue/es/input-number/style"),require("ant-design-vue/es/form/style"),require("echarts"),require("vuedraggable")):typeof define=="function"&&define.amd?define(["exports","vue","dayjs","lodash-es","axios","ant-design-vue","ant-design-vue/es/input-number/style","ant-design-vue/es/form/style","echarts","vuedraggable"],v):(Je=typeof globalThis<"u"?globalThis:Je||self,v(Je["@ecan-bi/pivot-table"]={},Je.Vue,Je.Dayjs,Je.LodashEs,Je.Axios,Je.AntDesignVue,null,null,Je.Echarts,Je.Draggable))})(this,function(Je,v,Fo,Ue,DB,Gi,nX,oX,OB,Hb){"use strict";function zB(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const NB=zB(OB),WB=i=>(i.install=t=>{t.component(i.name,i)},i);function Eb(i,t){var e={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&t.indexOf(n)<0&&(e[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var o=0;for(n=Object.getOwnPropertySymbols(i);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(i,n[o])&&(e[n[o]]=i[n[o]])}return e}const VB=()=>{},jB=Object.assign,$B=Array.isArray,mf=i=>typeof i=="function",GB=i=>typeof i=="symbol";let Lb;const vf=()=>Lb||(Lb=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bf(i){const t=i&&i.__v_raw;return t?bf(t):i}function kb(i){return!(!i||i.__v_isRef!==!0)}function Mi(i){return kb(i)?i.value:i}new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(GB));const Ur=[];function Cf(i,...t){if(process.env.NODE_ENV==="production")return;const e=Ur.length?Ur[Ur.length-1].component:null,n=e&&e.appContext.config.warnHandler,o=function(){let r=Ur[Ur.length-1];if(!r)return[];const s=[];for(;r;){const l=s[0];l&&l.vnode===r?l.recurseCount++:s.push({vnode:r,recurseCount:0});const a=r.component&&r.component.parent;r=a&&a.vnode}return s}();if(n)yf(n,e,11,[i+t.join(""),e&&e.proxy,o.map(({vnode:r})=>`at <${jb(e,r.type)}>`).join(`
3
3
  `),o]);else{const r=[`[Vue warn]: ${i}`,...t];o.length&&r.push(`
4
4
  `,...function(s){const l=[];return s.forEach((a,h)=>{l.push(...h===0?[]:[`
@@ -306,7 +306,7 @@
306
306
  border: 1px solid #E6E8ED;
307
307
  }
308
308
  `,document.head.appendChild(i)}v9();const Ih="vtable__bubble-tooltip-element",wT=`${Ih}__content`,ST=`${Ih}__triangle`,Il=`${Ih}--hidden`,Dh=`${Ih}--shown`;class b9{constructor(){this._handler=new bc;const t=this._rootElement=To("div",[Ih,Il]),e=To("div",[wT]),n=To("span",[ST]);t.appendChild(n),t.appendChild(e),this._messageElement=t.querySelector(`.${wT}`)||void 0,this._triangleElement=t.querySelector(`.${ST}`)||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=>{u4(e)&&o.stopPropagation()})}bindToCell(t,e,n,o,r){var s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A;this._disappearDelay=o==null?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const x=this._rootElement,T=this._messageElement,M=this._triangleElement;if(x==null||x.classList.remove(Dh),x==null||x.classList.add(Il),this._canBindToCell(t,e,n)){if(T.setAttribute("style",""),M.setAttribute("style",""),o!=null&&o.className&&x.classList.add(o.className),!((s=o==null?void 0:o.style)===null||s===void 0)&&s.bgColor&&(T.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&&(M.style.backgroundColor=(h=o==null?void 0:o.style)===null||h===void 0?void 0:h.bgColor),M.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&&(T.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&&(T.style.fontFamily=(p=o==null?void 0:o.style)===null||p===void 0?void 0:p.fontFamily),!((m=o==null?void 0:o.style)===null||m===void 0)&&m.color&&(T.style.color=(b=o==null?void 0:o.style)===null||b===void 0?void 0:b.color),!((C=o==null?void 0:o.style)===null||C===void 0)&&C.padding&&(T.style.padding=`${(_=o==null?void 0:o.style)===null||_===void 0?void 0:_.padding.join("px ")}px`),!((w=o==null?void 0:o.style)===null||w===void 0)&&w.maxHeight&&(T.style.maxHeight=`${(y=o==null?void 0:o.style)===null||y===void 0?void 0:y.maxHeight}px`),!((S=o==null?void 0:o.style)===null||S===void 0)&&S.maxWidth&&(T.style.maxWidth=`${(R=o==null?void 0:o.style)===null||R===void 0?void 0:R.maxWidth}px`),T&&(T.textContent=o==null?void 0:o.content),this._bindToCell(t,e,n,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r,(A=o==null?void 0:o.style)===null||A===void 0?void 0:A.arrowMark))return x==null||x.classList.add(Dh),x==null||x.classList.remove(Il),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const n=this._rootElement;n!=null&&n.parentElement&&n.parentElement.removeChild(n),(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,n,o,r){const s=this._rootElement;this._canBindToCell(t,e,n)?(this._bindToCell(t,e,n,o==null?void 0:o.position,o==null?void 0:o.referencePosition,r),s==null||s.classList.add(Dh),s==null||s.classList.remove(Il)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout(()=>{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Dh),e.classList.add(Il))},(t=this._disappearDelay)!==null&&t!==void 0?t:0);else{const e=this._rootElement;e!=null&&e.parentElement&&(e.classList.remove(Dh),e.classList.add(Il))}}_canBindToCell(t,e,n){const o=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{bottom:s,left:l,right:a,top:h}=o;if(t.isFrozenCell(e,n))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,n,o,r,s,l){const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:n}),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 m=a.clientWidth,b=a.clientHeight;if(!o&&!r)return!1;{const T=this.getComputedPosition(t,e,n,o,r,s,l);f=T.x,g=T.y}a.style.left=`${f}px`,a.style.top=`${g}px`,sm()&&(a.style.fontSize="11px");const{x1:C,x2:_,y1:w,y2:y}=t.stateManager.menu.bounds,S=f,R=S+m,A=g,x=S+b;return!(t.stateManager.menu.isShow&&C<R&&_>S&&y>A&&w<x)}return!1}getComputedPosition(t,e,n,o,r,s,l){var a;const h=this._rootElement,d=t.getCellRangeRelativeRect({col:e,row:n}),{x:u,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:g,height:f,x:p,y:m}=t.internalProps.element.getBoundingClientRect(),{width:b}=d;let C,_;const w=Math.min(.8*g,4*b);h.style.maxWidth=`${w}px`;const y=h.clientWidth,S=h.clientHeight,R=l?6:0;if(o)_=o.x,C=o.y+R,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(r){let A=(a=r.placement)!==null&&a!==void 0?a:nn.bottom;const x=r.rect.left+r.rect.width/2,T=r.rect.top+r.rect.height/2,M=r.rect.top,B=r.rect.bottom,P=r.rect.left,F=r.rect.right;let H=0;const E=()=>{H++,H>=4||(this.removeStyleFromTriangle(),A===nn.top?(_=x-y/2,C=M-S-R,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",s&&C<0&&(A=nn.right,E())):A===nn.bottom?(_=x-y/2,C=B+R,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",s&&C+S>f&&(A=nn.left,E())):A===nn.left?(C=T-S/2,_=P-y-R,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",s&&_<0&&(A=nn.top,E())):A===nn.right&&(C=T-S/2,_=F+R,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",s&&_+y>g&&(A=nn.bottom,E())))};E()}return s&&(_<0?_=0:_+h.offsetWidth>g&&(_=g-h.offsetWidth)),{x:_+p-u,y:C+m-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,n,o,r,s){const l=this.getComputedPosition(t,e,n,o,r,s),a=l.x,h=l.y;this._rootElement.style.left=`${a}px`,this._rootElement.style.top=`${h}px`}}class C9 extends m9{createTooltipElementInternal(){return new b9}}const y9={"bubble-tooltip":function(i){return new C9(i)}};class _9{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const n=this._tooltipInstances;for(const o in n)(e=(t=n[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,n){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,n,this.confine)){const l=this._table.getCellRange(t,e);this._attachInfo={range:l,instance:s,tooltipOptions:n}}}_move(t,e,n){const o=this._attachInfo;if(!o||!qi(o.range,t,e))return;const{instance:r}=o;r==null||r.moveTooltipElement(t,e,n,this.confine)}moveToPosition(t,e,n,o){const r=this._attachInfo;if(!r||!qi(r.range,t,e))return;const{instance:s}=r;this._attachInfo.tooltipOptions.position=n,this._attachInfo.tooltipOptions.referencePosition=o,s==null||s.locateTooltipElement(t,e,n,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 n=this._attachInfo;return!!n&&qi(n.range,t,e)}_bindTableEvent(t){t.on(lt.MOUSEENTER_CELL,e=>{if(sm())return;const{x1:n,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>n&&e.x<o&&e.y>r&&e.y<s)return;const{col:l,row:a}=e;this.showTooltip(l,a)}),t.on(lt.MOUSEMOVE_CELL,e=>{var n,o;if(!sm()){if(!((o=(n=this._attachInfo)===null||n===void 0?void 0:n.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(lt.MOUSELEAVE_CELL,e=>{this._unbindFromCell()}),t.on(lt.SELECTED_CELL,e=>{this._isBindCell(e.col,e.row)&&this._unbindFromCell()}),t.on(lt.MOUSELEAVE_TABLE,e=>{this._unbindFromCell()}),t.on(lt.SCROLL,e=>{this._unbindFromCell()})}showTooltip(t,e){var n,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:nn.bottom,rect:h},disappearDelay:(n=l.internalProps.tooltip.overflowTextTooltipDisappearDelay)!==null&&n!==void 0?n:0,style:l.theme.tooltipStyle}}else if(ce((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}
309
- ${h}`:h,referencePosition:{placement:nn.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 n=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=y9["bubble-tooltip"](n))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const Pg=()=>{Et.registerComponent("axis",UV),Et.registerFunction("computeAxisComponentWidth",XV),Et.registerFunction("computeAxisComponentHeight",qV),Et.registerFunction("getAxisConfigInPivotChart",V8)},Hg=()=>{Et.registerComponent("emptyTip",JV)},Eg=()=>{Et.registerFunction("createLegend",a9)},Lg=()=>{Et.registerComponent("menuHandler",f9)},kg=()=>{Et.registerComponent("title",p9)},Fg=()=>{Et.registerComponent("tooltipHandler",_9)};class w9{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",e=>{e.scrollDirection==="vertical"&&this.updateGroupTitle()}),this.table.on("resize_column",e=>{this.updateGroupTitle()})}updateGroupTitle(){this.table.scrollTop===0?(this.titleRows=[],this.showedTitleRows=[]):this.skipStartRow!==-1&&this.skipEndRow!==-1&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){st(t)||(t=[t]),st(e)||(e=[e]);for(let l=0;l<t.length;l++){const a=t.slice(0,l+1);this.table.dataSource.getRaw(a)}const n=[],o=e.length===t.length+1;let r=t.slice(0,o?t.length:t.length-1);const s=this.table.dataSource.currentIndexedData;for(let l=this.rowNow-this.table.columnHeaderLevelCount;l>=0;l--){const a=s[l];if(st(a)&&r.length===a.length){let h=!0;for(let d=0;d<a.length;d++)if(a[d]!==r[d]){h=!1;break}h&&(n.push(l+this.table.columnHeaderLevelCount),r=r.slice(0,r.length-1))}else if(a===t[0]){n.push(l+this.table.columnHeaderLevelCount);break}}this.titleRows=n.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:n}=x9(t);this.showedTitleRows.length=0;let o=0;for(let r=0;r<t.colCount;r++){let s;r<t.frozenColCount?(s=new ue({x:t.getColsWidth(0,r-1),y:t.getFrozenRowsHeight()}),n.add(s)):(s=new ue({x:t.getColsWidth(t.frozenColCount,r-1),y:t.getFrozenRowsHeight()}),e.add(s)),s.col=r;for(let l=0;l<this.titleRows.length;l++){const a=this.titleRows[l];if(S9(a,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){r===0&&o++;continue}r===0&&this.showedTitleRows.push(a);const h=t.scenegraph.getCell(r,a);if(h.role==="cell"){const d=xT(h);d.setAttributes({y:40*l}),s.add(d)}else{const d=xo(r,a,t,!0,!0);d.setAttributes({y:40*l}),s.add(d)}}}o>0&&this.skipStartRow===-1&&this.skipEndRow===-1&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function S9(i,t,e,n){return i===t&&i!==e+n.length-1?!0:i===e+n.indexOf(i)+1&&i<t}function xT(i){const t=i.clone();if(t.role=i.role,t.col=i.col,t.row=i.row,t.mergeStartCol=i.mergeStartCol,t.mergeStartRow=i.mergeStartRow,t.mergeEndCol=i.mergeEndCol,t.mergeEndRow=i.mergeEndRow,t.contentWidth=i.contentWidth,t.contentHeight=i.contentHeight,t.role==="cell"){const e=Ie({x:0,y:0,width:t.attribute.width,height:t.attribute.height});t.add(e)}if(i.type==="group"){const e=t;i.forEachChildren(n=>{const o=xT(n);e.add(o)})}return t}function x9(i){const t=i.scenegraph.colHeaderGroup,e=i.scenegraph.cornerHeaderGroup;if(!t.border){const r=Ie({x:0,y:0,width:0,height:0,cursor:"pointer"});t.add(r),t.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Lr(a),{col:d,row:u}=h;AT(u-l.indexOf(u),i)})}if(!e.border){const r=Ie({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(r),e.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Lr(a),{col:d,row:u}=h;AT(u-l.indexOf(u),i)})}const n=t.border.shadowRoot,o=e.border.shadowRoot;return n.removeAllChild(),o.removeAllChild(),{shadowGroup:n,shadowGroupFrozen:o}}function AT(i,t){const e=t.getDrawRange();if(z(i)&&i>=t.frozenRowCount){const n=t.getFrozenRowsHeight(),o=t.getRowsHeight(0,i-1);t.scrollTop=Math.min(o-n,t.getAllRowsHeight()-e.height)-1}t.scenegraph.updateNextFrame()}const A9=()=>{Et.registerComponent("listTreeStickCellPlugin",w9)},R9={};function T9(){return rh(R9,wg)}function M9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j;const G=T9()[d],Z=f._getCellStyle(o,r),et=Fc("padding",Z,o,r,f);if(z(et)&&(a=et),!i){const gt=xs(o,r,p,f);b&&(i=f.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(w=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.lineWidth)!==null&&w!==void 0?w:void 0,fill:(S=(y=p==null?void 0:p.group)===null||y===void 0?void 0:y.fill)!==null&&S!==void 0?S:void 0,stroke:(A=(R=p==null?void 0:p.group)===null||R===void 0?void 0:R.stroke)!==null&&A!==void 0?A:void 0,strokeArrayWidth:gt,strokeArrayColor:(T=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.strokeArrayColor)!==null&&T!==void 0?T:void 0,cursor:(B=(M=p==null?void 0:p.group)===null||M===void 0?void 0:M.cursor)!==null&&B!==void 0?B:void 0,lineDash:(F=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),i&&i.role==="cell"||((i=new ue({x:e,y:n,width:s,height:l,lineWidth:(E=(H=p==null?void 0:p.group)===null||H===void 0?void 0:H.lineWidth)!==null&&E!==void 0?E:void 0,fill:(I=(k=p==null?void 0:p.group)===null||k===void 0?void 0:k.fill)!==null&&I!==void 0?I:void 0,stroke:(D=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&D!==void 0?D:void 0,strokeArrayWidth:gt,strokeArrayColor:(W=(O=p==null?void 0:p.group)===null||O===void 0?void 0:O.strokeArrayColor)!==null&&W!==void 0?W:void 0,cursor:($=(N=p==null?void 0:p.group)===null||N===void 0?void 0:N.cursor)!==null&&$!==void 0?$:void 0,lineDash:(Y=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Y!==void 0?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}if(i.AABBBounds.width(),C&&Array.isArray(f.getCellValue(o,r))||!C){const gt=new Rl(m,{stroke:!1,x:a[3],y:a[0],canvas:(j=f.canvas)!==null&&j!==void 0?j:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:G,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});i.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return i}function B9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U;if(!i){const et=xs(o,r,f,g);b&&(i=g.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:l,height:a,lineWidth:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.lineWidth)!==null&&_!==void 0?_:void 0,fill:(y=(w=f==null?void 0:f.group)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:void 0,stroke:(R=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.stroke)!==null&&R!==void 0?R:void 0,strokeArrayWidth:et,strokeArrayColor:(x=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.strokeArrayColor)!==null&&x!==void 0?x:void 0,cursor:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(P=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),i&&i.role==="cell"||((i=new ue({x:e,y:n,width:l,height:a,lineWidth:(H=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.lineWidth)!==null&&H!==void 0?H:void 0,fill:(k=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.fill)!==null&&k!==void 0?k:void 0,stroke:(L=(I=f==null?void 0:f.group)===null||I===void 0?void 0:I.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:et,strokeArrayColor:(O=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&O!==void 0?O:void 0,cursor:(N=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.cursor)!==null&&N!==void 0?N:void 0,lineDash:(U=($=f==null?void 0:f.group)===null||$===void 0?void 0:$.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}let Y;if(c){let et=o,gt=r;m&&(et=m.start.col,gt=m.start.row),Y=g.getCellIcons(et,gt)}let j=0,G=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:et,rightIconWidth:gt,absoluteLeftIconWidth:vt,absoluteRightIconWidth:it}=zc(Y,i,m,g);j=et+gt,G=et,i.forEachChildren(nt=>{nt.role==="icon-left"?nt.setAttribute("x",nt.attribute.x+h[3]):nt.role==="icon-right"?nt.setAttribute("x",nt.attribute.x+l-gt-h[1]):nt.role==="icon-absolute-right"&&nt.setAttribute("x",nt.attribute.x+l-it-h[1])}),i.forEachChildren(nt=>{u==="middle"?nt.setAttribute("y",(a-nt.AABBBounds.height())/2):u==="bottom"?nt.setAttribute("y",a-nt.AABBBounds.height()-h[2]):nt.setAttribute("y",h[0])})}const Z=P9(o,r,s-j,l,a,h,f,p,g);return Z&&i.appendChild(Z),Z.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],d==="center"?Z.setAttribute("x",h[3]+G+(l-Z.AABBBounds.width())/2):d==="right"?Z.setAttribute("x",h[3]+G+l-Z.AABBBounds.width()):Z.setAttribute("x",h[3]+G),u==="middle"?Z.setAttribute("y",h[0]+(a-Z.AABBBounds.height())/2):u==="bottom"?Z.setAttribute("y",h[0]+a-Z.AABBBounds.height()):Z.setAttribute("y",h[0]),i}function P9(i,t,e,n,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(i,t),f=wt("size",g,i,t,a),p=wt("spaceBetweenTextAndIcon",g,i,t,a),m=wt("defaultFill",g,i,t,a),b=wt("defaultStroke",g,i,t,a),C=wt("disableFill",g,i,t,a),_=wt("checkedFill",g,i,t,a),w=wt("checkedStroke",g,i,t,a),y=wt("disableCheckedFill",g,i,t,a),S=wt("disableCheckedStroke",g,i,t,a),R=wt("checkIconImage",g,i,t,a),A=wt("indeterminateIconImage",g,i,t,a),x=a.getCellValue(i,t),T=a.getCellOriginValue(i,t);let M,B,P=(h=x)!==null&&h!==void 0?h:"";pe(x)?(M=x.checked,B=x.disable,P=(d=x.text)!==null&&d!==void 0?d:""):typeof x=="boolean"&&(M=x,P=""),M=a.stateManager.syncCheckedState(i,t,l.field,M);const F=uo(i,t,a),H=a._getCellStyle(i,t),E=(u=H.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:k}=H,{checked:I,disable:L}=l;if(M==null||typeof M=="function"){const Y=ii(I,{col:i,row:t,table:a,context:null,value:x,dataValue:T});M=a.stateManager.syncCheckedState(i,t,l.field,Y)}const D=ii(L,{col:i,row:t,table:a,context:null,value:x,dataValue:T}),O=e==="auto",W=a.isAutoRowHeight(t),N={text:P.length===1?P[0]:P,maxLineWidth:O?1/0:n-(r[1]+r[3]+F)-f-p,textBaseline:"top",autoWrapText:E,lineClamp:k,wordBreak:"break-word",heightLimit:W?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:F,whiteSpace:P.length!==1||E?"normal":"no-wrap"},$={x:0,y:0,text:s.text?Object.assign({},s.text,N):N,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=B??D)!==null&&c!==void 0&&c};M==="indeterminate"?($.checked=void 0,$.indeterminate=!0):($.checked=M,$.indeterminate=void 0),m&&($.box.fill=m),b&&($.box.stroke=b),C&&($.box.disableFill=C),_&&($.box.checkedFill=_),w&&($.box.checkedStroke=w),y&&($.box.disableCheckedFill=y),S&&($.box.disableCheckedStroke=S),R&&($.icon.checkIconImage=R),A&&($.icon.indeterminateIconImage=A);const U=new Tr($);return U.name="checkbox",U}function H9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,R,A,x,T;if(!i){const P=xs(o,r,g,c);(i=new ue({x:e,y:n,width:l,height:a,lineWidth:(m=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&m!==void 0?m:void 0,fill:(C=(b=g==null?void 0:g.group)===null||b===void 0?void 0:b.fill)!==null&&C!==void 0?C:void 0,stroke:(w=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.stroke)!==null&&w!==void 0?w:void 0,strokeArrayWidth:P,strokeArrayColor:(S=(y=g==null?void 0:g.group)===null||y===void 0?void 0:y.strokeArrayColor)!==null&&S!==void 0?S:void 0,cursor:(A=(R=g==null?void 0:g.group)===null||R===void 0?void 0:R.cursor)!==null&&A!==void 0?A:void 0,lineDash:(T=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.lineDash)!==null&&T!==void 0?T:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i)}const{width:M,height:B}=E9(o,r,s,l,a,h,g,f,i,c);return l-=h[1]+h[3],a-=h[0]+h[2],i.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-M)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-M):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-B)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-B):P.setAttribute("y",h[0]+P.attribute.y)}),i}function E9(i,t,e,n,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(i,t);let g=wt("size",c,i,t,h),f=wt("innerRadius",c,i,t,h),p=wt("outerRadius",c,i,t,h);const m=wt("spaceBetweenTextAndIcon",c,i,t,h),b=wt("spaceBetweenRadio",c,i,t,h),C=wt("defaultFill",c,i,t,h),_=wt("defaultStroke",c,i,t,h),w=wt("disableFill",c,i,t,h),y=wt("checkedFill",c,i,t,h),S=wt("checkedStroke",c,i,t,h),R=wt("disableCheckedFill",c,i,t,h),A=wt("disableCheckedStroke",c,i,t,h);pt(p)?g=2*p:p=Math.round(g/2),(!pt(f)||f<0)&&(f=Math.round(p/7*3));const x=h.getCellValue(i,t),T=h.getCellOriginValue(i,t),M=uo(i,t,h),B=h._getCellStyle(i,t),P=(d=B.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:F}=B,H=e==="auto",E=h.heightMode==="autoHeight",k={maxLineWidth:H?1/0:n-(r[1]+r[3]+M)-g-m,textBaseline:"top",autoWrapText:P,lineClamp:F,wordBreak:"break-word",heightLimit:E?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:M},I={x:0,y:0,text:s.text?Object.assign({},s.text,k):k,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:m};C&&(I.circle.fill=C),_&&(I.circle.stroke=_),w&&(I.circle.disableFill=w),y&&(I.circle.checkedFill=y),S&&(I.circle.checkedStroke=S),R&&(I.circle.disableCheckedFill=R),A&&(I.circle.disableCheckedStroke=A);let L=0,D=0;const O=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(st(x))x.forEach((W,N)=>{const $=RT(W,T,N,i,t,l,P,I,h);$&&a.appendChild($),$.id=`radio-${i}-${t}-${N}`,$.render();const U=$.AABBBounds;O==="vertical"?($.setAttribute("y",D),D+=U.height()+(N!==x.length-1?b:0),L=Math.max(L,U.width())):O==="horizontal"&&($.setAttribute("x",L),L+=U.width()+(N!==x.length-1?b:0),D=Math.max(D,U.height()))});else{const W=RT(x,T,void 0,i,t,l,P,I,h);W&&a.appendChild(W),W.id=`radio-${i}-${t}`,W.render();const N=W.AABBBounds;L=N.width(),D=N.height()}return{width:L,height:D}}function RT(i,t,e,n,o,r,s,l,a){const h=L9(i,t,e,n,o,r,a),d=k9(i,t,n,o,r,a),u=pe(i)?i.text:vi(i)?"":i??"",c=xt({},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 eh(c);return g.name="radio",g}function L9(i,t,e,n,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return pe(i)?d=i.checked:typeof i=="boolean"&&(d=i),d=s.stateManager.syncRadioState(n,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=ii(r.checked,{col:n,row:o,table:s,context:null,value:i,dataValue:t}),d=s.stateManager.syncRadioState(n,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function k9(i,t,e,n,o,r){var s;let l;pe(i)&&(l=i.disable);const a=ii(o.disable,{col:e,row:n,table:r,context:null,value:i,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const zr=new sz,Nr=new cs;function F9(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L;if(!i){const O=xs(o,r,d,h);u&&(i=h.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,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:(b=(m=d==null?void 0:d.group)===null||m===void 0?void 0:m.stroke)!==null&&b!==void 0?b:void 0,strokeArrayWidth:O,strokeArrayColor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.strokeArrayColor)!==null&&_!==void 0?_:void 0,cursor:(y=(w=d==null?void 0:d.group)===null||w===void 0?void 0:w.cursor)!==null&&y!==void 0?y:void 0,lineDash:(R=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineDash)!==null&&R!==void 0?R:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),i&&i.role==="cell"||((i=new ue({x:e,y:n,width:s,height:l,lineWidth:(x=(A=d==null?void 0:d.group)===null||A===void 0?void 0:A.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=d==null?void 0:d.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=d==null?void 0:d.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:O,strokeArrayColor:(H=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=d==null?void 0:d.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=d==null?void 0:d.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}const D=I9(o,r,s,l,a,h);return D&&i.appendChild(D),i}function I9(i,t,e,n,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(i,t).sparklineSpec,h=r.getCellValue(i,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=n-=o[0]+o[2];if(typeof a=="function"){const _={col:i,row:t,dataValue:r.getCellOriginValue(i,t)||"",value:r.getCellValue(i,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(i,t)),table:r};s=a(_),l=TT(s,d,u,e,n)}else s=a,l=TT(a,d,u,e,n);const g=[],f=[];let p,m;if(typeof s.xField=="object")zr.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const _=h.map(w=>w[s.xField]);zr.domain(_),p=s.xField}else Array.isArray(h)&&(zr.domain(Array.from({length:h.length},(_,w)=>w)),p=s.xField);if(zr.range([0,e]),typeof s.yField=="object")Nr.domain(s.yField.domain),m=s.yField.field;else if(typeof s.yField=="string"){const _=MT(h,s.yField);Nr.domain([Math.min(..._),Math.max(..._)]),m=s.yField}else if(Array.isArray(h)){const _=MT(h);Nr.domain([Math.min(..._),Math.max(..._)]),m=s.yField}if(Nr.range([0,n]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const _=h.map(y=>y[s.xField.field]),w=s.xField.domain;for(let y=0;y<w.length;y++){let S=!1;for(let R=0;R<_.length;R++)if(w[y]===_[R]){const A=h[R];if(!z(A[p])||!z(A[m]))break;g.push({x:0+zr.scale(A[p]),y:c-Nr.scale(A[m]),defined:z(A[m])}),f.push(A),S=!0;break}S||(g.push({x:0+zr.scale(w[y]),y:0,defined:!1}),f.push({[p]:w[y],[m]:null}))}}else for(let _=0;_<h.length;_++){const w=h[_];g.push({x:0+zr.scale(p?w[p]:_),y:c-Nr.scale(m?w[m]:w),defined:z(m?w[m]:w),rawData:w}),f.push(w)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=zr.step(),b.min=Nr.range()[0],b.max=Nr.range()[1];const C=l.getChildByName("sparkline-symbol-group");if(C){const _=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let w=0;w<g.length;w++){const{x:y,y:S,defined:R}=g[w];if(R){const A=ka({x:y,y:S});C.appendChild(A)}}else if(_)for(let w=0;w<g.length;w++){const{x:y,y:S,defined:R}=g[w];if(R&&(!g[w-1]||!g[w-1].defined)&&(!g[w+1]||!g[w+1].defined)){const A=ka({x:y,y:S});C.appendChild(A)}}}return l}function TT(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A,x,T;let M;M=typeof i=="function"?i(null):i;const B=new ue({x:t,y:e,width:n,height:o,stroke:!1,fill:!1});if(B.name="sparkline",M.type==="line"){const P=mn({x:0,y:0,curveType:M.smooth?"monotoneX":"linear",stroke:(l=(s=(r=M.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=M.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",B.addChild(P),M.crosshair&&(P.hover=(c=(u=M.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const F=new ue({x:0,y:0,width:n,height:o,stroke:!1,fill:!1});F.name="sparkline-symbol-group",F.setTheme({symbol:{stroke:(p=(f=(g=M.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(C=(b=(m=M.point)===null||m===void 0?void 0:m.style)===null||b===void 0?void 0:b.strokeWidth)!==null&&C!==void 0?C:1,fill:(y=(w=(_=M.point)===null||_===void 0?void 0:_.style)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:"#000",size:2*((A=(R=(S=M.point)===null||S===void 0?void 0:S.style)===null||R===void 0?void 0:R.size)!==null&&A!==void 0?A:3),symbolType:"circle"}}),B.addChild(F),F.hover=(T=(x=M.point)===null||x===void 0?void 0:x.hover)!==null&&T!==void 0&&T}return B}function MT(i,t){const e=[];for(let n=0;n<i.length;n++){const o=i[n];z(t)&&z(o[t])?e.push(o[t]):!z(t)&&z(o)&&e.push(o)}return e}const pv=Cn();function D9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et;const gt=g._getCellStyle(n,o),vt=Fc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=ee((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(vt)&&(h=vt),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const it=xs(n,o,f,g);let nt,bt;if(m&&(nt=g.scenegraph.highPerformanceGetCell(n,o,!0),nt&&nt.role==="cell"&&nt.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(A=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.lineWidth)!==null&&A!==void 0?A:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:it,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),nt&&nt.role==="cell"||(nt=new ue({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(W=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&W!==void 0?W:void 0,stroke:($=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:it,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(et=(Z=f==null?void 0:f.group)===null||Z===void 0?void 0:Z.lineDash)!==null&&et!==void 0?et:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),nt.role="cell",nt.col=n,nt.row=o,i==null||i.addCellGroup(nt)),c){let _t=n,ut=o;p&&(_t=p.start.col,ut=p.start.row),bt=g.getCellIcons(_t,ut)}let Ct=0,at=0;if(Array.isArray(bt)&&bt.length!==0){const{leftIconWidth:_t,rightIconWidth:ut,absoluteLeftIconWidth:It,absoluteRightIconWidth:Ut}=zc(bt,nt,p,g);Ct=_t,at=ut,nt.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ut-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Ut-h[1])}),nt.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),nt._cellLeftIconWidth=Ct,nt._cellRightIconWidth=at}const rt=g.getCellValue(n,o),ct=document.createElement("video");ct.addEventListener("loadeddata",()=>{a&&fA(n,o,ct.videoWidth,ct.videoHeight,g.scenegraph,h,nt);const{width:_t,height:ut,isMerge:It}=Sl(nt,g);if(l){const{width:ye,height:Oe}=kc(ct.videoWidth,ct.videoHeight,_t-h[1]-h[3],ut-h[0]-h[2]),Be=Pm(0,0,_t,ut,ye,Oe,d,u,h);ht.setAttributes({width:ye,height:Oe,x:Be.x,y:Be.y,dx:0})}else ht.setAttributes({x:h[3],y:h[0],width:_t-h[1]-h[3],height:ut-h[2]-h[0],dy:0});It&&Hm(nt.mergeStartCol,nt.mergeEndCol,nt.mergeStartRow,nt.mergeEndRow,g);const{width:Ut,height:yt}=Sl(nt,g),Tt=Math.floor(Math.min(Ut-h[1]-h[3],yt-h[2]-h[0])/2),kt=0+(Ut>ht.attribute.width?ht.attribute.x-0+ht.attribute.width/2:Ut/2),oe=0+(yt>ht.attribute.height?ht.attribute.y-0+ht.attribute.height/2:yt/2),re=new vs({x:kt-Tt/2,y:oe-Tt/2,width:Tt,height:Tt,image:pv.play.svg,cursor:pv.play.cursor});re.name="play-icon",nt.appendChild(re),g.scenegraph.updateNextFrame()}),ct.onerror=()=>{ht.image=pv.damage_pic.svg},ct.src=rt,ct.setAttribute("preload","auto");const ht=pu({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ct,cursor:"pointer"});return ht.name="image",ht.keepAspectRatio=l,ht.textAlign=d,ht.textBaseline=u,nt.appendChild(ht),nt}function O9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt;const bt=i._getCellStyle(r,s),Ct=Fc("padding",bt,r,s,i);z(Ct)&&(d=Ct),!((_=m==null?void 0:m.text)===null||_===void 0)&&_.textAlign&&(u=(w=m==null?void 0:m.text)===null||w===void 0?void 0:w.textAlign),!((y=m==null?void 0:m.text)===null||y===void 0)&&y.textBaseline&&(c=(S=m==null?void 0:m.text)===null||S===void 0?void 0:S.textBaseline);const at=i.isAutoRowHeight(s),rt=l==="auto",ct=(R=bt.autoWrapText)!==null&&R!==void 0?R:i.internalProps.autoWrapText,ht=bt.lineClamp,_t=xs(r,s,m,i);let ut;if(C&&(ut=i.scenegraph.getCell(r,s,!0),ut&&ut.role==="cell"&&ut.setAttributes({x:n,y:o,width:a,height:h,lineWidth:(x=(A=m==null?void 0:m.group)===null||A===void 0?void 0:A.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=m==null?void 0:m.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=m==null?void 0:m.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(H=(F=m==null?void 0:m.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=m==null?void 0:m.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=m==null?void 0:m.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),ut&&ut.role==="cell"||(ut=new ue({x:n,y:o,width:a,height:h,lineWidth:(O=(D=m==null?void 0:m.group)===null||D===void 0?void 0:D.lineWidth)!==null&&O!==void 0?O:void 0,fill:(N=(W=m==null?void 0:m.group)===null||W===void 0?void 0:W.fill)!==null&&N!==void 0?N:void 0,stroke:(U=($=m==null?void 0:m.group)===null||$===void 0?void 0:$.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(j=(Y=m==null?void 0:m.group)===null||Y===void 0?void 0:Y.strokeArrayColor)!==null&&j!==void 0?j:void 0,cursor:(Z=(G=m==null?void 0:m.group)===null||G===void 0?void 0:G.cursor)!==null&&Z!==void 0?Z:void 0,lineDash:(gt=(et=m==null?void 0:m.group)===null||et===void 0?void 0:et.lineDash)!==null&&gt!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),ut.role="cell",ut.col=r,ut.row=s,e==null||e.addCellGroup(ut)),f&&ut.appendChild(f),p){const It=t;let Ut;if(g){let yt=r,Tt=s;b&&(yt=b.start.col,Tt=b.start.row),Ut=i.getCellIcons(yt,Tt)}if(tN(ut,Ut,It,d,rt,at,ct,typeof ht=="number"?ht:void 0,ut.attribute.width,ut.attribute.height,u,c,i,m,b),(vt=m==null?void 0:m._vtable)===null||vt===void 0?void 0:vt.marked){const yt=o0({x:ut.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});yt.name="mark",ut.appendChild(yt)}}return f&&ut.setAttributes({width:Math.max(ut.attribute.width,(it=f.attribute.width)!==null&&it!==void 0?it:0),height:Math.max(ut.attribute.height,(nt=f.attribute.height)!==null&&nt!==void 0?nt:0)}),ut}function z9(i,t,e,n,o,r,s,l,a,h){var d,u,c,g,f,p;i.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[i.dependField])!==null&&u!==void 0?u:o),i.barType=(c=i.barType)!==null&&c!==void 0?c:"default",i.min=(g=ii(i.min,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,i.max=(f=ii(i.max,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:i.min+100;let m=0;m=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let b=e,C=m,_=0;pt(a.theme._contentOffset)&&(_=a.theme._contentOffset);const w=new ue({x:-_,y:-_,width:b,height:C});w.name="progress-bar";const{showBar:y,barColor:S,barBgColor:R,barPositiveColor:A,barNegativeColor:x,barAxisColor:T,barRightToLeft:M,showBarMark:B,barMarkPositiveColor:P,barMarkNegativeColor:F,barMarkWidth:H,barMarkPosition:E}=t;let{barHeight:k,barBottom:I,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((G,Z)=>{if(typeof G=="string"&&vc.endsWith(G,"%")){const et=Number(G.substr(0,G.length-1));return Z===0||Z===2?m*et/100:e*et/100}return Number(G)});const D=ee(wt("borderLineWidth",t,r,s,a)),O=Math.max(L[0],Math.ceil(D[0]/2)),W=Math.max(L[1],Math.floor(D[1]/2)),N=Math.max(L[2],Math.floor(D[2]/2)),$=Math.max(L[3],Math.ceil(D[3]/2));b-=W+$,C-=N+O,s===a.rowCount-1&&[0,"0"].includes(I)&&(C-=1);const U=O,Y=$,j=b;if(typeof k=="string"&&vc.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=C*k/100):k=Number(k),typeof I=="string"&&vc.endsWith(I,"%")?(I=Number(I.substr(0,I.length-1)),I=C*I/100):I=Number(I),ii(y,{col:r,row:s,table:a,context:null,value:n,dataValue:o})){let G=`${o}`;vc.endsWith(G,"%")&&(G=G.substr(0,G.length-1));const Z=Number(G);if(isNaN(Z))return w;if(((p=i.barType)!==null&&p!==void 0?p:"default")==="default"){const et=Z<i.min?0:Z>i.max?1:(Z-i.min)/(i.max-i.min),gt=b,vt=U+C-k-I;let it=Math.min(gt*et,gt);const nt=M?Y+j-it:Y;r!==a.colCount-1||et!==1||M||(it-=1);const bt=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et});if(bt){const rt=Ie({x:nt,y:vt,width:gt,height:k,fill:bt});w.addChild(rt)}const Ct=ii(S,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",at=Ie({x:nt,y:vt,width:it,height:k,fill:Ct});w.addChild(at)}else if(i.barType==="negative"){const et=i.min<0?-i.min:0,gt=i.max>0?i.max:0,vt=et/(et+gt),it=1-vt,nt=Z>0?Z/gt:0,bt=Z<0?-Z/et:0,Ct=b,at=U+C-k-I,rt=Y,ct=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt});if(ct){const Be=Ie({x:rt,y:at,width:Ct,height:k,fill:ct});w.addChild(Be)}const ht=M?it*Ct:vt*Ct,_t=Math.min(Ct*vt*bt,Ct),ut=M?{left:rt+ht,top:at,width:_t,height:k}:{left:rt+ht-_t,top:at,width:_t,height:k},It=ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:bt})||"#20a8d8",Ut=Ie({x:ut.left,y:ut.top,width:ut.width,height:ut.height,fill:It});w.addChild(Ut);let yt=Math.min(Ct*it*nt,Ct);r!==a.colCount-1||nt!==1||M||(yt-=1);const Tt=M?{left:rt+ht-yt,top:at,width:yt,height:k}:{left:rt+ht,top:at,width:yt,height:k},kt=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt})||"#20a8d8",oe=Ie({x:Tt.left,y:Tt.top,width:Tt.width,height:Tt.height,fill:kt});w.addChild(oe);const re=M?ut.left:Tt.left,ye=ii(T,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt}),Oe=mn({x:0,y:0,stroke:ye,lineWidth:1,lineDash:[2,2],points:[{x:re,y:0},{x:re,y:m}]});if(w.addChild(Oe),B&&(nt||bt)){const Be=H,Ee=[];let At;if(nt>0)if(At=ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt})||"#20a8d8",E==="right"){const Bt=M?Tt.left+H/2:Tt.left+Tt.width-H/2;Ee.push({x:Bt,y:Tt.top}),Ee.push({x:Bt,y:Tt.top+Tt.height})}else E==="bottom"&&(Ee.push({x:Tt.left,y:Tt.top+Tt.height-H/2}),Ee.push({x:Tt.left+Tt.width,y:Tt.top+Tt.height-H/2}));else if(bt>0)if(At=ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:bt})||"#20a8d8",E==="right"){const Bt=M?ut.left+ut.width-H/2:ut.left+H/2;Ee.push({x:Bt,y:ut.top}),Ee.push({x:Bt,y:ut.top+ut.height})}else E==="bottom"&&(Ee.push({x:ut.left,y:ut.top+ut.height-H/2}),Ee.push({x:ut.left+ut.width,y:ut.top+ut.height-H/2}));const mt=mn({x:0,y:0,stroke:At,lineWidth:Be,points:Ee});w.addChild(mt)}}else if(i.barType==="negative_no_axis"){const et=i.min<0?-i.min:0,gt=i.max>0?i.max:0,vt=Math.max(et,gt),it=vt===0?0:Math.abs(Z)/vt,nt=b;let bt=Math.min(nt*it,nt);r!==a.colCount-1||it!==1||M||(bt-=1);const Ct=U+C-k-I,at=M?Y+j-bt:Y,rt=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it});if(rt){const ut=Ie({x:at,y:Ct,width:nt,height:k,fill:rt});w.addChild(ut)}const ct={left:at,top:Ct,width:bt,height:k};let ht;ht=Z>=0?ii(A,{col:r,row:s,table:a,context:null,value:n,percentile:it,dataValue:o})||"#20a8d8":ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it})||"#20a8d8";const _t=Ie({x:ct.left,y:ct.top,width:ct.width,height:ct.height,fill:ht});if(w.addChild(_t),B&&Z){const ut=H,It=[];let Ut;if(Ut=Z>=0?ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it})||"#20a8d8":ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it})||"#20a8d8",E==="right"){const Tt=M?ct.left+H/2:ct.left+ct.width-H/2;It.push({x:Tt,y:ct.top}),It.push({x:Tt,y:ct.top+ct.height})}else E==="bottom"&&(It.push({x:ct.left,y:ct.top+ct.height-H/2}),It.push({x:ct.left+ct.width,y:ct.top+ct.height-H/2}));const yt=mn({x:0,y:0,stroke:Ut,lineWidth:ut,points:It});w.addChild(yt)}}}return w}function N9(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(i=Math.min(i,0),t=Math.max(t,0)),e==null?void 0:e.expand){const b=i,C=t;z(e.expand.min)&&(i=b-(C-b)*e.expand.min),z(e.expand.max)&&(t=C+(C-b)*e.expand.max)}let p,m;if(pt(e==null?void 0:e.min)&&(i=e.min),pt(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new qa,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Za,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new cs,p.domain([i,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let b=(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;ce(b)&&(b=b({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:kh.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(b=Math.max(10,b)),Mt(e.min)&&Mt(e.max)?p.nice(b):z(e.min)&&Mt(e.max)?p.niceMax(b):Mt(e.min)&&z(e.max)&&p.niceMin(b)}return delete p._niceType,r||(m=p.ticks(pt(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:m}}const Ig=()=>{Et.registerFunction("createChartCellGroup",M9),Et.registerFunction("getAxisDomainRangeAndLabels",N9)},Dg=()=>{Et.registerFunction("createCheckboxCellGroup",B9)},Og=()=>{Et.registerFunction("createImageCellGroup",nN)},zg=()=>{Et.registerFunction("createProgressBarCell",z9)},Ng=()=>{Et.registerFunction("createRadioCellGroup",H9)},Wg=()=>{Et.registerFunction("createSparkLineCellGroup",F9)},Dl=()=>{Et.registerFunction("createTextCellGroup",O9)},Vg=()=>{Et.registerFunction("createVideoCellGroup",D9)};Pg(),Hg(),Eg(),Lg(),kg(),Fg(),A9(),Ig(),Dg(),Og(),zg(),Ng(),Wg(),Dl(),Vg();class W9 extends bT{}Dl();class V9 extends bT{}function j9(i,t,e,n,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)n.includes(e[c])||a.push(o[c]);for(let c=0;c<n.length;c++)if(!e.includes(n[c])){const g={col:i,row:s+c};l.push(g)}let h=r.getParentCellId(i,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 BT={startInTotal:0,level:0};class hr{constructor(t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;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=Zi,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(x=>{typeof x=="string"?this.indicatorKeys.push(x):this.indicatorKeys.push(x.indicatorKey)}),this.columnDimensionTree=n,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(x=>{var T,M;if(x.chartSpec&&x.chartSpec.series&&x.chartSpec.series.length>1){const B=(M=(T=x.chartSpec.axes)!==null&&T!==void 0?T:this._table.pivotChartAxes)!==null&&M!==void 0?M:[];if(!B.length||B.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=nm(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((m=this.extensionRows)===null||m===void 0?void 0:m.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(x=>{const T=[];x.rows.forEach(M=>{typeof M=="string"?T.push(M):T.push(M.dimensionKey)}),this._extensionRowDimensionKeys.push(T),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(T)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let S,R=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((C=(b=this.dataset.records)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)!==0||this.dataset.customColTree||(R=this.columnsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol&&R.push(this.indicatorDimensionKey)),R=this.columnHeaderTitle?[""].concat(R):R;let A=[];if(this.rowHierarchyType==="tree"&&((_=this.extensionRows)===null||_===void 0?void 0:_.length)>=1){const x=[];x.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(T=>{x.push(T[0])}),A=this.extensionRows.reduce((T,M)=>T.concat(M.rows),[]),S=this.rowHeaderTitle?[""].concat(x):x}else S=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((y=(w=this.dataset.records)===null||w===void 0?void 0:w.length)!==null&&y!==void 0?y:0)!==0||this.dataset.customRowTree||(S=this.rowsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol||S.push(this.indicatorDimensionKey)),S=this.rowHeaderTitle?[""].concat(S):S;this.cornerHeaderObjs=this._addCornerHeaders(R,S,this.columnsDefine.concat(...this.rowsDefine,...A)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((x,T)=>(x[T.id]=T,x),{}),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(x=>{var T,M,B,P,F,H,E,k;!((T=x==null?void 0:x.style)===null||T===void 0)&&T.padding&&(this._chartPadding=x.style.padding),!((M=x.chartSpec)===null||M===void 0)&&M.barWidth&&typeof x.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(B=x.chartSpec)===null||B===void 0?void 0:B.barWidth);const I=(F=(P=x.chartSpec)===null||P===void 0?void 0:P.axes)===null||F===void 0?void 0:F.find(L=>L.type==="band");return I!=null&&I.bandSize&&(this._chartItemBandSize=I==null?void 0:I.bandSize,this._chartPaddingInner=(H=st(I.paddingInner)?I.paddingInner[0]:I.paddingInner)!==null&&H!==void 0?H:0,this._chartPaddingOuter=(E=st(I.paddingOuter)?I.paddingOuter[0]:I.paddingOuter)!==null&&E!==void 0?E:0),this._chartItemSpanSize>0||((k=x.chartSpec.series)===null||k===void 0||k.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,n;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:(n=t.cellType)!==null&&n!==void 0?n:"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,n,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()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n: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,n,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()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n: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,n,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<n.length;l++){const a=n[l];H8(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,n,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<n.length;d++){const u=n[d];E8(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,n){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=n.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=n.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=n.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=n.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=n.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 n=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],n.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=Le(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new He(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,n;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;(n=this._indicators)===null||n===void 0||n.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(z(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(z(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(z(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(z(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,n,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=(n=this.columnDimensionTree)===null||n===void 0?void 0:n.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&&Fh(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,n,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&&!(!((n=this.dataset.customRowTree)===null||n===void 0)&&n.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,n,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=(n=this._rowHeaderCellIds)===null||n===void 0?void 0:n.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&&Fh(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 n,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(n=this._cornerHeaderCellIds[e])===null||n===void 0?void 0:n[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 n;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(n=this._headerObjectMap[o])!==null&&n!==void 0?n:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var n,o;const r=this.getCellId(t,e);return((n=this._headerObjectMap[r])===null||n===void 0?void 0:n.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 n=this._columnHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var n,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 b=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,b),b}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const b=(o=(n=f.colHeaderPaths)===null||n===void 0?void 0:n.find(_=>_.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,C=z(b)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(_=>_.indicatorKey===b))!==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,C),C}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(b=>b.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,m=z(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(b=>b.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,m),m}getCellRange(t,e){var n,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<((n=this.colCount)!==null&&n!==void 0?n: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,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,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 n=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!n&&e>=0&&r>=0&&(n=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,n)),!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:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var n,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(n=r.colHeaderPaths)===null||n===void 0||n.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(n=>typeof n!="string"&&!!t&&n.indicatorKey===t)}findFullCellIds(t){const e=[];for(let n=0;n<t.length;n++){let o=t[n];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 n,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(n=this.rowsDefine)===null||n===void 0?void 0:n.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 n,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===Vt.collapse?Vt.expand:Vt.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((m,b)=>typeof b=="string"?m:m+(m?`/${b.title}`:`${b.title}`),""),field:void 0,headerType:(o=(n=this.rowHeaderTitle)===null||n===void 0?void 0:n.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=nm(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=j9(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 n,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(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((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(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((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,n=g;break}}}let l=0,a=0;if(n){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=n;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 n;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)&&(((n=this==null?void 0:this.cornerSetting)===null||n===void 0?void 0:n.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 n;return(n=this.getBody(t,e))===null||n===void 0?void 0:n.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,n;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(n=r,!0)),z(e)&&z(n))return{col:e,row:n+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 n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row);{const o=Le(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Le(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 n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(n.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(n.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,n.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:n.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===n.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(n.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(n.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(n.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,n.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:n.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,n,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(y=>this.colDimensionKeys.indexOf(y.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey),h=t.filter(y=>this.rowDimensionKeys.indexOf(y.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.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,S)=>{var R,A;return this.colDimensionKeys.indexOf((R=y.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((A=S.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)}),h==null||h.sort((y,S)=>{var R,A;return this.fullRowDimensionKeys.indexOf((R=y.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((A=S.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)}),a==null||a.forEach(y=>{y.isPivotCorner&&(d=!0)}),h==null||h.forEach(y=>{y.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[y])return{col:y+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 y=0;y<this.rowDimensionKeys.length;y++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:0}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[y])return{col:0,row:y}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((n=a[0])===null||n===void 0?void 0:n.dimensionKey)===this.colDimensionKeys[y])return{col:this.rowHeaderLevelCount-1,row:y}}let c,g,f,p,m=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(m=!0);let b,C,_=this.rowTree,w=this.columnTree;if(a)for(let y=0;y<a.length;y++){const S=a[y];for(let R=0;R<w.length;R++){const A=w[R];if(!z(S.indicatorKey)&&A.dimensionKey===S.dimensionKey&&A.value===S.value||z(S.indicatorKey)&&A.indicatorKey===S.indicatorKey){w=A.children,m&&!w?C=A:m||(C=A);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const y=h[h.length-1],S=this.headerObjects.filter(A=>((A==null?void 0:A.field)===y.dimensionKey||(A==null?void 0:A.field)===y.indicatorKey)&&(A==null?void 0:A.title)===y.value).map(A=>A.id),R=this._rowHeaderCellIds.filter(A=>S.indexOf(A[A.length-1])>=0).find(A=>{const x=this.findFullCellIds(A);return x.length===h.length&&x.every(T=>{const M=this._headerObjectMap[T];return h.find(B=>B.dimensionKey===M.field&&B.value===M.title)})});g=this._rowHeaderCellIds.indexOf(R)+this.columnHeaderLevelCount}else for(let y=0;y<h.length;y++){const S=h[y];for(let R=0;R<_.length;R++){const A=_[R];if(!z(S.indicatorKey)&&A.dimensionKey===S.dimensionKey&&A.value===S.value||z(S.indicatorKey)&&A.indicatorKey===S.indicatorKey&&(!z(S.value)||A.value===S.value)){_=A.children,(!m||_&&!_.some(x=>x.dimensionKey==="axis"))&&m||(b=A);break}}}if(u||!m||(b||z(g))&&C){if(b||u){g=this.columnHeaderLevelCount;const{startInTotal:y,level:S}=(s=b)!==null&&s!==void 0?s:BT;g+=y??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?S+1:S)+this.leftRowSeriesNumberColumnCount:0}if(C||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:y,level:S}=(l=C)!==null&&l!==void 0?l:BT;c+=y??0,p=this.columnHeaderTitle?S+1:S}return z(c)||z(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,n){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=n)}getChartInstance(t,e){var n,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(n=l.colHeaderPaths.find(d=>d.indicatorKey))===null||n===void 0?void 0:n.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 pT(this)}getDimension(t,e){var n,o;return e==="column"?(n=this.columnsDefine)===null||n===void 0?void 0:n.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))&&El(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&El(t,e,"col",this))return Et.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&&Fh(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&El(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&El(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&El(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&El(t,e,"col",this))):!1}getChartAxes(t,e){if(_V(t,e,this)||this.isAxisCell(t,e))return SV(t,e,this)}getRawChartSpec(t,e){return bV(t,e,this)}getChartSpec(t,e){return wV(t,e,this)}isShareChartSpec(t,e){return CV(t,e,this)}getChartDataId(t,e){return fT(t,e,this)}isNoChartDataRenderNothing(t,e){return yV(t,e,this)}setPagination(t){var e,n,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&z((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&z((n=this.pagination)===null||n===void 0?void 0:n.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(n=>{var o;(o=n.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var n,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(n=l.rowHeaderPaths)===null||n===void 0?void 0:n.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,n){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(z(n)&&z(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,n);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(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(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(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 n,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=(n=u.xField)!==null&&n!==void 0?n:(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(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.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 n=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(n)}),t==null||t.updateState(n)}}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 n=this._generateChartState();t==null||t.updateState(n)}}getIndicatorKeyInChartSpec(t,e){const n=this.getRawChartSpec(t,e),o=[];if(n){if(n.series||n.xField||n.yField)return this.indicatorsAsCol===!1?n.series?n.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(n.yField):n.series?n.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(n.xField),o;if(n.valueField&&o.push(n.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,n,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=PT((n=a==null?void 0:a.length)!==null&&n!==void 0?n: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=ee((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,n,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=PT((n=a==null?void 0:a.length)!==null&&n!==void 0?n: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=ee((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 n=this.getCellHeaderPaths(t,e),o=[];return n.colHeaderPaths.length&&n.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.rowHeaderPaths.length&&n.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var n;return(n=this.indicatorsDefine)===null||n===void 0?void 0:n.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return rv(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return rv(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return yg(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let n=yg(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=yg(o.rowTree,!0);n*=r}}),n}resetHeaderTree(){var t,e,n;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 He((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new He((n=this.rowTree)!==null&&n!==void 0?n:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=nm(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!!(z(t)&&z(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,n){this.getHeadNode(t,e).value=n;const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}changeCornerTitle(t,e,n){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Zi),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 n=t.slice();n.splice(0,n.length),this._rowHeaderCellIds_FULL[e]=n});else{const t=this.rowDimensionKeys.indexOf(Zi);this._rowHeaderCellIds_FULL.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[n]=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(Zi),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 n=t.slice();n.splice(0,n.length),this._cornerHeaderCellIds[e]=n});else{const t=this.rowDimensionKeys.indexOf(Zi);this._cornerHeaderCellIds.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[n]=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,n){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,n):this._getBodyCache.set(e,n))}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,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,n)}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,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,n)}}function PT(i,t,e,n){e===1&&(e=0);const o=$9(i,e,n),r=t/(1-e);return Math.ceil(o*r)}function $9(i,t,e){let n;return n=i===1?i+2*e:i-t+2*e,i?n>0?n:1:0}class mv{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 n=this.records[t];this.processRecord(n)}}processRecord(t){var e;const n=[],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&&n.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?n.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=n.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),n.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),n.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?n.pop():o.pop()))})}getTreeNode(t=[],e=[],n,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===n&&(t.splice(g,1),u=!0)}),u&&t.push(n),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===n&&(e.splice(g,1),u=!0)}),u&&e.push(n),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:z((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=[],n,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let m=!1;t.map((b,C)=>{b===n&&(t.splice(C,1),m=!0)}),m&&t.push(n),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let m=!1;e.map((b,C)=>{b===n&&(e.splice(C,1),m=!0)}),m&&e.push(n),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[n]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,n,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=[],n,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[n]=o,this.records.push(r),r}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,n){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]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function HT(i,t){let e="";for(let n=0;n<i.length;n++)e+=i[n],n!==i.length-1&&(e+=t);return e}class Oh{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt,bt;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=(m=this.dataConfig)===null||m===void 0?void 0:m.aggregationRules,this.derivedFieldRules=(b=this.dataConfig)===null||b===void 0?void 0:b.derivedFieldRules,this.mappingRules=(C=this.dataConfig)===null||C===void 0?void 0:C.mappingRules,this.calculatedFieldRules=(_=this.dataConfig)===null||_===void 0?void 0:_.calculatedFieldRules,this.calculatedFiledKeys=(y=(w=this.calculatedFieldRules)===null||w===void 0?void 0:w.map(Ct=>Ct.key))!==null&&y!==void 0?y:[],this.calculatedFieldDependIndicatorKeys=(R=(S=this.calculatedFieldRules)===null||S===void 0?void 0:S.reduce((Ct,at)=>{for(let rt=0;rt<at.dependIndicatorKeys.length;rt++)Ct.indexOf(at.dependIndicatorKeys[rt])===-1&&Ct.push(at.dependIndicatorKeys[rt]);return Ct},[]))!==null&&R!==void 0?R:[],this.totals=(A=this.dataConfig)===null||A===void 0?void 0:A.totals,this.rows=e,this.columns=n,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let Ct=0;Ct<this.calculatedFieldDependIndicatorKeys.length;Ct++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[Ct])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[Ct]);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=(M=(T=(x=this.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.grandTotalLabel)!==null&&M!==void 0?M:"总计",this.colSubTotalLabel=(F=(P=(B=this.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&F!==void 0?F:"小计",this.rowGrandTotalLabel=(k=(E=(H=this.totals)===null||H===void 0?void 0:H.row)===null||E===void 0?void 0:E.grandTotalLabel)!==null&&k!==void 0?k:"总计",this.rowSubTotalLabel=(D=(L=(I=this.totals)===null||I===void 0?void 0:I.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&D!==void 0?D:"小计",this.collectValuesBy=(O=this.dataConfig)===null||O===void 0?void 0:O.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((N=(W=this.rows)===null||W===void 0?void 0:W.length)!==null&&N!==void 0?N:0).fill(!1),this.colsIsTotal=new Array((U=($=this.columns)===null||$===void 0?void 0:$.length)!==null&&U!==void 0?U:0).fill(!1),((Y=this.totals)===null||Y===void 0?void 0:Y.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let Ct=0,at=(et=(Z=(G=(j=this.totals)===null||j===void 0?void 0:j.row)===null||G===void 0?void 0:G.subTotalsDimensions)===null||Z===void 0?void 0:Z.length)!==null&&et!==void 0?et:0;Ct<at;Ct++){const rt=this.totals.row.subTotalsDimensions[Ct],ct=this.rows.indexOf(rt);this.rowsIsTotal[ct]=!0}if(!((gt=this.totals)===null||gt===void 0)&&gt.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let Ct=0,at=(bt=(nt=(it=(vt=this.totals)===null||vt===void 0?void 0:vt.column)===null||it===void 0?void 0:it.subTotalsDimensions)===null||nt===void 0?void 0:nt.length)!==null&&bt!==void 0?bt:0;Ct<at;Ct++){const rt=this.totals.column.subTotalsDimensions[Ct],ct=this.columns.indexOf(rt);this.colsIsTotal[ct]=!0}this.setRecords(l)}setRecords(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;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,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.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,S)=>this.rowsHasValue[S]),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,S)=>this.columnsHasValue[S]),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,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_),typeof window<"u"&&window.performance.now(),!((w=this.dataConfig)===null||w===void 0)&&w.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(zt.RECORD,kx),this.registerAggregator(zt.SUM,Ix),this.registerAggregator(zt.COUNT,Dx),this.registerAggregator(zt.MAX,zx),this.registerAggregator(zt.MIN,Nx),this.registerAggregator(zt.AVG,Ox),this.registerAggregator(zt.NONE,Fx),this.registerAggregator(zt.RECALCULATE,Q4)}processCollectedValuesWithSumBy(){var t,e,n,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;((n=this.collectValuesBy[l])===null||n===void 0?void 0:n.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 n=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=n.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=n.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 n in this.collectedValues[t])Array.isArray(this.collectedValues[t][n])&&(e.push(...this.collectedValues[t][n]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let n=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(n=!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];n&&!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];n&&!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,n;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(!(!((n=s.filterFunc)===null||n===void 0)&&n.call(s,t))){o=!1;break}}return o}processRecord(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt,bt,Ct,at,rt,ct,ht,_t,ut,It,Ut,yt,Tt,kt,oe,re,ye,Oe;(n=this.derivedFieldRules)===null||n===void 0||n.forEach((mt,Bt)=>{mt.fieldName&&mt.derivedFunc&&(t[mt.fieldName]=mt.derivedFunc(t))});for(const mt in this.collectValuesBy)if(z(t[mt])){this.collectedValues[mt]||(this.collectedValues[mt]={});const Bt=this.collectValuesBy[mt].by.map(Kt=>t[Kt]).join(this.stringJoinChar);if(this.collectedValues[mt][Bt]||(this.collectValuesBy[mt].sumBy?this.collectedValues[mt][Bt]={}:this.collectValuesBy[mt].range?this.collectedValues[mt][Bt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[mt][Bt]=[]),this.collectValuesBy[mt].sumBy){const Kt=this.collectValuesBy[mt].sumBy.map(qt=>t[qt]).join(this.stringJoinChar);this.collectedValues[mt][Bt][Kt]||(this.collectedValues[mt][Bt][Kt]=new this.aggregators[zt.SUM]({key:mt,dimension:mt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[mt][Bt][Kt].push(t)}else if(this.collectValuesBy[mt].range){const Kt=this.collectedValues[mt][Bt],qt=Math.max(t[mt],Kt.max),fe=Math.min(t[mt],Kt.min);isNaN(qt)||(Kt.max=qt,Kt.min=fe)}else{const Kt=this.collectedValues[mt][Bt];Kt.indexOf(t[mt])===-1&&Kt.push(t[mt])}}let Be=!1;const Ee=[],At=[];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 mt=[];At.push({rowKey:mt,indicatorKey:e});for(let Bt=0,Kt=this.rows.length;Bt<Kt;Bt++){const qt=this.rows[Bt];if(qt in t)this.rowsHasValue[Bt]=!0,mt.push(t[qt]);else if(qt!==Zi){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&&Bt===0&&!this.rows.find(fe=>fe in t)){mt.push(this.rowGrandTotalLabel),Be=!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[Bt-1]))>=0){this.rowHierarchyType==="grid"&&mt.push(this.rowSubTotalLabel),Be=!0;break}}}}else{const mt=this.getFieldMatchRowDimensionPaths(t);if(mt.length>0)for(let Bt=0,Kt=mt.length;Bt<Kt;Bt++){const qt=mt[Bt],fe=[];let Yt;for(let Nt=0,dt=qt.length;Nt<dt;Nt++)z(qt[Nt].indicatorKey)?Yt=qt[Nt].indicatorKey:fe.push(qt[Nt].value);At.push({rowKey:fe,indicatorKey:Yt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((m=this.customColTree)===null||m===void 0)&&m.length)||e||this.hasExtensionRowTree){const mt=[];Ee.push({colKey:mt,indicatorKey:e});for(let Bt=0,Kt=this.columns.length;Bt<Kt;Bt++){const qt=this.columns[Bt];if(qt in t)this.columnsHasValue[Bt]=!0,mt.push(t[qt]);else if(qt!==Zi){if(!((_=(C=(b=this.dataConfig)===null||b===void 0?void 0:b.totals)===null||C===void 0?void 0:C.column)===null||_===void 0)&&_.showGrandTotals&&Bt===0&&!this.columns.find(fe=>fe in t)){mt.push(this.colGrandTotalLabel),Be=!0;break}if(!((S=(y=(w=this.dataConfig)===null||w===void 0?void 0:w.totals)===null||y===void 0?void 0:y.column)===null||S===void 0)&&S.subTotalsDimensions&&((x=(A=(R=this.dataConfig)===null||R===void 0?void 0:R.totals)===null||A===void 0?void 0:A.column)===null||x===void 0?void 0:x.subTotalsDimensions.indexOf(this.columns[Bt-1]))>=0){mt.push(this.colSubTotalLabel),Be=!0;break}}}}else{const mt=this.getFieldMatchColDimensionPaths(t);if(mt.length>0)for(let Bt=0,Kt=mt.length;Bt<Kt;Bt++){const qt=mt[Bt],fe=[];let Yt;for(let Nt=0,dt=qt.length;Nt<dt;Nt++)z(qt[Nt].indicatorKey)?Yt=qt[Nt].indicatorKey:fe.push(qt[Nt].value);Ee.push({colKey:fe,indicatorKey:Yt})}}for(let mt=0;mt<At.length;mt++){const Bt=At[mt].rowKey;let Kt;this.indicatorsAsCol||(Kt=At[mt].indicatorKey);for(let qt=0;qt<Ee.length;qt++){const fe=Ee[qt].colKey;this.indicatorsAsCol&&(Kt=Ee[qt].indicatorKey);const Yt=Bt.join(this.stringJoinChar),Nt=fe.join(this.stringJoinChar);if(Be){this.totalRecordsTree[Yt]||(this.totalRecordsTree[Yt]={}),this.totalRecordsTree[Yt][Nt]||(this.totalRecordsTree[Yt][Nt]=[]);const Ft=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let $t=0;$t<Ft.length;$t++)if(this.calculatedFiledKeys.indexOf(Ft[$t])>=0){const ae=(T=this.calculatedFieldRules)===null||T===void 0?void 0:T.find(Ti=>Ti.key===Ft[$t]);!((B=(M=this.totalRecordsTree[Yt])===null||M===void 0?void 0:M[Nt])===null||B===void 0)&&B[$t]||(this.totalRecordsTree[Yt][Nt][$t]=new this.aggregators[zt.RECALCULATE]({key:Ft[$t],dimension:Ft[$t],isRecord:!0,formatFun:(F=(P=this.indicators)===null||P===void 0?void 0:P.find(Ti=>typeof Ti!="string"&&Ti.indicatorKey===Ft[$t]))===null||F===void 0?void 0:F.format,calculateFun:ae==null?void 0:ae.calculateFun,dependAggregators:this.totalRecordsTree[Yt][Nt],dependIndicatorKeys:ae==null?void 0:ae.dependIndicatorKeys})),Ft[$t]in t&&((E=(H=this.totalRecordsTree[Yt])===null||H===void 0?void 0:H[Nt])===null||E===void 0||E[$t].push(t))}else{const ae=this.getAggregatorRule(Ft[$t]);!((I=(k=this.totalRecordsTree[Yt])===null||k===void 0?void 0:k[Nt])===null||I===void 0)&&I[$t]||(this.totalRecordsTree[Yt][Nt][$t]=new this.aggregators[(L=ae==null?void 0:ae.aggregationType)!==null&&L!==void 0?L:zt.SUM]({key:Ft[$t],dimension:(D=ae==null?void 0:ae.field)!==null&&D!==void 0?D:Ft[$t],formatFun:(O=ae==null?void 0:ae.formatFun)!==null&&O!==void 0?O:(N=(W=this.indicators)===null||W===void 0?void 0:W.find(Ti=>typeof Ti!="string"&&Ti.indicatorKey===Ft[$t]))===null||N===void 0?void 0:N.format})),Ft[$t]in t&&((U=($=this.totalRecordsTree[Yt])===null||$===void 0?void 0:$[Nt])===null||U===void 0||U[$t].push(t))}return}Bt.length!==0&&(this.rowFlatKeys[Yt]||(this.rowKeys.push(Bt),this.rowFlatKeys[Yt]=1)),fe.length!==0&&(this.colFlatKeys[Nt]||(this.colKeys.push(fe),this.colFlatKeys[Nt]=1)),this.tree[Yt]||(this.tree[Yt]={}),!((Y=this.tree[Yt])===null||Y===void 0)&&Y[Nt]||(this.tree[Yt][Nt]=[]);const dt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Ft=0;Ft<dt.length;Ft++)if(this.calculatedFiledKeys.indexOf(dt[Ft])>=0){const $t=(j=this.calculatedFieldRules)===null||j===void 0?void 0:j.find(ae=>ae.key===dt[Ft]);!((Z=(G=this.tree[Yt])===null||G===void 0?void 0:G[Nt])===null||Z===void 0)&&Z[Ft]||(this.tree[Yt][Nt][Ft]=new this.aggregators[zt.RECALCULATE]({key:dt[Ft],dimension:dt[Ft],isRecord:!0,formatFun:(gt=(et=this.indicators)===null||et===void 0?void 0:et.find(ae=>typeof ae!="string"&&ae.indicatorKey===dt[Ft]))===null||gt===void 0?void 0:gt.format,calculateFun:$t==null?void 0:$t.calculateFun,dependAggregators:this.tree[Yt][Nt],dependIndicatorKeys:$t==null?void 0:$t.dependIndicatorKeys})),(it=(vt=this.tree[Yt])===null||vt===void 0?void 0:vt[Nt])===null||it===void 0||it[Ft].push(t)}else{const $t=this.getAggregatorRule(dt[Ft]);let ae=!1;Kt?e===Kt?dt[Ft]===Kt&&(ae=!0):dt[Ft]===Kt&&dt[Ft]in t&&(ae=!0):$t!=null&&$t.field?typeof($t==null?void 0:$t.field)=="string"?($t==null?void 0:$t.field)in t&&(ae=!0):$t!=null&&$t.field.find(Ti=>Ti in t)&&(ae=!0):dt[Ft]in t&&(ae=!0),!(!((bt=(nt=this.tree[Yt])===null||nt===void 0?void 0:nt[Nt])===null||bt===void 0)&&bt[Ft])&&ae&&(this.tree[Yt][Nt][Ft]=new this.aggregators[(Ct=$t==null?void 0:$t.aggregationType)!==null&&Ct!==void 0?Ct:zt.SUM]({key:dt[Ft],dimension:(at=$t==null?void 0:$t.field)!==null&&at!==void 0?at:dt[Ft],formatFun:(rt=$t==null?void 0:$t.formatFun)!==null&&rt!==void 0?rt:(ht=(ct=this.indicators)===null||ct===void 0?void 0:ct.find(Ti=>typeof Ti!="string"&&Ti.indicatorKey===dt[Ft]))===null||ht===void 0?void 0:ht.format})),ae&&((ut=(_t=this.tree[Yt])===null||_t===void 0?void 0:_t[Nt])===null||ut===void 0||ut[Ft].push(t))}if(this.mappingRules)for(let Ft=0;Ft<this.indicatorKeys.length;Ft++){if(!this.indicatorStatistics[Ft]){const $t=this.getAggregatorRule(this.indicatorKeys[Ft]);this.indicatorStatistics[Ft]={max:new this.aggregators[zt.MAX]({key:this.indicatorKeys[Ft],dimension:this.indicatorKeys[Ft]}),min:new this.aggregators[zt.MIN]({key:this.indicatorKeys[Ft],dimension:this.indicatorKeys[Ft]}),total:new this.aggregators[(It=$t==null?void 0:$t.aggregationType)!==null&&It!==void 0?It:zt.SUM]({key:this.indicatorKeys[Ft],dimension:(Ut=$t==null?void 0:$t.field)!==null&&Ut!==void 0?Ut:this.indicatorKeys[Ft],formatFun:(yt=$t==null?void 0:$t.formatFun)!==null&&yt!==void 0?yt:(kt=(Tt=this.indicators)===null||Tt===void 0?void 0:Tt.find(ae=>typeof ae!="string"&&ae.indicatorKey===this.indicatorKeys[Ft]))===null||kt===void 0?void 0:kt.format})}}this.indicatorStatistics[Ft].max.push((re=(oe=this.tree[Yt])===null||oe===void 0?void 0:oe[Nt])===null||re===void 0?void 0:re[Ft].value()),this.indicatorStatistics[Ft].min.push((Oe=(ye=this.tree[Yt])===null||ye===void 0?void 0:ye[Nt])===null||Oe===void 0?void 0:Oe[Ft].value()),this.indicatorStatistics[Ft].total.push(t)}}}}updateSortRules(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((w,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.ArrToTree(this.colKeys,this.columns.filter((w,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,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_))}updateFilterRules(t,e=!1){var n,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++)(n=this.tree[r][s][l])===null||n===void 0||n.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((n,o)=>t===n.indicatorKey)}getAggregator(t=[],e=[],n,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(n);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=HT(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=HT(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&&z((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 n;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(n=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===n&&l.push({field:n,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,m=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),m=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?m.push(o.rowSubTotalLabel):e||m.push(o.colSubTotalLabel)),c=g.func(p,m,(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 n=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return n.rowHierarchyType==="grid"&&a.length<n.rows.length&&a[a.length-1]!==n.rowSubTotalLabel&&a[a.length-1]!==n.rowGrandTotalLabel&&a.push(n.rowSubTotalLabel),h.length<n.columns.length&&h[h.length-1]!==n.colSubTotalLabel&&h[h.length-1]!==n.colGrandTotalLabel&&h.push(n.colSubTotalLabel),n.getAggregator(a,h,t.sortByIndicator).value()};return e?yc(l(o,t.query),l(r,t.query),s):yc(l(t.query,o),l(t.query,r),s)}:t.sortBy?e6(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?t6:yc}totalStatistics(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f;const p=this,m=(b,C)=>{var _,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt,bt,Ct,at,rt,ct,ht,_t,ut,It,Ut,yt,Tt,kt,oe,re,ye,Oe,Be;if(!((w=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[b])===null||w===void 0)&&w[C])return this.tree[b]||(this.tree[b]={}),void(this.tree[b][C]=(S=(y=this.totalRecordsTree)===null||y===void 0?void 0:y[b])===null||S===void 0?void 0:S[C]);const Ee=C.split(this.stringJoinChar);if(!((A=(R=p.totals)===null||R===void 0?void 0:R.column)===null||A===void 0)&&A.subTotalsDimensions&&((M=(T=(x=p.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length)>0&&p.totals.column.showSubTotals!==!1)for(let At=0,mt=(F=(P=(B=p.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||F===void 0?void 0:F.length;At<mt;At++){const Bt=p.totals.column.subTotalsDimensions[At],Kt=p.columns.indexOf(Bt);if(Kt>=0){const qt=Ee.slice(0,Kt+1);qt.push(p.colSubTotalLabel);const fe=qt.join(this.stringJoinChar);if(!((E=(H=this.totalRecordsTree)===null||H===void 0?void 0:H[b])===null||E===void 0)&&E[fe])return void(this.tree[b][fe]=(I=(k=this.totalRecordsTree)===null||k===void 0?void 0:k[b])===null||I===void 0?void 0:I[fe]);this.tree[b][fe]||(this.tree[b][fe]=[]);const Yt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Nt=0;Nt<Yt.length;Nt++)if(this.calculatedFiledKeys.indexOf(Yt[Nt])>=0){const dt=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(Ft=>Ft.key===Yt[Nt]);!((O=(D=this.tree[b])===null||D===void 0?void 0:D[fe])===null||O===void 0)&&O[Nt]||(this.tree[b][fe][Nt]=new this.aggregators[zt.RECALCULATE]({key:Yt[Nt],dimension:Yt[Nt],isRecord:!0,formatFun:(N=(W=this.indicators)===null||W===void 0?void 0:W.find(Ft=>typeof Ft!="string"&&Ft.indicatorKey===Yt[Nt]))===null||N===void 0?void 0:N.format,calculateFun:dt==null?void 0:dt.calculateFun,dependAggregators:this.tree[b][fe],dependIndicatorKeys:dt==null?void 0:dt.dependIndicatorKeys})),fe!==C&&this.tree[b][fe][Nt].push((U=($=p.tree[b])===null||$===void 0?void 0:$[C])===null||U===void 0?void 0:U[Nt])}else{if(!this.tree[b][fe][Nt]){const dt=this.getAggregatorRule(Yt[Nt]);this.tree[b][fe][Nt]=new this.aggregators[(Y=dt==null?void 0:dt.aggregationType)!==null&&Y!==void 0?Y:zt.SUM]({key:Yt[Nt],dimension:(j=dt==null?void 0:dt.field)!==null&&j!==void 0?j:Yt[Nt],formatFun:(G=dt==null?void 0:dt.formatFun)!==null&&G!==void 0?G:(et=(Z=this.indicators)===null||Z===void 0?void 0:Z.find(Ft=>typeof Ft!="string"&&Ft.indicatorKey===Yt[Nt]))===null||et===void 0?void 0:et.format})}fe!==C&&this.tree[b][fe][Nt].push((vt=(gt=p.tree[b])===null||gt===void 0?void 0:gt[C])===null||vt===void 0?void 0:vt[Nt])}}}if(!((nt=(it=p.totals)===null||it===void 0?void 0:it.column)===null||nt===void 0)&&nt.showGrandTotals||this.rows.length===0){const At=p.colGrandTotalLabel;if(!((Ct=(bt=this.totalRecordsTree)===null||bt===void 0?void 0:bt[b])===null||Ct===void 0)&&Ct[At])return void(this.tree[b][At]=(rt=(at=this.totalRecordsTree)===null||at===void 0?void 0:at[b])===null||rt===void 0?void 0:rt[At]);this.tree[b][At]||(this.tree[b][At]=[]);const mt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Bt=0;Bt<mt.length;Bt++)if(this.calculatedFiledKeys.indexOf(mt[Bt])>=0){const Kt=(ct=this.calculatedFieldRules)===null||ct===void 0?void 0:ct.find(qt=>qt.key===mt[Bt]);!((_t=(ht=this.tree[b])===null||ht===void 0?void 0:ht[At])===null||_t===void 0)&&_t[Bt]||(this.tree[b][At][Bt]=new this.aggregators[zt.RECALCULATE]({key:mt[Bt],dimension:mt[Bt],isRecord:!0,formatFun:(It=(ut=this.indicators)===null||ut===void 0?void 0:ut.find(qt=>typeof qt!="string"&&qt.indicatorKey===mt[Bt]))===null||It===void 0?void 0:It.format,calculateFun:Kt==null?void 0:Kt.calculateFun,dependAggregators:this.tree[b][At],dependIndicatorKeys:Kt==null?void 0:Kt.dependIndicatorKeys})),At!==C&&this.tree[b][At][Bt].push((yt=(Ut=p.tree[b])===null||Ut===void 0?void 0:Ut[C])===null||yt===void 0?void 0:yt[Bt])}else{if(!this.tree[b][At][Bt]){const Kt=this.getAggregatorRule(mt[Bt]);this.tree[b][At][Bt]=new this.aggregators[(Tt=Kt==null?void 0:Kt.aggregationType)!==null&&Tt!==void 0?Tt:zt.SUM]({key:mt[Bt],dimension:(kt=Kt==null?void 0:Kt.field)!==null&&kt!==void 0?kt:mt[Bt],formatFun:(oe=Kt==null?void 0:Kt.formatFun)!==null&&oe!==void 0?oe:(ye=(re=this.indicators)===null||re===void 0?void 0:re.find(qt=>typeof qt!="string"&&qt.indicatorKey===mt[Bt]))===null||ye===void 0?void 0:ye.format})}At!==C&&this.tree[b][At][Bt].push((Be=(Oe=p.tree[b])===null||Oe===void 0?void 0:Oe[C])===null||Be===void 0?void 0:Be[Bt])}}};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=(n=p==null?void 0:p.totals)===null||n===void 0?void 0:n.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 b=[];Object.keys(p.tree).forEach(C=>{const _=C.split(this.stringJoinChar);Object.keys(p.tree[C]).forEach(w=>{var y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt;if(!((S=(y=p.totals)===null||y===void 0?void 0:y.row)===null||S===void 0)&&S.subTotalsDimensions&&((x=(A=(R=p.totals)===null||R===void 0?void 0:R.row)===null||A===void 0?void 0:A.subTotalsDimensions)===null||x===void 0?void 0:x.length)>0&&p.totals.row.showSubTotals!==!1)for(let bt=0,Ct=(B=(M=(T=p.totals)===null||T===void 0?void 0:T.row)===null||M===void 0?void 0:M.subTotalsDimensions)===null||B===void 0?void 0:B.length;bt<Ct;bt++){const at=p.totals.row.subTotalsDimensions[bt],rt=p.rows.indexOf(at);if(rt>=0&&rt<p.rows.length-1){const ct=_.slice(0,rt+1);this.rowHierarchyType==="grid"&&ct.push(p.rowSubTotalLabel);const ht=ct.join(this.stringJoinChar);this.tree[ht]||(this.tree[ht]={},b.push(ht)),this.tree[ht][w]||(this.tree[ht][w]=[]);const _t=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let ut=0;ut<_t.length;ut++){if(!this.tree[ht][w][ut])if(this.calculatedFiledKeys.indexOf(_t[ut])>=0){const It=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(Ut=>Ut.key===_t[ut]);this.tree[ht][w][ut]=new this.aggregators[zt.RECALCULATE]({key:_t[ut],dimension:_t[ut],isRecord:!0,formatFun:(H=(F=this.indicators)===null||F===void 0?void 0:F.find(Ut=>typeof Ut!="string"&&Ut.indicatorKey===_t[ut]))===null||H===void 0?void 0:H.format,calculateFun:It==null?void 0:It.calculateFun,dependAggregators:this.tree[ht][w],dependIndicatorKeys:It==null?void 0:It.dependIndicatorKeys})}else{const It=this.getAggregatorRule(_t[ut]);this.tree[ht][w][ut]=new this.aggregators[(E=It==null?void 0:It.aggregationType)!==null&&E!==void 0?E:zt.SUM]({key:_t[ut],dimension:(k=It==null?void 0:It.field)!==null&&k!==void 0?k:_t[ut],formatFun:(I=It==null?void 0:It.formatFun)!==null&&I!==void 0?I:(D=(L=this.indicators)===null||L===void 0?void 0:L.find(Ut=>typeof Ut!="string"&&Ut.indicatorKey===_t[ut]))===null||D===void 0?void 0:D.format})}ht!==C&&this.tree[ht][w][ut].push((W=(O=p.tree[C])===null||O===void 0?void 0:O[w])===null||W===void 0?void 0:W[ut])}}}if(!(($=(N=p.totals)===null||N===void 0?void 0:N.row)===null||$===void 0)&&$.showGrandTotals||this.columns.length===0){const bt=p.rowGrandTotalLabel;this.tree[bt]||(this.tree[bt]={},b.push(bt)),this.tree[bt][w]||(this.tree[bt][w]=[]);const Ct=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let at=0;at<Ct.length;at++){if(!this.tree[bt][w][at])if(this.calculatedFiledKeys.indexOf(Ct[at])>=0){const rt=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ct=>ct.key===Ct[at]);this.tree[bt][w][at]=new this.aggregators[zt.RECALCULATE]({key:Ct[at],dimension:Ct[at],isRecord:!0,formatFun:(j=(Y=this.indicators)===null||Y===void 0?void 0:Y.find(ct=>typeof ct!="string"&&ct.indicatorKey===Ct[at]))===null||j===void 0?void 0:j.format,calculateFun:rt==null?void 0:rt.calculateFun,dependAggregators:this.tree[bt][w],dependIndicatorKeys:rt==null?void 0:rt.dependIndicatorKeys})}else{const rt=this.getAggregatorRule(Ct[at]);this.tree[bt][w][at]=new this.aggregators[(G=rt==null?void 0:rt.aggregationType)!==null&&G!==void 0?G:zt.SUM]({key:Ct[at],dimension:(Z=rt==null?void 0:rt.field)!==null&&Z!==void 0?Z:Ct[at],formatFun:(et=rt==null?void 0:rt.formatFun)!==null&&et!==void 0?et:(vt=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ct=>typeof ct!="string"&&ct.indicatorKey===Ct[at]))===null||vt===void 0?void 0:vt.format})}bt!==C&&this.tree[bt][w][at].push((nt=(it=p.tree[C])===null||it===void 0?void 0:it[w])===null||nt===void 0?void 0:nt[at])}}m(C,w)})}),b.forEach(C=>{Object.keys(p.tree[C]).forEach(_=>{m(C,_)})})}for(const b in p.totalRecordsTree)for(const C in p.totalRecordsTree[b])m(b,C)}ArrToTree1(t,e,n,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 m=u.join(l);let b=a.get(m);b||(b={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)>=1?n==null?void 0:n.map(C=>typeof C=="string"?{indicatorKey:C,value:C}:{indicatorKey:C.indicatorKey,value:C.title}):[]},a.set(m,b),c?c.children.push(b):s.push(b)),c=b})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,n,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 m=[];let b;p.forEach((C,_)=>{var w,y,S,R;m.push(C);const A=m.join(c);let x=g.get(A);if(!x){if(x={value:C,dimensionKey:e[_],children:_===p.length-1&&((w=n==null?void 0:n.length)!==null&&w!==void 0?w:0)>=1?n==null?void 0:n.map(T=>typeof T=="string"?{indicatorKey:T,value:T}:{indicatorKey:T.indicatorKey,value:T.title}):[]},o[_]){let T=(y=x.children)!==null&&y!==void 0?y:[];const M={value:l,dimensionKey:e[_+1],levelSpan:o.length-_-1,children:((S=n==null?void 0:n.length)!==null&&S!==void 0?S:0)>=1?n==null?void 0:n.map(B=>typeof B=="string"?{indicatorKey:B,value:B}:{indicatorKey:B.indicatorKey,value:B.title}):[]};T.push(M),T=(R=M.children)!==null&&R!==void 0?R:[]}g.set(A,x),b?o[_-1]&&!h?b.children.splice(b.children.length-1,0,x):b.children.push(x):u.push(x)}b=x})}(f)):n&&(u=n==null?void 0:n.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=n==null?void 0:n.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]=G9(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l;const a=this.indicatorKeys.indexOf(n);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,n){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]=n)}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]=n)}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,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const n=[],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:z(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=[],n.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):n.push(l)}return t==null||t.forEach(s=>r(s,[])),n}getFieldMatchColDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;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,n;const o=[];for(let r=0;(n=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;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=>z(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 G9(i,t){return i.sort((e,n)=>{const o=t.indexOf(e),r=t.indexOf(n);return o<r?-1:o>r?1:0})}let ET=class extends _g{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;if(le.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=Le(e.columns),this.internalProps.rows=Le(e.rows),this.internalProps.indicators=go(e.indicators),(n=e.indicators)===null||n===void 0||n.forEach((w,y)=>{typeof w=="object"&&(w!=null&&w.editor)&&(this.internalProps.indicators[y].editor=w.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Le(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Le(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=Le(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=_==null?void 0:_[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 w=new He((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),y=new He((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 hr(this,null,w,y),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new mv({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},_))}else{const w=YR(this,e),{rowKeys:y,columnKeys:S,indicatorKeys:R}=w;let{columnDimensionTree:A,rowDimensionTree:x}=w;this.dataset=new Oh(this.internalProps.dataConfig,y,S,R,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=Vi(this.dataset.colHeaderTree,e.indicators)),A=new He((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),x=new He((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),this.internalProps.layoutMap=new hr(this,this.dataset,A,x)}if(this._changePivotSortStateBySortRules(),((C=(b=e.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),le.mode!=="node"&&(this.editorManager=new mT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(_),this.scenegraph.createSceneGraph(),e.title){const w=Et.getComponent("title");this.internalProps.title=new w(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const w=Et.getComponent("emptyTip");this.internalProps.emptyTip=new w(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(lt.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return lr}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 n=super._canResizeColumn(t,e);if(n){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 n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;const w=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Le(t.columns),this.internalProps.rows=Le(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?go(t.indicators):[],(n=t.indicators)===null||n===void 0||n.forEach((S,R)=>{typeof S=="object"&&(S!=null&&S.editor)&&(this.internalProps.indicators[R].editor=S.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Le(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Le(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,w.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",w.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",w.dataConfig=Le(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 S=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((R,A)=>{const x=S.find(T=>T.dimensionKey===R.dimensionKey&&T.value===R.value);x&&this._syncHierarchyState(x,R)})}const y=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=y==null?void 0:y[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 S,R;t.columnTree&&(S=new He((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(R=new He((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)),w.layoutMap=new hr(this,null,S,R),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new mv({rows:w.layoutMap.fullRowDimensionKeys,columns:w.layoutMap.colDimensionKeys,indicators:w.layoutMap.indicatorKeys,indicatorsAsCol:w.layoutMap.indicatorsAsCol,indicatorDimensionKey:w.layoutMap.indicatorDimensionKey},y))}else{const S=YR(this,t),{rowKeys:R,columnKeys:A,indicatorKeys:x}=S;let{columnDimensionTree:T,rowDimensionTree:M}=S;this.dataset=new Oh(w.dataConfig,R,A,x,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,y,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),T=new He((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),M=new He((m=this.dataset.rowHeaderTree)!==null&&m!==void 0?m:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(b=this.options.rowExpandLevel)!==null&&b!==void 0?b:1:void 0)),w.layoutMap=new hr(this,this.dataset,T,M)}if(this._changePivotSortStateBySortRules(),((_=(C=t.pivotSortState)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,w.releaseList&&(w.releaseList.forEach(S=>{var R;return(R=S==null?void 0:S.release)===null||R===void 0?void 0:R.call(S)}),w.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const S=Et.getComponent("title");this.internalProps.title=new S(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const S=Et.getComponent("emptyTip");this.internalProps.emptyTip=new S(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(S=>{setTimeout(S,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,n,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(((n=u.rowHeaderLevelCount)!==null&&n!==void 0?n: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,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n: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,n){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,n)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(n),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,n);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,n),!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,n),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,n).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,n){var o,r,s,l,a,h,d;if(!n){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(b=>!b.virtual))===null||s===void 0?void 0:s.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"col",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(b=>!b.virtual))===null||a===void 0?void 0:a.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"row",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:m}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof m=="function"?m(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(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),g=u.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.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 n,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(n=this.records[l])===null||n===void 0?void 0:n[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 n,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(n=this.records[l])===null||n===void 0?void 0:n[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 n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[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 n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[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,n){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(),pt(e)&&pt(n)?(this.isRowHeader(e,n)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,n)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,n)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,n,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=(n=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||n===void 0?void 0:n.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:gi[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const n=t[e],o=n.dimensions,r=n.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,n){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:gi[n],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:gi[n]}))}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:gi[n],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:gi[n]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=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&&qi(n,l.col,l.row))return a}}_moveHeaderPosition(t,e){const n=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(n.start.col,n.end.col-n.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,n=!0){const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(lr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(lr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}_refreshHierarchyState(t,e,n=!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,n),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 n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.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,n){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,n,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(((n=this.options.customConfig)===null||n===void 0?void 0:n.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new mv({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 He((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new He((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 hr(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=Et.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(n=l==null?void 0:l.headerEditor)!==null&&n!==void 0?n: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"?aT(s):s}isHasEditorDefine(t,e){var n;const o=this.getBodyColumnDefine(t,e);let r=(n=o==null?void 0:o.editor)!==null&&n!==void 0?n: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})),z(r)}changeCellValue(t,e,n,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=n;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&am(n)&&(r=parseFloat(n)),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=Dr(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=rn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(lt.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,n,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){const c=n[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const m=this.getCellRawValue(t+p,e+u);g.push(m);const b=this.getCellOriginValue(t+p,e+u);f.push(b)}}for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=n[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 m=p;const b=a[u][f],C=l[u][f];typeof C=="number"&&am(p)&&(m=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,b,m),this.fireListeners(lt.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:C,currentValue:b,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=Dr(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=rn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,n,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,n,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.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,n,o);else{const f=g.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=g.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.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:n}=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<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,n,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,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(n,o).children=t,this._refreshHierarchyState(n,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}};Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Ng(),Wg(),Dl(),Vg();class LT extends ET{}Dl();class U9 extends ET{}Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Ng(),Wg(),Dl(),Vg();let K9=class extends _g{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;let y,S;le.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},this._selectedDataItemsInChart=[],this._selectedDimensionInChart=[],this._chartEventMap={},e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Le(e.columns),this.internalProps.rows=Le(e.rows),this.internalProps.indicators=go(e.indicators),this.internalProps.columnTree=!e.indicatorsAsCol||!((n=e.columns)===null||n===void 0)&&n.length||e.columnTree?Le(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((o=e.rows)===null||o===void 0)&&o.length||e.rowTree?Le(e.rowTree):[],this.internalProps.records=e.records,this.setCustomStateNameToSpec(),this.internalProps.columnResizeType=(r=e.columnResizeType)!==null&&r!==void 0?r:"column",this.internalProps.rowResizeType=(s=e.rowResizeType)!==null&&s!==void 0?s:"row",this.internalProps.dataConfig={isPivotChart:!0},this._axes=st(e.axes)?e.axes:[],e.columnTree&&(e.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,e.indicators)),y=new He((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),e.rowTree&&(e.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,e.indicators)),S=new He((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const R=!((h=S==null?void 0:S.dimensionKeys)===null||h===void 0)&&h.count?S.dimensionKeys.valueArr():(u=(d=e.rows)===null||d===void 0?void 0:d.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&u!==void 0?u:[],A=!((c=y==null?void 0:y.dimensionKeys)===null||c===void 0)&&c.count?y.dimensionKeys.valueArr():(f=(g=e.columns)===null||g===void 0?void 0:g.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&f!==void 0?f:[],x=(m=(p=e.indicators)===null||p===void 0?void 0:p.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.indicatorKey),T),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(A,R),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Oh(this.internalProps.dataConfig,R,A,x,this.internalProps.indicators,(b=e.indicatorsAsCol)===null||b===void 0||b,e.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Fh(this.internalProps.indicators)){const T=M=>{M.forEach(B=>{var P;!((P=B.children)===null||P===void 0)&&P.length?T(B.children):B.children=[{dimensionKey:"axis",value:""}]})};!((C=this.dataset.rowHeaderTree)===null||C===void 0)&&C.length?T(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(e.columnTree||e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),e.rowTree||e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),y=new He((_=this.dataset.colHeaderTree)!==null&&_!==void 0?_:[],this.layoutNodeId),S=new He((w=this.dataset.rowHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),this.internalProps.layoutMap=new hr(this,this.dataset,y,S),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(),e.title){const T=Et.getComponent("title");this.internalProps.title=new T(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const T=Et.getComponent("emptyTip");this.internalProps.emptyTip=new T(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(lt.INITIALIZED,null)},0)}static get EVENT_TYPE(){return TR}get pivotChartAxes(){return this._axes}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=this.internalProps;let R,A;super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Le(t.columns),this.internalProps.rows=Le(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?go(t.indicators):[],this.internalProps.columnTree=!t.indicatorsAsCol||!((n=t.columns)===null||n===void 0)&&n.length||t.columnTree?Le(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((o=t.rows)===null||o===void 0)&&o.length||t.rowTree?Le(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.setCustomStateNameToSpec(),this._selectedDataItemsInChart=[],S.columnResizeType=(r=t.columnResizeType)!==null&&r!==void 0?r:"column",S.rowResizeType=(s=t.rowResizeType)!==null&&s!==void 0?s:"row",S.dataConfig={isPivotChart:!0},this._axes=st(t.axes)?t.axes:[],t.columnTree&&(t.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,t.indicators)),R=new He((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),t.rowTree&&(t.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,t.indicators)),A=new He((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const x=!((h=A==null?void 0:A.dimensionKeys)===null||h===void 0)&&h.count?A.dimensionKeys.valueArr():(u=(d=t.rows)===null||d===void 0?void 0:d.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&u!==void 0?u:[],T=!((c=R==null?void 0:R.dimensionKeys)===null||c===void 0)&&c.count?R.dimensionKeys.valueArr():(f=(g=t.columns)===null||g===void 0?void 0:g.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&f!==void 0?f:[],M=(m=(p=t.indicators)===null||p===void 0?void 0:p.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.indicatorKey),B),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(T,x),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Oh(this.internalProps.dataConfig,x,T,M,this.internalProps.indicators,(b=t.indicatorsAsCol)===null||b===void 0||b,(C=t.records)!==null&&C!==void 0?C:this.internalProps.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Fh(this.internalProps.indicators)){const B=P=>{P.forEach(F=>{var H;!((H=F.children)===null||H===void 0)&&H.length?B(F.children):F.children=[{dimensionKey:"axis",value:""}]})};!((_=this.dataset.rowHeaderTree)===null||_===void 0)&&_.length?B(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(t.columnTree||t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),t.rowTree||t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),R=new He((w=this.dataset.colHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),A=new He((y=this.dataset.rowHeaderTree)!==null&&y!==void 0?y:[],this.layoutNodeId),S.layoutMap=new hr(this,this.dataset,R,A),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,S.releaseList&&(S.releaseList.forEach(B=>{var P;return(P=B==null?void 0:B.release)===null||P===void 0?void 0:P.call(B)}),S.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const B=Et.getComponent("title");this.internalProps.title=new B(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const B=Et.getComponent("emptyTip");this.internalProps.emptyTip=new B(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(B=>{setTimeout(B,0)})}updatePagination(){}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a;const h=this,{layoutMap:d}=h.internalProps;d&&(h.colCount=(t=d.colCount)!==null&&t!==void 0?t:0,h.rowCount=(e=d.rowCount)!==null&&e!==void 0?e:0,h.internalProps.frozenColCount=(n=d.rowHeaderLevelCount)!==null&&n!==void 0?n:0,h.frozenRowCount=Math.max(d.headerLevelCount,(o=this.options.frozenRowCount)!==null&&o!==void 0?o:0),h.bottomFrozenRowCount!==((r=d==null?void 0:d.bottomFrozenRowCount)!==null&&r!==void 0?r:0)&&(h.bottomFrozenRowCount=(s=d==null?void 0:d.bottomFrozenRowCount)!==null&&s!==void 0?s:0),h.rightFrozenColCount!==((l=d==null?void 0:d.rightFrozenColCount)!==null&&l!==void 0?l:0)&&(h.rightFrozenColCount=(a=d==null?void 0:d.rightFrozenColCount)!==null&&a!==void 0?a:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n: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;!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r&&this.syncHierarchyState(t.children[s],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)}getCellValue(t,e,n){var o,r,s;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const g=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let f;return g==null||g.forEach(p=>{const m=this.internalProps.layoutMap.getIndicatorInfo(p);m&&(f=m)}),(r=(o=f==null?void 0:f.title)!==null&&o!==void 0?o:f==null?void 0:f.indicatorKey)!==null&&r!==void 0?r:""}const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.dataset){let u;const c=this.internalProps.layoutMap.getCellHeaderPaths(t,e),g=c.colHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"col",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),f=c.rowHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"row",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,u);return p.value?p.value():void 0}const{fieldFormat:l}=this.internalProps.layoutMap.getBody(t,e),a=this.getBodyIndexByRow(e),h=this.getBodyIndexByCol(t),d=(s=this.records[a])===null||s===void 0?void 0:s[h];return typeof l=="function"?l(d,t,e,this):d}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const d=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let u;return d==null||d.forEach(c=>{const g=this.internalProps.layoutMap.getIndicatorInfo(c);g&&(u=g)}),(o=(n=u==null?void 0:u.title)!==null&&n!==void 0?n:u==null?void 0:u.indicatorKey)!==null&&o!==void 0?o:""}const{title:h}=s.internalProps.layoutMap.getHeader(t,e);return typeof h=="function"?h():h}if(this.dataset){let h;const d=this.internalProps.layoutMap.getCellHeaderPaths(t,e),u=d.colHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"col",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),c=d.rowHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"row",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),g=this.dataset.getAggregator(c,u,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,h);return g.value?g.value():void 0}const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(r=this.records[l])===null||r===void 0?void 0:r[a]}getCellRawValue(t,e){return this.getCellOriginValue(t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)&&this.dataset){let n;const o=this.internalProps.layoutMap.getCellHeaderPaths(t,e),r=o.colHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"col",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value}),s=o.rowHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"row",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value});return this.dataset.getAggregator(s,r,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,n).records}}getCellRawRecord(t,e){return this.getCellOriginRecord(t,e)}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const{col:r,row:s,order:l}=this.pivotSortState[o];if(qi(n,r,s))return l}}_moveHeaderPosition(t,e){var n,o,r,s;const l=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(l){if(l.moveType==="column"){if(((o=(n=this.options.records)===null||n===void 0?void 0:n[0])===null||o===void 0?void 0:o.constructor)===Array)for(let a=0;a<this.internalProps.records.length;a++){const h=this.internalProps.records[a].splice(l.sourceIndex-this.rowHeaderLevelCount,l.sourceSize);h.unshift(l.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[a],h)}this.colWidthsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize),this.setMinMaxLimitWidth()}else if(l.moveType==="row"){if(((s=(r=this.options.records)===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.constructor)===Array){const a=this.internalProps.records.splice(l.sourceIndex-this.columnHeaderLevelCount,l.sourceSize);a.unshift(l.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,a)}this.rowHeightsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize)}return l}return null}toggleHierarchyState(t,e,n=!0){}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 n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){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}}_generateCollectValuesConfig(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;t=t.filter(S=>S!==Zi),e=e.filter(S=>S!==Zi);const w=this.internalProps.indicators,y={};for(let S=0,R=w==null?void 0:w.length;S<R;S++)if(typeof w[S]!="string"&&w[S].chartSpec){if(((n=w[S].chartSpec)===null||n===void 0?void 0:n.type)==="pie"||((o=w[S].chartSpec)===null||o===void 0?void 0:o.type)==="rose"||((r=w[S].chartSpec)===null||r===void 0?void 0:r.type)==="radar"||((s=w[S].chartSpec)===null||s===void 0?void 0:s.type)==="gauge"||((l=w[S].chartSpec)===null||l===void 0?void 0:l.type)==="wordCloud")continue;const A=w[S],x=A.chartSpec;if(this.options.indicatorsAsCol===!1)if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[A.indicatorKey]={by:e,range:!0,sumBy:(x==null?void 0:x.stack)&&t.concat(x==null?void 0:x.xField)},x.series)x.series.forEach(T=>{var M,B,P,F,H,E,k,I,L,D,O,W,N,$;const U=typeof T.xField=="string"?T.xField:T.xField[0];y[U]={by:t,type:T.direction!=="horizontal"?"xField":void 0,range:Ms(T,this._axes,T.direction==="horizontal",!0),sortBy:T.direction!=="horizontal"?(F=(P=(B=(M=T==null?void 0:T.data)===null||M===void 0?void 0:M.fields)===null||B===void 0?void 0:B[U])===null||P===void 0?void 0:P.domain)!==null&&F!==void 0?F:(k=(E=(H=x==null?void 0:x.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[U])===null||k===void 0?void 0:k.domain:void 0};const Y=T.yField;T.stack!==!1&&(T.type==="bar"||T.type==="area")&&(T.stack=!0),y[Y]={by:e,range:Ms(T,this._axes,T.direction==="horizontal",!1),sumBy:T.stack&&t.concat(T==null?void 0:T.xField),sortBy:T.direction==="horizontal"?(O=(D=(L=(I=T==null?void 0:T.data)===null||I===void 0?void 0:I.fields)===null||L===void 0?void 0:L[Y])===null||D===void 0?void 0:D.domain)!==null&&O!==void 0?O:($=(N=(W=x==null?void 0:x.data)===null||W===void 0?void 0:W.fields)===null||N===void 0?void 0:N[Y])===null||$===void 0?void 0:$.domain:void 0,extendRange:Mc(x.markLine)}});else{const T=typeof x.xField=="string"?x.xField:x.xField[0];y[T]={by:t,type:x.direction!=="horizontal"?"xField":void 0,range:Ms(x,this._axes,x.direction==="horizontal",!0),sortBy:x.direction!=="horizontal"?(d=(h=(a=x==null?void 0:x.data)===null||a===void 0?void 0:a.fields)===null||h===void 0?void 0:h[T])===null||d===void 0?void 0:d.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const M=x.yField;y[M]={by:e,range:x.direction!=="horizontal",sumBy:x.stack&&t.concat(x==null?void 0:x.xField),sortBy:x.direction==="horizontal"?(g=(c=(u=x==null?void 0:x.data)===null||u===void 0?void 0:u.fields)===null||c===void 0?void 0:c[M])===null||g===void 0?void 0:g.domain:void 0,extendRange:Mc(x.markLine)}}else{const T=w[S];if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[T.indicatorKey]={by:t,range:!0,sumBy:(x==null?void 0:x.stack)&&e.concat(x==null?void 0:x.yField)},x.series)x.series.forEach(M=>{var B,P,F,H,E,k,I,L,D,O,W,N,$,U;const Y=typeof M.yField=="string"?M.yField:M.yField[0];y[Y]={by:e,type:M.direction==="horizontal"?"yField":void 0,range:Ms(M,this._axes,M.direction==="horizontal",!1),sortBy:M.direction==="horizontal"?(H=(F=(P=(B=M==null?void 0:M.data)===null||B===void 0?void 0:B.fields)===null||P===void 0?void 0:P[Y])===null||F===void 0?void 0:F.domain)!==null&&H!==void 0?H:(I=(k=(E=x==null?void 0:x.data)===null||E===void 0?void 0:E.fields)===null||k===void 0?void 0:k[Y])===null||I===void 0?void 0:I.domain:void 0};const j=M.xField;M.stack!==!1&&(M.type==="bar"||M.type==="area")&&(M.stack=!0),y[j]={by:t,range:Ms(M,this._axes,M.direction==="horizontal",!0),sumBy:M.stack&&e.concat(M==null?void 0:M.yField),sortBy:M.direction!=="horizontal"?(W=(O=(D=(L=M==null?void 0:M.data)===null||L===void 0?void 0:L.fields)===null||D===void 0?void 0:D[j])===null||O===void 0?void 0:O.domain)!==null&&W!==void 0?W:(U=($=(N=x==null?void 0:x.data)===null||N===void 0?void 0:N.fields)===null||$===void 0?void 0:$[j])===null||U===void 0?void 0:U.domain:void 0,extendRange:Mc(x.markLine)}});else{const M=typeof x.yField=="string"?x.yField:x.yField[0];y[M]={by:e,type:x.direction==="horizontal"?"yField":void 0,range:Ms(x,this._axes,x.direction==="horizontal",!1),sortBy:x.direction==="horizontal"?(m=(p=(f=x==null?void 0:x.data)===null||f===void 0?void 0:f.fields)===null||p===void 0?void 0:p[M])===null||m===void 0?void 0:m.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const B=x.xField;y[B]={by:t,range:Ms(x,this._axes,x.direction==="horizontal",!0),sumBy:x.stack&&e.concat(x==null?void 0:x.yField),sortBy:x.direction!=="horizontal"?(_=(C=(b=x==null?void 0:x.data)===null||b===void 0?void 0:b.fields)===null||C===void 0?void 0:C[B])===null||_===void 0?void 0:_.domain:void 0,extendRange:Mc(x.markLine)}}}}return y}_generateAggregationRules(){var t;const e=[];return(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=this.options.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=this.options.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}setCustomStateNameToSpec(){var t;const e=n=>{var o,r,s,l,a,h,d,u,c,g;!((r=(o=n.bar)===null||o===void 0?void 0:o.state)===null||r===void 0)&&r.selected&&(n.bar.state.vtable_selected=n.bar.state.selected,n.bar.state.vtable_selected_reverse=n.bar.state.selected_reverse,delete n.bar.state.selected,delete n.bar.state.selected_reverse),!((l=(s=n.point)===null||s===void 0?void 0:s.state)===null||l===void 0)&&l.selected&&(n.point.state.vtable_selected=n.point.state.selected,n.point.state.vtable_selected_reverse=n.point.state.selected_reverse,delete n.point.state.selected,delete n.point.state.selected_reverse),!((h=(a=n.line)===null||a===void 0?void 0:a.state)===null||h===void 0)&&h.selected&&(n.line.state.vtable_selected=n.line.state.selected,n.line.state.vtable_selected_reverse=n.line.state.selected_reverse,delete n.line.state.selected,delete n.line.state.selected_reverse),!((u=(d=n.area)===null||d===void 0?void 0:d.state)===null||u===void 0)&&u.selected&&(n.area.state.vtable_selected=n.area.state.selected,n.area.state.vtable_selected_reverse=n.area.state.selected_reverse,delete n.area.state.selected,delete n.area.state.selected_reverse),!((g=(c=n.pie)===null||c===void 0?void 0:c.state)===null||g===void 0)&&g.selected&&(n.pie.state.vtable_selected=n.pie.state.selected,n.pie.state.vtable_selected_reverse=n.pie.state.selected_reverse,delete n.pie.state.selected,delete n.pie.state.selected_reverse)};(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{if(n.chartSpec){const o=n.chartSpec;o.series?o.series.forEach(r=>{e(r)}):e(o)}})}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),Bh(this.scenegraph),IW(this.scenegraph),this.render()}clearChartCacheImage(t,e){pt(t)&&pt(e)?FW(t,e,this.scenegraph):Bh(this.scenegraph)}getLegendSelected(){var t;const e=[];return(t=this.internalProps.legends)===null||t===void 0||t.forEach(n=>{const o=n.legendComponent._getSelectedLegends().map(r=>r.label);e.push(...o)}),e}setLegendSelected(t){var e;(e=this.internalProps.legends)===null||e===void 0||e.forEach(n=>{n.legendComponent.setSelected(t)})}getChartDatumPosition(t,e){const{chartInstance:n,bounds:o}=this.getChartInstance(e);if(n){const r=n.convertDatumToPosition(t);return r?{x:Math.round(r.x+o.x1),y:Math.round(r.y+o.y1)}:null}return null}getCellAddressByRecord(t){const e=[],n=[],o={},r=[];this.dataset.dataConfig.aggregationRules.forEach(s=>{if(typeof s.field=="string")o[s.field]=s.indicatorKey,r.push(s.field);else for(let l=0;l<s.field.length;l++)o[s.field[l]]=s.indicatorKey,r.push(s.field[l])});for(const s in t)this.dataset.rows.indexOf(s)>=0&&e.push({dimensionKey:s,value:t[s]}),this.dataset.columns.indexOf(s)>=0&&n.push({dimensionKey:s,value:t[s]}),r.indexOf(s)>=0&&(this.dataset.indicatorsAsCol?n.push({indicatorKey:o[s]}):e.push({indicatorKey:o[s]}));return this.getCellAddressByHeaderPaths({rowHeaderPaths:e,colHeaderPaths:n,cellLocation:"body"})}getChartInstance(t){var e,n,o,r,s;const l=this.getCellAddressByHeaderPaths(t);if(l){const a=this.getCellRelativeRect(l.col,l.row),h=this.scenegraph.getCell(l.col,l.row);let d;const u=(e=h==null?void 0:h.getChildren())===null||e===void 0?void 0:e[0];if(u.attribute.chartInstance){d=u.attribute.chartInstance;const{dataId:c,data:g,axes:f,spec:p}=u.attribute,m=u.getViewBox();if(f==null||f.forEach((b,C)=>{var _,w,y,S;b.type==="linear"?d.updateModelSpecSync({type:"axes",index:C},{min:(w=(_=b.range)===null||_===void 0?void 0:_.min)!==null&&w!==void 0?w:0,max:(S=(y=b.range)===null||y===void 0?void 0:y.max)!==null&&S!==void 0?S:0},!0):b.type==="band"&&d.updateModelSpec({type:"axes",index:C},{domain:b.domain.slice(0)},!0)}),d.updateViewBox({x1:m.x1-u.getRootNode().table.scrollLeft,x2:m.x2-u.getRootNode().table.scrollLeft,y1:m.y1-u.getRootNode().table.scrollTop,y2:m.y2-u.getRootNode().table.scrollTop},!1,!1),typeof c=="string")d.updateDataSync(c,g??[]);else{const b=[];for(const C in c){const _=c[C],w=p.series.find(y=>{var S;return((S=y==null?void 0:y.data)===null||S===void 0?void 0:S.id)===C});b.push({id:C,values:_?(n=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&n!==void 0?n:[]:g??[],fields:(o=w==null?void 0:w.data)===null||o===void 0?void 0:o.fields}),d.updateFullDataSync||d.updateDataSync(C,_?(r=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&r!==void 0?r:[]:g??[])}(s=d.updateFullDataSync)===null||s===void 0||s.call(d,b)}this.renderAsync()}return{chartInstance:d,bounds:a.bounds}}return{}}_getDimensionSortArray(){var t,e;if(!((e=(t=this.options)===null||t===void 0?void 0:t.axes)===null||e===void 0)&&e.length){const n=this.options.indicatorsAsCol?"left":"bottom",o=this.options.axes.find(r=>r.orient===n);if(o&&st(o.domain))return o.domain}}setRecords(t){var e,n;const o={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t;const r=this.options,s=this.internalProps;let l,a;this.dataset.setRecords(t),l=r.columnTree?s.layoutMap.columnDimensionTree:new He((e=this.dataset.colHeaderTree)!==null&&e!==void 0?e:[],this.layoutNodeId),a=r.rowTree?s.layoutMap.rowDimensionTree:new He((n=this.dataset.rowHeaderTree)!==null&&n!==void 0?n:[],this.layoutNodeId),s.layoutMap=new hr(this,this.dataset,l,a),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(o.col,o.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder()}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=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<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}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)}};class Y9 extends Zp{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class kT extends fn{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||t.justifyContent!=="start"&&t.justifyContent!=="end"||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||t.alignItems!=="start"&&t.alignItems!=="end"||(t.alignItems="flex-"+t.alignItems),!t.alignContent||t.alignContent!=="start"&&t.alignContent!=="end"||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=(e=t==null?void 0:t.background)===null||e===void 0?void 0:e.fill,t.stroke=(n=t==null?void 0:t.background)===null||n===void 0?void 0:n.stroke,t.lineWidth=(o=t==null?void 0:t.background)===null||o===void 0?void 0:o.lineWidth,t.cornerRadius=(r=t==null?void 0:t.background)===null||r===void 0?void 0:r.cornerRadius;const m=st(t.boundsPadding),b=[(l=(s=t.marginTop)!==null&&s!==void 0?s:m?t.boundsPadding[0]:t.boundsPadding)!==null&&l!==void 0?l:0,(h=(a=t.marginRight)!==null&&a!==void 0?a:m?t.boundsPadding[1]:t.boundsPadding)!==null&&h!==void 0?h:0,(c=(d=t.marginBottom)!==null&&d!==void 0?d:m?(u=t.boundsPadding[2])!==null&&u!==void 0?u:t.boundsPadding[0]:t.boundsPadding)!==null&&c!==void 0?c:0,(p=(g=t.marginLeft)!==null&&g!==void 0?g:m?(f=t.boundsPadding[3])!==null&&f!==void 0?f:t.boundsPadding[1]:t.boundsPadding)!==null&&p!==void 0?p:0];t.boundsPadding=b,super(t)}}class X9 extends kT{constructor(t){t.flexWrap="nowrap",super(t)}}let q9=class extends Yo{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g;let f;ge(t.iconName)&&(f=Cn()[t.iconName],f&&(t.width=(e=t.width)!==null&&e!==void 0?e:f.width,t.height=(n=t.height)!==null&&n!==void 0?n:f.height,t.svg=f.svg,t.cursor=f.cursor)),t.svg&&(t.image=t.svg);const p=st(t.boundsPadding),m=[(r=(o=t.marginTop)!==null&&o!==void 0?o:p?t.boundsPadding[0]:t.boundsPadding)!==null&&r!==void 0?r:0,(l=(s=t.marginRight)!==null&&s!==void 0?s:p?t.boundsPadding[1]:t.boundsPadding)!==null&&l!==void 0?l:0,(d=(a=t.marginBottom)!==null&&a!==void 0?a:p?(h=t.boundsPadding[2])!==null&&h!==void 0?h:t.boundsPadding[0]:t.boundsPadding)!==null&&d!==void 0?d:0,(g=(u=t.marginLeft)!==null&&u!==void 0?u:p?(c=t.boundsPadding[3])!==null&&c!==void 0?c:t.boundsPadding[1]:t.boundsPadding)!==null&&g!==void 0?g:0];t.boundsPadding=m,super(t),this.cache=f}},Z9=class extends Yo{constructor(t){var e,n,o,r,s,l,a,h,d,u;t.src&&(t.image=t.src),t.shape==="circle"&&(t.cornerRadius=t.width/2);const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}};class J9 extends fu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class Q9 extends Hi{constructor(t){var e,n,o,r,s,l,a,h,d,u,c;t.textBaseline||(t.textBaseline="top");const g=st(t.boundsPadding),f=[(n=(e=t.marginTop)!==null&&e!==void 0?e:g?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:g?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:g?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:g?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=f,t.fill=(c=t.fill)!==null&&c!==void 0?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}}function t7(i,t=0){return{percent:i,delta:t}}class e7 extends mu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class i7 extends $a{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}getSize(t){this.AABBBounds.width()}}class n7 extends fn{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}const o7=Object.freeze(Object.defineProperty({__proto__:null,Arc:e7,CheckBox:Tr,Circle:Y9,Container:kT,Group:n7,GroupElement:X9,Icon:q9,Image:Z9,Line:n0,Radio:eh,Rect:J9,Tag:i7,Text:Q9,percentCalc:t7},Symbol.toStringTag,{value:"Module"}));function r7(i){var t,e,n,o,r,s,l,a,h,d,u;const c={seqId:0},g={isPivotChart:!0};let f,p,m,b;i.columnTree&&(i.indicatorsAsCol!==!1&&(m=Vi(i.columnTree,i.indicators)),f=new He((t=i.columnTree)!==null&&t!==void 0?t:[],c)),i.rowTree&&(i.indicatorsAsCol===!1&&(b=Vi(i.rowTree,i.indicators)),p=new He((e=i.rowTree)!==null&&e!==void 0?e:[],c));const C=!((n=p.dimensionKeys)===null||n===void 0)&&n.count?p.dimensionKeys.valueArr():(r=(o=i.rows)===null||o===void 0?void 0:o.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&r!==void 0?r:[],_=!((s=f.dimensionKeys)===null||s===void 0)&&s.count?f.dimensionKeys.valueArr():(a=(l=i.columns)===null||l===void 0?void 0:l.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&a!==void 0?a:[],w=(d=(h=i.indicators)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.indicatorKey),y),[]))!==null&&d!==void 0?d:[];return g.collectValuesBy=s7(i,_,C),g.aggregationRules=l7(i),{dataset:new Oh(g,C,_,w,i.indicators,(u=i.indicatorsAsCol)===null||u===void 0||u,i.records,void 0,m||i.columnTree,b||i.rowTree,!0),columnDimensionTree:f,rowDimensionTree:p,layoutNodeId:c}}function s7(i,t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A,x;const T={};for(let M=0,B=(n=i.indicators)===null||n===void 0?void 0:n.length;M<B;M++)if(typeof i.indicators[M]!="string"&&i.indicators[M].chartSpec)if(i.indicatorsAsCol===!1){const P=i.indicators[M];if(T[P.indicatorKey]={by:e,range:!0,sumBy:((o=P.chartSpec)===null||o===void 0?void 0:o.stack)!==!1&&t.concat((r=P.chartSpec)===null||r===void 0?void 0:r.xField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et;const gt=typeof F.xField=="string"?F.xField:F.xField[0];T[gt]={by:t,type:F.direction!=="horizontal"?"xField":void 0,range:F.direction==="horizontal",sortBy:F.direction!=="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(W=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||W===void 0?void 0:W.domain:void 0};const vt=F.yField;T[vt]={by:e,range:F.direction!=="horizontal",sumBy:F.stack!==!1&&t.concat(F==null?void 0:F.xField),sortBy:F.direction==="horizontal"?(Y=(U=($=(N=F==null?void 0:F.data)===null||N===void 0?void 0:N.fields)===null||$===void 0?void 0:$[vt])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(et=(Z=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||Z===void 0?void 0:Z[vt])===null||et===void 0?void 0:et.domain:void 0}});else{const F=typeof P.chartSpec.xField=="string"?P.chartSpec.xField:P.chartSpec.xField[0];T[F]={by:t,type:P.chartSpec.direction!=="horizontal"?"xField":void 0,range:P.chartSpec.direction==="horizontal",sortBy:P.chartSpec.direction!=="horizontal"?(h=(a=(l=(s=P.chartSpec)===null||s===void 0?void 0:s.data)===null||l===void 0?void 0:l.fields)===null||a===void 0?void 0:a[F])===null||h===void 0?void 0:h.domain:void 0};const H=P.chartSpec.yField;T[H]={by:e,range:i.indicators[M].chartSpec.direction!=="horizontal",sumBy:P.chartSpec.stack!==!1&&t.concat((d=P.chartSpec)===null||d===void 0?void 0:d.xField),sortBy:P.chartSpec.direction==="horizontal"?(f=(g=(c=(u=P.chartSpec)===null||u===void 0?void 0:u.data)===null||c===void 0?void 0:c.fields)===null||g===void 0?void 0:g[H])===null||f===void 0?void 0:f.domain:void 0}}}else{const P=i.indicators[M];if(T[P.indicatorKey]={by:t,range:!0,sumBy:((p=P.chartSpec)===null||p===void 0?void 0:p.stack)!==!1&&e.concat((m=P.chartSpec)===null||m===void 0?void 0:m.yField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et;const gt=typeof F.yField=="string"?F.yField:F.yField[0];T[gt]={by:e,type:F.direction==="horizontal"?"yField":void 0,range:F.direction!=="horizontal",sortBy:F.direction==="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(W=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||W===void 0?void 0:W.domain:void 0};const vt=F.xField;T[vt]={by:t,range:F.direction==="horizontal",sumBy:F.stack!==!1&&e.concat(F==null?void 0:F.yField),sortBy:F.direction!=="horizontal"?(Y=(U=($=(N=F==null?void 0:F.data)===null||N===void 0?void 0:N.fields)===null||$===void 0?void 0:$[vt])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(et=(Z=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||Z===void 0?void 0:Z[vt])===null||et===void 0?void 0:et.domain:void 0}});else{const F=typeof P.chartSpec.yField=="string"?P.chartSpec.yField:P.chartSpec.yField[0];T[F]={by:e,type:P.chartSpec.direction==="horizontal"?"yField":void 0,range:P.chartSpec.direction!=="horizontal",sortBy:P.chartSpec.direction==="horizontal"?(w=(_=(C=(b=P.chartSpec)===null||b===void 0?void 0:b.data)===null||C===void 0?void 0:C.fields)===null||_===void 0?void 0:_[F])===null||w===void 0?void 0:w.domain:void 0};const H=P.chartSpec.xField;T[H]={by:t,range:i.indicators[M].chartSpec.direction==="horizontal",sumBy:P.chartSpec.stack!==!1&&e.concat((y=P.chartSpec)===null||y===void 0?void 0:y.yField),sortBy:P.chartSpec.direction!=="horizontal"?(x=(A=(R=(S=P.chartSpec)===null||S===void 0?void 0:S.data)===null||R===void 0?void 0:R.fields)===null||A===void 0?void 0:A[H])===null||x===void 0?void 0:x.domain:void 0}}}return T}function l7(i){var t;const e=[];return(t=i.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=i.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=i.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}function a7(i,t,e){var n,o;const r=r7(i);let s=r.columnDimensionTree,l=r.rowDimensionTree,a=!1,h=!1;i.columnTree&&i.indicatorsAsCol&&!s.dimensionKeys.contain(Zi)&&(a=!0),i.rowTree&&(i.indicatorsAsCol||l.dimensionKeys.contain(Zi)||(h=!0));const{dataset:d,layoutNodeId:u}=r,c={options:i,layoutNodeId:u,internalProps:i,isPivotChart:()=>!0,pivotChartAxes:[],_selectedDataItemsInChart:[],_getActiveChartInstance:()=>({updateState:()=>{}})};i.columnTree&&!a||(s=new He((n=d.colHeaderTree)!==null&&n!==void 0?n:[],u)),i.rowTree&&!h||(l=new He((o=d.rowHeaderTree)!==null&&o!==void 0?o:[],u));const g=new hr(c,d,s,l);for(let f=0;f<g.colCount;f++)for(let p=0;p<g.rowCount;p++){if(g.isHeader(f,p))continue;const m=g.getCellHeaderPaths(f,p),b=m.colHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),C=m.rowHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),_=d.getAggregator(g.indicatorsAsCol?C:C.slice(0,-1),g.indicatorsAsCol?b.slice(0,-1):b,g.getIndicatorKey(f,p)),w=h7(_.value?_.value():void 0,t,f,p,g,e);if(w)return w}}function h7(i,t,e,n,o,r){if(st(i)){for(let s=0;s<i.length;s++)if(r?r(i[s],t):d7(i[s],t))return o.getCellHeaderPaths(e,n)}}function d7(i,t){return JSON.stringify(i)===JSON.stringify(t)}function u7(i){return new $a(i?i.attribute:{})}function c7(i){return new Tr(i?i.attribute:{})}function g7(i){return new eh(i?i.attribute:{})}class f7{constructor(t,e){var n,o,r,s,l,a;this.willUpdateRow=!1,this.willUpdateCol=!1,this.table=t,this.rowCount=(n=e==null?void 0:e.rowCount)!==null&&n!==void 0?n:void 0,this.colCount=(o=e==null?void 0:e.colCount)!==null&&o!==void 0?o:void 0,this.animationDuration=(r=e==null?void 0:e.animationDuration)!==null&&r!==void 0?r:500,this.animationDelay=(s=e==null?void 0:e.animationDelay)!==null&&s!==void 0?s:1e3,this.animationEasing=(l=e==null?void 0:e.animationEasing)!==null&&l!==void 0?l:"linear",this.replaceScrollAction=(a=e==null?void 0:e.replaceScrollAction)!==null&&a!==void 0&&a,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):this.row+=this.rowCount,this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout(()=>{this.willUpdateRow=!1,this.updateRow()},this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):this.col+=this.colCount,this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout(()=>{this.willUpdateCol=!1,this.updateCol()},this.animationDuration+this.animationDelay)}}class p7{constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){var t,e,n,o,r,s,l,a;this.table.registerCustomCellStyle("col-highlight",{bgColor:(e=(t=this.options)===null||t===void 0?void 0:t.colHighlightBGColor)!==null&&e!==void 0?e:"#82b2f5",color:(o=(n=this.options)===null||n===void 0?void 0:n.colHighlightColor)!==null&&o!==void 0?o:"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:(s=(r=this.options)===null||r===void 0?void 0:r.rowHighlightBGColor)!==null&&s!==void 0?s:"#82b2f5",color:(a=(l=this.options)===null||l===void 0?void 0:l.rowHighlightColor)!==null&&a!==void 0?a:"#FFF"})}bindEvent(){this.table.on("selected_cell",t=>{this.updateHighlight()}),this.table.on("selected_clear",()=>{this.clearHighlight()}),this.table.on("mousemove_table",()=>{this.table.stateManager.select.selecting&&this.updateHighlight()})}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){var t,e,n,o;if(((t=this.options)===null||t===void 0?void 0:t.colHighlight)===!1&&((e=this.options)===null||e===void 0?void 0:e.rowHighlight)===!1)return;const r=this.table.getSelectedCellRanges();if(r.length===0)return void this.clearHighlight();const s=r[0],l=[s.start.row,s.end.row];l.sort((u,c)=>u-c);const a=[s.start.col,s.end.col];let h,d;a.sort((u,c)=>u-c),this.table.isPivotTable()?(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}):this.table.internalProps.transpose?d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}:(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(d={start:{col:0,row:l[0]},end:{col:0,row:l[1]}})),((n=this.options)===null||n===void 0?void 0:n.colHighlight)===!1||FT(this.colHeaderRange,h)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),h&&this.table.arrangeCustomCellStyle({range:h},"col-highlight"),this.colHeaderRange=h),((o=this.options)===null||o===void 0?void 0:o.rowHighlight)===!1||FT(this.rowHeaderRange,d)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),d&&this.table.arrangeCustomCellStyle({range:d},"row-highlight"),this.rowHeaderRange=d)}}function FT(i,t){return i===void 0&&t===void 0||i!==void 0&&t!==void 0&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}sx();const m7="1.11.1";function v7(){return Cn()}function b7(){hT()}const C7=Object.freeze(Object.defineProperty({__proto__:null,CarouselAnimationPlugin:f7,CustomLayout:o7,DataStatistics:hV,EventTarget:ih,HeaderHighlightPlugin:p7,InvertHighlightPlugin:rN,ListTable:W9,ListTableSimple:V9,PIVOT_CHART_EVENT_TYPE:TR,PIVOT_TABLE_EVENT_TYPE:lr,PivotChart:K9,PivotTable:LT,PivotTableSimple:U9,TABLE_EVENT_TYPE:lt,TYPES:Xz,VArc:DI,VArea:OI,VCheckBox:c7,VCircle:zI,VGlyph:WI,VGroup:NI,VImage:VI,VLine:jI,VPath:$I,VPolygon:GI,VRadio:g7,VRect:UI,VSymbol:KI,VTag:u7,VText:YI,clearGlobal:b7,core:Q8,data:r6,getDataCellPath:a7,getIcons:v7,getTargetCell:Lr,graphicUtil:L1,jsx:qI,onBeforeAttributeUpdateForInvertHighlight:bA,register:oV,registerAxis:Pg,registerChartCell:Ig,registerCheckboxCell:Dg,registerEmptyTip:Hg,registerImageCell:Og,registerLegend:Eg,registerMenu:Lg,registerProgressBarCell:zg,registerRadioCell:Ng,registerSparkLineCell:Wg,registerTextCell:Dl,registerTitle:kg,registerTooltip:Fg,registerVideoCell:Vg,renderChart:jm,restoreMeasureText:pN,setCustomAlphabetCharSet:fN,themes:X4,updateCell:xo,version:m7},Symbol.toStringTag,{value:"Module"})),dr=DB.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*15});dr.interceptors.request.use(i=>i,i=>Promise.reject(i)),dr.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&Gi.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.message)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))Gi.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?Gi.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?Gi.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):Gi.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});var IT={},y7={get exports(){return IT},set exports(i){IT=i}};(function(i,t){(function(e,n){i.exports=n(Fo)})(cP,function(e){function n(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var o=n(e),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var a=100*s+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r})})(y7);const EX="",LX="",Ri=(i,t)=>{const e=i.__vccOpts||i;for(const[n,o]of t)e[n]=o;return e};Fo.locale("zh-cn");const _7=v.defineComponent({name:"PivotFilter",props:{data:{type:Object,default:()=>{}},customDimensions:{type:Array,default:()=>[]},dimensions:{type:Array,default:()=>[]},indicators:{type:Array,default:()=>[]}},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref(!1),r=v.ref(!1),s=v.ref([]),l=v.ref(""),a=v.ref(),h=v.ref(""),d=v.ref([]),u=v.ref(),c=v.ref("range"),g=v.ref(),f=v.ref({}),p=v.ref(),m=v.ref({}),b=v.inject("getContainer",()=>{}),C=v.inject("scaleValue",{}),_=v.inject("theme","light"),w=v.inject("pageId",""),y=v.inject("context",""),S=v.inject("indicatorUrl",""),R=v.inject("indicatorToken",""),A=v.inject("graphicConfig",{}),x=v.inject("theDateInfo",{}),T=[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}],M=[{label:"单个日期",value:"date"},{label:"日期范围",value:"range"}],B=j=>{r.value=!1,s.value=j.target.checked?v.unref(d).map(G=>G.value):[]};v.watch(s,j=>{o.value=j.length===v.unref(d).length,r.value=!!j.length&&j.length<v.unref(d).length});const P=async j=>{var ht,_t;const{queryColumnList:G=[],edvDataSetId:Z="",source:et,dataSourceId:gt}=v.unref(A);let vt=G.find(ut=>ut.name===j||ut.label===j);vt||(vt=i.customDimensions.find(ut=>ut.name===j||ut.label===j));const it={},{search:nt}=(window==null?void 0:window.location)||{},Ct=nt.slice(1,nt.length).split("&");for(const ut of Ct)if(ut){const It=ut.split("=");if(It[0])if(It[0]==="userInfo")try{it.token=(_t=(ht=JSON.parse(decodeURIComponent(It[1])))==null?void 0:ht.baseInfo)==null?void 0:_t.hrpToken}catch(Ut){console.log(Ut)}else it[It[0]]=It[1]}const at=await dr.post(`${v.unref(S)}/diagram/groupvalue`,{source:et,groupColumn:j,hrpIndexTypeGuid:vt==null?void 0:vt.typeGuid,pageId:v.unref(w),pageFlag:!0,edvDataSetId:Z,dataSourceId:gt,extParam:it},{headers:{Authentication:v.unref(R),operateContext:v.unref(y)}}),{success:rt,data:ct=[]}=at.data;rt&&(d.value=ct.map(ut=>({value:ut})))},F=v.ref("");async function H(){const{filterData:j,type:G,key:Z}=i.data,gt=i.dimensions.concat(i.indicators).find(vt=>vt.label===Z);gt&&(F.value=gt.genericType),v.unref(F)==="DATE"?u.value="date":u.value="select",G==="dimension"?v.unref(u)==="select"?(await P(Z),Array.isArray(j)?s.value=j:s.value=(j==null?void 0:j.value)||[]):v.unref(u)==="date"&&(j==null?void 0:j.length)===2&&(a.value=[Fo(j[0].value),Fo(j[1].value)]):(l.value=(j==null?void 0:j.rule)||"",a.value=(j==null?void 0:j.value)||""),n.value=!0}const E=v.computed(()=>v.unref(x).dateFormat||"YYYY-MM-DD");function k(){var et;const{key:j,type:G}=i.data;let Z={};G==="dimension"?v.unref(u)==="select"?Z={rule:"IN",value:v.unref(s)}:v.unref(u)==="date"&&(v.unref(c)==="date"?Z={rule:"EQUAL",value:((et=v.unref(a))==null?void 0:et.format(v.unref(E)))||""}:v.unref(c)==="range"&&v.unref(a)&&(Z=[{rule:"GREATER_EQUAL",value:v.unref(a)[0].format(v.unref(E))},{rule:"LESS_EQUAL",value:v.unref(a)[1].format(v.unref(E))}])):Z={rule:v.unref(l),value:v.unref(a)},t("change",{checkKeys:Z,key:j,type:G}),n.value=!1}function I(){l.value="",a.value=null}const L=v.computed(()=>v.unref(_)==="darkBlue"?"#b2c3dd":""),D=()=>document.getElementsByClassName("filter-modal")[0]||document.body,O=j=>{var G,Z,et;if(j){const gt=(G=v.unref(g))==null?void 0:G.getBoundingClientRect();if(gt){const vt=gt.left/(((Z=v.unref(C))==null?void 0:Z.widthScale)||1)+"px",it=(gt.top+gt.height)/(((et=v.unref(C))==null?void 0:et.heightScale)||1)+"px";setTimeout(()=>{var Ct,at;const nt=document.querySelectorAll(".ant-select-dropdown"),bt=Array.from(nt).filter(rt=>window.getComputedStyle(rt).display!=="none");if(bt!=null&&bt.length){const rt=document.getElementsByClassName("filter-modal")[0];bt[0].classList.add("filter-select-dropdown"),(Ct=rt==null?void 0:rt.style)==null||Ct.setProperty("--drop-down-left",vt),(at=rt==null?void 0:rt.style)==null||at.setProperty("--drop-down-top",it),f.value={visibility:"visible"}}},200)}}else f.value={}},W=j=>{var G,Z,et;if(j){const gt=(G=v.unref(p))==null?void 0:G.getBoundingClientRect();if(gt){const vt=gt.left/(((Z=v.unref(C))==null?void 0:Z.widthScale)||1)+"px",it=(gt.top+gt.height)/(((et=v.unref(C))==null?void 0:et.heightScale)||1)+"px";setTimeout(()=>{var Ct,at;const nt=document.querySelectorAll(".pivot-table-range-date-dropdown"),bt=Array.from(nt).filter(rt=>window.getComputedStyle(rt).display!=="none");if(bt!=null&&bt.length){const rt=document.getElementsByClassName("filter-modal")[0];bt[0].classList.add("filter-range-picker-dropdown"),(Ct=rt==null?void 0:rt.style)==null||Ct.setProperty("--range-picker-dropdown-left",vt),(at=rt==null?void 0:rt.style)==null||at.setProperty("--range-picker-dropdown-top",it),m.value={visibility:"visible"}}},200)}}else m.value={}},N=v.computed(()=>{let j="270px";return v.unref(u)==="date"&&(j=""),{padding:"10px",height:j,maxHeight:"280px"}}),$=()=>{a.value=null};v.watch(n,j=>{window.modalShow&&window.modalShow(j)});const U=v.computed(()=>{let j="date";return v.unref(E).endsWith("MM")?j="month":v.unref(E).endsWith("YYYY")&&(j="year"),j}),Y=j=>{const{startTime:G,endTime:Z,rangeFormat:et}=v.unref(x);if(G&&Z){let gt="day";return et.endsWith("MM")?gt="month":et.endsWith("YYYY")&&(gt="year"),j&&gt&&(j<Fo(G).startOf(gt)||j>Fo(Z).endOf(gt))}else return!1};return e({showModal:H}),{visible:n,checkAllDimensions:o,dimIndeterminate:r,dimensionCheckKeys:s,ruleValue:l,ruleOptions:T,filterValue:a,searchDimName:h,fontColor:L,valueList:d,filterType:u,dateSelectType:c,bodyStyle:N,dateType:U,dateSelectOptions:M,formatStr:E,theme:_,handleOk:k,onCheckAllDimChange:B,handleClear:I,dropdownStyle:f,popupStyle:m,selectRef:g,rangePickerRef:p,getPopupContainer:D,onChangeSelectType:$,disabledDate:Y,getContainer:b,dropdownVisibleChange:O,openChange:W}}}),w7={class:"wrap-header"},S7={class:"wrap-body"},x7={style:{padding:"20px",display:"none"}},A7={ref:"selectRef",style:{display:"inline-block"}},R7={style:{padding:"10px 20px"}},T7={key:0,class:"ecan-date-picker"},M7={key:1,class:"ecan-range-picker",style:{display:"inline-block"},ref:"rangePickerRef"},B7={key:1},P7={style:{padding:"20px"}},H7={ref:"selectRef",style:{display:"inline-block"}},E7={style:{padding:"10px 20px"}};function L7(i,t,e,n,o,r){var p;const s=v.resolveComponent("a-checkbox"),l=v.resolveComponent("a-input"),a=v.resolveComponent("a-checkbox-group"),h=v.resolveComponent("a-select-option"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-date-picker"),c=v.resolveComponent("a-range-picker"),g=v.resolveComponent("a-button"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(f,{wrapClassName:i.theme+" filter-modal",visible:i.visible,"onUpdate:visible":t[9]||(t[9]=m=>i.visible=m),title:((p=i.data)==null?void 0:p.fieldName)+"-筛选","ok-text":"确认","cancel-text":"取消",bodyStyle:i.bodyStyle,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(g,{onClick:t[8]||(t[8]=m=>i.visible=!1)},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("取消")])),_:1}),i.data.type==="indicators"?(v.openBlock(),v.createBlock(g,{key:0,onClick:i.handleClear},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"])):v.createCommentVNode("",!0),v.createVNode(g,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[i.data.type==="dimension"?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["dimension-wrap",i.filterType==="select"?"border":""])},[i.filterType==="select"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:0},[v.createElementVNode("div",w7,[v.createVNode(s,{checked:i.checkAllDimensions,"onUpdate:checked":t[0]||(t[0]=m=>i.checkAllDimensions=m),indeterminate:i.dimIndeterminate,disabled:!!i.searchDimName,onChange:i.onCheckAllDimChange},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"全选",4)]),_:1},8,["checked","indeterminate","disabled","onChange"]),v.createVNode(l,{value:i.searchDimName,"onUpdate:value":t[1]||(t[1]=m=>i.searchDimName=m),placeholder:"请输入关键字搜索",style:{width:"200px","margin-left":"15px"}},null,8,["value"])]),v.createElementVNode("div",S7,[v.createVNode(a,{value:i.dimensionCheckKeys,"onUpdate:value":t[2]||(t[2]=m=>i.dimensionCheckKeys=m),style:{width:"100%"}},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.valueList||[],(m,b)=>v.withDirectives((v.openBlock(),v.createElementBlock("div",{class:"body-item",key:b},[v.createVNode(s,{value:m.value},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(m.value),5)]),_:2},1032,["value"])])),[[v.vShow,!i.searchDimName||m.value.includes(i.searchDimName)]])),128))]),_:1},8,["value"])])],64)):i.filterType==="date"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:1},[v.createElementVNode("div",x7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选类型:",4),v.createElementVNode("div",A7,[v.createVNode(d,{value:i.dateSelectType,"onUpdate:value":t[3]||(t[3]=m=>i.dateSelectType=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange,onChange:i.onChangeSelectType},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dateSelectOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange","onChange"])],512)]),v.createElementVNode("div",R7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),i.dateSelectType==="date"?(v.openBlock(),v.createElementBlock("span",T7,[v.createVNode(u,{dropdownClassName:"ecan-date-picker-dropdown",value:i.filterValue,"onUpdate:value":t[4]||(t[4]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,getPopupContainer:i.getPopupContainer},null,8,["value","picker","format","getPopupContainer"])])):i.dateSelectType==="range"?(v.openBlock(),v.createElementBlock("div",M7,[v.createVNode(c,{dropdownClassName:"ecan-range-picker-dropdown pivot-table-range-date-dropdown",value:i.filterValue,"onUpdate:value":t[5]||(t[5]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,"disabled-date":i.disabledDate,getPopupContainer:i.getPopupContainer,popupStyle:i.popupStyle,onOpenChange:i.openChange},null,8,["value","picker","format","disabled-date","getPopupContainer","popupStyle","onOpenChange"])],512)):v.createCommentVNode("",!0)])],64)):v.createCommentVNode("",!0)],2)):i.data.type==="indicators"?(v.openBlock(),v.createElementBlock("div",B7,[v.createElementVNode("div",P7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选规则:",4),v.createElementVNode("div",H7,[v.createVNode(d,{value:i.ruleValue,"onUpdate:value":t[6]||(t[6]=m=>i.ruleValue=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.ruleOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),v.createElementVNode("div",E7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),v.createVNode(l,{value:i.filterValue,"onUpdate:value":t[7]||(t[7]=m=>i.filterValue=m),placeholder:"请输入",style:{width:"200px"}},null,8,["value"])])])):v.createCommentVNode("",!0)]),_:1},8,["wrapClassName","visible","title","bodyStyle","getContainer","onOk"])}const DT=Ri(_7,[["render",L7],["__scopeId","data-v-8f8e78da"]]),kX="",k7=v.defineComponent({name:"PivotProperty",props:{},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref({unit:"",format:"",floatLength:""}),r=v.ref(),s=v.ref({}),l=v.inject("theme","light"),a=v.inject("scaleValue",{}),h=v.inject("getContainer",()=>{}),d=[{label:"整数",value:"integer"},{label:"小数",value:"float"},{label:"百分比",value:"percent"}];function u(p){o.value=p,n.value=!0}function c(){t("change",v.unref(o)),n.value=!1}const g=()=>document.getElementsByClassName("property-modal")[0]||document.body,f=p=>{var m,b,C;if(p){const _=(m=v.unref(r))==null?void 0:m.getBoundingClientRect();if(_){const w=_.left/(((b=v.unref(a))==null?void 0:b.widthScale)||1)+"px",y=(_.top+_.height)/(((C=v.unref(a))==null?void 0:C.heightScale)||1)+"px";setTimeout(()=>{var A,x;const S=document.querySelectorAll(".ant-select-dropdown"),R=Array.from(S).filter(T=>window.getComputedStyle(T).display!=="none");if(R!=null&&R.length){const T=document.getElementsByClassName("property-modal")[0];R[0].classList.add("property-select-dropdown"),(A=T==null?void 0:T.style)==null||A.setProperty("--drop-down-left",w),(x=T==null?void 0:T.style)==null||x.setProperty("--drop-down-top",y),s.value={visibility:"visible"}}},200)}}else s.value={}};return v.watch(n,p=>{window.modalShow&&window.modalShow(p)}),e({showModal:u}),{theme:l,visible:n,formData:o,handleOk:c,getPopupContainer:g,formatOptions:d,getContainer:h,selectRef:r,dropdownStyle:s,dropdownVisibleChange:f}}}),F7={ref:"selectRef"};function I7(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-radio-button"),h=v.resolveComponent("a-radio-group"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form"),c=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(c,{wrapClassName:i.theme+" property-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",title:i.formData.fieldName+"-度量属性",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(u,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"度量单位"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.formData.unit,"onUpdate:value":t[0]||(t[0]=g=>i.formData.unit=g)},null,8,["value"])]),_:1}),i.formData.unit?(v.openBlock(),v.createBlock(l,{key:0,label:"度量单位位置"},{default:v.withCtx(()=>[v.createVNode(h,{value:i.formData.position,"onUpdate:value":t[1]||(t[1]=g=>i.formData.position=g),"button-style":"solid"},{default:v.withCtx(()=>[v.createVNode(a,{value:"left"},{default:v.withCtx(()=>t[5]||(t[5]=[v.createTextVNode("数据左侧")])),_:1}),v.createVNode(a,{value:"right"},{default:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("数据右侧")])),_:1})]),_:1},8,["value"])]),_:1})):v.createCommentVNode("",!0),v.createVNode(l,{label:"格式化"},{default:v.withCtx(()=>[v.createElementVNode("div",F7,[v.createVNode(d,{value:i.formData.format,"onUpdate:value":t[2]||(t[2]=g=>i.formData.format=g),options:i.formatOptions,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),["float","percent"].includes(i.formData.format)?(v.openBlock(),v.createBlock(l,{key:1,label:"小数位数"},{default:v.withCtx(()=>[v.createVNode(s,{type:"number",value:i.formData.floatLength,"onUpdate:value":t[3]||(t[3]=g=>i.formData.floatLength=g),min:0},null,8,["value"])]),_:1})):v.createCommentVNode("",!0)]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const D7=Ri(k7,[["render",I7]]);function $n(i,t){O7(i)&&(i="100%");var e=z7(i);return i=t===360?i:Math.min(t,Math.max(0,parseFloat(i))),e&&(i=parseInt(String(i*t),10)/100),Math.abs(i-t)<1e-6?1:(t===360?i=(i<0?i%t+t:i%t)/parseFloat(String(t)):i=i%t/parseFloat(String(t)),i)}function O7(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function z7(i){return typeof i=="string"&&i.indexOf("%")!==-1}function N7(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function jg(i){return i<=1?"".concat(Number(i)*100,"%"):i}function vv(i){return i.length===1?"0"+i:String(i)}function W7(i,t,e){return{r:$n(i,255)*255,g:$n(t,255)*255,b:$n(e,255)*255}}function bv(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*(6*e):e<1/2?t:e<2/3?i+(t-i)*(2/3-e)*6:i}function V7(i,t,e){var n,o,r;if(i=$n(i,360),t=$n(t,100),e=$n(e,100),t===0)o=e,r=e,n=e;else{var s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;n=bv(l,s,i+1/3),o=bv(l,s,i),r=bv(l,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function j7(i,t,e){i=$n(i,255),t=$n(t,255),e=$n(e,255);var n=Math.max(i,t,e),o=Math.min(i,t,e),r=0,s=n,l=n-o,a=n===0?0:l/n;if(n===o)r=0;else{switch(n){case i:r=(t-e)/l+(t<e?6:0);break;case t:r=(e-i)/l+2;break;case e:r=(i-t)/l+4;break}r/=6}return{h:r,s:a,v:s}}function $7(i,t,e){i=$n(i,360)*6,t=$n(t,100),e=$n(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:h*255,g:d*255,b:u*255}}function G7(i,t,e,n){var o=[vv(Math.round(i).toString(16)),vv(Math.round(t).toString(16)),vv(Math.round(e).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function OT(i){return Sn(i)/255}function Sn(i){return parseInt(i,16)}var zT={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function zh(i){var t={r:0,g:0,b:0},e=1,n=null,o=null,r=null,s=!1,l=!1;return typeof i=="string"&&(i=Y7(i)),typeof i=="object"&&(ur(i.r)&&ur(i.g)&&ur(i.b)?(t=W7(i.r,i.g,i.b),s=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):ur(i.h)&&ur(i.s)&&ur(i.v)?(n=jg(i.s),o=jg(i.v),t=$7(i.h,n,o),s=!0,l="hsv"):ur(i.h)&&ur(i.s)&&ur(i.l)&&(n=jg(i.s),r=jg(i.l),t=V7(i.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(e=i.a)),e=N7(e),{ok:s,format:i.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var U7="[-\\+]?\\d+%?",K7="[-\\+]?\\d*\\.\\d+%?",Wr="(?:".concat(K7,")|(?:").concat(U7,")"),Cv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),yv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),po={CSS_UNIT:new RegExp(Wr),rgb:new RegExp("rgb"+Cv),rgba:new RegExp("rgba"+yv),hsl:new RegExp("hsl"+Cv),hsla:new RegExp("hsla"+yv),hsv:new RegExp("hsv"+Cv),hsva:new RegExp("hsva"+yv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Y7(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var t=!1;if(zT[i])i=zT[i],t=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=po.rgb.exec(i);return e?{r:e[1],g:e[2],b:e[3]}:(e=po.rgba.exec(i),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=po.hsl.exec(i),e?{h:e[1],s:e[2],l:e[3]}:(e=po.hsla.exec(i),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=po.hsv.exec(i),e?{h:e[1],s:e[2],v:e[3]}:(e=po.hsva.exec(i),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=po.hex8.exec(i),e?{r:Sn(e[1]),g:Sn(e[2]),b:Sn(e[3]),a:OT(e[4]),format:t?"name":"hex8"}:(e=po.hex6.exec(i),e?{r:Sn(e[1]),g:Sn(e[2]),b:Sn(e[3]),format:t?"name":"hex"}:(e=po.hex4.exec(i),e?{r:Sn(e[1]+e[1]),g:Sn(e[2]+e[2]),b:Sn(e[3]+e[3]),a:OT(e[4]+e[4]),format:t?"name":"hex8"}:(e=po.hex3.exec(i),e?{r:Sn(e[1]+e[1]),g:Sn(e[2]+e[2]),b:Sn(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function ur(i){return!!po.CSS_UNIT.exec(String(i))}var $g=2,NT=.16,X7=.05,q7=.05,Z7=.15,WT=5,VT=4,J7=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function jT(i){var t=i.r,e=i.g,n=i.b,o=j7(t,e,n);return{h:o.h*360,s:o.s,v:o.v}}function Gg(i){var t=i.r,e=i.g,n=i.b;return"#".concat(G7(t,e,n,!1))}function Q7(i,t,e){var n=e/100,o={r:(t.r-i.r)*n+i.r,g:(t.g-i.g)*n+i.g,b:(t.b-i.b)*n+i.b};return o}function $T(i,t,e){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=e?Math.round(i.h)-$g*t:Math.round(i.h)+$g*t:n=e?Math.round(i.h)+$g*t:Math.round(i.h)-$g*t,n<0?n+=360:n>=360&&(n-=360),n}function GT(i,t,e){if(i.h===0&&i.s===0)return i.s;var n;return e?n=i.s-NT*t:t===VT?n=i.s+NT:n=i.s+X7*t,n>1&&(n=1),e&&t===WT&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function UT(i,t,e){var n;return e?n=i.v+q7*t:n=i.v-Z7*t,n>1&&(n=1),Number(n.toFixed(2))}function _v(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=zh(i),o=WT;o>0;o-=1){var r=jT(n),s=Gg(zh({h:$T(r,o,!0),s:GT(r,o,!0),v:UT(r,o,!0)}));e.push(s)}e.push(Gg(n));for(var l=1;l<=VT;l+=1){var a=jT(n),h=Gg(zh({h:$T(a,l),s:GT(a,l),v:UT(a,l)}));e.push(h)}return t.theme==="dark"?J7.map(function(d){var u=d.index,c=d.opacity,g=Gg(Q7(zh(t.backgroundColor||"#141414"),zh(e[u]),c*100));return g}):e}var wv={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Sv={},xv={};Object.keys(wv).forEach(function(i){Sv[i]=_v(wv[i]),Sv[i].primary=Sv[i][5],xv[i]=_v(wv[i],{theme:"dark",backgroundColor:"#141414"}),xv[i].primary=xv[i][5]});var KT=[],Nh=[],tj="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function ej(){var i=document.createElement("style");return i.setAttribute("type","text/css"),i}function ij(i,t){if(t=t||{},i===void 0)throw new Error(tj);var e=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),o=KT.indexOf(n);o===-1&&(o=KT.push(n)-1,Nh[o]={});var r;return Nh[o]!==void 0&&Nh[o][e]!==void 0?r=Nh[o][e]:(r=Nh[o][e]=ej(),e==="prepend"?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)),i.charCodeAt(0)===65279&&(i=i.substr(1,i.length)),r.styleSheet?r.styleSheet.cssText+=i:r.textContent+=i,r}function YT(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){nj(i,o,e[o])})}return i}function nj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function oj(i,t){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(t))}function rj(i,t){oj(i,"[@ant-design/icons-vue] ".concat(t))}function XT(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function Av(i,t,e){return e?v.h(i.tag,YT({key:t},e,i.attrs),(i.children||[]).map(function(n,o){return Av(n,"".concat(t,"-").concat(i.tag,"-").concat(o))})):v.h(i.tag,YT({key:t},i.attrs),(i.children||[]).map(function(n,o){return Av(n,"".concat(t,"-").concat(i.tag,"-").concat(o))}))}function qT(i){return _v(i)[0]}function ZT(i){return i?Array.isArray(i)?i:[i]:[]}var sj=`
309
+ ${h}`:h,referencePosition:{placement:nn.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 n=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=y9["bubble-tooltip"](n))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify((e=this._attachInfo)===null||e===void 0?void 0:e.tooltipOptions)}}const Pg=()=>{Et.registerComponent("axis",UV),Et.registerFunction("computeAxisComponentWidth",XV),Et.registerFunction("computeAxisComponentHeight",qV),Et.registerFunction("getAxisConfigInPivotChart",V8)},Hg=()=>{Et.registerComponent("emptyTip",JV)},Eg=()=>{Et.registerFunction("createLegend",a9)},Lg=()=>{Et.registerComponent("menuHandler",f9)},kg=()=>{Et.registerComponent("title",p9)},Fg=()=>{Et.registerComponent("tooltipHandler",_9)};class w9{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",e=>{e.scrollDirection==="vertical"&&this.updateGroupTitle()}),this.table.on("resize_column",e=>{this.updateGroupTitle()})}updateGroupTitle(){this.table.scrollTop===0?(this.titleRows=[],this.showedTitleRows=[]):this.skipStartRow!==-1&&this.skipEndRow!==-1&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){st(t)||(t=[t]),st(e)||(e=[e]);for(let l=0;l<t.length;l++){const a=t.slice(0,l+1);this.table.dataSource.getRaw(a)}const n=[],o=e.length===t.length+1;let r=t.slice(0,o?t.length:t.length-1);const s=this.table.dataSource.currentIndexedData;for(let l=this.rowNow-this.table.columnHeaderLevelCount;l>=0;l--){const a=s[l];if(st(a)&&r.length===a.length){let h=!0;for(let d=0;d<a.length;d++)if(a[d]!==r[d]){h=!1;break}h&&(n.push(l+this.table.columnHeaderLevelCount),r=r.slice(0,r.length-1))}else if(a===t[0]){n.push(l+this.table.columnHeaderLevelCount);break}}this.titleRows=n.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:n}=x9(t);this.showedTitleRows.length=0;let o=0;for(let r=0;r<t.colCount;r++){let s;r<t.frozenColCount?(s=new ue({x:t.getColsWidth(0,r-1),y:t.getFrozenRowsHeight()}),n.add(s)):(s=new ue({x:t.getColsWidth(t.frozenColCount,r-1),y:t.getFrozenRowsHeight()}),e.add(s)),s.col=r;for(let l=0;l<this.titleRows.length;l++){const a=this.titleRows[l];if(S9(a,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){r===0&&o++;continue}r===0&&this.showedTitleRows.push(a);const h=t.scenegraph.getCell(r,a);if(h.role==="cell"){const d=xT(h);d.setAttributes({y:40*l}),s.add(d)}else{const d=xo(r,a,t,!0,!0);d.setAttributes({y:40*l}),s.add(d)}}}o>0&&this.skipStartRow===-1&&this.skipEndRow===-1&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function S9(i,t,e,n){return i===t&&i!==e+n.length-1?!0:i===e+n.indexOf(i)+1&&i<t}function xT(i){const t=i.clone();if(t.role=i.role,t.col=i.col,t.row=i.row,t.mergeStartCol=i.mergeStartCol,t.mergeStartRow=i.mergeStartRow,t.mergeEndCol=i.mergeEndCol,t.mergeEndRow=i.mergeEndRow,t.contentWidth=i.contentWidth,t.contentHeight=i.contentHeight,t.role==="cell"){const e=Ie({x:0,y:0,width:t.attribute.width,height:t.attribute.height});t.add(e)}if(i.type==="group"){const e=t;i.forEachChildren(n=>{const o=xT(n);e.add(o)})}return t}function x9(i){const t=i.scenegraph.colHeaderGroup,e=i.scenegraph.cornerHeaderGroup;if(!t.border){const r=Ie({x:0,y:0,width:0,height:0,cursor:"pointer"});t.add(r),t.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Lr(a),{col:d,row:u}=h;AT(u-l.indexOf(u),i)})}if(!e.border){const r=Ie({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(r),e.border=r,r.attachShadow(r.shadowRoot),r.name="border-rect",r.addEventListener("click",s=>{const l=i.listTreeStickCellPlugin.titleRows,{shadowTarget:a}=s.pickParams,h=Lr(a),{col:d,row:u}=h;AT(u-l.indexOf(u),i)})}const n=t.border.shadowRoot,o=e.border.shadowRoot;return n.removeAllChild(),o.removeAllChild(),{shadowGroup:n,shadowGroupFrozen:o}}function AT(i,t){const e=t.getDrawRange();if(z(i)&&i>=t.frozenRowCount){const n=t.getFrozenRowsHeight(),o=t.getRowsHeight(0,i-1);t.scrollTop=Math.min(o-n,t.getAllRowsHeight()-e.height)-1}t.scenegraph.updateNextFrame()}const A9=()=>{Et.registerComponent("listTreeStickCellPlugin",w9)},R9={};function T9(){return rh(R9,wg)}function M9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j;const G=T9()[d],Z=f._getCellStyle(o,r),et=Fc("padding",Z,o,r,f);if(z(et)&&(a=et),!i){const gt=xs(o,r,p,f);b&&(i=f.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:s,height:l,lineWidth:(w=(_=p==null?void 0:p.group)===null||_===void 0?void 0:_.lineWidth)!==null&&w!==void 0?w:void 0,fill:(S=(y=p==null?void 0:p.group)===null||y===void 0?void 0:y.fill)!==null&&S!==void 0?S:void 0,stroke:(A=(R=p==null?void 0:p.group)===null||R===void 0?void 0:R.stroke)!==null&&A!==void 0?A:void 0,strokeArrayWidth:gt,strokeArrayColor:(T=(x=p==null?void 0:p.group)===null||x===void 0?void 0:x.strokeArrayColor)!==null&&T!==void 0?T:void 0,cursor:(B=(M=p==null?void 0:p.group)===null||M===void 0?void 0:M.cursor)!==null&&B!==void 0?B:void 0,lineDash:(F=(P=p==null?void 0:p.group)===null||P===void 0?void 0:P.lineDash)!==null&&F!==void 0?F:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),i&&i.role==="cell"||((i=new ue({x:e,y:n,width:s,height:l,lineWidth:(E=(H=p==null?void 0:p.group)===null||H===void 0?void 0:H.lineWidth)!==null&&E!==void 0?E:void 0,fill:(I=(k=p==null?void 0:p.group)===null||k===void 0?void 0:k.fill)!==null&&I!==void 0?I:void 0,stroke:(D=(L=p==null?void 0:p.group)===null||L===void 0?void 0:L.stroke)!==null&&D!==void 0?D:void 0,strokeArrayWidth:gt,strokeArrayColor:(W=(O=p==null?void 0:p.group)===null||O===void 0?void 0:O.strokeArrayColor)!==null&&W!==void 0?W:void 0,cursor:($=(N=p==null?void 0:p.group)===null||N===void 0?void 0:N.cursor)!==null&&$!==void 0?$:void 0,lineDash:(Y=(U=p==null?void 0:p.group)===null||U===void 0?void 0:U.lineDash)!==null&&Y!==void 0?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}if(i.AABBBounds.width(),C&&Array.isArray(f.getCellValue(o,r))||!C){const gt=new Rl(m,{stroke:!1,x:a[3],y:a[0],canvas:(j=f.canvas)!==null&&j!==void 0?j:f.scenegraph.stage.window.getContext().canvas,mode:f.options.mode,modeParams:f.options.modeParams,spec:u,ClassType:G,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});i.appendChild(gt),f.internalProps.layoutMap.setChartInstance(o,r,gt.chartInstance)}return i}function B9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b){var C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U;if(!i){const et=xs(o,r,f,g);b&&(i=g.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,width:l,height:a,lineWidth:(_=(C=f==null?void 0:f.group)===null||C===void 0?void 0:C.lineWidth)!==null&&_!==void 0?_:void 0,fill:(y=(w=f==null?void 0:f.group)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:void 0,stroke:(R=(S=f==null?void 0:f.group)===null||S===void 0?void 0:S.stroke)!==null&&R!==void 0?R:void 0,strokeArrayWidth:et,strokeArrayColor:(x=(A=f==null?void 0:f.group)===null||A===void 0?void 0:A.strokeArrayColor)!==null&&x!==void 0?x:void 0,cursor:(M=(T=f==null?void 0:f.group)===null||T===void 0?void 0:T.cursor)!==null&&M!==void 0?M:void 0,lineDash:(P=(B=f==null?void 0:f.group)===null||B===void 0?void 0:B.lineDash)!==null&&P!==void 0?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),i&&i.role==="cell"||((i=new ue({x:e,y:n,width:l,height:a,lineWidth:(H=(F=f==null?void 0:f.group)===null||F===void 0?void 0:F.lineWidth)!==null&&H!==void 0?H:void 0,fill:(k=(E=f==null?void 0:f.group)===null||E===void 0?void 0:E.fill)!==null&&k!==void 0?k:void 0,stroke:(L=(I=f==null?void 0:f.group)===null||I===void 0?void 0:I.stroke)!==null&&L!==void 0?L:void 0,strokeArrayWidth:et,strokeArrayColor:(O=(D=f==null?void 0:f.group)===null||D===void 0?void 0:D.strokeArrayColor)!==null&&O!==void 0?O:void 0,cursor:(N=(W=f==null?void 0:f.group)===null||W===void 0?void 0:W.cursor)!==null&&N!==void 0?N:void 0,lineDash:(U=($=f==null?void 0:f.group)===null||$===void 0?void 0:$.lineDash)!==null&&U!==void 0?U:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}let Y;if(c){let et=o,gt=r;m&&(et=m.start.col,gt=m.start.row),Y=g.getCellIcons(et,gt)}let j=0,G=0;if(Array.isArray(Y)&&Y.length!==0){const{leftIconWidth:et,rightIconWidth:gt,absoluteLeftIconWidth:vt,absoluteRightIconWidth:it}=zc(Y,i,m,g);j=et+gt,G=et,i.forEachChildren(nt=>{nt.role==="icon-left"?nt.setAttribute("x",nt.attribute.x+h[3]):nt.role==="icon-right"?nt.setAttribute("x",nt.attribute.x+l-gt-h[1]):nt.role==="icon-absolute-right"&&nt.setAttribute("x",nt.attribute.x+l-it-h[1])}),i.forEachChildren(nt=>{u==="middle"?nt.setAttribute("y",(a-nt.AABBBounds.height())/2):u==="bottom"?nt.setAttribute("y",a-nt.AABBBounds.height()-h[2]):nt.setAttribute("y",h[0])})}const Z=P9(o,r,s-j,l,a,h,f,p,g);return Z&&i.appendChild(Z),Z.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],d==="center"?Z.setAttribute("x",h[3]+G+(l-Z.AABBBounds.width())/2):d==="right"?Z.setAttribute("x",h[3]+G+l-Z.AABBBounds.width()):Z.setAttribute("x",h[3]+G),u==="middle"?Z.setAttribute("y",h[0]+(a-Z.AABBBounds.height())/2):u==="bottom"?Z.setAttribute("y",h[0]+a-Z.AABBBounds.height()):Z.setAttribute("y",h[0]),i}function P9(i,t,e,n,o,r,s,l,a){var h,d,u,c;const g=a._getCellStyle(i,t),f=wt("size",g,i,t,a),p=wt("spaceBetweenTextAndIcon",g,i,t,a),m=wt("defaultFill",g,i,t,a),b=wt("defaultStroke",g,i,t,a),C=wt("disableFill",g,i,t,a),_=wt("checkedFill",g,i,t,a),w=wt("checkedStroke",g,i,t,a),y=wt("disableCheckedFill",g,i,t,a),S=wt("disableCheckedStroke",g,i,t,a),R=wt("checkIconImage",g,i,t,a),A=wt("indeterminateIconImage",g,i,t,a),x=a.getCellValue(i,t),T=a.getCellOriginValue(i,t);let M,B,P=(h=x)!==null&&h!==void 0?h:"";pe(x)?(M=x.checked,B=x.disable,P=(d=x.text)!==null&&d!==void 0?d:""):typeof x=="boolean"&&(M=x,P=""),M=a.stateManager.syncCheckedState(i,t,l.field,M);const F=uo(i,t,a),H=a._getCellStyle(i,t),E=(u=H.autoWrapText)!==null&&u!==void 0?u:a.internalProps.autoWrapText,{lineClamp:k}=H,{checked:I,disable:L}=l;if(M==null||typeof M=="function"){const Y=ii(I,{col:i,row:t,table:a,context:null,value:x,dataValue:T});M=a.stateManager.syncCheckedState(i,t,l.field,Y)}const D=ii(L,{col:i,row:t,table:a,context:null,value:x,dataValue:T}),O=e==="auto",W=a.isAutoRowHeight(t),N={text:P.length===1?P[0]:P,maxLineWidth:O?1/0:n-(r[1]+r[3]+F)-f-p,textBaseline:"top",autoWrapText:E,lineClamp:k,wordBreak:"break-word",heightLimit:W?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:F,whiteSpace:P.length!==1||E?"normal":"no-wrap"},$={x:0,y:0,text:s.text?Object.assign({},s.text,N):N,icon:{width:Math.floor(f/1.4),height:Math.floor(f/1.4)},box:{width:f,height:f},spaceBetweenTextAndIcon:p,disabled:(c=B??D)!==null&&c!==void 0&&c};M==="indeterminate"?($.checked=void 0,$.indeterminate=!0):($.checked=M,$.indeterminate=void 0),m&&($.box.fill=m),b&&($.box.stroke=b),C&&($.box.disableFill=C),_&&($.box.checkedFill=_),w&&($.box.checkedStroke=w),y&&($.box.disableCheckedFill=y),S&&($.box.disableCheckedStroke=S),R&&($.icon.checkIconImage=R),A&&($.icon.indeterminateIconImage=A);const U=new Tr($);return U.name="checkbox",U}function H9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f){var p,m,b,C,_,w,y,S,R,A,x,T;if(!i){const P=xs(o,r,g,c);(i=new ue({x:e,y:n,width:l,height:a,lineWidth:(m=(p=g==null?void 0:g.group)===null||p===void 0?void 0:p.lineWidth)!==null&&m!==void 0?m:void 0,fill:(C=(b=g==null?void 0:g.group)===null||b===void 0?void 0:b.fill)!==null&&C!==void 0?C:void 0,stroke:(w=(_=g==null?void 0:g.group)===null||_===void 0?void 0:_.stroke)!==null&&w!==void 0?w:void 0,strokeArrayWidth:P,strokeArrayColor:(S=(y=g==null?void 0:g.group)===null||y===void 0?void 0:y.strokeArrayColor)!==null&&S!==void 0?S:void 0,cursor:(A=(R=g==null?void 0:g.group)===null||R===void 0?void 0:R.cursor)!==null&&A!==void 0?A:void 0,lineDash:(T=(x=g==null?void 0:g.group)===null||x===void 0?void 0:x.lineDash)!==null&&T!==void 0?T:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i)}const{width:M,height:B}=E9(o,r,s,l,a,h,g,f,i,c);return l-=h[1]+h[3],a-=h[0]+h[2],i.forEachChildren(P=>{d==="center"?P.setAttribute("x",h[3]+P.attribute.x+(l-M)/2):d==="right"?P.setAttribute("x",h[3]+P.attribute.x+l-M):P.setAttribute("x",h[3]+P.attribute.x),u==="middle"?P.setAttribute("y",h[0]+P.attribute.y+(a-B)/2):u==="bottom"?P.setAttribute("y",h[0]+P.attribute.y+a-B):P.setAttribute("y",h[0]+P.attribute.y)}),i}function E9(i,t,e,n,o,r,s,l,a,h){var d,u;const c=h._getCellStyle(i,t);let g=wt("size",c,i,t,h),f=wt("innerRadius",c,i,t,h),p=wt("outerRadius",c,i,t,h);const m=wt("spaceBetweenTextAndIcon",c,i,t,h),b=wt("spaceBetweenRadio",c,i,t,h),C=wt("defaultFill",c,i,t,h),_=wt("defaultStroke",c,i,t,h),w=wt("disableFill",c,i,t,h),y=wt("checkedFill",c,i,t,h),S=wt("checkedStroke",c,i,t,h),R=wt("disableCheckedFill",c,i,t,h),A=wt("disableCheckedStroke",c,i,t,h);pt(p)?g=2*p:p=Math.round(g/2),(!pt(f)||f<0)&&(f=Math.round(p/7*3));const x=h.getCellValue(i,t),T=h.getCellOriginValue(i,t),M=uo(i,t,h),B=h._getCellStyle(i,t),P=(d=B.autoWrapText)!==null&&d!==void 0?d:h.internalProps.autoWrapText,{lineClamp:F}=B,H=e==="auto",E=h.heightMode==="autoHeight",k={maxLineWidth:H?1/0:n-(r[1]+r[3]+M)-g-m,textBaseline:"top",autoWrapText:P,lineClamp:F,wordBreak:"break-word",heightLimit:E?-1:o-Math.floor(r[0]+r[2]),pickable:!1,dx:M},I={x:0,y:0,text:s.text?Object.assign({},s.text,k):k,circle:{innerRadius:f,outerRadius:p},spaceBetweenTextAndIcon:m};C&&(I.circle.fill=C),_&&(I.circle.stroke=_),w&&(I.circle.disableFill=w),y&&(I.circle.checkedFill=y),S&&(I.circle.checkedStroke=S),R&&(I.circle.disableCheckedFill=R),A&&(I.circle.disableCheckedStroke=A);let L=0,D=0;const O=(u=l.radioDirectionInCell)!==null&&u!==void 0?u:"vertical";if(st(x))x.forEach((W,N)=>{const $=RT(W,T,N,i,t,l,P,I,h);$&&a.appendChild($),$.id=`radio-${i}-${t}-${N}`,$.render();const U=$.AABBBounds;O==="vertical"?($.setAttribute("y",D),D+=U.height()+(N!==x.length-1?b:0),L=Math.max(L,U.width())):O==="horizontal"&&($.setAttribute("x",L),L+=U.width()+(N!==x.length-1?b:0),D=Math.max(D,U.height()))});else{const W=RT(x,T,void 0,i,t,l,P,I,h);W&&a.appendChild(W),W.id=`radio-${i}-${t}`,W.render();const N=W.AABBBounds;L=N.width(),D=N.height()}return{width:L,height:D}}function RT(i,t,e,n,o,r,s,l,a){const h=L9(i,t,e,n,o,r,a),d=k9(i,t,n,o,r,a),u=pe(i)?i.text:vi(i)?"":i??"",c=xt({},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 eh(c);return g.name="radio",g}function L9(i,t,e,n,o,r,s){var l,a;const h=(l=r.radioCheckType)!==null&&l!==void 0?l:"column";let d,u;return pe(i)?d=i.checked:typeof i=="boolean"&&(d=i),d=s.stateManager.syncRadioState(n,o,r.field,h,e,d),d!=null&&typeof d!="function"||(u=ii(r.checked,{col:n,row:o,table:s,context:null,value:i,dataValue:t}),d=s.stateManager.syncRadioState(n,o,r.field,h,e,u)),(a=d??u)!==null&&a!==void 0&&a}function k9(i,t,e,n,o,r){var s;let l;pe(i)&&(l=i.disable);const a=ii(o.disable,{col:e,row:n,table:r,context:null,value:i,dataValue:t});return(s=l??a)!==null&&s!==void 0&&s}const zr=new sz,Nr=new cs;function F9(i,t,e,n,o,r,s,l,a,h,d,u){var c,g,f,p,m,b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L;if(!i){const O=xs(o,r,d,h);u&&(i=h.scenegraph.highPerformanceGetCell(o,r,!0))&&i.role==="cell"&&i.setAttributes({x:e,y:n,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:(b=(m=d==null?void 0:d.group)===null||m===void 0?void 0:m.stroke)!==null&&b!==void 0?b:void 0,strokeArrayWidth:O,strokeArrayColor:(_=(C=d==null?void 0:d.group)===null||C===void 0?void 0:C.strokeArrayColor)!==null&&_!==void 0?_:void 0,cursor:(y=(w=d==null?void 0:d.group)===null||w===void 0?void 0:w.cursor)!==null&&y!==void 0?y:void 0,lineDash:(R=(S=d==null?void 0:d.group)===null||S===void 0?void 0:S.lineDash)!==null&&R!==void 0?R:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),i&&i.role==="cell"||((i=new ue({x:e,y:n,width:s,height:l,lineWidth:(x=(A=d==null?void 0:d.group)===null||A===void 0?void 0:A.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=d==null?void 0:d.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=d==null?void 0:d.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:O,strokeArrayColor:(H=(F=d==null?void 0:d.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=d==null?void 0:d.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=d==null?void 0:d.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",i.col=o,i.row=r,t==null||t.addCellGroup(i))}const D=I9(o,r,s,l,a,h);return D&&i.appendChild(D),i}function I9(i,t,e,n,o,r){let s,l;const a=r.internalProps.layoutMap.getBody(i,t).sparklineSpec,h=r.getCellValue(i,t);if(!Array.isArray(h))return;const d=o[3],u=o[0];e-=o[1]+o[3];const c=n-=o[0]+o[2];if(typeof a=="function"){const _={col:i,row:t,dataValue:r.getCellOriginValue(i,t)||"",value:r.getCellValue(i,t)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(i,t)),table:r};s=a(_),l=TT(s,d,u,e,n)}else s=a,l=TT(a,d,u,e,n);const g=[],f=[];let p,m;if(typeof s.xField=="object")zr.domain(s.xField.domain),p=s.xField.field;else if(typeof s.xField=="string"){const _=h.map(w=>w[s.xField]);zr.domain(_),p=s.xField}else Array.isArray(h)&&(zr.domain(Array.from({length:h.length},(_,w)=>w)),p=s.xField);if(zr.range([0,e]),typeof s.yField=="object")Nr.domain(s.yField.domain),m=s.yField.field;else if(typeof s.yField=="string"){const _=MT(h,s.yField);Nr.domain([Math.min(..._),Math.max(..._)]),m=s.yField}else if(Array.isArray(h)){const _=MT(h);Nr.domain([Math.min(..._),Math.max(..._)]),m=s.yField}if(Nr.range([0,n]),typeof s.xField=="object"&&Array.isArray(s.xField.domain)){const _=h.map(y=>y[s.xField.field]),w=s.xField.domain;for(let y=0;y<w.length;y++){let S=!1;for(let R=0;R<_.length;R++)if(w[y]===_[R]){const A=h[R];if(!z(A[p])||!z(A[m]))break;g.push({x:0+zr.scale(A[p]),y:c-Nr.scale(A[m]),defined:z(A[m])}),f.push(A),S=!0;break}S||(g.push({x:0+zr.scale(w[y]),y:0,defined:!1}),f.push({[p]:w[y],[m]:null}))}}else for(let _=0;_<h.length;_++){const w=h[_];g.push({x:0+zr.scale(p?w[p]:_),y:c-Nr.scale(m?w[m]:w),defined:z(m?w[m]:w),rawData:w}),f.push(w)}const b=l.getChildByName("sparkline-line");b&&b.setAttribute("points",g),b.bandwidth=zr.step(),b.min=Nr.range()[0],b.max=Nr.range()[1];const C=l.getChildByName("sparkline-symbol-group");if(C){const _=s.pointShowRule==="isolatedPoint";if(s.pointShowRule==="all")for(let w=0;w<g.length;w++){const{x:y,y:S,defined:R}=g[w];if(R){const A=ka({x:y,y:S});C.appendChild(A)}}else if(_)for(let w=0;w<g.length;w++){const{x:y,y:S,defined:R}=g[w];if(R&&(!g[w-1]||!g[w-1].defined)&&(!g[w+1]||!g[w+1].defined)){const A=ka({x:y,y:S});C.appendChild(A)}}}return l}function TT(i,t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A,x,T;let M;M=typeof i=="function"?i(null):i;const B=new ue({x:t,y:e,width:n,height:o,stroke:!1,fill:!1});if(B.name="sparkline",M.type==="line"){const P=mn({x:0,y:0,curveType:M.smooth?"monotoneX":"linear",stroke:(l=(s=(r=M.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=M.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",B.addChild(P),M.crosshair&&(P.hover=(c=(u=M.crosshair)===null||u===void 0?void 0:u.style)!==null&&c!==void 0?c:{stroke:"#000",interpolate:"linear"});const F=new ue({x:0,y:0,width:n,height:o,stroke:!1,fill:!1});F.name="sparkline-symbol-group",F.setTheme({symbol:{stroke:(p=(f=(g=M.point)===null||g===void 0?void 0:g.style)===null||f===void 0?void 0:f.stroke)!==null&&p!==void 0?p:"#000",lineWidth:(C=(b=(m=M.point)===null||m===void 0?void 0:m.style)===null||b===void 0?void 0:b.strokeWidth)!==null&&C!==void 0?C:1,fill:(y=(w=(_=M.point)===null||_===void 0?void 0:_.style)===null||w===void 0?void 0:w.fill)!==null&&y!==void 0?y:"#000",size:2*((A=(R=(S=M.point)===null||S===void 0?void 0:S.style)===null||R===void 0?void 0:R.size)!==null&&A!==void 0?A:3),symbolType:"circle"}}),B.addChild(F),F.hover=(T=(x=M.point)===null||x===void 0?void 0:x.hover)!==null&&T!==void 0&&T}return B}function MT(i,t){const e=[];for(let n=0;n<i.length;n++){const o=i[n];z(t)&&z(o[t])?e.push(o[t]):!z(t)&&z(o)&&e.push(o)}return e}const pv=Cn();function D9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m){var b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et;const gt=g._getCellStyle(n,o),vt=Fc("padding",gt,n,o,g);!((b=g.options.customConfig)===null||b===void 0)&&b.imageMargin?h=ee((C=g.options.customConfig)===null||C===void 0?void 0:C.imageMargin):z(vt)&&(h=vt),!((_=f==null?void 0:f.text)===null||_===void 0)&&_.textAlign&&(d=(w=f==null?void 0:f.text)===null||w===void 0?void 0:w.textAlign),!((y=f==null?void 0:f.text)===null||y===void 0)&&y.textBaseline&&(u=(S=f==null?void 0:f.text)===null||S===void 0?void 0:S.textBaseline);const it=xs(n,o,f,g);let nt,bt;if(m&&(nt=g.scenegraph.highPerformanceGetCell(n,o,!0),nt&&nt.role==="cell"&&nt.setAttributes({x:t,y:e,width:r,height:s,lineWidth:(A=(R=f==null?void 0:f.group)===null||R===void 0?void 0:R.lineWidth)!==null&&A!==void 0?A:void 0,fill:(T=(x=f==null?void 0:f.group)===null||x===void 0?void 0:x.fill)!==null&&T!==void 0?T:void 0,stroke:(B=(M=f==null?void 0:f.group)===null||M===void 0?void 0:M.stroke)!==null&&B!==void 0?B:void 0,strokeArrayWidth:it,strokeArrayColor:(F=(P=f==null?void 0:f.group)===null||P===void 0?void 0:P.strokeArrayColor)!==null&&F!==void 0?F:void 0,cursor:(E=(H=f==null?void 0:f.group)===null||H===void 0?void 0:H.cursor)!==null&&E!==void 0?E:void 0,lineDash:(I=(k=f==null?void 0:f.group)===null||k===void 0?void 0:k.lineDash)!==null&&I!==void 0?I:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})),nt&&nt.role==="cell"||(nt=new ue({x:t,y:e,width:r,height:s,lineWidth:(D=(L=f==null?void 0:f.group)===null||L===void 0?void 0:L.lineWidth)!==null&&D!==void 0?D:void 0,fill:(W=(O=f==null?void 0:f.group)===null||O===void 0?void 0:O.fill)!==null&&W!==void 0?W:void 0,stroke:($=(N=f==null?void 0:f.group)===null||N===void 0?void 0:N.stroke)!==null&&$!==void 0?$:void 0,strokeArrayWidth:it,strokeArrayColor:(Y=(U=f==null?void 0:f.group)===null||U===void 0?void 0:U.strokeArrayColor)!==null&&Y!==void 0?Y:void 0,cursor:(G=(j=f==null?void 0:f.group)===null||j===void 0?void 0:j.cursor)!==null&&G!==void 0?G:void 0,lineDash:(et=(Z=f==null?void 0:f.group)===null||Z===void 0?void 0:Z.lineDash)!==null&&et!==void 0?et:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),nt.role="cell",nt.col=n,nt.row=o,i==null||i.addCellGroup(nt)),c){let _t=n,ut=o;p&&(_t=p.start.col,ut=p.start.row),bt=g.getCellIcons(_t,ut)}let Ct=0,at=0;if(Array.isArray(bt)&&bt.length!==0){const{leftIconWidth:_t,rightIconWidth:ut,absoluteLeftIconWidth:It,absoluteRightIconWidth:Ut}=zc(bt,nt,p,g);Ct=_t,at=ut,nt.forEachChildren(yt=>{yt.role==="icon-left"?yt.setAttribute("x",yt.attribute.x+h[3]):yt.role==="icon-right"?yt.setAttribute("x",yt.attribute.x+r-ut-h[1]):yt.role==="icon-absolute-right"&&yt.setAttribute("x",yt.attribute.x+r-Ut-h[1])}),nt.forEachChildren(yt=>{u==="middle"?yt.setAttribute("y",(s-yt.AABBBounds.height())/2):u==="bottom"?yt.setAttribute("y",s-yt.AABBBounds.height()-h[2]):yt.setAttribute("y",h[0])}),nt._cellLeftIconWidth=Ct,nt._cellRightIconWidth=at}const rt=g.getCellValue(n,o),ct=document.createElement("video");ct.addEventListener("loadeddata",()=>{a&&fA(n,o,ct.videoWidth,ct.videoHeight,g.scenegraph,h,nt);const{width:_t,height:ut,isMerge:It}=Sl(nt,g);if(l){const{width:ye,height:Oe}=kc(ct.videoWidth,ct.videoHeight,_t-h[1]-h[3],ut-h[0]-h[2]),Be=Pm(0,0,_t,ut,ye,Oe,d,u,h);ht.setAttributes({width:ye,height:Oe,x:Be.x,y:Be.y,dx:0})}else ht.setAttributes({x:h[3],y:h[0],width:_t-h[1]-h[3],height:ut-h[2]-h[0],dy:0});It&&Hm(nt.mergeStartCol,nt.mergeEndCol,nt.mergeStartRow,nt.mergeEndRow,g);const{width:Ut,height:yt}=Sl(nt,g),Tt=Math.floor(Math.min(Ut-h[1]-h[3],yt-h[2]-h[0])/2),kt=0+(Ut>ht.attribute.width?ht.attribute.x-0+ht.attribute.width/2:Ut/2),oe=0+(yt>ht.attribute.height?ht.attribute.y-0+ht.attribute.height/2:yt/2),re=new vs({x:kt-Tt/2,y:oe-Tt/2,width:Tt,height:Tt,image:pv.play.svg,cursor:pv.play.cursor});re.name="play-icon",nt.appendChild(re),g.scenegraph.updateNextFrame()}),ct.onerror=()=>{ht.image=pv.damage_pic.svg},ct.src=rt,ct.setAttribute("preload","auto");const ht=pu({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:ct,cursor:"pointer"});return ht.name="image",ht.keepAspectRatio=l,ht.textAlign=d,ht.textBaseline=u,nt.appendChild(ht),nt}function O9(i,t,e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C){var _,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt;const bt=i._getCellStyle(r,s),Ct=Fc("padding",bt,r,s,i);z(Ct)&&(d=Ct),!((_=m==null?void 0:m.text)===null||_===void 0)&&_.textAlign&&(u=(w=m==null?void 0:m.text)===null||w===void 0?void 0:w.textAlign),!((y=m==null?void 0:m.text)===null||y===void 0)&&y.textBaseline&&(c=(S=m==null?void 0:m.text)===null||S===void 0?void 0:S.textBaseline);const at=i.isAutoRowHeight(s),rt=l==="auto",ct=(R=bt.autoWrapText)!==null&&R!==void 0?R:i.internalProps.autoWrapText,ht=bt.lineClamp,_t=xs(r,s,m,i);let ut;if(C&&(ut=i.scenegraph.getCell(r,s,!0),ut&&ut.role==="cell"&&ut.setAttributes({x:n,y:o,width:a,height:h,lineWidth:(x=(A=m==null?void 0:m.group)===null||A===void 0?void 0:A.lineWidth)!==null&&x!==void 0?x:void 0,fill:(M=(T=m==null?void 0:m.group)===null||T===void 0?void 0:T.fill)!==null&&M!==void 0?M:void 0,stroke:(P=(B=m==null?void 0:m.group)===null||B===void 0?void 0:B.stroke)!==null&&P!==void 0?P:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(H=(F=m==null?void 0:m.group)===null||F===void 0?void 0:F.strokeArrayColor)!==null&&H!==void 0?H:void 0,cursor:(k=(E=m==null?void 0:m.group)===null||E===void 0?void 0:E.cursor)!==null&&k!==void 0?k:void 0,lineDash:(L=(I=m==null?void 0:m.group)===null||I===void 0?void 0:I.lineDash)!==null&&L!==void 0?L:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius})),ut&&ut.role==="cell"||(ut=new ue({x:n,y:o,width:a,height:h,lineWidth:(O=(D=m==null?void 0:m.group)===null||D===void 0?void 0:D.lineWidth)!==null&&O!==void 0?O:void 0,fill:(N=(W=m==null?void 0:m.group)===null||W===void 0?void 0:W.fill)!==null&&N!==void 0?N:void 0,stroke:(U=($=m==null?void 0:m.group)===null||$===void 0?void 0:$.stroke)!==null&&U!==void 0?U:void 0,strokeArrayWidth:_t??void 0,strokeArrayColor:(j=(Y=m==null?void 0:m.group)===null||Y===void 0?void 0:Y.strokeArrayColor)!==null&&j!==void 0?j:void 0,cursor:(Z=(G=m==null?void 0:m.group)===null||G===void 0?void 0:G.cursor)!==null&&Z!==void 0?Z:void 0,lineDash:(gt=(et=m==null?void 0:m.group)===null||et===void 0?void 0:et.lineDash)!==null&&gt!==void 0?gt:void 0,lineCap:"butt",clip:!0,cornerRadius:m.group.cornerRadius}),ut.role="cell",ut.col=r,ut.row=s,e==null||e.addCellGroup(ut)),f&&ut.appendChild(f),p){const It=t;let Ut;if(g){let yt=r,Tt=s;b&&(yt=b.start.col,Tt=b.start.row),Ut=i.getCellIcons(yt,Tt)}if(tN(ut,Ut,It,d,rt,at,ct,typeof ht=="number"?ht:void 0,ut.attribute.width,ut.attribute.height,u,c,i,m,b),(vt=m==null?void 0:m._vtable)===null||vt===void 0?void 0:vt.marked){const yt=o0({x:ut.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});yt.name="mark",ut.appendChild(yt)}}return f&&ut.setAttributes({width:Math.max(ut.attribute.width,(it=f.attribute.width)!==null&&it!==void 0?it:0),height:Math.max(ut.attribute.height,(nt=f.attribute.height)!==null&&nt!==void 0?nt:0)}),ut}function z9(i,t,e,n,o,r,s,l,a,h){var d,u,c,g,f,p;i.dependField&&(o=(u=(d=a.getCellOriginRecord(r,s))===null||d===void 0?void 0:d[i.dependField])!==null&&u!==void 0?u:o),i.barType=(c=i.barType)!==null&&c!==void 0?c:"default",i.min=(g=ii(i.min,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&g!==void 0?g:0,i.max=(f=ii(i.max,{col:r,row:s,table:a,value:n,dataValue:o,cellHeaderPaths:void 0}))!==null&&f!==void 0?f:i.min+100;let m=0;m=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let b=e,C=m,_=0;pt(a.theme._contentOffset)&&(_=a.theme._contentOffset);const w=new ue({x:-_,y:-_,width:b,height:C});w.name="progress-bar";const{showBar:y,barColor:S,barBgColor:R,barPositiveColor:A,barNegativeColor:x,barAxisColor:T,barRightToLeft:M,showBarMark:B,barMarkPositiveColor:P,barMarkNegativeColor:F,barMarkWidth:H,barMarkPosition:E}=t;let{barHeight:k,barBottom:I,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((G,Z)=>{if(typeof G=="string"&&vc.endsWith(G,"%")){const et=Number(G.substr(0,G.length-1));return Z===0||Z===2?m*et/100:e*et/100}return Number(G)});const D=ee(wt("borderLineWidth",t,r,s,a)),O=Math.max(L[0],Math.ceil(D[0]/2)),W=Math.max(L[1],Math.floor(D[1]/2)),N=Math.max(L[2],Math.floor(D[2]/2)),$=Math.max(L[3],Math.ceil(D[3]/2));b-=W+$,C-=N+O,s===a.rowCount-1&&[0,"0"].includes(I)&&(C-=1);const U=O,Y=$,j=b;if(typeof k=="string"&&vc.endsWith(k,"%")?(k=Number(k.substr(0,k.length-1)),k=C*k/100):k=Number(k),typeof I=="string"&&vc.endsWith(I,"%")?(I=Number(I.substr(0,I.length-1)),I=C*I/100):I=Number(I),ii(y,{col:r,row:s,table:a,context:null,value:n,dataValue:o})){let G=`${o}`;vc.endsWith(G,"%")&&(G=G.substr(0,G.length-1));const Z=Number(G);if(isNaN(Z))return w;if(((p=i.barType)!==null&&p!==void 0?p:"default")==="default"){const et=Z<i.min?0:Z>i.max?1:(Z-i.min)/(i.max-i.min),gt=b,vt=U+C-k-I;let it=Math.min(gt*et,gt);const nt=M?Y+j-it:Y;r!==a.colCount-1||et!==1||M||(it-=1);const bt=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et});if(bt){const rt=Ie({x:nt,y:vt,width:gt,height:k,fill:bt});w.addChild(rt)}const Ct=ii(S,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:et})||"#20a8d8",at=Ie({x:nt,y:vt,width:it,height:k,fill:Ct});w.addChild(at)}else if(i.barType==="negative"){const et=i.min<0?-i.min:0,gt=i.max>0?i.max:0,vt=et/(et+gt),it=1-vt,nt=Z>0?Z/gt:0,bt=Z<0?-Z/et:0,Ct=b,at=U+C-k-I,rt=Y,ct=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt});if(ct){const Be=Ie({x:rt,y:at,width:Ct,height:k,fill:ct});w.addChild(Be)}const ht=M?it*Ct:vt*Ct,_t=Math.min(Ct*vt*bt,Ct),ut=M?{left:rt+ht,top:at,width:_t,height:k}:{left:rt+ht-_t,top:at,width:_t,height:k},It=ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:bt})||"#20a8d8",Ut=Ie({x:ut.left,y:ut.top,width:ut.width,height:ut.height,fill:It});w.addChild(Ut);let yt=Math.min(Ct*it*nt,Ct);r!==a.colCount-1||nt!==1||M||(yt-=1);const Tt=M?{left:rt+ht-yt,top:at,width:yt,height:k}:{left:rt+ht,top:at,width:yt,height:k},kt=ii(A,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt})||"#20a8d8",oe=Ie({x:Tt.left,y:Tt.top,width:Tt.width,height:Tt.height,fill:kt});w.addChild(oe);const re=M?ut.left:Tt.left,ye=ii(T,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt}),Oe=mn({x:0,y:0,stroke:ye,lineWidth:1,lineDash:[2,2],points:[{x:re,y:0},{x:re,y:m}]});if(w.addChild(Oe),B&&(nt||bt)){const Be=H,Ee=[];let At;if(nt>0)if(At=ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:nt})||"#20a8d8",E==="right"){const Bt=M?Tt.left+H/2:Tt.left+Tt.width-H/2;Ee.push({x:Bt,y:Tt.top}),Ee.push({x:Bt,y:Tt.top+Tt.height})}else E==="bottom"&&(Ee.push({x:Tt.left,y:Tt.top+Tt.height-H/2}),Ee.push({x:Tt.left+Tt.width,y:Tt.top+Tt.height-H/2}));else if(bt>0)if(At=ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:bt})||"#20a8d8",E==="right"){const Bt=M?ut.left+ut.width-H/2:ut.left+H/2;Ee.push({x:Bt,y:ut.top}),Ee.push({x:Bt,y:ut.top+ut.height})}else E==="bottom"&&(Ee.push({x:ut.left,y:ut.top+ut.height-H/2}),Ee.push({x:ut.left+ut.width,y:ut.top+ut.height-H/2}));const mt=mn({x:0,y:0,stroke:At,lineWidth:Be,points:Ee});w.addChild(mt)}}else if(i.barType==="negative_no_axis"){const et=i.min<0?-i.min:0,gt=i.max>0?i.max:0,vt=Math.max(et,gt),it=vt===0?0:Math.abs(Z)/vt,nt=b;let bt=Math.min(nt*it,nt);r!==a.colCount-1||it!==1||M||(bt-=1);const Ct=U+C-k-I,at=M?Y+j-bt:Y,rt=ii(R,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it});if(rt){const ut=Ie({x:at,y:Ct,width:nt,height:k,fill:rt});w.addChild(ut)}const ct={left:at,top:Ct,width:bt,height:k};let ht;ht=Z>=0?ii(A,{col:r,row:s,table:a,context:null,value:n,percentile:it,dataValue:o})||"#20a8d8":ii(x,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it})||"#20a8d8";const _t=Ie({x:ct.left,y:ct.top,width:ct.width,height:ct.height,fill:ht});if(w.addChild(_t),B&&Z){const ut=H,It=[];let Ut;if(Ut=Z>=0?ii(P,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it})||"#20a8d8":ii(F,{col:r,row:s,table:a,context:null,value:n,dataValue:o,percentile:it})||"#20a8d8",E==="right"){const Tt=M?ct.left+H/2:ct.left+ct.width-H/2;It.push({x:Tt,y:ct.top}),It.push({x:Tt,y:ct.top+ct.height})}else E==="bottom"&&(It.push({x:ct.left,y:ct.top+ct.height-H/2}),It.push({x:ct.left+ct.width,y:ct.top+ct.height-H/2}));const yt=mn({x:0,y:0,stroke:Ut,lineWidth:ut,points:It});w.addChild(yt)}}}return w}function N9(i,t,e,n,o,r){var s,l,a,h,d,u,c,g,f;if(e!=null&&e.zero&&(i=Math.min(i,0),t=Math.max(t,0)),e==null?void 0:e.expand){const b=i,C=t;z(e.expand.min)&&(i=b-(C-b)*e.expand.min),z(e.expand.max)&&(t=C+(C-b)*e.expand.max)}let p,m;if(pt(e==null?void 0:e.min)&&(i=e.min),pt(e==null?void 0:e.max)&&(t=e.max),(e==null?void 0:e.type)==="log"?(p=new qa,p.base((s=e==null?void 0:e.base)!==null&&s!==void 0?s:10)):(e==null?void 0:e.type)==="symlog"?(p=new Za,p.constant((l=e==null?void 0:e.constant)!==null&&l!==void 0?l:10)):p=new cs,p.domain([i,t],!!(e!=null&&e.nice)),e==null?void 0:e.nice){let b=(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;ce(b)&&(b=b({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:kh.LABEL_FONT_SIZE}})),e.niceType==="accurateFirst"&&(b=Math.max(10,b)),Mt(e.min)&&Mt(e.max)?p.nice(b):z(e.min)&&Mt(e.max)?p.niceMax(b):Mt(e.min)&&z(e.max)&&p.niceMin(b)}return delete p._niceType,r||(m=p.ticks(pt(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:m}}const Ig=()=>{Et.registerFunction("createChartCellGroup",M9),Et.registerFunction("getAxisDomainRangeAndLabels",N9)},Dg=()=>{Et.registerFunction("createCheckboxCellGroup",B9)},Og=()=>{Et.registerFunction("createImageCellGroup",nN)},zg=()=>{Et.registerFunction("createProgressBarCell",z9)},Ng=()=>{Et.registerFunction("createRadioCellGroup",H9)},Wg=()=>{Et.registerFunction("createSparkLineCellGroup",F9)},Dl=()=>{Et.registerFunction("createTextCellGroup",O9)},Vg=()=>{Et.registerFunction("createVideoCellGroup",D9)};Pg(),Hg(),Eg(),Lg(),kg(),Fg(),A9(),Ig(),Dg(),Og(),zg(),Ng(),Wg(),Dl(),Vg();class W9 extends bT{}Dl();class V9 extends bT{}function j9(i,t,e,n,o,r){const s=r.columnHeaderLevelCount,l=[],a=[];for(let c=0;c<e.length;c++)n.includes(e[c])||a.push(o[c]);for(let c=0;c<n.length;c++)if(!e.includes(n[c])){const g={col:i,row:s+c};l.push(g)}let h=r.getParentCellId(i,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 BT={startInTotal:0,level:0};class hr{constructor(t,e,n,o){var r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;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=Zi,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(x=>{typeof x=="string"?this.indicatorKeys.push(x):this.indicatorKeys.push(x.indicatorKey)}),this.columnDimensionTree=n,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(x=>{var T,M;if(x.chartSpec&&x.chartSpec.series&&x.chartSpec.series.length>1){const B=(M=(T=x.chartSpec.axes)!==null&&T!==void 0?T:this._table.pivotChartAxes)!==null&&M!==void 0?M:[];if(!B.length||B.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=nm(this._rowHeaderCellFullPathIds_FULL),t.options.rowHierarchyType==="tree"&&((m=this.extensionRows)===null||m===void 0?void 0:m.length)>=1&&(this.generateExtensionRowTree(),this.extensionRows.forEach(x=>{const T=[];x.rows.forEach(M=>{typeof M=="string"?T.push(M):T.push(M.dimensionKey)}),this._extensionRowDimensionKeys.push(T),this.fullRowDimensionKeys=this.fullRowDimensionKeys.concat(T)})),this.sharedVar.seqId=Math.max(this.sharedVar.seqId,this._headerObjects.length);let S,R=this.columnDimensionTree.dimensionKeysIncludeVirtual.valueArr();!this.dataset||this._table.isPivotChart()||((C=(b=this.dataset.records)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)!==0||this.dataset.customColTree||(R=this.columnsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol&&R.push(this.indicatorDimensionKey)),R=this.columnHeaderTitle?[""].concat(R):R;let A=[];if(this.rowHierarchyType==="tree"&&((_=this.extensionRows)===null||_===void 0?void 0:_.length)>=1){const x=[];x.push(this.rowDimensionKeys[0]),this._extensionRowDimensionKeys.forEach(T=>{x.push(T[0])}),A=this.extensionRows.reduce((T,M)=>T.concat(M.rows),[]),S=this.rowHeaderTitle?[""].concat(x):x}else S=this.rowDimensionTree.dimensionKeysIncludeVirtual.valueArr(),!this.dataset||this._table.isPivotChart()||((y=(w=this.dataset.records)===null||w===void 0?void 0:w.length)!==null&&y!==void 0?y:0)!==0||this.dataset.customRowTree||(S=this.rowsDefine.map(x=>typeof x=="string"?x:x.dimensionKey),this.indicatorsAsCol||S.push(this.indicatorDimensionKey)),S=this.rowHeaderTitle?[""].concat(S):S;this.cornerHeaderObjs=this._addCornerHeaders(R,S,this.columnsDefine.concat(...this.rowsDefine,...A)),this.colIndex=0,this._headerObjectMap=this._headerObjects.reduce((x,T)=>(x[T.id]=T,x),{}),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(x=>{var T,M,B,P,F,H,E,k;!((T=x==null?void 0:x.style)===null||T===void 0)&&T.padding&&(this._chartPadding=x.style.padding),!((M=x.chartSpec)===null||M===void 0)&&M.barWidth&&typeof x.chartSpec.barWidth=="number"&&(this._chartItemSpanSize=(B=x.chartSpec)===null||B===void 0?void 0:B.barWidth);const I=(F=(P=x.chartSpec)===null||P===void 0?void 0:P.axes)===null||F===void 0?void 0:F.find(L=>L.type==="band");return I!=null&&I.bandSize&&(this._chartItemBandSize=I==null?void 0:I.bandSize,this._chartPaddingInner=(H=st(I.paddingInner)?I.paddingInner[0]:I.paddingInner)!==null&&H!==void 0?H:0,this._chartPaddingOuter=(E=st(I.paddingOuter)?I.paddingOuter[0]:I.paddingOuter)!==null&&E!==void 0?E:0),this._chartItemSpanSize>0||((k=x.chartSpec.series)===null||k===void 0||k.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,n;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:(n=t.cellType)!==null&&n!==void 0?n:"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,n,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()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n: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,n,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()&&((n=(e=this.dataset.records)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n: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,n,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<n.length;l++){const a=n[l];H8(a,t,r,o,e,this)}}_addHeadersForTreeMode(t,e,n,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<n.length;d++){const u=n[d];E8(u,t,a,o,e,r,s,l,this)}}_addCornerHeaders(t,e,n){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=n.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=n.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=n.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=n.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=n.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 n=this._rowHeaderCellFullPathIds_FULL;this._rowHeaderCellFullPathIds_FULL=[],n.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=Le(t.rowTree);this._rowHeaderExtensionTree[s]?(this._rowHeaderExtensionTree[s].reset(this._rowHeaderExtensionTree[s].tree.children,!0),a=this._rowHeaderExtensionTree[s]):(a=new He(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,n;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;(n=this._indicators)===null||n===void 0||n.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(z(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(z(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(z(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(z(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,n,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=(n=this.columnDimensionTree)===null||n===void 0?void 0:n.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&&Fh(this.indicatorsDefine)&&(c-=1),void(this.columnHeaderLevelCount=c)}this.columnHeaderLevelCount=this.indicatorsAsCol?this.hideIndicatorName?0:1:0}resetRowHeaderLevelCount(){var t,e,n,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&&!(!((n=this.dataset.customRowTree)===null||n===void 0)&&n.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,n,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=(n=this._rowHeaderCellIds)===null||n===void 0?void 0:n.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&&Fh(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 n,o,r,s,l;if(e>=0&&t>=0){if(this.isSeriesNumber(t,e))return"";if(this.isCornerHeader(t,e))return(n=this._cornerHeaderCellIds[e])===null||n===void 0?void 0:n[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 n;if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const o=this.getCellId(t,e);return(n=this._headerObjectMap[o])!==null&&n!==void 0?n:{id:void 0,field:"",headerType:"text",define:void 0}}getHeaderField(t,e){var n,o;const r=this.getCellId(t,e);return((n=this._headerObjectMap[r])===null||n===void 0?void 0:n.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 n=this._columnHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o+this._table.frozenColCount,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e+this._table.frozenRowCount}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let o=0;o<n.length;o++)if(n[o]===t)return{col:o,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find(n=>n&&n.field===t);return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){var n,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 b=this.getSeriesNumberBody(t,e);return this.setBodyWidthCache(t,e,b),b}const f=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const b=(o=(n=f.colHeaderPaths)===null||n===void 0?void 0:n.find(_=>_.indicatorKey))===null||o===void 0?void 0:o.indicatorKey,C=z(b)&&(l=(s=(r=this._indicators)===null||r===void 0?void 0:r.find(_=>_.indicatorKey===b))!==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,C),C}const p=(h=(a=f.rowHeaderPaths)===null||a===void 0?void 0:a.find(b=>b.indicatorKey))===null||h===void 0?void 0:h.indicatorKey,m=z(p)&&(c=(u=(d=this._indicators)===null||d===void 0?void 0:d.find(b=>b.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,m),m}getCellRange(t,e){var n,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<((n=this.colCount)!==null&&n!==void 0?n: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,n,o){const r=this.getCellRange(t,e),s=this.getCellRange(n,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 n=this.getColHeaderPathCache(t,e),o=this.getRowHeaderPathCache(t,e);const r=this.getBodyIndexByCol(t),s=this.getBodyIndexByRow(e)+this.currentPageStartIndex;if(!n&&e>=0&&r>=0&&(n=this.columnDimensionTree.getTreePath(r,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel),this.setColHeaderPathCache(t,e,n)),!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:n,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getCellHeaderPaths(t,e){var n,o;const r=this.getCellHeaderPathsWithTreeNode(t,e),s={colHeaderPaths:[],rowHeaderPaths:[],cellLocation:r.cellLocation};return(n=r.colHeaderPaths)===null||n===void 0||n.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(n=>typeof n!="string"&&!!t&&n.indicatorKey===t)}findFullCellIds(t){const e=[];for(let n=0;n<t.length;n++){let o=t[n];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 n,o,r;if(this.isHeader(t,e)){const s=this.getHeader(t,e);return(o=(n=this.rowsDefine)===null||n===void 0?void 0:n.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 n,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===Vt.collapse?Vt.expand:Vt.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((m,b)=>typeof b=="string"?m:m+(m?`/${b.title}`:`${b.title}`),""),field:void 0,headerType:(o=(n=this.rowHeaderTitle)===null||n===void 0?void 0:n.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=nm(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=j9(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 n,o,r=this.rowTree,s=this.columnTree;for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(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((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(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((z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey)&&g.value===d.value){r=g.children,n=g;break}}}let l=0,a=0;if(n){a=this.columnHeaderLevelCount;const{startInTotal:h,level:d}=n;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 n;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)&&(((n=this==null?void 0:this.cornerSetting)===null||n===void 0?void 0:n.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 n;return(n=this.getBody(t,e))===null||n===void 0?void 0:n.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,n;if(this._rowHeaderCellIds.find((o,r)=>!!o.find((s,l)=>s===t&&(e=l,!0))&&(n=r,!0)),z(e)&&z(n))return{col:e,row:n+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 n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row))return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row);if(this.isRowHeader(t.col,t.row)){if(this.rowHierarchyType!=="tree")return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row);{const o=Le(this.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths),r=Le(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 n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=n.end.col-n.start.col+1;let r;const s=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?s.end.col-o+1:s.start.col,r===n.start.col)return null;for(let a=0;a<this._columnHeaderCellFullPathIds.length;a++){const h=this._columnHeaderCellFullPathIds[a].splice(n.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(n.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,n.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:n.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===n.start.row-this.columnHeaderLevelCount)return null;const d=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,h);d.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellIds,d);const u=this._rowHeaderCellFullPathIds.splice(n.start.row-this.columnHeaderLevelCount,h);u.unshift(o-this.currentPageStartIndex,0),Array.prototype.splice.apply(this._rowHeaderCellFullPathIds,u);const c=this._rowHeaderCellIds_FULL.splice(n.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(n.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,n.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:n.start.row,targetIndex:o+this.columnHeaderLevelCount,sourceSize:h,targetSize:a.size,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){var e,n,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(y=>this.colDimensionKeys.indexOf(y.dimensionKey)>=0||this.colDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.indicatorKey),h=t.filter(y=>this.rowDimensionKeys.indexOf(y.dimensionKey)>=0||this.rowDimensionKeys.indexOf(this.indicatorDimensionKey)>=0&&y.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,S)=>{var R,A;return this.colDimensionKeys.indexOf((R=y.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)-this.colDimensionKeys.indexOf((A=S.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)}),h==null||h.sort((y,S)=>{var R,A;return this.fullRowDimensionKeys.indexOf((R=y.dimensionKey)!==null&&R!==void 0?R:this.indicatorDimensionKey)-this.fullRowDimensionKeys.indexOf((A=S.dimensionKey)!==null&&A!==void 0?A:this.indicatorDimensionKey)}),a==null||a.forEach(y=>{y.isPivotCorner&&(d=!0)}),h==null||h.forEach(y=>{y.isPivotCorner&&(d=!0)}),d){if(this.cornerSetting.titleOnDimension==="all"&&this.indicatorsAsCol&&a.length===0){for(let y=0;y<this.rowDimensionKeys.length;y++)if(((e=h[0])===null||e===void 0?void 0:e.dimensionKey)===this.rowDimensionKeys[y])return{col:y+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 y=0;y<this.rowDimensionKeys.length;y++)if(((o=h[0])===null||o===void 0?void 0:o.dimensionKey)===this.rowDimensionKeys[y])return{col:y+this.leftRowSeriesNumberColumnCount,row:0}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((r=a[0])===null||r===void 0?void 0:r.dimensionKey)===this.colDimensionKeys[y])return{col:0,row:y}}else for(let y=0;y<this.colDimensionKeys.length;y++)if(((n=a[0])===null||n===void 0?void 0:n.dimensionKey)===this.colDimensionKeys[y])return{col:this.rowHeaderLevelCount-1,row:y}}let c,g,f,p,m=!1;(a==null?void 0:a.length)>=1&&(h==null?void 0:h.length)>=1&&(m=!0);let b,C,_=this.rowTree,w=this.columnTree;if(a)for(let y=0;y<a.length;y++){const S=a[y];for(let R=0;R<w.length;R++){const A=w[R];if(!z(S.indicatorKey)&&A.dimensionKey===S.dimensionKey&&A.value===S.value||z(S.indicatorKey)&&A.indicatorKey===S.indicatorKey){w=A.children,m&&!w?C=A:m||(C=A);break}}}if((h==null?void 0:h.length)>=1)if(this.rowHierarchyType==="tree"){const y=h[h.length-1],S=this.headerObjects.filter(A=>((A==null?void 0:A.field)===y.dimensionKey||(A==null?void 0:A.field)===y.indicatorKey)&&(A==null?void 0:A.title)===y.value).map(A=>A.id),R=this._rowHeaderCellIds.filter(A=>S.indexOf(A[A.length-1])>=0).find(A=>{const x=this.findFullCellIds(A);return x.length===h.length&&x.every(T=>{const M=this._headerObjectMap[T];return h.find(B=>B.dimensionKey===M.field&&B.value===M.title)})});g=this._rowHeaderCellIds.indexOf(R)+this.columnHeaderLevelCount}else for(let y=0;y<h.length;y++){const S=h[y];for(let R=0;R<_.length;R++){const A=_[R];if(!z(S.indicatorKey)&&A.dimensionKey===S.dimensionKey&&A.value===S.value||z(S.indicatorKey)&&A.indicatorKey===S.indicatorKey&&(!z(S.value)||A.value===S.value)){_=A.children,(!m||_&&!_.some(x=>x.dimensionKey==="axis"))&&m||(b=A);break}}}if(u||!m||(b||z(g))&&C){if(b||u){g=this.columnHeaderLevelCount;const{startInTotal:y,level:S}=(s=b)!==null&&s!==void 0?s:BT;g+=y??0,f=this.rowHierarchyType==="grid"?(this.rowHeaderTitle?S+1:S)+this.leftRowSeriesNumberColumnCount:0}if(C||u){c=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount;const{startInTotal:y,level:S}=(l=C)!==null&&l!==void 0?l:BT;c+=y??0,p=this.columnHeaderTitle?S+1:S}return z(c)||z(g)?{col:c??f,row:g??p}:void 0}}setChartInstance(t,e,n){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=n)}getChartInstance(t,e){var n,o,r,s;const l=this.getCellHeaderPaths(t,e);let a;if(this.indicatorsAsCol){const h=(n=l.colHeaderPaths.find(d=>d.indicatorKey))===null||n===void 0?void 0:n.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 pT(this)}getDimension(t,e){var n,o;return e==="column"?(n=this.columnsDefine)===null||n===void 0?void 0:n.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))&&El(t,e,"row",this)||(this.isFrozenRow(t,e)||this.isBottomFrozenRow(t,e))&&El(t,e,"col",this))return Et.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&&Fh(this.indicatorsDefine)&&(this.isBottomFrozenRow(t,e)&&El(t,e,"col",this)||this.isRightFrozenColumn(t,e)&&El(t,e,"row",this)||this.isRowHeader(t,e)&&t===this.rowHeaderLevelCount-1&&El(t,e,"row",this)||this.hasTwoIndicatorAxes&&this.indicatorsAsCol&&e===this.columnHeaderLevelCount-1&&El(t,e,"col",this))):!1}getChartAxes(t,e){if(_V(t,e,this)||this.isAxisCell(t,e))return SV(t,e,this)}getRawChartSpec(t,e){return bV(t,e,this)}getChartSpec(t,e){return wV(t,e,this)}isShareChartSpec(t,e){return CV(t,e,this)}getChartDataId(t,e){return fT(t,e,this)}isNoChartDataRenderNothing(t,e){return yV(t,e,this)}setPagination(t){var e,n,o,r,s,l,a;if(this.clearCellRangeMap(),this._table.internalProps.useOneRowHeightFillAll=!1,this.pagination=t,this.rowHierarchyType==="grid"&&z((e=this.pagination)===null||e===void 0?void 0:e.perPageCount)&&z((n=this.pagination)===null||n===void 0?void 0:n.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(n=>{var o;(o=n.chartInstance)===null||o===void 0||o.release()})}getHeadNode(t,e){var n,o,r;let s;const l=this.getCellHeaderPaths(t,e);return l.rowHeaderPaths&&((o=(n=l.rowHeaderPaths)===null||n===void 0?void 0:n.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,n){var o;if(!Array.isArray(t))return;let r,s,l=this.rowTree,a=this.columnTree;if(z(n)&&z(e)&&this.rowHierarchyType==="tree"&&this.extensionRows&&e>=1+this.leftRowSeriesNumberColumnCount){const h=this.getCellId(e-1,n);l=this._rowHeaderExtensionTree[h].tree.children}for(let h=0;h<t.length;h++){const d=t[h];if((d.isPivotCorner||!z(d.value))&&h===t.length-1)return;let u=!1;for(let c=0;c<a.length;c++){const g=a[c];if(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(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(z(d.dimensionKey)&&g.dimensionKey===d.dimensionKey&&g.value===d.value||z(d.indicatorKey)&&g.indicatorKey===d.indicatorKey&&(g.value===d.value||!z(d.value)||!z(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 n,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=(n=u.xField)!==null&&n!==void 0?n:(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(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.value):!1}},vtable_selected_reverse:{filter:t=>{var e;return this._table._selectedDataItemsInChart.length>=1?!this._table._selectedDataItemsInChart.find(n=>{for(const o in n)if(typeof n[o]!="object"&&n[o]!==t[o])return!1;return!0}):!((e=this._table._selectedDimensionInChart)===null||e===void 0)&&e.length?!this._table._selectedDimensionInChart.every(n=>typeof n.value=="object"||t[n.key]===n.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 n=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(n)}),t==null||t.updateState(n)}}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 n=this._generateChartState();t==null||t.updateState(n)}}getIndicatorKeyInChartSpec(t,e){const n=this.getRawChartSpec(t,e),o=[];if(n){if(n.series||n.xField||n.yField)return this.indicatorsAsCol===!1?n.series?n.series.forEach(r=>{const s=r.yField;o.push(s)}):o.push(n.yField):n.series?n.series.forEach(r=>{const s=r.xField;o.push(s)}):o.push(n.xField),o;if(n.valueField&&o.push(n.valueField),o.length>=1)return o}return null}getOptimunHeightForChart(t){var e,n,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=PT((n=a==null?void 0:a.length)!==null&&n!==void 0?n: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=ee((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,n,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=PT((n=a==null?void 0:a.length)!==null&&n!==void 0?n: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=ee((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 n=this.getCellHeaderPaths(t,e),o=[];return n.colHeaderPaths.length&&n.colHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getRowKeysPath(t,e){const n=this.getCellHeaderPaths(t,e),o=[];return n.rowHeaderPaths.length&&n.rowHeaderPaths.forEach(r=>{r.dimensionKey&&o.push(r.value)}),o==null?void 0:o.join(this.dataset.stringJoinChar)}getIndicatorInfo(t,e=""){var n;return(n=this.indicatorsDefine)===null||n===void 0?void 0:n.find(o=>typeof o!="string"&&(t?o.indicatorKey===t:!!e&&o.title===e))}getLayoutColumnTree(){const t=[],e=this.columnDimensionTree.tree.children;return rv(t,e),t}getLayoutRowTree(){const t=[],e=this.rowDimensionTree.tree.children;return rv(t,e),t}getLayoutColumnTreeCount(){const t=this.columnDimensionTree.tree.children;return yg(t,this.rowHierarchyType==="tree")}getLayoutRowTreeCount(){var t;const e=this.rowDimensionTree.tree.children;let n=yg(e,this.rowHierarchyType==="tree");return(t=this.extensionRows)===null||t===void 0||t.forEach(o=>{if(typeof o.rowTree!="function"){const r=yg(o.rowTree,!0);n*=r}}),n}resetHeaderTree(){var t,e,n;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 He((e=this.columnTree)!==null&&e!==void 0?e:[],this.sharedVar),this.rowDimensionTree=new He((n=this.rowTree)!==null&&n!==void 0?n:[],this.sharedVar,this.rowHierarchyType,this.rowHierarchyType==="tree"?this.rowExpandLevel:void 0),this.resetColumnHeaderLevelCount(),this._generateColHeaderIds(),this.colIndex=0,this._generateRowHeaderIds(),this._rowHeaderCellFullPathIds_FULL=nm(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!!(z(t)&&z(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,n){this.getHeadNode(t,e).value=n;const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}changeCornerTitle(t,e,n){if(this.isCornerHeader(t,e)){const o=this.getCellId(t,e);this._headerObjectMap[o].title=n}}generateCellIdsConsiderHideHeader(){if(this._columnHeaderCellIds=this._columnHeaderCellFullPathIds.slice(),!this.showColumnHeader)if(this.indicatorsAsCol&&!this.hideIndicatorName){const t=this.colDimensionKeys.indexOf(Zi),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 n=t.slice();n.splice(0,n.length),this._rowHeaderCellIds_FULL[e]=n});else{const t=this.rowDimensionKeys.indexOf(Zi);this._rowHeaderCellIds_FULL.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._rowHeaderCellIds_FULL[n]=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(Zi),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 n=t.slice();n.splice(0,n.length),this._cornerHeaderCellIds[e]=n});else{const t=this.rowDimensionKeys.indexOf(Zi);this._cornerHeaderCellIds.forEach((e,n)=>{const o=e.slice(),r=o.splice(t,1);o.splice(0,o.length),o.push(r[0]),this._cornerHeaderCellIds[n]=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,n){!this._useGetBodyCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||(this.indicatorsAsCol?this._getBodyCache.set(t,n):this._getBodyCache.set(e,n))}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,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._colHeaderPathCache.set(t,n)}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,n){!this._useHeaderPathCache||this.isHeader(t,e)||this.isSeriesNumber(t,e)||this._rowHeaderPathCache.set(e,n)}}function PT(i,t,e,n){e===1&&(e=0);const o=$9(i,e,n),r=t/(1-e);return Math.ceil(o*r)}function $9(i,t,e){let n;return n=i===1?i+2*e:i-t+2*e,i?n>0?n:1:0}class mv{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 n=this.records[t];this.processRecord(n)}}processRecord(t){var e;const n=[],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&&n.push(t[l])}(e=this.dataConfig.indicators)===null||e===void 0||e.forEach(r=>{const s=t[r];s!==void 0&&(this.dataConfig.indicatorsAsCol?n.push(r):o.push(r));const l=o.join(this.stringJoinChar),a=n.join(this.stringJoinChar);o.length!==0&&(this.rowFlatKeys[l]||(this.rowFlatKeys[l]=1)),n.length!==0&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),n.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?n.pop():o.pop()))})}getTreeNode(t=[],e=[],n,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===n&&(t.splice(g,1),u=!0)}),u&&t.push(n),h=t.join(this.stringJoinChar)}if(typeof e=="string")d=e;else{let u=!1;e.map((c,g)=>{c===n&&(e.splice(g,1),u=!0)}),u&&e.push(n),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:z((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=[],n,o){var r,s,l,a,h,d,u;let c,g;if(typeof t=="string")c=t;else{let m=!1;t.map((b,C)=>{b===n&&(t.splice(C,1),m=!0)}),m&&t.push(n),c=t.join(this.stringJoinChar)}if(typeof e=="string")g=e;else{let m=!1;e.map((b,C)=>{b===n&&(e.splice(C,1),m=!0)}),m&&e.push(n),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[n]=o,this.tree[c][g].value=o):(this.tree[c]||(this.tree[c]={}),this.tree[c][g]={record:this._buildRecord(t,e,n,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=[],n,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[n]=o,this.records.push(r),r}addRecords(t){for(let e=0,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}this.records.push(t)}changeRecordFieldValue(t,e,n){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]=n)}this.rowFlatKeys={},this.colFlatKeys={},this.tree={},this.processRecords()}}}function HT(i,t){let e="";for(let n=0;n<i.length;n++)e+=i[n],n!==i.length-1&&(e+=t);return e}class Oh{constructor(t,e,n,o,r,s,l,a,h,d,u,c,g){var f,p,m,b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt,bt;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=(m=this.dataConfig)===null||m===void 0?void 0:m.aggregationRules,this.derivedFieldRules=(b=this.dataConfig)===null||b===void 0?void 0:b.derivedFieldRules,this.mappingRules=(C=this.dataConfig)===null||C===void 0?void 0:C.mappingRules,this.calculatedFieldRules=(_=this.dataConfig)===null||_===void 0?void 0:_.calculatedFieldRules,this.calculatedFiledKeys=(y=(w=this.calculatedFieldRules)===null||w===void 0?void 0:w.map(Ct=>Ct.key))!==null&&y!==void 0?y:[],this.calculatedFieldDependIndicatorKeys=(R=(S=this.calculatedFieldRules)===null||S===void 0?void 0:S.reduce((Ct,at)=>{for(let rt=0;rt<at.dependIndicatorKeys.length;rt++)Ct.indexOf(at.dependIndicatorKeys[rt])===-1&&Ct.push(at.dependIndicatorKeys[rt]);return Ct},[]))!==null&&R!==void 0?R:[],this.totals=(A=this.dataConfig)===null||A===void 0?void 0:A.totals,this.rows=e,this.columns=n,this.indicatorKeys=o,this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys=[...o];for(let Ct=0;Ct<this.calculatedFieldDependIndicatorKeys.length;Ct++)this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.indexOf(this.calculatedFieldDependIndicatorKeys[Ct])===-1&&this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys.push(this.calculatedFieldDependIndicatorKeys[Ct]);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=(M=(T=(x=this.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.grandTotalLabel)!==null&&M!==void 0?M:"总计",this.colSubTotalLabel=(F=(P=(B=this.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalLabel)!==null&&F!==void 0?F:"小计",this.rowGrandTotalLabel=(k=(E=(H=this.totals)===null||H===void 0?void 0:H.row)===null||E===void 0?void 0:E.grandTotalLabel)!==null&&k!==void 0?k:"总计",this.rowSubTotalLabel=(D=(L=(I=this.totals)===null||I===void 0?void 0:I.row)===null||L===void 0?void 0:L.subTotalLabel)!==null&&D!==void 0?D:"小计",this.collectValuesBy=(O=this.dataConfig)===null||O===void 0?void 0:O.collectValuesBy,this.needSplitPositiveAndNegative=u!=null&&u,this.rowsIsTotal=new Array((N=(W=this.rows)===null||W===void 0?void 0:W.length)!==null&&N!==void 0?N:0).fill(!1),this.colsIsTotal=new Array((U=($=this.columns)===null||$===void 0?void 0:$.length)!==null&&U!==void 0?U:0).fill(!1),((Y=this.totals)===null||Y===void 0?void 0:Y.row)&&this.totals.row.showSubTotals!==!1&&this.totals.row.subTotalsDimensions)for(let Ct=0,at=(et=(Z=(G=(j=this.totals)===null||j===void 0?void 0:j.row)===null||G===void 0?void 0:G.subTotalsDimensions)===null||Z===void 0?void 0:Z.length)!==null&&et!==void 0?et:0;Ct<at;Ct++){const rt=this.totals.row.subTotalsDimensions[Ct],ct=this.rows.indexOf(rt);this.rowsIsTotal[ct]=!0}if(!((gt=this.totals)===null||gt===void 0)&&gt.column&&this.totals.column.showSubTotals!==!1&&this.totals.column.subTotalsDimensions)for(let Ct=0,at=(bt=(nt=(it=(vt=this.totals)===null||vt===void 0?void 0:vt.column)===null||it===void 0?void 0:it.subTotalsDimensions)===null||nt===void 0?void 0:nt.length)!==null&&bt!==void 0?bt:0;Ct<at;Ct++){const rt=this.totals.column.subTotalsDimensions[Ct],ct=this.columns.indexOf(rt);this.colsIsTotal[ct]=!0}this.setRecords(l)}setRecords(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;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,S)=>this.rowsHasValue[S]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.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,S)=>this.rowsHasValue[S]),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,S)=>this.columnsHasValue[S]),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,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_),typeof window<"u"&&window.performance.now(),!((w=this.dataConfig)===null||w===void 0)&&w.isPivotChart&&this.cacheDeminsionCollectedValues())}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(zt.RECORD,kx),this.registerAggregator(zt.SUM,Ix),this.registerAggregator(zt.COUNT,Dx),this.registerAggregator(zt.MAX,zx),this.registerAggregator(zt.MIN,Nx),this.registerAggregator(zt.AVG,Ox),this.registerAggregator(zt.NONE,Fx),this.registerAggregator(zt.RECALCULATE,Q4)}processCollectedValuesWithSumBy(){var t,e,n,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;((n=this.collectValuesBy[l])===null||n===void 0?void 0:n.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 n=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=n.collectValuesBy[o].sortBy)===null||a===void 0?void 0:a.indexOf(s))!==null&&h!==void 0?h:-1)-((u=(d=n.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 n in this.collectedValues[t])Array.isArray(this.collectedValues[t][n])&&(e.push(...this.collectedValues[t][n]),e=Array.from(new Set(e)));e.length>0&&(this.collectValuesBy[t].sortBy=e)}}processRecords(){var t,e;let n=!1;if(((e=(t=this.filterRules)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>=1&&(n=!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];n&&!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];n&&!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,n;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(!(!((n=s.filterFunc)===null||n===void 0)&&n.call(s,t))){o=!1;break}}return o}processRecord(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt,bt,Ct,at,rt,ct,ht,_t,ut,It,Ut,yt,Tt,kt,oe,re,ye,Oe;(n=this.derivedFieldRules)===null||n===void 0||n.forEach((mt,Bt)=>{mt.fieldName&&mt.derivedFunc&&(t[mt.fieldName]=mt.derivedFunc(t))});for(const mt in this.collectValuesBy)if(z(t[mt])){this.collectedValues[mt]||(this.collectedValues[mt]={});const Bt=this.collectValuesBy[mt].by.map(Kt=>t[Kt]).join(this.stringJoinChar);if(this.collectedValues[mt][Bt]||(this.collectValuesBy[mt].sumBy?this.collectedValues[mt][Bt]={}:this.collectValuesBy[mt].range?this.collectedValues[mt][Bt]={min:Number.MAX_SAFE_INTEGER,max:Number.MIN_SAFE_INTEGER}:this.collectedValues[mt][Bt]=[]),this.collectValuesBy[mt].sumBy){const Kt=this.collectValuesBy[mt].sumBy.map(qt=>t[qt]).join(this.stringJoinChar);this.collectedValues[mt][Bt][Kt]||(this.collectedValues[mt][Bt][Kt]=new this.aggregators[zt.SUM]({key:mt,dimension:mt,isRecord:void 0,needSplitPositiveAndNegative:this.needSplitPositiveAndNegative})),this.collectedValues[mt][Bt][Kt].push(t)}else if(this.collectValuesBy[mt].range){const Kt=this.collectedValues[mt][Bt],qt=Math.max(t[mt],Kt.max),fe=Math.min(t[mt],Kt.min);isNaN(qt)||(Kt.max=qt,Kt.min=fe)}else{const Kt=this.collectedValues[mt][Bt];Kt.indexOf(t[mt])===-1&&Kt.push(t[mt])}}let Be=!1;const Ee=[],At=[];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 mt=[];At.push({rowKey:mt,indicatorKey:e});for(let Bt=0,Kt=this.rows.length;Bt<Kt;Bt++){const qt=this.rows[Bt];if(qt in t)this.rowsHasValue[Bt]=!0,mt.push(t[qt]);else if(qt!==Zi){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&&Bt===0&&!this.rows.find(fe=>fe in t)){mt.push(this.rowGrandTotalLabel),Be=!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[Bt-1]))>=0){this.rowHierarchyType==="grid"&&mt.push(this.rowSubTotalLabel),Be=!0;break}}}}else{const mt=this.getFieldMatchRowDimensionPaths(t);if(mt.length>0)for(let Bt=0,Kt=mt.length;Bt<Kt;Bt++){const qt=mt[Bt],fe=[];let Yt;for(let Nt=0,dt=qt.length;Nt<dt;Nt++)z(qt[Nt].indicatorKey)?Yt=qt[Nt].indicatorKey:fe.push(qt[Nt].value);At.push({rowKey:fe,indicatorKey:Yt})}}if(!this.parseCustomTreeToMatchRecords||!((p=this.dataConfig)===null||p===void 0)&&p.isPivotChart||!(!((m=this.customColTree)===null||m===void 0)&&m.length)||e||this.hasExtensionRowTree){const mt=[];Ee.push({colKey:mt,indicatorKey:e});for(let Bt=0,Kt=this.columns.length;Bt<Kt;Bt++){const qt=this.columns[Bt];if(qt in t)this.columnsHasValue[Bt]=!0,mt.push(t[qt]);else if(qt!==Zi){if(!((_=(C=(b=this.dataConfig)===null||b===void 0?void 0:b.totals)===null||C===void 0?void 0:C.column)===null||_===void 0)&&_.showGrandTotals&&Bt===0&&!this.columns.find(fe=>fe in t)){mt.push(this.colGrandTotalLabel),Be=!0;break}if(!((S=(y=(w=this.dataConfig)===null||w===void 0?void 0:w.totals)===null||y===void 0?void 0:y.column)===null||S===void 0)&&S.subTotalsDimensions&&((x=(A=(R=this.dataConfig)===null||R===void 0?void 0:R.totals)===null||A===void 0?void 0:A.column)===null||x===void 0?void 0:x.subTotalsDimensions.indexOf(this.columns[Bt-1]))>=0){mt.push(this.colSubTotalLabel),Be=!0;break}}}}else{const mt=this.getFieldMatchColDimensionPaths(t);if(mt.length>0)for(let Bt=0,Kt=mt.length;Bt<Kt;Bt++){const qt=mt[Bt],fe=[];let Yt;for(let Nt=0,dt=qt.length;Nt<dt;Nt++)z(qt[Nt].indicatorKey)?Yt=qt[Nt].indicatorKey:fe.push(qt[Nt].value);Ee.push({colKey:fe,indicatorKey:Yt})}}for(let mt=0;mt<At.length;mt++){const Bt=At[mt].rowKey;let Kt;this.indicatorsAsCol||(Kt=At[mt].indicatorKey);for(let qt=0;qt<Ee.length;qt++){const fe=Ee[qt].colKey;this.indicatorsAsCol&&(Kt=Ee[qt].indicatorKey);const Yt=Bt.join(this.stringJoinChar),Nt=fe.join(this.stringJoinChar);if(Be){this.totalRecordsTree[Yt]||(this.totalRecordsTree[Yt]={}),this.totalRecordsTree[Yt][Nt]||(this.totalRecordsTree[Yt][Nt]=[]);const Ft=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let $t=0;$t<Ft.length;$t++)if(this.calculatedFiledKeys.indexOf(Ft[$t])>=0){const ae=(T=this.calculatedFieldRules)===null||T===void 0?void 0:T.find(Ti=>Ti.key===Ft[$t]);!((B=(M=this.totalRecordsTree[Yt])===null||M===void 0?void 0:M[Nt])===null||B===void 0)&&B[$t]||(this.totalRecordsTree[Yt][Nt][$t]=new this.aggregators[zt.RECALCULATE]({key:Ft[$t],dimension:Ft[$t],isRecord:!0,formatFun:(F=(P=this.indicators)===null||P===void 0?void 0:P.find(Ti=>typeof Ti!="string"&&Ti.indicatorKey===Ft[$t]))===null||F===void 0?void 0:F.format,calculateFun:ae==null?void 0:ae.calculateFun,dependAggregators:this.totalRecordsTree[Yt][Nt],dependIndicatorKeys:ae==null?void 0:ae.dependIndicatorKeys})),Ft[$t]in t&&((E=(H=this.totalRecordsTree[Yt])===null||H===void 0?void 0:H[Nt])===null||E===void 0||E[$t].push(t))}else{const ae=this.getAggregatorRule(Ft[$t]);!((I=(k=this.totalRecordsTree[Yt])===null||k===void 0?void 0:k[Nt])===null||I===void 0)&&I[$t]||(this.totalRecordsTree[Yt][Nt][$t]=new this.aggregators[(L=ae==null?void 0:ae.aggregationType)!==null&&L!==void 0?L:zt.SUM]({key:Ft[$t],dimension:(D=ae==null?void 0:ae.field)!==null&&D!==void 0?D:Ft[$t],formatFun:(O=ae==null?void 0:ae.formatFun)!==null&&O!==void 0?O:(N=(W=this.indicators)===null||W===void 0?void 0:W.find(Ti=>typeof Ti!="string"&&Ti.indicatorKey===Ft[$t]))===null||N===void 0?void 0:N.format})),Ft[$t]in t&&((U=($=this.totalRecordsTree[Yt])===null||$===void 0?void 0:$[Nt])===null||U===void 0||U[$t].push(t))}return}Bt.length!==0&&(this.rowFlatKeys[Yt]||(this.rowKeys.push(Bt),this.rowFlatKeys[Yt]=1)),fe.length!==0&&(this.colFlatKeys[Nt]||(this.colKeys.push(fe),this.colFlatKeys[Nt]=1)),this.tree[Yt]||(this.tree[Yt]={}),!((Y=this.tree[Yt])===null||Y===void 0)&&Y[Nt]||(this.tree[Yt][Nt]=[]);const dt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Ft=0;Ft<dt.length;Ft++)if(this.calculatedFiledKeys.indexOf(dt[Ft])>=0){const $t=(j=this.calculatedFieldRules)===null||j===void 0?void 0:j.find(ae=>ae.key===dt[Ft]);!((Z=(G=this.tree[Yt])===null||G===void 0?void 0:G[Nt])===null||Z===void 0)&&Z[Ft]||(this.tree[Yt][Nt][Ft]=new this.aggregators[zt.RECALCULATE]({key:dt[Ft],dimension:dt[Ft],isRecord:!0,formatFun:(gt=(et=this.indicators)===null||et===void 0?void 0:et.find(ae=>typeof ae!="string"&&ae.indicatorKey===dt[Ft]))===null||gt===void 0?void 0:gt.format,calculateFun:$t==null?void 0:$t.calculateFun,dependAggregators:this.tree[Yt][Nt],dependIndicatorKeys:$t==null?void 0:$t.dependIndicatorKeys})),(it=(vt=this.tree[Yt])===null||vt===void 0?void 0:vt[Nt])===null||it===void 0||it[Ft].push(t)}else{const $t=this.getAggregatorRule(dt[Ft]);let ae=!1;Kt?e===Kt?dt[Ft]===Kt&&(ae=!0):dt[Ft]===Kt&&dt[Ft]in t&&(ae=!0):$t!=null&&$t.field?typeof($t==null?void 0:$t.field)=="string"?($t==null?void 0:$t.field)in t&&(ae=!0):$t!=null&&$t.field.find(Ti=>Ti in t)&&(ae=!0):dt[Ft]in t&&(ae=!0),!(!((bt=(nt=this.tree[Yt])===null||nt===void 0?void 0:nt[Nt])===null||bt===void 0)&&bt[Ft])&&ae&&(this.tree[Yt][Nt][Ft]=new this.aggregators[(Ct=$t==null?void 0:$t.aggregationType)!==null&&Ct!==void 0?Ct:zt.SUM]({key:dt[Ft],dimension:(at=$t==null?void 0:$t.field)!==null&&at!==void 0?at:dt[Ft],formatFun:(rt=$t==null?void 0:$t.formatFun)!==null&&rt!==void 0?rt:(ht=(ct=this.indicators)===null||ct===void 0?void 0:ct.find(Ti=>typeof Ti!="string"&&Ti.indicatorKey===dt[Ft]))===null||ht===void 0?void 0:ht.format})),ae&&((ut=(_t=this.tree[Yt])===null||_t===void 0?void 0:_t[Nt])===null||ut===void 0||ut[Ft].push(t))}if(this.mappingRules)for(let Ft=0;Ft<this.indicatorKeys.length;Ft++){if(!this.indicatorStatistics[Ft]){const $t=this.getAggregatorRule(this.indicatorKeys[Ft]);this.indicatorStatistics[Ft]={max:new this.aggregators[zt.MAX]({key:this.indicatorKeys[Ft],dimension:this.indicatorKeys[Ft]}),min:new this.aggregators[zt.MIN]({key:this.indicatorKeys[Ft],dimension:this.indicatorKeys[Ft]}),total:new this.aggregators[(It=$t==null?void 0:$t.aggregationType)!==null&&It!==void 0?It:zt.SUM]({key:this.indicatorKeys[Ft],dimension:(Ut=$t==null?void 0:$t.field)!==null&&Ut!==void 0?Ut:this.indicatorKeys[Ft],formatFun:(yt=$t==null?void 0:$t.formatFun)!==null&&yt!==void 0?yt:(kt=(Tt=this.indicators)===null||Tt===void 0?void 0:Tt.find(ae=>typeof ae!="string"&&ae.indicatorKey===this.indicatorKeys[Ft]))===null||kt===void 0?void 0:kt.format})}}this.indicatorStatistics[Ft].max.push((re=(oe=this.tree[Yt])===null||oe===void 0?void 0:oe[Nt])===null||re===void 0?void 0:re[Ft].value()),this.indicatorStatistics[Ft].min.push((Oe=(ye=this.tree[Yt])===null||ye===void 0?void 0:ye[Nt])===null||Oe===void 0?void 0:Oe[Ft].value()),this.indicatorStatistics[Ft].total.push(t)}}}}updateSortRules(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;this.sorted=!1,this.sortRules=t,this.sortKeys(),this.customRowTree||(this.rowHierarchyType==="tree"?this.rowHeaderTree=this.ArrToTree1(this.rowKeys,this.rows.filter((w,y)=>this.rowsHasValue[y]),this.indicatorsAsCol?void 0:this.indicators,((n=(e=this.totals)===null||e===void 0?void 0:e.row)===null||n===void 0?void 0:n.showGrandTotals)||!this.indicatorsAsCol&&this.columns.length===0||this.indicatorsAsCol&&this.rows.length===0,this.rowGrandTotalLabel):this.rowHeaderTree=this.ArrToTree(this.rowKeys,this.rows.filter((w,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.ArrToTree(this.colKeys,this.columns.filter((w,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,(m=(p=(f=this.totals)===null||f===void 0?void 0:f.column)===null||p===void 0?void 0:p.showGrandTotalsOnLeft)!==null&&m!==void 0&&m,(_=(C=(b=this.totals)===null||b===void 0?void 0:b.column)===null||C===void 0?void 0:C.showSubTotalsOnLeft)!==null&&_!==void 0&&_))}updateFilterRules(t,e=!1){var n,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++)(n=this.tree[r][s][l])===null||n===void 0||n.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((n,o)=>t===n.indicatorKey)}getAggregator(t=[],e=[],n,o=!0,r){var s,l,a,h;const d=this.indicatorKeys.indexOf(n);let u,c;typeof t=="string"?u=t:(r&&r.position!=="row"||t.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||t.splice(p,1)}),u=HT(t,this.stringJoinChar)),typeof e=="string"?c=e:(r&&r.position!=="col"||e.map((f,p)=>{f!==n||z(r==null?void 0:r.index)&&p!==r.index||e.splice(p,1)}),c=HT(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&&z((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 n;const o=this,r=function(s){const l=[];for(let a=0,h=t.length;a<h;a++)if(n=t[a],o.sortRules)for(let d=0,u=o.sortRules.length;d<u;d++)o.sortRules[d].sortField===n&&l.push({field:n,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,m=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),m=l.slice(0,g.fieldIndex+1),o.rowHierarchyType==="grid"&&e?m.push(o.rowSubTotalLabel):e||m.push(o.colSubTotalLabel)),c=g.func(p,m,(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 n=this;return t.sortByIndicator?(o,r,s)=>{const l=function(a,h){return n.rowHierarchyType==="grid"&&a.length<n.rows.length&&a[a.length-1]!==n.rowSubTotalLabel&&a[a.length-1]!==n.rowGrandTotalLabel&&a.push(n.rowSubTotalLabel),h.length<n.columns.length&&h[h.length-1]!==n.colSubTotalLabel&&h[h.length-1]!==n.colGrandTotalLabel&&h.push(n.colSubTotalLabel),n.getAggregator(a,h,t.sortByIndicator).value()};return e?yc(l(o,t.query),l(r,t.query),s):yc(l(t.query,o),l(t.query,r),s)}:t.sortBy?e6(t.sortBy):t.sortFunc?t.sortFunc:t.sortType?t6:yc}totalStatistics(){var t,e,n,o,r,s,l,a,h,d,u,c,g,f;const p=this,m=(b,C)=>{var _,w,y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt,bt,Ct,at,rt,ct,ht,_t,ut,It,Ut,yt,Tt,kt,oe,re,ye,Oe,Be;if(!((w=(_=this.totalRecordsTree)===null||_===void 0?void 0:_[b])===null||w===void 0)&&w[C])return this.tree[b]||(this.tree[b]={}),void(this.tree[b][C]=(S=(y=this.totalRecordsTree)===null||y===void 0?void 0:y[b])===null||S===void 0?void 0:S[C]);const Ee=C.split(this.stringJoinChar);if(!((A=(R=p.totals)===null||R===void 0?void 0:R.column)===null||A===void 0)&&A.subTotalsDimensions&&((M=(T=(x=p.totals)===null||x===void 0?void 0:x.column)===null||T===void 0?void 0:T.subTotalsDimensions)===null||M===void 0?void 0:M.length)>0&&p.totals.column.showSubTotals!==!1)for(let At=0,mt=(F=(P=(B=p.totals)===null||B===void 0?void 0:B.column)===null||P===void 0?void 0:P.subTotalsDimensions)===null||F===void 0?void 0:F.length;At<mt;At++){const Bt=p.totals.column.subTotalsDimensions[At],Kt=p.columns.indexOf(Bt);if(Kt>=0){const qt=Ee.slice(0,Kt+1);qt.push(p.colSubTotalLabel);const fe=qt.join(this.stringJoinChar);if(!((E=(H=this.totalRecordsTree)===null||H===void 0?void 0:H[b])===null||E===void 0)&&E[fe])return void(this.tree[b][fe]=(I=(k=this.totalRecordsTree)===null||k===void 0?void 0:k[b])===null||I===void 0?void 0:I[fe]);this.tree[b][fe]||(this.tree[b][fe]=[]);const Yt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Nt=0;Nt<Yt.length;Nt++)if(this.calculatedFiledKeys.indexOf(Yt[Nt])>=0){const dt=(L=this.calculatedFieldRules)===null||L===void 0?void 0:L.find(Ft=>Ft.key===Yt[Nt]);!((O=(D=this.tree[b])===null||D===void 0?void 0:D[fe])===null||O===void 0)&&O[Nt]||(this.tree[b][fe][Nt]=new this.aggregators[zt.RECALCULATE]({key:Yt[Nt],dimension:Yt[Nt],isRecord:!0,formatFun:(N=(W=this.indicators)===null||W===void 0?void 0:W.find(Ft=>typeof Ft!="string"&&Ft.indicatorKey===Yt[Nt]))===null||N===void 0?void 0:N.format,calculateFun:dt==null?void 0:dt.calculateFun,dependAggregators:this.tree[b][fe],dependIndicatorKeys:dt==null?void 0:dt.dependIndicatorKeys})),fe!==C&&this.tree[b][fe][Nt].push((U=($=p.tree[b])===null||$===void 0?void 0:$[C])===null||U===void 0?void 0:U[Nt])}else{if(!this.tree[b][fe][Nt]){const dt=this.getAggregatorRule(Yt[Nt]);this.tree[b][fe][Nt]=new this.aggregators[(Y=dt==null?void 0:dt.aggregationType)!==null&&Y!==void 0?Y:zt.SUM]({key:Yt[Nt],dimension:(j=dt==null?void 0:dt.field)!==null&&j!==void 0?j:Yt[Nt],formatFun:(G=dt==null?void 0:dt.formatFun)!==null&&G!==void 0?G:(et=(Z=this.indicators)===null||Z===void 0?void 0:Z.find(Ft=>typeof Ft!="string"&&Ft.indicatorKey===Yt[Nt]))===null||et===void 0?void 0:et.format})}fe!==C&&this.tree[b][fe][Nt].push((vt=(gt=p.tree[b])===null||gt===void 0?void 0:gt[C])===null||vt===void 0?void 0:vt[Nt])}}}if(!((nt=(it=p.totals)===null||it===void 0?void 0:it.column)===null||nt===void 0)&&nt.showGrandTotals||this.rows.length===0){const At=p.colGrandTotalLabel;if(!((Ct=(bt=this.totalRecordsTree)===null||bt===void 0?void 0:bt[b])===null||Ct===void 0)&&Ct[At])return void(this.tree[b][At]=(rt=(at=this.totalRecordsTree)===null||at===void 0?void 0:at[b])===null||rt===void 0?void 0:rt[At]);this.tree[b][At]||(this.tree[b][At]=[]);const mt=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let Bt=0;Bt<mt.length;Bt++)if(this.calculatedFiledKeys.indexOf(mt[Bt])>=0){const Kt=(ct=this.calculatedFieldRules)===null||ct===void 0?void 0:ct.find(qt=>qt.key===mt[Bt]);!((_t=(ht=this.tree[b])===null||ht===void 0?void 0:ht[At])===null||_t===void 0)&&_t[Bt]||(this.tree[b][At][Bt]=new this.aggregators[zt.RECALCULATE]({key:mt[Bt],dimension:mt[Bt],isRecord:!0,formatFun:(It=(ut=this.indicators)===null||ut===void 0?void 0:ut.find(qt=>typeof qt!="string"&&qt.indicatorKey===mt[Bt]))===null||It===void 0?void 0:It.format,calculateFun:Kt==null?void 0:Kt.calculateFun,dependAggregators:this.tree[b][At],dependIndicatorKeys:Kt==null?void 0:Kt.dependIndicatorKeys})),At!==C&&this.tree[b][At][Bt].push((yt=(Ut=p.tree[b])===null||Ut===void 0?void 0:Ut[C])===null||yt===void 0?void 0:yt[Bt])}else{if(!this.tree[b][At][Bt]){const Kt=this.getAggregatorRule(mt[Bt]);this.tree[b][At][Bt]=new this.aggregators[(Tt=Kt==null?void 0:Kt.aggregationType)!==null&&Tt!==void 0?Tt:zt.SUM]({key:mt[Bt],dimension:(kt=Kt==null?void 0:Kt.field)!==null&&kt!==void 0?kt:mt[Bt],formatFun:(oe=Kt==null?void 0:Kt.formatFun)!==null&&oe!==void 0?oe:(ye=(re=this.indicators)===null||re===void 0?void 0:re.find(qt=>typeof qt!="string"&&qt.indicatorKey===mt[Bt]))===null||ye===void 0?void 0:ye.format})}At!==C&&this.tree[b][At][Bt].push((Be=(Oe=p.tree[b])===null||Oe===void 0?void 0:Oe[C])===null||Be===void 0?void 0:Be[Bt])}}};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=(n=p==null?void 0:p.totals)===null||n===void 0?void 0:n.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 b=[];Object.keys(p.tree).forEach(C=>{const _=C.split(this.stringJoinChar);Object.keys(p.tree[C]).forEach(w=>{var y,S,R,A,x,T,M,B,P,F,H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et,gt,vt,it,nt;if(!((S=(y=p.totals)===null||y===void 0?void 0:y.row)===null||S===void 0)&&S.subTotalsDimensions&&((x=(A=(R=p.totals)===null||R===void 0?void 0:R.row)===null||A===void 0?void 0:A.subTotalsDimensions)===null||x===void 0?void 0:x.length)>0&&p.totals.row.showSubTotals!==!1)for(let bt=0,Ct=(B=(M=(T=p.totals)===null||T===void 0?void 0:T.row)===null||M===void 0?void 0:M.subTotalsDimensions)===null||B===void 0?void 0:B.length;bt<Ct;bt++){const at=p.totals.row.subTotalsDimensions[bt],rt=p.rows.indexOf(at);if(rt>=0&&rt<p.rows.length-1){const ct=_.slice(0,rt+1);this.rowHierarchyType==="grid"&&ct.push(p.rowSubTotalLabel);const ht=ct.join(this.stringJoinChar);this.tree[ht]||(this.tree[ht]={},b.push(ht)),this.tree[ht][w]||(this.tree[ht][w]=[]);const _t=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let ut=0;ut<_t.length;ut++){if(!this.tree[ht][w][ut])if(this.calculatedFiledKeys.indexOf(_t[ut])>=0){const It=(P=this.calculatedFieldRules)===null||P===void 0?void 0:P.find(Ut=>Ut.key===_t[ut]);this.tree[ht][w][ut]=new this.aggregators[zt.RECALCULATE]({key:_t[ut],dimension:_t[ut],isRecord:!0,formatFun:(H=(F=this.indicators)===null||F===void 0?void 0:F.find(Ut=>typeof Ut!="string"&&Ut.indicatorKey===_t[ut]))===null||H===void 0?void 0:H.format,calculateFun:It==null?void 0:It.calculateFun,dependAggregators:this.tree[ht][w],dependIndicatorKeys:It==null?void 0:It.dependIndicatorKeys})}else{const It=this.getAggregatorRule(_t[ut]);this.tree[ht][w][ut]=new this.aggregators[(E=It==null?void 0:It.aggregationType)!==null&&E!==void 0?E:zt.SUM]({key:_t[ut],dimension:(k=It==null?void 0:It.field)!==null&&k!==void 0?k:_t[ut],formatFun:(I=It==null?void 0:It.formatFun)!==null&&I!==void 0?I:(D=(L=this.indicators)===null||L===void 0?void 0:L.find(Ut=>typeof Ut!="string"&&Ut.indicatorKey===_t[ut]))===null||D===void 0?void 0:D.format})}ht!==C&&this.tree[ht][w][ut].push((W=(O=p.tree[C])===null||O===void 0?void 0:O[w])===null||W===void 0?void 0:W[ut])}}}if(!(($=(N=p.totals)===null||N===void 0?void 0:N.row)===null||$===void 0)&&$.showGrandTotals||this.columns.length===0){const bt=p.rowGrandTotalLabel;this.tree[bt]||(this.tree[bt]={},b.push(bt)),this.tree[bt][w]||(this.tree[bt][w]=[]);const Ct=this.indicatorKeysIncludeCalculatedFieldDependIndicatorKeys;for(let at=0;at<Ct.length;at++){if(!this.tree[bt][w][at])if(this.calculatedFiledKeys.indexOf(Ct[at])>=0){const rt=(U=this.calculatedFieldRules)===null||U===void 0?void 0:U.find(ct=>ct.key===Ct[at]);this.tree[bt][w][at]=new this.aggregators[zt.RECALCULATE]({key:Ct[at],dimension:Ct[at],isRecord:!0,formatFun:(j=(Y=this.indicators)===null||Y===void 0?void 0:Y.find(ct=>typeof ct!="string"&&ct.indicatorKey===Ct[at]))===null||j===void 0?void 0:j.format,calculateFun:rt==null?void 0:rt.calculateFun,dependAggregators:this.tree[bt][w],dependIndicatorKeys:rt==null?void 0:rt.dependIndicatorKeys})}else{const rt=this.getAggregatorRule(Ct[at]);this.tree[bt][w][at]=new this.aggregators[(G=rt==null?void 0:rt.aggregationType)!==null&&G!==void 0?G:zt.SUM]({key:Ct[at],dimension:(Z=rt==null?void 0:rt.field)!==null&&Z!==void 0?Z:Ct[at],formatFun:(et=rt==null?void 0:rt.formatFun)!==null&&et!==void 0?et:(vt=(gt=this.indicators)===null||gt===void 0?void 0:gt.find(ct=>typeof ct!="string"&&ct.indicatorKey===Ct[at]))===null||vt===void 0?void 0:vt.format})}bt!==C&&this.tree[bt][w][at].push((nt=(it=p.tree[C])===null||it===void 0?void 0:it[w])===null||nt===void 0?void 0:nt[at])}}m(C,w)})}),b.forEach(C=>{Object.keys(p.tree[C]).forEach(_=>{m(C,_)})})}for(const b in p.totalRecordsTree)for(const C in p.totalRecordsTree[b])m(b,C)}ArrToTree1(t,e,n,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 m=u.join(l);let b=a.get(m);b||(b={value:g,dimensionKey:e[f],children:f===d.length-1&&((p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)>=1?n==null?void 0:n.map(C=>typeof C=="string"?{indicatorKey:C,value:C}:{indicatorKey:C.indicatorKey,value:C.title}):[]},a.set(m,b),c?c.children.push(b):s.push(b)),c=b})}return t.forEach(d=>h(d)),o&&h([r]),s}ArrToTree(t,e,n,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 m=[];let b;p.forEach((C,_)=>{var w,y,S,R;m.push(C);const A=m.join(c);let x=g.get(A);if(!x){if(x={value:C,dimensionKey:e[_],children:_===p.length-1&&((w=n==null?void 0:n.length)!==null&&w!==void 0?w:0)>=1?n==null?void 0:n.map(T=>typeof T=="string"?{indicatorKey:T,value:T}:{indicatorKey:T.indicatorKey,value:T.title}):[]},o[_]){let T=(y=x.children)!==null&&y!==void 0?y:[];const M={value:l,dimensionKey:e[_+1],levelSpan:o.length-_-1,children:((S=n==null?void 0:n.length)!==null&&S!==void 0?S:0)>=1?n==null?void 0:n.map(B=>typeof B=="string"?{indicatorKey:B,value:B}:{indicatorKey:B.indicatorKey,value:B.title}):[]};T.push(M),T=(R=M.children)!==null&&R!==void 0?R:[]}g.set(A,x),b?o[_-1]&&!h?b.children.splice(b.children.length-1,0,x):b.children.push(x):u.push(x)}b=x})}(f)):n&&(u=n==null?void 0:n.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=n==null?void 0:n.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]=G9(this.collectedValues[t],this.dataConfig.dimensionSortArray):this.cacheCollectedValues[t]=this.collectedValues[t])}changeTreeNodeValue(t=[],e=[],n,o){var r,s,l;const a=this.indicatorKeys.indexOf(n);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,n){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]=n)}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]=n)}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,n=t.length;e<n;e++){const o=t[e];this.processRecord(o)}Array.isArray(this.records)&&this.records.push(t)}customTreeToDimensionPathArr(t,e){const n=[],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:z(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=[],n.push([...l])),(d=s.children)===null||d===void 0||d.forEach(u=>r(u,[...l]))):n.push(l)}return t==null||t.forEach(s=>r(s,[])),n}getFieldMatchColDimensionPaths(t){var e,n;const o=[];for(let r=0;(n=r<((e=this.customColTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;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,n;const o=[];for(let r=0;(n=r<((e=this.customRowTreeDimensionPaths)===null||e===void 0?void 0:e.length))!==null&&n!==void 0&&n;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=>z(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 G9(i,t){return i.sort((e,n)=>{const o=t.indexOf(e),r=t.indexOf(n);return o<r?-1:o>r?1:0})}let ET=class extends _g{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C;if(le.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=Le(e.columns),this.internalProps.rows=Le(e.rows),this.internalProps.indicators=go(e.indicators),(n=e.indicators)===null||n===void 0||n.forEach((w,y)=>{typeof w=="object"&&(w!=null&&w.editor)&&(this.internalProps.indicators[y].editor=w.editor)}),this.internalProps.columnTree=!e.indicatorsAsCol||!((o=e.columns)===null||o===void 0)&&o.length||e.columnTree?Le(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((r=e.rows)===null||r===void 0)&&r.length||e.rowTree?Le(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=Le(e.dataConfig),this.internalProps.columnWidthConfig=e.columnWidthConfig;const _=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((a=_==null?void 0:_[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 w=new He((d=this.internalProps.columnTree)!==null&&d!==void 0?d:[],this.layoutNodeId),y=new He((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 hr(this,null,w,y),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new mv({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},_))}else{const w=YR(this,e),{rowKeys:y,columnKeys:S,indicatorKeys:R}=w;let{columnDimensionTree:A,rowDimensionTree:x}=w;this.dataset=new Oh(this.internalProps.dataConfig,y,S,R,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=Vi(this.dataset.colHeaderTree,e.indicators)),A=new He((f=this.dataset.colHeaderTree)!==null&&f!==void 0?f:[],this.layoutNodeId)),e.rowTree||(e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),x=new He((p=this.dataset.rowHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(m=this.options.rowExpandLevel)!==null&&m!==void 0?m:1:void 0)),this.internalProps.layoutMap=new hr(this,this.dataset,A,x)}if(this._changePivotSortStateBySortRules(),((C=(b=e.pivotSortState)===null||b===void 0?void 0:b.length)!==null&&C!==void 0?C:0)>0&&(this.pivotSortState=[],this.pivotSortState=e.pivotSortState),le.mode!=="node"&&(this.editorManager=new mT(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.stateManager.initCheckedState(_),this.scenegraph.createSceneGraph(),e.title){const w=Et.getComponent("title");this.internalProps.title=new w(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const w=Et.getComponent("emptyTip");this.internalProps.emptyTip=new w(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(lt.INITIALIZED,null)},0)}}static get EVENT_TYPE(){return lr}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 n=super._canResizeColumn(t,e);if(n){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 n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;const w=this.internalProps;if(super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Le(t.columns),this.internalProps.rows=Le(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?go(t.indicators):[],(n=t.indicators)===null||n===void 0||n.forEach((S,R)=>{typeof S=="object"&&(S!=null&&S.editor)&&(this.internalProps.indicators[R].editor=S.editor)}),this.internalProps.columnTree=!t.indicatorsAsCol||!((o=t.columns)===null||o===void 0)&&o.length||t.columnTree?Le(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((r=t.rows)===null||r===void 0)&&r.length||t.rowTree?Le(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,w.columnResizeType=(s=t.columnResizeType)!==null&&s!==void 0?s:"column",w.rowResizeType=(l=t.rowResizeType)!==null&&l!==void 0?l:"row",w.dataConfig=Le(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 S=this.internalProps.layoutMap.rowDimensionTree.tree.children;(a=this.internalProps.rowTree)===null||a===void 0||a.forEach((R,A)=>{const x=S.find(T=>T.dimensionKey===R.dimensionKey&&T.value===R.value);x&&this._syncHierarchyState(x,R)})}const y=this.internalProps.records;if(this.internalProps.recordsIsTwoDimensionalArray=!1,((h=y==null?void 0:y[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 S,R;t.columnTree&&(S=new He((u=this.internalProps.columnTree)!==null&&u!==void 0?u:[],this.layoutNodeId)),t.rowTree&&(R=new He((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)),w.layoutMap=new hr(this,null,S,R),this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new mv({rows:w.layoutMap.fullRowDimensionKeys,columns:w.layoutMap.colDimensionKeys,indicators:w.layoutMap.indicatorKeys,indicatorsAsCol:w.layoutMap.indicatorsAsCol,indicatorDimensionKey:w.layoutMap.indicatorDimensionKey},y))}else{const S=YR(this,t),{rowKeys:R,columnKeys:A,indicatorKeys:x}=S;let{columnDimensionTree:T,rowDimensionTree:M}=S;this.dataset=new Oh(w.dataConfig,R,A,x,this.internalProps.indicators,(f=t.indicatorsAsCol)===null||f===void 0||f,y,t.rowHierarchyType,this.internalProps.columnTree,this.internalProps.rowTree,!1,!!t.extensionRows,!!t.parseCustomTreeToMatchRecords),t.columnTree||(t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),T=new He((p=this.dataset.colHeaderTree)!==null&&p!==void 0?p:[],this.layoutNodeId)),t.rowTree||(t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),M=new He((m=this.dataset.rowHeaderTree)!==null&&m!==void 0?m:[],this.layoutNodeId,this.options.rowHierarchyType,this.options.rowHierarchyType==="tree"?(b=this.options.rowExpandLevel)!==null&&b!==void 0?b:1:void 0)),w.layoutMap=new hr(this,this.dataset,T,M)}if(this._changePivotSortStateBySortRules(),((_=(C=t.pivotSortState)===null||C===void 0?void 0:C.length)!==null&&_!==void 0?_:0)>0&&(this.pivotSortState=[],this.pivotSortState=t.pivotSortState),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,w.releaseList&&(w.releaseList.forEach(S=>{var R;return(R=S==null?void 0:S.release)===null||R===void 0?void 0:R.call(S)}),w.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const S=Et.getComponent("title");this.internalProps.title=new S(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const S=Et.getComponent("emptyTip");this.internalProps.emptyTip=new S(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(S=>{setTimeout(S,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,n,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(((n=u.rowHeaderLevelCount)!==null&&n!==void 0?n: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,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}_syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n: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,n){var o,r,s;if(!this.internalProps.layoutMap.isHeader(e,n)){if(this.internalProps.recordsIsTwoDimensionalArray){const l=this.getBodyIndexByRow(n),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,n);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,n),!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,n),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,n).indicatorKey,!1);if(d!=null&&d.record)return d==null?void 0:d.record[t]}}}getCellValue(t,e,n){var o,r,s,l,a,h,d;if(!n){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(b=>!b.virtual))===null||s===void 0?void 0:s.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"col",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),f=(a=(l=u.rowHeaderPaths)===null||l===void 0?void 0:l.filter(b=>!b.virtual))===null||a===void 0?void 0:a.map((b,C)=>{var _;return b.indicatorKey&&(c={position:"row",index:C}),(_=b.indicatorKey)!==null&&_!==void 0?_:b.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,c),{fieldFormat:m}=this.internalProps.layoutMap.getBody(t,e);return p.formatValue?p.formatValue(t,e,this):typeof m=="function"?m(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(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),g=u.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.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 n,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(n=this.records[l])===null||n===void 0?void 0:n[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 n,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(n=this.records[l])===null||n===void 0?void 0:n[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 n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[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 n,o,r;if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.recordsIsTwoDimensionalArray){const s=this.getBodyIndexByRow(e),l=this.getBodyIndexByCol(t);return(n=this.records[s])===null||n===void 0?void 0:n[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,n){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(),pt(e)&&pt(n)?(this.isRowHeader(e,n)?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):this.isCornerHeader(e,n)?o.cornerSetting.titleOnDimension==="column"?(this.setMinMaxLimitWidth(!0),this.internalProps._widthResizedColMap.clear()):o.cornerSetting.titleOnDimension==="row"&&this.internalProps._heightResizedRowMap.clear():this.isColumnHeader(e,n)&&this.internalProps._heightResizedRowMap.clear(),this.refreshRowColCount()):this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(!0),this.render()}_changePivotSortStateBySortRules(){var t,e,n,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=(n=this.internalProps.layoutMap.getIndicatorInfo(l.sortByIndicator))===null||n===void 0?void 0:n.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:gi[h]})}}_parseColumnWidthConfig(t){for(let e=0;e<(t==null?void 0:t.length);e++){const n=t[e],o=n.dimensions,r=n.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,n){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:gi[n],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:gi[n]}))}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:gi[n],sortByIndicator:s,query:r.reduce((a,h)=>(h.dimensionKey&&a.push(h.value),a),[])}]:[{sortField:l.dimensionKey,sortType:gi[n]}];this.updateSortRules(this.dataset.sortRules,t,e)}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=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&&qi(n,l.col,l.row))return a}}_moveHeaderPosition(t,e){const n=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(n.start.col,n.end.col-n.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,n=!0){const o=this.getHierarchyState(t,e);if(o===Vt.expand)this._refreshHierarchyState(t,e,n),this.fireListeners(lr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.collapse});else if(o===Vt.collapse){const r=this.internalProps.layoutMap.getHeadNode(t,e);Array.isArray(r.children)&&this._refreshHierarchyState(t,e,n),this.fireListeners(lr.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Vt.expand,originData:r})}}_refreshHierarchyState(t,e,n=!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,n),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 n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.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,n){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,n,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(((n=this.options.customConfig)===null||n===void 0?void 0:n.enableDataAnalysis)===!1)this.internalProps.recordsIsTwoDimensionalArray===!1&&(this.flatDataToObjects=new mv({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 He((o=this.dataset.colHeaderTree)!==null&&o!==void 0?o:[],this.layoutNodeId),u=a.rowTree?h.layoutMap.rowDimensionTree:new He((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 hr(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=Et.getComponent("emptyTip");this.internalProps.emptyTip=new d(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}}startEditCell(t,e,n){var o;if(z(t)&&z(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,n);else if(!((o=this.stateManager.select)===null||o===void 0)&&o.cellPos){const{col:r,row:s}=this.stateManager.select.cellPos;z(r)&&z(s)&&this.editorManager.startEditCell(r,s,n)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var n,o,r;let s;if(this.isCornerHeader(t,e)){const l=this.getHeaderDefine(t,e);s=(n=l==null?void 0:l.headerEditor)!==null&&n!==void 0?n: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"?aT(s):s}isHasEditorDefine(t,e){var n;const o=this.getBodyColumnDefine(t,e);let r=(n=o==null?void 0:o.editor)!==null&&n!==void 0?n: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})),z(r)}changeCellValue(t,e,n,o=!1){if(o&&this.isHasEditorDefine(t,e)||o===!1){let r=n;const s=this.getCellOriginValue(t,e),l=this.getCellRawValue(t,e);typeof l=="number"&&am(n)&&(r=parseFloat(n)),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=Dr(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=rn(e,0,this.colCount-1,this);this.scenegraph.updateRowHeight(e,d-h)}this.fireListeners(lt.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:l,currentValue:s,changedValue:r}),this.scenegraph.updateNextFrame()}}changeCellValues(t,e,n,o=!1){let r=t,s=e;const l=[],a=[];for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){const c=n[u],g=[],f=[];l.push(g),a.push(f);for(let p=0;p<c.length&&!(t+p>this.colCount-1);p++){const m=this.getCellRawValue(t+p,e+u);g.push(m);const b=this.getCellOriginValue(t+p,e+u);f.push(b)}}for(let u=0;u<n.length&&!(e+u>this.rowCount-1);u++){s=e+u;const c=n[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 m=p;const b=a[u][f],C=l[u][f];typeof C=="number"&&am(p)&&(m=parseFloat(p)),this._changeCellValueToDataSet(t+f,e+u,b,m),this.fireListeners(lt.CHANGE_CELL_VALUE,{col:t+f,row:e+u,rawValue:C,currentValue:b,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=Dr(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=rn(g,0,this.colCount-1,this);u.push(g),c.push(p-f)}this.scenegraph.updateRowsHeight(u,c)}this.scenegraph.updateNextFrame()}_changeCellValueToDataSet(t,e,n,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,n,o);else{const f=(a=g.colHeaderPaths)===null||a===void 0?void 0:a.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=(h=g.rowHeaderPaths)===null||h===void 0?void 0:h.filter(m=>!m.virtual).map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.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,n,o);else{const f=g.colHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.value}),p=g.rowHeaderPaths.map(m=>{var b;return(b=m.indicatorKey)!==null&&b!==void 0?b:m.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:n}=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<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}setTreeNodeChildren(t,e,n,o){this.flatDataToObjects?(this.internalProps.layoutMap.getHeadNode(n,o).children=t,this._refreshHierarchyState(n,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(n,o).children=t,this._refreshHierarchyState(n,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}};Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Ng(),Wg(),Dl(),Vg();class LT extends ET{}Dl();class U9 extends ET{}Pg(),Hg(),Eg(),Lg(),kg(),Fg(),Ig(),Dg(),Og(),zg(),Ng(),Wg(),Dl(),Vg();let K9=class extends _g{constructor(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w;let y,S;le.mode==="node"?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.layoutNodeId={seqId:0},this._selectedDataItemsInChart=[],this._selectedDimensionInChart=[],this._chartEventMap={},e.layout&&Object.assign(e,e.layout),this.internalProps.columns=Le(e.columns),this.internalProps.rows=Le(e.rows),this.internalProps.indicators=go(e.indicators),this.internalProps.columnTree=!e.indicatorsAsCol||!((n=e.columns)===null||n===void 0)&&n.length||e.columnTree?Le(e.columnTree):[],this.internalProps.rowTree=e.indicatorsAsCol||!((o=e.rows)===null||o===void 0)&&o.length||e.rowTree?Le(e.rowTree):[],this.internalProps.records=e.records,this.setCustomStateNameToSpec(),this.internalProps.columnResizeType=(r=e.columnResizeType)!==null&&r!==void 0?r:"column",this.internalProps.rowResizeType=(s=e.rowResizeType)!==null&&s!==void 0?s:"row",this.internalProps.dataConfig={isPivotChart:!0},this._axes=st(e.axes)?e.axes:[],e.columnTree&&(e.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,e.indicators)),y=new He((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),e.rowTree&&(e.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,e.indicators)),S=new He((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const R=!((h=S==null?void 0:S.dimensionKeys)===null||h===void 0)&&h.count?S.dimensionKeys.valueArr():(u=(d=e.rows)===null||d===void 0?void 0:d.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&u!==void 0?u:[],A=!((c=y==null?void 0:y.dimensionKeys)===null||c===void 0)&&c.count?y.dimensionKeys.valueArr():(f=(g=e.columns)===null||g===void 0?void 0:g.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.dimensionKey),T),[]))!==null&&f!==void 0?f:[],x=(m=(p=e.indicators)===null||p===void 0?void 0:p.reduce((T,M)=>(typeof M=="string"?T.push(M):T.push(M.indicatorKey),T),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(A,R),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Oh(this.internalProps.dataConfig,R,A,x,this.internalProps.indicators,(b=e.indicatorsAsCol)===null||b===void 0||b,e.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Fh(this.internalProps.indicators)){const T=M=>{M.forEach(B=>{var P;!((P=B.children)===null||P===void 0)&&P.length?T(B.children):B.children=[{dimensionKey:"axis",value:""}]})};!((C=this.dataset.rowHeaderTree)===null||C===void 0)&&C.length?T(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(e.columnTree||e.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,e.indicators)),e.rowTree||e.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,e.indicators)),y=new He((_=this.dataset.colHeaderTree)!==null&&_!==void 0?_:[],this.layoutNodeId),S=new He((w=this.dataset.rowHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),this.internalProps.layoutMap=new hr(this,this.dataset,y,S),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.createSceneGraph(),e.title){const T=Et.getComponent("title");this.internalProps.title=new T(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const T=Et.getComponent("emptyTip");this.internalProps.emptyTip=new T(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}setTimeout(()=>{this.fireListeners(lt.INITIALIZED,null)},0)}static get EVENT_TYPE(){return TR}get pivotChartAxes(){return this._axes}get recordsCount(){var t;return(t=this.records)===null||t===void 0?void 0:t.length}isListTable(){return!1}isPivotTable(){return!0}isPivotChart(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const o=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(o!=null&&o.disableColumnResize)return!1}return n}updateOption(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y;const S=this.internalProps;let R,A;super.updateOption(t),this.layoutNodeId={seqId:0},this.internalProps.columns=Le(t.columns),this.internalProps.rows=Le(t.rows),this.internalProps.indicators=!((e=t.indicators)===null||e===void 0)&&e.length?go(t.indicators):[],this.internalProps.columnTree=!t.indicatorsAsCol||!((n=t.columns)===null||n===void 0)&&n.length||t.columnTree?Le(t.columnTree):[],this.internalProps.rowTree=t.indicatorsAsCol||!((o=t.rows)===null||o===void 0)&&o.length||t.rowTree?Le(t.rowTree):[],t.records&&(this.internalProps.records=t.records),this.setCustomStateNameToSpec(),this._selectedDataItemsInChart=[],S.columnResizeType=(r=t.columnResizeType)!==null&&r!==void 0?r:"column",S.rowResizeType=(s=t.rowResizeType)!==null&&s!==void 0?s:"row",S.dataConfig={isPivotChart:!0},this._axes=st(t.axes)?t.axes:[],t.columnTree&&(t.indicatorsAsCol!==!1&&(this.internalProps.columnTree=Vi(this.internalProps.columnTree,t.indicators)),R=new He((l=this.internalProps.columnTree)!==null&&l!==void 0?l:[],this.layoutNodeId)),t.rowTree&&(t.indicatorsAsCol===!1&&(this.internalProps.rowTree=Vi(this.internalProps.rowTree,t.indicators)),A=new He((a=this.internalProps.rowTree)!==null&&a!==void 0?a:[],this.layoutNodeId));const x=!((h=A==null?void 0:A.dimensionKeys)===null||h===void 0)&&h.count?A.dimensionKeys.valueArr():(u=(d=t.rows)===null||d===void 0?void 0:d.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&u!==void 0?u:[],T=!((c=R==null?void 0:R.dimensionKeys)===null||c===void 0)&&c.count?R.dimensionKeys.valueArr():(f=(g=t.columns)===null||g===void 0?void 0:g.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.dimensionKey),B),[]))!==null&&f!==void 0?f:[],M=(m=(p=t.indicators)===null||p===void 0?void 0:p.reduce((B,P)=>(typeof P=="string"?B.push(P):B.push(P.indicatorKey),B),[]))!==null&&m!==void 0?m:[];if(this.internalProps.dataConfig.collectValuesBy=this._generateCollectValuesConfig(T,x),this.internalProps.dataConfig.aggregationRules=this._generateAggregationRules(),this.internalProps.dataConfig.dimensionSortArray=this._getDimensionSortArray(),this.dataset=new Oh(this.internalProps.dataConfig,x,T,M,this.internalProps.indicators,(b=t.indicatorsAsCol)===null||b===void 0||b,(C=t.records)!==null&&C!==void 0?C:this.internalProps.records,void 0,this.internalProps.columnTree,this.internalProps.rowTree,!0),this.options.indicatorsAsCol&&Fh(this.internalProps.indicators)){const B=P=>{P.forEach(F=>{var H;!((H=F.children)===null||H===void 0)&&H.length?B(F.children):F.children=[{dimensionKey:"axis",value:""}]})};!((_=this.dataset.rowHeaderTree)===null||_===void 0)&&_.length?B(this.dataset.rowHeaderTree):this.dataset.rowHeaderTree=[{dimensionKey:"axis",value:""}]}if(t.columnTree||t.indicatorsAsCol!==!1&&(this.dataset.colHeaderTree=Vi(this.dataset.colHeaderTree,t.indicators)),t.rowTree||t.indicatorsAsCol===!1&&(this.dataset.rowHeaderTree=Vi(this.dataset.rowHeaderTree,t.indicators)),R=new He((w=this.dataset.colHeaderTree)!==null&&w!==void 0?w:[],this.layoutNodeId),A=new He((y=this.dataset.rowHeaderTree)!==null&&y!==void 0?y:[],this.layoutNodeId),S.layoutMap=new hr(this,this.dataset,R,A),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,S.releaseList&&(S.releaseList.forEach(B=>{var P;return(P=B==null?void 0:B.release)===null||P===void 0?void 0:P.call(B)}),S.releaseList=null),this.scenegraph.clearCells(),this.scenegraph.createSceneGraph(),t.title){const B=Et.getComponent("title");this.internalProps.title=new B(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const B=Et.getComponent("emptyTip");this.internalProps.emptyTip=new B(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise(B=>{setTimeout(B,0)})}updatePagination(){}refreshHeader(){this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,n,o,r,s,l,a;const h=this,{layoutMap:d}=h.internalProps;d&&(h.colCount=(t=d.colCount)!==null&&t!==void 0?t:0,h.rowCount=(e=d.rowCount)!==null&&e!==void 0?e:0,h.internalProps.frozenColCount=(n=d.rowHeaderLevelCount)!==null&&n!==void 0?n:0,h.frozenRowCount=Math.max(d.headerLevelCount,(o=this.options.frozenRowCount)!==null&&o!==void 0?o:0),h.bottomFrozenRowCount!==((r=d==null?void 0:d.bottomFrozenRowCount)!==null&&r!==void 0?r:0)&&(h.bottomFrozenRowCount=(s=d==null?void 0:d.bottomFrozenRowCount)!==null&&s!==void 0?s:0),h.rightFrozenColCount!==((l=d==null?void 0:d.rightFrozenColCount)!==null&&l!==void 0?l:0)&&(h.rightFrozenColCount=(a=d==null?void 0:d.rightFrozenColCount)!==null&&a!==void 0?a:0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount))}_getSortFuncFromHeaderOption(t,e,n){}syncHierarchyState(t,e){var n,o;t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=(n=e.hierarchyState)!==null&&n!==void 0?n: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;!((l=t==null?void 0:t.children)===null||l===void 0)&&l[s]&&r&&this.syncHierarchyState(t.children[s],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)}getCellValue(t,e,n){var o,r,s;if(!n){const u=this.getCustomMergeValue(t,e);if(u)return u}if(this.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const g=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let f;return g==null||g.forEach(p=>{const m=this.internalProps.layoutMap.getIndicatorInfo(p);m&&(f=m)}),(r=(o=f==null?void 0:f.title)!==null&&o!==void 0?o:f==null?void 0:f.indicatorKey)!==null&&r!==void 0?r:""}const{title:u,fieldFormat:c}=this.internalProps.layoutMap.getHeader(t,e);return typeof c=="function"?c(u,t,e,this):u}if(this.dataset){let u;const c=this.internalProps.layoutMap.getCellHeaderPaths(t,e),g=c.colHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"col",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),f=c.rowHeaderPaths.map((m,b)=>{var C;return m.indicatorKey&&(u={position:"row",index:b}),(C=m.indicatorKey)!==null&&C!==void 0?C:m.value}),p=this.dataset.getAggregator(f,g,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,u);return p.value?p.value():void 0}const{fieldFormat:l}=this.internalProps.layoutMap.getBody(t,e),a=this.getBodyIndexByRow(e),h=this.getBodyIndexByCol(t),d=(s=this.records[a])===null||s===void 0?void 0:s[h];return typeof l=="function"?l(d,t,e,this):d}getCellOriginValue(t,e){var n,o,r;const s=this;if(s.internalProps.layoutMap.isHeader(t,e)){if(this.internalProps.layoutMap.isBottomFrozenRow(t,e)||this.internalProps.layoutMap.isRightFrozenColumn(t,e)){const d=this.internalProps.layoutMap.getIndicatorKeyInChartSpec(t,e);let u;return d==null||d.forEach(c=>{const g=this.internalProps.layoutMap.getIndicatorInfo(c);g&&(u=g)}),(o=(n=u==null?void 0:u.title)!==null&&n!==void 0?n:u==null?void 0:u.indicatorKey)!==null&&o!==void 0?o:""}const{title:h}=s.internalProps.layoutMap.getHeader(t,e);return typeof h=="function"?h():h}if(this.dataset){let h;const d=this.internalProps.layoutMap.getCellHeaderPaths(t,e),u=d.colHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"col",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),c=d.rowHeaderPaths.map((f,p)=>{var m;return f.indicatorKey&&(h={position:"row",index:p}),(m=f.indicatorKey)!==null&&m!==void 0?m:f.value}),g=this.dataset.getAggregator(c,u,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,h);return g.value?g.value():void 0}const l=this.getBodyIndexByRow(e),a=this.getBodyIndexByCol(t);return(r=this.records[l])===null||r===void 0?void 0:r[a]}getCellRawValue(t,e){return this.getCellOriginValue(t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)&&this.dataset){let n;const o=this.internalProps.layoutMap.getCellHeaderPaths(t,e),r=o.colHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"col",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value}),s=o.rowHeaderPaths.map((l,a)=>{var h;return l.indicatorKey&&(n={position:"row",index:a}),(h=l.indicatorKey)!==null&&h!==void 0?h:l.value});return this.dataset.getAggregator(s,r,this.internalProps.layoutMap.getIndicatorKey(t,e),!0,n).records}}getCellRawRecord(t,e){return this.getCellOriginRecord(t,e)}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let o=0;o<this.pivotSortState.length;o++){const{col:r,row:s,order:l}=this.pivotSortState[o];if(qi(n,r,s))return l}}_moveHeaderPosition(t,e){var n,o,r,s;const l=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(l){if(l.moveType==="column"){if(((o=(n=this.options.records)===null||n===void 0?void 0:n[0])===null||o===void 0?void 0:o.constructor)===Array)for(let a=0;a<this.internalProps.records.length;a++){const h=this.internalProps.records[a].splice(l.sourceIndex-this.rowHeaderLevelCount,l.sourceSize);h.unshift(l.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records[a],h)}this.colWidthsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize),this.setMinMaxLimitWidth()}else if(l.moveType==="row"){if(((s=(r=this.options.records)===null||r===void 0?void 0:r[0])===null||s===void 0?void 0:s.constructor)===Array){const a=this.internalProps.records.splice(l.sourceIndex-this.columnHeaderLevelCount,l.sourceSize);a.unshift(l.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.internalProps.records,a)}this.rowHeightsMap.adjustOrder(l.sourceIndex,l.targetIndex,l.sourceSize)}return l}return null}toggleHierarchyState(t,e,n=!0){}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 n;return(n=this._getHeaderLayoutMap(t,e))===null||n===void 0?void 0:n.hierarchyState}_hasHierarchyTreeHeader(){return this.internalProps.layoutMap.rowHierarchyType==="tree"}getMenuInfo(t,e,n){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}}_generateCollectValuesConfig(t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_;t=t.filter(S=>S!==Zi),e=e.filter(S=>S!==Zi);const w=this.internalProps.indicators,y={};for(let S=0,R=w==null?void 0:w.length;S<R;S++)if(typeof w[S]!="string"&&w[S].chartSpec){if(((n=w[S].chartSpec)===null||n===void 0?void 0:n.type)==="pie"||((o=w[S].chartSpec)===null||o===void 0?void 0:o.type)==="rose"||((r=w[S].chartSpec)===null||r===void 0?void 0:r.type)==="radar"||((s=w[S].chartSpec)===null||s===void 0?void 0:s.type)==="gauge"||((l=w[S].chartSpec)===null||l===void 0?void 0:l.type)==="wordCloud")continue;const A=w[S],x=A.chartSpec;if(this.options.indicatorsAsCol===!1)if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[A.indicatorKey]={by:e,range:!0,sumBy:(x==null?void 0:x.stack)&&t.concat(x==null?void 0:x.xField)},x.series)x.series.forEach(T=>{var M,B,P,F,H,E,k,I,L,D,O,W,N,$;const U=typeof T.xField=="string"?T.xField:T.xField[0];y[U]={by:t,type:T.direction!=="horizontal"?"xField":void 0,range:Ms(T,this._axes,T.direction==="horizontal",!0),sortBy:T.direction!=="horizontal"?(F=(P=(B=(M=T==null?void 0:T.data)===null||M===void 0?void 0:M.fields)===null||B===void 0?void 0:B[U])===null||P===void 0?void 0:P.domain)!==null&&F!==void 0?F:(k=(E=(H=x==null?void 0:x.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[U])===null||k===void 0?void 0:k.domain:void 0};const Y=T.yField;T.stack!==!1&&(T.type==="bar"||T.type==="area")&&(T.stack=!0),y[Y]={by:e,range:Ms(T,this._axes,T.direction==="horizontal",!1),sumBy:T.stack&&t.concat(T==null?void 0:T.xField),sortBy:T.direction==="horizontal"?(O=(D=(L=(I=T==null?void 0:T.data)===null||I===void 0?void 0:I.fields)===null||L===void 0?void 0:L[Y])===null||D===void 0?void 0:D.domain)!==null&&O!==void 0?O:($=(N=(W=x==null?void 0:x.data)===null||W===void 0?void 0:W.fields)===null||N===void 0?void 0:N[Y])===null||$===void 0?void 0:$.domain:void 0,extendRange:Mc(x.markLine)}});else{const T=typeof x.xField=="string"?x.xField:x.xField[0];y[T]={by:t,type:x.direction!=="horizontal"?"xField":void 0,range:Ms(x,this._axes,x.direction==="horizontal",!0),sortBy:x.direction!=="horizontal"?(d=(h=(a=x==null?void 0:x.data)===null||a===void 0?void 0:a.fields)===null||h===void 0?void 0:h[T])===null||d===void 0?void 0:d.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const M=x.yField;y[M]={by:e,range:x.direction!=="horizontal",sumBy:x.stack&&t.concat(x==null?void 0:x.xField),sortBy:x.direction==="horizontal"?(g=(c=(u=x==null?void 0:x.data)===null||u===void 0?void 0:u.fields)===null||c===void 0?void 0:c[M])===null||g===void 0?void 0:g.domain:void 0,extendRange:Mc(x.markLine)}}else{const T=w[S];if((x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0),y[T.indicatorKey]={by:t,range:!0,sumBy:(x==null?void 0:x.stack)&&e.concat(x==null?void 0:x.yField)},x.series)x.series.forEach(M=>{var B,P,F,H,E,k,I,L,D,O,W,N,$,U;const Y=typeof M.yField=="string"?M.yField:M.yField[0];y[Y]={by:e,type:M.direction==="horizontal"?"yField":void 0,range:Ms(M,this._axes,M.direction==="horizontal",!1),sortBy:M.direction==="horizontal"?(H=(F=(P=(B=M==null?void 0:M.data)===null||B===void 0?void 0:B.fields)===null||P===void 0?void 0:P[Y])===null||F===void 0?void 0:F.domain)!==null&&H!==void 0?H:(I=(k=(E=x==null?void 0:x.data)===null||E===void 0?void 0:E.fields)===null||k===void 0?void 0:k[Y])===null||I===void 0?void 0:I.domain:void 0};const j=M.xField;M.stack!==!1&&(M.type==="bar"||M.type==="area")&&(M.stack=!0),y[j]={by:t,range:Ms(M,this._axes,M.direction==="horizontal",!0),sumBy:M.stack&&e.concat(M==null?void 0:M.yField),sortBy:M.direction!=="horizontal"?(W=(O=(D=(L=M==null?void 0:M.data)===null||L===void 0?void 0:L.fields)===null||D===void 0?void 0:D[j])===null||O===void 0?void 0:O.domain)!==null&&W!==void 0?W:(U=($=(N=x==null?void 0:x.data)===null||N===void 0?void 0:N.fields)===null||$===void 0?void 0:$[j])===null||U===void 0?void 0:U.domain:void 0,extendRange:Mc(x.markLine)}});else{const M=typeof x.yField=="string"?x.yField:x.yField[0];y[M]={by:e,type:x.direction==="horizontal"?"yField":void 0,range:Ms(x,this._axes,x.direction==="horizontal",!1),sortBy:x.direction==="horizontal"?(m=(p=(f=x==null?void 0:x.data)===null||f===void 0?void 0:f.fields)===null||p===void 0?void 0:p[M])===null||m===void 0?void 0:m.domain:void 0},(x==null?void 0:x.stack)!==!1&&((x==null?void 0:x.type)==="bar"||(x==null?void 0:x.type)==="area")&&(x.stack=!0);const B=x.xField;y[B]={by:t,range:Ms(x,this._axes,x.direction==="horizontal",!0),sumBy:x.stack&&e.concat(x==null?void 0:x.yField),sortBy:x.direction!=="horizontal"?(_=(C=(b=x==null?void 0:x.data)===null||b===void 0?void 0:b.fields)===null||C===void 0?void 0:C[B])===null||_===void 0?void 0:_.domain:void 0,extendRange:Mc(x.markLine)}}}}return y}_generateAggregationRules(){var t;const e=[];return(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=this.options.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=this.options.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}setCustomStateNameToSpec(){var t;const e=n=>{var o,r,s,l,a,h,d,u,c,g;!((r=(o=n.bar)===null||o===void 0?void 0:o.state)===null||r===void 0)&&r.selected&&(n.bar.state.vtable_selected=n.bar.state.selected,n.bar.state.vtable_selected_reverse=n.bar.state.selected_reverse,delete n.bar.state.selected,delete n.bar.state.selected_reverse),!((l=(s=n.point)===null||s===void 0?void 0:s.state)===null||l===void 0)&&l.selected&&(n.point.state.vtable_selected=n.point.state.selected,n.point.state.vtable_selected_reverse=n.point.state.selected_reverse,delete n.point.state.selected,delete n.point.state.selected_reverse),!((h=(a=n.line)===null||a===void 0?void 0:a.state)===null||h===void 0)&&h.selected&&(n.line.state.vtable_selected=n.line.state.selected,n.line.state.vtable_selected_reverse=n.line.state.selected_reverse,delete n.line.state.selected,delete n.line.state.selected_reverse),!((u=(d=n.area)===null||d===void 0?void 0:d.state)===null||u===void 0)&&u.selected&&(n.area.state.vtable_selected=n.area.state.selected,n.area.state.vtable_selected_reverse=n.area.state.selected_reverse,delete n.area.state.selected,delete n.area.state.selected_reverse),!((g=(c=n.pie)===null||c===void 0?void 0:c.state)===null||g===void 0)&&g.selected&&(n.pie.state.vtable_selected=n.pie.state.selected,n.pie.state.vtable_selected_reverse=n.pie.state.selected_reverse,delete n.pie.state.selected,delete n.pie.state.selected_reverse)};(t=this.internalProps.indicators)===null||t===void 0||t.forEach(n=>{if(n.chartSpec){const o=n.chartSpec;o.series?o.series.forEach(r=>{e(r)}):e(o)}})}updateFilterRules(t){this.internalProps.dataConfig.filterRules=t,this.dataset.updateFilterRules(t),Bh(this.scenegraph),IW(this.scenegraph),this.render()}clearChartCacheImage(t,e){pt(t)&&pt(e)?FW(t,e,this.scenegraph):Bh(this.scenegraph)}getLegendSelected(){var t;const e=[];return(t=this.internalProps.legends)===null||t===void 0||t.forEach(n=>{const o=n.legendComponent._getSelectedLegends().map(r=>r.label);e.push(...o)}),e}setLegendSelected(t){var e;(e=this.internalProps.legends)===null||e===void 0||e.forEach(n=>{n.legendComponent.setSelected(t)})}getChartDatumPosition(t,e){const{chartInstance:n,bounds:o}=this.getChartInstance(e);if(n){const r=n.convertDatumToPosition(t);return r?{x:Math.round(r.x+o.x1),y:Math.round(r.y+o.y1)}:null}return null}getCellAddressByRecord(t){const e=[],n=[],o={},r=[];this.dataset.dataConfig.aggregationRules.forEach(s=>{if(typeof s.field=="string")o[s.field]=s.indicatorKey,r.push(s.field);else for(let l=0;l<s.field.length;l++)o[s.field[l]]=s.indicatorKey,r.push(s.field[l])});for(const s in t)this.dataset.rows.indexOf(s)>=0&&e.push({dimensionKey:s,value:t[s]}),this.dataset.columns.indexOf(s)>=0&&n.push({dimensionKey:s,value:t[s]}),r.indexOf(s)>=0&&(this.dataset.indicatorsAsCol?n.push({indicatorKey:o[s]}):e.push({indicatorKey:o[s]}));return this.getCellAddressByHeaderPaths({rowHeaderPaths:e,colHeaderPaths:n,cellLocation:"body"})}getChartInstance(t){var e,n,o,r,s;const l=this.getCellAddressByHeaderPaths(t);if(l){const a=this.getCellRelativeRect(l.col,l.row),h=this.scenegraph.getCell(l.col,l.row);let d;const u=(e=h==null?void 0:h.getChildren())===null||e===void 0?void 0:e[0];if(u.attribute.chartInstance){d=u.attribute.chartInstance;const{dataId:c,data:g,axes:f,spec:p}=u.attribute,m=u.getViewBox();if(f==null||f.forEach((b,C)=>{var _,w,y,S;b.type==="linear"?d.updateModelSpecSync({type:"axes",index:C},{min:(w=(_=b.range)===null||_===void 0?void 0:_.min)!==null&&w!==void 0?w:0,max:(S=(y=b.range)===null||y===void 0?void 0:y.max)!==null&&S!==void 0?S:0},!0):b.type==="band"&&d.updateModelSpec({type:"axes",index:C},{domain:b.domain.slice(0)},!0)}),d.updateViewBox({x1:m.x1-u.getRootNode().table.scrollLeft,x2:m.x2-u.getRootNode().table.scrollLeft,y1:m.y1-u.getRootNode().table.scrollTop,y2:m.y2-u.getRootNode().table.scrollTop},!1,!1),typeof c=="string")d.updateDataSync(c,g??[]);else{const b=[];for(const C in c){const _=c[C],w=p.series.find(y=>{var S;return((S=y==null?void 0:y.data)===null||S===void 0?void 0:S.id)===C});b.push({id:C,values:_?(n=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&n!==void 0?n:[]:g??[],fields:(o=w==null?void 0:w.data)===null||o===void 0?void 0:o.fields}),d.updateFullDataSync||d.updateDataSync(C,_?(r=g==null?void 0:g.filter(y=>y.hasOwnProperty(_)))!==null&&r!==void 0?r:[]:g??[])}(s=d.updateFullDataSync)===null||s===void 0||s.call(d,b)}this.renderAsync()}return{chartInstance:d,bounds:a.bounds}}return{}}_getDimensionSortArray(){var t,e;if(!((e=(t=this.options)===null||t===void 0?void 0:t.axes)===null||e===void 0)&&e.length){const n=this.options.indicatorsAsCol?"left":"bottom",o=this.options.axes.find(r=>r.orient===n);if(o&&st(o.domain))return o.domain}}setRecords(t){var e,n;const o={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.options.records=this.internalProps.records=t;const r=this.options,s=this.internalProps;let l,a;this.dataset.setRecords(t),l=r.columnTree?s.layoutMap.columnDimensionTree:new He((e=this.dataset.colHeaderTree)!==null&&e!==void 0?e:[],this.layoutNodeId),a=r.rowTree?s.layoutMap.rowDimensionTree:new He((n=this.dataset.rowHeaderTree)!==null&&n!==void 0?n:[],this.layoutNodeId),s.layoutMap=new hr(this,this.dataset,l,a),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(o.col,o.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.eventManager.updateEventBinder()}_hasCustomRenderOrLayout(){if(this.options.customRender)return!0;const{columnsDefine:t,rowsDefine:e,indicatorsDefine:n}=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<n.length;o++){const r=n[o];if(typeof r!="string"&&(r.customLayout||r.headerCustomLayout||r.customRender||r.headerCustomRender))return!0}return!1}changeRecordOrder(t,e){}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)}};class Y9 extends Zp{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class kT extends fn{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g,f,p;t.direction&&(t.flexDirection=t.direction),!t.justifyContent||t.justifyContent!=="start"&&t.justifyContent!=="end"||(t.justifyContent="flex-"+t.justifyContent),!t.alignItems||t.alignItems!=="start"&&t.alignItems!=="end"||(t.alignItems="flex-"+t.alignItems),!t.alignContent||t.alignContent!=="start"&&t.alignContent!=="end"||(t.alignContent="flex-"+t.alignContent),t.display="flex",t.flexDirection||(t.flexDirection="row"),t.clip=!0,t.fill=(e=t==null?void 0:t.background)===null||e===void 0?void 0:e.fill,t.stroke=(n=t==null?void 0:t.background)===null||n===void 0?void 0:n.stroke,t.lineWidth=(o=t==null?void 0:t.background)===null||o===void 0?void 0:o.lineWidth,t.cornerRadius=(r=t==null?void 0:t.background)===null||r===void 0?void 0:r.cornerRadius;const m=st(t.boundsPadding),b=[(l=(s=t.marginTop)!==null&&s!==void 0?s:m?t.boundsPadding[0]:t.boundsPadding)!==null&&l!==void 0?l:0,(h=(a=t.marginRight)!==null&&a!==void 0?a:m?t.boundsPadding[1]:t.boundsPadding)!==null&&h!==void 0?h:0,(c=(d=t.marginBottom)!==null&&d!==void 0?d:m?(u=t.boundsPadding[2])!==null&&u!==void 0?u:t.boundsPadding[0]:t.boundsPadding)!==null&&c!==void 0?c:0,(p=(g=t.marginLeft)!==null&&g!==void 0?g:m?(f=t.boundsPadding[3])!==null&&f!==void 0?f:t.boundsPadding[1]:t.boundsPadding)!==null&&p!==void 0?p:0];t.boundsPadding=b,super(t)}}class X9 extends kT{constructor(t){t.flexWrap="nowrap",super(t)}}let q9=class extends Yo{constructor(t){var e,n,o,r,s,l,a,h,d,u,c,g;let f;ge(t.iconName)&&(f=Cn()[t.iconName],f&&(t.width=(e=t.width)!==null&&e!==void 0?e:f.width,t.height=(n=t.height)!==null&&n!==void 0?n:f.height,t.svg=f.svg,t.cursor=f.cursor)),t.svg&&(t.image=t.svg);const p=st(t.boundsPadding),m=[(r=(o=t.marginTop)!==null&&o!==void 0?o:p?t.boundsPadding[0]:t.boundsPadding)!==null&&r!==void 0?r:0,(l=(s=t.marginRight)!==null&&s!==void 0?s:p?t.boundsPadding[1]:t.boundsPadding)!==null&&l!==void 0?l:0,(d=(a=t.marginBottom)!==null&&a!==void 0?a:p?(h=t.boundsPadding[2])!==null&&h!==void 0?h:t.boundsPadding[0]:t.boundsPadding)!==null&&d!==void 0?d:0,(g=(u=t.marginLeft)!==null&&u!==void 0?u:p?(c=t.boundsPadding[3])!==null&&c!==void 0?c:t.boundsPadding[1]:t.boundsPadding)!==null&&g!==void 0?g:0];t.boundsPadding=m,super(t),this.cache=f}},Z9=class extends Yo{constructor(t){var e,n,o,r,s,l,a,h,d,u;t.src&&(t.image=t.src),t.shape==="circle"&&(t.cornerRadius=t.width/2);const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}};class J9 extends fu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class Q9 extends Hi{constructor(t){var e,n,o,r,s,l,a,h,d,u,c;t.textBaseline||(t.textBaseline="top");const g=st(t.boundsPadding),f=[(n=(e=t.marginTop)!==null&&e!==void 0?e:g?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:g?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:g?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:g?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=f,t.fill=(c=t.fill)!==null&&c!==void 0?c:"#000",super(t)}getSize(t){this.AABBBounds.width()}}function t7(i,t=0){return{percent:i,delta:t}}class e7 extends mu{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}class i7 extends $a{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}getSize(t){this.AABBBounds.width()}}class n7 extends fn{constructor(t){var e,n,o,r,s,l,a,h,d,u;const c=st(t.boundsPadding),g=[(n=(e=t.marginTop)!==null&&e!==void 0?e:c?t.boundsPadding[0]:t.boundsPadding)!==null&&n!==void 0?n:0,(r=(o=t.marginRight)!==null&&o!==void 0?o:c?t.boundsPadding[1]:t.boundsPadding)!==null&&r!==void 0?r:0,(a=(s=t.marginBottom)!==null&&s!==void 0?s:c?(l=t.boundsPadding[2])!==null&&l!==void 0?l:t.boundsPadding[0]:t.boundsPadding)!==null&&a!==void 0?a:0,(u=(h=t.marginLeft)!==null&&h!==void 0?h:c?(d=t.boundsPadding[3])!==null&&d!==void 0?d:t.boundsPadding[1]:t.boundsPadding)!==null&&u!==void 0?u:0];t.boundsPadding=g,super(t)}}const o7=Object.freeze(Object.defineProperty({__proto__:null,Arc:e7,CheckBox:Tr,Circle:Y9,Container:kT,Group:n7,GroupElement:X9,Icon:q9,Image:Z9,Line:n0,Radio:eh,Rect:J9,Tag:i7,Text:Q9,percentCalc:t7},Symbol.toStringTag,{value:"Module"}));function r7(i){var t,e,n,o,r,s,l,a,h,d,u;const c={seqId:0},g={isPivotChart:!0};let f,p,m,b;i.columnTree&&(i.indicatorsAsCol!==!1&&(m=Vi(i.columnTree,i.indicators)),f=new He((t=i.columnTree)!==null&&t!==void 0?t:[],c)),i.rowTree&&(i.indicatorsAsCol===!1&&(b=Vi(i.rowTree,i.indicators)),p=new He((e=i.rowTree)!==null&&e!==void 0?e:[],c));const C=!((n=p.dimensionKeys)===null||n===void 0)&&n.count?p.dimensionKeys.valueArr():(r=(o=i.rows)===null||o===void 0?void 0:o.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&r!==void 0?r:[],_=!((s=f.dimensionKeys)===null||s===void 0)&&s.count?f.dimensionKeys.valueArr():(a=(l=i.columns)===null||l===void 0?void 0:l.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.dimensionKey),y),[]))!==null&&a!==void 0?a:[],w=(d=(h=i.indicators)===null||h===void 0?void 0:h.reduce((y,S)=>(typeof S=="string"?y.push(S):y.push(S.indicatorKey),y),[]))!==null&&d!==void 0?d:[];return g.collectValuesBy=s7(i,_,C),g.aggregationRules=l7(i),{dataset:new Oh(g,C,_,w,i.indicators,(u=i.indicatorsAsCol)===null||u===void 0||u,i.records,void 0,m||i.columnTree,b||i.rowTree,!0),columnDimensionTree:f,rowDimensionTree:p,layoutNodeId:c}}function s7(i,t,e){var n,o,r,s,l,a,h,d,u,c,g,f,p,m,b,C,_,w,y,S,R,A,x;const T={};for(let M=0,B=(n=i.indicators)===null||n===void 0?void 0:n.length;M<B;M++)if(typeof i.indicators[M]!="string"&&i.indicators[M].chartSpec)if(i.indicatorsAsCol===!1){const P=i.indicators[M];if(T[P.indicatorKey]={by:e,range:!0,sumBy:((o=P.chartSpec)===null||o===void 0?void 0:o.stack)!==!1&&t.concat((r=P.chartSpec)===null||r===void 0?void 0:r.xField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et;const gt=typeof F.xField=="string"?F.xField:F.xField[0];T[gt]={by:t,type:F.direction!=="horizontal"?"xField":void 0,range:F.direction==="horizontal",sortBy:F.direction!=="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(W=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||W===void 0?void 0:W.domain:void 0};const vt=F.yField;T[vt]={by:e,range:F.direction!=="horizontal",sumBy:F.stack!==!1&&t.concat(F==null?void 0:F.xField),sortBy:F.direction==="horizontal"?(Y=(U=($=(N=F==null?void 0:F.data)===null||N===void 0?void 0:N.fields)===null||$===void 0?void 0:$[vt])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(et=(Z=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||Z===void 0?void 0:Z[vt])===null||et===void 0?void 0:et.domain:void 0}});else{const F=typeof P.chartSpec.xField=="string"?P.chartSpec.xField:P.chartSpec.xField[0];T[F]={by:t,type:P.chartSpec.direction!=="horizontal"?"xField":void 0,range:P.chartSpec.direction==="horizontal",sortBy:P.chartSpec.direction!=="horizontal"?(h=(a=(l=(s=P.chartSpec)===null||s===void 0?void 0:s.data)===null||l===void 0?void 0:l.fields)===null||a===void 0?void 0:a[F])===null||h===void 0?void 0:h.domain:void 0};const H=P.chartSpec.yField;T[H]={by:e,range:i.indicators[M].chartSpec.direction!=="horizontal",sumBy:P.chartSpec.stack!==!1&&t.concat((d=P.chartSpec)===null||d===void 0?void 0:d.xField),sortBy:P.chartSpec.direction==="horizontal"?(f=(g=(c=(u=P.chartSpec)===null||u===void 0?void 0:u.data)===null||c===void 0?void 0:c.fields)===null||g===void 0?void 0:g[H])===null||f===void 0?void 0:f.domain:void 0}}}else{const P=i.indicators[M];if(T[P.indicatorKey]={by:t,range:!0,sumBy:((p=P.chartSpec)===null||p===void 0?void 0:p.stack)!==!1&&e.concat((m=P.chartSpec)===null||m===void 0?void 0:m.yField)},P.chartSpec.series)P.chartSpec.series.forEach(F=>{var H,E,k,I,L,D,O,W,N,$,U,Y,j,G,Z,et;const gt=typeof F.yField=="string"?F.yField:F.yField[0];T[gt]={by:e,type:F.direction==="horizontal"?"yField":void 0,range:F.direction!=="horizontal",sortBy:F.direction==="horizontal"?(I=(k=(E=(H=F==null?void 0:F.data)===null||H===void 0?void 0:H.fields)===null||E===void 0?void 0:E[gt])===null||k===void 0?void 0:k.domain)!==null&&I!==void 0?I:(W=(O=(D=(L=P.chartSpec)===null||L===void 0?void 0:L.data)===null||D===void 0?void 0:D.fields)===null||O===void 0?void 0:O[gt])===null||W===void 0?void 0:W.domain:void 0};const vt=F.xField;T[vt]={by:t,range:F.direction==="horizontal",sumBy:F.stack!==!1&&e.concat(F==null?void 0:F.yField),sortBy:F.direction!=="horizontal"?(Y=(U=($=(N=F==null?void 0:F.data)===null||N===void 0?void 0:N.fields)===null||$===void 0?void 0:$[vt])===null||U===void 0?void 0:U.domain)!==null&&Y!==void 0?Y:(et=(Z=(G=(j=P.chartSpec)===null||j===void 0?void 0:j.data)===null||G===void 0?void 0:G.fields)===null||Z===void 0?void 0:Z[vt])===null||et===void 0?void 0:et.domain:void 0}});else{const F=typeof P.chartSpec.yField=="string"?P.chartSpec.yField:P.chartSpec.yField[0];T[F]={by:e,type:P.chartSpec.direction==="horizontal"?"yField":void 0,range:P.chartSpec.direction!=="horizontal",sortBy:P.chartSpec.direction==="horizontal"?(w=(_=(C=(b=P.chartSpec)===null||b===void 0?void 0:b.data)===null||C===void 0?void 0:C.fields)===null||_===void 0?void 0:_[F])===null||w===void 0?void 0:w.domain:void 0};const H=P.chartSpec.xField;T[H]={by:t,range:i.indicators[M].chartSpec.direction==="horizontal",sumBy:P.chartSpec.stack!==!1&&e.concat((y=P.chartSpec)===null||y===void 0?void 0:y.yField),sortBy:P.chartSpec.direction!=="horizontal"?(x=(A=(R=(S=P.chartSpec)===null||S===void 0?void 0:S.data)===null||R===void 0?void 0:R.fields)===null||A===void 0?void 0:A[H])===null||x===void 0?void 0:x.domain:void 0}}}return T}function l7(i){var t;const e=[];return(t=i.indicators)===null||t===void 0||t.forEach(n=>{var o,r;if(typeof n=="string")e.push({indicatorKey:n,field:n,aggregationType:zt.RECORD});else if(!((o=n.chartSpec)===null||o===void 0)&&o.series){const s=[];(r=n.chartSpec)===null||r===void 0||r.series.forEach(l=>{const a=i.indicatorsAsCol===!1?l.yField:l.xField;s.indexOf(a)===-1&&s.push(a)}),e.push({indicatorKey:n.indicatorKey,field:s,aggregationType:zt.RECORD})}else{const s=i.indicatorsAsCol===!1?n.chartSpec.yField:n.chartSpec.xField;e.push({indicatorKey:n.indicatorKey,field:s??n.indicatorKey,aggregationType:zt.RECORD})}}),e}function a7(i,t,e){var n,o;const r=r7(i);let s=r.columnDimensionTree,l=r.rowDimensionTree,a=!1,h=!1;i.columnTree&&i.indicatorsAsCol&&!s.dimensionKeys.contain(Zi)&&(a=!0),i.rowTree&&(i.indicatorsAsCol||l.dimensionKeys.contain(Zi)||(h=!0));const{dataset:d,layoutNodeId:u}=r,c={options:i,layoutNodeId:u,internalProps:i,isPivotChart:()=>!0,pivotChartAxes:[],_selectedDataItemsInChart:[],_getActiveChartInstance:()=>({updateState:()=>{}})};i.columnTree&&!a||(s=new He((n=d.colHeaderTree)!==null&&n!==void 0?n:[],u)),i.rowTree&&!h||(l=new He((o=d.rowHeaderTree)!==null&&o!==void 0?o:[],u));const g=new hr(c,d,s,l);for(let f=0;f<g.colCount;f++)for(let p=0;p<g.rowCount;p++){if(g.isHeader(f,p))continue;const m=g.getCellHeaderPaths(f,p),b=m.colHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),C=m.rowHeaderPaths.map(y=>{var S;return(S=y.indicatorKey)!==null&&S!==void 0?S:y.value}),_=d.getAggregator(g.indicatorsAsCol?C:C.slice(0,-1),g.indicatorsAsCol?b.slice(0,-1):b,g.getIndicatorKey(f,p)),w=h7(_.value?_.value():void 0,t,f,p,g,e);if(w)return w}}function h7(i,t,e,n,o,r){if(st(i)){for(let s=0;s<i.length;s++)if(r?r(i[s],t):d7(i[s],t))return o.getCellHeaderPaths(e,n)}}function d7(i,t){return JSON.stringify(i)===JSON.stringify(t)}function u7(i){return new $a(i?i.attribute:{})}function c7(i){return new Tr(i?i.attribute:{})}function g7(i){return new eh(i?i.attribute:{})}class f7{constructor(t,e){var n,o,r,s,l,a;this.willUpdateRow=!1,this.willUpdateCol=!1,this.table=t,this.rowCount=(n=e==null?void 0:e.rowCount)!==null&&n!==void 0?n:void 0,this.colCount=(o=e==null?void 0:e.colCount)!==null&&o!==void 0?o:void 0,this.animationDuration=(r=e==null?void 0:e.animationDuration)!==null&&r!==void 0?r:500,this.animationDelay=(s=e==null?void 0:e.animationDelay)!==null&&s!==void 0?s:1e3,this.animationEasing=(l=e==null?void 0:e.animationEasing)!==null&&l!==void 0?l:"linear",this.replaceScrollAction=(a=e==null?void 0:e.replaceScrollAction)!==null&&a!==void 0&&a,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):this.row+=this.rowCount,this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout(()=>{this.willUpdateRow=!1,this.updateRow()},this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing)return;let t=!0;this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):this.col+=this.colCount,this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout(()=>{this.willUpdateCol=!1,this.updateCol()},this.animationDuration+this.animationDelay)}}class p7{constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){var t,e,n,o,r,s,l,a;this.table.registerCustomCellStyle("col-highlight",{bgColor:(e=(t=this.options)===null||t===void 0?void 0:t.colHighlightBGColor)!==null&&e!==void 0?e:"#82b2f5",color:(o=(n=this.options)===null||n===void 0?void 0:n.colHighlightColor)!==null&&o!==void 0?o:"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:(s=(r=this.options)===null||r===void 0?void 0:r.rowHighlightBGColor)!==null&&s!==void 0?s:"#82b2f5",color:(a=(l=this.options)===null||l===void 0?void 0:l.rowHighlightColor)!==null&&a!==void 0?a:"#FFF"})}bindEvent(){this.table.on("selected_cell",t=>{this.updateHighlight()}),this.table.on("selected_clear",()=>{this.clearHighlight()}),this.table.on("mousemove_table",()=>{this.table.stateManager.select.selecting&&this.updateHighlight()})}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){var t,e,n,o;if(((t=this.options)===null||t===void 0?void 0:t.colHighlight)===!1&&((e=this.options)===null||e===void 0?void 0:e.rowHighlight)===!1)return;const r=this.table.getSelectedCellRanges();if(r.length===0)return void this.clearHighlight();const s=r[0],l=[s.start.row,s.end.row];l.sort((u,c)=>u-c);const a=[s.start.col,s.end.col];let h,d;a.sort((u,c)=>u-c),this.table.isPivotTable()?(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}):this.table.internalProps.transpose?d={start:{col:0,row:l[0]},end:{col:this.table.rowHeaderLevelCount-1,row:l[1]}}:(h={start:{col:a[0],row:0},end:{col:a[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(d={start:{col:0,row:l[0]},end:{col:0,row:l[1]}})),((n=this.options)===null||n===void 0?void 0:n.colHighlight)===!1||FT(this.colHeaderRange,h)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),h&&this.table.arrangeCustomCellStyle({range:h},"col-highlight"),this.colHeaderRange=h),((o=this.options)===null||o===void 0?void 0:o.rowHighlight)===!1||FT(this.rowHeaderRange,d)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),d&&this.table.arrangeCustomCellStyle({range:d},"row-highlight"),this.rowHeaderRange=d)}}function FT(i,t){return i===void 0&&t===void 0||i!==void 0&&t!==void 0&&i.start.col===t.start.col&&i.start.row===t.start.row&&i.end.col===t.end.col&&i.end.row===t.end.row}sx();const m7="1.11.1";function v7(){return Cn()}function b7(){hT()}const C7=Object.freeze(Object.defineProperty({__proto__:null,CarouselAnimationPlugin:f7,CustomLayout:o7,DataStatistics:hV,EventTarget:ih,HeaderHighlightPlugin:p7,InvertHighlightPlugin:rN,ListTable:W9,ListTableSimple:V9,PIVOT_CHART_EVENT_TYPE:TR,PIVOT_TABLE_EVENT_TYPE:lr,PivotChart:K9,PivotTable:LT,PivotTableSimple:U9,TABLE_EVENT_TYPE:lt,TYPES:Xz,VArc:DI,VArea:OI,VCheckBox:c7,VCircle:zI,VGlyph:WI,VGroup:NI,VImage:VI,VLine:jI,VPath:$I,VPolygon:GI,VRadio:g7,VRect:UI,VSymbol:KI,VTag:u7,VText:YI,clearGlobal:b7,core:Q8,data:r6,getDataCellPath:a7,getIcons:v7,getTargetCell:Lr,graphicUtil:L1,jsx:qI,onBeforeAttributeUpdateForInvertHighlight:bA,register:oV,registerAxis:Pg,registerChartCell:Ig,registerCheckboxCell:Dg,registerEmptyTip:Hg,registerImageCell:Og,registerLegend:Eg,registerMenu:Lg,registerProgressBarCell:zg,registerRadioCell:Ng,registerSparkLineCell:Wg,registerTextCell:Dl,registerTitle:kg,registerTooltip:Fg,registerVideoCell:Vg,renderChart:jm,restoreMeasureText:pN,setCustomAlphabetCharSet:fN,themes:X4,updateCell:xo,version:m7},Symbol.toStringTag,{value:"Module"})),dr=DB.create({baseURL:"/",validateStatus(i){return i===200},timeout:1e3*60});dr.interceptors.request.use(i=>i,i=>Promise.reject(i)),dr.interceptors.response.use(i=>{var t,e;return+((t=i==null?void 0:i.data)==null?void 0:t.code)==500&&Gi.message.error({content:((e=i==null?void 0:i.data)==null?void 0:e.message)||"服务器异常",key:"SERVER_ERROR"}),i},i=>{if(i.message.includes("timeout"))Gi.message.error({content:"网络连接超时,请重试!",key:"TIMEOUT"});else{const{status:t}=i.response;t===401?Gi.message.error({content:"当前用户信息不正确",key:"REQUEST_ERROR"}):t>=500?Gi.message.error({content:"服务器异常",key:"REQUEST_ERROR"}):Gi.message.error({content:"请求异常",key:"REQUEST_ERROR"})}return Promise.reject(i)});var IT={},y7={get exports(){return IT},set exports(i){IT=i}};(function(i,t){(function(e,n){i.exports=n(Fo)})(cP,function(e){function n(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var o=n(e),r={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(s,l){return l==="W"?s+"周":s+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(s,l){var a=100*s+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return o.default.locale(r,null,!0),r})})(y7);const EX="",LX="",Ri=(i,t)=>{const e=i.__vccOpts||i;for(const[n,o]of t)e[n]=o;return e};Fo.locale("zh-cn");const _7=v.defineComponent({name:"PivotFilter",props:{data:{type:Object,default:()=>{}},customDimensions:{type:Array,default:()=>[]},dimensions:{type:Array,default:()=>[]},indicators:{type:Array,default:()=>[]}},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref(!1),r=v.ref(!1),s=v.ref([]),l=v.ref(""),a=v.ref(),h=v.ref(""),d=v.ref([]),u=v.ref(),c=v.ref("range"),g=v.ref(),f=v.ref({}),p=v.ref(),m=v.ref({}),b=v.inject("getContainer",()=>{}),C=v.inject("scaleValue",{}),_=v.inject("theme","light"),w=v.inject("pageId",""),y=v.inject("context",""),S=v.inject("indicatorUrl",""),R=v.inject("indicatorToken",""),A=v.inject("graphicConfig",{}),x=v.inject("theDateInfo",{}),T=[{label:"小于",value:"LESS"},{label:"小于等于",value:"LESS_EQUAL"},{label:"大于",value:"GREATER"},{label:"大于等于",value:"GREATER_EQUAL"},{label:"等于",value:"EQUAL"},{label:"不等于",value:"NOT_EQUAL"}],M=[{label:"单个日期",value:"date"},{label:"日期范围",value:"range"}],B=j=>{r.value=!1,s.value=j.target.checked?v.unref(d).map(G=>G.value):[]};v.watch(s,j=>{o.value=j.length===v.unref(d).length,r.value=!!j.length&&j.length<v.unref(d).length});const P=async j=>{var ht,_t;const{queryColumnList:G=[],edvDataSetId:Z="",source:et,dataSourceId:gt}=v.unref(A);let vt=G.find(ut=>ut.name===j||ut.label===j);vt||(vt=i.customDimensions.find(ut=>ut.name===j||ut.label===j));const it={},{search:nt}=(window==null?void 0:window.location)||{},Ct=nt.slice(1,nt.length).split("&");for(const ut of Ct)if(ut){const It=ut.split("=");if(It[0])if(It[0]==="userInfo")try{it.token=(_t=(ht=JSON.parse(decodeURIComponent(It[1])))==null?void 0:ht.baseInfo)==null?void 0:_t.hrpToken}catch(Ut){console.log(Ut)}else it[It[0]]=It[1]}const at=await dr.post(`${v.unref(S)}/diagram/groupvalue`,{source:et,groupColumn:j,hrpIndexTypeGuid:vt==null?void 0:vt.typeGuid,pageId:v.unref(w),pageFlag:!0,edvDataSetId:Z,dataSourceId:gt,extParam:it},{headers:{Authentication:v.unref(R),operateContext:v.unref(y)}}),{success:rt,data:ct=[]}=at.data;rt&&(d.value=ct.map(ut=>({value:ut})))},F=v.ref("");async function H(){const{filterData:j,type:G,key:Z}=i.data,gt=i.dimensions.concat(i.indicators).find(vt=>vt.label===Z);gt&&(F.value=gt.genericType),v.unref(F)==="DATE"?u.value="date":u.value="select",G==="dimension"?v.unref(u)==="select"?(await P(Z),Array.isArray(j)?s.value=j:s.value=(j==null?void 0:j.value)||[]):v.unref(u)==="date"&&(j==null?void 0:j.length)===2&&(a.value=[Fo(j[0].value),Fo(j[1].value)]):(l.value=(j==null?void 0:j.rule)||"",a.value=(j==null?void 0:j.value)||""),n.value=!0}const E=v.computed(()=>v.unref(x).dateFormat||"YYYY-MM-DD");function k(){var et;const{key:j,type:G}=i.data;let Z={};G==="dimension"?v.unref(u)==="select"?Z={rule:"IN",value:v.unref(s)}:v.unref(u)==="date"&&(v.unref(c)==="date"?Z={rule:"EQUAL",value:((et=v.unref(a))==null?void 0:et.format(v.unref(E)))||""}:v.unref(c)==="range"&&v.unref(a)&&(Z=[{rule:"GREATER_EQUAL",value:v.unref(a)[0].format(v.unref(E))},{rule:"LESS_EQUAL",value:v.unref(a)[1].format(v.unref(E))}])):Z={rule:v.unref(l),value:v.unref(a)},t("change",{checkKeys:Z,key:j,type:G}),n.value=!1}function I(){l.value="",a.value=null}const L=v.computed(()=>v.unref(_)==="darkBlue"?"#b2c3dd":""),D=()=>document.getElementsByClassName("filter-modal")[0]||document.body,O=j=>{var G,Z,et;if(j){const gt=(G=v.unref(g))==null?void 0:G.getBoundingClientRect();if(gt){const vt=gt.left/(((Z=v.unref(C))==null?void 0:Z.widthScale)||1)+"px",it=(gt.top+gt.height)/(((et=v.unref(C))==null?void 0:et.heightScale)||1)+"px";setTimeout(()=>{var Ct,at;const nt=document.querySelectorAll(".ant-select-dropdown"),bt=Array.from(nt).filter(rt=>window.getComputedStyle(rt).display!=="none");if(bt!=null&&bt.length){const rt=document.getElementsByClassName("filter-modal")[0];bt[0].classList.add("filter-select-dropdown"),(Ct=rt==null?void 0:rt.style)==null||Ct.setProperty("--drop-down-left",vt),(at=rt==null?void 0:rt.style)==null||at.setProperty("--drop-down-top",it),f.value={visibility:"visible"}}},200)}}else f.value={}},W=j=>{var G,Z,et;if(j){const gt=(G=v.unref(p))==null?void 0:G.getBoundingClientRect();if(gt){const vt=gt.left/(((Z=v.unref(C))==null?void 0:Z.widthScale)||1)+"px",it=(gt.top+gt.height)/(((et=v.unref(C))==null?void 0:et.heightScale)||1)+"px";setTimeout(()=>{var Ct,at;const nt=document.querySelectorAll(".pivot-table-range-date-dropdown"),bt=Array.from(nt).filter(rt=>window.getComputedStyle(rt).display!=="none");if(bt!=null&&bt.length){const rt=document.getElementsByClassName("filter-modal")[0];bt[0].classList.add("filter-range-picker-dropdown"),(Ct=rt==null?void 0:rt.style)==null||Ct.setProperty("--range-picker-dropdown-left",vt),(at=rt==null?void 0:rt.style)==null||at.setProperty("--range-picker-dropdown-top",it),m.value={visibility:"visible"}}},200)}}else m.value={}},N=v.computed(()=>{let j="270px";return v.unref(u)==="date"&&(j=""),{padding:"10px",height:j,maxHeight:"280px"}}),$=()=>{a.value=null};v.watch(n,j=>{window.modalShow&&window.modalShow(j)});const U=v.computed(()=>{let j="date";return v.unref(E).endsWith("MM")?j="month":v.unref(E).endsWith("YYYY")&&(j="year"),j}),Y=j=>{const{startTime:G,endTime:Z,rangeFormat:et}=v.unref(x);if(G&&Z){let gt="day";return et.endsWith("MM")?gt="month":et.endsWith("YYYY")&&(gt="year"),j&&gt&&(j<Fo(G).startOf(gt)||j>Fo(Z).endOf(gt))}else return!1};return e({showModal:H}),{visible:n,checkAllDimensions:o,dimIndeterminate:r,dimensionCheckKeys:s,ruleValue:l,ruleOptions:T,filterValue:a,searchDimName:h,fontColor:L,valueList:d,filterType:u,dateSelectType:c,bodyStyle:N,dateType:U,dateSelectOptions:M,formatStr:E,theme:_,handleOk:k,onCheckAllDimChange:B,handleClear:I,dropdownStyle:f,popupStyle:m,selectRef:g,rangePickerRef:p,getPopupContainer:D,onChangeSelectType:$,disabledDate:Y,getContainer:b,dropdownVisibleChange:O,openChange:W}}}),w7={class:"wrap-header"},S7={class:"wrap-body"},x7={style:{padding:"20px",display:"none"}},A7={ref:"selectRef",style:{display:"inline-block"}},R7={style:{padding:"10px 20px"}},T7={key:0,class:"ecan-date-picker"},M7={key:1,class:"ecan-range-picker",style:{display:"inline-block"},ref:"rangePickerRef"},B7={key:1},P7={style:{padding:"20px"}},H7={ref:"selectRef",style:{display:"inline-block"}},E7={style:{padding:"10px 20px"}};function L7(i,t,e,n,o,r){var p;const s=v.resolveComponent("a-checkbox"),l=v.resolveComponent("a-input"),a=v.resolveComponent("a-checkbox-group"),h=v.resolveComponent("a-select-option"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-date-picker"),c=v.resolveComponent("a-range-picker"),g=v.resolveComponent("a-button"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(f,{wrapClassName:i.theme+" filter-modal",visible:i.visible,"onUpdate:visible":t[9]||(t[9]=m=>i.visible=m),title:((p=i.data)==null?void 0:p.fieldName)+"-筛选","ok-text":"确认","cancel-text":"取消",bodyStyle:i.bodyStyle,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(g,{onClick:t[8]||(t[8]=m=>i.visible=!1)},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("取消")])),_:1}),i.data.type==="indicators"?(v.openBlock(),v.createBlock(g,{key:0,onClick:i.handleClear},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"])):v.createCommentVNode("",!0),v.createVNode(g,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[i.data.type==="dimension"?(v.openBlock(),v.createElementBlock("div",{key:0,class:v.normalizeClass(["dimension-wrap",i.filterType==="select"?"border":""])},[i.filterType==="select"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:0},[v.createElementVNode("div",w7,[v.createVNode(s,{checked:i.checkAllDimensions,"onUpdate:checked":t[0]||(t[0]=m=>i.checkAllDimensions=m),indeterminate:i.dimIndeterminate,disabled:!!i.searchDimName,onChange:i.onCheckAllDimChange},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"全选",4)]),_:1},8,["checked","indeterminate","disabled","onChange"]),v.createVNode(l,{value:i.searchDimName,"onUpdate:value":t[1]||(t[1]=m=>i.searchDimName=m),placeholder:"请输入关键字搜索",style:{width:"200px","margin-left":"15px"}},null,8,["value"])]),v.createElementVNode("div",S7,[v.createVNode(a,{value:i.dimensionCheckKeys,"onUpdate:value":t[2]||(t[2]=m=>i.dimensionCheckKeys=m),style:{width:"100%"}},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.valueList||[],(m,b)=>v.withDirectives((v.openBlock(),v.createElementBlock("div",{class:"body-item",key:b},[v.createVNode(s,{value:m.value},{default:v.withCtx(()=>[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(m.value),5)]),_:2},1032,["value"])])),[[v.vShow,!i.searchDimName||m.value.includes(i.searchDimName)]])),128))]),_:1},8,["value"])])],64)):i.filterType==="date"?(v.openBlock(),v.createElementBlock(v.Fragment,{key:1},[v.createElementVNode("div",x7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选类型:",4),v.createElementVNode("div",A7,[v.createVNode(d,{value:i.dateSelectType,"onUpdate:value":t[3]||(t[3]=m=>i.dateSelectType=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange,onChange:i.onChangeSelectType},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dateSelectOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange","onChange"])],512)]),v.createElementVNode("div",R7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),i.dateSelectType==="date"?(v.openBlock(),v.createElementBlock("span",T7,[v.createVNode(u,{dropdownClassName:"ecan-date-picker-dropdown",value:i.filterValue,"onUpdate:value":t[4]||(t[4]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,getPopupContainer:i.getPopupContainer},null,8,["value","picker","format","getPopupContainer"])])):i.dateSelectType==="range"?(v.openBlock(),v.createElementBlock("div",M7,[v.createVNode(c,{dropdownClassName:"ecan-range-picker-dropdown pivot-table-range-date-dropdown",value:i.filterValue,"onUpdate:value":t[5]||(t[5]=m=>i.filterValue=m),picker:i.dateType,format:i.formatStr,"disabled-date":i.disabledDate,getPopupContainer:i.getPopupContainer,popupStyle:i.popupStyle,onOpenChange:i.openChange},null,8,["value","picker","format","disabled-date","getPopupContainer","popupStyle","onOpenChange"])],512)):v.createCommentVNode("",!0)])],64)):v.createCommentVNode("",!0)],2)):i.data.type==="indicators"?(v.openBlock(),v.createElementBlock("div",B7,[v.createElementVNode("div",P7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选规则:",4),v.createElementVNode("div",H7,[v.createVNode(d,{value:i.ruleValue,"onUpdate:value":t[6]||(t[6]=m=>i.ruleValue=m),style:{width:"200px"},placeholder:"请选择",dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},{default:v.withCtx(()=>[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.ruleOptions,m=>(v.openBlock(),v.createBlock(h,{key:m.value,value:m.value},{default:v.withCtx(()=>[v.createTextVNode(v.toDisplayString(m.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),v.createElementVNode("div",E7,[v.createElementVNode("span",{class:"filter-label",style:v.normalizeStyle({color:i.fontColor})},"筛选值:",4),v.createVNode(l,{value:i.filterValue,"onUpdate:value":t[7]||(t[7]=m=>i.filterValue=m),placeholder:"请输入",style:{width:"200px"}},null,8,["value"])])])):v.createCommentVNode("",!0)]),_:1},8,["wrapClassName","visible","title","bodyStyle","getContainer","onOk"])}const DT=Ri(_7,[["render",L7],["__scopeId","data-v-8f8e78da"]]),kX="",k7=v.defineComponent({name:"PivotProperty",props:{},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref({unit:"",format:"",floatLength:""}),r=v.ref(),s=v.ref({}),l=v.inject("theme","light"),a=v.inject("scaleValue",{}),h=v.inject("getContainer",()=>{}),d=[{label:"整数",value:"integer"},{label:"小数",value:"float"},{label:"百分比",value:"percent"}];function u(p){o.value=p,n.value=!0}function c(){t("change",v.unref(o)),n.value=!1}const g=()=>document.getElementsByClassName("property-modal")[0]||document.body,f=p=>{var m,b,C;if(p){const _=(m=v.unref(r))==null?void 0:m.getBoundingClientRect();if(_){const w=_.left/(((b=v.unref(a))==null?void 0:b.widthScale)||1)+"px",y=(_.top+_.height)/(((C=v.unref(a))==null?void 0:C.heightScale)||1)+"px";setTimeout(()=>{var A,x;const S=document.querySelectorAll(".ant-select-dropdown"),R=Array.from(S).filter(T=>window.getComputedStyle(T).display!=="none");if(R!=null&&R.length){const T=document.getElementsByClassName("property-modal")[0];R[0].classList.add("property-select-dropdown"),(A=T==null?void 0:T.style)==null||A.setProperty("--drop-down-left",w),(x=T==null?void 0:T.style)==null||x.setProperty("--drop-down-top",y),s.value={visibility:"visible"}}},200)}}else s.value={}};return v.watch(n,p=>{window.modalShow&&window.modalShow(p)}),e({showModal:u}),{theme:l,visible:n,formData:o,handleOk:c,getPopupContainer:g,formatOptions:d,getContainer:h,selectRef:r,dropdownStyle:s,dropdownVisibleChange:f}}}),F7={ref:"selectRef"};function I7(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-radio-button"),h=v.resolveComponent("a-radio-group"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form"),c=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(c,{wrapClassName:i.theme+" property-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",title:i.formData.fieldName+"-度量属性",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(u,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"度量单位"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.formData.unit,"onUpdate:value":t[0]||(t[0]=g=>i.formData.unit=g)},null,8,["value"])]),_:1}),i.formData.unit?(v.openBlock(),v.createBlock(l,{key:0,label:"度量单位位置"},{default:v.withCtx(()=>[v.createVNode(h,{value:i.formData.position,"onUpdate:value":t[1]||(t[1]=g=>i.formData.position=g),"button-style":"solid"},{default:v.withCtx(()=>[v.createVNode(a,{value:"left"},{default:v.withCtx(()=>t[5]||(t[5]=[v.createTextVNode("数据左侧")])),_:1}),v.createVNode(a,{value:"right"},{default:v.withCtx(()=>t[6]||(t[6]=[v.createTextVNode("数据右侧")])),_:1})]),_:1},8,["value"])]),_:1})):v.createCommentVNode("",!0),v.createVNode(l,{label:"格式化"},{default:v.withCtx(()=>[v.createElementVNode("div",F7,[v.createVNode(d,{value:i.formData.format,"onUpdate:value":t[2]||(t[2]=g=>i.formData.format=g),options:i.formatOptions,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),["float","percent"].includes(i.formData.format)?(v.openBlock(),v.createBlock(l,{key:1,label:"小数位数"},{default:v.withCtx(()=>[v.createVNode(s,{type:"number",value:i.formData.floatLength,"onUpdate:value":t[3]||(t[3]=g=>i.formData.floatLength=g),min:0},null,8,["value"])]),_:1})):v.createCommentVNode("",!0)]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const D7=Ri(k7,[["render",I7]]);function $n(i,t){O7(i)&&(i="100%");var e=z7(i);return i=t===360?i:Math.min(t,Math.max(0,parseFloat(i))),e&&(i=parseInt(String(i*t),10)/100),Math.abs(i-t)<1e-6?1:(t===360?i=(i<0?i%t+t:i%t)/parseFloat(String(t)):i=i%t/parseFloat(String(t)),i)}function O7(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function z7(i){return typeof i=="string"&&i.indexOf("%")!==-1}function N7(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function jg(i){return i<=1?"".concat(Number(i)*100,"%"):i}function vv(i){return i.length===1?"0"+i:String(i)}function W7(i,t,e){return{r:$n(i,255)*255,g:$n(t,255)*255,b:$n(e,255)*255}}function bv(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*(6*e):e<1/2?t:e<2/3?i+(t-i)*(2/3-e)*6:i}function V7(i,t,e){var n,o,r;if(i=$n(i,360),t=$n(t,100),e=$n(e,100),t===0)o=e,r=e,n=e;else{var s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;n=bv(l,s,i+1/3),o=bv(l,s,i),r=bv(l,s,i-1/3)}return{r:n*255,g:o*255,b:r*255}}function j7(i,t,e){i=$n(i,255),t=$n(t,255),e=$n(e,255);var n=Math.max(i,t,e),o=Math.min(i,t,e),r=0,s=n,l=n-o,a=n===0?0:l/n;if(n===o)r=0;else{switch(n){case i:r=(t-e)/l+(t<e?6:0);break;case t:r=(e-i)/l+2;break;case e:r=(i-t)/l+4;break}r/=6}return{h:r,s:a,v:s}}function $7(i,t,e){i=$n(i,360)*6,t=$n(t,100),e=$n(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:h*255,g:d*255,b:u*255}}function G7(i,t,e,n){var o=[vv(Math.round(i).toString(16)),vv(Math.round(t).toString(16)),vv(Math.round(e).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function OT(i){return Sn(i)/255}function Sn(i){return parseInt(i,16)}var zT={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function zh(i){var t={r:0,g:0,b:0},e=1,n=null,o=null,r=null,s=!1,l=!1;return typeof i=="string"&&(i=Y7(i)),typeof i=="object"&&(ur(i.r)&&ur(i.g)&&ur(i.b)?(t=W7(i.r,i.g,i.b),s=!0,l=String(i.r).substr(-1)==="%"?"prgb":"rgb"):ur(i.h)&&ur(i.s)&&ur(i.v)?(n=jg(i.s),o=jg(i.v),t=$7(i.h,n,o),s=!0,l="hsv"):ur(i.h)&&ur(i.s)&&ur(i.l)&&(n=jg(i.s),r=jg(i.l),t=V7(i.h,n,r),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(e=i.a)),e=N7(e),{ok:s,format:i.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}var U7="[-\\+]?\\d+%?",K7="[-\\+]?\\d*\\.\\d+%?",Wr="(?:".concat(K7,")|(?:").concat(U7,")"),Cv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),yv="[\\s|\\(]+(".concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")[,|\\s]+(").concat(Wr,")\\s*\\)?"),po={CSS_UNIT:new RegExp(Wr),rgb:new RegExp("rgb"+Cv),rgba:new RegExp("rgba"+yv),hsl:new RegExp("hsl"+Cv),hsla:new RegExp("hsla"+yv),hsv:new RegExp("hsv"+Cv),hsva:new RegExp("hsva"+yv),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Y7(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var t=!1;if(zT[i])i=zT[i],t=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e=po.rgb.exec(i);return e?{r:e[1],g:e[2],b:e[3]}:(e=po.rgba.exec(i),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=po.hsl.exec(i),e?{h:e[1],s:e[2],l:e[3]}:(e=po.hsla.exec(i),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=po.hsv.exec(i),e?{h:e[1],s:e[2],v:e[3]}:(e=po.hsva.exec(i),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=po.hex8.exec(i),e?{r:Sn(e[1]),g:Sn(e[2]),b:Sn(e[3]),a:OT(e[4]),format:t?"name":"hex8"}:(e=po.hex6.exec(i),e?{r:Sn(e[1]),g:Sn(e[2]),b:Sn(e[3]),format:t?"name":"hex"}:(e=po.hex4.exec(i),e?{r:Sn(e[1]+e[1]),g:Sn(e[2]+e[2]),b:Sn(e[3]+e[3]),a:OT(e[4]+e[4]),format:t?"name":"hex8"}:(e=po.hex3.exec(i),e?{r:Sn(e[1]+e[1]),g:Sn(e[2]+e[2]),b:Sn(e[3]+e[3]),format:t?"name":"hex"}:!1)))))))))}function ur(i){return!!po.CSS_UNIT.exec(String(i))}var $g=2,NT=.16,X7=.05,q7=.05,Z7=.15,WT=5,VT=4,J7=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function jT(i){var t=i.r,e=i.g,n=i.b,o=j7(t,e,n);return{h:o.h*360,s:o.s,v:o.v}}function Gg(i){var t=i.r,e=i.g,n=i.b;return"#".concat(G7(t,e,n,!1))}function Q7(i,t,e){var n=e/100,o={r:(t.r-i.r)*n+i.r,g:(t.g-i.g)*n+i.g,b:(t.b-i.b)*n+i.b};return o}function $T(i,t,e){var n;return Math.round(i.h)>=60&&Math.round(i.h)<=240?n=e?Math.round(i.h)-$g*t:Math.round(i.h)+$g*t:n=e?Math.round(i.h)+$g*t:Math.round(i.h)-$g*t,n<0?n+=360:n>=360&&(n-=360),n}function GT(i,t,e){if(i.h===0&&i.s===0)return i.s;var n;return e?n=i.s-NT*t:t===VT?n=i.s+NT:n=i.s+X7*t,n>1&&(n=1),e&&t===WT&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function UT(i,t,e){var n;return e?n=i.v+q7*t:n=i.v-Z7*t,n>1&&(n=1),Number(n.toFixed(2))}function _v(i){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=zh(i),o=WT;o>0;o-=1){var r=jT(n),s=Gg(zh({h:$T(r,o,!0),s:GT(r,o,!0),v:UT(r,o,!0)}));e.push(s)}e.push(Gg(n));for(var l=1;l<=VT;l+=1){var a=jT(n),h=Gg(zh({h:$T(a,l),s:GT(a,l),v:UT(a,l)}));e.push(h)}return t.theme==="dark"?J7.map(function(d){var u=d.index,c=d.opacity,g=Gg(Q7(zh(t.backgroundColor||"#141414"),zh(e[u]),c*100));return g}):e}var wv={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Sv={},xv={};Object.keys(wv).forEach(function(i){Sv[i]=_v(wv[i]),Sv[i].primary=Sv[i][5],xv[i]=_v(wv[i],{theme:"dark",backgroundColor:"#141414"}),xv[i].primary=xv[i][5]});var KT=[],Nh=[],tj="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function ej(){var i=document.createElement("style");return i.setAttribute("type","text/css"),i}function ij(i,t){if(t=t||{},i===void 0)throw new Error(tj);var e=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),o=KT.indexOf(n);o===-1&&(o=KT.push(n)-1,Nh[o]={});var r;return Nh[o]!==void 0&&Nh[o][e]!==void 0?r=Nh[o][e]:(r=Nh[o][e]=ej(),e==="prepend"?n.insertBefore(r,n.childNodes[0]):n.appendChild(r)),i.charCodeAt(0)===65279&&(i=i.substr(1,i.length)),r.styleSheet?r.styleSheet.cssText+=i:r.textContent+=i,r}function YT(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){nj(i,o,e[o])})}return i}function nj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function oj(i,t){process.env.NODE_ENV!=="production"&&!i&&console!==void 0&&console.error("Warning: ".concat(t))}function rj(i,t){oj(i,"[@ant-design/icons-vue] ".concat(t))}function XT(i){return typeof i=="object"&&typeof i.name=="string"&&typeof i.theme=="string"&&(typeof i.icon=="object"||typeof i.icon=="function")}function Av(i,t,e){return e?v.h(i.tag,YT({key:t},e,i.attrs),(i.children||[]).map(function(n,o){return Av(n,"".concat(t,"-").concat(i.tag,"-").concat(o))})):v.h(i.tag,YT({key:t},i.attrs),(i.children||[]).map(function(n,o){return Av(n,"".concat(t,"-").concat(i.tag,"-").concat(o))}))}function qT(i){return _v(i)[0]}function ZT(i){return i?Array.isArray(i)?i:[i]:[]}var sj=`
310
310
  .anticon {
311
311
  display: inline-block;
312
312
  color: inherit;
@@ -364,7 +364,7 @@
364
364
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mj(i,t){if(i){if(typeof i=="string")return QT(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return QT(i,t)}}function QT(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function vj(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function bj(i){if(Array.isArray(i))return i}function tM(i){var t=ZT(i),e=fj(t,2),n=e[0],o=e[1];return Rv.setTwoToneColors({primaryColor:n,secondaryColor:o})}function Cj(){var i=Rv.getTwoToneColors();return i.calculated?[i.primaryColor,i.secondaryColor]:i.primaryColor}var yj=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function _j(i,t){return Aj(i)||xj(i,t)||Sj(i,t)||wj()}function wj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
365
365
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sj(i,t){if(i){if(typeof i=="string")return eM(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eM(i,t)}}function eM(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=i[e];return n}function xj(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var n=[],o=!0,r=!1,s,l;try{for(e=e.call(i);!(o=(s=e.next()).done)&&(n.push(s.value),!(t&&n.length===t));o=!0);}catch(a){r=!0,l=a}finally{try{!o&&e.return!=null&&e.return()}finally{if(r)throw l}}return n}}function Aj(i){if(Array.isArray(i))return i}function iM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Tv(i,o,e[o])})}return i}function Tv(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function Rj(i,t){if(i==null)return{};var e=Tj(i,t),n,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(e[n]=i[n])}return e}function Tj(i,t){if(i==null)return{};var e={},n=Object.keys(i),o,r;for(r=0;r<n.length;r++)o=n[r],!(t.indexOf(o)>=0)&&(e[o]=i[o]);return e}tM("#1890ff");var zl=function(t,e){var n,o=iM({},t,e.attrs),r=o.class,s=o.icon,l=o.spin,a=o.rotate,h=o.tabindex,d=o.twoToneColor,u=o.onClick,c=Rj(o,yj),g=(n={anticon:!0},Tv(n,"anticon-".concat(s.name),!!s.name),Tv(n,r,r),n),f=l===""||l||s.name==="loading"?"anticon-spin":"",p=h;p===void 0&&u&&(p=-1,c.tabindex=p);var m=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,b=ZT(d),C=_j(b,2),_=C[0],w=C[1];return v.createVNode("span",iM({role:"img","aria-label":s.name},c,{onClick:u,class:g}),[v.createVNode(Rv,{class:f,icon:s,primaryColor:_,secondaryColor:w,style:m},null)])};zl.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String},zl.displayName="AntdIcon",zl.inheritAttrs=!1,zl.getTwoToneColor=Cj,zl.setTwoToneColor=tM;const fi=zl;var Mj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L863.9 169a7.9 7.9 0 00-8.9-8.9zM416.6 562.3a8.03 8.03 0 00-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}}]},name:"arrows-alt",theme:"outlined"};const Bj=Mj;function nM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Pj(i,o,e[o])})}return i}function Pj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Mv=function(t,e){var n=nM({},t,e.attrs);return v.createVNode(fi,nM({},n,{icon:Bj}),null)};Mv.displayName="ArrowsAltOutlined",Mv.inheritAttrs=!1;const Hj=Mv;var Ej={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"border",theme:"outlined"};const Lj=Ej;function oM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){kj(i,o,e[o])})}return i}function kj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bv=function(t,e){var n=oM({},t,e.attrs);return v.createVNode(fi,oM({},n,{icon:Lj}),null)};Bv.displayName="BorderOutlined",Bv.inheritAttrs=!1;const rM=Bv;var Fj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const Ij=Fj;function sM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Dj(i,o,e[o])})}return i}function Dj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Pv=function(t,e){var n=sM({},t,e.attrs);return v.createVNode(fi,sM({},n,{icon:Ij}),null)};Pv.displayName="CaretDownOutlined",Pv.inheritAttrs=!1;const Oj=Pv;var zj={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"}}]},name:"caret-right",theme:"outlined"};const Nj=zj;function lM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Wj(i,o,e[o])})}return i}function Wj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Hv=function(t,e){var n=lM({},t,e.attrs);return v.createVNode(fi,lM({},n,{icon:Nj}),null)};Hv.displayName="CaretRightOutlined",Hv.inheritAttrs=!1;const Vj=Hv;var jj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"};const $j=jj;function aM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Gj(i,o,e[o])})}return i}function Gj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ev=function(t,e){var n=aM({},t,e.attrs);return v.createVNode(fi,aM({},n,{icon:$j}),null)};Ev.displayName="ClearOutlined",Ev.inheritAttrs=!1;const Uj=Ev;var Kj={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"};const Yj=Kj;function hM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Xj(i,o,e[o])})}return i}function Xj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Lv=function(t,e){var n=hM({},t,e.attrs);return v.createVNode(fi,hM({},n,{icon:Yj}),null)};Lv.displayName="CloseOutlined",Lv.inheritAttrs=!1;const dM=Lv;var qj={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};const Zj=qj;function uM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){Jj(i,o,e[o])})}return i}function Jj(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var kv=function(t,e){var n=uM({},t,e.attrs);return v.createVNode(fi,uM({},n,{icon:Zj}),null)};kv.displayName="DatabaseOutlined",kv.inheritAttrs=!1;const Qj=kv;var t$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const e$=t$;function cM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){i$(i,o,e[o])})}return i}function i$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Fv=function(t,e){var n=cM({},t,e.attrs);return v.createVNode(fi,cM({},n,{icon:e$}),null)};Fv.displayName="DeleteOutlined",Fv.inheritAttrs=!1;const gM=Fv;var n$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};const o$=n$;function fM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){r$(i,o,e[o])})}return i}function r$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Iv=function(t,e){var n=fM({},t,e.attrs);return v.createVNode(fi,fM({},n,{icon:o$}),null)};Iv.displayName="FilterOutlined",Iv.inheritAttrs=!1;const pM=Iv;var s$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 512h-56c-4.4 0-8 3.6-8 8v320H184V184h320c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V520c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M355.9 534.9L354 653.8c-.1 8.9 7.1 16.2 16 16.2h.4l118-2.9c2-.1 4-.9 5.4-2.3l415.9-415c3.1-3.1 3.1-8.2 0-11.3L785.4 114.3c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-415.8 415a8.3 8.3 0 00-2.3 5.6zm63.5 23.6L779.7 199l45.2 45.1-360.5 359.7-45.7 1.1.7-46.4z"}}]},name:"form",theme:"outlined"};const l$=s$;function mM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){a$(i,o,e[o])})}return i}function a$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Dv=function(t,e){var n=mM({},t,e.attrs);return v.createVNode(fi,mM({},n,{icon:l$}),null)};Dv.displayName="FormOutlined",Dv.inheritAttrs=!1;const vM=Dv;var h$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M878.7 336H145.3c-18.4 0-33.3 14.3-33.3 32v464c0 17.7 14.9 32 33.3 32h733.3c18.4 0 33.3-14.3 33.3-32V368c.1-17.7-14.8-32-33.2-32zM360 792H184V632h176v160zm0-224H184V408h176v160zm240 224H424V632h176v160zm0-224H424V408h176v160zm240 224H664V632h176v160zm0-224H664V408h176v160zm64-408H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"insert-row-above",theme:"outlined"};const d$=h$;function bM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){u$(i,o,e[o])})}return i}function u$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Ov=function(t,e){var n=bM({},t,e.attrs);return v.createVNode(fi,bM({},n,{icon:d$}),null)};Ov.displayName="InsertRowAboveOutlined",Ov.inheritAttrs=!1;const c$=Ov;var g$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M248 112h-80c-4.4 0-8 3.6-8 8v784c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8V120c0-4.4-3.6-8-8-8zm584 0H368c-17.7 0-32 14.9-32 33.3v733.3c0 18.4 14.3 33.3 32 33.3h464c17.7 0 32-14.9 32-33.3V145.3c0-18.4-14.3-33.3-32-33.3zM568 840H408V664h160v176zm0-240H408V424h160v176zm0-240H408V184h160v176zm224 480H632V664h160v176zm0-240H632V424h160v176zm0-240H632V184h160v176z"}}]},name:"insert-row-left",theme:"outlined"};const f$=g$;function CM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){p$(i,o,e[o])})}return i}function p$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var zv=function(t,e){var n=CM({},t,e.attrs);return v.createVNode(fi,CM({},n,{icon:f$}),null)};zv.displayName="InsertRowLeftOutlined",zv.inheritAttrs=!1;const m$=zv;var v$={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const b$=v$;function yM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){C$(i,o,e[o])})}return i}function C$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Nv=function(t,e){var n=yM({},t,e.attrs);return v.createVNode(fi,yM({},n,{icon:b$}),null)};Nv.displayName="LoadingOutlined",Nv.inheritAttrs=!1;const y$=Nv;var _$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"};const w$=_$;function _M(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){S$(i,o,e[o])})}return i}function S$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Wv=function(t,e){var n=_M({},t,e.attrs);return v.createVNode(fi,_M({},n,{icon:w$}),null)};Wv.displayName="MinusCircleOutlined",Wv.inheritAttrs=!1;const wM=Wv;var x$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const A$=x$;function SM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){R$(i,o,e[o])})}return i}function R$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Vv=function(t,e){var n=SM({},t,e.attrs);return v.createVNode(fi,SM({},n,{icon:A$}),null)};Vv.displayName="MinusSquareOutlined",Vv.inheritAttrs=!1;const T$=Vv;var M$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const B$=M$;function xM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){P$(i,o,e[o])})}return i}function P$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var jv=function(t,e){var n=xM({},t,e.attrs);return v.createVNode(fi,xM({},n,{icon:B$}),null)};jv.displayName="PlusCircleOutlined",jv.inheritAttrs=!1;const AM=jv;var H$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const E$=H$;function RM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){L$(i,o,e[o])})}return i}function L$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var $v=function(t,e){var n=RM({},t,e.attrs);return v.createVNode(fi,RM({},n,{icon:E$}),null)};$v.displayName="SettingOutlined",$v.inheritAttrs=!1;const k$=$v;var F$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M881.7 187.4l-45.1-45.1a8.03 8.03 0 00-11.3 0L667.8 299.9l-54.7-54.7a7.94 7.94 0 00-13.5 4.7L576.1 439c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 157.6-157.6c3-3 3-8.1-.1-11.2zM439 576.1l-189.2 23.5c-6.6.8-9.3 8.9-4.7 13.5l54.7 54.7-157.5 157.5a8.03 8.03 0 000 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l157.6-157.6 54.7 54.7a7.94 7.94 0 0013.5-4.7L447.9 585a7.9 7.9 0 00-8.9-8.9z"}}]},name:"shrink",theme:"outlined"};const I$=F$;function TM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){D$(i,o,e[o])})}return i}function D$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Gv=function(t,e){var n=TM({},t,e.attrs);return v.createVNode(fi,TM({},n,{icon:I$}),null)};Gv.displayName="ShrinkOutlined",Gv.inheritAttrs=!1;const O$=Gv;var z$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z"}}]},name:"sliders",theme:"outlined"};const N$=z$;function MM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){W$(i,o,e[o])})}return i}function W$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Uv=function(t,e){var n=MM({},t,e.attrs);return v.createVNode(fi,MM({},n,{icon:N$}),null)};Uv.displayName="SlidersOutlined",Uv.inheritAttrs=!1;const V$=Uv;var j$={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M752 240H144c-17.7 0-32 14.3-32 32v608c0 17.7 14.3 32 32 32h608c17.7 0 32-14.3 32-32V272c0-17.7-14.3-32-32-32zm-40 600H184V312h528v528zm168-728H264c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h576v576c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V144c0-17.7-14.3-32-32-32zM300 550h296v64H300z"}}]},name:"switcher",theme:"outlined"};const $$=j$;function BM(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(e).filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.forEach(function(o){G$(i,o,e[o])})}return i}function G$(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Kv=function(t,e){var n=BM({},t,e.attrs);return v.createVNode(fi,BM({},n,{icon:$$}),null)};Kv.displayName="SwitcherOutlined",Kv.inheritAttrs=!1;const PM=Kv,FX="",U$=v.defineComponent({name:"ConditionalItemConfig",components:{PlusCircleOutlined:AM,FormOutlined:vM,MinusCircleOutlined:wM},props:{config:{type:Array,default(){return[]}}},setup(i,{emit:t}){const e=v.ref("add"),n=v.ref(!1),o=v.ref(-1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light");v.watch(o,()=>{t("change",v.unref(o))});const l=v.ref("");function a(){e.value="add",l.value="",n.value=!0}function h(){if(v.unref(o)===-1){Gi.message.info("请选择要修改的条件项");return}e.value="edit",l.value=i.config[v.unref(o)].name,n.value=!0}function d(){if(v.unref(o)===-1){Gi.message.info("请选择要删除的条件项");return}i.config.splice(v.unref(o),1),o.value=-1}function u(){v.unref(e)==="add"?i.config.push({name:v.unref(l),conditions:[]}):i.config[v.unref(o)].name=v.unref(l),n.value=!1}const c=v.computed(()=>v.unref(s)==="darkBlue"?"#b2c3dd":"");return v.watch(n,g=>{g&&window.modalShow&&window.modalShow(g)}),{theme:s,modalType:e,visible:n,selectedIndex:o,addItem:a,name:l,handleOk:u,editItem:h,deleteItem:d,fontColor:c,getContainer:r}}}),K$={class:"content"},Y$={style:{display:"flex","align-items":"center"}},X$={class:"list"},q$=["onClick"];function Z$(i,t,e,n,o,r){const s=v.resolveComponent("plus-circle-outlined"),l=v.resolveComponent("a-button"),a=v.resolveComponent("form-outlined"),h=v.resolveComponent("minus-circle-outlined"),d=v.resolveComponent("a-input"),u=v.resolveComponent("a-form-item"),c=v.resolveComponent("a-form"),g=v.resolveComponent("a-modal");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",K$,[v.createElementVNode("div",Y$,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},"条件项配置",4),v.createElementVNode("div",null,[v.createVNode(l,{class:"condition-button",onClick:i.addItem},{default:v.withCtx(()=>[v.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick"]),v.createVNode(l,{class:"condition-button",onClick:i.editItem},{default:v.withCtx(()=>[v.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick"]),v.createVNode(l,{class:"condition-button",onClick:i.deleteItem},{default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick"])])]),v.createElementVNode("div",X$,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.config,(f,p)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["list-item",i.selectedIndex===p?"active":""]),key:p,onClick:m=>i.selectedIndex=p,style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(f.name),15,q$))),128))])]),v.createVNode(g,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=f=>i.visible=f),title:i.modalType==="add"?"添加条件项":"修改条件项","ok-text":"确认","cancel-text":"取消",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(c,{name:"conditionItem"},{default:v.withCtx(()=>[v.createVNode(u,{label:"条件项名称"},{default:v.withCtx(()=>[v.createVNode(d,{value:i.name,"onUpdate:value":t[0]||(t[0]=f=>i.name=f)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])],64)}const J$=Ri(U$,[["render",Z$],["__scopeId","data-v-1b06e44c"]]),IX="",DX="",Q$=v.defineComponent({name:"ConditionalConfig",components:{PlusCircleOutlined:AM,FormOutlined:vM,MinusCircleOutlined:wM},props:{config:{type:Array,default(){return[]}},isSelected:{type:Boolean}},setup(i){const t=v.ref("add"),e=v.ref(!1),n=v.ref(-1),o=v.ref({}),r=v.ref(!1),s=v.ref(),l=v.ref(),a=v.ref(),h=v.ref({}),d=v.inject("theme","light"),u=v.inject("getContainer",()=>{}),c=v.inject("scaleValue",{}),g=v.computed(()=>A=>{const x=`当前值 ${A.operation} ${A.value}`;return A.join?`${A.join} ${x}`:x});v.watch(()=>i.config,()=>{n.value=-1});const f=[{label:"与",value:"and"},{label:"或",value:"or"}],p=[{label:"大于",value:">"},{label:"大于等于",value:">="},{label:"小于",value:"<"},{label:"小于等于",value:"<="},{label:"等于",value:"=="},{label:"不等于",value:"!="}],m={operation:[{required:!0,message:"操作符不能为空"}],value:[{required:!0,message:"值不能为空"}]};function b(){t.value="add",r.value=i.config.length>0,v.unref(r)?o.value={join:"and",operation:"",value:""}:o.value={operation:"",value:""},e.value=!0}function C(){if(v.unref(n)===-1){Gi.message.info("请选择要修改的条件配置");return}t.value="edit",r.value=v.unref(n)!==0,o.value=i.config[v.unref(n)],e.value=!0}function _(){if(v.unref(n)===-1){Gi.message.info("请选择要删除的条件配置");return}i.config.splice(v.unref(n),1),n.value=-1}function w(){v.unref(s).validateFields().then(()=>{v.unref(t)==="add"?i.config.push(v.unref(o)):i.config[v.unref(n)]=v.unref(o),e.value=!1}).catch(()=>{})}const y=v.computed(()=>i.theme==="darkBlue"?"#b2c3dd":""),S=()=>document.getElementsByClassName("update-config-modal")[0]||document.body,R=(A,x="")=>{var T,M,B,P;if(A){let F=(T=v.unref(l))==null?void 0:T.getBoundingClientRect();if(x==="join"&&(F=(M=v.unref(a))==null?void 0:M.getBoundingClientRect()),F){const H=F.left/(((B=v.unref(c))==null?void 0:B.widthScale)||1)+"px",E=(F.top+F.height)/(((P=v.unref(c))==null?void 0:P.heightScale)||1)+"px";setTimeout(()=>{var L,D;const k=document.querySelectorAll(".ant-select-dropdown"),I=Array.from(k).filter(O=>window.getComputedStyle(O).display!=="none");if(I!=null&&I.length){let O="update-config-select-dropdown";x==="join"&&(O="update-config-join-select-dropdown");const W=document.getElementsByClassName("update-config-modal")[0];I[0].classList.remove("update-config-select-dropdown"),I[0].classList.remove("update-config-join-select-dropdown"),I[0].classList.add(O),(L=W==null?void 0:W.style)==null||L.setProperty(`--${x?x+"-":""}drop-down-left`,H),(D=W==null?void 0:W.style)==null||D.setProperty(`--${x?x+"-":""}drop-down-top`,E),h.value={visibility:"visible"}}},200)}}else h.value={}};return v.watch(e,A=>{A&&window.modalShow&&window.modalShow(A)}),{theme:d,modalType:t,visible:e,selectedIndex:n,addItem:b,handleOk:w,editItem:C,deleteItem:_,operateOptions:p,formData:o,joinOptions:f,isShowJoin:r,formRules:m,formRef:s,conditionTitle:g,fontColor:y,dropdownStyle:h,selectRef:l,joinSelectRef:a,getPopupContainer:S,getContainer:u,dropdownVisibleChange:R}}}),tG={class:"content"},eG={style:{display:"flex","align-items":"center"}},iG={class:"list"},nG=["onClick"],oG={ref:"joinSelectRef"},rG={ref:"selectRef"};function sG(i,t,e,n,o,r){const s=v.resolveComponent("plus-circle-outlined"),l=v.resolveComponent("a-button"),a=v.resolveComponent("form-outlined"),h=v.resolveComponent("minus-circle-outlined"),d=v.resolveComponent("a-select"),u=v.resolveComponent("a-form-item"),c=v.resolveComponent("a-input"),g=v.resolveComponent("a-form"),f=v.resolveComponent("a-modal");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",tG,[v.createElementVNode("div",eG,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},"条件配置",4),v.createElementVNode("div",null,[v.createVNode(l,{class:"condition-button",onClick:i.addItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(s,{class:"add-icon"})]),_:1},8,["onClick","disabled"]),v.createVNode(l,{class:"condition-button",onClick:i.editItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(a,{class:"edit-icon"})]),_:1},8,["onClick","disabled"]),v.createVNode(l,{class:"condition-button",onClick:i.deleteItem,disabled:!i.isSelected},{default:v.withCtx(()=>[v.createVNode(h,{class:"delete-icon"})]),_:1},8,["onClick","disabled"])])]),v.createElementVNode("div",iG,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.config,(p,m)=>(v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["list-item",i.selectedIndex===m?"active":""]),key:m,onClick:b=>i.selectedIndex=m,style:v.normalizeStyle({color:i.fontColor})},v.toDisplayString(i.conditionTitle(p)),15,nG))),128))])]),v.createVNode(f,{wrapClassName:i.theme+" update-config-modal",visible:i.visible,"onUpdate:visible":t[4]||(t[4]=p=>i.visible=p),title:i.modalType==="add"?"添加条件配置":"修改条件配置","ok-text":"确认","cancel-text":"取消",destroyOnClose:!1,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(g,{model:i.formData,rules:i.formRules,ref:"formRef"},{default:v.withCtx(()=>[i.isShowJoin?(v.openBlock(),v.createBlock(u,{key:0,label:"与上一条件关系",name:"join",required:!0},{default:v.withCtx(()=>[v.createElementVNode("div",oG,[v.createVNode(d,{options:i.joinOptions,value:i.formData.join,"onUpdate:value":t[0]||(t[0]=p=>i.formData.join=p),dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:t[1]||(t[1]=p=>i.dropdownVisibleChange(p,"join"))},null,8,["options","value","getPopupContainer","dropdownStyle"])],512)]),_:1})):v.createCommentVNode("",!0),v.createVNode(u,{label:"操作符",name:"operation",required:!0},{default:v.withCtx(()=>[v.createElementVNode("div",rG,[v.createVNode(d,{options:i.operateOptions,value:i.formData.operation,"onUpdate:value":t[2]||(t[2]=p=>i.formData.operation=p),dropdownClassName:"pivot-table-select-dropdown",getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["options","value","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1}),v.createVNode(u,{label:"值",name:"value",required:!0},{default:v.withCtx(()=>[v.createVNode(c,{type:"number",value:i.formData.value,"onUpdate:value":t[3]||(t[3]=p=>i.formData.value=p),style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])],64)}const lG=Ri(Q$,[["render",sG],["__scopeId","data-v-580c2bff"]]);var ln="top",Gn="bottom",Un="right",an="left",Yv="auto",Vh=[ln,Gn,Un,an],Nl="start",jh="end",aG="clippingParents",HM="viewport",$h="popper",hG="reference",EM=Vh.reduce(function(i,t){return i.concat([t+"-"+Nl,t+"-"+jh])},[]),LM=[].concat(Vh,[Yv]).reduce(function(i,t){return i.concat([t,t+"-"+Nl,t+"-"+jh])},[]),dG="beforeRead",uG="read",cG="afterRead",gG="beforeMain",fG="main",pG="afterMain",mG="beforeWrite",vG="write",bG="afterWrite",CG=[dG,uG,cG,gG,fG,pG,mG,vG,bG];function Bo(i){return i?(i.nodeName||"").toLowerCase():null}function xn(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var t=i.ownerDocument;return t&&t.defaultView||window}return i}function Hs(i){var t=xn(i).Element;return i instanceof t||i instanceof Element}function Kn(i){var t=xn(i).HTMLElement;return i instanceof t||i instanceof HTMLElement}function Xv(i){if(typeof ShadowRoot>"u")return!1;var t=xn(i).ShadowRoot;return i instanceof t||i instanceof ShadowRoot}function yG(i){var t=i.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];!Kn(r)||!Bo(r)||(Object.assign(r.style,n),Object.keys(o).forEach(function(s){var l=o[s];l===!1?r.removeAttribute(s):r.setAttribute(s,l===!0?"":l)}))})}function _G(i){var t=i.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],r=t.attributes[n]||{},s=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:e[n]),l=s.reduce(function(a,h){return a[h]="",a},{});!Kn(o)||!Bo(o)||(Object.assign(o.style,l),Object.keys(r).forEach(function(a){o.removeAttribute(a)}))})}}const wG={name:"applyStyles",enabled:!0,phase:"write",fn:yG,effect:_G,requires:["computeStyles"]};function Po(i){return i.split("-")[0]}var Es=Math.max,Kg=Math.min,Wl=Math.round;function qv(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function kM(){return!/^((?!chrome|android).)*safari/i.test(qv())}function Vl(i,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var n=i.getBoundingClientRect(),o=1,r=1;t&&Kn(i)&&(o=i.offsetWidth>0&&Wl(n.width)/i.offsetWidth||1,r=i.offsetHeight>0&&Wl(n.height)/i.offsetHeight||1);var s=Hs(i)?xn(i):window,l=s.visualViewport,a=!kM()&&e,h=(n.left+(a&&l?l.offsetLeft:0))/o,d=(n.top+(a&&l?l.offsetTop:0))/r,u=n.width/o,c=n.height/r;return{width:u,height:c,top:d,right:h+u,bottom:d+c,left:h,x:h,y:d}}function Zv(i){var t=Vl(i),e=i.offsetWidth,n=i.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:i.offsetLeft,y:i.offsetTop,width:e,height:n}}function FM(i,t){var e=t.getRootNode&&t.getRootNode();if(i.contains(t))return!0;if(e&&Xv(e)){var n=t;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function cr(i){return xn(i).getComputedStyle(i)}function SG(i){return["table","td","th"].indexOf(Bo(i))>=0}function Vr(i){return((Hs(i)?i.ownerDocument:i.document)||window.document).documentElement}function Yg(i){return Bo(i)==="html"?i:i.assignedSlot||i.parentNode||(Xv(i)?i.host:null)||Vr(i)}function IM(i){return!Kn(i)||cr(i).position==="fixed"?null:i.offsetParent}function xG(i){var t=/firefox/i.test(qv()),e=/Trident/i.test(qv());if(e&&Kn(i)){var n=cr(i);if(n.position==="fixed")return null}var o=Yg(i);for(Xv(o)&&(o=o.host);Kn(o)&&["html","body"].indexOf(Bo(o))<0;){var r=cr(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||t&&r.willChange==="filter"||t&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}function Gh(i){for(var t=xn(i),e=IM(i);e&&SG(e)&&cr(e).position==="static";)e=IM(e);return e&&(Bo(e)==="html"||Bo(e)==="body"&&cr(e).position==="static")?t:e||xG(i)||t}function Jv(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Uh(i,t,e){return Es(i,Kg(t,e))}function AG(i,t,e){var n=Uh(i,t,e);return n>e?e:n}function DM(){return{top:0,right:0,bottom:0,left:0}}function OM(i){return Object.assign({},DM(),i)}function zM(i,t){return t.reduce(function(e,n){return e[n]=i,e},{})}var RG=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,OM(typeof t!="number"?t:zM(t,Vh))};function TG(i){var t,e=i.state,n=i.name,o=i.options,r=e.elements.arrow,s=e.modifiersData.popperOffsets,l=Po(e.placement),a=Jv(l),h=[an,Un].indexOf(l)>=0,d=h?"height":"width";if(!(!r||!s)){var u=RG(o.padding,e),c=Zv(r),g=a==="y"?ln:an,f=a==="y"?Gn:Un,p=e.rects.reference[d]+e.rects.reference[a]-s[a]-e.rects.popper[d],m=s[a]-e.rects.reference[a],b=Gh(r),C=b?a==="y"?b.clientHeight||0:b.clientWidth||0:0,_=p/2-m/2,w=u[g],y=C-c[d]-u[f],S=C/2-c[d]/2+_,R=Uh(w,S,y),A=a;e.modifiersData[n]=(t={},t[A]=R,t.centerOffset=R-S,t)}}function MG(i){var t=i.state,e=i.options,n=e.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||FM(t.elements.popper,o)&&(t.elements.arrow=o))}const BG={name:"arrow",enabled:!0,phase:"main",fn:TG,effect:MG,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jl(i){return i.split("-")[1]}var PG={top:"auto",right:"auto",bottom:"auto",left:"auto"};function HG(i,t){var e=i.x,n=i.y,o=t.devicePixelRatio||1;return{x:Wl(e*o)/o||0,y:Wl(n*o)/o||0}}function NM(i){var t,e=i.popper,n=i.popperRect,o=i.placement,r=i.variation,s=i.offsets,l=i.position,a=i.gpuAcceleration,h=i.adaptive,d=i.roundOffsets,u=i.isFixed,c=s.x,g=c===void 0?0:c,f=s.y,p=f===void 0?0:f,m=typeof d=="function"?d({x:g,y:p}):{x:g,y:p};g=m.x,p=m.y;var b=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),_=an,w=ln,y=window;if(h){var S=Gh(e),R="clientHeight",A="clientWidth";if(S===xn(e)&&(S=Vr(e),cr(S).position!=="static"&&l==="absolute"&&(R="scrollHeight",A="scrollWidth")),S=S,o===ln||(o===an||o===Un)&&r===jh){w=Gn;var x=u&&S===y&&y.visualViewport?y.visualViewport.height:S[R];p-=x-n.height,p*=a?1:-1}if(o===an||(o===ln||o===Gn)&&r===jh){_=Un;var T=u&&S===y&&y.visualViewport?y.visualViewport.width:S[A];g-=T-n.width,g*=a?1:-1}}var M=Object.assign({position:l},h&&PG),B=d===!0?HG({x:g,y:p},xn(e)):{x:g,y:p};if(g=B.x,p=B.y,a){var P;return Object.assign({},M,(P={},P[w]=C?"0":"",P[_]=b?"0":"",P.transform=(y.devicePixelRatio||1)<=1?"translate("+g+"px, "+p+"px)":"translate3d("+g+"px, "+p+"px, 0)",P))}return Object.assign({},M,(t={},t[w]=C?p+"px":"",t[_]=b?g+"px":"",t.transform="",t))}function EG(i){var t=i.state,e=i.options,n=e.gpuAcceleration,o=n===void 0?!0:n,r=e.adaptive,s=r===void 0?!0:r,l=e.roundOffsets,a=l===void 0?!0:l,h={placement:Po(t.placement),variation:jl(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,NM(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:a})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,NM(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const LG={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:EG,data:{}};var Xg={passive:!0};function kG(i){var t=i.state,e=i.instance,n=i.options,o=n.scroll,r=o===void 0?!0:o,s=n.resize,l=s===void 0?!0:s,a=xn(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&h.forEach(function(d){d.addEventListener("scroll",e.update,Xg)}),l&&a.addEventListener("resize",e.update,Xg),function(){r&&h.forEach(function(d){d.removeEventListener("scroll",e.update,Xg)}),l&&a.removeEventListener("resize",e.update,Xg)}}const FG={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kG,data:{}};var IG={left:"right",right:"left",bottom:"top",top:"bottom"};function qg(i){return i.replace(/left|right|bottom|top/g,function(t){return IG[t]})}var DG={start:"end",end:"start"};function WM(i){return i.replace(/start|end/g,function(t){return DG[t]})}function Qv(i){var t=xn(i),e=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:e,scrollTop:n}}function tb(i){return Vl(Vr(i)).left+Qv(i).scrollLeft}function OG(i,t){var e=xn(i),n=Vr(i),o=e.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(o){r=o.width,s=o.height;var h=kM();(h||!h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:r,height:s,x:l+tb(i),y:a}}function zG(i){var t,e=Vr(i),n=Qv(i),o=(t=i.ownerDocument)==null?void 0:t.body,r=Es(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Es(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-n.scrollLeft+tb(i),a=-n.scrollTop;return cr(o||e).direction==="rtl"&&(l+=Es(e.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:l,y:a}}function eb(i){var t=cr(i),e=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+o+n)}function VM(i){return["html","body","#document"].indexOf(Bo(i))>=0?i.ownerDocument.body:Kn(i)&&eb(i)?i:VM(Yg(i))}function Kh(i,t){var e;t===void 0&&(t=[]);var n=VM(i),o=n===((e=i.ownerDocument)==null?void 0:e.body),r=xn(n),s=o?[r].concat(r.visualViewport||[],eb(n)?n:[]):n,l=t.concat(s);return o?l:l.concat(Kh(Yg(s)))}function ib(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function NG(i,t){var e=Vl(i,!1,t==="fixed");return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function jM(i,t,e){return t===HM?ib(OG(i,e)):Hs(t)?NG(t,e):ib(zG(Vr(i)))}function WG(i){var t=Kh(Yg(i)),e=["absolute","fixed"].indexOf(cr(i).position)>=0,n=e&&Kn(i)?Gh(i):i;return Hs(n)?t.filter(function(o){return Hs(o)&&FM(o,n)&&Bo(o)!=="body"}):[]}function VG(i,t,e,n){var o=t==="clippingParents"?WG(i):[].concat(t),r=[].concat(o,[e]),s=r[0],l=r.reduce(function(a,h){var d=jM(i,h,n);return a.top=Es(d.top,a.top),a.right=Kg(d.right,a.right),a.bottom=Kg(d.bottom,a.bottom),a.left=Es(d.left,a.left),a},jM(i,s,n));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function $M(i){var t=i.reference,e=i.element,n=i.placement,o=n?Po(n):null,r=n?jl(n):null,s=t.x+t.width/2-e.width/2,l=t.y+t.height/2-e.height/2,a;switch(o){case ln:a={x:s,y:t.y-e.height};break;case Gn:a={x:s,y:t.y+t.height};break;case Un:a={x:t.x+t.width,y:l};break;case an:a={x:t.x-e.width,y:l};break;default:a={x:t.x,y:t.y}}var h=o?Jv(o):null;if(h!=null){var d=h==="y"?"height":"width";switch(r){case Nl:a[h]=a[h]-(t[d]/2-e[d]/2);break;case jh:a[h]=a[h]+(t[d]/2-e[d]/2);break}}return a}function Yh(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=n===void 0?i.placement:n,r=e.strategy,s=r===void 0?i.strategy:r,l=e.boundary,a=l===void 0?aG:l,h=e.rootBoundary,d=h===void 0?HM:h,u=e.elementContext,c=u===void 0?$h:u,g=e.altBoundary,f=g===void 0?!1:g,p=e.padding,m=p===void 0?0:p,b=OM(typeof m!="number"?m:zM(m,Vh)),C=c===$h?hG:$h,_=i.rects.popper,w=i.elements[f?C:c],y=VG(Hs(w)?w:w.contextElement||Vr(i.elements.popper),a,d,s),S=Vl(i.elements.reference),R=$M({reference:S,element:_,strategy:"absolute",placement:o}),A=ib(Object.assign({},_,R)),x=c===$h?A:S,T={top:y.top-x.top+b.top,bottom:x.bottom-y.bottom+b.bottom,left:y.left-x.left+b.left,right:x.right-y.right+b.right},M=i.modifiersData.offset;if(c===$h&&M){var B=M[o];Object.keys(T).forEach(function(P){var F=[Un,Gn].indexOf(P)>=0?1:-1,H=[ln,Gn].indexOf(P)>=0?"y":"x";T[P]+=B[H]*F})}return T}function jG(i,t){t===void 0&&(t={});var e=t,n=e.placement,o=e.boundary,r=e.rootBoundary,s=e.padding,l=e.flipVariations,a=e.allowedAutoPlacements,h=a===void 0?LM:a,d=jl(n),u=d?l?EM:EM.filter(function(f){return jl(f)===d}):Vh,c=u.filter(function(f){return h.indexOf(f)>=0});c.length===0&&(c=u);var g=c.reduce(function(f,p){return f[p]=Yh(i,{placement:p,boundary:o,rootBoundary:r,padding:s})[Po(p)],f},{});return Object.keys(g).sort(function(f,p){return g[f]-g[p]})}function $G(i){if(Po(i)===Yv)return[];var t=qg(i);return[WM(i),t,WM(t)]}function GG(i){var t=i.state,e=i.options,n=i.name;if(!t.modifiersData[n]._skip){for(var o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!0:s,a=e.fallbackPlacements,h=e.padding,d=e.boundary,u=e.rootBoundary,c=e.altBoundary,g=e.flipVariations,f=g===void 0?!0:g,p=e.allowedAutoPlacements,m=t.options.placement,b=Po(m),C=b===m,_=a||(C||!f?[qg(m)]:$G(m)),w=[m].concat(_).reduce(function($,U){return $.concat(Po(U)===Yv?jG(t,{placement:U,boundary:d,rootBoundary:u,padding:h,flipVariations:f,allowedAutoPlacements:p}):U)},[]),y=t.rects.reference,S=t.rects.popper,R=new Map,A=!0,x=w[0],T=0;T<w.length;T++){var M=w[T],B=Po(M),P=jl(M)===Nl,F=[ln,Gn].indexOf(B)>=0,H=F?"width":"height",E=Yh(t,{placement:M,boundary:d,rootBoundary:u,altBoundary:c,padding:h}),k=F?P?Un:an:P?Gn:ln;y[H]>S[H]&&(k=qg(k));var I=qg(k),L=[];if(r&&L.push(E[B]<=0),l&&L.push(E[k]<=0,E[I]<=0),L.every(function($){return $})){x=M,A=!1;break}R.set(M,L)}if(A)for(var D=f?3:1,O=function(U){var Y=w.find(function(j){var G=R.get(j);if(G)return G.slice(0,U).every(function(Z){return Z})});if(Y)return x=Y,"break"},W=D;W>0;W--){var N=O(W);if(N==="break")break}t.placement!==x&&(t.modifiersData[n]._skip=!0,t.placement=x,t.reset=!0)}}const UG={name:"flip",enabled:!0,phase:"main",fn:GG,requiresIfExists:["offset"],data:{_skip:!1}};function GM(i,t,e){return e===void 0&&(e={x:0,y:0}),{top:i.top-t.height-e.y,right:i.right-t.width+e.x,bottom:i.bottom-t.height+e.y,left:i.left-t.width-e.x}}function UM(i){return[ln,Un,Gn,an].some(function(t){return i[t]>=0})}function KG(i){var t=i.state,e=i.name,n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,s=Yh(t,{elementContext:"reference"}),l=Yh(t,{altBoundary:!0}),a=GM(s,n),h=GM(l,o,r),d=UM(a),u=UM(h);t.modifiersData[e]={referenceClippingOffsets:a,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}const YG={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:KG};function XG(i,t,e){var n=Po(i),o=[an,ln].indexOf(n)>=0?-1:1,r=typeof e=="function"?e(Object.assign({},t,{placement:i})):e,s=r[0],l=r[1];return s=s||0,l=(l||0)*o,[an,Un].indexOf(n)>=0?{x:l,y:s}:{x:s,y:l}}function qG(i){var t=i.state,e=i.options,n=i.name,o=e.offset,r=o===void 0?[0,0]:o,s=LM.reduce(function(d,u){return d[u]=XG(u,t.rects,r),d},{}),l=s[t.placement],a=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=h),t.modifiersData[n]=s}const ZG={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qG};function JG(i){var t=i.state,e=i.name;t.modifiersData[e]=$M({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const QG={name:"popperOffsets",enabled:!0,phase:"read",fn:JG,data:{}};function tU(i){return i==="x"?"y":"x"}function eU(i){var t=i.state,e=i.options,n=i.name,o=e.mainAxis,r=o===void 0?!0:o,s=e.altAxis,l=s===void 0?!1:s,a=e.boundary,h=e.rootBoundary,d=e.altBoundary,u=e.padding,c=e.tether,g=c===void 0?!0:c,f=e.tetherOffset,p=f===void 0?0:f,m=Yh(t,{boundary:a,rootBoundary:h,padding:u,altBoundary:d}),b=Po(t.placement),C=jl(t.placement),_=!C,w=Jv(b),y=tU(w),S=t.modifiersData.popperOffsets,R=t.rects.reference,A=t.rects.popper,x=typeof p=="function"?p(Object.assign({},t.rects,{placement:t.placement})):p,T=typeof x=="number"?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(S){if(r){var P,F=w==="y"?ln:an,H=w==="y"?Gn:Un,E=w==="y"?"height":"width",k=S[w],I=k+m[F],L=k-m[H],D=g?-A[E]/2:0,O=C===Nl?R[E]:A[E],W=C===Nl?-A[E]:-R[E],N=t.elements.arrow,$=g&&N?Zv(N):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:DM(),Y=U[F],j=U[H],G=Uh(0,R[E],$[E]),Z=_?R[E]/2-D-G-Y-T.mainAxis:O-G-Y-T.mainAxis,et=_?-R[E]/2+D+G+j+T.mainAxis:W+G+j+T.mainAxis,gt=t.elements.arrow&&Gh(t.elements.arrow),vt=gt?w==="y"?gt.clientTop||0:gt.clientLeft||0:0,it=(P=M==null?void 0:M[w])!=null?P:0,nt=k+Z-it-vt,bt=k+et-it,Ct=Uh(g?Kg(I,nt):I,k,g?Es(L,bt):L);S[w]=Ct,B[w]=Ct-k}if(l){var at,rt=w==="x"?ln:an,ct=w==="x"?Gn:Un,ht=S[y],_t=y==="y"?"height":"width",ut=ht+m[rt],It=ht-m[ct],Ut=[ln,an].indexOf(b)!==-1,yt=(at=M==null?void 0:M[y])!=null?at:0,Tt=Ut?ut:ht-R[_t]-A[_t]-yt+T.altAxis,kt=Ut?ht+R[_t]+A[_t]-yt-T.altAxis:It,oe=g&&Ut?AG(Tt,ht,kt):Uh(g?Tt:ut,ht,g?kt:It);S[y]=oe,B[y]=oe-ht}t.modifiersData[n]=B}}const iU={name:"preventOverflow",enabled:!0,phase:"main",fn:eU,requiresIfExists:["offset"]};function nU(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function oU(i){return i===xn(i)||!Kn(i)?Qv(i):nU(i)}function rU(i){var t=i.getBoundingClientRect(),e=Wl(t.width)/i.offsetWidth||1,n=Wl(t.height)/i.offsetHeight||1;return e!==1||n!==1}function sU(i,t,e){e===void 0&&(e=!1);var n=Kn(t),o=Kn(t)&&rU(t),r=Vr(t),s=Vl(i,o,e),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(n||!n&&!e)&&((Bo(t)!=="body"||eb(r))&&(l=oU(t)),Kn(t)?(a=Vl(t,!0),a.x+=t.clientLeft,a.y+=t.clientTop):r&&(a.x=tb(r))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function lU(i){var t=new Map,e=new Set,n=[];i.forEach(function(r){t.set(r.name,r)});function o(r){e.add(r.name);var s=[].concat(r.requires||[],r.requiresIfExists||[]);s.forEach(function(l){if(!e.has(l)){var a=t.get(l);a&&o(a)}}),n.push(r)}return i.forEach(function(r){e.has(r.name)||o(r)}),n}function aU(i){var t=lU(i);return CG.reduce(function(e,n){return e.concat(t.filter(function(o){return o.phase===n}))},[])}function hU(i){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(i())})})),t}}function dU(i){var t=i.reduce(function(e,n){var o=e[n.name];return e[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,e},{});return Object.keys(t).map(function(e){return t[e]})}var KM={placement:"bottom",modifiers:[],strategy:"absolute"};function YM(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function uU(i){i===void 0&&(i={});var t=i,e=t.defaultModifiers,n=e===void 0?[]:e,o=t.defaultOptions,r=o===void 0?KM:o;return function(l,a,h){h===void 0&&(h=r);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},KM,r),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},u=[],c=!1,g={state:d,setOptions:function(b){var C=typeof b=="function"?b(d.options):b;p(),d.options=Object.assign({},r,d.options,C),d.scrollParents={reference:Hs(l)?Kh(l):l.contextElement?Kh(l.contextElement):[],popper:Kh(a)};var _=aU(dU([].concat(n,d.options.modifiers)));return d.orderedModifiers=_.filter(function(w){return w.enabled}),f(),g.update()},forceUpdate:function(){if(!c){var b=d.elements,C=b.reference,_=b.popper;if(YM(C,_)){d.rects={reference:sU(C,Gh(_),d.options.strategy==="fixed"),popper:Zv(_)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(T){return d.modifiersData[T.name]=Object.assign({},T.data)});for(var w=0;w<d.orderedModifiers.length;w++){if(d.reset===!0){d.reset=!1,w=-1;continue}var y=d.orderedModifiers[w],S=y.fn,R=y.options,A=R===void 0?{}:R,x=y.name;typeof S=="function"&&(d=S({state:d,options:A,name:x,instance:g})||d)}}}},update:hU(function(){return new Promise(function(m){g.forceUpdate(),m(d)})}),destroy:function(){p(),c=!0}};if(!YM(l,a))return g;g.setOptions(h).then(function(m){!c&&h.onFirstUpdate&&h.onFirstUpdate(m)});function f(){d.orderedModifiers.forEach(function(m){var b=m.name,C=m.options,_=C===void 0?{}:C,w=m.effect;if(typeof w=="function"){var y=w({state:d,name:b,instance:g,options:_}),S=function(){};u.push(y||S)}})}function p(){u.forEach(function(m){return m()}),u=[]}return g}}var cU=[FG,QG,LG,wG,ZG,UG,iU,BG,YG],gU=uU({defaultModifiers:cU});function nb(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,n=Array(t);e<t;e++)n[e]=i[e];return n}function XM(i,t){if(i){if(typeof i=="string")return nb(i,t);var e={}.toString.call(i).slice(8,-1);return e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set"?Array.from(i):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?nb(i,t):void 0}}function fU(i){return function(t){if(Array.isArray(t))return nb(t)}(i)||function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}(i)||XM(i)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
366
366
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function $l(i){return $l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$l(i)}function qM(i,t,e,n,o,r,s){try{var l=i[r](s),a=l.value}catch(h){return void e(h)}l.done?t(a):Promise.resolve(a).then(n,o)}function ZM(i){return function(){var t=this,e=arguments;return new Promise(function(n,o){var r=i.apply(t,e);function s(a){qM(r,n,o,s,l,"next",a)}function l(a){qM(r,n,o,s,l,"throw",a)}s(void 0)})}}var JM={exports:{}},QM={exports:{}};(function(i){function t(e){return i.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i.exports.__esModule=!0,i.exports.default=i.exports,t(e)}i.exports=t,i.exports.__esModule=!0,i.exports.default=i.exports})(QM),function(i){var t=QM.exports.default;function e(){i.exports=e=function(){return o},i.exports.__esModule=!0,i.exports.default=i.exports;var n,o={},r=Object.prototype,s=r.hasOwnProperty,l=Object.defineProperty||function(L,D,O){L[D]=O.value},a=typeof Symbol=="function"?Symbol:{},h=a.iterator||"@@iterator",d=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(L,D,O){return Object.defineProperty(L,D,{value:O,enumerable:!0,configurable:!0,writable:!0}),L[D]}try{c({},"")}catch{c=function(D,O,W){return D[O]=W}}function g(L,D,O,W){var N=D&&D.prototype instanceof w?D:w,$=Object.create(N.prototype),U=new k(W||[]);return l($,"_invoke",{value:P(L,O,U)}),$}function f(L,D,O){try{return{type:"normal",arg:L.call(D,O)}}catch(W){return{type:"throw",arg:W}}}o.wrap=g;var p="suspendedStart",m="suspendedYield",b="executing",C="completed",_={};function w(){}function y(){}function S(){}var R={};c(R,h,function(){return this});var A=Object.getPrototypeOf,x=A&&A(A(I([])));x&&x!==r&&s.call(x,h)&&(R=x);var T=S.prototype=w.prototype=Object.create(R);function M(L){["next","throw","return"].forEach(function(D){c(L,D,function(O){return this._invoke(D,O)})})}function B(L,D){function O(N,$,U,Y){var j=f(L[N],L,$);if(j.type!=="throw"){var G=j.arg,Z=G.value;return Z&&t(Z)=="object"&&s.call(Z,"__await")?D.resolve(Z.__await).then(function(et){O("next",et,U,Y)},function(et){O("throw",et,U,Y)}):D.resolve(Z).then(function(et){G.value=et,U(G)},function(et){return O("throw",et,U,Y)})}Y(j.arg)}var W;l(this,"_invoke",{value:function(N,$){function U(){return new D(function(Y,j){O(N,$,Y,j)})}return W=W?W.then(U,U):U()}})}function P(L,D,O){var W=p;return function(N,$){if(W===b)throw Error("Generator is already running");if(W===C){if(N==="throw")throw $;return{value:n,done:!0}}for(O.method=N,O.arg=$;;){var U=O.delegate;if(U){var Y=F(U,O);if(Y){if(Y===_)continue;return Y}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(W===p)throw W=C,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);W=b;var j=f(L,D,O);if(j.type==="normal"){if(W=O.done?C:m,j.arg===_)continue;return{value:j.arg,done:O.done}}j.type==="throw"&&(W=C,O.method="throw",O.arg=j.arg)}}}function F(L,D){var O=D.method,W=L.iterator[O];if(W===n)return D.delegate=null,O==="throw"&&L.iterator.return&&(D.method="return",D.arg=n,F(L,D),D.method==="throw")||O!=="return"&&(D.method="throw",D.arg=new TypeError("The iterator does not provide a '"+O+"' method")),_;var N=f(W,L.iterator,D.arg);if(N.type==="throw")return D.method="throw",D.arg=N.arg,D.delegate=null,_;var $=N.arg;return $?$.done?(D[L.resultName]=$.value,D.next=L.nextLoc,D.method!=="return"&&(D.method="next",D.arg=n),D.delegate=null,_):$:(D.method="throw",D.arg=new TypeError("iterator result is not an object"),D.delegate=null,_)}function H(L){var D={tryLoc:L[0]};1 in L&&(D.catchLoc=L[1]),2 in L&&(D.finallyLoc=L[2],D.afterLoc=L[3]),this.tryEntries.push(D)}function E(L){var D=L.completion||{};D.type="normal",delete D.arg,L.completion=D}function k(L){this.tryEntries=[{tryLoc:"root"}],L.forEach(H,this),this.reset(!0)}function I(L){if(L||L===""){var D=L[h];if(D)return D.call(L);if(typeof L.next=="function")return L;if(!isNaN(L.length)){var O=-1,W=function N(){for(;++O<L.length;)if(s.call(L,O))return N.value=L[O],N.done=!1,N;return N.value=n,N.done=!0,N};return W.next=W}}throw new TypeError(t(L)+" is not iterable")}return y.prototype=S,l(T,"constructor",{value:S,configurable:!0}),l(S,"constructor",{value:y,configurable:!0}),y.displayName=c(S,u,"GeneratorFunction"),o.isGeneratorFunction=function(L){var D=typeof L=="function"&&L.constructor;return!!D&&(D===y||(D.displayName||D.name)==="GeneratorFunction")},o.mark=function(L){return Object.setPrototypeOf?Object.setPrototypeOf(L,S):(L.__proto__=S,c(L,u,"GeneratorFunction")),L.prototype=Object.create(T),L},o.awrap=function(L){return{__await:L}},M(B.prototype),c(B.prototype,d,function(){return this}),o.AsyncIterator=B,o.async=function(L,D,O,W,N){N===void 0&&(N=Promise);var $=new B(g(L,D,O,W),N);return o.isGeneratorFunction(D)?$:$.next().then(function(U){return U.done?U.value:$.next()})},M(T),c(T,u,"Generator"),c(T,h,function(){return this}),c(T,"toString",function(){return"[object Generator]"}),o.keys=function(L){var D=Object(L),O=[];for(var W in D)O.push(W);return O.reverse(),function N(){for(;O.length;){var $=O.pop();if($ in D)return N.value=$,N.done=!1,N}return N.done=!0,N}},o.values=I,k.prototype={constructor:k,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!L)for(var D in this)D.charAt(0)==="t"&&s.call(this,D)&&!isNaN(+D.slice(1))&&(this[D]=n)},stop:function(){this.done=!0;var L=this.tryEntries[0].completion;if(L.type==="throw")throw L.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var D=this;function O(j,G){return $.type="throw",$.arg=L,D.next=j,G&&(D.method="next",D.arg=n),!!G}for(var W=this.tryEntries.length-1;W>=0;--W){var N=this.tryEntries[W],$=N.completion;if(N.tryLoc==="root")return O("end");if(N.tryLoc<=this.prev){var U=s.call(N,"catchLoc"),Y=s.call(N,"finallyLoc");if(U&&Y){if(this.prev<N.catchLoc)return O(N.catchLoc,!0);if(this.prev<N.finallyLoc)return O(N.finallyLoc)}else if(U){if(this.prev<N.catchLoc)return O(N.catchLoc,!0)}else{if(!Y)throw Error("try statement without catch or finally");if(this.prev<N.finallyLoc)return O(N.finallyLoc)}}}},abrupt:function(L,D){for(var O=this.tryEntries.length-1;O>=0;--O){var W=this.tryEntries[O];if(W.tryLoc<=this.prev&&s.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var N=W;break}}N&&(L==="break"||L==="continue")&&N.tryLoc<=D&&D<=N.finallyLoc&&(N=null);var $=N?N.completion:{};return $.type=L,$.arg=D,N?(this.method="next",this.next=N.finallyLoc,_):this.complete($)},complete:function(L,D){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&D&&(this.next=D),_},finish:function(L){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.finallyLoc===L)return this.complete(O.completion,O.afterLoc),E(O),_}},catch:function(L){for(var D=this.tryEntries.length-1;D>=0;--D){var O=this.tryEntries[D];if(O.tryLoc===L){var W=O.completion;if(W.type==="throw"){var N=W.arg;E(O)}return N}}throw Error("illegal catch attempt")},delegateYield:function(L,D,O){return this.delegate={iterator:I(L),resultName:D,nextLoc:O},this.method==="next"&&(this.arg=n),_}},o}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(JM);var Zg=JM.exports(),Jg=Zg;try{regeneratorRuntime=Zg}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Zg:Function("r","regeneratorRuntime = r")(Zg)}function Gl(i,t){return function(e){if(Array.isArray(e))return e}(i)||function(e,n){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r,s,l,a,h=[],d=!0,u=!1;try{if(l=(o=o.call(e)).next,n===0){if(Object(o)!==o)return;d=!1}else for(;!(d=(r=l.call(o)).done)&&(h.push(r.value),h.length!==n);d=!0);}catch(c){u=!0,s=c}finally{try{if(!d&&o.return!=null&&(a=o.return(),Object(a)!==a))return}finally{if(u)throw s}}return h}}(i,t)||XM(i,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
367
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pU(i){var t=function(e,n){if($l(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return $l(t)=="symbol"?t:t+""}function ob(i,t,e){return(t=pU(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Qg=v.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:v.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function Ho(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}Ho(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Qg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"saturation",style:v.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=v.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=v.createElementVNode("div",{class:"saturation-black"},null,-1)),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],36)},Qg.__scopeId="data-v-24517fec",Qg.__file="src/picker/Saturation.vue";var tf=v.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref();return v.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),mU={ref:"canvas"};Ho(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),tf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",mU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},tf.__scopeId="data-v-78b9f4f0",tf.__file="src/picker/Hue.vue";var ef=v.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return v.watch(function(){return i.color},function(){r()}),v.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),vU={ref:"canvas"};Ho(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),ef.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",vU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},ef.__scopeId="data-v-24dc9656",ef.__file="src/picker/Alpha.vue";var tB={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},eB={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},bU={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function iB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function rb(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?iB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):iB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Ls=null,nB=function(i,t,e){var n=v.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Ls.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=rb(rb(rb({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return v.watch(function(){return[v.unref(i),v.unref(t)]},function(a,h){var d,u=Gl(a,2),c=u[0],g=u[1],f=Gl(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Ls)===null||d===void 0||d.destroy();var b=c.$el||c,C=g.$el||g;v.nextTick(function(){Ls=gU(b,C,l)})}}),v.onBeforeUnmount(function(){var a;Ls&&((a=Ls)===null||a===void 0||a.destroy(),Ls=null)}),{instance:Ls,style:n}},nf=v.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.ref(null),o=v.ref(null),r=v.ref(!1),s=nB(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=v.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=v.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return tB[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return eB[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=v.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=v.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return v.onMounted(function(){document.addEventListener("mouseup",h,!1)}),v.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",bU[d])}}}}),CU={class:"format"},yU={key:0,class:"arrow"},_U=["onClick"];Ho(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),nf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",CU,[v.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[v.createElementVNode("span",null,v.toDisplayString(i.value),1),i.isNeedSelect?(v.openBlock(),v.createElementBlock("div",yU)):v.createCommentVNode("v-if",!0)],512),v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowSelector?(v.openBlock(),v.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:v.normalizeStyle(i.selectorStyle)},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.formatOptions,function(s){return v.openBlock(),v.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},v.toDisplayString(s),9,_U)}),128))],4)):v.createCommentVNode("v-if",!0)]}),_:1})])},nf.__scopeId="data-v-5f6e8f5e",nf.__file="src/picker/input-value/FormatValue.vue";var of=v.defineComponent({name:"Input",components:{FormatValue:nf},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:v.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),wU={class:"input"},SU=[".value"];function oB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Yn(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?oB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):oB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),of.render=function(i,t,e,n,o,r){var s=v.resolveComponent("FormatValue");return v.openBlock(),v.createElementBlock("div",wU,[v.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),v.createElementVNode("input",{class:"value",style:v.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=v.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,SU)])},of.__scopeId="data-v-2c454c00",of.__file="src/picker/input-value/InputValue.vue";var rB=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},sB={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},rf=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat(sB[t]||t).concat(sB[e]||e)},lB=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(rf(t)).concat(rf(e)).concat(rf(n))},Ul=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},Xh=function(i,t,e){i=6*Ul(i,360),t=Ul(t,100),e=Ul(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},aB=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=rB(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=Xh(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(lB(Xh(r,s,l))).concat(rf(255*a))}else switch(t){case"hsl":var f=rB(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=Xh(r,s,l),m=p.r,b=p.g,C=p.b;return"rgb(".concat(m,", ").concat(b,", ").concat(C,")");default:return lB(Xh(r,s,l))}},sf=function(i){var t=i.r,e=i.g,n=i.b;t=Ul(t,255),e=Ul(e,255),n=Ul(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},hB=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},dB=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},sb=function(i,t,e){if(typeof i=="string"&&i!==""){var n=lf(i,af(i),e),o=fB(n);return o==null?"":aB(o,t,e)}return""},uB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},cB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},gB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},lf=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=uB(i),n=e.r,o=e.g,r=e.b,s=e.a;return Yn(Yn({},sf({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=gB(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=cB(i),h=a.h,d=a.s,u=a.l,c=a.a;return Yn(Yn({},hB({h,s:d,l:u})),{},{a:+c});default:var g=dB(i),f=g.r,p=g.g,m=g.b,b=g.a;return Yn(Yn({},sf({r:f,g:p,b:m})),{},{a:b/255})}else switch(t){case"rgb":return Yn(Yn({},sf(uB(i))),{},{a:1});case"hsv":var C=gB(i);return{h:C.h,s:C.s,v:C.v,a:1};case"hsl":return Yn(Yn({},hB(cB(i))),{},{a:1});default:return Yn(Yn({},sf(dB(i))),{},{a:1})}},af=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},fB=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},qh=v.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=v.ref(),e=v.inject("theme",{theme:"light"}).theme,n=v.computed(function(){return parseFloat((i.width||i.size)+"")}),o=v.computed(function(){return parseFloat((i.height||i.size)+"")}),r=v.computed(function(){return{width:"".concat(v.unref(n),"px"),height:"".concat(v.unref(o),"px"),border:i.border?"1px solid ".concat(v.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=v.unref(n),t.value.height=v.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,v.unref(n),v.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,v.unref(n),v.unref(o))};return v.watch(function(){return i.value},function(){s()}),v.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),xU=["draggable"];Ho(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),qh.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("canvas",{class:"color-item",style:v.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,xU)},qh.__scopeId="data-v-02da71fd",qh.__file="src/color-item/ColorItem.vue";var hf=v.defineComponent({name:"Colors",components:{ColorItem:qh},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:v.computed(function(){return i.colors.map(function(n){return sb(n,"hex",!0)})})}}}),AU={class:"colors"};function pB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Eo(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?pB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):pB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),hf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item");return v.openBlock(),v.createElementBlock("div",AU,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.useColors,function(l,a){return v.openBlock(),v.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:v.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},hf.__scopeId="data-v-0f8b52a8",hf.__file="src/picker/Colors.vue";var df=v.defineComponent({name:"Picker",components:{Colors:hf,Saturation:Qg,Hue:tf,Alpha:ef,InputValue:of},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return Eo(Eo({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=v.ref(),r=v.ref(),s=v.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var b=af(m);return fB(lf(m,b,i.showAlpha))}return null};v.watch(function(){return i.value},function(){i.value!==v.unref(s)&&(o.value=l())},{immediate:!0}),v.watch(function(){return[v.unref(o),i.format]},function(p){var m=Gl(p,2),b=m[0],C=m[1],_="";b!=null?(_=aB(Eo({},b),i.format,i.showAlpha),r.value=Eo({},b)):r.value=null,s.value=_;var w=l();JSON.stringify(b)!==JSON.stringify(w)&&JSON.stringify(b)!==JSON.stringify(C)&&e("change",_)},{immediate:!0});var a=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.h)||0}),h=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.s)||0}),d=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.v)||0}),u=v.computed(function(){var p,m;return((p=v.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=v.unref(o))===null||m===void 0?void 0:m.a:1}),c=v.computed(function(){return Xh(v.unref(a),v.unref(h),v.unref(d))}),g=v.computed(function(){return"rgb(".concat(v.unref(c).r,", ").concat(v.unref(c).g,", ").concat(v.unref(c).b,")")}),f=v.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:p,v:m,a:v.unref(u)}:o.value=Eo(Eo({},v.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,v.unref(o)==null&&(o.value={h:p,s:v.unref(h),v:v.unref(d),a:v.unref(u)}),o.value=Eo(Eo({},v.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:v.unref(h),v:v.unref(d),a:p}:o.value=Eo(Eo({},v.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?tB[p]:eB[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=v.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var b=i.showAlpha,C=af(m),_=lf(m,C,b),w=function(y){var S=y.h,R=y.s,A=y.v,x=y.a;return!(isNaN(S)||isNaN(R)||isNaN(A)||isNaN(x))}(_);w?o.value=_:v.unref(r)!=null?o.value=v.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var b=af(p);b?function(C,_,w){if(C.length!==0){var y=lf(C,_,w),S=y.h,R=y.s,A=y.v;if(!(isNaN(S)||isNaN(R)||isNaN(A))){var x=1,T=y.a;isNaN(T)||(x=T),o.value={h:S,s:R,v:A,a:x}}}}(p,b,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),RU={class:"picker-inner"},TU={class:"picker-header"};Ho(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),df.render=function(i,t,e,n,o,r){var s=v.resolveComponent("saturation"),l=v.resolveComponent("hue"),a=v.resolveComponent("alpha"),h=v.resolveComponent("input-value"),d=v.resolveComponent("Colors");return v.openBlock(),v.createElementBlock("div",{class:"picker",style:v.normalizeStyle(i.pickerStyle)},[v.createElementVNode("div",RU,[v.createElementVNode("div",TU,[v.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),v.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(v.openBlock(),v.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):v.createCommentVNode("v-if",!0)]),v.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(v.openBlock(),v.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):v.createCommentVNode("v-if",!0)])],4)},df.__scopeId="data-v-6ceadec6",df.__file="src/picker/Picker.vue";var uf=v.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=v.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});Ho(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),uf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("svg",{class:"add-color-item",style:v.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[v.createElementVNode("g",{class:"container"},[v.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},uf.__scopeId="data-v-ceb1719c",uf.__file="src/add-color-item/AddColorItem.vue";var cf=v.defineComponent({name:"ColorPicker",components:{ColorItem:qh,Picker:df,AddColorItem:uf},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=v.ref([]),o=v.computed(function(){return v.unref(n).map(function(x){return sb(x,"hex",i.showAlpha)})}),r=v.ref("hex");v.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),v.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(M){return sb(M,v.unref(r),i.showAlpha)})},{immediate:!0});var s=v.ref(void 0),l=v.computed(function(){return v.unref(n)[v.unref(s)]}),a=v.ref(!1);v.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=v.ref(null),c=v.ref(null),g=nB(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){v.unref(u)==null&&(u.value=v.unref(A)[0]),v.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",v.toRaw(Array.isArray(i.value)||i.addColor?v.unref(n):v.unref(n)[0]))},m=v.ref(),b=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H;return Jg.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(P=M.target,(F=(B=P.dataset)===null||B===void 0?void 0:B.index)!=null&&F!==""){E.next=4;break}return E.abrupt("return");case 4:if(H=+F,v.unref(s)!==H){E.next=7;break}return E.abrupt("return");case 7:v.unref(s)!=null&&v.unref(s)!==H?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=H,u.value=P;case 10:case"end":return E.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),C=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H,E;return Jg.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(H=M.target,!(!((B=v.unref(m))!==null&&B!==void 0&&B.isEqualNode(H))&&(!((P=v.unref(m))===null||P===void 0)&&P.contains(H)))){k.next=4;break}return k.abrupt("return");case 4:if(E=(F=v.unref(c))===null||F===void 0?void 0:F.$el,!(E!=null&&E.contains(H))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){v.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();v.watch(a,function(){v.unref(a)&&(f(),clearTimeout(d))});var _,w=v.ref(i.max>v.unref(n).length),y=v.computed(function(){return typeof i.popupContainer=="string"||$l(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),S=v.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),R=v.computed(function(){return i.theme});v.watch(function(){return[i.theme,v.unref(c)]},function(){v.nextTick(function(){var x,T;(x=v.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",v.unref(R)),(T=v.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",v.unref(R))})},{immediate:!0}),v.provide("theme",{theme:R});var A=v.ref([]);return v.onMounted(function(){document.addEventListener("mouseup",C,!1),i.showPicker&&f()}),v.onUnmounted(function(){document.removeEventListener("mouseup",C,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?v.unref(n).length>0:v.unref(n).length>1)&&v.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:w,onPickerChange:function(x){var T=v.unref(s),M=v.unref(n).slice(),B=v.unref(n).length;if(T!=null){T>=0?M[T]=x:(s.value=B,M.push(x));var P="";P=Array.isArray(i.value)||i.addColor?M:x,n.value=Array.isArray(P)?P:[P],e("update:value",P),e("change",P,x,T),i.addColor&&B>=i.max&&(w.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:b,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;_=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,M=fU(v.unref(n)),B=M[_];M.splice(_,1);var P=M.slice(0,T),F=M.splice(T),H=P.concat([B]).concat(F);e("update:value",H),e("change",H,H[_],_)},colorItemsRef:A,pickerStyle:g,values:o,teleportDisabled:S,toPopupContainer:y,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});Ho(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),cf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item"),l=v.resolveComponent("add-color-item"),a=v.resolveComponent("picker");return v.openBlock(),v.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=v.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=v.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=v.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=v.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.values,function(h,d){return v.openBlock(),v.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(v.openBlock(),v.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):v.createCommentVNode("v-if",!0),(v.openBlock(),v.createBlock(v.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowPicker?(v.openBlock(),v.createBlock(a,{key:0,class:"picker",style:v.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):v.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},cf.__scopeId="data-v-3c43ade8",cf.__file="src/ColorPicker.vue";const OX="",MU=v.defineComponent({name:"ColorPick",components:{PickColors:cf},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=v.ref(i.value);v.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",v.unref(e))}return{myValue:e,onChange:n}}}),BU={class:"color-pick"};function PU(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("pick-colors");return v.openBlock(),v.createElementBlock("div",BU,[v.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),v.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const HU=Ri(MU,[["render",PU],["__scopeId","data-v-99378939"]]),EU=v.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function LU(i,t,e,n,o,r){const s=v.resolveComponent("a-radio-group");return v.openBlock(),v.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const kU=Ri(EU,[["render",LU]]),zX="",FU=v.defineComponent({name:"PropertyConfig",components:{ColorPick:HU,Radio:kU},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean}},setup(i){const t=v.inject("theme","light"),e=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],n=v.ref([]);v.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const l=Object.keys(i.config);n.value=l}});function o(l,a){i.config[l]=a}function r(l,a){if(l.target.checked)i.config[a]="",v.unref(n).push(a);else{delete i.config[a];const h=v.unref(n).indexOf(a);v.unref(n).splice(h,1)}}const s=v.computed(()=>v.unref(t)==="darkBlue"?"#b2c3dd":"");return{formConfig:e,handleSelect:r,selectedProperty:n,onChange:o,fontColor:s}}}),IU={class:"content"},DU={class:"list"};function OU(i,t,e,n,o,r){const s=v.resolveComponent("a-checkbox");return v.openBlock(),v.createElementBlock("div",IU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),v.createElementVNode("div",DU,[i.selectedIndex>-1?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:0},v.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(v.openBlock(),v.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[v.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),v.createElementVNode("span",{style:v.normalizeStyle({padding:"0 8px",color:i.fontColor})},v.toDisplayString(l),5),i.selectedProperty.includes(d)?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(a),v.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):v.createCommentVNode("",!0)]))),128)):v.createCommentVNode("",!0)])])}const zU=Ri(FU,[["render",OU],["__scopeId","data-v-b2df2e2d"]]),NU=v.defineComponent({name:"ConditionalProperty",props:{},components:{ConditionalItemConfig:J$,ConditionalConfig:lG,PropertyConfig:zU},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref([]),r=v.ref(-1),s=v.inject("theme","light"),l=v.inject("getContainer",()=>{});let a="";const h=v.computed(()=>v.unref(r)>-1?v.unref(o)[v.unref(r)]:{});function d(f,p=[]){a=f,o.value=p,n.value=!0}function u(f){r.value=f}function c(){t("change",a,v.unref(o)),r.value=-1,n.value=!1}function g(){r.value=-1,o.value=[]}return v.watch(n,f=>{window.modalShow&&window.modalShow(f)}),e({showModal:d}),{theme:s,visible:n,config:o,changeSelectedItem:u,selectedConfig:h,selectedIndex:r,handleOk:c,handleClear:g,getContainer:l}}}),WU={style:{display:"flex"}};function VU(i,t,e,n,o,r){const s=v.resolveComponent("conditional-item-config"),l=v.resolveComponent("conditional-config"),a=v.resolveComponent("property-config"),h=v.resolveComponent("a-button"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(h,{onClick:i.handleClear},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"]),v.createVNode(h,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[4]||(t[4]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",WU,[v.createVNode(s,{config:i.config,onChange:i.changeSelectedItem},null,8,["config","onChange"]),v.createVNode(l,{config:i.selectedConfig.conditions,isSelected:i.selectedIndex>-1},null,8,["config","isSelected"]),v.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex},null,8,["config","selectedIndex"])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const jU=Ri(NU,[["render",VU]]),NX="",$U=v.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}}},components:{FilterOutlined:pM,MinusSquareOutlined:T$,PivotFilter:DT},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.ref();let o;const r=v.ref([]),s=v.computed(()=>{var H;return(H=v.unref(r)[v.unref(r).length-1])==null?void 0:H.key}),l=v.ref([]),a=v.ref(!1),h=v.ref(),d=v.ref({});let u={};const c=v.reactive({position:"absolute",top:"0",left:"0"});let g="",f;function p(){l.value=[],r.value=[],u={};const{dimensionData:H,xLabel:E}=i.data,k=H[E].map(I=>I.value);b(E,k),v.unref(r).push({key:E,drillValue:"",xAxisData:k}),C()}let m=[];v.onMounted(()=>{o=NB.init(n.value),w()});function b(H,E){const{yLabel:k,records:I}=i.data;let L=[];E.forEach(()=>{L.push(0)}),I.forEach(D=>{if(D[k]!==void 0){const O=E.indexOf(D[H]);if(O>-1){let W=!0;v.unref(r).forEach($=>{$.drillValue&&D[$.key]!==$.drillValue&&(W=!1)});const N=Number(D[k]);W&&!isNaN(N)&&(L[O]+=Number(N))}}}),L=L.map(D=>D.toFixed(2)),f={tooltip:{},xAxis:{data:E},yAxis:{},series:[{name:k,type:"bar",label:{show:!0,position:"top"},data:L}]},m=L,o.setOption(f)}function C(){const H=Object.keys(i.data.dimensionData),E=v.unref(r).map(I=>I.key),k=[];H.forEach(I=>{E.includes(I)||k.push(I)}),l.value=k}function _(){g="",a.value=!1}function w(){o.on("contextmenu",function(H){const{event:{event:E},name:k}=H;g=k,E.preventDefault(),c.left=E.offsetX+90+"px",c.top=E.offsetY+80+"px",a.value=!0}),document.addEventListener("click",_)}function y(H){const E=[],{records:k}=i.data;for(const I of k){let L=!0;for(const D of v.unref(r))D.drillValue&&I[D.key]!==D.drillValue&&(L=!1);L&&!E.includes(I[H])&&E.push(I[H])}return E}function S(H){v.unref(r)[v.unref(r).length-1].drillValue=g;const E=y(H);b(H,E),v.unref(r).push({key:H,drillValue:"",xAxisData:E}),C()}function R(H,E){v.unref(r).splice(H+1,v.unref(r).length-H-1),v.unref(r)[H].drillValue="";const k=y(E);b(E,k),B(),C()}function A(H,E){const k=f.series[0].data,I=f.xAxis.data,L=k.map((O,W)=>({value:O,label:I[W]}));let D;E==="asc"?H==="dimension"?D=L.sort((O,W)=>O.label.localeCompare(W.label)):D=L.sort((O,W)=>O.value-W.value):E==="desc"&&(H==="dimension"?D=L.sort((O,W)=>W.label.localeCompare(O.label)):D=L.sort((O,W)=>W.value-O.value)),f.series[0].data=D.map(O=>O.value),f.xAxis.data=D.map(O=>O.label),o.setOption(f)}function x(H){if(H==="dimension"){const E=y(v.unref(s));b(v.unref(s),E),B()}else u={},B()}function T(H){if(H==="dimension"){const E=v.unref(r)[v.unref(r).length-1].xAxisData.map(k=>({value:k}));d.value={fieldName:v.unref(s),key:v.unref(s),type:H,filterData:f.xAxis.data,valueList:E}}else H==="indicators"&&(d.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:u});v.nextTick(()=>{v.unref(h).showModal()})}function M({checkKeys:H,type:E}){E==="dimension"?b(v.unref(s),H):E==="indicators"&&(u=H,B())}function B(){const H=v.unref(r)[v.unref(r).length-1].xAxisData;let E=m.map((k,I)=>({value:k,label:H[I]}));E=E.filter(k=>P(k.value)),f.series[0].data=E.map(k=>k.value),f.xAxis.data=E.map(k=>k.label),o.setOption(f)}function P(H){let E=!1,{rule:k,value:I}=u;switch(I=Number(I),k){case"LESS":E=H<I;break;case"GREATER":E=H>I;break;case"EQUAL":E=H===I;break;case"NOT_EQUAL":E=H!==I;break;default:E=!0;break}return E}v.onBeforeUnmount(()=>{document.removeEventListener("click",_)}),t({init:p});const F=v.computed(()=>v.unref(e)==="darkBlue"?"#b2c3dd":"");return{echartRef:n,dropdownList:l,isShowMenu:a,curXLabel:s,menuStyle:c,drillDimension:S,dimensionMap:r,deleteDimension:R,handleSort:A,handleClear:x,handleFilter:T,pivotFilterRef:h,filterData:d,onFilterChange:M,fontColor:F}}}),GU={style:{display:"flex",height:"400px"}},UU={style:{flex:"0 0 200px"}},KU={style:{flex:"0 0 650px",height:"100%"}},YU={key:0,style:{display:"flex","align-items":"center"}},XU={key:0,class:"dimension-item"},qU={key:1,style:{height:"30px"}},ZU={style:{width:"100%",height:"100%"},ref:"echartRef"},JU=["onClick"];function QU(i,t,e,n,o,r){const s=v.resolveComponent("filter-outlined"),l=v.resolveComponent("a-menu-item"),a=v.resolveComponent("a-menu"),h=v.resolveComponent("a-dropdown"),d=v.resolveComponent("minus-square-outlined"),u=v.resolveComponent("pivot-filter");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",GU,[v.createElementVNode("div",UU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 横轴:"+v.toDisplayString(i.curXLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:v.withCtx(()=>t[8]||(t[8]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:v.withCtx(()=>t[9]||(t[9]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 纵轴:"+v.toDisplayString(i.data.yLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:v.withCtx(()=>t[13]||(t[13]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:v.withCtx(()=>t[14]||(t[14]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:v.withCtx(()=>t[15]||(t[15]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),v.createElementVNode("div",KU,[i.dimensionMap.length>1?(v.openBlock(),v.createElementBlock("div",YU,[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dimensionMap,(c,g)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:g},[c.drillValue?(v.openBlock(),v.createElementBlock("div",XU,[v.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),v.createTextVNode(v.toDisplayString(c.key)+"("+v.toDisplayString(c.drillValue)+") ",1)])):v.createCommentVNode("",!0)],64))),128))])):(v.openBlock(),v.createElementBlock("div",qU)),v.createElementVNode("div",ZU,null,512)]),v.withDirectives(v.createElementVNode("div",{style:v.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dropdownList,c=>(v.openBlock(),v.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+v.toDisplayString(c),9,JU))),128))],4),[[v.vShow,i.isShowMenu]])]),v.createVNode(u,{ref:"pivotFilterRef",data:i.filterData,onChange:i.onFilterChange},null,8,["data","onChange"])],64)}const tK=Ri($U,[["render",QU],["__scopeId","data-v-f29855b0"]]),eK=v.defineComponent({components:{PivotChart:tK},name:"ChartModal",props:{},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.inject("getContainer",()=>{}),o=v.ref(!1),r=v.ref({}),s=v.ref();function l(a){r.value=a,o.value=!0,v.nextTick(()=>{s.value.init()})}return v.watch(o,a=>{window.modalShow&&window.modalShow(a)}),t({showModal:l}),{theme:e,visible:o,chartOptions:r,chartRef:s,getContainer:n}}});function iK(i,t,e,n,o,r){const s=v.resolveComponent("pivot-chart"),l=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),title:"图形",style:{width:"900px"},destroyOnClose:!0,footer:null,getContainer:i.getContainer},{default:v.withCtx(()=>[v.createVNode(s,{data:i.chartOptions,ref:"chartRef"},null,8,["data"])]),_:1},8,["wrapClassName","visible","getContainer"])}const nK=Ri(eK,[["render",iK]]),WX="",oK=v.defineComponent({name:"PivotAggregate",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("scaleValue",{}),r=v.inject("theme","light"),s=v.inject("dimensionFieldList",[]),l=v.ref(!1),a=v.ref([]),h=v.ref(""),d=v.ref(""),u=v.ref(),c=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function g(){t("confirm",v.unref(a),h.value),l.value=!1}function f(C,_){a.value=Ue.cloneDeep(C),h.value=_,l.value=!0;const w=v.unref(s).find(y=>y.label===_);d.value=(w==null?void 0:w.title)||_}const p=v.ref({}),m=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body,b=C=>{var _,w,y;if(C){const S=(_=v.unref(u))==null?void 0:_.getBoundingClientRect();if(S){const R=S.left/(((w=v.unref(o))==null?void 0:w.widthScale)||1)+"px",A=(S.top+S.height)/(((y=v.unref(o))==null?void 0:y.heightScale)||1)+"px";setTimeout(()=>{var M,B;const x=document.querySelectorAll(".ant-select-dropdown"),T=Array.from(x).filter(P=>window.getComputedStyle(P).display!=="none");if(T!=null&&T.length){const P=document.getElementsByClassName("aggregate-modal")[0];T[0].classList.add("aggregate-select-dropdown"),(M=P==null?void 0:P.style)==null||M.setProperty("--drop-down-left",R),(B=P==null?void 0:P.style)==null||B.setProperty("--drop-down-top",A),p.value={visibility:"visible"}}},200)}}else p.value={}};return v.watch(l,C=>{window.modalShow&&window.modalShow(C)}),e({showModal:f}),{theme:r,visible:l,aggregationType:a,options:c,dimensionKey:h,titleText:d,dropdownStyle:p,selectRef:u,handleOk:g,getPopupContainer:m,getContainer:n,dropdownVisibleChange:b}}}),rK={ref:"selectRef"};function sK(i,t,e,n,o,r){const s=v.resolveComponent("a-select"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.titleText+"-聚合",destroyOnClose:!1,maskClosable:!1,getContainer:i.getContainer,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"聚合方式"},{default:v.withCtx(()=>[v.createElementVNode("div",rK,[v.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",mode:"multiple",dropdownClassName:"pivot-table-select-dropdown",options:i.options,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const lK=Ri(oK,[["render",sK]]),aK=v.defineComponent({name:"PivotTop",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(""),l=v.ref("");function a(){t("confirm",{value:v.unref(s),key:v.unref(l)}),r.value=!1}function h(d){const{value:u,key:c}=d;s.value=u,r.value=!0,l.value=c}return v.watch(r,d=>{window.modalShow&&window.modalShow(d)}),e({showModal:h}),{theme:n,visible:r,topNum:s,handleOk:a,getContainer:o}}});function hK(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"维度取Top"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const dK=Ri(aK,[["render",hK]]);let jr=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const VX="",jX="";Fo.locale("zh-cn");const uK=v.defineComponent({name:"PivotDetail",components:{ATable:Gi.Table,BorderOutlined:rM,SwitcherOutlined:PM,CloseOutlined:dM},props:{},setup(i,{emit:t,expose:e}){const n=`dtmodal_${jr(6)}`,o=v.ref(!1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light"),l=v.inject("pageId",""),a=v.inject("context",""),h=v.inject("indicatorUrl",""),d=v.inject("indicatorToken",""),u=v.inject("theDateInfo",{}),c=v.ref(!1),g=v.ref(!1),f=v.ref([]),p=v.ref([]),m=v.ref({current:1,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:x=>`共 ${x} 条数据`}),b=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);if(T)if(x)T.addEventListener("mousedown",_);else{const M=T.parentElement;M&&(M.style.left="",M.style.top=""),T.removeEventListener("mousedown",_)}},C=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);T&&(x?T.addEventListener("dblclick",w):T.removeEventListener("dblclick",w))},_=x=>{LC(x,`.${n} .ant-modal-header`)},w=()=>{o.value=!o.value,v.nextTick(()=>{o.value?b(!1):b(!0)})},y=()=>{o.value=!1,C(!1),b(!1)};async function S(x){var I;g.value=!0,c.value=!0;const{args:T={},dimension:M,indicator:B,splitSymbol:P,theFlag:F}=x,{originData:H=[],cellHeaderPaths:{colHeaderPaths:E=[],rowHeaderPaths:k=[]}}=T;if(H!=null&&H.length){const L=H[0],D=E!=null&&E.length?E[E.length-1]:"",O=E.filter(et=>et.dimensionKey).concat(k.filter(et=>et.dimensionKey)).map(et=>et.dimensionKey);if(!(D!=null&&D.indicatorKey)||!O.length)return;const W=B.find(et=>et.label===D.indicatorKey),N={};for(const et of M)if(O.includes(et.label)){const vt=(L[et.label]||"").split(P)||[];N[et.typeGuid]=vt!=null&&vt.length?vt[vt.length-1]:""}const{startTime:$,endTime:U,rangeFormat:Y}=v.unref(u);$&&U&&(N.startTime=Fo($).format(Y),N.endTime=Fo(U).format(Y));const j=await dr.post(`${v.unref(h)}/diagram/obtainDataSetData`,{pageId:v.unref(l),indexCode:(W==null?void 0:W.indexCode)||"",indexName:W.label,theFlag:F,param:N},{headers:{Authentication:v.unref(d),operateContext:v.unref(a)}}),{columns:G=[],data:Z=[]}=((I=j==null?void 0:j.data)==null?void 0:I.data)||{};f.value=G.filter(et=>et).map(et=>({title:et,dataIndex:et})),p.value=Z.map(et=>({...et,uid:jr(6)}))}g.value=!1,v.nextTick(()=>{C(!0),b(!0)})}const R=v.computed(()=>{let x=`detail-modal ${n}`;return o.value&&(x+=" full"),v.unref(s)&&(x+=` ${v.unref(s)}`),x});v.watch(c,x=>{window.modalShow&&window.modalShow(x)});const A=x=>{v.unref(m).current=x.current};return e({showModal:S}),{theme:s,visible:c,loading:g,pagination:m,columns:f,dataSource:p,wrapClassName:R,isIndFullScreen:o,handleTableChange:A,getContainer:r,onDetailCancel:y,toggleFullScreen:w}}}),cK={key:0,class:"spin-container"};function gK(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("a-spin"),d=v.resolveComponent("a-table"),u=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(u,{wrapClassName:i.wrapClassName,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=c=>i.visible=c),width:"40%",title:"指标明细",destroyOnClose:!0,footer:null,bodyStyle:{maxHeight:"50vh",overflow:"auto"},getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>t[2]||(t[2]=[v.createElementVNode("div",{class:"modal-title"}," 指标明细 ",-1)])),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...c)=>i.toggleFullScreen&&i.toggleFullScreen(...c))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.loading?(v.openBlock(),v.createElementBlock("div",cK,[v.createVNode(h,{size:"large"})])):v.createCommentVNode("",!0),i.loading?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(d,{key:1,"row-key":c=>c.uid,columns:i.columns,"data-source":i.dataSource,pagination:i.pagination,onChange:i.handleTableChange},null,8,["row-key","columns","data-source","pagination","onChange"]))]),_:1},8,["wrapClassName","visible","getContainer","onCancel"])}const fK=Ri(uK,[["render",gK],["__scopeId","data-v-698ec4e6"]]),pK=(i,t)=>{i.register.icon("dropdownIcon",{type:"svg",svg:`<svg width="${t.downSize}" height="${t.downSize}" 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:t.downSize,height:t.downSize,funcType:i.TYPES.IconFuncTypeEnum.dropDown,positionType:i.TYPES.IconPosition.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:t.downSize,height:t.downSize,bgColor:"rgba(101, 117, 168, 0.1)",image:`<svg width="${t.downSize}" height="${t.downSize}" 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"}),i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})},mK=v.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),vK={mounted(i){i.focus()}},bK=v.defineComponent({name:"PivotConfig",directives:{focus:vK},props:{fullMode:{type:Boolean,default:!1}},components:{VNodeRender:mK,draggable:Hb,DeleteOutlined:gM},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(),l=v.ref([]),a=v.ref([{title:"行维度",icon:v.createVNode(m$),fields:[]},{title:"列维度",icon:v.createVNode(c$),fields:[]},{title:"指标",icon:v.createVNode(V$),fields:[]}]),h=(R=[],A=[])=>{for(const x of v.unref(a))x.fields=[];for(const x of R)x.positionType==="rows"?v.unref(a)[0].fields.push(Ue.cloneDeep(x)):x.positionType==="columns"&&v.unref(a)[1].fields.push(Ue.cloneDeep(x));v.unref(a)[2].fields=Ue.cloneDeep(A),r.value=!0},d=v.computed(()=>[...v.unref(a)[0].fields.map(R=>({...R,label:R.showTitle,positionType:"rows"})),...v.unref(a)[1].fields.map(R=>({...R,label:R.showTitle,positionType:"columns"}))]),u=v.computed(()=>v.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",v.unref(d),v.unref(u)),r.value=!1},g=(R,A)=>{const x=A[R.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=()=>{l.value=[]},p=()=>{a.value=Ue.cloneDeep(v.unref(a))},m=(R,A)=>{v.unref(a)[R].fields.splice(A,1)},b=v.ref(),C=v.ref(),_=v.ref(""),w=(R,A)=>{i.fullMode&&(b.value=`${R}_${A}`,C.value=Ue.cloneDeep(v.unref(a)[R].fields[A]))},y=()=>{if(v.unref(_)){const R=v.unref(b).split("_");Gi.message.error(v.unref(_)),v.unref(a)[R[0]].fields[R[1]].showTitle=v.unref(C).showTitle,_.value=""}b.value=""},S=R=>{const A=R.target.value,x=v.unref(d).concat(v.unref(u));A?x.find(M=>M.name!==v.unref(C).name&&M.showTitle===A)&&(_.value="名称不能重复"):_.value="不能为空"};return v.watch(r,R=>{window.modalShow&&window.modalShow(R)}),e({showModal:h}),{theme:n,visible:r,fieldAreas:a,indSourceRef:s,maskList:l,currentEditItem:b,handleOk:c,onDragAreaStart:g,onDragEnd:f,handleDeleteField:m,handleEdit:w,onConfirmLabel:y,onDragAdd:p,onChangeLabel:S,getContainer:o}}}),$X="",CK={class:"config-wrap"},yK={class:"area-content"},_K={class:"area-title"},wK={class:"field-item"},SK=["onClick"];function xK(i,t,e,n,o,r){const s=v.resolveComponent("v-node-render"),l=v.resolveComponent("a-input"),a=v.resolveComponent("delete-outlined"),h=v.resolveComponent("draggable"),d=v.resolveComponent("a-button"),u=v.resolveComponent("a-modal"),c=v.resolveDirective("focus");return v.openBlock(),v.createBlock(u,{wrapClassName:`${i.theme}`,title:"设置",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:{width:"500px"},bodyStyle:{padding:0},getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(d,{onClick:t[0]||(t[0]=g=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(d,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",CK,[v.createElementVNode("div",yK,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.fieldAreas,(g,f)=>(v.openBlock(),v.createElementBlock("div",{class:"area-item",key:f},[v.createElementVNode("div",_K,[v.createVNode(s,{class:"area-icon",node:g.icon},null,8,["node"]),v.createTextVNode(" "+v.toDisplayString(g.title),1)]),v.createVNode(h,{class:"area-list",list:g.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(f),onStart:p=>i.onDragAreaStart(p,g.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:v.withCtx(({index:p,element:m})=>[v.createElementVNode("div",wK,[i.currentEditItem===`${f}_${p}`?v.withDirectives((v.openBlock(),v.createBlock(l,{key:0,size:"small",value:m.showTitle,"onUpdate:value":b=>m.showTitle=b,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel,onChange:i.onChangeLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur","onChange"])),[[c]]):(v.openBlock(),v.createElementBlock("div",{key:1,style:{width:"100%"},onClick:b=>i.handleEdit(f,p)},v.toDisplayString(m.showTitle),9,SK)),i.fullMode?(v.openBlock(),v.createBlock(a,{key:2,style:{color:"red","padding-left":"8px"},onClick:b=>i.handleDeleteField(f,p)},null,8,["onClick"])):v.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const AK=Ri(bK,[["render",xK],["__scopeId","data-v-b39c2a7b"]]),RK=v.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:Vj,CaretDownOutlined:Oj,LoadingOutlined:y$,Draggable:Hb},props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1}},setup(i,{emit:t,expose:e}){const n=v.inject("indicatorUrl",""),o=v.inject("indicatorToken",""),r=v.inject("pageId",""),s=v.inject("setItemDisabled",S=>!1),l=v.ref([]),a=v.ref(),h=v.reactive({pageSize:20,currentPage:1,totalResult:0}),d=v.ref(!1),u=v.ref(""),c=v.ref(!1);v.watch(()=>i.data,S=>{i.isSub&&(S==null||S.forEach(R=>{var A;R!=null&&R.isLeaf||(A=R.dataViewColumns)==null||A.forEach(x=>{x.show=!0,x.edit=!1,x.title&&(x.label=x.title)})}),l.value=S)},{deep:!0,immediate:!0});const g=()=>{var S;i.isSub||(S=v.unref(a))==null||S.removeEventListener("scroll",_)},f=async S=>{var A;if(v.unref(d))return;d.value=!0;const R={source:i.config.source||"INDICATOR_LIB",pageId:v.unref(r),dataSourceId:i.config.dataSourceId||"",indexName:u.value};S?(S.loading=!0,R.indexTypeGuid=S.indexTypeGuid,R.isLeaf=S.isLeaf):h&&(R.queryRequest={pageSize:h.pageSize,pageNum:h.currentPage});try{const x=await dr.post(`${v.unref(n)}/diagram/sourceList`,R,{headers:{Authentication:o,operateContext:"ygt"}}),{success:T,data:M={}}=x.data;if(T){const{rows:B=[],total:P=0}=M;B==null||B.forEach(F=>{var H;(S==null?void 0:S.isLeaf)==="1"?(H=F.dataViewColumns)==null||H.forEach(E=>{E.show=!0,E.edit=!1,E.title&&(E.label=E.title)}):F.show=!1}),S?(S.children=B,S.show=!0,B!=null&&B.length||(S.noData=!0)):(l.value=v.unref(l).concat(B),h.totalResult=+P,((A=v.unref(l))==null?void 0:A.length)>=P&&g())}S&&(S.loading=!1),d.value=!1}catch{S&&(S.loading=!1),d.value=!1}},p=async S=>{const R=l.value[S],{children:A=[]}=R;A!=null&&A.length?R.show=!R.show:!R.noData&&R.isLeaf?f(R):R.noData&&(R.show=!R.show)},m=(S,R)=>{t("onDragStart",S,R)},b=()=>{t("onDragEnd")},C=S=>{S.show=!S.show},_=S=>{S.target.scrollTop+S.target.clientHeight+20>=S.target.scrollHeight&&(h.currentPage++,f())},w=async()=>{await f(),v.nextTick(async()=>{v.unref(a).scrollHeight===v.unref(a).clientHeight&&h.totalResult>v.unref(l).length&&(h.currentPage++,w())})},y=async S=>{var R;g(),c.value=!0,h.currentPage=1,h.totalResult=0,l.value=[],u.value=S,await w(),c.value=!1,(R=v.unref(a))==null||R.addEventListener("scroll",_)};return v.onMounted(async()=>{var S;i.isSub||(w(),(S=v.unref(a))==null||S.addEventListener("scroll",_))}),v.onUnmounted(()=>{g()}),e({handleSearch:y}),{columnRef:a,sourceList:l,searchLoading:c,onToggleGroup:p,onToggleSource:C,setItemDisabled:s,onDragStart:m,onDragEnd:b,mapDataSetScope:X2,mapScope:Y2,getLoadType:q2,getUseType:Z2,getSourceType:J2}}}),GX="",TK={key:0,class:"no-data"},MK={class:"column-item"},BK=["onClick"],PK={key:3,class:"item-name"},HK={class:"column-item"},EK={key:0},LK={key:1},kK={key:2},FK={key:3},IK=["onClick"],DK={class:"item-name"},OK={class:"column-child-item"},zK={class:"field"},NK={class:"column-child-item-name"};function WK(i,t,e,n,o,r){const s=v.resolveComponent("loading-outlined"),l=v.resolveComponent("caret-down-outlined"),a=v.resolveComponent("caret-right-outlined"),h=v.resolveComponent("ind-source-list",!0),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("draggable"),c=v.resolveComponent("a-spin");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[v.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:v.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(v.openBlock(),v.createElementBlock("div",TK,"暂无数据")):i.hasChildren?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:1},v.renderList(i.sourceList,(f,p)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:f.indexTypeGuid||f.id},[v.createElementVNode("div",MK,[v.createElementVNode("span",{class:"item-group",onClick:m=>i.onToggleGroup(p)},[f.loading?(v.openBlock(),v.createBlock(s,{key:0})):f.show?(v.openBlock(),v.createBlock(l,{key:1})):(v.openBlock(),v.createBlock(a,{key:2})),f.isLeaf?(v.openBlock(),v.createElementBlock("span",PK,v.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):v.createCommentVNode("",!0)],8,BK)]),f.show?(v.openBlock(),v.createBlock(h,{key:0,data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",config:i.config,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","config","onOnDragStart","onOnDragEnd"])):v.createCommentVNode("",!0)],64))),128)):(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:2},v.renderList(i.sourceList,f=>(v.openBlock(),v.createElementBlock("div",{key:f.id,class:v.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[v.createElementVNode("div",HK,[v.createVNode(d,null,{title:v.withCtx(()=>[v.createElementVNode("div",null,"加载类型:"+v.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(v.openBlock(),v.createElementBlock("div",EK,"数据使用系统:"+v.toDisplayString(i.getUseType(f.useType)),1)):v.createCommentVNode("",!0),f.systemSource?(v.openBlock(),v.createElementBlock("div",LK,"制度出处:"+v.toDisplayString(f.systemSource),1)):v.createCommentVNode("",!0),f.dataTo?(v.openBlock(),v.createElementBlock("div",kK,"数据来源:"+v.toDisplayString(i.getSourceType(f.dataTo)),1)):v.createCommentVNode("",!0),f.meaning?(v.openBlock(),v.createElementBlock("div",FK,"指标含义:"+v.toDisplayString(f.meaning),1)):v.createCommentVNode("",!0)]),default:v.withCtx(()=>[v.createElementVNode("span",{class:"item-group",onClick:p=>i.onToggleSource(f)},[f.show?(v.openBlock(),v.createBlock(l,{key:0})):(v.openBlock(),v.createBlock(a,{key:1})),v.createElementVNode("span",DK,v.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,IK)]),_:2},1024)]),f.show?(v.openBlock(),v.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),filter:".not-allow",onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:v.withCtx(({element:p})=>[v.createElementVNode("div",OK,[v.createElementVNode("span",zK,"【"+v.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】",1),v.createElementVNode("span",NK,v.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):v.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const VK=Ri(RK,[["render",WK],["__scopeId","data-v-aabcdc1c"]]),jK=v.defineComponent({name:"DragArea",props:{style:{type:Object,default:()=>({})},maskList:{type:Array,default:()=>[]}},setup(i,{emit:t}){return{onDragOver:s=>{s.preventDefault(),s.target.classList.add("highlight")},onDragLeave:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDragEnd:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDrop:s=>{s.preventDefault(),s.target.classList.remove("highlight");const l=Array.from(s.target.classList);l.includes("rows")?t("add","rows"):l.includes("columns")?t("add","columns"):l.includes("indicators")?t("add","indicators"):l.includes("filters")&&t("add","filters")}}}}),UX="";function $K(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"drag-area",style:v.normalizeStyle(i.style.main)},[i.maskList.includes(2)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"area-wrap filters",onDragover:t[0]||(t[0]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[1]||(t[1]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[2]||(t[2]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[3]||(t[3]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.filters)},null,36)):v.createCommentVNode("",!0),i.maskList.includes(0)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:1,class:"area-wrap rows",onDragover:t[4]||(t[4]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[5]||(t[5]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[6]||(t[6]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[7]||(t[7]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.rows)},null,36)),i.maskList.includes(1)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:2,class:"area-wrap columns",onDragover:t[8]||(t[8]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[9]||(t[9]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[10]||(t[10]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[11]||(t[11]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.columns)},null,36)),i.maskList.includes(2)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:3,class:"area-wrap indicators",onDragover:t[12]||(t[12]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[13]||(t[13]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[14]||(t[14]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[15]||(t[15]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.indicators)},null,36))],4)}const GK=Ri(jK,[["render",$K],["__scopeId","data-v-01e4c58d"]]),UK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r}=i;return async(l={},a,h)=>{var f;const d=HC(i,l),{url:u,...c}=d||{};let g=t;if(!g){const{pathname:p}=window==null?void 0:window.location;if(p){const m=p.split("/");m!=null&&m.length&&(g=m[m.length-1])}}if(u&&c){a&&a("tableChange",{type:"11",data:c}),h&&h(c);try{return await dr({url:`${e}${u}`,method:"post",headers:{Authentication:n,operateContext:o},data:{...c,dataSourceId:(r==null?void 0:r.dataSourceId)||"",pageId:g},signal:((f=window.controller)==null?void 0:f.signal)||""})}catch(p){console.error(p)}}}},KK=(i={})=>{const{indicatorUrl:t=""}=i;return async(n,o)=>{var d;const r={},{search:s}=window==null?void 0:window.location;if(s){const u=s.slice(1,s.length).split("&");for(const c of u){const g=c.split("=");r[g[0]]=g[1]}}const{keyName:l,...a}=o,h={keyName:l};n==="save"&&(h.searchMap=a);try{return await dr({url:`${t}/userSearch/${n}`,method:"post",headers:{Authentication:r.token||null},data:h,signal:((d=window.controller)==null?void 0:d.signal)||""})}catch(u){console.error(u)}}},YK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r={}}=i;return async(l={})=>{var h,d;const a=HC(i,l);try{const u=await dr({url:`${e}/diagram/obtainDrillAbleDimensionOptions`,method:"post",headers:{Authentication:n,operateContext:o},data:{source:(r==null?void 0:r.source)||"INDICATOR_LIB",pageId:t,indicatorList:(a==null?void 0:a.indicatorList)||[],classifications:(a==null?void 0:a.queryColumns)||[],dataSourceId:(r==null?void 0:r.dataSourceId)||""},signal:((h=window.controller)==null?void 0:h.signal)||""});return((d=u==null?void 0:u.data)==null?void 0:d.data)||[]}catch(u){console.error(u)}}},XK=(i={})=>{const{indicatorUrl:t="",indicatorToken:e="",context:n=""}=i;return async(r={},s)=>{var l,a;try{const h=await dr({url:`${t}${s}`,method:"post",headers:{Authentication:e,operateContext:n},data:r,signal:((l=window.controller)==null?void 0:l.signal)||""});return((a=h==null?void 0:h.data)==null?void 0:a.data)||[]}catch(h){console.error(h)}}},qK={id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:"indicator"},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:1},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""},indicatorToken:{type:String,default:""},context:{type:String,default:""},enlargeContainer:{type:String,default:"body"},globalModel:{type:Object,default:()=>new Map},isIframeMode:{type:Boolean,default:!1},showLeftTree:{type:Boolean,default:!0},allowDrill:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},relateKeyName:{type:String,default:""},usedDimensionFields:{type:Array,default:[]},allDimensions:{type:Array,default:[]},pageConfig:{type:Object,default:()=>({})},scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},defaultConfig:{type:Object,defalut:()=>({})},modalContainer:{type:String,default:"#ProviderConfig > #container"},isAllowSaveConfig:{type:Boolean,default:!0},defaultFontSize:{type:Number,default:16},theFlag:{type:String,default:""}},lb={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},ZK=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],ks=["合计","平均值","计数","最大值","最小值","方差","标准差"],JK=i=>v.defineAsyncComponent({loader:i,delay:200}),KX="",YX="",QK=v.defineComponent({name:"PivotTable",components:{PivotFilter:DT,PivotProperty:D7,ConditionalProperty:jU,ChartModal:nK,PivotAggregate:lK,PivotTop:dK,PivotConfig:AK,IndSourceList:VK,DragArea:GK,PivotDetail:fK,DrillModal:JK(()=>Promise.resolve().then(()=>cY)),SettingOutlined:k$,DatabaseOutlined:Qj,ArrowsAltOutlined:Hj,ShrinkOutlined:O$,FilterOutlined:pM,DeleteOutlined:gM,ClearOutlined:Uj},props:{...qK},setup(i,{expose:t,emit:e}){let n=null;const o=v.ref(!1),r=v.ref(""),s=v.ref({}),l=v.ref(),a=v.ref({}),h=v.ref({}),d=v.ref({}),u=v.ref(),c=v.ref({}),g=v.ref(),f=v.ref(),p=v.ref(),m=v.ref(),b=v.ref(),C=v.ref(),_=v.ref(),w=v.ref(),y=v.ref(),S=v.ref(),R=v.ref({}),A=v.ref(!1),x=v.ref({}),T=v.ref({}),M=v.ref({}),B=v.ref(),P=v.ref({}),F=v.ref("200px"),H=v.ref("200px"),E=v.ref(300),k=v.ref({}),I=v.ref(),L=v.ref(i.showLeftTree),D=v.ref(!1),O=v.ref({}),W=v.ref(0),N=v.ref(0),$=v.ref(),U=v.ref(!1),Y=v.ref(),j=v.ref(25),G=v.ref(!0),Z=v.ref({dateFormat:"YYYY-MM-DD"}),et=v.ref(16);let gt=40;const vt=6,it=10,nt=15,bt=20,Ct=24,at=v.ref([]);let rt=`|${jr(6)}|`;const ct=v.ref();v.provide("splitSymbol",rt),v.provide("indicatorUrl",i.indicatorUrl),v.provide("indicatorToken",i.indicatorToken),v.provide("theme",i.theme),v.provide("pageId",i.pageId),v.provide("context",i.context),v.provide("graphicConfig",i.graphicConfig),v.provide("theDateInfo",Z),v.provide("scaleValue",i.scaleValue),v.provide("getContainer",()=>document.querySelector(i.modalContainer)||document.body);const ht=v.ref({}),_t=()=>{const V={borderColor:v.unref(kt).borderColor};ht.value=V},ut=v.computed(()=>{let V="#ECF1F5";switch(i.theme){case"default":V="#EAF0F9";break;case"dark":V="#FFFFFF";break}return{borderColor:"#E3E3E3",headerBgColor:V,headerColor:"#252525",bodyBgColor:"#FFFFFF",bodyColor:"#252525",indicatorsHeaderBgColor:V,indicatorsHeaderColor:"#252525",indicatorsBodyBgColor:"#FFFFFF",indicatorsBodyColor:"#252525",aggregateBgColor:V,aggregateColor:"#252525",sortNotActiveColor:"#CCCCCC",sortActiveColor:"#416EFF",dropDownMenuBgColor:"#FFFFFF",dropDownMenuColor:"#141414",dropDownMenuHightLightColor:"#2E68CF"}}),It=v.ref(1),Ut=v.ref();new ResizeObserver(V=>{for(const K of V){const{width:q}=K.contentRect;Ut.value=q,It.value++,v.nextTick(()=>{SB()})}}).observe(document.body);const Tt=v.computed(()=>{const{width:V}=i;return V.includes("%")&&It.value?i.isIframeMode?Ut.value:document.querySelector(`#pivotWrap_${i.id}`).clientWidth:parseFloat(V)}),kt=v.computed(()=>{var J;const V={},{styleConfig:K}=i;let q={};(J=Object.keys(K))!=null&&J.length?q=K:q=v.unref(ut);for(const X in q)V[X]=q[X]||"transparent";return V}),oe=v.ref({}),re=()=>{const V=Zl();V&&(v.unref(oe).width=V.width+2+"px"),v.unref(oe).backgroundColor=EC(v.unref(kt).headerBgColor,2)};v.watch(()=>i.theme,()=>{n&&(n==null||n.updateOption(dt))});const ye=()=>{const{widthScale:V,heightScale:K}=i.scaleValue||{};if(V&&K){const q=+(1/V).toFixed(5),J=+(1/K).toFixed(5),X=+(parseFloat(i.width)*V).toFixed(2),Q=+(parseFloat(i.height)*K).toFixed(2);R.value={transform:`scale(${q}, ${J})`,width:X+"px",height:Q+"px",left:-(X-parseFloat(i.width))/2+"px",top:-(Q-parseFloat(i.height))/2+"px",paddingLeft:v.unref(j)+"px"},et.value=i.defaultFontSize*V,gt=(i.defaultFontSize+30)*K,dt.defaultRowHeight=gt,dt.theme.scrollStyle.width=vt*V,dt.theme.scrollStyle.scrollSliderCornerRadius=it*V,dt.theme.tooltipStyle.fontSize=et.value,j.value=(i.defaultFontSize+10)*V,pK(C7,{sortNotActiveColor:v.unref(kt).sortNotActiveColor,sortActiveColor:v.unref(kt).sortActiveColor,iconSize:nt*V,hoverSize:bt*V,downSize:Ct*V}),v.nextTick(()=>{var tt,ft,Pt,Qt,Ht,Lt,te,Ot,We,Rn,qn,ji;(ft=(tt=v.unref(S))==null?void 0:tt.style)==null||ft.setProperty("--box-tooltip-fontsize",et.value+"px"),(Qt=(Pt=v.unref(S))==null?void 0:Pt.style)==null||Qt.setProperty("--box-item-size",j.value+"px"),(Lt=(Ht=v.unref(_))==null?void 0:Ht.style)==null||Lt.setProperty("--menu-item-max-width",200*V+"px"),(Ot=(te=v.unref(_))==null?void 0:te.style)==null||Ot.setProperty("--menu-item-padding",`${i.defaultFontSize/2*V}px ${i.defaultFontSize*V}px`),(Rn=(We=v.unref(_))==null?void 0:We.style)==null||Rn.setProperty("--menu-item-font-size",(i.defaultFontSize>20?i.defaultFontSize-4:i.defaultFontSize)*V+"px"),(ji=(qn=v.unref(_))==null?void 0:qn.style)==null||ji.setProperty("--menu-item-line-height",24*K+"px"),n&&n.updateOption(dt)})}};v.watch(()=>[i.scaleValue,i.width,i.height],()=>{ye()},{deep:!0});const Oe=v.computed(()=>{var V,K,q;return i.fullMode&&!((V=dt.rows)!=null&&V.length)&&!((K=dt.columns)!=null&&K.length)&&!((q=dt.indicators)!=null&&q.length)}),Be=v.computed(()=>{var V;return{width:(V=i.width)!=null&&V.includes("%")?"calc(100%)":parseFloat(i.width)-v.unref(E)+"px",height:"100%",backgroundColor:i.theme==="darkBlue"?"#081653":"#F1F1F1",color:i.theme==="darkBlue"?"#b2c3dd":""}}),Ee=v.computed(()=>{const V={fontSize:et.value+"px"};return v.unref(L)&&(i.theme==="darkBlue"?V.color="#00CCFF":V.color="#416EFF"),V}),At=v.ref([]),mt=v.ref([]);v.provide("dimensionFieldList",At),v.provide("indicatorFieldList",mt);const Bt="-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol",Kt=v.computed(()=>v.unref(At).filter(V=>V.isInnerFilter).concat(v.unref(mt).filter(V=>V.isInnerFilter)).sort((V,K)=>V.timeStamp-K.timeStamp));v.watchEffect(()=>{var J,X,Q,tt,ft,Pt,Qt,Ht,Lt,te;const{dropDownMenuBgColor:V,dropDownMenuColor:K,dropDownMenuHightLightColor:q}=kt.value;V&&((X=(J=v.unref(_))==null?void 0:J.style)==null||X.setProperty("--menu-bg-color",V)),K&&((tt=(Q=v.unref(_))==null?void 0:Q.style)==null||tt.setProperty("--menu-color",K)),q&&((Pt=(ft=v.unref(_))==null?void 0:ft.style)==null||Pt.setProperty("--menu-hight-light-color",q)),F.value&&((Ht=(Qt=v.unref(_))==null?void 0:Qt.style)==null||Ht.setProperty("--sub-menu-left",F.value)),H.value&&((te=(Lt=v.unref(_))==null?void 0:Lt.style)==null||te.setProperty("--sub-menu-top",H.value))});const qt=v.ref([]),fe=v.ref({}),Yt=v.ref({}),Nt=v.reactive({cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderBgColor:v.unref(kt).headerBgColor},color(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderColor:v.unref(kt).headerColor},borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},cornerHeaderStyle:{bgColor(){return v.unref(kt).headerBgColor},color:v.unref(kt).headerColor,borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},bodyStyle:{borderColor:v.unref(kt).borderColor,color(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyColor:v.unref(kt).bodyColor},bgColor(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateBgColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyBgColor:v.unref(kt).bodyBgColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},rowHeaderStyle:{borderColor:v.unref(kt).borderColor,bgColor(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateBgColor:v.unref(kt).bodyBgColor},color(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateColor:v.unref(kt).bodyColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},frameStyle:{borderLineWidth:1,borderColor:v.unref(kt).borderColor},scrollStyle:{width:vt,scrollSliderCornerRadius:it},tooltipStyle:{fontSize:v.unref(et)}}),dt=v.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",heightMode:"standard",defaultRowHeight:gt,defaultColWidth:360,menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:Nt}),Ft=v.computed(()=>{let V=0;return v.unref(L)&&i.fullMode&&(V=v.unref(E)),V}),$t=v.computed(()=>{let V=0;return v.unref(D)&&(V=20),V}),ae=5,Ti=v.ref({});v.watch(A,V=>{if(V){const K={};v.nextTick(()=>{var X,Q;const q=Zl();let J=0;(X=v.unref(Kt))!=null&&X.length&&(J=(Q=v.unref($))==null?void 0:Q.clientHeight),q&&(K.width=q.width+"px",K.height=q.height+"px",K.top=q.top+J+v.unref($t)+"px",K.left=q.left+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"),Ti.value=K})}});const Lo=v.ref([]),Xn=v.ref([]),$r=v.ref({}),An=v.ref({}),Fs=v.ref([]),Kl=v.ref([]),Yl=v.ref([]),Xl=v.ref([]),gY=v.computed(()=>{const V=[];for(const Q of v.unref(Lo)){const{data:tt,indicatorKey:ft="",calculateType:Pt=""}=Q||{};V.push({label:tt.indicatorKey,columnName:tt.indicatorKey,location:"LEFT",show:!0,calcType:"BUILT_IN",builtInFormula:Pt,builtInValueSource:ft})}const K=[],q={};v.unref(Xn).forEach(Q=>{q[Q.key]||(q[Q.key]=[]),q[Q.key].push(Q)});for(const Q in q){const tt=q[Q]||[];tt.forEach((ft,Pt)=>{var Ot;const Qt=v.unref(At).find(We=>We.label===ft.key),Ht=v.unref(mt).find(We=>We.label===ft.key),Lt=Qt||Ht,te={};Pt<tt.length-1&&(te.join="&&"),(Lt==null?void 0:Lt.genericType)==="DATE"&&(te.dateFormat=((Ot=v.unref(Z))==null?void 0:Ot.dateFormat)||"YYYY-MM-DD",Pt===0?te.prop="startTime":Pt===1&&(te.prop="endTime")),Lt&&K.push({fieldName:Lt.name,fieldType:Lt.genericType,fieldValue:Array.isArray(ft.value)?ft.value.join(","):ft.value,hrpIndexCode:Lt.indexCode,hrpIndexCodeNum:Lt.indexCodeNum,id:Lt.id,label:Lt.label,rule:ft.rule,targetSource:"",typeGuid:ft.typeGuid||"",type:ft.type,...te})})}const J=[];if(Object.keys(v.unref($r)))for(const Q in v.unref($r))v.unref($r)[Q]&&J.push({key:Q,num:v.unref($r)[Q],rule:"TOP"});const X=[];if(Object.keys(v.unref(An)))for(const Q in v.unref(An)){const{order:tt,type:ft,columnData:Pt,columnHeader:Qt}=v.unref(An)[Q];if(tt.toLowerCase()==="default-sort")continue;const Ht={label:Q,order:tt.toUpperCase(),type:"COMBINATION",fieldType:ft};ft==="indicators"&&(Ht.columnHeader=Qt,Ht.columnData=Pt,Ht.type="NORMAL"),X.push(Ht)}return{calc:V,filter:K,truncations:J,sorts:X,aggregateMethod:v.unref(P)||{}}}),fY=XK(i),pY=YK(i),mY=UK(i),hb=KK(i),db=v.ref({}),ub=v.ref({}),vY=async()=>{var q;const V=v.unref(mt).filter(J=>J.calcType==="FORMULA");let K;if(V!=null&&V.length&&(K=await fY({indicatorList:v.unref(mt).map(J=>{const X={calcType:J.calcType||"COLUMN",columnName:J.name,label:J.label,location:J.location,show:J.show};return J.indexCode&&(X.hrpIndexCode=J.indexCode),J.indexCodeNum&&(X.hrpIndexCodeNum=J.indexCodeNum),J.formula&&(X.formula=J.formula),X})},"/diagram/obtainIndexDrillDetail")),K!=null&&K.length){const J={};for(const X of K)(q=X.detailList)!=null&&q.length&&(J[X.label]=X.detailList);ub.value=J}};v.watch(()=>mt.value,()=>{vY()},{deep:!0});const gr=async()=>{var Pt,Qt,Ht,Lt,te;const{dimensionList:V,graphicConfig:K={}}=i,{queryColumnList:q=[]}=K,{rows:J=[],columns:X=[]}=dt,Q=(Pt=v.unref(Yl))!=null&&Pt.length?v.unref(Yl):[],tt=(Qt=v.unref(Xl))!=null&&Qt.length?v.unref(Xl):[];if(!(Q!=null&&Q.length))for(const Ot of J)Q.push(Ot.dimensionKey);if(!(tt!=null&&tt.length))for(const Ot of X)tt.push(Ot.dimensionKey);Q!=null&&Q.length||Q.push(...V.filter(Ot=>Ot.position==="rows").map(Ot=>Ot.key)),tt!=null&&tt.length||tt.push(...V.filter(Ot=>Ot.position==="columns").map(Ot=>Ot.key));const ft=[];for(const Ot in v.unref(a))ft.push({type:"dimension",key:Ot,rule:v.unref(a)[Ot]});for(const Ot in v.unref(h))ft.push({type:"indicators",key:Ot,rule:v.unref(h)[Ot]});if(ft!=null&&ft.length&&cb(ft,{isHandle:!1}),q!=null&&q.length)for(const Ot of q)!Q.includes(Ot.name)&&!tt.includes(Ot.name)&&Q.push(Ot.name);db.value={...v.unref(gY),rowDimensionKeys:Q,colDimensionKeys:tt,dimensions:(Ht=v.unref(Fs))!=null&&Ht.length?v.unref(Fs):v.unref(At),indicators:(Lt=v.unref(Kl))!=null&&Lt.length?v.unref(Kl):v.unref(mt)};try{const Ot=await mY({pivotTableCal:v.unref(db)},e,We=>{var Rn;if(v.unref(G)){const{sqlConditions:qn=[],queryColumns:ji=[]}=We,Xe=vB(qn),oi=ji.find($i=>$i.typeGuid==="the_date");if(oi&&(Z.value={dateFormat:oi.dateFormat||"YYYY-MM-DD"}),Xe!=null&&Xe.length)for(const $i of Xe)["startTime","endTime"].includes($i.prop)&&(v.unref(Z)[$i.prop]=$i.fieldValue||"",(Rn=v.unref(Z))!=null&&Rn.rangeFormat||(v.unref(Z).rangeFormat=$i.dateFormat||"YYYY-MM-DD"));G.value=!1}});(te=Ot==null?void 0:Ot.data)!=null&&te.success&&(YY(),ct.value=""),wB(Ot)}catch(Ot){console.error(Ot)}};function vB(V){const K=[];for(const q of V)q.sqlConditions?K.push(...vB(q.sqlConditions)):q.fieldName==="the_date"&&K.push(q);return K}const bY=V=>{v.unref(Lo).find(K=>K.data.indicatorKey===V.data.indicatorKey)||Lo.value.push(V),gr()},CY=V=>{const K=v.unref(Lo).findIndex(q=>q.data.indicatorKey===V);K!==-1&&Lo.value.splice(K,1),gr()},cb=(V,{isHandle:K=!0}={})=>{let q=[];Array.isArray(V)?q=V:q=[V];for(const J of q){const{key:X="",rule:Q,type:tt=""}=J||{};let ft=Ue.cloneDeep(Q);Array.isArray(Q)||(ft=[Q]);const Pt=v.unref(At).find(Lt=>Lt.label===X),Qt=v.unref(mt).find(Lt=>Lt.label===X),Ht=Pt||Qt;if(Ht){if((Ht==null?void 0:Ht.genericType)==="DATE"&&(ft==null?void 0:ft.length)===1){const Lt=ft[0].value;ft[0].rule="GREATER_EQUAL",ft[1]={rule:"LESS_EQUAL",value:Lt}}for(let Lt=v.unref(Xn).length-1;Lt>=0;Lt--){const te=v.unref(Xn)[Lt];te.key===X&&te.type===tt&&v.unref(Xn).splice(Lt,1)}for(const Lt of ft){const{rule:te,value:Ot}=Lt;X&&te&&Ot&&Xn.value.push({key:X,rule:te,value:Ot,type:tt,typeGuid:Ht.typeGuid})}}}K&&gr()},yY=()=>{$r.value=v.unref(x)||{},gr()},bB=V=>{const{key:K,order:q,type:J,columnData:X=[]}=V;if(J==="indicators"){let Q="";for(const tt in v.unref(An))v.unref(An)[tt].type==="indicators"&&(Q=tt);Q&&delete v.unref(An)[Q]}v.unref(An)[K]={order:q,type:J,columnData:X},gr()},ql=()=>{const V=v.unref(At),K=v.unref(mt),q=V.filter(X=>X.positionType==="rows").map(X=>X.name),J=V.filter(X=>X.positionType==="columns").map(X=>X.name);Fs.value=Ue.cloneDeep(V),Kl.value=Ue.cloneDeep(K),Yl.value=Ue.cloneDeep(q),Xl.value=Ue.cloneDeep(J),gr()};function _Y(V,K=!0,q=-1){if(q>-1)dt.indicators.splice(q,0,...V);else for(const J of V)dt.indicators.push(J);K&&n.updateOption(dt)}function wY({label:V,calcType:K}){const q=[],J=[],X=[],Q=v.unref(ub)[V],tt=v.unref(Yt)[V]||[];for(const ft in lb)tt.indexOf(ft)===-1&&X.push({text:lb[ft],menuKey:ft});return Q!=null&&Q.length&&(J.push({text:"公式:"+Q[0],menuKey:"formula"}),Q.forEach((ft,Pt)=>{const Qt=v.unref(mt).find(Ht=>Ht.label===ft);Pt>0&&!Qt.show&&J.push({text:ft,menuKey:ft})}),q.push({text:"详情",menuKey:"detail",children:J})),[...q,{text:"计算",menuKey:"calculate",children:X},...ZK]}function gf(V){var q;let K=[];if(V!=="rows"&&(K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}]),i.fullMode||i.allowDrill)if(v.unref(at)&&Array.isArray(v.unref(at)))if((q=v.unref(at))!=null&&q.length){const J=v.unref(at).map(X=>({text:X.title||X.label,menuKey:V==="rows"?`${rt}${X.label}`:X.label}));V==="rows"?K=J:K[0].children=J}else K.splice(0,1);else K.splice(0,1);else K.splice(0,1),K.splice(-1,1);return K}function SY(V,K){A.value=!0,v.unref(P)[K]=V||[],hn({type:"9",data:{key:K,types:V}}),gr()}function xY(V,K=!0){var q;for(const J of V){const{key:X,name:Q,type:tt,dimensionKey:ft,width:Pt}=J;let Qt;if(ft)Qt=J;else{const Ht={dimensionKey:X,title:Q,width:Pt?`${Pt}%`:"auto",type:tt};tt==="columns"?Ht.headerStyle={textStick:!0}:tt==="rows"&&(Ht.cornerHeaderIcon="sortNormal"),Qt=Ht}if(Qt&&(Qt.headerStyle={textStick:!0},Qt.headerFormat||(Qt.headerFormat=Ht=>{if(tt==="rows"){const Lt=Ht==null?void 0:Ht.split(rt);return Lt!=null&&Lt.length?Lt[Lt.length-1]:Ht}else return Ht}),dt[tt].push(Qt)),(q=dt[tt])!=null&&q.length)for(const Ht of dt[tt])Ht.cornerDropDownMenu=gf(),tt==="rows"&&(Ht.dropDownMenu=gf("rows"));dt.dataConfig.sortRules.push({sortField:X,sortType:v.unref(r)})}K&&n.updateOption(dt),v.nextTick(()=>{yB()})}function CB(V){const K={},{records:q}=dt;for(const J of q)for(const X of V)Mn(K,X)?K[X].find(Q=>Q.value===J[X])||K[X].push(gb({value:J[X]})):K[X]=gb([{value:J[X]}]);return K}function gb(V){const K=Ue.cloneDeep(V);if(typeof V=="object")if(Array.isArray(K))for(const J of K)q(J);else q(K);function q(J){for(const X in J)if(typeof J[X]=="string"){const Q=J[X].split(rt);Q!=null&&Q.length&&(J[X]=Q[Q.length-1])}}return K}function yB(){const{dataset:{columns:V,rows:K}}=n,q=K.concat(V);s.value=CB(q)}const _B=v.computed(()=>{var V;return(V=v.unref(At))!=null&&V.length?v.unref(At).map(K=>K.label).concat(i.usedDimensionFields):i.usedDimensionFields});async function wB(V){var Ot,We,Rn,qn,ji,Xe,oi,$i;const K=await pY({pivotTableCal:v.unref(db)});at.value=K.filter(Wt=>!v.unref(_B).includes(Wt.label));let q=V;V?Y.value=Ue.cloneDeep(V):q=Ue.cloneDeep(v.unref(Y)),A.value=!0;const{data:J={}}=(q==null?void 0:q.data)||{},{rows:X=[]}=J,Q=[],tt=[];for(const Wt of v.unref(At)){if(!Wt.show)continue;const ie=dt[Wt.positionType].find(Ze=>Ze.dimensionKey===Wt.label);ie?tt.push({...ie,title:Wt.showTitle}):tt.push({key:Wt.label,name:Wt.showTitle,type:Wt.positionType,width:Wt.width})}for(let Wt=0;Wt<v.unref(mt).length;Wt++){const ie=v.unref(mt)[Wt];if(!ie.show)continue;const Ze=wY(ie),Ge=dt.indicators.find(Fi=>Fi.indicatorKey===ie.label);let ze={};Ge?ze={...Ge,dropDownMenu:Ze,title:ie.showTitle}:ze={indicatorKey:ie.label,title:ie.showTitle,width:ie!=null&&ie.width?`${ie.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Ze},ze&&(ze.style={padding:[16,28,16,28],textAlign:"right"},ze.format||(ze.format=(Fi,Tn,Jh,Qh)=>{const bb=Qh.getRecordByCell(Tn,Jh)||[];return bb[0]&&isNaN(+bb[0][ie.label])?bb[0][ie.label]:Fi||"-"}),Q.push(ze))}const ft=tt.filter(Wt=>Wt.type==="rows");if(((Ot=dt==null?void 0:dt.rows)==null?void 0:Ot.length)!==ft.length&&typeof((We=v.unref(B))==null?void 0:We.col)=="number"&&(v.unref(B).col+=ft.length-(((Rn=dt==null?void 0:dt.rows)==null?void 0:Rn.length)||0)),dt.indicators=[],dt.rows=[],dt.columns=[],(qn=v.unref(Lo))!=null&&qn.length){for(const Wt of v.unref(Lo))if(!isNaN(+Wt.position)){const ie={...Wt.data,calculateType:Wt.calculateType};["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(ie.calculateType)&&PB(ie,Wt.data.formatConfig),Q.splice(+Wt.position,0,ie)}}const{sortType:Pt,col:Qt,row:Ht}=v.unref(B)||{};for(const Wt of Q)Wt&&(Wt.headerIcon=ie=>{const{col:Ze,row:Ge}=ie;if(Qt===Ze&&Ht===Ge){let ze="sortNormal";return Pt==="ASC"?ze="sortUp":Pt==="DESC"&&(ze="sortDown"),ze}else return"sortNormal"});_Y(Q,!1),xY(tt,!1);const Lt=[],te=tt.filter(Wt=>Wt.type==="rows").map(Wt=>Wt.key||Wt.dimensionKey);for(const Wt of X)for(const ie in Wt)if(!ks.includes(Wt[ie])){const Ze=te.indexOf(ie);if(Ze!==-1){const Ge=[];for(let ze=0;ze<=Ze;ze++){const Fi=String(Wt[te[ze]]);if(Fi.includes(rt)){const Tn=Fi.split(rt);Tn!=null&&Tn.length&&Ge.push(Tn[Tn.length-1])}else Ge.push(Fi)}Ge!=null&&Ge.length&&(Wt[ie]=Ge.join(rt))}}for(const Wt of tt){const ie=(Wt==null?void 0:Wt.key)||(Wt==null?void 0:Wt.dimensionKey);if(Wt.type==="columns"&&!v.unref(M)[ie])v.unref(M)[ie]=fb("",ie,X);else if(Wt.type==="rows")if(v.unref(T)[ie]){const{type:Ze}=v.unref(T)[ie]||{};Lt.push(fb(Ze,ie,X))}else if(!v.unref(B)||v.unref(B).sortField===ie||!n)Lt.push(fb("",ie,X));else{const Ze=dt.dataConfig.sortRules.find(Ge=>Ge.sortField===ie);Ze&&Lt.push(Ze)}}if(v.unref(B)&&Lt.push(v.unref(B)),(ji=Object.keys(v.unref(M)))!=null&&ji.length)for(const Wt in v.unref(M))Lt.push(v.unref(M)[Wt]);if(dt.records=X,dt.dataConfig.sortRules=Lt,X!=null&&X.length&&(v.unref(O).records=[]),(Xe=dt.columns)!=null&&Xe.length?dt.columnHeaderTitle=!0:(oi=dt.indicators)!=null&&oi.length?dt.columnHeaderTitle=!1:($i=dt.rows)!=null&&$i.length&&(dt.columnHeaderTitle=!0),n)n.updateOption(dt),v.nextTick(()=>{xB()}),A.value=!1;else{const Wt=document.getElementById(`pivotTableContainer_${i.id}`);n=new LT(Wt,dt),v.nextTick(()=>{xB(),o.value=!0,A.value=!1,i.isIframeMode&&(v.unref(W)&&n.setScrollTop(v.unref(W)),v.unref(N)&&n.setScrollLeft(v.unref(N)))}),FY()}v.nextTick(()=>{const{indexFormatConfig:Wt}=(i==null?void 0:i.defaultConfig)||{};if(Wt){const ie=[];for(const Ze in Wt)Wt[Ze]&&ie.push(Wt[Ze]);BB(ie)}})}const Gr=v.ref({});function SB(){Zl()&&(v.unref(D)?(v.unref(Gr).top=v.unref($t)+"px",v.unref(Gr).left="0"):(v.unref(Gr).top="0",v.unref(Gr).left="0"))}function xB(){var V;if(n&&!((V=dt.records)!=null&&V.length)){const{dataset:{rows:K}}=n,q={};for(const J of K)q[J]="";v.unref(O).dataConfig={...dt.dataConfig,filterRules:[]},v.unref(O).records=[q],n.updateOption({...dt,...v.unref(O)})}}function AY(V,K){A.value=!0,hn({type:"3",data:{type:"indicators",key:V,rule:K}}),cb({type:"indicators",key:V,rule:K})}function RY(V,K){A.value=!0,hn({type:"3",data:{type:"dimension",key:V,rule:K}}),cb({type:"dimension",key:V,rule:K})}function TY(V,K){var Q;let q=!1;const J=dt[K].findIndex(tt=>tt.dimensionKey===V),X=dt.dataConfig.sortRules.findIndex(tt=>tt.sortField===V);if(J!==-1){if(dt[K].splice(J,1),i.fullMode||i.allowDrill){const tt=v.unref(At).findIndex(ft=>ft.label===V);tt!==-1&&(v.unref(At)[tt].isInnerFilter?(v.unref(At)[tt].show=!1,q=!0):v.unref(At).splice(tt,1))}else for(const tt of dt[K])tt.cornerDropDownMenu=gf(),K==="rows"&&(tt.dropDownMenu=gf("rows"));(Q=v.unref(B))!=null&&Q.col&&(v.unref(B).col-=1),A.value=!0,hn({type:"7"}),ql()}X!==-1&&(dt.dataConfig.sortRules[X].sortType=r),n.updateOption(dt),v.nextTick(()=>{if(yB(),!q){delete a.value[V];const tt=v.unref(Xn).findIndex(ft=>ft.key===V);tt!==-1&&v.unref(Xn).splice(tt,1)}})}function MY(V){const{indicators:K}=dt,q=K.findIndex(J=>J.indicatorKey===V);if(q!==-1){const J=K[q];if(K.splice(q,1),J.calculateType){const X=J.indicatorKey.split("@"+J.calculateType)[0],Q=v.unref(Yt)[X].indexOf(J.calculateType);Q!==-1&&v.unref(Yt)[X].splice(Q,1);const tt=v.unref(qt).indexOf(J.title);tt!==-1&&v.unref(qt).splice(tt,1),delete v.unref(fe)[J.title]}hn({type:"2",data:J.indicatorKey}),CY(J.indicatorKey)}}function fb(V,K,q){let J=[];const X=new Set;for(const Q of q){const tt=Q[K];tt&&!ks.includes(tt)&&X.add(tt)}return J=Array.from(X),V==="asc"?J=J.sort((Q,tt)=>Q.localeCompare(tt)):V==="desc"&&(J=J.sort((Q,tt)=>tt.localeCompare(Q))),{sortField:K,sortBy:[...J,...ks]}}function AB(V,K,q,J){A.value=!0;let{menu:{dropDownMenuHighlight:X},rows:Q}=dt;J=J+1,X=X.filter(ft=>!(ft.type==="dimension"&&ft.field===K)||ft.type==="indicator"),X.push({col:q,row:J-1,field:K,type:"dimension",menuKey:V}),dt.menu.dropDownMenuHighlight=X;const tt=Q.find(ft=>ft.dimensionKey===K);if(tt){let ft="sortNormal";V==="asc"?ft="sortUp":V==="desc"&&(ft="sortDown"),tt.cornerHeaderIcon=ft}n.updateOption(dt),V==="default-sort"?delete v.unref(T)[K]:v.unref(T)[K]={type:V},hn({type:"4",data:{key:K,order:V,type:"dimension"}}),bB({key:K,order:V,type:"dimension"})}function RB(V,K,q,J,X){var te;A.value=!0;const{menu:Q}=dt;let tt=Q.dropDownMenuHighlight,ft="";(te=dt.rows)!=null&&te.length&&(ft=dt.rows[dt.rows.length-1].dimensionKey);const Pt=q.filter((Ot,We)=>We<q.length-1),Qt=Pt.map(Ot=>({columnName:Ot.dimensionKey})),Ht=Pt.map(Ot=>Ot.value),Lt=tt.findIndex(Ot=>Ot.field===ft&&Ot.type==="dimension");Lt!==-1&&tt.splice(Lt,1),tt=tt.filter(Ot=>Ot.type==="dimension"),tt.push({col:J,row:X,field:K,type:"indicator",menuKey:V}),dt.menu.dropDownMenuHighlight=tt,n.updateOption(dt),V==="default-sort"?B.value=null:B.value={sortField:ft,sortByIndicator:K,sortType:V.toUpperCase(),query:Ht,col:J,row:X},hn({type:"4",data:{key:K,order:V,type:"indicators"}}),bB({key:K,order:V,type:"indicators",columnData:Ht,columnHeader:Qt})}function TB({dimensionKey:V,value:K=""}){const q={};v.unref(a)[V]&&(q.filterData=v.unref(a)[V]);const J=v.unref(At).find(X=>X.label===V);d.value={fieldName:K||(J==null?void 0:J.title)||V,key:V,type:"dimension",...q},v.nextTick(()=>{v.unref(u).showModal(),hn({type:"5",data:V})})}function BY(V,K){d.value={fieldName:K,key:V,type:"indicators",filterData:v.unref(h)[V]},v.nextTick(()=>{v.unref(u).showModal()})}function PY({indicatorKey:V,menuKey:K}){A.value=!0;let q=dt.indicators.length-1;const J=`${V}@${K}`,X=`${V}(${lb[K]}) fx`;v.unref(qt).push(X),v.unref(fe)[X]=J,dt.indicators.forEach((tt,ft)=>{tt.indicatorKey===V&&(q=ft+1)}),v.unref(Yt)[V]||(v.unref(Yt)[V]=[]),v.unref(Yt)[V].push(K);const Q={data:{indicatorKey:J,title:X,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28],textAlign:"right"},format:(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][J])?Ht[0][J]:tt}},position:q,indicatorKey:V,calculateType:K};if(["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(K)){const tt=Zh(V);if(tt>-1){const ft=dt.indicators[tt].formatConfig||{};Q.data.formatConfig={...ft,fieldName:J,indicatorKey:J}}}hn({type:"1",data:{indicatorKey:V,calculateType:K}}),bY(Q)}function HY(){const V=dt.rows[0]?dt.rows[0].cornerDropDownMenu:[],K=dt.columns[0]?dt.columns[0].cornerDropDownMenu:[],q=dt.rows.map(tt=>({...tt,cornerDropDownMenu:K})),J=dt.columns.map(tt=>({...tt,cornerDropDownMenu:V}));dt.columns=q,dt.rows=J;const{type:X,len:Q}=dt.aggregate||{};X&&(dt.records.splice(-Q),dt.aggregate={type:X,len:0}),dt.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},dt.dataConfig.filterRules=[],n.updateOption(dt)}function EY({indicatorKey:V,fieldName:K}){const q=Zh(V);if(q>-1){const J=dt.indicators[q].formatConfig||{};v.unref(g).showModal({...J,indicatorKey:V,fieldName:K})}}function LY(V){const K=Zh(V);if(K>-1){const q=dt.indicators[K].conditionalConfig||[];v.unref(f).showModal(V,q)}}function Zh(V){return dt.indicators.findIndex(K=>K.indicatorKey===V)}function kY(V){const K=v.unref(At)[0],q=v.unref(At).map(Q=>Q.label),J=CB(q),X={xLabel:K.label,yLabel:V,dimensionData:J,records:gb(dt.records)};v.unref(C).showModal(X)}function FY(){n.on("scroll",V=>{const{scrollDirection:K}=V;K==="vertical"?W.value=n.getScrollTop():K==="horizontal"&&(N.value=n.getScrollLeft())}),n.on("dblclick_cell",V=>{const{cellLocation:K="",field:q=""}=V;K==="body"&&!q.includes("LAST_DATA")&&!q.includes("SAME_DATA")&&!q.includes("DIFF_DATA")&&!q.includes("MOM_DATA")&&!q.includes("YOY_DATA")&&v.unref(w).showModal({args:V,splitSymbol:rt,dimension:v.unref(At),indicator:v.unref(mt),theFlag:i.theFlag})}),n.on("after_render",()=>{_t(),SB(),re(),v.nextTick(()=>{o.value=!0})}),n.on("icon_click",V=>{const{name:K,col:q,row:J}=V;if(["sortNormal","sortUp","sortDown"].includes(K)){const{rows:X,indicators:Q}=dt,tt=n.getCellValue(q,J);let ft=v.unref(At).find(te=>te.showTitle===tt);ft||(ft=v.unref(mt).find(te=>te.showTitle===tt));let Pt=ft==null?void 0:ft.label;if(v.unref(qt).includes(tt)&&(Pt=v.unref(fe)[tt]),!Pt)return;const Qt=X.find(te=>te.dimensionKey===Pt),Ht=Q.find(te=>te.indicatorKey===Pt);let Lt="default-sort";if(K==="sortUp"?Lt="desc":K==="sortDown"?Lt="default-sort":(!K||K==="sortNormal")&&(Lt="asc"),Ht){const te=n.getCellHeaderPaths(q,J);RB(Lt,Pt,(te==null?void 0:te.colHeaderPaths)||[],q,J)}else Qt&&AB(Lt,Pt,q,J)}}),n.on("show_menu",()=>{const V=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);if(V){V.classList.add("first");const K=parseFloat(V.style.left)+V.clientWidth+3;F.value=K+"px",H.value=parseFloat(V.style.top)+"px"}}),n.on("dropdown_menu_click",V=>{const{field:K,col:q,row:J}=V,{dimensionKey:X,indicatorKey:Q,value:tt}=K[K.length-1];let ft=V.menuKey,Pt=!1;ft.includes(rt)&&(Pt=!0,ft=ft.replace(rt,"")),l.value=V;const Qt=v.unref(at).find(Ht=>Ht.label===ft);if(Qt){const Ht=v.unref(At).findIndex(Lt=>Lt.label===X);if(Ht!==-1){const Lt={...Qt,show:!0,positionType:"rows",showTitle:Qt.title||Qt.label};Pt?v.unref(y).showModal({drillDimension:Lt,drillFieldData:K,usedDimensionFields:v.unref(_B),tableProps:i,splitSymbol:rt}):(At.value.splice(Ht+1,0,Lt),A.value=!0,ql()),hn({type:"8"})}}else{const Ht=Ue.cloneDeep(v.unref(mt));let Lt=0;const te=Ht.findIndex(We=>We.label===ft),Ot=Ht.findIndex(We=>We.label===Q);if(te!==-1)Ht[te].show=!0,kC(Ht,te,te>Ot?Ot+1:Ot),Lt=1;else if(ft==="formula"){const We=v.unref(ub)[Q]||[];if((We==null?void 0:We.length)>1){const Rn=We.slice(1,We.length);for(const qn of Rn){const ji=Ht.findIndex(Xe=>Xe.label===qn);ji!==-1&&!Ht[ji].show&&(Ht[ji].show=!0,kC(Ht,ji,ji>Ot?Ot+1:Ot),Lt++)}}}Lt&&(mt.value=Ht,A.value=!0,ql())}switch(ft){case"drill":alert("无维度可钻取");break;case"delete":X?TY(X,"rows"):Q&&MY(Q);break;case"asc":case"desc":case"default-sort":X?AB(ft,X,q,J):Q&&RB(ft,Q,K,q,J);break;case"filter":X?TB({dimensionKey:X}):Q&&BY(Q,tt);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":PY({indicatorKey:Q,menuKey:ft});break;case"trans":HY();break;case"property":EY({indicatorKey:Q,fieldName:tt});break;case"conditionalProperty":LY(Q);break;case"aggregate":v.unref(p).showModal(v.unref(P)[X]||[],X);break;case"top":IY(X);break;case"graph":kY(Q);break}})}function IY(V){v.unref(m).showModal({value:v.unref(x)[V]||"",key:V})}function DY(){v.unref(b).showModal(v.unref(At),v.unref(mt))}async function OY(){A.value=!0,await hb("save",{keyName:i.relateKeyName||i.keyName,data:{}}),r.value="",s.value={},a.value={},h.value={},d.value={},c.value={},x.value={},T.value={},M.value={},B.value={},P.value={},F.value="200px",H.value="200px",k.value={},L.value=i.showLeftTree,D.value=!1,O.value={},ht.value={},At.value=[],mt.value=[],qt.value=[],fe.value={},Yt.value={},Ti.value={},Lo.value=[],Xn.value=[],$r.value={},An.value={},Fs.value=[],Kl.value=[],Yl.value=[],Xl.value=[],Y.value={},Gr.value={},W.value=0,N.value=0,dt.records=[],dt.rows=[],dt.columns=[],dt.indicators=[],dt.dataConfig={sortRules:[],filterRules:[]},dt.defaultRowHeight=gt,dt.menu.dropDownMenuHighlight=[],kB(),ye(),gr()}function zY(V=[],K=[]){var Q;const q=V.concat(K).map(tt=>tt.name),J=v.unref(At).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1})),X=v.unref(mt).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1}));At.value=[...V,...J],mt.value=[...K,...X];for(const tt in v.unref(An))if(((Q=v.unref(An)[tt])==null?void 0:Q.type)==="indicators"){delete v.unref(An)[tt];break}i.fullMode||i.allowDrill?(T.value={},B.value={},M.value={},A.value=!0,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()):wB()}function NY(V){if(!v.unref(I))return;const{name:K,scope:q}=v.unref(I),J=v.unref(At).find(Pt=>Pt.name===K),X=v.unref(At).findIndex(Pt=>Pt.name===K),Q=v.unref(mt).find(Pt=>Pt.name===K),tt=v.unref(mt).findIndex(Pt=>Pt.name===K),ft={timeStamp:new Date().getTime()};if(["rows","columns"].includes(V))if(J)if(J.show){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J.positionType=V,J.show=!0,v.unref(At).push(J),v.unref(At).splice(X,1);else v.unref(At).push({...Ue.cloneDeep(v.unref(I)),...ft,positionType:V,showTitle:v.unref(I).label});else if(V==="indicators")if(Q)if(Q.show){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q.show=!0,v.unref(mt).push(Q),v.unref(mt).splice(tt,1);else v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),...ft,showTitle:v.unref(I).label});else if(V==="filters"){if(["IDX","BUILT_IN_IDX"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q?(Q.isInnerFilter=!0,Q.timeStamp=new Date().getTime()):v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft});else if(["DIM","BUILT_IN_DIM"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J?(J.isInnerFilter=!0,J.timeStamp=new Date().getTime()):v.unref(At).push({...Ue.cloneDeep(v.unref(I)),positionType:"filters",showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft})}A.value=!0,I.value=null,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()}const WY=(V=[])=>{let K=!1;for(const q of v.unref(At))if(!V.find(X=>X.typeGuid===q.typeGuid)){K=!0;break}return K};v.provide("setItemDisabled",WY);const MB=()=>{},VY=({checkKeys:V,key:K,type:q})=>{q==="dimension"?(a.value[K]=V,c.value={},RY(K,V)):q==="indicators"&&(h.value[K]=V,AY(K,V))};function BB(V){let K=V;Array.isArray(K)||(K=[V]);for(const q of K){const{indicatorKey:J}=q,X=Zh(J);if(X>-1){const Q=dt.indicators[X];Q.formatConfig=q,PB(Q,q)}}n.updateOption(dt)}function PB(V,K){const{unit:q="",format:J,floatLength:X,position:Q}=K;V.format=(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][V.indicatorKey])?Ht[0][V.indicatorKey]:(J==="integer"?tt=Math.round(Number(tt)):J==="float"&&!isNaN(X)?tt=Number(tt).toFixed(X):J==="percent"&&(X?tt=(Number(tt)*100).toFixed(X)+"%":tt=Number(tt)*100+"%"),Q==="right"?tt+q:q+tt)}}function jY(V,K=[]){const q=Zh(V);if(q>-1){const J=dt.indicators[q];J.conditionalConfig=K;const X=[];K.forEach(Q=>{let tt="";Q.conditions.forEach((ft,Pt)=>{Pt>0&&(tt+=ft.join==="and"?" && ":" || "),tt+=`value${ft.operation}${ft.value}`}),X.push(tt)}),J.style.color=({dataValue:Q})=>{let tt="#333";return K.forEach((ft,Pt)=>{ft.color&&(tt=pb(X[Pt],Q)?ft.color:tt)}),tt},J.style.textAlign=({dataValue:Q})=>{let tt="left";return K.forEach((ft,Pt)=>{ft.align&&(tt=pb(X[Pt],Q)?ft.align:tt)}),tt},J.customRender=({rect:Q,dataValue:tt})=>{let ft=[];return K.forEach((Pt,Qt)=>{if(Pt.icon&&pb(X[Qt],tt)){const Lt=K2(Pt.icon,Pt.iconColor);ft=[{type:"icon",x:Pt.align!=="right"?15:Q.width-25,y:Q.height/2-7,svg:Lt,height:14,width:14}]}}),{elements:ft,renderDefault:!0}},n.updateOption(dt)}}function pb(V,K){V=V||"true";const q=`function (value){
367
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function pU(i){var t=function(e,n){if($l(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var r=o.call(e,n||"default");if($l(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return $l(t)=="symbol"?t:t+""}function ob(i,t,e){return(t=pU(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Qg=v.defineComponent({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),background:"hsl(".concat(i.hue,", 100%, 50%)")}});return{saturationStyle:n,sliderStyle:v.computed(function(){return{top:"".concat((100-i.value)/100*i.size-5,"px"),left:"".concat(i.saturation*i.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(o){var r=o.target.getBoundingClientRect(),s=r.left,l=r.top,a=function(d){var u=d.clientX,c=d.clientY,g=u-s,f=c-l;g<0&&(g=0),f<0&&(f=0),g>i.size&&(g=i.size),f>i.size&&(f=i.size);var p=g/i.size*100,m=100-f/i.size*100;e("change",p,m)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(o),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}});function Ho(i,t){t===void 0&&(t={});var e=t.insertAt;if(i&&typeof document<"u"){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}Ho(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),Qg.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"saturation",style:v.normalizeStyle(i.saturationStyle),onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[t[1]||(t[1]=v.createElementVNode("div",{class:"saturation-white"},null,-1)),t[2]||(t[2]=v.createElementVNode("div",{class:"saturation-black"},null,-1)),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],36)},Qg.__scopeId="data-v-24517fec",Qg.__file="src/picker/Saturation.vue";var tf=v.defineComponent({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat((1-i.hue/360)*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref();return v.onMounted(function(){(function(){o.value.width=i.width,o.value.height=i.height;var r=o.value.getContext("2d"),s=r.createLinearGradient(0,0,0,i.height);s.addColorStop(0,"#FF0000"),s.addColorStop(.17,"#FF00FF"),s.addColorStop(.34,"#0000FF"),s.addColorStop(.51,"#00FFFF"),s.addColorStop(.68,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),r.fillStyle=s,r.fillRect(0,0,i.width,i.height)})()}),{canvas:o,sliderStyle:n,onSelect:function(r){var s=r.target.getBoundingClientRect().top,l=function(h){var d=h.clientY-s;d<0&&(d=0),d>i.height&&(d=i.height);var u=-100*d/i.height+100;e("change",360*u/100)},a=function(){document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)};l(r),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}}}}),mU={ref:"canvas"};Ho(".hue[data-v-78b9f4f0]{position:relative}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),tf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"hue",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",mU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},tf.__scopeId="data-v-78b9f4f0",tf.__file="src/picker/Hue.vue";var ef=v.defineComponent({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(i,t){var e=t.emit,n=v.computed(function(){return{top:"".concat(i.alpha*i.height-2,"px"),height:"".concat(4,"px")}}),o=v.ref(),r=function(){var s=o.value.getContext("2d");o.value.width=i.width,o.value.height=i.height;var l=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);s.fillStyle=s.createPattern(l,"repeat"),s.fillRect(0,0,i.width,i.height);var a=s.createLinearGradient(0,0,0,i.height);a.addColorStop(.01,"rgba(255,255,255,0)"),a.addColorStop(.99,i.color),s.fillStyle=a,s.fillRect(0,0,i.width,i.height)};return v.watch(function(){return i.color},function(){r()}),v.onMounted(function(){r()}),{canvas:o,sliderStyle:n,onSelect:function(s){var l=s.target.getBoundingClientRect().top,a=function(d){var u=d.clientY-l;u<0&&(u=0),u>i.height&&(u=i.height);var c=parseFloat((u/i.height).toFixed(2));e("change",c)},h=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",h)};a(s),document.addEventListener("mousemove",a),document.addEventListener("mouseup",h)}}}}),vU={ref:"canvas"};Ho(".alpha[data-v-24dc9656]{position:relative}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),ef.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"alpha",onMousedown:t[0]||(t[0]=v.withModifiers(function(){return i.onSelect&&i.onSelect.apply(i,arguments)},["prevent","stop"]))},[v.createElementVNode("canvas",vU,null,512),v.createElementVNode("div",{class:"slider",style:v.normalizeStyle(i.sliderStyle)},null,4)],32)},ef.__scopeId="data-v-24dc9656",ef.__file="src/picker/Alpha.vue";var tB={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},eB={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},bU={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function iB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function rb(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?iB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):iB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}var Ls=null,nB=function(i,t,e){var n=v.ref({}),o=e||{},r=o.placement,s=o.defaultStyle,l={strategy:o.strategy||"absolute",placement:r||"auto",onFirstUpdate:function(){Ls.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(a){var h=a.state,d=h.styles,u=h.placement,c=d.popper;n.value=rb(rb(rb({},c),s),{},{transformOrigin:u==="top"?"center bottom":"center top"})}}]};return v.watch(function(){return[v.unref(i),v.unref(t)]},function(a,h){var d,u=Gl(a,2),c=u[0],g=u[1],f=Gl(h,2),p=f[0],m=f[1];if(c&&g&&(p!==c||m!==p)){(d=Ls)===null||d===void 0||d.destroy();var b=c.$el||c,C=g.$el||g;v.nextTick(function(){Ls=gU(b,C,l)})}}),v.onBeforeUnmount(function(){var a;Ls&&((a=Ls)===null||a===void 0||a.destroy(),Ls=null)}),{instance:Ls,style:n}},nf=v.defineComponent({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(i,t){var e=t.emit,n=v.ref(null),o=v.ref(null),r=v.ref(!1),s=nB(n,o,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,l=v.computed(function(){return Array.isArray(i.options)&&i.options.length>1}),a=v.computed(function(){var d=i.options,u=i.showAlpha,c=i.value;return Array.isArray(d)?u?d.map(function(g){return tB[g]}).filter(function(g){return!g.includes(c)}):d.map(function(g){return eB[g]}).filter(function(g){return!g.includes(c)}):[]}),h=function(d){var u,c,g=d.target;!((u=v.unref(n))!==null&&u!==void 0&&u.isEqualNode(g))&&(!((c=v.unref(n))===null||c===void 0)&&c.contains(g))||(r.value=!1)};return v.onMounted(function(){document.addEventListener("mouseup",h,!1)}),v.onUnmounted(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:n,selectorRef:o,selectorStyle:s,isShowSelector:r,isNeedSelect:l,formatOptions:a,onShow:function(){l.value&&(r.value=!0)},onFormatChange:function(d){e("change",bU[d])}}}}),CU={class:"format"},yU={key:0,class:"arrow"},_U=["onClick"];Ho(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),nf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",CU,[v.createElementVNode("div",{class:"label",ref:"targetRef",onClick:t[0]||(t[0]=function(){return i.onShow&&i.onShow.apply(i,arguments)})},[v.createElementVNode("span",null,v.toDisplayString(i.value),1),i.isNeedSelect?(v.openBlock(),v.createElementBlock("div",yU)):v.createCommentVNode("v-if",!0)],512),v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowSelector?(v.openBlock(),v.createElementBlock("div",{key:0,class:"selector",ref:"selectorRef",style:v.normalizeStyle(i.selectorStyle)},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.formatOptions,function(s){return v.openBlock(),v.createElementBlock("div",{class:"selector-item",key:s,onClick:function(l){return i.onFormatChange(s)}},v.toDisplayString(s),9,_U)}),128))],4)):v.createCommentVNode("v-if",!0)]}),_:1})])},nf.__scopeId="data-v-5f6e8f5e",nf.__file="src/picker/input-value/FormatValue.vue";var of=v.defineComponent({name:"Input",components:{FormatValue:nf},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(i,t){var e=t.emit;return{onInput:function(n){var o;e("change",(o=n.target)===null||o===void 0?void 0:o.value)},valueStyle:v.computed(function(){return{minWidth:"".concat(i.width,"px"),maxWidth:"".concat(i.width,"px"),width:"".concat(i.width,"px")}}),onFocus:function(){e("focus")},onBlur:function(){e("blur")},onEnter:function(){e("enter")},onFormatChange:function(n){e("formatChange",n)}}}}),wU={class:"input"},SU=[".value"];function oB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Yn(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?oB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):oB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),of.render=function(i,t,e,n,o,r){var s=v.resolveComponent("FormatValue");return v.openBlock(),v.createElementBlock("div",wU,[v.createVNode(s,{value:i.format,showAlpha:i.showAlpha,options:i.formatOptions,onChange:i.onFormatChange},null,8,["value","showAlpha","options","onChange"]),v.createElementVNode("input",{class:"value",style:v.normalizeStyle(i.valueStyle),".value":i.value,onFocus:t[0]||(t[0]=function(){return i.onFocus&&i.onFocus.apply(i,arguments)}),onInput:t[1]||(t[1]=function(){return i.onInput&&i.onInput.apply(i,arguments)}),onBlur:t[2]||(t[2]=function(){return i.onBlur&&i.onBlur.apply(i,arguments)}),onKeydown:t[3]||(t[3]=v.withKeys(function(){return i.onEnter&&i.onEnter.apply(i,arguments)},["enter"]))},null,44,SU)])},of.__scopeId="data-v-2c454c00",of.__file="src/picker/input-value/InputValue.vue";var rB=function(i,t,e){return[i,t*e/((i=(2-t)*e)<1?i:2-i)||0,i/2]},sB={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},rf=function(i){i=Math.min(Math.round(i),255);var t=Math.floor(i/16),e=i%16;return"".concat(sB[t]||t).concat(sB[e]||e)},lB=function(i){var t=i.r,e=i.g,n=i.b;return isNaN(t)||isNaN(e)||isNaN(n)?"":"#".concat(rf(t)).concat(rf(e)).concat(rf(n))},Ul=function(i,t){var e;typeof(e=i)=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1&&(i="100%");var n=function(o){return typeof o=="string"&&o.indexOf("%")!==-1}(i);return i=Math.min(t,Math.max(0,parseFloat("".concat(i)))),n&&(i=parseInt("".concat(i*t),10)/100),Math.abs(i-t)<1e-6?1:i%t/parseFloat(t)},Xh=function(i,t,e){i=6*Ul(i,360),t=Ul(t,100),e=Ul(e,100);var n=Math.floor(i),o=i-n,r=e*(1-t),s=e*(1-o*t),l=e*(1-(1-o)*t),a=n%6,h=[e,s,r,r,l,e][a],d=[l,e,e,s,r,r][a],u=[r,r,l,e,e,s][a];return{r:Math.round(255*h),g:Math.round(255*d),b:Math.round(255*u)}},aB=function(i,t,e){var n,o,r=i.h,s=i.s,l=i.v,a=i.a;if(e)switch(a=(o=(n=a).toString().match(/\.(\d{1,2})(\d*)/))&&o[2].length>0?parseFloat(n.toFixed(2)):n,t){case"hsl":var h=rB(r,s/100,l/100);return"hsla(".concat(r.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(a,")");case"hsv":return"hsva(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%, ").concat(a,")");case"rgb":var d=Xh(r,s,l),u=d.r,c=d.g,g=d.b;return"rgba(".concat(u,", ").concat(c,", ").concat(g,", ").concat(a,")");default:return"".concat(lB(Xh(r,s,l))).concat(rf(255*a))}else switch(t){case"hsl":var f=rB(r,s/100,l/100);return"hsl(".concat(r.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(r.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(l),"%)");case"rgb":var p=Xh(r,s,l),m=p.r,b=p.g,C=p.b;return"rgb(".concat(m,", ").concat(b,", ").concat(C,")");default:return lB(Xh(r,s,l))}},sf=function(i){var t=i.r,e=i.g,n=i.b;t=Ul(t,255),e=Ul(e,255),n=Ul(n,255);var o,r=Math.max(t,e,n),s=Math.min(t,e,n),l=r,a=r-s,h=r===0?0:a/r;if(r===s)o=0;else{switch(r){case t:o=(e-n)/a+(e<n?6:0);break;case e:o=(n-t)/a+2;break;case n:o=(t-e)/a+4}o/=6}return{h:360*o,s:100*h,v:100*l}},hB=function(i){var t=i.h,e=i.s,n=i.l;n/=100;var o=e/=100,r=Math.max(n,.01);return e*=(n*=2)<=1?n:2-n,o*=r<=1?r:2-r,{h:+t,s:100*(n===0?2*o/(r+o):2*e/(n+e)),v:100*((n+e)/2)}},dB=function(i){var t=[];if(i.match(/^#([0-9a-fA-f]{3,4})$/g))for(var e=1;e<i.length;e++)t.push(parseInt("0x"+i[e].repeat(2)));else if(i.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var n=1;n<i.length;n+=2)t.push(parseInt("0x"+i.slice(n,n+2)));return{r:t[0],g:t[1],b:t[2],a:t[3]}},sb=function(i,t,e){if(typeof i=="string"&&i!==""){var n=lf(i,af(i),e),o=fB(n);return o==null?"":aB(o,t,e)}return""},uB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}},cB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:e,s:parseFloat(n),l:parseFloat(o),a:r}},gB=function(i){var t=Gl(i.match(/(\d(\.\d+)?)+/g),4),e=t[0],n=t[1],o=t[2],r=t[3];return{h:parseFloat(e),s:parseFloat(n),v:parseFloat(o),a:parseFloat(r)}},lf=function(i,t){if(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])switch(t){case"rgb":var e=uB(i),n=e.r,o=e.g,r=e.b,s=e.a;return Yn(Yn({},sf({r:n,g:o,b:r})),{},{a:+s});case"hsv":var l=gB(i);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var a=cB(i),h=a.h,d=a.s,u=a.l,c=a.a;return Yn(Yn({},hB({h,s:d,l:u})),{},{a:+c});default:var g=dB(i),f=g.r,p=g.g,m=g.b,b=g.a;return Yn(Yn({},sf({r:f,g:p,b:m})),{},{a:b/255})}else switch(t){case"rgb":return Yn(Yn({},sf(uB(i))),{},{a:1});case"hsv":var C=gB(i);return{h:C.h,s:C.s,v:C.v,a:1};case"hsl":return Yn(Yn({},hB(cB(i))),{},{a:1});default:return Yn(Yn({},sf(dB(i))),{},{a:1})}},af=function(i){return i.match(/^#/)?"hex":i.match(/^rgb/)?"rgb":i.match(/^hsl/)?"hsl":i.match(/^hsv/)?"hsv":"hex"},fB=function(i){var t=i.h,e=i.s,n=i.v,o=i.a;return isNaN(t)&&isNaN(e)&&isNaN(n)?null:(isNaN(t)&&(t=0),isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(o)&&(o=1),{h:t,s:e,v:n,a:o})},qh=v.defineComponent({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(i){var t=v.ref(),e=v.inject("theme",{theme:"light"}).theme,n=v.computed(function(){return parseFloat((i.width||i.size)+"")}),o=v.computed(function(){return parseFloat((i.height||i.size)+"")}),r=v.computed(function(){return{width:"".concat(v.unref(n),"px"),height:"".concat(v.unref(o),"px"),border:i.border?"1px solid ".concat(v.unref(e)==="dark"?"#434345":"#d9d9d9"):"",borderRadius:"".concat(i.borderRadius,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(e)==="dark"?"#2681ff":"#1890ff"):""}}),s=function(){var l=t.value.getContext("2d");t.value.width=v.unref(n),t.value.height=v.unref(o);var a=function(h){var d=document.createElement("canvas"),u=d.getContext("2d"),c=2*h;return d.width=c,d.height=c,u.fillStyle="#ffffff",u.fillRect(0,0,c,c),u.fillStyle="#ccd5db",u.fillRect(0,0,h,h),u.fillRect(h,h,h,h),d}(5);l.fillStyle=l.createPattern(a,"repeat"),l.fillRect(0,0,v.unref(n),v.unref(o)),l.fillStyle=i.value,l.fillRect(0,0,v.unref(n),v.unref(o))};return v.watch(function(){return i.value},function(){s()}),v.onMounted(function(){s()}),{canvas:t,colorItemStyle:r}}}),xU=["draggable"];Ho(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),qh.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("canvas",{class:"color-item",style:v.normalizeStyle(i.colorItemStyle),ref:"canvas",draggable:i.draggable},null,12,xU)},qh.__scopeId="data-v-02da71fd",qh.__file="src/color-item/ColorItem.vue";var hf=v.defineComponent({name:"Colors",components:{ColorItem:qh},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(i,t){var e=t.emit;return{onSelectColor:function(n,o){e("change",n,o)},useColors:v.computed(function(){return i.colors.map(function(n){return sb(n,"hex",!0)})})}}}),AU={class:"colors"};function pB(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),e.push.apply(e,n)}return e}function Eo(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?pB(Object(e),!0).forEach(function(n){ob(i,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):pB(Object(e)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(e,n))})}return i}Ho(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),hf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item");return v.openBlock(),v.createElementBlock("div",AU,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.useColors,function(l,a){return v.openBlock(),v.createBlock(s,{key:a,class:"color-item",size:16,value:l,border:!1,"border-radius":3,selected:i.selectedIndex===a,onClick:v.withModifiers(function(h){return i.onSelectColor(l,+a)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},hf.__scopeId="data-v-0f8b52a8",hf.__file="src/picker/Colors.vue";var df=v.defineComponent({name:"Picker",components:{Colors:hf,Saturation:Qg,Hue:tf,Alpha:ef,InputValue:of},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(i,t){var e=t.emit,n=v.computed(function(){return Eo(Eo({},i.style),{},{width:i.showAlpha?"230px":"205px"})}),o=v.ref(),r=v.ref(),s=v.ref(),l=function(){var p,m=(p=i.value)===null||p===void 0?void 0:p.trim();if(m!=null&&m!==""){var b=af(m);return fB(lf(m,b,i.showAlpha))}return null};v.watch(function(){return i.value},function(){i.value!==v.unref(s)&&(o.value=l())},{immediate:!0}),v.watch(function(){return[v.unref(o),i.format]},function(p){var m=Gl(p,2),b=m[0],C=m[1],_="";b!=null?(_=aB(Eo({},b),i.format,i.showAlpha),r.value=Eo({},b)):r.value=null,s.value=_;var w=l();JSON.stringify(b)!==JSON.stringify(w)&&JSON.stringify(b)!==JSON.stringify(C)&&e("change",_)},{immediate:!0});var a=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.h)||0}),h=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.s)||0}),d=v.computed(function(){var p;return((p=v.unref(o))===null||p===void 0?void 0:p.v)||0}),u=v.computed(function(){var p,m;return((p=v.unref(o))===null||p===void 0?void 0:p.a)!=null?(m=v.unref(o))===null||m===void 0?void 0:m.a:1}),c=v.computed(function(){return Xh(v.unref(a),v.unref(h),v.unref(d))}),g=v.computed(function(){return"rgb(".concat(v.unref(c).r,", ").concat(v.unref(c).g,", ").concat(v.unref(c).b,")")}),f=v.ref(-1);return{h:a,s:h,v:d,a:u,rgbStr:g,onSelectSaturation:function(p,m){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:p,v:m,a:v.unref(u)}:o.value=Eo(Eo({},v.unref(o)),{},{s:p,v:m})},onSelectHue:function(p){f.value=-1,v.unref(o)==null&&(o.value={h:p,s:v.unref(h),v:v.unref(d),a:v.unref(u)}),o.value=Eo(Eo({},v.unref(o)),{},{h:p})},onSelectAlpha:function(p){f.value=-1,v.unref(o)==null?o.value={h:v.unref(a),s:v.unref(h),v:v.unref(d),a:p}:o.value=Eo(Eo({},v.unref(o)),{},{a:p})},handleInputFormat:function(p){return i.showAlpha?tB[p]:eB[p]},colorValue:s,pickerStyle:n,onInputChange:function(p){f.value=-1,s.value=p},handleChange:function(){var p,m=(p=v.unref(s))===null||p===void 0?void 0:p.trim();if(m!==""){var b=i.showAlpha,C=af(m),_=lf(m,C,b),w=function(y){var S=y.h,R=y.s,A=y.v,x=y.a;return!(isNaN(S)||isNaN(R)||isNaN(A)||isNaN(x))}(_);w?o.value=_:v.unref(r)!=null?o.value=v.unref(r):s.value=""}else o.value=null},selectColorIndex:f,onSelectColor:function(p,m){if(f.value=m,(p=p.trim())==="")o.value=null;else{var b=af(p);b?function(C,_,w){if(C.length!==0){var y=lf(C,_,w),S=y.h,R=y.s,A=y.v;if(!(isNaN(S)||isNaN(R)||isNaN(A))){var x=1,T=y.a;isNaN(T)||(x=T),o.value={h:S,s:R,v:A,a:x}}}}(p,b,!0):o.value=null}},onFormatChange:function(p){e("formatChange",p)}}}}),RU={class:"picker-inner"},TU={class:"picker-header"};Ho(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),df.render=function(i,t,e,n,o,r){var s=v.resolveComponent("saturation"),l=v.resolveComponent("hue"),a=v.resolveComponent("alpha"),h=v.resolveComponent("input-value"),d=v.resolveComponent("Colors");return v.openBlock(),v.createElementBlock("div",{class:"picker",style:v.normalizeStyle(i.pickerStyle)},[v.createElementVNode("div",RU,[v.createElementVNode("div",TU,[v.createVNode(s,{class:"saturation",hue:i.h,saturation:i.s,value:i.v,onChange:i.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),v.createVNode(l,{class:"hue",hue:i.h,onChange:i.onSelectHue},null,8,["hue","onChange"]),i.showAlpha?(v.openBlock(),v.createBlock(a,{key:0,class:"alpha",alpha:i.a,color:i.rgbStr,onChange:i.onSelectAlpha},null,8,["alpha","color","onChange"])):v.createCommentVNode("v-if",!0)]),v.createVNode(h,{format:i.handleInputFormat(i.format),value:i.colorValue,showAlpha:i.showAlpha,width:i.showAlpha?150:125,formatOptions:i.formatOptions,onChange:i.onInputChange,onBlur:i.handleChange,onEnter:i.handleChange,onFormatChange:i.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),i.colors.length>0?(v.openBlock(),v.createBlock(d,{key:0,class:"colors",colors:i.colors,"selected-index":i.selectColorIndex,onChange:i.onSelectColor},null,8,["colors","selected-index","onChange"])):v.createCommentVNode("v-if",!0)])],4)},df.__scopeId="data-v-6ceadec6",df.__file="src/picker/Picker.vue";var uf=v.defineComponent({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(i){var t=v.inject("theme",{theme:"light"}).theme;return{addColorItemStyle:v.computed(function(){return{width:"".concat(i.size,"px"),height:"".concat(i.size,"px"),lineHeight:"".concat(i.size,"px"),boxShadow:i.selected?"0 0 3px 2px ".concat(v.unref(t)==="dark"?"#2681ff":"#1890ff"):""}})}}});Ho(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),uf.render=function(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("svg",{class:"add-color-item",style:v.normalizeStyle(i.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},t[0]||(t[0]=[v.createElementVNode("g",{class:"container"},[v.createElementVNode("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},uf.__scopeId="data-v-ceb1719c",uf.__file="src/add-color-item/AddColorItem.vue";var cf=v.defineComponent({name:"ColorPicker",components:{ColorItem:qh,Picker:df,AddColorItem:uf},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(i,t){var e=t.emit,n=v.ref([]),o=v.computed(function(){return v.unref(n).map(function(x){return sb(x,"hex",i.showAlpha)})}),r=v.ref("hex");v.watch(function(){return i.format},function(){r.value=i.format},{immediate:!0}),v.watch(function(){return i.value},function(){var x=i.value||"",T=Array.isArray(x)?x:[x];n.value=T.map(function(M){return sb(M,v.unref(r),i.showAlpha)})},{immediate:!0});var s=v.ref(void 0),l=v.computed(function(){return v.unref(n)[v.unref(s)]}),a=v.ref(!1);v.watch(function(){return i.showPicker},function(){a.value=i.showPicker},{immediate:!0});var h,d,u=v.ref(null),c=v.ref(null),g=nB(u,c,{defaultStyle:{zIndex:i.zIndex},strategy:i.position,placement:i.placement}).style,f=function(){v.unref(u)==null&&(u.value=v.unref(A)[0]),v.unref(s)==null&&(s.value=0),i.showPicker===void 0?a.value=!0:e("update:showPicker",!0)},p=function(){s.value=void 0,i.showPicker===void 0?a.value=!1:e("update:showPicker",!1),e("closePicker",v.toRaw(Array.isArray(i.value)||i.addColor?v.unref(n):v.unref(n)[0]))},m=v.ref(),b=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H;return Jg.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(P=M.target,(F=(B=P.dataset)===null||B===void 0?void 0:B.index)!=null&&F!==""){E.next=4;break}return E.abrupt("return");case 4:if(H=+F,v.unref(s)!==H){E.next=7;break}return E.abrupt("return");case 7:v.unref(s)!=null&&v.unref(s)!==H?(p(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=H,u.value=P;case 10:case"end":return E.stop()}},T)}));return function(T){return x.apply(this,arguments)}}(),C=function(){var x=ZM(Jg.mark(function T(M){var B,P,F,H,E;return Jg.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(H=M.target,!(!((B=v.unref(m))!==null&&B!==void 0&&B.isEqualNode(H))&&(!((P=v.unref(m))===null||P===void 0)&&P.contains(H)))){k.next=4;break}return k.abrupt("return");case 4:if(E=(F=v.unref(c))===null||F===void 0?void 0:F.$el,!(E!=null&&E.contains(H))){k.next=8;break}return k.abrupt("return");case 8:d&&clearTimeout(d),d=setTimeout(function(){v.unref(a)&&p()},0);case 10:case"end":return k.stop()}},T)}));return function(T){return x.apply(this,arguments)}}();v.watch(a,function(){v.unref(a)&&(f(),clearTimeout(d))});var _,w=v.ref(i.max>v.unref(n).length),y=v.computed(function(){return typeof i.popupContainer=="string"||$l(i.popupContainer)==="object"&&i.popupContainer!=null?i.popupContainer:"body"}),S=v.computed(function(){return typeof i.popupContainer=="boolean"&&i.popupContainer===!1}),R=v.computed(function(){return i.theme});v.watch(function(){return[i.theme,v.unref(c)]},function(){v.nextTick(function(){var x,T;(x=v.unref(m))===null||x===void 0||x.setAttribute("pick-colors-theme",v.unref(R)),(T=v.unref(c))===null||T===void 0||(T=T.$el)===null||T===void 0||T.setAttribute("pick-colors-theme",v.unref(R))})},{immediate:!0}),v.provide("theme",{theme:R});var A=v.ref([]);return v.onMounted(function(){document.addEventListener("mouseup",C,!1),i.showPicker&&f()}),v.onUnmounted(function(){document.removeEventListener("mouseup",C,!1),h&&(clearTimeout(h),h=null),d&&(clearTimeout(d),d=null)}),{valueList:n,colorItemSelected:function(x){return(i.addColor?v.unref(n).length>0:v.unref(n).length>1)&&v.unref(s)===x},selectedColor:l,selectedIndex:s,isShowPicker:a,addColorItemShow:w,onPickerChange:function(x){var T=v.unref(s),M=v.unref(n).slice(),B=v.unref(n).length;if(T!=null){T>=0?M[T]=x:(s.value=B,M.push(x));var P="";P=Array.isArray(i.value)||i.addColor?M:x,n.value=Array.isArray(P)?P:[P],e("update:value",P),e("change",P,x,T),i.addColor&&B>=i.max&&(w.value=!1,e("overflowMax"))}},colorPicker:m,onColorClick:b,pickerRef:c,onColorItemDragStart:function(x){x.dataTransfer.effectAllowed="move";var T=x.target;_=+T.dataset.index},onColorItemDragOver:function(x){},onColorItemDrop:function(x){var T=+x.target.dataset.index,M=fU(v.unref(n)),B=M[_];M.splice(_,1);var P=M.slice(0,T),F=M.splice(T),H=P.concat([B]).concat(F);e("update:value",H),e("change",H,H[_],_)},colorItemsRef:A,pickerStyle:g,values:o,teleportDisabled:S,toPopupContainer:y,formatValue:r,onFormatChange:function(x){r.value=x,e("formatChange",x)}}}});Ho(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),cf.render=function(i,t,e,n,o,r){var s=v.resolveComponent("color-item"),l=v.resolveComponent("add-color-item"),a=v.resolveComponent("picker");return v.openBlock(),v.createElementBlock("div",{class:"color-picker",ref:"colorPicker",onDragstart:t[0]||(t[0]=v.withModifiers(function(){return i.onColorItemDragStart&&i.onColorItemDragStart.apply(i,arguments)},["stop"])),onDragover:t[1]||(t[1]=v.withModifiers(function(){return i.onColorItemDragOver&&i.onColorItemDragOver.apply(i,arguments)},["prevent","stop"])),onDrop:t[2]||(t[2]=v.withModifiers(function(){return i.onColorItemDrop&&i.onColorItemDrop.apply(i,arguments)},["prevent","stop"])),onClick:t[3]||(t[3]=v.withModifiers(function(){return i.onColorClick&&i.onColorClick.apply(i,arguments)},["stop"]))},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.values,function(h,d){return v.openBlock(),v.createBlock(s,{class:"color-item",key:d,ref_for:!0,ref:function(u){return i.colorItemsRef[d]=u},size:i.size,width:i.width,height:i.height,value:h,selected:i.colorItemSelected(d),"data-index":d,draggable:i.valueList.length>1,format:i.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),i.addColor&&i.addColorItemShow?(v.openBlock(),v.createBlock(l,{key:0,class:"add-color-item",ref:"addColorItem",selected:i.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):v.createCommentVNode("v-if",!0),(v.openBlock(),v.createBlock(v.Teleport,{to:i.toPopupContainer,disabled:i.teleportDisabled},[v.createVNode(v.Transition,null,{default:v.withCtx(function(){return[i.isShowPicker?(v.openBlock(),v.createBlock(a,{key:0,class:"picker",style:v.normalizeStyle(i.pickerStyle),ref:"pickerRef",value:i.selectedColor,format:i.formatValue,"show-alpha":i.showAlpha,colors:i.colors,formatOptions:i.formatOptions,onChange:i.onPickerChange,onFormatChange:i.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):v.createCommentVNode("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},cf.__scopeId="data-v-3c43ade8",cf.__file="src/ColorPicker.vue";const OX="",MU=v.defineComponent({name:"ColorPick",components:{PickColors:cf},props:{value:{type:String,default:""}},setup(i,{emit:t}){const e=v.ref(i.value);v.watch(()=>i.value,o=>{e.value=o},{immediate:!0});function n(){t("changeProp",v.unref(e))}return{myValue:e,onChange:n}}}),BU={class:"color-pick"};function PU(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("pick-colors");return v.openBlock(),v.createElementBlock("div",BU,[v.createVNode(s,{class:"input",size:"small",value:i.myValue,"onUpdate:value":t[0]||(t[0]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"]),v.createVNode(l,{value:i.myValue,"onUpdate:value":t[1]||(t[1]=a=>i.myValue=a),onChange:i.onChange},null,8,["value","onChange"])])}const HU=Ri(MU,[["render",PU],["__scopeId","data-v-99378939"]]),EU=v.defineComponent({name:"Radio",props:{value:{type:String,default:""},options:{type:Array,default(){return[]}}},setup(i,{emit:t}){function e(n){t("changeProp",n.target.value)}return{onChange:e}}});function LU(i,t,e,n,o,r){const s=v.resolveComponent("a-radio-group");return v.openBlock(),v.createBlock(s,{value:i.value,size:"small",onChange:i.onChange,options:i.options,optionType:"button"},null,8,["value","onChange","options"])}const kU=Ri(EU,[["render",LU]]),zX="",FU=v.defineComponent({name:"PropertyConfig",components:{ColorPick:HU,Radio:kU},props:{config:{type:Object,default(){return{}}},selectedIndex:{type:Boolean}},setup(i){const t=v.inject("theme","light"),e=[{label:"字体颜色",key:"color",component:"color-pick"},{label:"对齐方式",key:"align",component:"radio",props:{options:[{label:"左",value:"left"},{label:"中",value:"center"},{label:"右",value:"right"}]}},{label:"图标",key:"icon",component:"radio",props:{options:[{label:"上涨",value:"increase"},{label:"下跌",value:"decline"}]}},{label:"图标颜色",key:"iconColor",component:"color-pick"}],n=v.ref([]);v.watch(()=>i.selectedIndex,()=>{if(i.selectedIndex>-1){const l=Object.keys(i.config);n.value=l}});function o(l,a){i.config[l]=a}function r(l,a){if(l.target.checked)i.config[a]="",v.unref(n).push(a);else{delete i.config[a];const h=v.unref(n).indexOf(a);v.unref(n).splice(h,1)}}const s=v.computed(()=>v.unref(t)==="darkBlue"?"#b2c3dd":"");return{formConfig:e,handleSelect:r,selectedProperty:n,onChange:o,fontColor:s}}}),IU={class:"content"},DU={class:"list"};function OU(i,t,e,n,o,r){const s=v.resolveComponent("a-checkbox");return v.openBlock(),v.createElementBlock("div",IU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor,height:"32px",lineHeight:"32px"})},"属性配置",4),v.createElementVNode("div",DU,[i.selectedIndex>-1?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:0},v.renderList(i.formConfig,({label:l,component:a,props:h,key:d},u)=>(v.openBlock(),v.createElementBlock("div",{class:"list-item",style:{display:"flex"},key:u},[v.createVNode(s,{checked:i.selectedProperty.includes(d),onChange:c=>i.handleSelect(c,d)},null,8,["checked","onChange"]),v.createElementVNode("span",{style:v.normalizeStyle({padding:"0 8px",color:i.fontColor})},v.toDisplayString(l),5),i.selectedProperty.includes(d)?(v.openBlock(),v.createBlock(v.resolveDynamicComponent(a),v.mergeProps({key:0,value:i.config[d],ref_for:!0},h,{onChangeProp:c=>i.onChange(d,c)}),null,16,["value","onChangeProp"])):v.createCommentVNode("",!0)]))),128)):v.createCommentVNode("",!0)])])}const zU=Ri(FU,[["render",OU],["__scopeId","data-v-b2df2e2d"]]),NU=v.defineComponent({name:"ConditionalProperty",props:{},components:{ConditionalItemConfig:J$,ConditionalConfig:lG,PropertyConfig:zU},setup(i,{emit:t,expose:e}){const n=v.ref(!1),o=v.ref([]),r=v.ref(-1),s=v.inject("theme","light"),l=v.inject("getContainer",()=>{});let a="";const h=v.computed(()=>v.unref(r)>-1?v.unref(o)[v.unref(r)]:{});function d(f,p=[]){a=f,o.value=p,n.value=!0}function u(f){r.value=f}function c(){t("change",a,v.unref(o)),r.value=-1,n.value=!1}function g(){r.value=-1,o.value=[]}return v.watch(n,f=>{window.modalShow&&window.modalShow(f)}),e({showModal:d}),{theme:s,visible:n,config:o,changeSelectedItem:u,selectedConfig:h,selectedIndex:r,handleOk:c,handleClear:g,getContainer:l}}}),WU={style:{display:"flex"}};function VU(i,t,e,n,o,r){const s=v.resolveComponent("conditional-item-config"),l=v.resolveComponent("conditional-config"),a=v.resolveComponent("property-config"),h=v.resolveComponent("a-button"),d=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(d,{wrapClassName:i.theme,title:"条件属性",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=u=>i.visible=u),"ok-text":"确认","cancel-text":"取消",style:{width:"950px",top:"60px",height:"700px"},maskClosable:!1,destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(h,{onClick:t[0]||(t[0]=u=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(h,{onClick:i.handleClear},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("清除筛选")])),_:1},8,["onClick"]),v.createVNode(h,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[4]||(t[4]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",WU,[v.createVNode(s,{config:i.config,onChange:i.changeSelectedItem},null,8,["config","onChange"]),v.createVNode(l,{config:i.selectedConfig.conditions,isSelected:i.selectedIndex>-1},null,8,["config","isSelected"]),v.createVNode(a,{config:i.selectedConfig,selectedIndex:i.selectedIndex},null,8,["config","selectedIndex"])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const jU=Ri(NU,[["render",VU]]),NX="",$U=v.defineComponent({name:"PivotChart",props:{data:{type:Object,default(){return{dimensionData:{},xLabel:"",yLabel:""}}}},components:{FilterOutlined:pM,MinusSquareOutlined:T$,PivotFilter:DT},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.ref();let o;const r=v.ref([]),s=v.computed(()=>{var H;return(H=v.unref(r)[v.unref(r).length-1])==null?void 0:H.key}),l=v.ref([]),a=v.ref(!1),h=v.ref(),d=v.ref({});let u={};const c=v.reactive({position:"absolute",top:"0",left:"0"});let g="",f;function p(){l.value=[],r.value=[],u={};const{dimensionData:H,xLabel:E}=i.data,k=H[E].map(I=>I.value);b(E,k),v.unref(r).push({key:E,drillValue:"",xAxisData:k}),C()}let m=[];v.onMounted(()=>{o=NB.init(n.value),w()});function b(H,E){const{yLabel:k,records:I}=i.data;let L=[];E.forEach(()=>{L.push(0)}),I.forEach(D=>{if(D[k]!==void 0){const O=E.indexOf(D[H]);if(O>-1){let W=!0;v.unref(r).forEach($=>{$.drillValue&&D[$.key]!==$.drillValue&&(W=!1)});const N=Number(D[k]);W&&!isNaN(N)&&(L[O]+=Number(N))}}}),L=L.map(D=>D.toFixed(2)),f={tooltip:{},xAxis:{data:E},yAxis:{},series:[{name:k,type:"bar",label:{show:!0,position:"top"},data:L}]},m=L,o.setOption(f)}function C(){const H=Object.keys(i.data.dimensionData),E=v.unref(r).map(I=>I.key),k=[];H.forEach(I=>{E.includes(I)||k.push(I)}),l.value=k}function _(){g="",a.value=!1}function w(){o.on("contextmenu",function(H){const{event:{event:E},name:k}=H;g=k,E.preventDefault(),c.left=E.offsetX+90+"px",c.top=E.offsetY+80+"px",a.value=!0}),document.addEventListener("click",_)}function y(H){const E=[],{records:k}=i.data;for(const I of k){let L=!0;for(const D of v.unref(r))D.drillValue&&I[D.key]!==D.drillValue&&(L=!1);L&&!E.includes(I[H])&&E.push(I[H])}return E}function S(H){v.unref(r)[v.unref(r).length-1].drillValue=g;const E=y(H);b(H,E),v.unref(r).push({key:H,drillValue:"",xAxisData:E}),C()}function R(H,E){v.unref(r).splice(H+1,v.unref(r).length-H-1),v.unref(r)[H].drillValue="";const k=y(E);b(E,k),B(),C()}function A(H,E){const k=f.series[0].data,I=f.xAxis.data,L=k.map((O,W)=>({value:O,label:I[W]}));let D;E==="asc"?H==="dimension"?D=L.sort((O,W)=>O.label.localeCompare(W.label)):D=L.sort((O,W)=>O.value-W.value):E==="desc"&&(H==="dimension"?D=L.sort((O,W)=>W.label.localeCompare(O.label)):D=L.sort((O,W)=>W.value-O.value)),f.series[0].data=D.map(O=>O.value),f.xAxis.data=D.map(O=>O.label),o.setOption(f)}function x(H){if(H==="dimension"){const E=y(v.unref(s));b(v.unref(s),E),B()}else u={},B()}function T(H){if(H==="dimension"){const E=v.unref(r)[v.unref(r).length-1].xAxisData.map(k=>({value:k}));d.value={fieldName:v.unref(s),key:v.unref(s),type:H,filterData:f.xAxis.data,valueList:E}}else H==="indicators"&&(d.value={fieldName:i.data.yLabel,key:i.data.yLabel,type:"indicators",filterData:u});v.nextTick(()=>{v.unref(h).showModal()})}function M({checkKeys:H,type:E}){E==="dimension"?b(v.unref(s),H):E==="indicators"&&(u=H,B())}function B(){const H=v.unref(r)[v.unref(r).length-1].xAxisData;let E=m.map((k,I)=>({value:k,label:H[I]}));E=E.filter(k=>P(k.value)),f.series[0].data=E.map(k=>k.value),f.xAxis.data=E.map(k=>k.label),o.setOption(f)}function P(H){let E=!1,{rule:k,value:I}=u;switch(I=Number(I),k){case"LESS":E=H<I;break;case"GREATER":E=H>I;break;case"EQUAL":E=H===I;break;case"NOT_EQUAL":E=H!==I;break;default:E=!0;break}return E}v.onBeforeUnmount(()=>{document.removeEventListener("click",_)}),t({init:p});const F=v.computed(()=>v.unref(e)==="darkBlue"?"#b2c3dd":"");return{echartRef:n,dropdownList:l,isShowMenu:a,curXLabel:s,menuStyle:c,drillDimension:S,dimensionMap:r,deleteDimension:R,handleSort:A,handleClear:x,handleFilter:T,pivotFilterRef:h,filterData:d,onFilterChange:M,fontColor:F}}}),GU={style:{display:"flex",height:"400px"}},UU={style:{flex:"0 0 200px"}},KU={style:{flex:"0 0 650px",height:"100%"}},YU={key:0,style:{display:"flex","align-items":"center"}},XU={key:0,class:"dimension-item"},qU={key:1,style:{height:"30px"}},ZU={style:{width:"100%",height:"100%"},ref:"echartRef"},JU=["onClick"];function QU(i,t,e,n,o,r){const s=v.resolveComponent("filter-outlined"),l=v.resolveComponent("a-menu-item"),a=v.resolveComponent("a-menu"),h=v.resolveComponent("a-dropdown"),d=v.resolveComponent("minus-square-outlined"),u=v.resolveComponent("pivot-filter");return v.openBlock(),v.createElementBlock(v.Fragment,null,[v.createElementVNode("div",GU,[v.createElementVNode("div",UU,[v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 横轴:"+v.toDisplayString(i.curXLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[0]||(t[0]=c=>i.handleSort("dimension","asc"))},{default:v.withCtx(()=>t[8]||(t[8]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[1]||(t[1]=c=>i.handleSort("dimension","desc"))},{default:v.withCtx(()=>t[9]||(t[9]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[2]||(t[2]=c=>i.handleFilter("dimension"))},{default:v.withCtx(()=>t[10]||(t[10]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[3]||(t[3]=c=>i.handleClear("dimension"))},{default:v.withCtx(()=>t[11]||(t[11]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4),v.createElementVNode("div",{style:v.normalizeStyle({color:i.fontColor})},[v.createTextVNode(" 纵轴:"+v.toDisplayString(i.data.yLabel)+" ",1),v.createVNode(h,null,{overlay:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{key:"asc",onClick:t[4]||(t[4]=c=>i.handleSort("indicators","asc"))},{default:v.withCtx(()=>t[12]||(t[12]=[v.createTextVNode("升序")])),_:1}),v.createVNode(l,{key:"desc",onClick:t[5]||(t[5]=c=>i.handleSort("indicators","desc"))},{default:v.withCtx(()=>t[13]||(t[13]=[v.createTextVNode("降序")])),_:1}),v.createVNode(l,{key:"filter",onClick:t[6]||(t[6]=c=>i.handleFilter("indicators"))},{default:v.withCtx(()=>t[14]||(t[14]=[v.createTextVNode("筛选")])),_:1}),v.createVNode(l,{key:"clear",onClick:t[7]||(t[7]=c=>i.handleClear("indicators"))},{default:v.withCtx(()=>t[15]||(t[15]=[v.createTextVNode("清除")])),_:1})]),_:1})]),default:v.withCtx(()=>[v.createVNode(s,{class:"filter-icon",style:v.normalizeStyle({color:i.fontColor})},null,8,["style"])]),_:1})],4)]),v.createElementVNode("div",KU,[i.dimensionMap.length>1?(v.openBlock(),v.createElementBlock("div",YU,[v.createElementVNode("span",{style:v.normalizeStyle({color:i.fontColor})},"钻取维度:",4),(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dimensionMap,(c,g)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:g},[c.drillValue?(v.openBlock(),v.createElementBlock("div",XU,[v.createVNode(d,{class:"dimension-icon",onClick:f=>i.deleteDimension(g,c.key)},null,8,["onClick"]),v.createTextVNode(v.toDisplayString(c.key)+"("+v.toDisplayString(c.drillValue)+") ",1)])):v.createCommentVNode("",!0)],64))),128))])):(v.openBlock(),v.createElementBlock("div",qU)),v.createElementVNode("div",ZU,null,512)]),v.withDirectives(v.createElementVNode("div",{style:v.normalizeStyle(i.menuStyle),class:"dropdown-menu"},[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.dropdownList,c=>(v.openBlock(),v.createElementBlock("div",{class:"item",key:c,onClick:g=>i.drillDimension(c)},"下钻"+v.toDisplayString(c),9,JU))),128))],4),[[v.vShow,i.isShowMenu]])]),v.createVNode(u,{ref:"pivotFilterRef",data:i.filterData,onChange:i.onFilterChange},null,8,["data","onChange"])],64)}const tK=Ri($U,[["render",QU],["__scopeId","data-v-f29855b0"]]),eK=v.defineComponent({components:{PivotChart:tK},name:"ChartModal",props:{},setup(i,{expose:t}){const e=v.inject("theme","light"),n=v.inject("getContainer",()=>{}),o=v.ref(!1),r=v.ref({}),s=v.ref();function l(a){r.value=a,o.value=!0,v.nextTick(()=>{s.value.init()})}return v.watch(o,a=>{window.modalShow&&window.modalShow(a)}),t({showModal:l}),{theme:e,visible:o,chartOptions:r,chartRef:s,getContainer:n}}});function iK(i,t,e,n,o,r){const s=v.resolveComponent("pivot-chart"),l=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(l,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[0]||(t[0]=a=>i.visible=a),title:"图形",style:{width:"900px"},destroyOnClose:!0,footer:null,getContainer:i.getContainer},{default:v.withCtx(()=>[v.createVNode(s,{data:i.chartOptions,ref:"chartRef"},null,8,["data"])]),_:1},8,["wrapClassName","visible","getContainer"])}const nK=Ri(eK,[["render",iK]]),WX="",oK=v.defineComponent({name:"PivotAggregate",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("getContainer",()=>{}),o=v.inject("scaleValue",{}),r=v.inject("theme","light"),s=v.inject("dimensionFieldList",[]),l=v.ref(!1),a=v.ref([]),h=v.ref(""),d=v.ref(""),u=v.ref(),c=[{label:"合计",value:"SUM"},{label:"平均值",value:"AVG"},{label:"计数",value:"COUNT"},{label:"最大值",value:"MAX"},{label:"最小值",value:"MIN"},{label:"方差",value:"VAR"},{label:"标准差",value:"STDEV"}];function g(){t("confirm",v.unref(a),h.value),l.value=!1}function f(C,_){a.value=Ue.cloneDeep(C),h.value=_,l.value=!0;const w=v.unref(s).find(y=>y.label===_);d.value=(w==null?void 0:w.title)||_}const p=v.ref({}),m=()=>document.getElementsByClassName("aggregate-modal")[0]||document.body,b=C=>{var _,w,y;if(C){const S=(_=v.unref(u))==null?void 0:_.getBoundingClientRect();if(S){const R=S.left/(((w=v.unref(o))==null?void 0:w.widthScale)||1)+"px",A=(S.top+S.height)/(((y=v.unref(o))==null?void 0:y.heightScale)||1)+"px";setTimeout(()=>{var M,B;const x=document.querySelectorAll(".ant-select-dropdown"),T=Array.from(x).filter(P=>window.getComputedStyle(P).display!=="none");if(T!=null&&T.length){const P=document.getElementsByClassName("aggregate-modal")[0];T[0].classList.add("aggregate-select-dropdown"),(M=P==null?void 0:P.style)==null||M.setProperty("--drop-down-left",R),(B=P==null?void 0:P.style)==null||B.setProperty("--drop-down-top",A),p.value={visibility:"visible"}}},200)}}else p.value={}};return v.watch(l,C=>{window.modalShow&&window.modalShow(C)}),e({showModal:f}),{theme:r,visible:l,aggregationType:a,options:c,dimensionKey:h,titleText:d,dropdownStyle:p,selectRef:u,handleOk:g,getPopupContainer:m,getContainer:n,dropdownVisibleChange:b}}}),rK={ref:"selectRef"};function sK(i,t,e,n,o,r){const s=v.resolveComponent("a-select"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme+" aggregate-modal",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:i.titleText+"-聚合",destroyOnClose:!1,maskClosable:!1,getContainer:i.getContainer,onOk:i.handleOk,onCancel:t[2]||(t[2]=d=>i.visible=!1)},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"聚合方式"},{default:v.withCtx(()=>[v.createElementVNode("div",rK,[v.createVNode(s,{value:i.aggregationType,"onUpdate:value":t[0]||(t[0]=d=>i.aggregationType=d),allowClear:"",mode:"multiple",dropdownClassName:"pivot-table-select-dropdown",options:i.options,getPopupContainer:i.getPopupContainer,dropdownStyle:i.dropdownStyle,onDropdownVisibleChange:i.dropdownVisibleChange},null,8,["value","options","getPopupContainer","dropdownStyle","onDropdownVisibleChange"])],512)]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","title","getContainer","onOk"])}const lK=Ri(oK,[["render",sK]]),aK=v.defineComponent({name:"PivotTop",props:{},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(""),l=v.ref("");function a(){t("confirm",{value:v.unref(s),key:v.unref(l)}),r.value=!1}function h(d){const{value:u,key:c}=d;s.value=u,r.value=!0,l.value=c}return v.watch(r,d=>{window.modalShow&&window.modalShow(d)}),e({showModal:h}),{theme:n,visible:r,topNum:s,handleOk:a,getContainer:o}}});function hK(i,t,e,n,o,r){const s=v.resolveComponent("a-input"),l=v.resolveComponent("a-form-item"),a=v.resolveComponent("a-form"),h=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(h,{wrapClassName:i.theme,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=d=>i.visible=d),"ok-text":"确认","cancel-text":"取消",title:"维度取Top",destroyOnClose:!0,getContainer:i.getContainer,onOk:i.handleOk},{default:v.withCtx(()=>[v.createVNode(a,null,{default:v.withCtx(()=>[v.createVNode(l,{label:"维度取Top"},{default:v.withCtx(()=>[v.createVNode(s,{value:i.topNum,"onUpdate:value":t[0]||(t[0]=d=>i.topNum=d),type:"number",style:{width:"100%"}},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const dK=Ri(aK,[["render",hK]]);let jr=(i=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(i));for(;i--;){let n=e[i]&63;n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n<63?t+="_":t+="-"}return t};const VX="",jX="";Fo.locale("zh-cn");const uK=v.defineComponent({name:"PivotDetail",components:{ATable:Gi.Table,BorderOutlined:rM,SwitcherOutlined:PM,CloseOutlined:dM},props:{},setup(i,{emit:t,expose:e}){const n=`dtmodal_${jr(6)}`,o=v.ref(!1),r=v.inject("getContainer",()=>{}),s=v.inject("theme","light"),l=v.inject("pageId",""),a=v.inject("context",""),h=v.inject("indicatorUrl",""),d=v.inject("indicatorToken",""),u=v.inject("theDateInfo",{}),c=v.ref(!1),g=v.ref(!1),f=v.ref([]),p=v.ref([]),m=v.ref({current:1,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:x=>`共 ${x} 条数据`}),b=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);if(T)if(x)T.addEventListener("mousedown",_);else{const M=T.parentElement;M&&(M.style.left="",M.style.top=""),T.removeEventListener("mousedown",_)}},C=x=>{const T=document.querySelector(`.${n} .ant-modal-header`);T&&(x?T.addEventListener("dblclick",w):T.removeEventListener("dblclick",w))},_=x=>{LC(x,`.${n} .ant-modal-header`)},w=()=>{o.value=!o.value,v.nextTick(()=>{o.value?b(!1):b(!0)})},y=()=>{o.value=!1,C(!1),b(!1)};async function S(x){var I;g.value=!0,c.value=!0;const{args:T={},dimension:M,indicator:B,splitSymbol:P,theFlag:F}=x,{originData:H=[],cellHeaderPaths:{colHeaderPaths:E=[],rowHeaderPaths:k=[]}}=T;if(H!=null&&H.length){const L=H[0],D=E!=null&&E.length?E[E.length-1]:"",O=E.filter(et=>et.dimensionKey).concat(k.filter(et=>et.dimensionKey)).map(et=>et.dimensionKey);if(!(D!=null&&D.indicatorKey)||!O.length)return;const W=B.find(et=>et.label===D.indicatorKey),N={};for(const et of M)if(O.includes(et.label)){const vt=(L[et.label]||"").split(P)||[];N[et.typeGuid]=vt!=null&&vt.length?vt[vt.length-1]:""}const{startTime:$,endTime:U,rangeFormat:Y}=v.unref(u);$&&U&&(N.startTime=Fo($).format(Y),N.endTime=Fo(U).format(Y));const j=await dr.post(`${v.unref(h)}/diagram/obtainDataSetData`,{pageId:v.unref(l),indexCode:(W==null?void 0:W.indexCode)||"",indexName:W.label,theFlag:F,param:N},{headers:{Authentication:v.unref(d),operateContext:v.unref(a)}}),{columns:G=[],data:Z=[]}=((I=j==null?void 0:j.data)==null?void 0:I.data)||{};f.value=G.filter(et=>et).map(et=>({title:et,dataIndex:et})),p.value=Z.map(et=>({...et,uid:jr(6)}))}g.value=!1,v.nextTick(()=>{C(!0),b(!0)})}const R=v.computed(()=>{let x=`detail-modal ${n}`;return o.value&&(x+=" full"),v.unref(s)&&(x+=` ${v.unref(s)}`),x});v.watch(c,x=>{window.modalShow&&window.modalShow(x)});const A=x=>{v.unref(m).current=x.current};return e({showModal:S}),{theme:s,visible:c,loading:g,pagination:m,columns:f,dataSource:p,wrapClassName:R,isIndFullScreen:o,handleTableChange:A,getContainer:r,onDetailCancel:y,toggleFullScreen:w}}}),cK={key:0,class:"spin-container"};function gK(i,t,e,n,o,r){const s=v.resolveComponent("close-outlined"),l=v.resolveComponent("switcher-outlined"),a=v.resolveComponent("border-outlined"),h=v.resolveComponent("a-spin"),d=v.resolveComponent("a-table"),u=v.resolveComponent("a-modal");return v.openBlock(),v.createBlock(u,{wrapClassName:i.wrapClassName,visible:i.visible,"onUpdate:visible":t[1]||(t[1]=c=>i.visible=c),width:"40%",title:"指标明细",destroyOnClose:!0,footer:null,bodyStyle:{maxHeight:"50vh",overflow:"auto"},getContainer:i.getContainer,onCancel:i.onDetailCancel},{title:v.withCtx(()=>t[2]||(t[2]=[v.createElementVNode("div",{class:"modal-title"}," 指标明细 ",-1)])),closeIcon:v.withCtx(()=>[v.createVNode(s,{class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])]),default:v.withCtx(()=>[v.createElementVNode("div",{class:"zoom-btn",onClick:t[0]||(t[0]=(...c)=>i.toggleFullScreen&&i.toggleFullScreen(...c))},[i.isIndFullScreen?(v.openBlock(),v.createBlock(l,{key:0,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"])):(v.openBlock(),v.createBlock(a,{key:1,class:v.normalizeClass(["modal-icon",i.theme])},null,8,["class"]))]),i.loading?(v.openBlock(),v.createElementBlock("div",cK,[v.createVNode(h,{size:"large"})])):v.createCommentVNode("",!0),i.loading?v.createCommentVNode("",!0):(v.openBlock(),v.createBlock(d,{key:1,"row-key":c=>c.uid,columns:i.columns,"data-source":i.dataSource,pagination:i.pagination,onChange:i.handleTableChange},null,8,["row-key","columns","data-source","pagination","onChange"]))]),_:1},8,["wrapClassName","visible","getContainer","onCancel"])}const fK=Ri(uK,[["render",gK],["__scopeId","data-v-698ec4e6"]]),pK=(i,t)=>{i.register.icon("dropdownIcon",{type:"svg",svg:`<svg width="${t.downSize}" height="${t.downSize}" 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:t.downSize,height:t.downSize,funcType:i.TYPES.IconFuncTypeEnum.dropDown,positionType:i.TYPES.IconPosition.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:t.downSize,height:t.downSize,bgColor:"rgba(101, 117, 168, 0.1)",image:`<svg width="${t.downSize}" height="${t.downSize}" 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"}),i.register.icon("sortDown",{name:"sortDown",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"取消排序",placement:"top"}}),i.register.icon("sortUp",{name:"sortUp",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击降序",placement:"top"}}),i.register.icon("sortNormal",{name:"sortNormal",type:"svg",positionType:i.TYPES.IconPosition.contentRight,width:t.iconSize,visibleTime:"always",height:t.iconSize,svg:`<svg t="1736221132194" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1418" width="60" height="60"><path d="M512 85.333333l256 341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1419"></path><path d="M512 938.666667l256-341.333334H256z" fill="${t.sortNotActiveColor}" p-id="1420"></path></svg>`,marginLeft:5,hover:{width:t.hoverSize,height:t.hoverSize,bgColor:"#DEE4ED80"},cursor:"pointer",tooltip:{title:"点击升序",placement:"top"}})},mK=v.defineComponent({props:{node:{type:[Object,String],required:!0}},render(){return this.node}}),vK={mounted(i){i.focus()}},bK=v.defineComponent({name:"PivotConfig",directives:{focus:vK},props:{fullMode:{type:Boolean,default:!1}},components:{VNodeRender:mK,draggable:Hb,DeleteOutlined:gM},setup(i,{emit:t,expose:e}){const n=v.inject("theme","light"),o=v.inject("getContainer",()=>{}),r=v.ref(!1),s=v.ref(),l=v.ref([]),a=v.ref([{title:"行维度",icon:v.createVNode(m$),fields:[]},{title:"列维度",icon:v.createVNode(c$),fields:[]},{title:"指标",icon:v.createVNode(V$),fields:[]}]),h=(R=[],A=[])=>{for(const x of v.unref(a))x.fields=[];for(const x of R)x.positionType==="rows"?v.unref(a)[0].fields.push(Ue.cloneDeep(x)):x.positionType==="columns"&&v.unref(a)[1].fields.push(Ue.cloneDeep(x));v.unref(a)[2].fields=Ue.cloneDeep(A),r.value=!0},d=v.computed(()=>[...v.unref(a)[0].fields.map(R=>({...R,label:R.showTitle,positionType:"rows"})),...v.unref(a)[1].fields.map(R=>({...R,label:R.showTitle,positionType:"columns"}))]),u=v.computed(()=>v.unref(a)[2].fields),c=()=>{l.value=[],t("confirm",v.unref(d),v.unref(u)),r.value=!1},g=(R,A)=>{const x=A[R.oldIndex],{scope:T}=x;["IDX","BUILT_IN_IDX"].includes(T)?l.value=[0,1]:["DIM","BUILT_IN_DIM"].includes(T)&&(l.value=[2])},f=()=>{l.value=[]},p=()=>{a.value=Ue.cloneDeep(v.unref(a))},m=(R,A)=>{v.unref(a)[R].fields.splice(A,1)},b=v.ref(),C=v.ref(),_=v.ref(""),w=(R,A)=>{i.fullMode&&(b.value=`${R}_${A}`,C.value=Ue.cloneDeep(v.unref(a)[R].fields[A]))},y=()=>{if(v.unref(_)){const R=v.unref(b).split("_");Gi.message.error(v.unref(_)),v.unref(a)[R[0]].fields[R[1]].showTitle=v.unref(C).showTitle,_.value=""}b.value=""},S=R=>{const A=R.target.value,x=v.unref(d).concat(v.unref(u));A?x.find(M=>M.name!==v.unref(C).name&&M.showTitle===A)&&(_.value="名称不能重复"):_.value="不能为空"};return v.watch(r,R=>{window.modalShow&&window.modalShow(R)}),e({showModal:h}),{theme:n,visible:r,fieldAreas:a,indSourceRef:s,maskList:l,currentEditItem:b,handleOk:c,onDragAreaStart:g,onDragEnd:f,handleDeleteField:m,handleEdit:w,onConfirmLabel:y,onDragAdd:p,onChangeLabel:S,getContainer:o}}}),$X="",CK={class:"config-wrap"},yK={class:"area-content"},_K={class:"area-title"},wK={class:"field-item"},SK=["onClick"];function xK(i,t,e,n,o,r){const s=v.resolveComponent("v-node-render"),l=v.resolveComponent("a-input"),a=v.resolveComponent("delete-outlined"),h=v.resolveComponent("draggable"),d=v.resolveComponent("a-button"),u=v.resolveComponent("a-modal"),c=v.resolveDirective("focus");return v.openBlock(),v.createBlock(u,{wrapClassName:`${i.theme}`,title:"设置",visible:i.visible,"onUpdate:visible":t[1]||(t[1]=g=>i.visible=g),"ok-text":"确认","cancel-text":"取消",maskClosable:!1,destroyOnClose:!1,style:{width:"500px"},bodyStyle:{padding:0},getContainer:i.getContainer,onOk:i.handleOk},{footer:v.withCtx(()=>[v.createVNode(d,{onClick:t[0]||(t[0]=g=>i.visible=!1)},{default:v.withCtx(()=>t[2]||(t[2]=[v.createTextVNode("取消")])),_:1}),v.createVNode(d,{type:"primary",onClick:i.handleOk},{default:v.withCtx(()=>t[3]||(t[3]=[v.createTextVNode("确定")])),_:1},8,["onClick"])]),default:v.withCtx(()=>[v.createElementVNode("div",CK,[v.createElementVNode("div",yK,[(v.openBlock(!0),v.createElementBlock(v.Fragment,null,v.renderList(i.fieldAreas,(g,f)=>(v.openBlock(),v.createElementBlock("div",{class:"area-item",key:f},[v.createElementVNode("div",_K,[v.createVNode(s,{class:"area-icon",node:g.icon},null,8,["node"]),v.createTextVNode(" "+v.toDisplayString(g.title),1)]),v.createVNode(h,{class:"area-list",list:g.fields,"item-key":"index",group:{name:"diGroup"},disabled:i.maskList.includes(f),onStart:p=>i.onDragAreaStart(p,g.fields),onEnd:i.onDragEnd,onAdd:i.onDragAdd},{item:v.withCtx(({index:p,element:m})=>[v.createElementVNode("div",wK,[i.currentEditItem===`${f}_${p}`?v.withDirectives((v.openBlock(),v.createBlock(l,{key:0,size:"small",value:m.showTitle,"onUpdate:value":b=>m.showTitle=b,onPressEnter:i.onConfirmLabel,onBlur:i.onConfirmLabel,onChange:i.onChangeLabel},null,8,["value","onUpdate:value","onPressEnter","onBlur","onChange"])),[[c]]):(v.openBlock(),v.createElementBlock("div",{key:1,style:{width:"100%"},onClick:b=>i.handleEdit(f,p)},v.toDisplayString(m.showTitle),9,SK)),i.fullMode?(v.openBlock(),v.createBlock(a,{key:2,style:{color:"red","padding-left":"8px"},onClick:b=>i.handleDeleteField(f,p)},null,8,["onClick"])):v.createCommentVNode("",!0)])]),_:2},1032,["list","disabled","onStart","onEnd","onAdd"])]))),128))])])]),_:1},8,["wrapClassName","visible","getContainer","onOk"])}const AK=Ri(bK,[["render",xK],["__scopeId","data-v-b39c2a7b"]]),RK=v.defineComponent({name:"IndSourceList",components:{CaretRightOutlined:Vj,CaretDownOutlined:Oj,LoadingOutlined:y$,Draggable:Hb},props:{data:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},isSub:{type:Boolean,default:!1},hasChildren:{type:Boolean,default:!1}},setup(i,{emit:t,expose:e}){const n=v.inject("indicatorUrl",""),o=v.inject("indicatorToken",""),r=v.inject("pageId",""),s=v.inject("setItemDisabled",S=>!1),l=v.ref([]),a=v.ref(),h=v.reactive({pageSize:20,currentPage:1,totalResult:0}),d=v.ref(!1),u=v.ref(""),c=v.ref(!1);v.watch(()=>i.data,S=>{i.isSub&&(S==null||S.forEach(R=>{var A;R!=null&&R.isLeaf||(A=R.dataViewColumns)==null||A.forEach(x=>{x.show=!0,x.edit=!1,x.title&&(x.label=x.title)})}),l.value=S)},{deep:!0,immediate:!0});const g=()=>{var S;i.isSub||(S=v.unref(a))==null||S.removeEventListener("scroll",_)},f=async S=>{var A;if(v.unref(d))return;d.value=!0;const R={source:i.config.source||"INDICATOR_LIB",pageId:v.unref(r),dataSourceId:i.config.dataSourceId||"",indexName:u.value};S?(S.loading=!0,R.indexTypeGuid=S.indexTypeGuid,R.isLeaf=S.isLeaf):h&&(R.queryRequest={pageSize:h.pageSize,pageNum:h.currentPage});try{const x=await dr.post(`${v.unref(n)}/diagram/sourceList`,R,{headers:{Authentication:o,operateContext:"ygt"}}),{success:T,data:M={}}=x.data;if(T){const{rows:B=[],total:P=0}=M;B==null||B.forEach(F=>{var H;(S==null?void 0:S.isLeaf)==="1"?(H=F.dataViewColumns)==null||H.forEach(E=>{E.show=!0,E.edit=!1,E.title&&(E.label=E.title)}):F.show=!1}),S?(S.children=B,S.show=!0,B!=null&&B.length||(S.noData=!0)):(l.value=v.unref(l).concat(B),h.totalResult=+P,((A=v.unref(l))==null?void 0:A.length)>=P&&g())}S&&(S.loading=!1),d.value=!1}catch{S&&(S.loading=!1),d.value=!1}},p=async S=>{const R=l.value[S],{children:A=[]}=R;A!=null&&A.length?R.show=!R.show:!R.noData&&R.isLeaf?f(R):R.noData&&(R.show=!R.show)},m=(S,R)=>{t("onDragStart",S,R)},b=()=>{t("onDragEnd")},C=S=>{S.show=!S.show},_=S=>{S.target.scrollTop+S.target.clientHeight+20>=S.target.scrollHeight&&(h.currentPage++,f())},w=async()=>{await f(),v.nextTick(async()=>{v.unref(a).scrollHeight===v.unref(a).clientHeight&&h.totalResult>v.unref(l).length&&(h.currentPage++,w())})},y=async S=>{var R;g(),c.value=!0,h.currentPage=1,h.totalResult=0,l.value=[],u.value=S,await w(),c.value=!1,(R=v.unref(a))==null||R.addEventListener("scroll",_)};return v.onMounted(async()=>{var S;i.isSub||(w(),(S=v.unref(a))==null||S.addEventListener("scroll",_))}),v.onUnmounted(()=>{g()}),e({handleSearch:y}),{columnRef:a,sourceList:l,searchLoading:c,onToggleGroup:p,onToggleSource:C,setItemDisabled:s,onDragStart:m,onDragEnd:b,mapDataSetScope:X2,mapScope:Y2,getLoadType:q2,getUseType:Z2,getSourceType:J2}}}),GX="",TK={key:0,class:"no-data"},MK={class:"column-item"},BK=["onClick"],PK={key:3,class:"item-name"},HK={class:"column-item"},EK={key:0},LK={key:1},kK={key:2},FK={key:3},IK=["onClick"],DK={class:"item-name"},OK={class:"column-child-item"},zK={class:"field"},NK={class:"column-child-item-name"};function WK(i,t,e,n,o,r){const s=v.resolveComponent("loading-outlined"),l=v.resolveComponent("caret-down-outlined"),a=v.resolveComponent("caret-right-outlined"),h=v.resolveComponent("ind-source-list",!0),d=v.resolveComponent("a-tooltip"),u=v.resolveComponent("draggable"),c=v.resolveComponent("a-spin");return v.openBlock(),v.createElementBlock("div",{class:v.normalizeClass(["columns",i.isSub?"sub-columns":""]),ref:"columnRef"},[v.createVNode(c,{spinning:i.searchLoading,tip:"数据源加载中..."},{default:v.withCtx(()=>{var g;return[!((g=i.sourceList)!=null&&g.length)&&!i.searchLoading?(v.openBlock(),v.createElementBlock("div",TK,"暂无数据")):i.hasChildren?(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:1},v.renderList(i.sourceList,(f,p)=>(v.openBlock(),v.createElementBlock(v.Fragment,{key:f.indexTypeGuid||f.id},[v.createElementVNode("div",MK,[v.createElementVNode("span",{class:"item-group",onClick:m=>i.onToggleGroup(p)},[f.loading?(v.openBlock(),v.createBlock(s,{key:0})):f.show?(v.openBlock(),v.createBlock(l,{key:1})):(v.openBlock(),v.createBlock(a,{key:2})),f.isLeaf?(v.openBlock(),v.createElementBlock("span",PK,v.toDisplayString(f.indexTypeCode+"."+f.indexTypeName),1)):v.createCommentVNode("",!0)],8,BK)]),f.show?(v.openBlock(),v.createBlock(h,{key:0,data:f.children,isSub:!0,hasChildren:f.isLeaf==="0",config:i.config,onOnDragStart:i.onDragStart,onOnDragEnd:i.onDragEnd},null,8,["data","hasChildren","config","onOnDragStart","onOnDragEnd"])):v.createCommentVNode("",!0)],64))),128)):(v.openBlock(!0),v.createElementBlock(v.Fragment,{key:2},v.renderList(i.sourceList,f=>(v.openBlock(),v.createElementBlock("div",{key:f.id,class:v.normalizeClass(i.setItemDisabled(f.dataViewColumns)?"column-disabled":"")},[v.createElementVNode("div",HK,[v.createVNode(d,null,{title:v.withCtx(()=>[v.createElementVNode("div",null,"加载类型:"+v.toDisplayString(i.getLoadType(f.loadType)),1),f.useType?(v.openBlock(),v.createElementBlock("div",EK,"数据使用系统:"+v.toDisplayString(i.getUseType(f.useType)),1)):v.createCommentVNode("",!0),f.systemSource?(v.openBlock(),v.createElementBlock("div",LK,"制度出处:"+v.toDisplayString(f.systemSource),1)):v.createCommentVNode("",!0),f.dataTo?(v.openBlock(),v.createElementBlock("div",kK,"数据来源:"+v.toDisplayString(i.getSourceType(f.dataTo)),1)):v.createCommentVNode("",!0),f.meaning?(v.openBlock(),v.createElementBlock("div",FK,"指标含义:"+v.toDisplayString(f.meaning),1)):v.createCommentVNode("",!0)]),default:v.withCtx(()=>[v.createElementVNode("span",{class:"item-group",onClick:p=>i.onToggleSource(f)},[f.show?(v.openBlock(),v.createBlock(l,{key:0})):(v.openBlock(),v.createBlock(a,{key:1})),v.createElementVNode("span",DK,v.toDisplayString((f.indexCode?f.indexCode:"")+" "+f.name),1)],8,IK)]),_:2},1024)]),f.show?(v.openBlock(),v.createBlock(u,{key:0,modelValue:f.dataViewColumns,"onUpdate:modelValue":p=>f.dataViewColumns=p,group:{name:"diGroup",pull:"clone",put:!1},"item-key":"id",sort:!1,disabled:i.setItemDisabled(f.dataViewColumns),filter:".not-allow",onStart:p=>i.onDragStart(p,f),onEnd:i.onDragEnd},{item:v.withCtx(({element:p})=>[v.createElementVNode("div",OK,[v.createElementVNode("span",zK,"【"+v.toDisplayString(p.scope==="FIELD"?i.mapDataSetScope(p.genericType):i.mapScope(p.scope))+"】",1),v.createElementVNode("span",NK,v.toDisplayString(p.label),1)])]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onStart","onEnd"])):v.createCommentVNode("",!0)],2))),128))]}),_:1},8,["spinning"])],2)}const VK=Ri(RK,[["render",WK],["__scopeId","data-v-aabcdc1c"]]),jK=v.defineComponent({name:"DragArea",props:{style:{type:Object,default:()=>({})},maskList:{type:Array,default:()=>[]}},setup(i,{emit:t}){return{onDragOver:s=>{s.preventDefault(),s.target.classList.add("highlight")},onDragLeave:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDragEnd:s=>{s.preventDefault(),s.target.classList.remove("highlight")},onDrop:s=>{s.preventDefault(),s.target.classList.remove("highlight");const l=Array.from(s.target.classList);l.includes("rows")?t("add","rows"):l.includes("columns")?t("add","columns"):l.includes("indicators")?t("add","indicators"):l.includes("filters")&&t("add","filters")}}}}),UX="";function $K(i,t,e,n,o,r){return v.openBlock(),v.createElementBlock("div",{class:"drag-area",style:v.normalizeStyle(i.style.main)},[i.maskList.includes(2)?(v.openBlock(),v.createElementBlock("div",{key:0,class:"area-wrap filters",onDragover:t[0]||(t[0]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[1]||(t[1]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[2]||(t[2]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[3]||(t[3]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.filters)},null,36)):v.createCommentVNode("",!0),i.maskList.includes(0)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:1,class:"area-wrap rows",onDragover:t[4]||(t[4]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[5]||(t[5]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[6]||(t[6]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[7]||(t[7]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.rows)},null,36)),i.maskList.includes(1)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:2,class:"area-wrap columns",onDragover:t[8]||(t[8]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[9]||(t[9]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[10]||(t[10]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[11]||(t[11]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.columns)},null,36)),i.maskList.includes(2)?v.createCommentVNode("",!0):(v.openBlock(),v.createElementBlock("div",{key:3,class:"area-wrap indicators",onDragover:t[12]||(t[12]=(...s)=>i.onDragOver&&i.onDragOver(...s)),onDragleave:t[13]||(t[13]=(...s)=>i.onDragLeave&&i.onDragLeave(...s)),onDragend:t[14]||(t[14]=(...s)=>i.onDragEnd&&i.onDragEnd(...s)),onDrop:t[15]||(t[15]=(...s)=>i.onDrop&&i.onDrop(...s)),style:v.normalizeStyle(i.style.indicators)},null,36))],4)}const GK=Ri(jK,[["render",$K],["__scopeId","data-v-01e4c58d"]]),UK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r,sqlConditions:s}=i;return async(a={},h,d)=>{var p;const u=HC(i,a),{url:c,...g}=u||{};let f=t;if(!f){const{pathname:m}=window==null?void 0:window.location;if(m){const b=m.split("/");b!=null&&b.length&&(f=b[b.length-1])}}if(c&&g){h&&h("tableChange",{type:"11",data:g}),d&&d(g),s!=null&&s.length&&(g.sqlConditions=s);try{return await dr({url:`${e}${c}`,method:"post",headers:{Authentication:n,operateContext:o},data:{...g,dataSourceId:(r==null?void 0:r.dataSourceId)||"",pageId:f},signal:((p=window.controller)==null?void 0:p.signal)||""})}catch(m){console.error(m)}}}},KK=(i={})=>{const{indicatorUrl:t=""}=i;return async(n,o)=>{var d;const r={},{search:s}=window==null?void 0:window.location;if(s){const u=s.slice(1,s.length).split("&");for(const c of u){const g=c.split("=");r[g[0]]=g[1]}}const{keyName:l,...a}=o,h={keyName:l};n==="save"&&(h.searchMap=a);try{return await dr({url:`${t}/userSearch/${n}`,method:"post",headers:{Authentication:r.token||null},data:h,signal:((d=window.controller)==null?void 0:d.signal)||""})}catch(u){console.error(u)}}},YK=(i={})=>{const{pageId:t="",indicatorUrl:e="",indicatorToken:n="",context:o="",graphicConfig:r={}}=i;return async(l={})=>{var h,d;const a=HC(i,l);try{const u=await dr({url:`${e}/diagram/obtainDrillAbleDimensionOptions`,method:"post",headers:{Authentication:n,operateContext:o},data:{source:(r==null?void 0:r.source)||"INDICATOR_LIB",pageId:t,indicatorList:(a==null?void 0:a.indicatorList)||[],classifications:(a==null?void 0:a.queryColumns)||[],dataSourceId:(r==null?void 0:r.dataSourceId)||""},signal:((h=window.controller)==null?void 0:h.signal)||""});return((d=u==null?void 0:u.data)==null?void 0:d.data)||[]}catch(u){console.error(u)}}},XK=(i={})=>{const{indicatorUrl:t="",indicatorToken:e="",context:n=""}=i;return async(r={},s)=>{var l,a;try{const h=await dr({url:`${t}${s}`,method:"post",headers:{Authentication:e,operateContext:n},data:r,signal:((l=window.controller)==null?void 0:l.signal)||""});return((a=h==null?void 0:h.data)==null?void 0:a.data)||[]}catch(h){console.error(h)}}},qK={id:{type:String,default:""},name:{type:String,default:""},keyName:{type:String,default:""},type:{type:String,default:""},width:{type:String,default:""},height:{type:String,default:""},position:{type:String,default:""},top:{type:String,default:""},left:{type:String,default:""},zIndex:{type:Number,default:1},events:{type:Array,default:()=>[]},dataType:{type:String,default:"indicator"},graphicConfig:{type:Object,default:()=>({})},data:{type:Array,default:()=>[]},scale:{type:Number,default:1},dimensionList:{type:Array,default:()=>[]},indicatorList:{type:Array,default:()=>[]},pageMode:{type:String,default:""},styleConfig:{type:Object,default:()=>({})},theme:{type:String,default:"light"},fullMode:{type:Boolean,default:!1},pageId:{type:String,default:""},indicatorUrl:{type:String,default:""},indicatorToken:{type:String,default:""},context:{type:String,default:""},enlargeContainer:{type:String,default:"body"},globalModel:{type:Object,default:()=>new Map},isIframeMode:{type:Boolean,default:!1},showLeftTree:{type:Boolean,default:!0},allowDrill:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!0},showClear:{type:Boolean,default:!0},relateKeyName:{type:String,default:""},usedDimensionFields:{type:Array,default:[]},allDimensions:{type:Array,default:[]},pageConfig:{type:Object,default:()=>({})},scaleValue:{type:Object,default:()=>({widthScale:1,heightScale:1})},defaultConfig:{type:Object,defalut:()=>({})},modalContainer:{type:String,default:"#ProviderConfig > #container"},isAllowSaveConfig:{type:Boolean,default:!0},defaultFontSize:{type:Number,default:16},theFlag:{type:String,default:""},sqlConditions:{type:Array,default:[]}},lb={LAST_DATA:"上期值",SAME_DATA:"同期值",DIFF_DATA:"增减额",MOM_DATA:"环比(%)",YOY_DATA:"同比(%)"},ZK=[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"图形",menuKey:"graph"},{text:"筛选",menuKey:"filter"}],ks=["合计","平均值","计数","最大值","最小值","方差","标准差"],JK=i=>v.defineAsyncComponent({loader:i,delay:200}),KX="",YX="",QK=v.defineComponent({name:"PivotTable",components:{PivotFilter:DT,PivotProperty:D7,ConditionalProperty:jU,ChartModal:nK,PivotAggregate:lK,PivotTop:dK,PivotConfig:AK,IndSourceList:VK,DragArea:GK,PivotDetail:fK,DrillModal:JK(()=>Promise.resolve().then(()=>cY)),SettingOutlined:k$,DatabaseOutlined:Qj,ArrowsAltOutlined:Hj,ShrinkOutlined:O$,FilterOutlined:pM,DeleteOutlined:gM,ClearOutlined:Uj},props:{...qK},setup(i,{expose:t,emit:e}){let n=null;const o=v.ref(!1),r=v.ref(""),s=v.ref({}),l=v.ref(),a=v.ref({}),h=v.ref({}),d=v.ref({}),u=v.ref(),c=v.ref({}),g=v.ref(),f=v.ref(),p=v.ref(),m=v.ref(),b=v.ref(),C=v.ref(),_=v.ref(),w=v.ref(),y=v.ref(),S=v.ref(),R=v.ref({}),A=v.ref(!1),x=v.ref({}),T=v.ref({}),M=v.ref({}),B=v.ref(),P=v.ref({}),F=v.ref("200px"),H=v.ref("200px"),E=v.ref(300),k=v.ref({}),I=v.ref(),L=v.ref(i.showLeftTree),D=v.ref(!1),O=v.ref({}),W=v.ref(0),N=v.ref(0),$=v.ref(),U=v.ref(!1),Y=v.ref(),j=v.ref(25),G=v.ref(!0),Z=v.ref({dateFormat:"YYYY-MM-DD"}),et=v.ref(16);let gt=40;const vt=6,it=10,nt=15,bt=20,Ct=24,at=v.ref([]);let rt=`|${jr(6)}|`;const ct=v.ref();v.provide("splitSymbol",rt),v.provide("indicatorUrl",i.indicatorUrl),v.provide("indicatorToken",i.indicatorToken),v.provide("theme",i.theme),v.provide("pageId",i.pageId),v.provide("context",i.context),v.provide("graphicConfig",i.graphicConfig),v.provide("theDateInfo",Z),v.provide("scaleValue",i.scaleValue),v.provide("getContainer",()=>document.querySelector(i.modalContainer)||document.body);const ht=v.ref({}),_t=()=>{const V={borderColor:v.unref(kt).borderColor};ht.value=V},ut=v.computed(()=>{let V="#ECF1F5";switch(i.theme){case"default":V="#EAF0F9";break;case"dark":V="#FFFFFF";break}return{borderColor:"#E3E3E3",headerBgColor:V,headerColor:"#252525",bodyBgColor:"#FFFFFF",bodyColor:"#252525",indicatorsHeaderBgColor:V,indicatorsHeaderColor:"#252525",indicatorsBodyBgColor:"#FFFFFF",indicatorsBodyColor:"#252525",aggregateBgColor:V,aggregateColor:"#252525",sortNotActiveColor:"#CCCCCC",sortActiveColor:"#416EFF",dropDownMenuBgColor:"#FFFFFF",dropDownMenuColor:"#141414",dropDownMenuHightLightColor:"#2E68CF"}}),It=v.ref(1),Ut=v.ref();new ResizeObserver(V=>{for(const K of V){const{width:q}=K.contentRect;Ut.value=q,It.value++,v.nextTick(()=>{SB()})}}).observe(document.body);const Tt=v.computed(()=>{const{width:V}=i;return V.includes("%")&&It.value?i.isIframeMode?Ut.value:document.querySelector(`#pivotWrap_${i.id}`).clientWidth:parseFloat(V)}),kt=v.computed(()=>{var J;const V={},{styleConfig:K}=i;let q={};(J=Object.keys(K))!=null&&J.length?q=K:q=v.unref(ut);for(const X in q)V[X]=q[X]||"transparent";return V}),oe=v.ref({}),re=()=>{const V=Zl();V&&(v.unref(oe).width=V.width+2+"px"),v.unref(oe).backgroundColor=EC(v.unref(kt).headerBgColor,2)};v.watch(()=>i.theme,()=>{n&&(n==null||n.updateOption(dt))});const ye=()=>{const{widthScale:V,heightScale:K}=i.scaleValue||{};if(V&&K){const q=+(1/V).toFixed(5),J=+(1/K).toFixed(5),X=+(parseFloat(i.width)*V).toFixed(2),Q=+(parseFloat(i.height)*K).toFixed(2);R.value={transform:`scale(${q}, ${J})`,width:X+"px",height:Q+"px",left:-(X-parseFloat(i.width))/2+"px",top:-(Q-parseFloat(i.height))/2+"px",paddingLeft:v.unref(j)+"px"},et.value=i.defaultFontSize*V,gt=(i.defaultFontSize+30)*K,dt.defaultRowHeight=gt,dt.theme.scrollStyle.width=vt*V,dt.theme.scrollStyle.scrollSliderCornerRadius=it*V,dt.theme.tooltipStyle.fontSize=et.value,j.value=(i.defaultFontSize+10)*V,pK(C7,{sortNotActiveColor:v.unref(kt).sortNotActiveColor,sortActiveColor:v.unref(kt).sortActiveColor,iconSize:nt*V,hoverSize:bt*V,downSize:Ct*V}),v.nextTick(()=>{var tt,ft,Pt,Qt,Ht,Lt,te,Ot,We,Rn,qn,ji;(ft=(tt=v.unref(S))==null?void 0:tt.style)==null||ft.setProperty("--box-tooltip-fontsize",et.value+"px"),(Qt=(Pt=v.unref(S))==null?void 0:Pt.style)==null||Qt.setProperty("--box-item-size",j.value+"px"),(Lt=(Ht=v.unref(_))==null?void 0:Ht.style)==null||Lt.setProperty("--menu-item-max-width",200*V+"px"),(Ot=(te=v.unref(_))==null?void 0:te.style)==null||Ot.setProperty("--menu-item-padding",`${i.defaultFontSize/2*V}px ${i.defaultFontSize*V}px`),(Rn=(We=v.unref(_))==null?void 0:We.style)==null||Rn.setProperty("--menu-item-font-size",(i.defaultFontSize>20?i.defaultFontSize-4:i.defaultFontSize)*V+"px"),(ji=(qn=v.unref(_))==null?void 0:qn.style)==null||ji.setProperty("--menu-item-line-height",24*K+"px"),n&&n.updateOption(dt)})}};v.watch(()=>[i.scaleValue,i.width,i.height],()=>{ye()},{deep:!0});const Oe=v.computed(()=>{var V,K,q;return i.fullMode&&!((V=dt.rows)!=null&&V.length)&&!((K=dt.columns)!=null&&K.length)&&!((q=dt.indicators)!=null&&q.length)}),Be=v.computed(()=>{var V;return{width:(V=i.width)!=null&&V.includes("%")?"calc(100%)":parseFloat(i.width)-v.unref(E)+"px",height:"100%",backgroundColor:i.theme==="darkBlue"?"#081653":"#F1F1F1",color:i.theme==="darkBlue"?"#b2c3dd":""}}),Ee=v.computed(()=>{const V={fontSize:et.value+"px"};return v.unref(L)&&(i.theme==="darkBlue"?V.color="#00CCFF":V.color="#416EFF"),V}),At=v.ref([]),mt=v.ref([]);v.provide("dimensionFieldList",At),v.provide("indicatorFieldList",mt);const Bt="-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol",Kt=v.computed(()=>v.unref(At).filter(V=>V.isInnerFilter).concat(v.unref(mt).filter(V=>V.isInnerFilter)).sort((V,K)=>V.timeStamp-K.timeStamp));v.watchEffect(()=>{var J,X,Q,tt,ft,Pt,Qt,Ht,Lt,te;const{dropDownMenuBgColor:V,dropDownMenuColor:K,dropDownMenuHightLightColor:q}=kt.value;V&&((X=(J=v.unref(_))==null?void 0:J.style)==null||X.setProperty("--menu-bg-color",V)),K&&((tt=(Q=v.unref(_))==null?void 0:Q.style)==null||tt.setProperty("--menu-color",K)),q&&((Pt=(ft=v.unref(_))==null?void 0:ft.style)==null||Pt.setProperty("--menu-hight-light-color",q)),F.value&&((Ht=(Qt=v.unref(_))==null?void 0:Qt.style)==null||Ht.setProperty("--sub-menu-left",F.value)),H.value&&((te=(Lt=v.unref(_))==null?void 0:Lt.style)==null||te.setProperty("--sub-menu-top",H.value))});const qt=v.ref([]),fe=v.ref({}),Yt=v.ref({}),Nt=v.reactive({cellInnerBorder:!1,underlayBackgroundColor:"transparent",headerStyle:{bgColor(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderBgColor:v.unref(kt).headerBgColor},color(V){return v.unref(qt).includes(V.dataValue)?v.unref(kt).indicatorsHeaderColor:v.unref(kt).headerColor},borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},cornerHeaderStyle:{bgColor(){return v.unref(kt).headerBgColor},color:v.unref(kt).headerColor,borderColor:v.unref(kt).borderColor,fontWeight:"600",fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},bodyStyle:{borderColor:v.unref(kt).borderColor,color(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyColor:v.unref(kt).bodyColor},bgColor(V){var J,X;const K=V.cellHeaderPaths.rowHeaderPaths,q=V.cellHeaderPaths.colHeaderPaths;return ks.includes((J=K==null?void 0:K[K.length-1])==null?void 0:J.value)?v.unref(kt).aggregateBgColor:v.unref(qt).includes((X=q==null?void 0:q[q.length-1])==null?void 0:X.value)?v.unref(kt).indicatorsBodyBgColor:v.unref(kt).bodyBgColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},rowHeaderStyle:{borderColor:v.unref(kt).borderColor,bgColor(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateBgColor:v.unref(kt).bodyBgColor},color(V){return ks.includes(V.dataValue)?v.unref(kt).aggregateColor:v.unref(kt).bodyColor},fontFamily(){if(i.isIframeMode)return Bt},fontSize(){return v.unref(et)}},frameStyle:{borderLineWidth:1,borderColor:v.unref(kt).borderColor},scrollStyle:{width:vt,scrollSliderCornerRadius:it},tooltipStyle:{fontSize:v.unref(et)}}),dt=v.reactive({records:[],columnHeaderTitle:!0,excelOptions:{fillHandle:!0},rows:[],columns:[],indicators:[],corner:{titleOnDimension:"row"},dataConfig:{sortRules:[],filterRules:[]},widthMode:"standard",heightMode:"standard",defaultRowHeight:gt,defaultColWidth:360,menu:{renderMode:"html",dropDownMenuHighlight:[]},theme:Nt}),Ft=v.computed(()=>{let V=0;return v.unref(L)&&i.fullMode&&(V=v.unref(E)),V}),$t=v.computed(()=>{let V=0;return v.unref(D)&&(V=20),V}),ae=5,Ti=v.ref({});v.watch(A,V=>{if(V){const K={};v.nextTick(()=>{var X,Q;const q=Zl();let J=0;(X=v.unref(Kt))!=null&&X.length&&(J=(Q=v.unref($))==null?void 0:Q.clientHeight),q&&(K.width=q.width+"px",K.height=q.height+"px",K.top=q.top+J+v.unref($t)+"px",K.left=q.left+v.unref(Ft)+v.unref($t)+v.unref(j)+"px"),Ti.value=K})}});const Lo=v.ref([]),Xn=v.ref([]),$r=v.ref({}),An=v.ref({}),Fs=v.ref([]),Kl=v.ref([]),Yl=v.ref([]),Xl=v.ref([]),gY=v.computed(()=>{const V=[];for(const Q of v.unref(Lo)){const{data:tt,indicatorKey:ft="",calculateType:Pt=""}=Q||{};V.push({label:tt.indicatorKey,columnName:tt.indicatorKey,location:"LEFT",show:!0,calcType:"BUILT_IN",builtInFormula:Pt,builtInValueSource:ft})}const K=[],q={};v.unref(Xn).forEach(Q=>{q[Q.key]||(q[Q.key]=[]),q[Q.key].push(Q)});for(const Q in q){const tt=q[Q]||[];tt.forEach((ft,Pt)=>{var Ot;const Qt=v.unref(At).find(We=>We.label===ft.key),Ht=v.unref(mt).find(We=>We.label===ft.key),Lt=Qt||Ht,te={};Pt<tt.length-1&&(te.join="&&"),(Lt==null?void 0:Lt.genericType)==="DATE"&&(te.dateFormat=((Ot=v.unref(Z))==null?void 0:Ot.dateFormat)||"YYYY-MM-DD",Pt===0?te.prop="startTime":Pt===1&&(te.prop="endTime")),Lt&&K.push({fieldName:Lt.name,fieldType:Lt.genericType,fieldValue:Array.isArray(ft.value)?ft.value.join(","):ft.value,hrpIndexCode:Lt.indexCode,hrpIndexCodeNum:Lt.indexCodeNum,id:Lt.id,label:Lt.label,rule:ft.rule,targetSource:"",typeGuid:ft.typeGuid||"",type:ft.type,...te})})}const J=[];if(Object.keys(v.unref($r)))for(const Q in v.unref($r))v.unref($r)[Q]&&J.push({key:Q,num:v.unref($r)[Q],rule:"TOP"});const X=[];if(Object.keys(v.unref(An)))for(const Q in v.unref(An)){const{order:tt,type:ft,columnData:Pt,columnHeader:Qt}=v.unref(An)[Q];if(tt.toLowerCase()==="default-sort")continue;const Ht={label:Q,order:tt.toUpperCase(),type:"COMBINATION",fieldType:ft};ft==="indicators"&&(Ht.columnHeader=Qt,Ht.columnData=Pt,Ht.type="NORMAL"),X.push(Ht)}return{calc:V,filter:K,truncations:J,sorts:X,aggregateMethod:v.unref(P)||{}}}),fY=XK(i),pY=YK(i),mY=UK(i),hb=KK(i),db=v.ref({}),ub=v.ref({}),vY=async()=>{var q;const V=v.unref(mt).filter(J=>J.calcType==="FORMULA");let K;if(V!=null&&V.length&&(K=await fY({indicatorList:v.unref(mt).map(J=>{const X={calcType:J.calcType||"COLUMN",columnName:J.name,label:J.label,location:J.location,show:J.show};return J.indexCode&&(X.hrpIndexCode=J.indexCode),J.indexCodeNum&&(X.hrpIndexCodeNum=J.indexCodeNum),J.formula&&(X.formula=J.formula),X})},"/diagram/obtainIndexDrillDetail")),K!=null&&K.length){const J={};for(const X of K)(q=X.detailList)!=null&&q.length&&(J[X.label]=X.detailList);ub.value=J}};v.watch(()=>mt.value,()=>{vY()},{deep:!0});const gr=async()=>{var Pt,Qt,Ht,Lt,te;const{dimensionList:V,graphicConfig:K={}}=i,{queryColumnList:q=[]}=K,{rows:J=[],columns:X=[]}=dt,Q=(Pt=v.unref(Yl))!=null&&Pt.length?v.unref(Yl):[],tt=(Qt=v.unref(Xl))!=null&&Qt.length?v.unref(Xl):[];if(!(Q!=null&&Q.length))for(const Ot of J)Q.push(Ot.dimensionKey);if(!(tt!=null&&tt.length))for(const Ot of X)tt.push(Ot.dimensionKey);Q!=null&&Q.length||Q.push(...V.filter(Ot=>Ot.position==="rows").map(Ot=>Ot.key)),tt!=null&&tt.length||tt.push(...V.filter(Ot=>Ot.position==="columns").map(Ot=>Ot.key));const ft=[];for(const Ot in v.unref(a))ft.push({type:"dimension",key:Ot,rule:v.unref(a)[Ot]});for(const Ot in v.unref(h))ft.push({type:"indicators",key:Ot,rule:v.unref(h)[Ot]});if(ft!=null&&ft.length&&cb(ft,{isHandle:!1}),q!=null&&q.length)for(const Ot of q)!Q.includes(Ot.name)&&!tt.includes(Ot.name)&&Q.push(Ot.name);db.value={...v.unref(gY),rowDimensionKeys:Q,colDimensionKeys:tt,dimensions:(Ht=v.unref(Fs))!=null&&Ht.length?v.unref(Fs):v.unref(At),indicators:(Lt=v.unref(Kl))!=null&&Lt.length?v.unref(Kl):v.unref(mt)};try{const Ot=await mY({pivotTableCal:v.unref(db)},e,We=>{var Rn;if(v.unref(G)){const{sqlConditions:qn=[],queryColumns:ji=[]}=We,Xe=vB(qn),oi=ji.find($i=>$i.typeGuid==="the_date");if(oi&&(Z.value={dateFormat:oi.dateFormat||"YYYY-MM-DD"}),Xe!=null&&Xe.length)for(const $i of Xe)["startTime","endTime"].includes($i.prop)&&(v.unref(Z)[$i.prop]=$i.fieldValue||"",(Rn=v.unref(Z))!=null&&Rn.rangeFormat||(v.unref(Z).rangeFormat=$i.dateFormat||"YYYY-MM-DD"));G.value=!1}});(te=Ot==null?void 0:Ot.data)!=null&&te.success&&(YY(),ct.value=""),wB(Ot)}catch(Ot){console.error(Ot)}};function vB(V){const K=[];for(const q of V)q.sqlConditions?K.push(...vB(q.sqlConditions)):q.fieldName==="the_date"&&K.push(q);return K}const bY=V=>{v.unref(Lo).find(K=>K.data.indicatorKey===V.data.indicatorKey)||Lo.value.push(V),gr()},CY=V=>{const K=v.unref(Lo).findIndex(q=>q.data.indicatorKey===V);K!==-1&&Lo.value.splice(K,1),gr()},cb=(V,{isHandle:K=!0}={})=>{let q=[];Array.isArray(V)?q=V:q=[V];for(const J of q){const{key:X="",rule:Q,type:tt=""}=J||{};let ft=Ue.cloneDeep(Q);Array.isArray(Q)||(ft=[Q]);const Pt=v.unref(At).find(Lt=>Lt.label===X),Qt=v.unref(mt).find(Lt=>Lt.label===X),Ht=Pt||Qt;if(Ht){if((Ht==null?void 0:Ht.genericType)==="DATE"&&(ft==null?void 0:ft.length)===1){const Lt=ft[0].value;ft[0].rule="GREATER_EQUAL",ft[1]={rule:"LESS_EQUAL",value:Lt}}for(let Lt=v.unref(Xn).length-1;Lt>=0;Lt--){const te=v.unref(Xn)[Lt];te.key===X&&te.type===tt&&v.unref(Xn).splice(Lt,1)}for(const Lt of ft){const{rule:te,value:Ot}=Lt;X&&te&&Ot&&Xn.value.push({key:X,rule:te,value:Ot,type:tt,typeGuid:Ht.typeGuid})}}}K&&gr()},yY=()=>{$r.value=v.unref(x)||{},gr()},bB=V=>{const{key:K,order:q,type:J,columnData:X=[]}=V;if(J==="indicators"){let Q="";for(const tt in v.unref(An))v.unref(An)[tt].type==="indicators"&&(Q=tt);Q&&delete v.unref(An)[Q]}v.unref(An)[K]={order:q,type:J,columnData:X},gr()},ql=()=>{const V=v.unref(At),K=v.unref(mt),q=V.filter(X=>X.positionType==="rows").map(X=>X.name),J=V.filter(X=>X.positionType==="columns").map(X=>X.name);Fs.value=Ue.cloneDeep(V),Kl.value=Ue.cloneDeep(K),Yl.value=Ue.cloneDeep(q),Xl.value=Ue.cloneDeep(J),gr()};function _Y(V,K=!0,q=-1){if(q>-1)dt.indicators.splice(q,0,...V);else for(const J of V)dt.indicators.push(J);K&&n.updateOption(dt)}function wY({label:V,calcType:K}){const q=[],J=[],X=[],Q=v.unref(ub)[V],tt=v.unref(Yt)[V]||[];for(const ft in lb)tt.indexOf(ft)===-1&&X.push({text:lb[ft],menuKey:ft});return Q!=null&&Q.length&&(J.push({text:"公式:"+Q[0],menuKey:"formula"}),Q.forEach((ft,Pt)=>{const Qt=v.unref(mt).find(Ht=>Ht.label===ft);Pt>0&&!Qt.show&&J.push({text:ft,menuKey:ft})}),q.push({text:"详情",menuKey:"detail",children:J})),[...q,{text:"计算",menuKey:"calculate",children:X},...ZK]}function gf(V){var q;let K=[];if(V!=="rows"&&(K=[{text:"钻取",menuKey:"drill"},{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"筛选",menuKey:"filter"},{text:"聚合",menuKey:"aggregate"},{text:"取top",menuKey:"top"},{text:"删除",menuKey:"delete"}]),i.fullMode||i.allowDrill)if(v.unref(at)&&Array.isArray(v.unref(at)))if((q=v.unref(at))!=null&&q.length){const J=v.unref(at).map(X=>({text:X.title||X.label,menuKey:V==="rows"?`${rt}${X.label}`:X.label}));V==="rows"?K=J:K[0].children=J}else K.splice(0,1);else K.splice(0,1);else K.splice(0,1),K.splice(-1,1);return K}function SY(V,K){A.value=!0,v.unref(P)[K]=V||[],hn({type:"9",data:{key:K,types:V}}),gr()}function xY(V,K=!0){var q;for(const J of V){const{key:X,name:Q,type:tt,dimensionKey:ft,width:Pt}=J;let Qt;if(ft)Qt=J;else{const Ht={dimensionKey:X,title:Q,width:Pt?`${Pt}%`:"auto",type:tt};tt==="columns"?Ht.headerStyle={textStick:!0}:tt==="rows"&&(Ht.cornerHeaderIcon="sortNormal"),Qt=Ht}if(Qt&&(Qt.headerStyle={textStick:!0},Qt.headerFormat||(Qt.headerFormat=Ht=>{if(tt==="rows"){const Lt=Ht==null?void 0:Ht.split(rt);return Lt!=null&&Lt.length?Lt[Lt.length-1]:Ht}else return Ht}),dt[tt].push(Qt)),(q=dt[tt])!=null&&q.length)for(const Ht of dt[tt])Ht.cornerDropDownMenu=gf(),tt==="rows"&&(Ht.dropDownMenu=gf("rows"));dt.dataConfig.sortRules.push({sortField:X,sortType:v.unref(r)})}K&&n.updateOption(dt),v.nextTick(()=>{yB()})}function CB(V){const K={},{records:q}=dt;for(const J of q)for(const X of V)Mn(K,X)?K[X].find(Q=>Q.value===J[X])||K[X].push(gb({value:J[X]})):K[X]=gb([{value:J[X]}]);return K}function gb(V){const K=Ue.cloneDeep(V);if(typeof V=="object")if(Array.isArray(K))for(const J of K)q(J);else q(K);function q(J){for(const X in J)if(typeof J[X]=="string"){const Q=J[X].split(rt);Q!=null&&Q.length&&(J[X]=Q[Q.length-1])}}return K}function yB(){const{dataset:{columns:V,rows:K}}=n,q=K.concat(V);s.value=CB(q)}const _B=v.computed(()=>{var V;return(V=v.unref(At))!=null&&V.length?v.unref(At).map(K=>K.label).concat(i.usedDimensionFields):i.usedDimensionFields});async function wB(V){var Ot,We,Rn,qn,ji,Xe,oi,$i;const K=await pY({pivotTableCal:v.unref(db)});at.value=K.filter(Wt=>!v.unref(_B).includes(Wt.label));let q=V;V?Y.value=Ue.cloneDeep(V):q=Ue.cloneDeep(v.unref(Y)),A.value=!0;const{data:J={}}=(q==null?void 0:q.data)||{},{rows:X=[]}=J,Q=[],tt=[];for(const Wt of v.unref(At)){if(!Wt.show)continue;const ie=dt[Wt.positionType].find(Ze=>Ze.dimensionKey===Wt.label);ie?tt.push({...ie,title:Wt.showTitle}):tt.push({key:Wt.label,name:Wt.showTitle,type:Wt.positionType,width:Wt.width})}for(let Wt=0;Wt<v.unref(mt).length;Wt++){const ie=v.unref(mt)[Wt];if(!ie.show)continue;const Ze=wY(ie),Ge=dt.indicators.find(Fi=>Fi.indicatorKey===ie.label);let ze={};Ge?ze={...Ge,dropDownMenu:Ze,title:ie.showTitle}:ze={indicatorKey:ie.label,title:ie.showTitle,width:ie!=null&&ie.width?`${ie.width}%`:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},dropDownMenu:Ze},ze&&(ze.style={padding:[16,28,16,28],textAlign:"right"},ze.format||(ze.format=(Fi,Tn,Jh,Qh)=>{const bb=Qh.getRecordByCell(Tn,Jh)||[];return bb[0]&&isNaN(+bb[0][ie.label])?bb[0][ie.label]:Fi||"-"}),Q.push(ze))}const ft=tt.filter(Wt=>Wt.type==="rows");if(((Ot=dt==null?void 0:dt.rows)==null?void 0:Ot.length)!==ft.length&&typeof((We=v.unref(B))==null?void 0:We.col)=="number"&&(v.unref(B).col+=ft.length-(((Rn=dt==null?void 0:dt.rows)==null?void 0:Rn.length)||0)),dt.indicators=[],dt.rows=[],dt.columns=[],(qn=v.unref(Lo))!=null&&qn.length){for(const Wt of v.unref(Lo))if(!isNaN(+Wt.position)){const ie={...Wt.data,calculateType:Wt.calculateType};["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(ie.calculateType)&&PB(ie,Wt.data.formatConfig),Q.splice(+Wt.position,0,ie)}}const{sortType:Pt,col:Qt,row:Ht}=v.unref(B)||{};for(const Wt of Q)Wt&&(Wt.headerIcon=ie=>{const{col:Ze,row:Ge}=ie;if(Qt===Ze&&Ht===Ge){let ze="sortNormal";return Pt==="ASC"?ze="sortUp":Pt==="DESC"&&(ze="sortDown"),ze}else return"sortNormal"});_Y(Q,!1),xY(tt,!1);const Lt=[],te=tt.filter(Wt=>Wt.type==="rows").map(Wt=>Wt.key||Wt.dimensionKey);for(const Wt of X)for(const ie in Wt)if(!ks.includes(Wt[ie])){const Ze=te.indexOf(ie);if(Ze!==-1){const Ge=[];for(let ze=0;ze<=Ze;ze++){const Fi=String(Wt[te[ze]]);if(Fi.includes(rt)){const Tn=Fi.split(rt);Tn!=null&&Tn.length&&Ge.push(Tn[Tn.length-1])}else Ge.push(Fi)}Ge!=null&&Ge.length&&(Wt[ie]=Ge.join(rt))}}for(const Wt of tt){const ie=(Wt==null?void 0:Wt.key)||(Wt==null?void 0:Wt.dimensionKey);if(Wt.type==="columns"&&!v.unref(M)[ie])v.unref(M)[ie]=fb("",ie,X);else if(Wt.type==="rows")if(v.unref(T)[ie]){const{type:Ze}=v.unref(T)[ie]||{};Lt.push(fb(Ze,ie,X))}else if(!v.unref(B)||v.unref(B).sortField===ie||!n)Lt.push(fb("",ie,X));else{const Ze=dt.dataConfig.sortRules.find(Ge=>Ge.sortField===ie);Ze&&Lt.push(Ze)}}if(v.unref(B)&&Lt.push(v.unref(B)),(ji=Object.keys(v.unref(M)))!=null&&ji.length)for(const Wt in v.unref(M))Lt.push(v.unref(M)[Wt]);if(dt.records=X,dt.dataConfig.sortRules=Lt,X!=null&&X.length&&(v.unref(O).records=[]),(Xe=dt.columns)!=null&&Xe.length?dt.columnHeaderTitle=!0:(oi=dt.indicators)!=null&&oi.length?dt.columnHeaderTitle=!1:($i=dt.rows)!=null&&$i.length&&(dt.columnHeaderTitle=!0),n)n.updateOption(dt),v.nextTick(()=>{xB()}),A.value=!1;else{const Wt=document.getElementById(`pivotTableContainer_${i.id}`);n=new LT(Wt,dt),v.nextTick(()=>{xB(),o.value=!0,A.value=!1,i.isIframeMode&&(v.unref(W)&&n.setScrollTop(v.unref(W)),v.unref(N)&&n.setScrollLeft(v.unref(N)))}),FY()}v.nextTick(()=>{const{indexFormatConfig:Wt}=(i==null?void 0:i.defaultConfig)||{};if(Wt){const ie=[];for(const Ze in Wt)Wt[Ze]&&ie.push(Wt[Ze]);BB(ie)}})}const Gr=v.ref({});function SB(){Zl()&&(v.unref(D)?(v.unref(Gr).top=v.unref($t)+"px",v.unref(Gr).left="0"):(v.unref(Gr).top="0",v.unref(Gr).left="0"))}function xB(){var V;if(n&&!((V=dt.records)!=null&&V.length)){const{dataset:{rows:K}}=n,q={};for(const J of K)q[J]="";v.unref(O).dataConfig={...dt.dataConfig,filterRules:[]},v.unref(O).records=[q],n.updateOption({...dt,...v.unref(O)})}}function AY(V,K){A.value=!0,hn({type:"3",data:{type:"indicators",key:V,rule:K}}),cb({type:"indicators",key:V,rule:K})}function RY(V,K){A.value=!0,hn({type:"3",data:{type:"dimension",key:V,rule:K}}),cb({type:"dimension",key:V,rule:K})}function TY(V,K){var Q;let q=!1;const J=dt[K].findIndex(tt=>tt.dimensionKey===V),X=dt.dataConfig.sortRules.findIndex(tt=>tt.sortField===V);if(J!==-1){if(dt[K].splice(J,1),i.fullMode||i.allowDrill){const tt=v.unref(At).findIndex(ft=>ft.label===V);tt!==-1&&(v.unref(At)[tt].isInnerFilter?(v.unref(At)[tt].show=!1,q=!0):v.unref(At).splice(tt,1))}else for(const tt of dt[K])tt.cornerDropDownMenu=gf(),K==="rows"&&(tt.dropDownMenu=gf("rows"));(Q=v.unref(B))!=null&&Q.col&&(v.unref(B).col-=1),A.value=!0,hn({type:"7"}),ql()}X!==-1&&(dt.dataConfig.sortRules[X].sortType=r),n.updateOption(dt),v.nextTick(()=>{if(yB(),!q){delete a.value[V];const tt=v.unref(Xn).findIndex(ft=>ft.key===V);tt!==-1&&v.unref(Xn).splice(tt,1)}})}function MY(V){const{indicators:K}=dt,q=K.findIndex(J=>J.indicatorKey===V);if(q!==-1){const J=K[q];if(K.splice(q,1),J.calculateType){const X=J.indicatorKey.split("@"+J.calculateType)[0],Q=v.unref(Yt)[X].indexOf(J.calculateType);Q!==-1&&v.unref(Yt)[X].splice(Q,1);const tt=v.unref(qt).indexOf(J.title);tt!==-1&&v.unref(qt).splice(tt,1),delete v.unref(fe)[J.title]}hn({type:"2",data:J.indicatorKey}),CY(J.indicatorKey)}}function fb(V,K,q){let J=[];const X=new Set;for(const Q of q){const tt=Q[K];tt&&!ks.includes(tt)&&X.add(tt)}return J=Array.from(X),V==="asc"?J=J.sort((Q,tt)=>Q.localeCompare(tt)):V==="desc"&&(J=J.sort((Q,tt)=>tt.localeCompare(Q))),{sortField:K,sortBy:[...J,...ks]}}function AB(V,K,q,J){A.value=!0;let{menu:{dropDownMenuHighlight:X},rows:Q}=dt;J=J+1,X=X.filter(ft=>!(ft.type==="dimension"&&ft.field===K)||ft.type==="indicator"),X.push({col:q,row:J-1,field:K,type:"dimension",menuKey:V}),dt.menu.dropDownMenuHighlight=X;const tt=Q.find(ft=>ft.dimensionKey===K);if(tt){let ft="sortNormal";V==="asc"?ft="sortUp":V==="desc"&&(ft="sortDown"),tt.cornerHeaderIcon=ft}n.updateOption(dt),V==="default-sort"?delete v.unref(T)[K]:v.unref(T)[K]={type:V},hn({type:"4",data:{key:K,order:V,type:"dimension"}}),bB({key:K,order:V,type:"dimension"})}function RB(V,K,q,J,X){var te;A.value=!0;const{menu:Q}=dt;let tt=Q.dropDownMenuHighlight,ft="";(te=dt.rows)!=null&&te.length&&(ft=dt.rows[dt.rows.length-1].dimensionKey);const Pt=q.filter((Ot,We)=>We<q.length-1),Qt=Pt.map(Ot=>({columnName:Ot.dimensionKey})),Ht=Pt.map(Ot=>Ot.value),Lt=tt.findIndex(Ot=>Ot.field===ft&&Ot.type==="dimension");Lt!==-1&&tt.splice(Lt,1),tt=tt.filter(Ot=>Ot.type==="dimension"),tt.push({col:J,row:X,field:K,type:"indicator",menuKey:V}),dt.menu.dropDownMenuHighlight=tt,n.updateOption(dt),V==="default-sort"?B.value=null:B.value={sortField:ft,sortByIndicator:K,sortType:V.toUpperCase(),query:Ht,col:J,row:X},hn({type:"4",data:{key:K,order:V,type:"indicators"}}),bB({key:K,order:V,type:"indicators",columnData:Ht,columnHeader:Qt})}function TB({dimensionKey:V,value:K=""}){const q={};v.unref(a)[V]&&(q.filterData=v.unref(a)[V]);const J=v.unref(At).find(X=>X.label===V);d.value={fieldName:K||(J==null?void 0:J.title)||V,key:V,type:"dimension",...q},v.nextTick(()=>{v.unref(u).showModal(),hn({type:"5",data:V})})}function BY(V,K){d.value={fieldName:K,key:V,type:"indicators",filterData:v.unref(h)[V]},v.nextTick(()=>{v.unref(u).showModal()})}function PY({indicatorKey:V,menuKey:K}){A.value=!0;let q=dt.indicators.length-1;const J=`${V}@${K}`,X=`${V}(${lb[K]}) fx`;v.unref(qt).push(X),v.unref(fe)[X]=J,dt.indicators.forEach((tt,ft)=>{tt.indicatorKey===V&&(q=ft+1)}),v.unref(Yt)[V]||(v.unref(Yt)[V]=[]),v.unref(Yt)[V].push(K);const Q={data:{indicatorKey:J,title:X,width:"auto",showSort:!1,headerStyle:{fontWeight:"normal"},headerIcon:"sortNormal",dropDownMenu:[{text:"排序",children:[{text:"升序",menuKey:"asc"},{text:"降序",menuKey:"desc"},{text:"默认",menuKey:"default-sort"}],menuKey:"sort"},{text:"度量属性",menuKey:"property"},{text:"条件属性",menuKey:"conditionalProperty"},{text:"删除",menuKey:"delete"}],style:{padding:[16,28,16,28],textAlign:"right"},format:(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][J])?Ht[0][J]:tt}},position:q,indicatorKey:V,calculateType:K};if(["LAST_DATA","SAME_DATA","DIFF_DATA"].includes(K)){const tt=Zh(V);if(tt>-1){const ft=dt.indicators[tt].formatConfig||{};Q.data.formatConfig={...ft,fieldName:J,indicatorKey:J}}}hn({type:"1",data:{indicatorKey:V,calculateType:K}}),bY(Q)}function HY(){const V=dt.rows[0]?dt.rows[0].cornerDropDownMenu:[],K=dt.columns[0]?dt.columns[0].cornerDropDownMenu:[],q=dt.rows.map(tt=>({...tt,cornerDropDownMenu:K})),J=dt.columns.map(tt=>({...tt,cornerDropDownMenu:V}));dt.columns=q,dt.rows=J;const{type:X,len:Q}=dt.aggregate||{};X&&(dt.records.splice(-Q),dt.aggregate={type:X,len:0}),dt.menu.dropDownMenuHighlight=[],a.value={},h.value={},c.value={},dt.dataConfig.filterRules=[],n.updateOption(dt)}function EY({indicatorKey:V,fieldName:K}){const q=Zh(V);if(q>-1){const J=dt.indicators[q].formatConfig||{};v.unref(g).showModal({...J,indicatorKey:V,fieldName:K})}}function LY(V){const K=Zh(V);if(K>-1){const q=dt.indicators[K].conditionalConfig||[];v.unref(f).showModal(V,q)}}function Zh(V){return dt.indicators.findIndex(K=>K.indicatorKey===V)}function kY(V){const K=v.unref(At)[0],q=v.unref(At).map(Q=>Q.label),J=CB(q),X={xLabel:K.label,yLabel:V,dimensionData:J,records:gb(dt.records)};v.unref(C).showModal(X)}function FY(){n.on("scroll",V=>{const{scrollDirection:K}=V;K==="vertical"?W.value=n.getScrollTop():K==="horizontal"&&(N.value=n.getScrollLeft())}),n.on("dblclick_cell",V=>{const{cellLocation:K="",field:q=""}=V;K==="body"&&!q.includes("LAST_DATA")&&!q.includes("SAME_DATA")&&!q.includes("DIFF_DATA")&&!q.includes("MOM_DATA")&&!q.includes("YOY_DATA")&&v.unref(w).showModal({args:V,splitSymbol:rt,dimension:v.unref(At),indicator:v.unref(mt),theFlag:i.theFlag})}),n.on("after_render",()=>{_t(),SB(),re(),v.nextTick(()=>{o.value=!0})}),n.on("icon_click",V=>{const{name:K,col:q,row:J}=V;if(["sortNormal","sortUp","sortDown"].includes(K)){const{rows:X,indicators:Q}=dt,tt=n.getCellValue(q,J);let ft=v.unref(At).find(te=>te.showTitle===tt);ft||(ft=v.unref(mt).find(te=>te.showTitle===tt));let Pt=ft==null?void 0:ft.label;if(v.unref(qt).includes(tt)&&(Pt=v.unref(fe)[tt]),!Pt)return;const Qt=X.find(te=>te.dimensionKey===Pt),Ht=Q.find(te=>te.indicatorKey===Pt);let Lt="default-sort";if(K==="sortUp"?Lt="desc":K==="sortDown"?Lt="default-sort":(!K||K==="sortNormal")&&(Lt="asc"),Ht){const te=n.getCellHeaderPaths(q,J);RB(Lt,Pt,(te==null?void 0:te.colHeaderPaths)||[],q,J)}else Qt&&AB(Lt,Pt,q,J)}}),n.on("show_menu",()=>{const V=document.querySelector(`#pivotTableContainer_${i.id} .vtable__menu-element`);if(V){V.classList.add("first");const K=parseFloat(V.style.left)+V.clientWidth+3;F.value=K+"px",H.value=parseFloat(V.style.top)+"px"}}),n.on("dropdown_menu_click",V=>{const{field:K,col:q,row:J}=V,{dimensionKey:X,indicatorKey:Q,value:tt}=K[K.length-1];let ft=V.menuKey,Pt=!1;ft.includes(rt)&&(Pt=!0,ft=ft.replace(rt,"")),l.value=V;const Qt=v.unref(at).find(Ht=>Ht.label===ft);if(Qt){const Ht=v.unref(At).findIndex(Lt=>Lt.label===X);if(Ht!==-1){const Lt={...Qt,show:!0,positionType:"rows",showTitle:Qt.title||Qt.label};Pt?v.unref(y).showModal({drillDimension:Lt,drillFieldData:K,usedDimensionFields:v.unref(_B),tableProps:i,splitSymbol:rt}):(At.value.splice(Ht+1,0,Lt),A.value=!0,ql()),hn({type:"8"})}}else{const Ht=Ue.cloneDeep(v.unref(mt));let Lt=0;const te=Ht.findIndex(We=>We.label===ft),Ot=Ht.findIndex(We=>We.label===Q);if(te!==-1)Ht[te].show=!0,kC(Ht,te,te>Ot?Ot+1:Ot),Lt=1;else if(ft==="formula"){const We=v.unref(ub)[Q]||[];if((We==null?void 0:We.length)>1){const Rn=We.slice(1,We.length);for(const qn of Rn){const ji=Ht.findIndex(Xe=>Xe.label===qn);ji!==-1&&!Ht[ji].show&&(Ht[ji].show=!0,kC(Ht,ji,ji>Ot?Ot+1:Ot),Lt++)}}}Lt&&(mt.value=Ht,A.value=!0,ql())}switch(ft){case"drill":alert("无维度可钻取");break;case"delete":X?TY(X,"rows"):Q&&MY(Q);break;case"asc":case"desc":case"default-sort":X?AB(ft,X,q,J):Q&&RB(ft,Q,K,q,J);break;case"filter":X?TB({dimensionKey:X}):Q&&BY(Q,tt);break;case"LAST_DATA":case"SAME_DATA":case"DIFF_DATA":case"MOM_DATA":case"YOY_DATA":case"zb":PY({indicatorKey:Q,menuKey:ft});break;case"trans":HY();break;case"property":EY({indicatorKey:Q,fieldName:tt});break;case"conditionalProperty":LY(Q);break;case"aggregate":v.unref(p).showModal(v.unref(P)[X]||[],X);break;case"top":IY(X);break;case"graph":kY(Q);break}})}function IY(V){v.unref(m).showModal({value:v.unref(x)[V]||"",key:V})}function DY(){v.unref(b).showModal(v.unref(At),v.unref(mt))}async function OY(){A.value=!0,await hb("save",{keyName:i.relateKeyName||i.keyName,data:{}}),r.value="",s.value={},a.value={},h.value={},d.value={},c.value={},x.value={},T.value={},M.value={},B.value={},P.value={},F.value="200px",H.value="200px",k.value={},L.value=i.showLeftTree,D.value=!1,O.value={},ht.value={},At.value=[],mt.value=[],qt.value=[],fe.value={},Yt.value={},Ti.value={},Lo.value=[],Xn.value=[],$r.value={},An.value={},Fs.value=[],Kl.value=[],Yl.value=[],Xl.value=[],Y.value={},Gr.value={},W.value=0,N.value=0,dt.records=[],dt.rows=[],dt.columns=[],dt.indicators=[],dt.dataConfig={sortRules:[],filterRules:[]},dt.defaultRowHeight=gt,dt.menu.dropDownMenuHighlight=[],kB(),ye(),gr()}function zY(V=[],K=[]){var Q;const q=V.concat(K).map(tt=>tt.name),J=v.unref(At).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1})),X=v.unref(mt).filter(tt=>tt.isInnerFilter&&!q.includes(tt.name)).map(tt=>({...tt,show:!1}));At.value=[...V,...J],mt.value=[...K,...X];for(const tt in v.unref(An))if(((Q=v.unref(An)[tt])==null?void 0:Q.type)==="indicators"){delete v.unref(An)[tt];break}i.fullMode||i.allowDrill?(T.value={},B.value={},M.value={},A.value=!0,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()):wB()}function NY(V){if(!v.unref(I))return;const{name:K,scope:q}=v.unref(I),J=v.unref(At).find(Pt=>Pt.name===K),X=v.unref(At).findIndex(Pt=>Pt.name===K),Q=v.unref(mt).find(Pt=>Pt.name===K),tt=v.unref(mt).findIndex(Pt=>Pt.name===K),ft={timeStamp:new Date().getTime()};if(["rows","columns"].includes(V))if(J)if(J.show){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J.positionType=V,J.show=!0,v.unref(At).push(J),v.unref(At).splice(X,1);else v.unref(At).push({...Ue.cloneDeep(v.unref(I)),...ft,positionType:V,showTitle:v.unref(I).label});else if(V==="indicators")if(Q)if(Q.show){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q.show=!0,v.unref(mt).push(Q),v.unref(mt).splice(tt,1);else v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),...ft,showTitle:v.unref(I).label});else if(V==="filters"){if(["IDX","BUILT_IN_IDX"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该指标已存在,请勿重复添加",key:"repeatFlag"});return}else Q?(Q.isInnerFilter=!0,Q.timeStamp=new Date().getTime()):v.unref(mt).push({...Ue.cloneDeep(v.unref(I)),showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft});else if(["DIM","BUILT_IN_DIM"].includes(q))if(v.unref(Kt).find(Pt=>Pt.name===K)){Gi.message.error({content:"该维度已存在,请勿重复添加",key:"repeatFlag"});return}else J?(J.isInnerFilter=!0,J.timeStamp=new Date().getTime()):v.unref(At).push({...Ue.cloneDeep(v.unref(I)),positionType:"filters",showTitle:v.unref(I).label,show:!1,isInnerFilter:!0,...ft})}A.value=!0,I.value=null,hn({type:"10",data:{dimensions:v.unref(At),indicators:v.unref(mt)}}),ql()}const WY=(V=[])=>{let K=!1;for(const q of v.unref(At))if(!V.find(X=>X.typeGuid===q.typeGuid)){K=!0;break}return K};v.provide("setItemDisabled",WY);const MB=()=>{},VY=({checkKeys:V,key:K,type:q})=>{q==="dimension"?(a.value[K]=V,c.value={},RY(K,V)):q==="indicators"&&(h.value[K]=V,AY(K,V))};function BB(V){let K=V;Array.isArray(K)||(K=[V]);for(const q of K){const{indicatorKey:J}=q,X=Zh(J);if(X>-1){const Q=dt.indicators[X];Q.formatConfig=q,PB(Q,q)}}n.updateOption(dt)}function PB(V,K){const{unit:q="",format:J,floatLength:X,position:Q}=K;V.format=(tt,ft,Pt,Qt)=>{const Ht=Qt.getRecordByCell(ft,Pt)||[];return Ht[0]&&isNaN(+Ht[0][V.indicatorKey])?Ht[0][V.indicatorKey]:(J==="integer"?tt=Math.round(Number(tt)):J==="float"&&!isNaN(X)?tt=Number(tt).toFixed(X):J==="percent"&&(X?tt=(Number(tt)*100).toFixed(X)+"%":tt=Number(tt)*100+"%"),Q==="right"?tt+q:q+tt)}}function jY(V,K=[]){const q=Zh(V);if(q>-1){const J=dt.indicators[q];J.conditionalConfig=K;const X=[];K.forEach(Q=>{let tt="";Q.conditions.forEach((ft,Pt)=>{Pt>0&&(tt+=ft.join==="and"?" && ":" || "),tt+=`value${ft.operation}${ft.value}`}),X.push(tt)}),J.style.color=({dataValue:Q})=>{let tt="#333";return K.forEach((ft,Pt)=>{ft.color&&(tt=pb(X[Pt],Q)?ft.color:tt)}),tt},J.style.textAlign=({dataValue:Q})=>{let tt="left";return K.forEach((ft,Pt)=>{ft.align&&(tt=pb(X[Pt],Q)?ft.align:tt)}),tt},J.customRender=({rect:Q,dataValue:tt})=>{let ft=[];return K.forEach((Pt,Qt)=>{if(Pt.icon&&pb(X[Qt],tt)){const Lt=K2(Pt.icon,Pt.iconColor);ft=[{type:"icon",x:Pt.align!=="right"?15:Q.width-25,y:Q.height/2-7,svg:Lt,height:14,width:14}]}}),{elements:ft,renderDefault:!0}},n.updateOption(dt)}}function pb(V,K){V=V||"true";const q=`function (value){
368
368
  if(${V}){
369
369
  return true
370
370
  }else{