@visactor/vtable-gantt 1.7.2 → 1.7.4

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.
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */let wv=class{time=Qe.beforeFillStroke;useStyle=!0;order=0;supportedAppName="vtable";drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){"date-header-cell"===t.name&&t.forEachChildren((t=>{if("date-header-cell-text"===t.name&&!0===t.attribute.textStick){const e=t;e.setAttribute("dx",0);const i=e.globalAABBBounds,o=e.stage.globalAABBBounds,r=e.parent.globalAABBBounds,n=o.intersect(r);o.intersect(r)&&(i.width()>=n.width()&&e.attribute.last_dx?e.setAttribute("dx",e.attribute.last_dx??0):o.x1>=i.x1?(e.setAttribute("dx",o.x1-i.x1),e.setAttribute("last_dx",o.x1-i.x1)):o.x2<=i.x2&&(e.setAttribute("dx",o.x2-i.x2),e.setAttribute("last_dx",o.x1-i.x1)))}}))}};wv=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s}([m()],wv);var xv=new n(((t,e,i,o)=>{t(wv).toSelf().inSingletonScope(),t(ds).toService(wv)}));Bo.load(xv);var Sv,_v,Av,Rv,Bv,Mv,Tv,Pv,kv;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(Sv||(Sv={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(_v||(_v={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(Av||(Av={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(Rv||(Rv={})),function(t){t.RECORD="RECORD",t.NONE="NONE",t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT",t.CUSTOM="CUSTOM",t.RECALCULATE="RECALCULATE"}(Bv||(Bv={})),function(t){t.ASC="ASC",t.DESC="DESC"}(Mv||(Mv={})),function(t){t.inlineFront="inlineFront",t.inlineEnd="inlineEnd",t.left="left",t.right="right",t.absoluteRight="absoluteRight",t.contentLeft="contentLeft",t.contentRight="contentRight",t.absolute="absolute"}(Tv||(Tv={})),function(t){t.frozen="frozen",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp",t.dragReorder="dragReorder"}(Pv||(Pv={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.freezeIconName="freeze",t.frozenIconName="frozen",t.frozenCurrentIconName="frozenCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse",t.dragReorderIconName="dragReorder"}(kv||(kv={}));let Lv,Hv=1,Ev=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=Hv++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const r=i.indexOf(e);i.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;null===(i=this.listenersData.listenerData[e])||void 0===i||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>J(t))):[]}release(){delete this.listenersData}};const zv={CHANGE_STYLE:"change_style"};let Fv,Iv,Ov,Dv=class t extends Ev{static get EVENT_TYPE(){return zv}static get DEFAULT(){return Lv||(Lv=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R,B,M,T,P,k,L;super(),this._defaultPadding=[10,16,10,16],this._textAlign=null!==(i=null==t?void 0:t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign,this._textBaseline=null!==(o=null==t?void 0:t.textBaseline)&&void 0!==o?o:null==e?void 0:e.textBaseline,this._color=null!==(r=null==t?void 0:t.color)&&void 0!==r?r:null==e?void 0:e.color,this._strokeColor=null!==(n=null==t?void 0:t.strokeColor)&&void 0!==n?n:null==e?void 0:e.strokeColor,this._fontSize=null!==(s=t.fontSize)&&void 0!==s?s:null==e?void 0:e.fontSize,this._fontFamily=null!==(a=t.fontFamily)&&void 0!==a?a:null==e?void 0:e.fontFamily,this._fontWeight=null!==(l=t.fontWeight)&&void 0!==l?l:null==e?void 0:e.fontWeight,this._fontVariant=null!==(h=t.fontVariant)&&void 0!==h?h:null==e?void 0:e.fontVariant,this._fontStyle=null!==(d=t.fontStyle)&&void 0!==d?d:null==e?void 0:e.fontStyle,this._padding=null!==(u=null!==(c=null==t?void 0:t.padding)&&void 0!==c?c:null==e?void 0:e.padding)&&void 0!==u?u:this._defaultPadding,this._borderColor=null!==(g=null==t?void 0:t.borderColor)&&void 0!==g?g:null==e?void 0:e.borderColor,this._textOverflow=null!==(p=null==t?void 0:t.textOverflow)&&void 0!==p?p:null==e?void 0:e.textOverflow,this._textStick=null!==(v=null!==(f=t.textStick)&&void 0!==f?f:null==e?void 0:e.textStick)&&void 0!==v&&v,this._textStickBaseOnAlign=null!==(m=null!==(b=t.textStickBaseOnAlign)&&void 0!==b?b:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==m&&m,this._bgColor=null!==(C=null==t?void 0:t.bgColor)&&void 0!==C?C:null==e?void 0:e.bgColor,this._lineHeight=null!==(y=null==t?void 0:t.lineHeight)&&void 0!==y?y:null==e?void 0:e.lineHeight,this._underline=null!==(w=null==t?void 0:t.underline)&&void 0!==w?w:null==e?void 0:e.underline,this._underlineColor=null!==(x=null==t?void 0:t.underlineColor)&&void 0!==x?x:null==e?void 0:e.underlineColor,this._underlineDash=null!==(S=null==t?void 0:t.underlineDash)&&void 0!==S?S:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(_=null==t?void 0:t.underlineOffset)&&void 0!==_?_:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(A=null==t?void 0:t.lineThrough)&&void 0!==A?A:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(R=null==t?void 0:t.lineThroughColor)&&void 0!==R?R:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(B=null==t?void 0:t.lineThroughDash)&&void 0!==B?B:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(M=null==t?void 0:t.linkColor)&&void 0!==M?M:null==e?void 0:e.linkColor,this._cursor=null!==(T=t.cursor)&&void 0!==T?T:null==e?void 0:e.cursor,this._borderLineWidth=null!==(P=t.borderLineWidth)&&void 0!==P?P:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(k=t.borderLineDash)&&void 0!==k?k:null==e?void 0:e.borderLineDash,this._marked=null!==(L=t.marked)&&void 0!==L?L:null==e?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new t(this,null)}},Wv=class t extends Dv{static get DEFAULT(){return Fv||(Fv=new t)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}clone(){return new t(this,null)}};class Nv extends Dv{static get DEFAULT(){return Iv||(Iv=new Nv)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new Nv(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let Gv,jv=class t extends Dv{static get DEFAULT(){return Ov||(Ov=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_;super(t,e),this._size=(null!==(r=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==r?r:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(n=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==n?n:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(l=null===(a=null==t?void 0:t.checkboxStyle)||void 0===a?void 0:a.defaultFill)&&void 0!==l?l:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(m=null===(b=null==t?void 0:t.checkboxStyle)||void 0===b?void 0:b.disableCheckedFill)&&void 0!==m?m:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(y=null===(C=null==t?void 0:t.checkboxStyle)||void 0===C?void 0:C.disableCheckedStroke)&&void 0!==y?y:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(_=null===(S=null==t?void 0:t.checkboxStyle)||void 0===S?void 0:S.indeterminateIconImage)&&void 0!==_?_:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(e){return new t(e,this)}clone(){return new t(this)}};class Uv extends Dv{static get DEFAULT(){return Gv||(Gv=new Uv)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R;super(t,e),this._size=(null!==(r=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==r?r:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(n=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==n?n:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=(null!==(l=null!==(a=null==t?void 0:t.spaceBetweenRadio)&&void 0!==a?a:null==e?void 0:e.spaceBetweenRadio)&&void 0!==l?l:null==i?void 0:i.spaceBetweenRadio)||2,this._innerRadius=null!==(d=null===(h=null==t?void 0:t.radioStyle)||void 0===h?void 0:h.innerRadius)&&void 0!==d?d:null==i?void 0:i.innerRadius,this._outerRadius=null!==(u=null===(c=null==t?void 0:t.radioStyle)||void 0===c?void 0:c.outerRadius)&&void 0!==u?u:null==i?void 0:i.outerRadius,this._defaultFill=null!==(p=null===(g=null==t?void 0:t.radioStyle)||void 0===g?void 0:g.defaultFill)&&void 0!==p?p:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(v=null===(f=null==t?void 0:t.radioStyle)||void 0===f?void 0:f.defaultStroke)&&void 0!==v?v:null==i?void 0:i.defaultStroke,this._disableFill=null!==(m=null===(b=null==t?void 0:t.radioStyle)||void 0===b?void 0:b.disableFill)&&void 0!==m?m:null==i?void 0:i.disableFill,this._checkedFill=null!==(y=null===(C=null==t?void 0:t.radioStyle)||void 0===C?void 0:C.checkedFill)&&void 0!==y?y:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(x=null===(w=null==t?void 0:t.radioStyle)||void 0===w?void 0:w.checkedStroke)&&void 0!==x?x:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(_=null===(S=null==t?void 0:t.radioStyle)||void 0===S?void 0:S.disableCheckedFill)&&void 0!==_?_:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(R=null===(A=null==t?void 0:t.radioStyle)||void 0===A?void 0:A.disableCheckedStroke)&&void 0!==R?R:null==i?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new Uv(t,this)}clone(){return new Uv(this)}}function Vv(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Dv,r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0;var s,a;return t||e?t instanceof Dv?t:"function"==typeof t?Vv(t(i),e,i,o,r,n):(t||(t={}),r&&!J(t.autoWrapText)&&(t.autoWrapText=!0),o===jv?new jv(null!=t?t:{},null!=e?e:{},null!==(s=n.checkboxStyle)&&void 0!==s?s:{}):o===Uv?new Uv(null!=t?t:{},null!=e?e:{},null!==(a=n.radioStyle)&&void 0!==a?a:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class Xv{static get mode(){return Xv._mode||(Xv._mode=function(){let t="browser";try{"node"===window.type?t="node":"undefined"==typeof window||window.performance?"undefined"==typeof window&&(t="node"):t="miniApp"}catch(e){t="node"}return t}()),Xv._mode}static set mode(t){Xv._mode=t}static RegisterCreateCanvas(t){Xv.CreateCanvas=t}static RegisterLoadImage(t){Xv.LoadImage=t}static GetCreateCanvasFunc(){return Xv.CreateCanvas?Xv.CreateCanvas:"worker"===Xv.mode?function(){return new OffscreenCanvas(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:200)}:void 0}static RegisterRequestAnimationFrame(t){Xv.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(Xv.RequestAnimationFrame)return Xv.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){Xv.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(Xv.CancelAnimationFrame)return Xv.CancelAnimationFrame}}Xv.dpr=0;const Yv=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e,$v=t=>Yv(t,"object"),Kv=t=>Yv(t,"string"),qv=t=>Yv(t,"number"),Zv=t=>Yv(t,"boolean");function Jv(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!i.length)return t||{};const r=i.shift();if($v(t)&&$v(r))for(const e in r)$v(r[e])?(t[e]||Object.assign(t,{[e]:{}}),$v(t[e])||Object.assign(t,{[e]:r[e]}),Jv(t[e],r[e])):null!==r[e]&&void 0!==r[e]&&Object.assign(t,{[e]:r[e]});return Jv(t,...i)}function Qv(t){return"function"==typeof t&&(t=t()),J(t)?`${t}`:""}function tb(t,e){let i=null;return function(){for(var o=arguments.length,r=new Array(o),n=0;n<o;n++)r[n]=arguments[n];i||(t.apply(this,r),i=setTimeout((()=>{i=null}),e))}}function eb(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function ib(t,e,i){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const o=Math.round(256*e)*(i?-1:1),r=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),n=r&&J(r[4])?r[4]:null,s=r?[r[1],r[2],r[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return r?`rgb${null!==n?"a":""}(${Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255)}${null!==n?`, ${n}`:""})`:["#",eb(Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255).toString(16),2),eb(Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255).toString(16),2),eb(Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255).toString(16),2)].join("")}function ob(t){return Kv(t)||qv(t)||Zv(t)?t.toString():""}function rb(t,e,i){return"desc"!==i?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}function nb(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}const sb="undefined"==typeof window||void 0===window.window;let ab,lb;const hb={get find(){return ab||(ab=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const i=hb.findIndex(t,e);return i>=0?t[i]:void 0},ab)},get findIndex(){return lb||(lb=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:i}=t;for(let o=0;o<i;o++)if(e(t[o],o,t))return o;return-1},lb)}};const{IE:db,Chrome:cb,Firefox:ub,Edge:gb,Safari:pb}=function(){if(sb)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();return{IE:!!/(msie|trident)/.exec(t),Edge:t.indexOf("edge")>-1,Chrome:t.indexOf("chrome")>-1&&-1===t.indexOf("edge"),Firefox:t.indexOf("firefox")>-1,Safari:t.indexOf("safari")>-1&&-1===t.indexOf("edge")}}();function fb(){const t={};for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return i.forEach((e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(t){e[i]=t},configurable:!0,enumerable:!0})})),t}function vb(t,e){let i=t;for(let t=0;t<(arguments.length<=2?0:arguments.length-2)&&null!=i;t++)i=e(i,t+2<2||arguments.length<=t+2?void 0:arguments[t+2]);return i}function bb(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return vb(t,((t,e)=>t[e]),...i)}function mb(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return"function"==typeof t?t(...i):t}function Cb(t){return Boolean(t&&"function"==typeof t.then)}function yb(t,e){Cb(t)?t.then((t=>{e(t)})).catch((t=>{})):e(t)}function wb(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}function xb(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row}function Sb(t){return{start:{col:Math.min(t.start.col,t.end.col),row:Math.min(t.start.row,t.end.row)},end:{col:Math.max(t.start.col,t.end.col),row:Math.max(t.start.row,t.end.row)}}}function _b(t,e){const i=Sb(t),o=Sb(e);return Math.max(i.start.col,o.start.col)<=Math.min(i.end.col,o.end.col)&&Math.max(i.start.row,o.start.row)<=Math.min(i.end.row,o.end.row)}const Ab=db,Rb={isObject:function(t){return t===Object(t)}},Bb={endsWith:function(t,e,i){const o=ob(t);("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>o.length)&&(i=o.length),i-=e.length;const r=o.lastIndexOf(e,i);return-1!==r&&r===i}},Mb={isTouchEvent:function(t){return!!t.changedTouches}},Tb={toBoxArray:wb},Pb=Function.prototype,kb={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},Lb=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function Hb(t,e,i){let o,r,n,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,n=r;return r=void 0,o=void 0,h=e,s=t.apply(n,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||d&&t-h>=n}function b(){const t=Date.now();if(v(t))return function(t){return a=void 0,u&&o?p(t):(r=void 0,o=void 0,s)}(t);a=f(b,function(t){const i=t-h,o=e&&-(t-l);return d?Math.min(o,n-i):o}(t))}return e=+e||0,Lb(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(n=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(){const t=Date.now(),i=v(t);for(var n=arguments.length,u=new Array(n),g=0;g<n;g++)u[g]=arguments[g];if(o=u,r=this,l=t,i){if(void 0===a)return function(t){return h=t,a=f(b,e),c?p(t):s}(l);if(d)return a=f(b,e),p(l)}return void 0===a&&(a=f(b,e)),s}}let Eb=1;const zb=(t,e)=>{let i=0,o=t.length-1;for(;i<=o;){const r=Math.floor((i+o)/2);if(t[r]===e)return r;t[r]>e?o=r-1:i=r+1}return o<0?0:o};class Fb{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const r=[];for(let n=zb(o,t+i-1);n>=0;n--){const s=o[n];if(s>=t)r.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,r[i-1-t])}const{length:r}=o;if(t<e){const n=[];for(let s=zb(o,t);s<r;s++){const r=o[s];if(r>=t&&r<t+i)n.push(this.get(r));else if(t+i<=r&&r<=e)this.put(r-i,this.get(r));else if(r>e)break}for(let t=0;t<i;t++)this.put(e+t,n[t])}}exchangeOrder(t,e,i,o,r){const{_keys:n}=this;if(this._sorted||(n.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let r=zb(n,i);r<t+e;r++){const i=n[r];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,s[t]);for(let t=0;t<o.length;t++)this.put(r+e+t,o[t])}else{const s=[],a=[];for(let r=zb(n,t);r<i+o;r++){const i=n[r];i>=t&&i<t+e?a.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,a[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);-1!==e&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return J(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:r}=o;this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let n=zb(o,t);n<r;n++){const r=o[n];if(t<=r&&r<=e){if(!1===i(this.get(r),r))break}else if(e<r)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),J(e)&&this.put(t,e)}}class Ib{constructor(t,e,i,o){this.bounds=new Qt,this.bounds.set(t,e,t+i,e+o)}static bounds(t,e,i,o){return new Ib(t,e,Math.round(i-t),Math.round(o-e))}get left(){return this.bounds.x1}set left(t){this.bounds.x1=t}get top(){return this.bounds.y1}set top(t){this.bounds.y1=t}get right(){return this.bounds.x2}set right(t){this.bounds.x2=t}get bottom(){return this.bounds.y2}set bottom(t){this.bounds.y2=t}get width(){return this.bounds.width()}set width(t){this.bounds.x2=this.bounds.x1+t}get height(){return this.bounds.height()}set height(t){this.bounds.y2=this.bounds.y1+t}offsetLeft(t){this.bounds.translate(t,0)}offsetTop(t){this.bounds.translate(0,t)}copy(){return new Ib(this.left,this.top,this.width,this.height)}contains(t){return this.bounds.encloses(t.bounds)}inPoint(t,e){return this.bounds.contains(t,e)}}var Ob={underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Db={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Wb={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Nb={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Gb={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:i}=t,{colCount:o,frozenColCount:r}=i,n="#ccc7c7";return r-1===e||o-1===e?[n,"#f2f2f2","#ccc7c7",null]:[n,null,"#ccc7c7",null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:i}}=t;return i-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};const jb={},Ub="Arial,sans-serif",Vb=[],Xb=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,Yb="$$indicator$$",$b={type:"line"};function Kb(t){return t||{}}const qb={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function Zb(t,e,i,o){var r,n,s;return null!==(s=null!==(n=null!==(r=bb(t,...i))&&void 0!==r?r:bb(e,...i))&&void 0!==n?n:o&&bb(t,...o))&&void 0!==s?s:o&&bb(e,...o)}class Jb{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._groupTitle=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this.isPivot=!1,this.internalTheme={obj:t,superTheme:e}}getExtendTheme(){return this.internalTheme.obj}get font(){const{obj:t,superTheme:e}=this.internalTheme;return Zb(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return Zb(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null===(t=Zb(e,i,["cellInnerBorder"]))||void 0===t||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Zb(e,i,["cellBorderClipDirection"]))&&void 0!==t?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Zb(e,i,["_contentOffset"]))&&void 0!==t?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=Jv({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var t;return null!==(t=o.fontSize)&&void 0!==t?t:16},get fontFamily(){var t;return null!==(t=o.fontFamily)&&void 0!==t?t:Ub},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var t;return null!==(t=o.bgColor)&&void 0!==t?t:"#FFF"},get color(){var t;return null!==(t=o.color)&&void 0!==t?t:"#000"},get borderColor(){var t;return null!==(t=o.borderColor)&&void 0!==t?t:"#000"},get borderLineWidth(){var t;return null!==(t=o.borderLineWidth)&&void 0!==t?t:1},get borderLineDash(){var t;return null!==(t=o.borderLineDash)&&void 0!==t?t:Vb},get hover(){if(o.hover)return{get cellBgColor(){var t,e;return null!==(e=null===(t=o.hover)||void 0===t?void 0:t.cellBgColor)&&void 0!==e?e:void 0},get inlineColumnBgColor(){var t,e,i,r,n,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineColumnBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var t,e,i,r,n,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineRowBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var e,i,r,n,s,a;return null!==(a=null!==(n=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:null===(r=t.selectionStyle)||void 0===r?void 0:r.inlineColumnBgColor)&&void 0!==n?n:(null===(s=t.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?ib(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==a?a:void 0},get inlineRowBgColor(){var e,i,r,n,s;return null!==(s=null!==(r=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:t.selectionStyle.inlineRowBgColor)&&void 0!==r?r:(null===(n=t.selectionStyle)||void 0===n?void 0:n.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?ib(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get padding(){var t;return null!==(t=o.padding)&&void 0!==t?t:[10,16,10,16]},get textAlign(){var t;return null!==(t=o.textAlign)&&void 0!==t?t:"left"},get textBaseline(){var t;return null!==(t=o.textBaseline)&&void 0!==t?t:"middle"},get textOverflow(){var t;return null!==(t=o.textOverflow)&&void 0!==t?t:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var t;return null!==(t=o.autoWrapText)&&void 0!==t&&t},get lineClamp(){var t;return null!==(t=o.lineClamp)&&void 0!==t?t:"auto"},get linkColor(){var t;return null!==(t=o.linkColor)&&void 0!==t?t:"#3772ff"},get cursor(){var t;return null!==(t=o.cursor)&&void 0!==t?t:"auto"},get marked(){var t;return null!==(t=o.marked)&&void 0!==t&&t},get underline(){var t;return null!==(t=o.underline)&&void 0!==t&&t},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var t;return null!==(t=o.lineThrough)&&void 0!==t&&t},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=Jv({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=Jv({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=Jv({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=Jv({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=Jv({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=Jv({},this.defaultStyle,i.rowHeaderStyle,null!==(t=e.rowHeaderStyle)&&void 0!==t?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get groupTitleStyle(){if(!this._groupTitle){const{obj:t,superTheme:e}=this.internalTheme;if(!e.groupTitleStyle&&!t.groupTitleStyle)return this._groupTitle;const i=Jv({},this.defaultStyle,e.groupTitleStyle,t.groupTitleStyle);this._groupTitle=this.getStyle(i)}return this._groupTitle}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var t;return null!==(t=i.scrollSliderColor)&&void 0!==t?t:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var t;return null!==(t=i.visible)&&void 0!==t?t:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:7},get hoverOn(){var t;return null===(t=i.hoverOn)||void 0===t||t},get barToSide(){var t;return null!==(t=i.barToSide)&&void 0!==t&&t},get horizontalPadding(){var t;return null!==(t=i.horizontalPadding)&&void 0!==t?t:0},get verticalPadding(){var t;return null!==(t=i.verticalPadding)&&void 0!==t?t:0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var t;return null!==(t=i.fontFamily)&&void 0!==t?t:Ub},get fontSize(){var t;return null!==(t=i.fontSize)&&void 0!==t?t:16},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#000"},get padding(){var t;return null!==(t=i.padding)&&void 0!==t?t:[6,8]},get color(){var t;return null!==(t=i.color)&&void 0!==t?t:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"#416EFF"},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#D9E2FF"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:1},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:i.lineWidth+2},get labelColor(){var t;return null!==(t=i.labelColor)&&void 0!==t?t:"#FFF"},get labelFontSize(){var t;return null!==(t=i.labelFontSize)&&void 0!==t?t:10},get labelFontFamily(){var t;return null!==(t=i.labelFontFamily)&&void 0!==t?t:"sans-serif"},get labelBackgroundFill(){var t;return null!==(t=i.labelBackgroundFill)&&void 0!==t?t:"#3073F2"},get labelBackgroundCornerRadius(){var t;return null!==(t=i.labelBackgroundCornerRadius)&&void 0!==t?t:5},get labelVisible(){var t;return null===(t=i.labelVisible)||void 0===t||t}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"blue"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:2},get shadowBlockColor(){var t;return null!==(t=i.shadowBlockColor)&&void 0!==t?t:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.width)&&void 0!==e?e:24},get startColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.startColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get endColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.endColor)&&void 0!==e?e:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get bgColor(){var t,e,o,r;return null!==(r=null!==(e=null===(t=i.border)||void 0===t?void 0:t.bgColor)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineColor)&&void 0!==r?r:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineWidth)&&void 0!==e?e:4},get width(){var t,e,o,r;return null!==(r=null!==(e=null===(t=i.border)||void 0===t?void 0:t.width)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineWidth)&&void 0!==r?r:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var t;return null!==(t=null==i?void 0:i.cellBgColor)&&void 0!==t?t:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var t;return null!==(t=null==i?void 0:i.cellBorderColor)&&void 0!==t?t:"#3073f2"},get cellBorderLineWidth(){var t;return null!==(t=null==i?void 0:i.cellBorderLineWidth)&&void 0!==t?t:2},get inlineColumnBgColor(){return null==i?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return null==i?void 0:i.inlineRowBgColor},get selectionFillMode(){var t;return null!==(t=null==i?void 0:i.selectionFillMode)&&void 0!==t?t:"overlay"}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.axisStyle,t.axisStyle);this._axisStyle=function(t){return{defaultAxisStyle:Kb(t.defaultAxisStyle),leftAxisStyle:Kb(t.leftAxisStyle),rightAxisStyle:Kb(t.rightAxisStyle),topAxisStyle:Kb(t.topAxisStyle),bottomAxisStyle:Kb(t.bottomAxisStyle)}}(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},qb,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return Qb(e,t)||Qb(i,t)}extends(t){return new Jb(t,this.internalTheme.superTheme||this.internalTheme.obj)}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var e,i;return null!==(i=null===(e=t.hover)||void 0===e?void 0:e.cellBgColor)&&void 0!==i?i:void 0},get inlineColumnBgColor(){var e,i,o,r,n,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var e,i,o,r,n,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,r,n,s,a;return null!==(a=null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineColumnBgColor)&&void 0!==o?o:null===(r=e.selectionStyle)||void 0===r?void 0:r.inlineColumnBgColor)&&void 0!==n?n:(null===(s=e.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?ib(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==a?a:void 0},get inlineRowBgColor(){var i,o,r,n,s;return null!==(s=null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineRowBgColor)&&void 0!==o?o:e.selectionStyle.inlineRowBgColor)&&void 0!==r?r:(null===(n=e.selectionStyle)||void 0===n?void 0:n.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?ib(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get cellBgColor(){var i,o,r;if("replace"===e.selectionStyle.selectionFillMode)return null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.cellBgColor)&&void 0!==o?o:e.selectionStyle.cellBgColor)&&void 0!==r?r:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderColor)&&void 0!==i?i:void 0},get borderLineWidth(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineWidth)&&void 0!==i?i:void 0},get borderLineDash(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineDash)&&void 0!==i?i:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var e;return null!==(e=t.underline)&&void 0!==e&&e},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var e;return null!==(e=t.lineThrough)&&void 0!==e&&e},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function Qb(t,e){if(t instanceof Jb)return t.hasProperty(e);let i=t;if(!i)return!1;for(let t=0;t<e.length;t++)if(i=i[e[t]],!i)return!1;return!!i}const tm=new Jb(Ob,Ob),em=new Jb(Db,Db),im=new Jb(Wb,Wb),om=new Jb(Nb,Nb),rm=new Jb(Gb,Gb),nm={DEFAULT:om,SIMPLIFY:rm,ARCO:im,DARK:tm,BRIGHT:em};function sm(){return fb(nm,jb)}var am={DARK:tm,BRIGHT:em,ARCO:im,DEFAULT:om,SIMPLIFY:rm,theme:{TableTheme:Jb},of:function(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const i=e.toLowerCase();if(t[i])return t[i];const o=e.toLowerCase();if(t[o])return t[o];for(const e in t)if(e.toLowerCase()===i)return t[e]}(sm(),t);return e?e instanceof Jb?e:new Jb(e,e):null}return t instanceof Jb?t:new Jb(t,t)},get:sm};function lm(t,e,i){var o;if(t.internalProps.customMergeCell){const o=t.getCustomMerge(e,i);if(o)return o.range}if(!t.internalProps.enableTreeNodeMerge&&!t.isHeader(e,i)&&!(null===(o=t.getBodyColumnDefine(e,i))||void 0===o?void 0:o.mergeCell))return!1;const r=t.getCellRange(e,i);return!(r.start.col===r.end.col&&r.start.row===r.end.row)&&r}class hm{static registerComponent(t,e){hm._components[t]=e}static getComponent(t){return hm._components[t]}static registerFunction(t,e){hm._functions[t]=e}static getFunction(t){return hm._functions[t]}static registerCellType(t,e){hm._cellTypes[t]=e}static getCellType(t){return hm._cellTypes[t]}}function dm(t,e,i,o,r,n){const s=function(t,e){const i=new Array(e);for(let o=0;o<e;o++)i[o]=t(o);return i}(t,i);s.sort(((t,e)=>o(n(t),n(e),r)));for(let t=0;t<i;t++)e(t,s[t])}hm._components={},hm._functions={},hm._cellTypes={};class cm{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=null!==(e=t.isRecord)&&void 0!==e?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[]}}class um extends cm{constructor(){super(...arguments),this.type=Bv.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t))}value(){return this.records}reset(){this.records=[]}recalculate(){}}class gm extends cm{constructor(){super(...arguments),this.type=Bv.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field]))}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class pm extends cm{constructor(t){super(t),this.type=Bv.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field]))}value(){var t;return this.fieldValue||(this.fieldValue=null===(t=this.aggregationFun)||void 0===t?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class fm extends cm{constructor(t){var e;super(t),this.type=Bv.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=null!==(e=t.needSplitPositiveAndNegative)&&void 0!==e&&e}push(t){if(t)if(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className){const e=t.value();this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}}value(){return this.sum}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if("Aggregator"===e.className){const t=e.value();this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const t=parseFloat(e[this.field]);this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}}}}class vm extends cm{constructor(){super(...arguments),this.type=Bv.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++)}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.count+=e.value():this.count++}}}class bm extends cm{constructor(){super(...arguments),this.type=Bv.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===Bv.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++))}value(){return this.sum/this.count}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className&&e.type===Bv.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class mm extends cm{constructor(){super(...arguments),this.type=Bv.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.max=t.max>this.max?t.max:this.max:"number"==typeof t?this.max=t>this.max?t:this.max:this.field&&"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max))}value(){return this.max}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.max=e.max>this.max?e.max:this.max:"number"==typeof e?this.max=e>this.max?e:this.max:this.field&&"number"==typeof e[this.field]?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class Cm extends cm{constructor(){super(...arguments),this.type=Bv.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.min=t.min<this.min?t.min:this.min:"number"==typeof t?this.min=t<this.min?t:this.min:this.field&&"number"==typeof t[this.field]&&(this.min=t[this.field]<this.min?t[this.field]:this.min))}value(){return this.min}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.min=e.min<this.min?e.min:this.min:"number"==typeof e?this.min=e<this.min?e:this.min:this.field&&"number"==typeof e[this.field]&&(this.min=e[this.field]<this.min?e[this.field]:this.min)}}}const ym={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function wm(t,e){const i=mb(t);if(Cb(i)){const t=i.then((t=>(e(t),t)));return e(t),t}return i}function xm(t,e,i,o,r,n){if(null==t)return;if(Cb(t))return t.then((t=>xm(t,e,i,o,r,n)));const s=function(t){if(Rb.isObject(t)){const e=t;if(J(e.get)&&J(e.set))return!0}return!1}(e)?e.get:e;if(s in t)return wm(t[s],n);if("function"==typeof s)return wm(s(t,i,o,r),n);if(Array.isArray(s))return wm(function(t,e){let i,o=t;for(;i=e.shift();)o=o[i];return o}(t,[...s]),n);const a=`${s}`.split(".");return a.length<=1?wm(t[s],n):wm(vb(t,((t,e)=>xm(t,e,i,o,r,Pb)),...a),n)}function Sm(t,e){if(!t)return e;const i=t[e];return J(i)?i:e}let _m=class extends Ev{static get EVENT_TYPE(){return ym}constructor(t,e,i,o,r,n){var s;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap=[],this.registedAggregators={},this.fieldAggregators=[],this.layoutColumnObjects=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=null==t?void 0:t.get,this.layoutColumnObjects=o,this._source=(null==t?void 0:t.records)?this.processRecords(null==t?void 0:t.records):t,this._sourceLength=(null===(s=this._source)||void 0===s?void 0:s.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},n>=1&&(this.hierarchyExpandLevel=n),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),"tree"===r&&this.initTreeHierarchyState(),this.rowHierarchyType=r,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],r=this.getOriginalRecord(o),n=null!==(t=r.filteredChildren)&&void 0!==t?t:r.children;if((null==n?void 0:n.length)>0){if(this.hierarchyExpandLevel>1?!r.hierarchyState&&(r.hierarchyState=Rv.expand):!r.hierarchyState&&(r.hierarchyState=Rv.collapse),this.hasHierarchyStateExpand=!0,r.hierarchyState===Rv.collapse)continue;const t=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,r);i+=t,e+=t}else!0===r.children&&!r.hierarchyState&&(r.hierarchyState=Rv.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(Bv.RECORD,um),this.registerAggregator(Bv.SUM,fm),this.registerAggregator(Bv.COUNT,vm),this.registerAggregator(Bv.MAX,mm),this.registerAggregator(Bv.MIN,Cm),this.registerAggregator(Bv.AVG,bm),this.registerAggregator(Bv.NONE,gm),this.registerAggregator(Bv.CUSTOM,pm)}_generateFieldAggragations(){const t=this.layoutColumnObjects;for(let e=0;e<(null==t?void 0:t.length);e++){t[e].aggregator=null;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let r=0;r<o.length;r++){const n=o[r],s=new this.registedAggregators[n.aggregationType]({dimension:i,formatFun:n.formatFun,isRecord:!0,aggregationFun:n.aggregationFun});this.fieldAggregators.push(s),t[e].aggregator||(t[e].aggregator=[]),t[e].aggregator.push(s)}else{const r=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(r),t[e].aggregator=r}}}processRecords(t){var e,i,o,r,n,s,a,l;this._generateFieldAggragations();const h=[],d=this.fieldAggregators.length>=1;if((null===(i=null===(e=this.dataConfig)||void 0===e?void 0:e.filterRules)||void 0===i?void 0:i.length)>=1||(null===(o=this.lastFilterRules)||void 0===o?void 0:o.length)>=1||d){for(let e=0,i=t.length;e<i;e++){const i=t[e];(null===(n=null===(r=this.dataConfig)||void 0===r?void 0:r.filterRules)||void 0===n?void 0:n.length)>=1?this.filterRecord(i)&&(h.push(i),"tree"===this.rowHierarchyType&&i.children&&(i.filteredChildren=this.filteredChildren(i.children)),d&&this.processRecord(i)):(null===(s=this.lastFilterRules)||void 0===s?void 0:s.length)>=1?(this.clearFilteredChildren(i),d&&this.processRecord(i)):d&&this.processRecord(i)}if((null===(l=null===(a=this.dataConfig)||void 0===a?void 0:a.filterRules)||void 0===l?void 0:l.length)>=1)return h}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];this.filterRecord(o)&&(e.push(o),o.children&&(o.filteredChildren=this.filteredChildren(o.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var r,n,s;let a=0;const l=o.filteredChildren?o.filteredChildren.length:null!==(n=null===(r=o.children)||void 0===r?void 0:r.length)&&void 0!==n?n:0;for(let r=0;r<l;r++){(i<=e||o.hierarchyState===Rv.expand)&&(a+=1);const n=o.filteredChildren?o.filteredChildren[r]:o.children[r],l=Array.isArray(t)?t.concat(r):[t,r];(i<=e||o.hierarchyState===Rv.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+a,0,l),(n.filteredChildren?n.filteredChildren.length>0:(null===(s=n.children)||void 0===s?void 0:s.length)>0)&&(i<e||n.hierarchyState===Rv.expand?(!n.hierarchyState&&(n.hierarchyState=Rv.expand),this.hasHierarchyStateExpand=!0):!n.hierarchyState&&(n.hierarchyState=Rv.collapse)),n.hierarchyState===Rv.expand&&(a+=this.initChildrenNodeHierarchy(l,e,i+1,n))}return a}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),r=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let i=0;i<t.length;i++)if((Array.isArray(t[i])&&1===t[i].length||!Array.isArray(t[i]))&&e++,e>=o&&e<r)this._currentPagerIndexedData.push(t[i]);else if(e>=r)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(Sm(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(Sm(this.currentPagerIndexedData,t))}getIndexKey(t){return Sm(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex((e=>Rt(e,t))):this.currentPagerIndexedData.findIndex((e=>e===t))}getField(t,e,i,o,r){return this.getOriginalField(Sm(this.currentPagerIndexedData,t),e,i,o,r)}getRawField(t,e,i,o,r){return this.getRawFieldData(Sm(this.currentPagerIndexedData,t),e,i,o,r)}hasField(t,e){return this.hasOriginalField(Sm(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentIndexedData[t]);return null!==(e=null==i?void 0:i.hierarchyState)&&void 0!==e?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),r=this.getIndexKey(t),n=this.getHierarchyState(t),s=this.getOriginalRecord(r);if(this.clearSortedIndexMap(),n===Rv.collapse)s.hierarchyState=Rv.expand,this.pushChildrenNode(r,Rv.expand,s),this.hasHierarchyStateExpand=!0;else if(n===Rv.expand){let t=0;const e=(i,o,r)=>{if(!o||o===Rv.collapse||o===Rv.none)return;const n=r.filteredChildren?r.filteredChildren:r.children;if(n)for(let o=0;o<n.length;o++){t+=1;const r=Array.isArray(i)?i.concat([o]):[i,o];e(r,n[o].hierarchyState,n[o])}};e(r,n,s),this.currentIndexedData.splice(this.currentIndexedData.indexOf(r)+1,t),s.hierarchyState=Rv.collapse}this.updatePagerData();const a=[],l=[];if(n===Rv.collapse){const e=this.currentIndexedData.length-o.length;for(let i=0;i<e;i++)a.push(t+i+1)}else if(n===Rv.expand){const e=o.length-this.currentIndexedData.length;for(let i=0;i<e;i++)l.push(t+i+1)}return{add:a,remove:l}}pushChildrenNode(t,e,i){var o;if(!e||e===Rv.collapse||e===Rv.none)return 0;let r=0;const n=i.filteredChildren?i.filteredChildren:i.children;if(n){const e=Array.from({length:n.length},((t,e)=>e));this.lastOrder&&"normal"!==this.lastOrder&&this.lastOrderField&&dm((t=>J(e[t])?e[t]:e[t]=t),((t,i)=>{e[t]=i}),n.length,this.lastOrderFn,this.lastOrder,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],this.lastOrderField)));for(let i=0;i<e.length;i++){r+=1;const s=Array.isArray(t)?t.concat([e[i]]):[t,e[i]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,s);const a=this.getOriginalRecord(s);!a.hierarchyState&&(null!==(o=a.filteredChildren)&&void 0!==o?o:a.children)&&(a.hierarchyState=Rv.collapse),r+=this.pushChildrenNode(s,a.hierarchyState,n[e[i]])}}return r}changeFieldValue(t,e,i,o,r,n){var s;if(null!==i&&e>=0){const o=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[o]){const t=this.getOriginalRecord(o);this.beforeChangedRecordsMap[o]=null!==(s=mt(t))&&void 0!==s?s:{}}if("string"==typeof i||"number"==typeof i){const e=this.beforeChangedRecordsMap[o][i],r=this.getOriginalRecord(o);let n=t;"number"==typeof e&&function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t)&&(n=parseFloat(t)),Cb(r)?r.then((t=>{t[i]=n})).catch((t=>{})):r?r[i]=n:(this.records[o]={},this.records[o][i]=n)}}}setRecord(t,e){var i,o;let r=!0;if((null===(o=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules)||void 0===o?void 0:o.length)>=1&&(this.filterRecord(t)?"tree"===this.rowHierarchyType&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):r=!1),r&&Array.isArray(this.records)){const i=this.getIndexKey(e);Array.isArray(i)||this.records.splice(i,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){if(this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const t=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=t}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort(((t,e)=>e-t));for(let t=0;t<o.length;t++){const e=o[t];e>=this._sourceLength||e<0||(delete this.beforeChangedRecordsMap[e],i.push(e),this.records.splice(e,1),this.currentIndexedData.pop(),this._sourceLength-=1)}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),(null===(e=this.dataSourceObj)||void 0===e?void 0:e.deleted)&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];if(i>=this._sourceLength||i<0)continue;const o=this.currentIndexedData[i];delete this.beforeChangedRecordsMap[o],this.records.splice(o,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const r=e[o];r>=this._sourceLength||r<0||(delete this.beforeChangedRecordsMap[r],i.push(r),this.records[r]=t[o])}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const r=this.currentIndexedData[o];if("number"!=typeof r)return;delete this.beforeChangedRecordsMap[r],this.records[r]=t[i]}this.sortedIndexMap.clear()}sort(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desc"!==e?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1;this.lastOrderField=t,this.lastOrder=e,this.lastOrderFn=i;let o,r=this.sortedIndexMap.get(t);if(r&&(o=r[e],o&&o.length>0))return this.currentIndexedData=o,this.updatePagerData(),void this.fireListeners(ym.CHANGE_ORDER,null);const n=[];if("normal"===e)for(let t=0;t<this._sourceLength;t++)n[t]=t;else dm((t=>J(n[t])?n[t]:n[t]=t),((t,e)=>{n[t]=e}),this._sourceLength,i,e,(e=>this.getOriginalField(e,t)));if(this.currentIndexedData=n,this.hierarchyExpandLevel){let t=n.length;window.performance.now();for(let e=0;e<t;e++){const i=this.getOriginalRecord(n[e]),o=this.pushChildrenNode(n[e],i.hierarchyState,this.getOriginalRecord(n[e]));t+=o,e+=o}}r||(r={asc:[],desc:[],normal:[]},this.sortedIndexMap.set(t,r)),r[e]=n,this.updatePagerData(),this.fireListeners(ym.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;null!==(i=o<(null===(e=t.children)||void 0===e?void 0:e.length))&&void 0!==i&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let r=!0;for(let n=0;n<(null===(e=this.dataConfig.filterRules)||void 0===e?void 0:e.length);n++){const e=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules[n];if(e.filterKey){const i=t[e.filterKey];if(-1===e.filteredValues.indexOf(i)){r=!1;break}}else if(!(null===(o=e.filterFunc)||void 0===o?void 0:o.call(e,t))){r=!1;break}}return r}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastOrderField&&this.lastOrder&&this.sortedIndexMap.forEach(((t,e)=>{e!==this.lastOrderField?this.sortedIndexMap.delete(e):"asc"===this.lastOrder?(t.desc=[],t.normal=[]):"desc"===this.lastOrder?(t.asc=[],t.normal=[]):(t.desc=[],t.asc=[])}))}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(ym.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?Am(this.records,t):this.records[t]:this._get(t),wm(e,(e=>{this.recordPromiseCallBack(t,e)}))}getRawRecord(t){var e;if(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?Am(this.records,t):this.records[t]:this._get(t),wm(i,(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e,i,o,r){if(null!==e)return xm(this.getOriginalRecord(t),e,i,o,r,(i=>{this.fieldPromiseCallBack(t,e,i)}))}getRawFieldData(t,e,i,o,r){if(null!==e)return xm(this.getRawRecord(t),e,i,o,r,(i=>{this.fieldPromiseCallBack(t,e,i)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const i=this.getOriginalRecord(t);return Boolean(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let t=0;t<=i.length-2;t++)if(i[t]!==o[t])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i;if("asc"!==this.lastOrder&&"desc"!==this.lastOrder&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let o,r,n=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];if(n=Array.isArray(n)?[...n]:[n],s=Array.isArray(s)?[...s]:[s],n.length>1||s.length>1){if(e>t&&s.length>n.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<s.length&&s.splice(s.length-1,1)}if(o=n.splice(n.length-1,1)[0],r=s.splice(s.length-1,1)[0],n.length>=1){const t=this.getOriginalRecord(n),e=t.filteredChildren?t.filteredChildren.splice(o,1):t.children.splice(o,1);e.unshift(r,0),Array.prototype.splice.apply(null!==(i=t.filteredChildren)&&void 0!==i?i:t.children,e)}else{const t=this.records.splice(o,1);t.unshift(r,0),Array.prototype.splice.apply(this.records,t)}}else{o=this.currentPagerIndexedData[t],r=this.currentPagerIndexedData[e];const i=this.records.splice(o,1);i.unshift(r,0),Array.prototype.splice.apply(this.records,i)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const i=this.records.splice(t,1);i.unshift(e,0),Array.prototype.splice.apply(this.records,i)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let e=0;e<this._sourceLength;e++){const i=this.getOriginalRecord(e);(null!==(t=i.filteredChildren)&&void 0!==t?t:i.children)&&!i.hierarchyState&&(i.hierarchyState=Rv.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let i=this._sourceLength;for(let t=0;t<i;t++){const o=this.currentIndexedData[t],r=this.getOriginalRecord(o),n=null!==(e=r.filteredChildren)&&void 0!==e?e:r.children;if((null==n?void 0:n.length)>0&&r.hierarchyState===Rv.expand){this.hasHierarchyStateExpand=!0;const e=this.restoreChildrenNodeHierarchy(o,r);t+=e,i+=e}else!0===r.children&&!r.hierarchyState&&(r.hierarchyState=Rv.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let r=0;const n=null!==(i=e.filteredChildren)&&void 0!==i?i:e.children,s=null!==(o=null==n?void 0:n.length)&&void 0!==o?o:0;for(let i=0;i<s;i++){e.hierarchyState===Rv.expand&&(r+=1);const o=n[i],s=Array.isArray(t)?t.concat(i):[t,i];e.hierarchyState===Rv.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,s),r+=this.restoreChildrenNodeHierarchy(s,o)}return r}};function Am(t,e){var i;let o=t;for(let t=0;t<e.length;t++){const r=e[t];if(!o[r])return;o=o[r];const n=null!==(i=o.filteredChildren)&&void 0!==i?i:null==o?void 0:o.children;n&&t+1<e.length&&(o=n)}return o}_m.EMPTY=new _m({get(){},length:0});class Rm extends _m{static get EVENT_TYPE(){return _m.EVENT_TYPE}static ofArray(t,e,i,o,r,n){return new Rm({get:e=>t[e],length:t.length,records:t},e,i,o,r,n)}constructor(t,e,i,o,r,n){rt(null==e?void 0:e.groupByRules)&&(r="tree"),super(t,e,i,o,r,n),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getRawRecord(t){var e;return(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])?this.beforeChangedRecordsMap[t]:this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getRawRecord(t)}getOriginalField(t,e,i,o,r){const n=this._fieldCache&&this._fieldCache[t];if(n){const t=n.get(e);if(t)return t}return super.getOriginalField(t,e,i,o,r)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){!function(t,e,i,o){(t[e]||(t[e]=new Map)).set(i,o)}(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache[t]=e}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this._recordCache=null,this._fieldCache=null}_generateFieldAggragations(){var t;if(super._generateFieldAggragations(),rt(null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)){const t=this.dataConfig.groupByRules;this.groupAggregator=new this.registedAggregators[Bv.CUSTOM]({dimension:"",aggregationFun:(e,i,o)=>{const r=new Map,n=[];for(let e=0;e<i.length;e++)Bm(i[e],n,r,t,0);return n}}),this.fieldAggregators.push(this.groupAggregator)}}processRecords(t){var e;const i=super.processRecords(t);return(null===(e=this.groupAggregator)||void 0===e?void 0:e.value())||i}getGroupLength(){var t,e,i;return null!==(i=null===(e=null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)||void 0===e?void 0:e.length)&&void 0!==i?i:0}updateGroup(){var t,e,i;this.clearCache();const o=this.source;this._source=this.processRecords(null!==(e=null===(t=this.dataSourceObj)||void 0===t?void 0:t.records)&&void 0!==e?e:this.dataSourceObj),o&&Mm(o,this.source),this.sourceLength=(null===(i=this.source)||void 0===i?void 0:i.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this.sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this.sourceLength,this.pagination.totalCount=this.sourceLength),this.initTreeHierarchyState(),this.updatePagerData()}addRecordsForGroup(t){rt(t)&&0!==t.length&&(this.dataSourceObj.records.push(...t),this.updateGroup())}deleteRecordsForGroup(t){if(!rt(t)||0===t.length)return;const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];i>=this.sourceLength||i<0||(delete this.beforeChangedRecordsMap[i],this.dataSourceObj.records.splice(i,1),this.sourceLength-=1)}this.updateGroup()}updateRecordsForGroup(t,e){for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records[o]=t[i])}this.updateGroup()}}function Bm(t,e,i,o,r){const n=o[r];if(!J(n))return void e.push(t);const s=t[n];if(void 0!==s)if(i.has(s)){const n=i.get(s);Bm(t,e[n].children,e[n].map,o,r+1)}else i.set(s,e.length),e.push({vtableMerge:!0,vtableMergeName:s,children:[],map:new Map}),Bm(t,e[e.length-1].children,e[e.length-1].map,o,r+1)}function Mm(t,e,i,o){if(!i){i=new Map;for(let e=0;e<t.length;e++){const o=t[e];o.vtableMerge&&i.set(o.vtableMergeName,e)}}if(!o){o=new Map;for(let t=0;t<e.length;t++){const i=e[t];i.vtableMerge&&o.set(i.vtableMergeName,t)}}for(let i=0;i<t.length;i++){const r=t[i],n=e[o.get(r.vtableMergeName)];J(n)&&(n.hierarchyState=t[i].hierarchyState),rt(r.children)&&rt(n.children)&&0!==r.map.size&&0!==n.map.size&&Mm(r.children,n.children,r.map,n.map)}}var Tm={exports:{}},Pm={},km=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Lm=["style","variant","weight","size","lineHeight","family"],Hm=/([\.0-9]+)(.*)/,Em=function(t,e,i){var o=t.match(Hm);if(o){t=parseFloat(o[1]);var r=o[2].toLowerCase().trim(),n=Math.round(t);switch(n===t&&(t=n),r){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/i);case"pc":return t/(6/i);case"mm":return t*(i/25.4);case"cm":return t*(i/2.54);case"in":return t*i;case"%":if(null===e)return;return e*(t/100)}}},zm={size:Em,lineHeight:Em},Fm={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},Im=Tm.exports=function(t,e,i){var o=t+"-"+(e||"null")+"@"+i;if(i=i||96,void 0!==Pm[o])return Pm[o];if(e&&(e=Im(e,null,i)),"inherit"===t)return e;var r=km.exec(t);if(r){r.shift();for(var n={},s=0;s<r.length;s++){var a=Lm[s],l=r[s];if(zm[a]&&l){var h=e&&e[a]||null,d=zm[a](l,h,i);l=void 0===d&&"lineHeight"===a&&l?n.size*parseFloat(l):d}if(l&&"normal"!==l){if("inherit"===l){if(!e)return;l=e[a]}l.trim&&(l=l.trim()),n[a]=l}}Object.keys(n).length||(n=null),Pm[o]=n;var c=[];n.style&&c.push(n.style),n.variant&&c.push(n.variant),n.weight&&"400"!==n.weight&&"normal"!==n.weight&&c.push(n.weight),c.push(n.size+"px"),n.lineHeight&&(c[c.length-1]+="/"+n.lineHeight+"px");var u=n.family.split(",");return n.family=u.map((function(t){return t=t.trim(),Fm[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(n.family),Object.defineProperty(n,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),n}Pm[o]=null};Tm.exports.generics=Fm;var Om=V(Tm.exports);function Dm(t){var e,i,o,r;if(at(t)||ot(t)||rt(t)){let e=Ar(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}return t&&(isFinite(t.bottom)||isFinite(t.left)||isFinite(t.right)||isFinite(t.top))?[null!==(e=t.top)&&void 0!==e?e:0,null!==(i=t.right)&&void 0!==i?i:0,null!==(o=t.bottom)&&void 0!==o?o:0,null!==(r=t.left)&&void 0!==r?r:0]:[0,0,0,0]}const Wm=0,Nm=1,Gm=2,jm=3,Um=10,Vm=11,Xm=12,Ym=9,$m=13,Km=10,qm=12,Zm=32,Jm=37,Qm=46,tC=48,eC=57,iC=65,oC=90,rC=97,nC=122;function sC(t){return function(t){return t>=rC&&t<=nC}(t)||function(t){return t>=iC&&t<=oC}(t)}function aC(t){return t===Ym||t===Km||t===qm||t===$m||t===Zm}function lC(t){return t>=tC&&t<=eC}function hC(t){return t===Qm}function dC(t){return sC(t)||t===Jm}function cC(t){return new Error(`calc parse error: ${t}`)}const uC={"*":3,"/":3,"+":2,"-":2};function gC(t,e){function i(t){const i=t.pop(),o=t.pop(),r=t.pop();if(!(r&&r.nodeType&&o&&o.type===Gm&&i&&i.nodeType))throw cC(e);return{nodeType:Vm,left:r,op:o,right:i}}const o=[];for(;t.length;){const r=t.shift();if(r.type===Wm&&"("===r.value){let i=0;const r=hb.findIndex(t,(t=>{if(t.type===Wm&&"("===t.value)i++;else if(t.type===Wm&&")"===t.value){if(!i)return!0;i--}return!1}));if(-1===r)throw cC(e);o.push(gC(t.splice(0,r),e)),t.shift()}else if(r.type===Gm){if(o.length>=3){const t=o[o.length-2].value;uC[r.value]<=uC[t]&&o.push(i(o))}o.push(r)}else if(r.type===Nm){const{value:t,unit:e}=r;o.push({nodeType:Um,value:t,unit:e})}else r.type===jm&&o.push({nodeType:Xm,value:r.value})}for(;o.length>1;)o.push(i(o));return o[0]}function pC(t){return gC(function(t){const e=t.replace(/calc\(/g,"(").trim(),i=[],o=e.length;for(let s=0;s<o;s++){const o=e[s],a=o.charCodeAt(0);if("("===o||")"===o)i.push({value:o,type:Wm});else if("*"===o||"/"===o)i.push({value:o,type:Gm});else if("+"===o||"-"===o)s=r(o,s+1)-1;else if(lC(a)||hC(a))s=n(o,s+1)-1;else if(!aC(a))throw cC(t)}function r(t,r){if(r<o){const i=e[r],o=i.charCodeAt(0);if(lC(o)||hC(o))return n(t+i,r+1)}return i.push({value:t,type:Gm}),r}function n(r,n){let a=n;for(;a<o;a++){const i=e[a],o=i.charCodeAt(0);if(lC(o))r+=i;else{if("."!==i){if(dC(o))return s(r,i,a+1);break}if(r.indexOf(".")>=0)throw cC(t);r+=i}}if("."===r)throw cC(t);return i.push({value:parseFloat(r),type:jm}),a}function s(t,r,n){let s=n;for(;s<o;s++){const t=e[s];if(!dC(t.charCodeAt(0)))break;r+=t}return i.push({value:parseFloat(t),unit:r,type:Nm}),s}return i}(t),t)}function fC(t,e){if(t.nodeType===Vm){const i=fC(t.left,e),o=fC(t.right,e);switch(t.op.value){case"+":return i+o;case"-":return i-o;case"*":return i*o;case"/":return i/o;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===Um)switch(t.unit){case"%":return t.value*e.full/100;case"px":return t.value;default:throw new Error(`calc error. unknown unit: ${t.unit}`)}else if(t.nodeType===Xm)return t.value;throw new Error("calc error.")}function vC(t,e){return fC(pC(t),e)}function bC(t,e){const{dataSourceEventIds:i}=t.internalProps;i&&i.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,_m.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.hierarchyExpandLevel&&t.refreshRowColCount(),t.render()}))]}function mC(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];bC(t,(()=>{t.internalProps.records=e;const i=t.internalProps.dataSource=Rm.ofArray(e,t.internalProps.dataConfig,t.pagination,t.internalProps.layoutMap.columnObjects,t.internalProps.layoutMap.rowHierarchyType,function(t){var e;return t.options.hierarchyExpandLevel?t.options.hierarchyExpandLevel:t.options.groupBy?1/0:(null===(e=t._hasHierarchyTreeHeader)||void 0===e?void 0:e.call(t))?1:void 0}(t));t.addReleaseObj(i)}))}function CC(t,e){bC(t,(()=>{if(e)if(e instanceof _m)t.internalProps.dataSource=e;else{const i=t.internalProps.dataSource=new Rm(e);t.addReleaseObj(i)}else t.internalProps.dataSource=_m.EMPTY;t.internalProps.records=null}))}function yC(t,e){return Math.round((i=e,o=t.internalProps.calcWidthContext,"string"==typeof i?vC(i.trim(),o):i-0));var i,o}function wC(t,e,i,o,r){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=Dm(r("padding",t,i,o,e)),a=r("bgColor",t,i,o,e),l=r("font",t,i,o,e);let h,d,c,u,g;if(l){const{family:t,size:e,weight:i,style:o,variant:r}=function(t){return Om(t)}(l);h=t.join(" "),d=e,c=i,u=o,u=r}else h=r("fontFamily",t,i,o,e),d=r("fontSize",t,i,o,e),c=r("fontWeight",t,i,o,e),u=r("fontStyle",t,i,o,e),g=r("fontVariant",t,i,o,e);const p=r("textAlign",t,i,o,e),f=r("textBaseline",t,i,o,e),v=r("color",t,i,o,e),b=r("strokeColor",t,i,o,e),m=r("lineHeight",t,i,o,e),C=r("underline",t,i,o,e),y=r("underlineDash",t,i,o,e),w=r("underlineOffset",t,i,o,e),x=r("lineThrough",t,i,o,e),S=Math.max(1,Math.floor(d/10)),_=r("textOverflow",t,i,o,e),A=r("borderColor",t,i,o,e),R=r("borderLineWidth",t,i,o,e),B=r("borderLineDash",t,i,o,e),M=r("marked",t,i,o,e),T=r("cursor",t,i,o,e),P=!(s&&a&&l&&p&&f&&v&&_&&A&&R&&B&&"boolean"==typeof C&&"boolean"==typeof x&&"boolean"==typeof M);if(!n)return{hasFunctionPros:P};const k={text:{fontFamily:h,fontSize:d,fontWeight:c,fontStyle:u,fontVariant:g,fill:v,stroke:null!=b&&b,textAlign:p,textBaseline:f,lineHeight:null!=m?m:d,underline:C?S:void 0,underlineDash:y,underlineOffset:w,lineThrough:x?S:void 0,ellipsis:"clip"===_?"":"ellipsis"===_?"...":J(_)?_:void 0},group:{fill:a,lineDash:B,lineWidth:R,stroke:A,cursor:"auto"===T||"default"===T?void 0:T},_vtable:{padding:s,marked:M}};if(Array.isArray(R)&&(k.group.strokeArrayWidth=Dm(R)),Array.isArray(A)){const t=Dm(A);k.group.stroke=!t.every((t=>!t))&&t,k.group.strokeArrayColor=Dm(A)}return{theme:k,hasFunctionPros:P}}function xC(t,e,i){const o=i.theme.frameStyle.cornerRadius;if(Array.isArray(o)){if(0===t&&0===e)return[o[0],0,0,0];if(t===i.colCount-1&&0===e)return[0,o[1],0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o[3]];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o[2],0]}else if(o){if(0===t&&0===e)return[o,0,0,0];if(t===i.colCount-1&&0===e)return[0,o,0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o,0]}return 0}class SC extends cd{constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundWidth)&&void 0!==t?t:this.attribute.width)&&void 0!==e?e:0}get backgroundHeight(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundHeight)&&void 0!==t?t:this.attribute.height)&&void 0!==e?e:0}}function _C(t){return{rootContainer:new zn({}),renderDefault:!0}}class AC{constructor(t,e){this.removeAllContainer=t,this.table=e,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0,r=[],n=e.internalProps.layoutMap;if(i){const{headerObjects:e}=n,i=[];for(let o=0;o<e.length;o++){const r=e[o];r&&r.define.componentId===t&&i.push(r.id)}for(let t=0;t<i.length;t++){const e=i[t],o=n.getHeaderCellAdressById(e),s=n.getCellRange(o.col,o.row);r.push(s)}}else{let e;const{columnObjects:i,indicatorsAsCol:s}=n;for(let o=0;o<i.length;o++)if(i[o].define.componentId===t){e=o;break}if(s)for(let t=n.rowHeaderLevelCount+e;t<n.colCount;t+=i.length){const e={start:{col:t+o,row:n.columnHeaderLevelCount},end:{col:t+o,row:n.rowCount-1}};r.push(e)}else for(let t=n.columnHeaderLevelCount+e;t<n.rowCount;t+=i.length){const e={start:{col:n.rowHeaderLevelCount+o,row:t},end:{col:n.colCount-1,row:t}};r.push(e)}}return r}(t,i,e);for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start.col;t<=e.end.col;t++)for(let o=e.start.row;o<=e.end.row;o++)i.scenegraph.updateCellContent(t,o)}}else{const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0;if(i){const i=e.internalProps.layoutMap,{headerObjects:o}=e.internalProps.layoutMap;let r;for(let e=0;e<o.length;e++){const i=o[e];if(i.define.componentId===t){r=i.id;break}}const n=i.getHeaderCellAdressById(r);return i.getCellRange(n.col,n.row)}const{columnObjects:r}=e.internalProps.layoutMap;for(let i=0;i<r.length;i++)if(r[i].define.componentId===t)return{start:{col:o+i,row:e.columnHeaderLevelCount},end:{col:o+i,row:e.rowCount-1}};return{start:{col:0,row:0},end:{col:e.colCount-1,row:e.rowCount-1}}}(t,i,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)i.scenegraph.updateCellContent(t,e)}i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:o}=this.table.getHeaderDefine(t,e);return null!==(i=this.headerCustomLayoutFuncCache.get(o))&&void 0!==i?i:_C}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||_C}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:r}=o;i=this.headerReactRemoveGraphicCache.get(r)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:r}=o;i=this.reactRemoveGraphicCache.get(r)}i&&i(t,e)}clearCache(){this.removeAllContainer()}}function RC(t){const e={abstractPos:{x:t.viewport.x,y:t.viewport.y}},i=BC(t.target);return i&&(e.eventArgs={col:i.col,row:i.row,event:t,targetCell:i,mergeInfo:MC(i),target:t.target}),e}function BC(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}function MC(t){if(J(t.mergeStartCol)&&J(t.mergeStartRow)&&J(t.mergeEndCol)&&J(t.mergeEndRow))return{colStart:t.mergeStartCol,colEnd:t.mergeEndCol,rowStart:t.mergeStartRow,rowEnd:t.mergeEndRow}}const TC=/radio-\d+-\d+-(\d+)/,PC="_custom_",kC="custom-container",LC=PC+"_0";function HC(t,e,i,o,r,n,s,a,l,h,d){var c;let u,g,p,f,v=!0,b=!1;if("react-custom-layout"===t&&(t=(null===(c=d.reactCustomLayout)||void 0===c?void 0:c.getCustomLayoutFunc(i,o))||_C),"function"==typeof t){const e=t({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:r,bottom:n,width:r,height:n},table:d});e.rootContainer&&(e.rootContainer=FC(e.rootContainer)),e.rootContainer instanceof zn&&(f=e.rootContainer,f.name=kC,f.col=i,f.row=o),v=e.renderDefault,b=e.enableCellPadding}else if("function"==typeof e){const t=e({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:r,bottom:n,width:r,height:n},table:d});t&&(p=t.elements,v=t.renderDefault,u=t.expectedWidth,g=t.expectedHeight)}else e&&(u=e.expectedWidth,g=e.expectedHeight,p=e.elements,v=e.renderDefault);return p&&(f=function(t,e,i,o){const r=new zn({x:0,y:0,width:e,height:i,fill:!1,stroke:!1,pickable:!1});return r.name=kC,function(t,e,i,o){const r=[],n=[0,0,0,0];for(let s=0;s<t.length;s++){const a=t[s],l=Object.assign({},a);for(const t in l)l.hasOwnProperty(t)&&q(l[t])&&(l[t]=l[t](o));const h=l;J(h.x)&&(h.x=ot(h.x)?EC(h.x,e-n[1]):Number(h.x)),J(h.y)&&(h.y=ot(h.y)?EC(h.y,i-n[2]):Number(h.y)),"width"in l&&(l.width=ot(l.width)?EC(l.width,e-n[1]):Number(l.width)),"height"in l&&(l.height=ot(l.height)?EC(l.height,i-n[2]):Number(l.height)),"radius"in l&&(l.radius=ot(l.radius)?EC(l.radius,Math.min(e-n[1],i-n[2])):Number(l.radius)),"hover"in l&&(l.hover.x=ot(l.hover.x)?EC(l.hover.x,e-n[1]):Number(l.hover.x),l.hover.y=ot(l.hover.y)?EC(l.hover.y,i-n[2]):Number(l.hover.y),l.hover.width=ot(l.hover.width)?EC(l.hover.width,e-n[1]):Number(l.hover.width),l.hover.height=ot(l.hover.height)?EC(l.hover.height,i-n[2]):Number(l.hover.height),l.hover.x+=0,l.hover.y+=0),h.x=h.x+0,h.y=h.y+0,r.push(l)}return r}(t,e,i,o).forEach((t=>{var e,i,o,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R,B,M,T;switch(t.clickable&&(t.pickable=t.clickable),t.type){case"arc":const P=wd({x:t.x,y:t.y,dx:null!==(e=t.dx)&&void 0!==e?e:0,dy:null!==(i=t.dy)&&void 0!==i?i:0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.pickable,cursor:t.cursor});P.name=t.name,r.appendChild(P);break;case"text":if(t.background){const e=null!==(n=null===(o=t.background)||void 0===o?void 0:o.expandX)&&void 0!==n?n:0,i=null!==(a=null===(s=t.background)||void 0===s?void 0:s.expandY)&&void 0!==a?a:0,p=ad({x:t.x-e,y:t.y-i,dx:null!==(l=t.dx)&&void 0!==l?l:0,dy:null!==(h=t.dy)&&void 0!==h?h:0,width:t.width+2*e,height:t.height+2*i,cornerRadius:null!==(c=null===(d=t.background)||void 0===d?void 0:d.cornerRadius)&&void 0!==c?c:0,fill:null!==(g=null===(u=t.background)||void 0===u?void 0:u.fill)&&void 0!==g?g:"#888"});r.appendChild(p)}const k=new Gl(Object.assign({pickable:!!t.pickable,fill:null!==(p=t.color)&&void 0!==p?p:t.fill},t));k.name=t.name,r.appendChild(k);break;case"rect":const L=ad({x:t.x,y:t.y,dx:null!==(f=t.dx)&&void 0!==f?f:0,dy:null!==(v=t.dy)&&void 0!==v?v:0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});L.name=t.name,r.appendChild(L);break;case"circle":const H=Dl({x:t.x,y:t.y,dx:null!==(b=t.dx)&&void 0!==b?b:0,dy:null!==(m=t.dy)&&void 0!==m?m:0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});H.name=t.name,r.appendChild(H);break;case"icon":const E=new SC({x:t.x,y:t.y,dx:null!==(C=t.dx)&&void 0!==C?C:0,dy:null!==(y=t.dy)&&void 0!==y?y:0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?null!==(w=t.hover.width)&&void 0!==w?w:t.width:void 0,backgroundHeight:t.hover?null!==(x=t.hover.width)&&void 0!==x?x:t.width:void 0,backgroundColor:t.hover?null!==(S=t.hover.bgColor)&&void 0!==S?S:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor});E.name=t.name,E.role="icon-custom",r.appendChild(E);break;case"image":const z=new SC({x:t.x,y:t.y,dx:null!==(_=t.dx)&&void 0!==_?_:0,dy:null!==(A=t.dy)&&void 0!==A?A:0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?null!==(R=t.hover.width)&&void 0!==R?R:t.width:void 0,backgroundHeight:t.hover?null!==(B=t.hover.width)&&void 0!==B?B:t.width:void 0,backgroundColor:t.hover?null!==(M=t.hover.bgColor)&&void 0!==M?M:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor,shape:t.shape});z.name=t.name,z.role="image-custom",r.appendChild(z);break;case"line":const F=rd({points:t.points,lineWidth:null!==(T=t.lineWidth)&&void 0!==T?T:1,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});F.name=t.name,r.appendChild(F)}})),r}(p,s?u:r,a?g:n,d.getCellValue(i,o))),b&&f.setAttributes({x:l[3],y:l[0],width:r-l[1]-l[3],height:n-l[0]-l[2]}),zC(f,r,n),!h||h.start.col===h.end.col&&h.start.row===h.end.row||IC(f,i,o,0),{elementsGroup:f,renderDefault:v}}function EC(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}function zC(t,e,i){t&&t.forEachChildren((t=>{var o,r;t&&(Q(t.attribute.width)&&t.attribute.width.percent&&t.setAttribute("width",Math.max(0,t.attribute.width.percent/100*e+(null!==(o=t.attribute.width.delta)&&void 0!==o?o:0))),t.attribute.width<0&&t.setAttribute("width",0),Q(t.attribute.height)&&t.attribute.height.percent&&t.setAttribute("height",Math.max(0,t.attribute.height.percent/100*i+(null!==(r=t.attribute.height.delta)&&void 0!==r?r:0))),t.attribute.height<0&&t.setAttribute("height",0),"group"===t.type&&zC(t,t.attribute.width,t.attribute.height))}))}function FC(t){if(!t||!J(t.$$typeof)&&!J(t.vtype))return t;const e=t.type,{attribute:i,children:o,stateProxy:r}=t.props,n=e({attribute:i});return function(t,e){let i=!1;switch(t.type){case"richtext":case"rich/image":break;default:i=!0}i&&Object.keys(e).forEach((i=>{const o=Ru[i];o&&t.on(o,e[i])}))}(n,t.props),r&&(n.stateProxy=r),n.id=i.id,n.name=i.name,rt(o)?o.forEach((t=>{const e=FC(t);e&&e.type&&n.add(e)})):o&&n.add(FC(o)),n}function IC(t,e,i,o,r){t&&(t.name=`${PC}${null!=r?r:""}_${o}`,t.onBeforeAttributeUpdate=OC,"group"===t.type&&t.childrenCount&&t.forEachChildren(((t,n)=>{IC(t,e,i,n,(null!=r?r:"")+"_"+o)})))}function OC(t,e){const i=this;if(i.skipMergeUpdate)return;const o=BC(i);if(!o||!o.stage)return;const r=o.stage.table;i.skipAttributeUpdate=!0;const{mergeStartCol:n,mergeEndCol:s,mergeStartRow:a,mergeEndRow:l}=o;if(J(n)&&J(s)&&J(a)&&J(l)&&(n!==s||a!==l)){for(let e=n;e<=s;e++)for(let n=a;n<=l;n++){if(e===o.col&&n===o.row)continue;const s=r.scenegraph.highPerformanceGetCell(e,n);if("cell"===s.role){const e=s.getChildByName(i.name,!0);if(!e||e.skipAttributeUpdate)continue;for(const i in t)t[i]!==e.attribute[i]&&"dx"!==i&&"dy"!==i&&e.setAttribute(i,t[i])}}i.skipAttributeUpdate=void 0}}const DC={};class WC{static setIcon(t,e){this.cache.set(t,e)}static getIcon(t){return this.cache.has(t)?this.cache.get(t):null}static hasIcon(t){return this.cache.has(t)}static clear(t){return this.cache.delete(t)}static clearAll(){this.cache=new Map}}WC.cache=new Map;const NC={get sort_downward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#416EFF"/> </svg>',width:16,height:16,funcType:Pv.sort,name:"sort_downward",positionType:Tv.contentRight,marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_upward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#416EFF"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:Pv.sort,positionType:Tv.contentRight,name:"sort_upward",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_normal(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:Pv.sort,positionType:Tv.contentRight,name:"sort_normal",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get freeze(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M17.1313 8.42047C17.1932 8.48238 17.2423 8.55587 17.2759 8.63676C17.3094 8.71764 17.3266 8.80434 17.3266 8.89189C17.3266 8.97944 17.3094 9.06613 17.2759 9.14702C17.2423 9.2279 17.1932 9.3014 17.1313 9.3633L13.3843 13.1103C13.7007 14.3048 13.5305 15.4443 12.8388 16.2395C12.8104 16.2781 12.7778 16.3136 12.7417 16.3451L12.712 16.3755C12.6501 16.4374 12.5766 16.4865 12.4957 16.52C12.4148 16.5535 12.3281 16.5707 12.2406 16.5707C12.153 16.5707 12.0663 16.5535 11.9854 16.52C11.9046 16.4865 11.8311 16.4374 11.7692 16.3755L9.17633 13.7826L6.05316 16.9058L5.11983 17.0925C5.09291 17.0979 5.06508 17.0965 5.03881 17.0886C5.01254 17.0806 4.98863 17.0663 4.96923 17.0469C4.94982 17.0275 4.9355 17.0036 4.92755 16.9773C4.9196 16.951 4.91827 16.9232 4.92366 16.8963L5.11033 15.963L8.23333 12.8396L5.64066 10.2471C5.57875 10.1852 5.52964 10.1117 5.49614 10.0309C5.46263 9.94997 5.44539 9.86327 5.44539 9.77572C5.44539 9.68817 5.46263 9.60148 5.49614 9.52059C5.52964 9.43971 5.57875 9.36621 5.64066 9.3043C5.65066 9.2943 5.66066 9.2843 5.67099 9.27464C5.70266 9.2383 5.73833 9.20547 5.77766 9.17664C6.57283 8.48564 7.71199 8.31564 8.90599 8.63197L12.6528 4.88497C12.7147 4.82306 12.7882 4.77395 12.8691 4.74045C12.95 4.70694 13.0367 4.6897 13.1242 4.6897C13.2118 4.6897 13.2985 4.70694 13.3794 4.74045C13.4603 4.77395 13.5338 4.82306 13.5957 4.88497L17.1312 8.42047H17.1313ZM15.7172 8.8918L13.1243 6.29914L9.56483 9.8588C9.47574 9.94788 9.36323 10.0099 9.24034 10.0376C9.11746 10.0654 8.98922 10.0578 8.87049 10.0156C8.22783 9.78764 7.63899 9.7553 7.17749 9.89814L12.1182 14.8388C12.261 14.3771 12.2287 13.7885 12.0007 13.146C11.9585 13.0272 11.9509 12.899 11.9787 12.7761C12.0064 12.6532 12.0684 12.5407 12.1575 12.4516L15.7172 8.89164V8.8918Z" fill="#282F38" fill-opacity="0.2"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>',width:22,height:22,name:"freeze",funcType:Pv.frozen,positionType:Tv.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozen(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#282F38" fill-opacity="0.35"/></svg>',width:22,height:22,name:"frozen",funcType:Pv.frozen,positionType:Tv.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozenCurrent(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#416EFF"/></svg>',width:22,height:22,funcType:Pv.frozen,positionType:Tv.right,name:"frozenCurrent",marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get dropdownIcon(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>',width:24,height:24,funcType:Pv.dropDown,positionType:Tv.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)",image:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>'},cursor:"pointer",visibleTime:"mouseenter_cell"}},get play(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01" /><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /><path d="M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /></svg>',width:24,height:24,funcType:Pv.play,positionType:Tv.right,name:"play",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get damage_pic(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10V38C5 39.1046 5.89543 40 7 40H14H18L15 29L22 27L21 20L29 16L27 13L30 8H7C5.89543 8 5 8.89543 5 10Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 38V10C43 8.89543 42.1046 8 41 8H38L34 14L37 19L28 23L29 31L22 33L24 40H41C42.1046 40 43 39.1046 43 38Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',width:24,height:24,funcType:Pv.damagePic,positionType:Tv.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:Tv.left}},get expand(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:Pv.expand,name:"expand",positionType:Tv.contentLeft,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get collapse(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 7.60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:Pv.collapse,name:"collapse",positionType:Tv.contentLeft,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get drillDown(){return{name:"drillDown",type:"svg",positionType:Tv.absolute,funcType:Pv.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:Tv.absolute,funcType:Pv.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:'<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5172"></path></svg>',width:20,height:20,funcType:Pv.dragReorder,positionType:Tv.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function GC(){return fb(NC,DC)}class jC extends zn{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren((e=>e.name===t&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const o=e.getChildByName(t,!0);if(o)return i=o,!0}return!1})),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.width)&&void 0!==t?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.height)&&void 0!==t?t:0)}setDeltaWidth(t){var e;0!==t&&(this.setAttribute("width",(null!==(e=this.attribute.width)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;0!==t&&(this.setAttribute("height",(null!==(e=this.attribute.height)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){0!==t&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){0!==t&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"border-rect";if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){let i=this._lastChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(0===this.childrenCount||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}tryUpdateAABBBounds(){if("cell"===this.role){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),function(t,e){t.stage&&t.stage.dirtyBounds&&t.stage.renderCount&&(t.isContainer&&!e||t.stage.dirty(t.globalAABBBounds))}(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if("cell"===this.role){const t=this.attribute,{x:e,y:i,width:o,height:r}=t;return this._AABBBounds.setValue(e,i,e+o,i+r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._AABBBounds}return"body"===this.role||"row-header"===this.role||"col-header"===this.role||"right-frozen"===this.role||"bottom-frozen"===this.role||"corner-header"===this.role||"corner-right-top-header"===this.role||"corner-right-bottom-header"===this.role||"corner-left-bottom-header"===this.role?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}}function UC(t,e,i,o){const r=t/e;let n,s;return r>i/o?(n=i,s=n/r):(s=o,n=s*r),{width:n,height:s}}function VC(t,e,i,o,r){const n=e&&J(e[t])?e[t]:void 0;return"function"==typeof n?n({col:i,row:o,table:r,value:r.getCellValue(i,o),dataValue:r.getCellOriginValue(i,o),cellHeaderPaths:r.getCellHeaderPaths(i,o)}):n}function XC(t,e,i,o){var r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w;let x=null!==(n=null===(r=null==i?void 0:i.group)||void 0===r?void 0:r.strokeArrayWidth)&&void 0!==n?n:void 0;return o.theme.cellInnerBorder||(0===t&&(x=null!=x?x:[null===(s=null==i?void 0:i.group)||void 0===s?void 0:s.lineWidth,null===(a=null==i?void 0:i.group)||void 0===a?void 0:a.lineWidth,null===(l=null==i?void 0:i.group)||void 0===l?void 0:l.lineWidth,null===(h=null==i?void 0:i.group)||void 0===h?void 0:h.lineWidth],x[3]=0),t===o.colCount-1&&(x=null!=x?x:[null===(d=null==i?void 0:i.group)||void 0===d?void 0:d.lineWidth,null===(c=null==i?void 0:i.group)||void 0===c?void 0:c.lineWidth,null===(u=null==i?void 0:i.group)||void 0===u?void 0:u.lineWidth,null===(g=null==i?void 0:i.group)||void 0===g?void 0:g.lineWidth],x[1]=0),0===e&&(x=null!=x?x:[null===(p=null==i?void 0:i.group)||void 0===p?void 0:p.lineWidth,null===(f=null==i?void 0:i.group)||void 0===f?void 0:f.lineWidth,null===(v=null==i?void 0:i.group)||void 0===v?void 0:v.lineWidth,null===(b=null==i?void 0:i.group)||void 0===b?void 0:b.lineWidth],x[0]=0),e===o.rowCount-1&&(x=null!=x?x:[null===(m=null==i?void 0:i.group)||void 0===m?void 0:m.lineWidth,null===(C=null==i?void 0:i.group)||void 0===C?void 0:C.lineWidth,null===(y=null==i?void 0:i.group)||void 0===y?void 0:y.lineWidth,null===(w=null==i?void 0:i.group)||void 0===w?void 0:w.lineWidth],x[2]=0)),x}class YC extends jC{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new jC({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new jC({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new jC({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof Gl&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}else{const i=this._cellWidth-t-e;this.updateCenterLayout(i);const o=this._centerGroup.width;this._cellWidth=t+e+o,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,r=this._centerGroup.height;this._cellHeight=Math.max(i,o,r),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof SC&&(e-=t.AABBBounds.width())}));const i=this._centerGroup.getChildByName("text");i instanceof bd?i.setAttribute("width",e):i instanceof Gl&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",o),o+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth,this.layout()}}function $C(t,e,i){var o,r,n,s,a;let l=0;const h=i.internalProps.layoutMap;if(h.isHeader(t,e)){const n=h.getHeader(t,e);J(null==n?void 0:n.hierarchyLevel)&&(l=(null!==(o=n.hierarchyLevel)&&void 0!==o?o:0)*(null!==(r=h.rowHierarchyIndent)&&void 0!==r?r:0),h.rowHierarchyTextStartAlignment&&!i.internalProps.headerHelper.getHierarchyIcon(t,e)&&(l+=i.internalProps.headerHelper.getHierarchyIconWidth()))}else if(i.options.groupBy||(null===(n=i.getBodyColumnDefine(t,e))||void 0===n?void 0:n.tree)){const o=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),r=null!==(s=i.dataSource.getGroupLength())&&void 0!==s?s:0;let n=rt(o)?o.length-1:0;r>0&&n===r&&(n=0),l=Array.isArray(o)&&i.getHierarchyState(t,e)!==Rv.none?n*(null!==(a=h.hierarchyIndent)&&void 0!==a?a:0):0,h.hierarchyTextStartAlignment&&!i.internalProps.bodyHelper.getHierarchyIcon(t,e)&&(l+=i.internalProps.bodyHelper.getHierarchyIconWidth())}return l}function KC(t,e){var i,o;let r,n=!1;for(ot(t)&&t.length>(e.options.maxCharactersNumber||200)&&(t=t.slice(0,e.options.maxCharactersNumber||200),t+="…",n=!0),r=e.internalProps.enableLineBreak||(null===(i=e.options.customConfig)||void 0===i?void 0:i.multilinesForXTable)?Qv(t).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n")||[]:[Qv(t)];r.length&&r.length>1&&!r[r.length-1];)r.pop();if((null===(o=e.options.customConfig)||void 0===o?void 0:o.multilinesForXTable)&&!e.internalProps.autoWrapText)for(;r.length&&r.length>1&&!r[0];)r.shift();return{text:r,moreThanMaxCharacters:n}}function qC(t,e,i,o,r,n,s){var a,l,h,d,c,u;const g={};"image"===t.type?g.image=t.src:("svg"===t.type||"svg"in t)&&(g.image=t.svg),g.width=t.width,g.height=t.height,g.visibleTime=null!==(a=t.visibleTime)&&void 0!==a?a:"always",g.funcType=t.funcType,g.interactive=t.interactive;let p=0;if(s&&0!==(null==s?void 0:s.addedHierarchyOffset)||!at(i)||!at(o)||!n||t.funcType!==Pv.collapse&&t.funcType!==Pv.expand&&t.positionType!==Tv.contentLeft&&t.positionType!==Tv.contentRight||(p=r?$C(r.start.col,r.start.row,n):$C(i,o,n),s&&(s.addedHierarchyOffset=1)),g.marginLeft=(null!==(l=t.marginLeft)&&void 0!==l?l:0)+p,g.marginRight=null!==(h=t.marginRight)&&void 0!==h?h:0,!1===t.interactive&&(g.pickable=!1),t.hover&&(g.backgroundWidth=null!==(d=t.hover.width)&&void 0!==d?d:t.width,g.backgroundHeight=null!==(c=t.hover.width)&&void 0!==c?c:t.width,g.backgroundColor=null!==(u=t.hover.bgColor)&&void 0!==u?u:"rgba(22,44,66,0.2)",g.hoverImage=t.hover.image),t.cursor&&(g.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(g.shape=t.shape),e)return e.setAttributes(g),e.loadImage(g.image),e;const f=new SC(g);return f.tooltip=t.tooltip,f}function ZC(t){var e,i,o,r,n,s;const a={};return"image"===t.type?a.image=t.src:("svg"===t.type||"svg"in t)&&(a.image=t.svg),a.visibleTime=null!==(e=t.visibleTime)&&void 0!==e?e:"always",a.funcType=t.funcType,a.id=t.name,a.width=t.width,a.height=t.height,(t.marginRight||t.marginLeft)&&(a.margin=[0,null!==(i=t.marginRight)&&void 0!==i?i:0,0,null!==(o=t.marginLeft)&&void 0!==o?o:0]),t.hover&&(a.backgroundWidth=null!==(r=t.hover.width)&&void 0!==r?r:t.width,a.backgroundHeight=null!==(n=t.hover.height)&&void 0!==n?n:t.height,a.backgroundShowMode="hover",a.hoverImage=t.hover.image,a.backgroundStroke=!1,a.backgroundFill=null!==(s=t.hover.bgColor)&&void 0!==s?s:"rgba(22,44,66,0.2)"),t.cursor&&(a.cursor=t.cursor),a.tooltip=t.tooltip,a}function JC(t,e,i,o,r,n,s,a,l){var h,d,c,u;lt(t.contentWidth)&&(o=e-(null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width));let g,p=0,f=0,v=0,b=0;t.forEachChildren((t=>{var e,i,o,r;"icon-left"===t.role?(p+=t.AABBBounds.width()+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)+(null!==(i=t.attribute.marginRight)&&void 0!==i?i:0),f=Math.max(f,t.AABBBounds.height())):"icon-right"===t.role&&(v+=t.AABBBounds.width()+(null!==(o=t.attribute.marginLeft)&&void 0!==o?o:0)+(null!==(r=t.attribute.marginRight)&&void 0!==r?r:0),b=Math.max(b,t.AABBBounds.height()))}));const m=t.getChildByName("text"),C=t.getChildByName("content");let y;m instanceof Gl?(g=m.AABBBounds.height(),m.setAttribute("maxLineWidth",e-p-v-(n[1]+n[3])-(null!==(d=m.attribute.dx)&&void 0!==d?d:0)-(null!==(c=l.table.theme._contentOffset)&&void 0!==c?c:0)),y=m.AABBBounds.height()):m instanceof bd?(g=m.AABBBounds.height(),m.setAttribute("width",e-p-v-(n[1]+n[3])),y=m.AABBBounds.height()):C&&(g=C.AABBBounds.height(),C.updateWidth(e-p-v-(n[1]+n[3])),y=C.AABBBounds.height());const w=Math.round(Math.max(f,b,g)+n[0]+n[2]);if(t.forEachChildren((i=>{var r;if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("content"===i.name||"text"===i.name&&"richtext"!==i.type){const t=null!==(r=i.attribute.textAlign)&&void 0!==r?r:s;"center"===t?i.setAttribute("x",n[3]+p+(e-(n[1]+n[3])-p-v)/2):"right"===t&&i.setAttribute("x",n[3]+e-(n[1]+n[3])-v)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),r){let e=Math.max(f,y,b);if(function(t,e,i,o){const r=t.table,n=lm(r,e.col,e.row);if(n&&n.end.row-n.start.row){o/=n.end.row-n.start.row+1,i/=n.end.row-n.start.row+1;for(let t=n.start.row;t<=n.end.row;t++){const e=r.getRowHeight(t);if(e===o&&i!==e)return!0;if(i>e)return!0}}else{const t=r.getRowHeight(e.row);if(t===o&&i!==t)return!0;if(i>t)return!0}return!1}(l,t,Math.round(e+n[0]+n[2]),w))return!0;e=(null!==(u=t.contentHeight)&&void 0!==u?u:i)-(n[0]+n[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==kC&&("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",n[0]+(e-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",n[0]+e-t.AABBBounds.height()):t.setAttribute("y",n[0]))}))}else"middle"!==a&&"bottom"!==a||t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==kC&&("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",(i-n[2]+n[0]-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",i-t.AABBBounds.height()-n[2]):t.setAttribute("y",n[0]))}));return!1}function QC(t,e,i,o,r,n,s){const a=e-Math.floor(r[0]+r[2]),l=t.getChildByName("text");l instanceof Gl&&!o?l.setAttributes({heightLimit:a}):l instanceof bd&&!o?l.setAttributes({height:a}):t.getChildByName("content")&&t.getChildByName("content").updateHeight(a),t.forEachChildren((t=>{t.setAttribute("dy",0),"rect"===t.type||"chart"===t.type||t.name===kC||("mark"===t.name?t.setAttribute("y",0):"middle"===s?t.setAttribute("y",r[0]+(a-t.AABBBounds.height())/2):"bottom"===s?t.setAttribute("y",r[0]+a-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}function ty(t,e,i,o){const r=[],n=[],s=[],a=[],l=[],h=[],d=[],c=[];let u=0,g=0,p=0,f=0,v=0,b=0;return t.forEach((t=>{switch(t.positionType){case Tv.left:r.push(t);break;case Tv.right:n.push(t);break;case Tv.contentLeft:s.push(t);break;case Tv.contentRight:a.push(t);break;case Tv.absoluteRight:c.push(t);break;case Tv.inlineFront:l.push(t);break;case Tv.inlineEnd:h.push(t)}})),r.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-left",a.name=t.name,a.setAttribute("x",u+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),u+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),g=Math.max(g,a.AABBBounds.height()),e.appendChild(a)})),n.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-right",a.name=t.name,a.setAttribute("x",p+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),p+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),f=Math.max(f,a.AABBBounds.height()),e.appendChild(a)})),d.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-absolute-left",a.name=t.name,a.setAttribute("x",v+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),v+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(a)})),c.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-absolute-right",a.name=t.name,a.setAttribute("x",b+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),b+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(a)})),{leftIcons:r,rightIcons:n,contentLeftIcons:s,contentRightIcons:a,inlineFrontIcons:l,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:c,leftIconWidth:u,leftIconHeight:g,rightIconWidth:p,rightIconHeight:f,absoluteLeftIconWidth:v,absoluteRightIconWidth:b}}function ey(t,e,i,o,r,n){var s,a,l,h,d,c,u,g,p,f,v,b;const m=t.getChildByName("image");if(!m)return;const C="string"!=typeof m.attribute.image&&m.attribute.image||(null===(s=m.resources)||void 0===s?void 0:s.get(m.attribute.image).data);if(!C)return;const y=n._getCellStyle(e,i),w=null!==(a=VC("textAlign",y,e,i,n))&&void 0!==a?a:"left",x=null!==(l=VC("textBaseline",y,e,i,n))&&void 0!==l?l:"middle";let S;S=(null===(h=n.options.customConfig)||void 0===h?void 0:h.imageMargin)?Dm(null===(d=n.options.customConfig)||void 0===d?void 0:d.imageMargin):null!==(c=Dm(VC("padding",y,e,i,n)))&&void 0!==c?c:[0,0,0,0];const{width:_,height:A,isMerge:R}=iy(t,n),B=null!==(u=t.mergeStartCol)&&void 0!==u?u:t.col,M=null!==(g=t.mergeStartRow)&&void 0!==g?g:t.row,T=null!==(p=t.mergeEndCol)&&void 0!==p?p:t.col,P=null!==(f=t.mergeEndCol)&&void 0!==f?f:t.row,k=null!==(v=t._cellLeftIconWidth)&&void 0!==v?v:0,L=null!==(b=t._cellRightIconWidth)&&void 0!==b?b:0;if(m.keepAspectRatio){const{width:t,height:e}=UC(C.width||C.videoWidth,C.height||C.videoHeight,_-(S[1]+S[3]),A-(S[0]+S[2])),i=function(t,e,i,o,r,n){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"left",a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"middle",l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[0,0,0,0],h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,c=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,u=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0;const g=t+i,p=e+o;let f=t+l[3]+h;"right"===s||"end"===s?f=g-r-l[1]-d:"center"===s&&(f=t+(i-r+h-d)/2);let v=e+l[0]+c;return"bottom"===a||"alphabetic"===a||"ideographic"===a?v=p-n-l[2]-u:"middle"===a&&(v=e+(o-n+c-u)/2),{x:f,y:v}}(0,0,_,A,t,e,w,x,S);for(let o=B;o<=T;o++)for(let r=M;r<=P;r++){const s=n.scenegraph.getCell(o,r).getChildByName("image");null==s||s.setAttributes({x:i.x,y:i.y,width:t,height:e})}}else for(let t=B;t<=T;t++)for(let e=M;e<=P;e++){const i=n.scenegraph.getCell(t,e).getChildByName("image");null==i||i.setAttributes({x:k+S[3],y:S[0],width:_-S[1]-S[3]-L-k,height:A-S[0]-S[2]})}if(t.getChildByName("play-icon")){const e=0,i=0,{width:o,height:r}=iy(t,n),s=Math.floor(Math.min(o-S[1]-S[3],r-S[2]-S[0])/2),a=e+(o>m.attribute.width?m.attribute.x-e+m.attribute.width/2:o/2),l=i+(r>m.attribute.height?m.attribute.y-i+m.attribute.height/2:r/2);for(let t=B;t<=T;t++)for(let e=M;e<=P;e++)n.scenegraph.getCell(t,e).getChildByName("play-icon").setAttributes({x:a-s/2,y:l-s/2,width:s,height:s})}t.forEachChildren((t=>{"icon-left"===t.role||("icon-right"===t.role||"icon-absolute-right"===t.role)&&t.setAttribute("x",t.attribute.x+o)})),t.forEachChildren((t=>{("rect"===t.type||t.role&&t.role.startsWith("icon"))&&("middle"===x?t.setAttribute("y",S[0]+(A-S[0]-S[2]-t.AABBBounds.height())/2):"bottom"===x?t.setAttribute("y",S[0]+A-S[0]-S[2]-t.AABBBounds.height()):t.setAttribute("y",S[0]))})),R&&function(t,e,i,o,r){for(let n=t;n<=e;n++)for(let t=i;t<=o;t++){const e=r.scenegraph.getCell(n,t);if(e){const i=e.getChildByName("image");i&&i.setAttributes({dx:-r.getColsWidth(e.mergeStartCol,n-1),dy:-r.getRowsHeight(e.mergeStartRow,t-1)});const o=e.getChildByName("play-icon");o&&o.setAttributes({dx:-r.getColsWidth(e.mergeStartCol,n-1),dy:-r.getRowsHeight(e.mergeStartRow,t-1)})}}}(t.mergeStartCol,t.mergeEndCol,t.mergeStartRow,t.mergeEndRow,n)}function iy(t,e){return"cell"===t.role&&J(t.mergeStartCol)&&J(t.mergeEndCol)&&J(t.mergeStartRow)&&J(t.mergeEndRow)?{width:e.getColsWidth(t.mergeStartCol,t.mergeEndCol),height:e.getRowsHeight(t.mergeStartRow,t.mergeEndRow),isMerge:!0}:{width:t.attribute.width,height:t.attribute.height,isMerge:!1}}function oy(t,e,i){t.then((()=>{i(),e.scenegraph.updateNextFrame()})).catch((t=>{}))}function ry(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b){var m;let C,y=!1;if(Cb(e)&&(e=o.getCellValue(r,n),y=!0),"text"===t||"link"===t){if("link"===t){const s=e,a=o._getCellStyle(r,n);"link"===t&&("templateLink"in i&&i.templateLink||!("linkDetect"in i)||!i.linkDetect||Xb.test(s))&&(f?(f.text.fill=VC("linkColor",a,r,n,o),f.group.cursor="pointer"):f={text:{fill:VC("linkColor",a,r,n,o)},group:{cursor:"pointer"}})}let m,w=!0;if(b)m=b.elementsGroup,w=b.renderDefault;else{let t,e;if("body"!==o.getCellLocation(r,n)?(t=null==i?void 0:i.headerCustomRender,e=null==i?void 0:i.headerCustomLayout):(t=(null==i?void 0:i.customRender)||o.customRender,e=null==i?void 0:i.customLayout),e||t){const i=HC(e,t,r,n,a,l,!1,o.isAutoRowHeight(n),c,v,o);m=i.elementsGroup,w=i.renderDefault}}C=hm.getFunction("createTextCellGroup")(o,e,h,0,d,r,n,s,a,l,c,u,g,p,m,w,f,v,y);const x=o.internalProps.layoutMap.getAxisConfigInPivotChart(r,n);if(x){const t=new(hm.getComponent("axis"))(x,C.attribute.width,C.attribute.height,c,o);C.clear(),C.appendChild(t.component),t.overlap()}else o.internalProps.layoutMap.isEmpty(r,n)?(C.setAttributes({fill:!1,stroke:!1}),C.clear()):o.internalProps.layoutMap.isAxisCell(r,n)&&C.clear()}else if("image"===t)C=hm.getFunction("createImageCellGroup")(h,0,d,r,n,a,l,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,y);else if("video"===t)C=hm.getFunction("createVideoCellGroup")(h,0,d,r,n,a,l,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,y);else if("chart"===t){const t=o.internalProps.layoutMap.getChartInstance(r,n);C=hm.getFunction("createChartCellGroup")(null,h,0,d,r,n,a,l,c,e,i.chartModule,o.internalProps.layoutMap.getChartSpec(r,n),t,null!==(m=o.internalProps.layoutMap.getChartDataId(r,n))&&void 0!==m?m:"data",o,f,o.internalProps.layoutMap.isShareChartSpec(r,n),y)}else if("progressbar"===t){const t=o._getCellStyle(r,n),p=o.getCellOriginValue(r,n);C=hm.getFunction("createTextCellGroup")(o,e,h,0,d,r,n,s,a,l,c,u,g,!1,null,!0,f,v,y);const b=hm.getFunction("createProgressBarCell")(i,t,s,e,p,r,n,c,o,v);C.firstChild?C.insertBefore(b,C.firstChild):C.appendChild(b)}else"sparkline"===t?C=hm.getFunction("createSparkLineCellGroup")(null,h,0,d,r,n,a,l,c,o,f,y):"checkbox"===t?C=hm.getFunction("createCheckboxCellGroup")(null,h,0,d,r,n,s,a,l,c,u,g,p,o,f,i,v,y):"radio"===t&&(C=hm.getFunction("createRadioCellGroup")(null,h,0,d,r,n,s,a,l,c,u,g,o,f,i));return C}function ny(t,e,i,o,r){var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y;const w=i.scenegraph.highPerformanceGetCell(t,e,!0),x=i.getCellLocation(t,e);let S,_,A,R,B,M=i.getCellValue(t,e);if(i.internalProps.customMergeCell){const o=i.getCustomMerge(t,e);if(o){const{range:r,text:n,style:s,customLayout:a,customRender:l}=o;_=r,S=_.start.col!==_.end.col||_.start.row!==_.end.row,M=n,R=s,R&&(A=wC(R,i,_.start.col,_.start.row,VC).theme,A.group.cornerRadius=xC(t,e,i)),(a||l)&&(B=HC(a,l,r.start.col,r.start.row,i.getColsWidth(r.start.col,r.end.col),i.getRowsHeight(r.start.row,r.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],_,i))}}let T=t,P=e;_&&(T=_.start.col,P=_.start.row);const k="body"!==x?i.getHeaderDefine(T,P):i.getBodyColumnDefine(T,P);let L="body"!==x||(null==k?void 0:k.dragOrder)||!!(null==k?void 0:k.icon)||!!(null==k?void 0:k.tree);_||!i.internalProps.enableTreeNodeMerge&&"body"===x&&!(null==k?void 0:k.mergeCell)||(_=i.getCellRange(t,e),S=_.start.col!==_.end.col||_.start.row!==_.end.row);let H=!1;if(i.internalProps.enableTreeNodeMerge&&S){const{vtableMergeName:t,vtableMerge:o}=i.getCellRawRecord(_.start.col,_.start.row);H=o,o&&(L=!0,i.options.groupTitleCustomLayout&&(B=HC(i.options.groupTitleCustomLayout,void 0,_.start.col,_.start.row,i.getColsWidth(_.start.col,_.end.col),i.getRowsHeight(_.start.row,_.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],_,i))),t&&(M=t)}const E=i._getCellStyle(_?_.start.col:t,_?_.start.row:e),z=null!==(n=E.autoWrapText)&&void 0!==n?n:i.internalProps.autoWrapText;if(A||(A=wC(E,i,S?_.start.col:t,S?_.start.row:e,VC).theme),A.group.cornerRadius=xC(t,e,i),!o&&!S&&!((null==k?void 0:k.customLayout)||(null==k?void 0:k.customRender)||(null==k?void 0:k.headerCustomLayout)||(null==k?void 0:k.headerCustomRender))&&function(t,e,i,o,r,n){var s;const a=n.getBodyColumnType(t,e),l=n.isAutoRowHeight(e),h=n.getCellValue(t,e);return!(n.isHeader(t,e)||"cell"!==i.role||"text"!==a||o||l||r||"text"!==(null===(s=i.firstChild)||void 0===s?void 0:s.type)||Cb(h))}(t,e,w,z,L,i)){const o=i.getColWidth(t),r=i.getRowHeight(e);w.setAttributes({width:o,height:r,lineWidth:null!==(a=null===(s=null==A?void 0:A.group)||void 0===s?void 0:s.lineWidth)&&void 0!==a?a:void 0,fill:null!==(h=null===(l=null==A?void 0:A.group)||void 0===l?void 0:l.fill)&&void 0!==h?h:void 0,stroke:null!==(c=null===(d=null==A?void 0:A.group)||void 0===d?void 0:d.stroke)&&void 0!==c?c:void 0,strokeArrayWidth:null!==(g=null===(u=null==A?void 0:A.group)||void 0===u?void 0:u.strokeArrayWidth)&&void 0!==g?g:void 0,strokeArrayColor:null!==(f=null===(p=null==A?void 0:A.group)||void 0===p?void 0:p.strokeArrayColor)&&void 0!==f?f:void 0,cursor:null!==(b=null===(v=null==A?void 0:A.group)||void 0===v?void 0:v.cursor)&&void 0!==b?b:void 0,cornerRadius:null!==(C=null===(m=null==A?void 0:A.group)||void 0===m?void 0:m.cornerRadius)&&void 0!==C?C:0,y:i.scenegraph.getCellGroupY(e)}),w.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));const n=w.getChildByName("text");if(n){const s=i.getCellValue(t,e),{text:a,moreThanMaxCharacters:l}=KC(s,i),h=$C(t,e,i),d=E.lineClamp,c=null!==(y=Dm(VC("padding",E,t,e,i)))&&void 0!==y?y:[0,0,0,0],u=A.text.textAlign;let g=0;g="center"===u?c[3]+(o-(c[1]+c[3]))/2:"right"===u?c[3]+o-(c[1]+c[3]):c[3];const p={text:1!==a.length||z?a:a[0],moreThanMaxCharacters:l,maxLineWidth:o-(c[1]+c[3]+h),textBaseline:"top",autoWrapText:z,lineClamp:d,wordBreak:"break-word",heightLimit:r-Math.floor(c[0]+c[2]),pickable:!1,dx:"left"===u?h:0,x:g};if(n.setAttributes(A.text?Object.assign({},A.text,p):p),n.attribute.text){const t=A.text.textBaseline,e=r-(c[0]+c[2]);let i=0;i="middle"===t?c[0]+(e-n.AABBBounds.height())/2:"bottom"===t?c[0]+e-n.AABBBounds.height():c[0],n.setAttributes({y:i})}}return w}if(!o&&"empty"===w.role)return;const F=H?"text":i.isHeader(t,e)?i._getHeaderLayoutMap(t,e).headerType:i.getBodyColumnType(t,e),I=A._vtable.padding,O=A.text.textAlign,D=A.text.textBaseline;let W,N,G;if(_?(N=i.getColsWidth(_.start.col,_.end.col),G=i.getRowsHeight(_.start.row,_.end.row)):(N=i.getColWidth(t),G=i.getRowHeight(e)),Cb(M)?(w.removeAllChild(),oy(M,i,sy.bind(null,F,M,k,i,t,e,N,G,w,I,O,D,L,o,A,_,B))):W=sy(F,M,k,i,t,e,N,G,w,I,O,D,L,o,A,_,B),S){const{width:t}=W.attribute,{height:e}=W.attribute;W.contentWidth=t,W.contentHeight=e,r?function(t,e,i,o,r,n,s,a){const{col:l,row:h}=a;t.start.row!==t.end.row&&a.contentHeight!==i&&QC(a,i,0,s.isAutoRowHeight(h),o,0,n),t.start.col!==t.end.col&&a.contentWidth!==e&&JC(a,e,i,0,s.isAutoRowHeight(h),o,r,n,s.scenegraph),a.contentWidth=e,a.contentHeight=i;const d=s.getRowHeight(h);ly(a,s.getColWidth(l),d,t,s)}(_,N,G,I,O,D,i,W):ay(_,N,G,I,O,D,i)}return W}function sy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v){var b,m;if(Cb(e)&&(e=o.getCellValue(r,n)),!g&&(l.row!==n||l.col!==r))return null;if(!g&&l.parent&&o.reactCustomLayout){const t=l.getChildByName("custom-container");if(t){const{col:e,row:i}=t;o.reactCustomLayout.removeCustomCell(e,i)}}const C=ry(t,e,i,o,r,n,o.getColWidth(r),s,a,g?o.scenegraph.getColGroup(r):l.parent,g?0:o.scenegraph.getCellGroupY(n),h,d,c,u,p,f,v);return!g&&l.parent&&(l.parent.insertAfter(C,l),l.parent.removeChild(l),(null===(b=o.scenegraph)||void 0===b?void 0:b.proxy.cellCache.get(r))&&(null===(m=o.scenegraph)||void 0===m||m.proxy.cellCache.set(r,C))),C}function ay(t,e,i,o,r,n,s){for(let a=t.start.col;a<=t.end.col;a++)for(let l=t.start.row;l<=t.end.row;l++){const h=s.scenegraph.highPerformanceGetCell(a,l,!0);if("cell"!==h.role)continue;t.start.row!==t.end.row&&h.contentHeight!==i&&QC(h,i,0,s.isAutoRowHeight(l),o,0,n),t.start.col!==t.end.col&&h.contentWidth!==e&&JC(h,e,i,0,s.isAutoRowHeight(l),o,r,n,s.scenegraph),h.contentWidth=e,h.contentHeight=i;const d=s.getRowHeight(l);ly(h,s.getColWidth(a),d,t,s)}}function ly(t,e,i,o,r){var n;const{col:s,row:a}=t,l=-r.getColsWidth(o.start.col,s-1),h=-r.getRowsHeight(o.start.row,a-1);t.forEachChildren((t=>{var e,i,o,r,n,s;"number"==typeof t._dx?(t.skipMergeUpdate=!0,t.setAttributes({dx:(null!==(e=t._dx)&&void 0!==e?e:0)+l}),t.skipMergeUpdate=!1):(t.skipMergeUpdate=!0,t._dx=null!==(i=t.attribute.dx)&&void 0!==i?i:0,t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+l}),t.skipMergeUpdate=!1),"number"==typeof t._dy?(t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(r=t._dy)&&void 0!==r?r:0)+h}),t.skipMergeUpdate=!1):(t._dy=null!==(n=t.attribute.dy)&&void 0!==n?n:0,t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+h}),t.skipMergeUpdate=!1)}));const d=null!==(n=t.attribute.strokeArrayWidth)&&void 0!==n?n:t.attribute.lineWidth,c=rt(d),u=[0,0,0,0];s===o.start.col&&(u[3]=c?d[3]:d),a===o.start.row&&(u[0]=c?d[0]:d),s===o.end.col&&(u[1]=c?d[1]:d),a===o.end.row&&(u[2]=c?d[2]:d);const g=e!==t.attribute.width,p=i!==t.attribute.height;return t.skipMergeUpdate=!0,t.setAttributes({width:e,height:i,strokeArrayWidth:u}),t.skipMergeUpdate=!1,t.mergeStartCol=o.start.col,t.mergeStartRow=o.start.row,t.mergeEndCol=o.end.col,t.mergeEndRow=o.end.row,{widthChange:g,heightChange:p}}function hy(t,e,i,o){if(o.internalProps.customMergeCell){const r=o.getCustomMerge(t,e);if(r){const{range:n,text:s,style:a,customLayout:l,customRender:h}=r;if(l||h){const r=HC(l,h,n.start.col,n.start.row,o.getColsWidth(n.start.col,n.end.col),o.getRowsHeight(n.start.row,n.end.row),!1,o.isAutoRowHeight(e),[0,0,0,0],n,o).elementsGroup;i.childrenCount>0&&r?i.insertBefore(r,i.firstChild):r&&i.appendChild(r);const s=o.getRowHeight(e),a=o.getColWidth(t),{width:d}=i.attribute,{height:c}=i.attribute;return i.contentWidth=d,i.contentHeight=c,ly(i,a,s,n,o),n}}}}function dy(t){return!!("cell"===t.role&&at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow))}const cy=new Uf({}),uy=new Vf({});function gy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){const f=ob(Q(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),b=VC("size",r,e,i,p);let m=VC("outerRadius",r,e,i,p);const C=at(m)?2*m:b;let y=0;if(n){const t=VC("spaceBetweenTextAndIcon",r,e,i,p),o=v-(g[1]+g[3])-s-C-t;at(m)||(m=Math.round(b/2)),uy.setAttributes({text:{maxLineWidth:o,text:f,fontSize:a,fontStyle:l,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},circle:{outerRadius:m},spaceBetweenTextAndIcon:t}),uy.render(),y=uy.AABBBounds.height()}else y=Math.max(b,f.length*c);return y}let py="quick";const fy=new n(((t,e,i,o)=>{i(Ao)?o(Ao).to(my).inSingletonScope():t(Ao).to(my).inSingletonScope()}));new n(((t,e,i,o)=>{i(Ao)?o(Ao).to(Ro).inSingletonScope():t(Ao).to(Ro).inSingletonScope()}));const vy=new Map;function by(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";const r=`${t}-${e}-${i}-${o}`,n=vy.get(r);if(n)return n;const s=(a={fontSize:t,fontFamily:i,fontWeight:e,fontStyle:o},new Se(Object.assign({defaultFontParams:{fontFamily:Xi.fontFamily,fontSize:Xi.fontSize},getTextBounds:Ua,specialCharSet:`{}()//&-/: .,@%'"~…=${Se.ALPHABET_CHAR_SET}${Se.ALPHABET_CHAR_SET.toUpperCase()}0123456789`},{}),a));var a;return vy.set(r,s),s}class my extends Ro{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py)}}const Cy=new class{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py).width}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,r){const n=Math.floor((o+r)/2),s=t.substring(0,n+1),a=this.measureTextWidth(s,e);let l;if(a>i){if(s.length<=1)return{str:"",width:0};const r=t.substring(0,n);return l=this.measureTextWidth(r,e),l<=i?{str:r,width:l}:this._clipText(t,e,i,o,n)}if(a<i){if(n>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,n+2);return l=this.measureTextWidth(o,e),l>=i?{str:s,width:a}:this._clipText(t,e,i,n,r)}return{str:s,width:a}}clipTextWithSuffix(t,e,i,o){if(""===o)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};const n=this.measureTextWidth(o,e);if(n>i)return{str:"",width:0};i-=n;const s=this._clipText(t,e,i,0,t.length-1);return s.str+=o,s.width+=n,s}},yy=new Gl({ignoreBuf:!0});function wy(t){return yy.initAttributes(Object.assign(Object.assign({},t),{ignoreBuf:!0})),yy.AABBBounds}const xy=new bd({width:0,height:0,textConfig:[]});function Sy(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;var n,s,a,l,h,d,c,u,g,p,f,v;"undefined"!=typeof window&&window.performance.now();const b=[],m=[];if(r)for(let o=e;o<=i;o++)b[o]=t.getRowHeight(o);const C=t.internalProps.layoutMap;t.isPivotTable()&&(C.enableUseGetBodyCache(),C.enableUseHeaderPathCache()),t.defaultHeaderRowHeight,t.defaultHeaderColWidth;const y="auto"===t.defaultHeaderRowHeight||rt(t.defaultHeaderRowHeight)&&t.defaultHeaderRowHeight.some((t=>"auto"===t)),w="autoHeight"===t.heightMode||"adaptive"===t.heightMode;if(w||y){e=null!=e?e:0,i=null!=i?i:t.rowCount-1,(0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap();for(let i=e;i<t.columnHeaderLevelCount;i++){let e=0,o=t.colCount-1;if((t.isPivotTable()&&!t.isPivotChart()||t.isPivotChart()&&!t.internalProps.layoutMap.indicatorsAsCol)&&Ry(t,i)&&!lm(t,t.rowHeaderLevelCount,i)&&(e=0,o=t.rowHeaderLevelCount),w||"auto"===t.getDefaultRowHeight(i)){const r=_y(i,e,o,t);m[i]=Math.round(r),t._setRowHeight(i,r)}}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++)if(w||"auto"===t.getDefaultRowHeight(e)){const i=_y(e,0,t.colCount-1,t);r?m[e]=Math.round(i):t._setRowHeight(e,i)}if(i<t.columnHeaderLevelCount||!w);else if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol||!function(t){var e,i,o;const{layoutMap:r}=t.internalProps,n=t.columnHeaderLevelCount;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak||t.isPivotChart())&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;for(let s=0;s<t.colCount;s++){const a=r.getBody(s,n);if("radio"===a.cellType)return!1;if("function"==typeof a.style||"function"==typeof a.icon||(null===(e=a.define)||void 0===e?void 0:e.customRender)||(null===(i=a.define)||void 0===i?void 0:i.customLayout)||"function"==typeof(null===(o=a.define)||void 0===o?void 0:o.icon))return!1;const l=t._getCellStyle(s,n);if("function"==typeof l.padding||"function"==typeof l.fontSize||"function"==typeof l.lineHeight||!0===l.autoWrapText)return!1}return!0}(t))if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol)for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){let e;e=Ay(t,o)?_y(o,0,t.rowHeaderLevelCount,t):_y(o,0,t.colCount-1,t),r?m[o]=Math.round(e):t._setRowHeight(o,e)}else for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){const e=_y(o,0,t.colCount-1,t);r?m[o]=Math.round(e):t._setRowHeight(o,e)}else{!function(t,e,i,o,r){if(!o.internalProps.useOneRowHeightFillAll){for(let n=e;n<=i;n++)r?r[n]=t:o._setRowHeight(n,t);o.internalProps.useOneRowHeightFillAll=!0}}(_y(t.columnHeaderLevelCount,0,t.colCount-1,t),t.columnHeaderLevelCount,t.rowCount-1-t.bottomFrozenRowCount,t,r?m:void 0);for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++){const i=_y(e,0,t.colCount-1,t);r?m[e]=Math.round(i):t._setRowHeight(e,i)}}}else if(("adaptive"===t.heightMode||t.autoFillHeight)&&t.clearRowHeightCache(),r)for(let o=e;o<=i;o++)m[o]=t.getRowHeight(o);if((0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap(),"adaptive"===t.heightMode){t._clearRowRangeHeightsMap();let e=t.tableNoFrameHeight,i=0,o=t.rowCount;if("only-body"===t.heightAdaptiveMode){const r=t.getRowsHeight(0,t.columnHeaderLevelCount-1),n=t.isPivotChart()?t.getBottomFrozenRowsHeight():0;e=t.tableNoFrameHeight-r-n,i=t.columnHeaderLevelCount,o=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount}let a=0;for(let e=i;e<o;e++)a+=r&&null!==(n=m[e])&&void 0!==n?n:t.getRowHeight(e);const l=e/a;for(let n=i;n<o;n++){let a;a=n===o-1?e-(r?m.reduce(((t,e,r)=>r>=i&&r<=o-2?t+e:t),0):t.getRowsHeight(i,o-2)):Math.round((r&&null!==(s=m[n])&&void 0!==s?s:t.getRowHeight(n))*l),r?m[n]=a:t._setRowHeight(n,a,!1)}}else if(t.autoFillHeight){t._clearRowRangeHeightsMap();const e=t.tableNoFrameHeight;let i=0,o=0;for(let e=0;e<t.rowCount;e++){const n=r&&null!==(a=m[e])&&void 0!==a?a:t.getRowHeight(e);(e<t.columnHeaderLevelCount||t.isPivotChart()&&e>=t.rowCount-t.bottomFrozenRowCount)&&(o+=n),i+=n}if(t.scenegraph._dealAutoFillHeightOriginRowsHeight=i,i<e&&i-o>0){const n=t.columnHeaderLevelCount,s=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount,a=(e-o)/(i-o);for(let i=n;i<s;i++){let h;h=i===s-1?e-o-(r?m.reduce(((t,e,i)=>i>=n&&i<=s-2?t+e:t),0):t.getRowsHeight(n,s-2)):Math.round((r&&null!==(l=m[i])&&void 0!==l?l:t.getRowHeight(i))*a),r?m[i]=h:t._setRowHeight(i,h,!1)}}}if(r){for(let o=e;o<=i;o++){const e=null!==(h=m[o])&&void 0!==h?h:t.getRowHeight(o);e!==(null!==(d=b[o])&&void 0!==d?d:t.getRowHeight(o))&&t._setRowHeight(o,e)}if("adaptive"===t.heightMode||t.autoFillHeight&&t.getAllRowsHeight()<=t.tableNoFrameHeight){for(let e=0;e<=t.columnHeaderLevelCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(c=b[e])&&void 0!==c?c:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(u=b[e])&&void 0!==u?u:t.getRowHeight(e)),!0)}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=t.rowCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(g=b[e])&&void 0!==g?g:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(p=b[e])&&void 0!==p?p:t.getRowHeight(e)),!0)}}for(let e=t.scenegraph.proxy.rowStart;e<=t.scenegraph.proxy.rowEnd;e++){const i=t.getRowHeight(e);i!==(null!==(f=b[e])&&void 0!==f?f:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(v=b[e])&&void 0!==v?v:t.getRowHeight(e)),!0)}}t.isPivotTable()&&(C.disableUseGetBodyCache(),C.disableUseHeaderPathCache())}function _y(t,e,i,o){var r;let n;if(o.isPivotChart()&&t>=o.columnHeaderLevelCount&&t<o.rowCount-o.bottomFrozenRowCount)if(o.internalProps.layoutMap.indicatorsAsCol){const e=o.internalProps.layoutMap.getOptimunHeightForChart(t);if(e>0)return e}else{const e=o.getDefaultRowHeight(t);if(at(e))return e}for(let s=e;s<=i;s++){const e=By(s,t,o);if(e&&(n=J(n)?Math.max(e.height,n):e.height,!e.renderDefault))continue;if(o.isPivotChart()){const e=o.internalProps.layoutMap.getAxisConfigInPivotChart(s,t);if(e){const t=hm.getFunction("computeAxisComponentHeight")(e,o);if("number"==typeof t){n=J(n)?Math.max(t,n):t;continue}}}if(o.isPivotChart()&&(o.isLeftFrozenColumn(s)&&o.isBottomFrozenRow(t)||o.isRightFrozenColumn(s)&&o.isBottomFrozenRow(t)))continue;const i=My(s,t,o.isHeader(s,t)?null===(r=o._getHeaderLayoutMap(s,t))||void 0===r?void 0:r.headerType:o.getBodyColumnType(s,t),o);n=J(n)?Math.max(i,n):i}if(J(n))return n;const s=o.getDefaultRowHeight(t);return at(s)?s:o.defaultRowHeight}function Ay(t,e){var i,o,r;const{layoutMap:n}=t.internalProps;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak)&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=n.getBody(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icon||(null===(i=s.define)||void 0===i?void 0:i.customRender)||(null===(o=s.define)||void 0===o?void 0:o.customLayout)||"function"==typeof(null===(r=s.define)||void 0===r?void 0:r.icon))return!1;const a=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof a.padding&&"function"!=typeof a.fontSize&&"function"!=typeof a.lineHeight&&!0!==a.autoWrapText}function Ry(t,e){var i,o,r;const{layoutMap:n}=t.internalProps;if(t.internalProps.autoWrapText&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=n.getHeader(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icons||(null===(i=s.define)||void 0===i?void 0:i.headerCustomRender)||(null===(o=s.define)||void 0===o?void 0:o.headerCustomLayout)||"function"==typeof(null===(r=s.define)||void 0===r?void 0:r.icon))return!1;const a=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof a.padding&&"function"!=typeof a.fontSize&&"function"!=typeof a.lineHeight&&!0!==a.autoWrapText}function By(t,e,i){var o,r,n,s;const a=i.getCustomRender(t,e),l=i.getCustomLayout(t,e);if(a||l){let h=1,d=0,c=!1,u=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);h=o.end.row-o.start.row+1}const g={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:Ty(t,e,i),table:i};if(q(l)){const e=l(g);e.rootContainer?(e.rootContainer=FC(e.rootContainer),zC(e.rootContainer,i.getColWidth(t),0),e.rootContainer.setStage(i.scenegraph.stage),d=null!==(r=e.rootContainer.AABBBounds.height())&&void 0!==r?r:0,c=e.renderDefault,u=e.enableCellPadding):(d=0,c=e.renderDefault,u=e.enableCellPadding)}else if("function"==typeof a){const t=a(g);d=null!==(n=null==t?void 0:t.expectedHeight)&&void 0!==n?n:0,c=null==t?void 0:t.renderDefault}else d=null!==(s=null==a?void 0:a.expectedHeight)&&void 0!==s?s:0,c=null==a?void 0:a.renderDefault;if(u){const o=Dm(VC("padding",i._getCellStyle(t,e),t,e,i));d+=o[0]+o[2]}return{height:d/h,renderDefault:c}}}function My(t,e,i,o){var r,n,s;let a=0;const l=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=0;const u=[];let g=0;const p=[];let f=0,v=!1;if("body"!==o.getCellLocation(t,e))v=!0;else{const i=o.getBodyColumnDefine(t,e);v=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(v){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o,r,n,s,a,l,h,v;t.positionType!==Tv.absoluteRight&&t.positionType!==Tv.inlineFront&&t.positionType!==Tv.inlineEnd?(c+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0),d=Math.max(d,null!==(r=t.height)&&void 0!==r?r:0)):t.positionType===Tv.inlineFront?(u.push(t),g=Math.max(g,(null!==(n=t.height)&&void 0!==n?n:0)+(null!==(s=t.marginLeft)&&void 0!==s?s:0)+(null!==(a=t.marginRight)&&void 0!==a?a:0))):t.positionType===Tv.inlineEnd&&(p.push(t),f=Math.max(f,(null!==(l=t.height)&&void 0!==l?l:0)+(null!==(h=t.marginLeft)&&void 0!==h?h:0)+(null!==(v=t.marginRight)&&void 0!==v?v:0)))}))}let b=1,m=t;if(o.isHeader(t,e)||(null===(r=o.getBodyColumnDefine(t,e))||void 0===r?void 0:r.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);b=i.end.row-i.start.row+1,t=i.start.col,m=i.end.col}const C=Dm(VC("padding",h,t,e,o)),y=VC("fontSize",h,t,e,o),w=VC("fontStyle",h,t,e,o),x=VC("fontWeight",h,t,e,o),S=null!==(n=VC("lineHeight",h,t,e,o))&&void 0!==n?n:y,_=VC("fontFamily",h,t,e,o),A=VC("autoWrapText",h,t,e,o),R=VC("lineClamp",h,t,e,o);let B;if("text"!==i&&"link"!==i&&"progressbar"!==i&&"checkbox"!==i&&"radio"!==i)a=S;else if("checkbox"===i)a=function(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){const f=ob(Q(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),b=VC("size",r,e,i,p);let m=0;if(n){const t=VC("spaceBetweenTextAndIcon",r,e,i,p),o=v-(g[1]+g[3])-s-b-t;cy.setAttributes({text:{maxLineWidth:o,text:f,fontSize:a,fontStyle:l,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},icon:{width:Math.floor(b/1.4),height:Math.floor(b/1.4)},box:{width:b,height:b},spaceBetweenTextAndIcon:t}),cy.render(),m=cy.AABBBounds.height()}else m=Math.max(b,f.length*c);return m}(l,t,e,m,h,A,c,y,w,x,_,S,R,C,o);else if("radio"===i)a=function(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f;if(rt(t)){let v=0;const b=p.getBodyColumnDefine(e,i),m=VC("spaceBetweenRadio",r,e,i,p),C=null!==(f=null==b?void 0:b.radioDirectionInCell)&&void 0!==f?f:"vertical";return"vertical"===C?t.forEach(((f,b)=>{const C=gy(f,e,i,o,r,n,s,a,l,h,d,c,u,g,p);v+=C,b!==t.length-1&&(v+=m)})):"horizontal"===C&&t.forEach((t=>{const f=gy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p);v=Math.max(f,v)})),v}return gy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p)}(l,t,e,m,h,A,c,y,w,x,_,S,R,C,o);else{B=l;const i=KC(B,o).text,r=o.getColsWidth(t,m);if(u.length||p.length)if(A){const t=Object.assign({text:null==l?void 0:l.toString(),fontFamily:_,fontSize:y,fontStyle:w,fontWeight:x,lineHeight:S});t.textBaseline="middle";const e=[...u.map((t=>ZC(t))),t,...p.map((t=>ZC(t)))];xy.setAttributes({width:r-(C[1]+C[3])-c,height:0,textConfig:e}),a=xy.AABBBounds.height()}else a=0,i.forEach(((t,e)=>{var r;(null===(r=o.options.customConfig)||void 0===r?void 0:r.multilinesForXTable)&&0!==e||(0===e&&u.length?a+=Math.max(S,g):e===i.length-1&&p.length?a+=Math.max(S,f):a+=S)}));else if(A){const n=$C(t,e,o),s=wy({maxLineWidth:r-(C[1]+C[3])-c-n,text:i,fontSize:y,fontStyle:w,fontWeight:x,fontFamily:_,lineHeight:S,wordBreak:"break-word",whiteSpace:1!==i.length||A?"normal":"no-wrap",lineClamp:R});a=s.height()||("number"==typeof S?S:y)}else a=(null===(s=o.options.customConfig)||void 0===s?void 0:s.multilinesForXTable)?S:i.length*S}return(Math.max(a,d)+C[0]+C[2])/b}function Ty(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:i.getColWidth(t),height:0}}function Py(t,e){if(!e||!e.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:i,mergeEndCol:o,mergeStartRow:r,mergeEndRow:n,col:s,row:a}=t,{colStart:l,colEnd:h,rowStart:d,rowEnd:c,bodyLeftCol:u,bodyRightCol:g,bodyTopRow:p,bodyBottomRow:f}=e.proxy;let v=i,b=o,m=r,C=n;return s>=u&&s<=g&&(v=Math.max(t.mergeStartCol,l),b=Math.min(t.mergeEndCol,h)),a>=p&&a<=f&&(m=Math.max(t.mergeStartRow,d),C=Math.min(t.mergeEndRow,c)),{colStart:v,colEnd:b,rowStart:m,rowEnd:C}}function ky(t,e,i,o){o||t.table._setRowHeight(e,t.table.getRowHeight(e)+i,!0);for(let o=0;o<t.table.colCount;o++){const r=t.getCell(o,e);if("empty"===r.role)continue;const n=lm(t.table,o,e);n&&n.start.col!==o||(Ly(t,r,o,e,r.attribute.height+i,i,t.table.isHeader(o,e)),t.updateCellContentWhileResize(o,e))}let r=0,n=0;e<t.table.frozenRowCount?(r=e+1,n=t.table.frozenRowCount-1):e>=t.table.rowCount-t.table.bottomFrozenRowCount?(r=e+1,n=t.table.rowCount-1):(r=e+1,n=Math.min(t.proxy.rowEnd,t.table.rowCount-t.table.bottomFrozenRowCount-1));for(let e=0;e<t.table.colCount;e++)for(let o=r;o<=n;o++){const r=t.highPerformanceGetCell(e,o);"cell"===r.role&&r.setAttribute("y",r.attribute.y+i)}}function Ly(t,e,i,o,r,n,s){e&&function(t,e,i,o,r,n,s){var a,l,h;if(e.attribute.height===r&&!e.needUpdateHeight)return;e.needUpdateHeight=!1,e.setAttribute("height",r);const d=(null===(a=t.table.getCellRawRecord(i,o))||void 0===a?void 0:a.vtableMerge)?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);if("progressbar"===d){const s=t.table.getBodyColumnDefine(i,o),a=t.table._getCellStyle(i,o),l=t.table.getCellValue(i,o),h=t.table.getCellOriginValue(i,o),d=Dm(VC("padding",a,i,o,t.table));let c;(null==s?void 0:s.mergeCell)&&(c=t.table.getCellRange(i,o));const u=hm.getFunction("createProgressBarCell")(s,a,e.attribute.width,l,h,i,o,d,t.table,c),g=e.getChildByName("progress-bar");e.insertBefore(u,g),e.removeChild(g),g.removeAllChild(),g.release(),Hy(e,r,n,t.table.isAutoRowHeight(o),!0,t.table)}else if("sparkline"===d){e.removeAllChild();const r=t.table._getCellStyle(i,o),n=Dm(VC("padding",r,i,o,t.table));hm.getFunction("createSparkLineCellGroup")(e,e.parent,e.attribute.x,e.attribute.y,i,o,e.attribute.width,e.attribute.height,n,t.table,wC(r,t.table,i,o,VC).theme,!1)}else if("image"===d||"video"===d)ey(e,i,o,0,0,t.table);else if("axis"===(null===(l=e.firstChild)||void 0===l?void 0:l.name))null===(h=e.firstChild)||void 0===h||h.originAxis.resize(e.attribute.width,e.attribute.height);else{let s=!0;const a=e.getChildByName(kC)||e.getChildByName(LC);if(a){let r;t.table.reactCustomLayout&&t.table.reactCustomLayout.removeCustomCell(i,o),a.removeAllChild(),e.removeChild(a);const n=hy(i,o,e,t.table);if(n)for(let e=n.start.row;e<=n.end.row;e++){if(e===o)continue;const r=t.getCell(i,e),n=r.getChildByName(kC)||r.getChildByName(LC);n.removeAllChild(),r.removeChild(n),hy(i,e,r,t.table)}else{let n,a;const l=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o);if(h&&t.table.options.groupTitleCustomLayout)a=t.table.options.groupTitleCustomLayout;else if("body"!==l){const e=t.table.getHeaderDefine(i,o);n=null==e?void 0:e.headerCustomRender,a=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);n=(null==e?void 0:e.customRender)||t.table.customRender,a=null==e?void 0:e.customLayout}if((n||a)&&dy(e))for(let i=e.mergeStartCol;i<=e.mergeEndCol;i++)for(let r=e.mergeStartRow;r<=e.mergeEndRow;r++)r!==o&&t.updateCellContent(i,r);if(a||n){const l=Dm(VC("padding",t.table._getCellStyle(i,o),i,o,t.table));let h=e.attribute.width,d=e.attribute.height;dy(e)&&(h=t.table.getColsWidth(e.mergeStartCol,e.mergeEndCol),d=t.table.getRowsHeight(e.mergeStartRow,e.mergeEndRow));const c=HC(a,n,i,o,h,d,!1,t.table.isAutoRowHeight(o),l,dy(e)?{start:{col:e.mergeStartCol,row:e.mergeStartRow},end:{col:e.mergeEndCol,row:e.mergeEndRow}}:void 0,t.table);r=c.elementsGroup,s=c.renderDefault}e.childrenCount>0&&r?e.insertBefore(r,e.firstChild):r&&e.appendChild(r)}}Hy(e,r,n,t.table.isAutoRowHeight(o),s,t.table)}}(t,e,i,o,r,n)}function Hy(t,e,i,o,r,n){if(dy(t)){e=0;for(let i=t.mergeStartRow;i<=t.mergeEndRow;i++)e+=n.getRowHeight(i);const{colStart:i,colEnd:s,rowStart:a,rowEnd:l}=Py(t,n.scenegraph);for(let h=i;h<=s;h++)for(let s=a;s<=l;s++){const l=n.scenegraph.getCell(h,s);if(l.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})})),r){const t=n._getCellStyle(i,a);QC(l,e,0,o,Dm(t.padding),t.textAlign,t.textBaseline)}const d=n.getRowHeight(s),c=n.getColWidth(h);l.contentHeight=e;const{widthChange:u}=ly(l,c,d,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},n);u&&(l.needUpdateWidth=!0)}}else{const i=n._getCellStyle(t.col,t.row);QC(t,e,0,o,Dm(i.padding),i.textAlign,i.textBaseline)}}function Ey(t,e,i,o){var r,n,s,a,l,h,d;let c=!1;const u=null!==(r=null==t?void 0:t.attribute.width)&&void 0!==r?r:0;if(null==t||t.setAttribute("width",u+e),null==t||t.forEachChildren(((t,r)=>{if(function(t,e,i,o,r,n,s,a,l){var h,d,c,u,g,p;if(e.attribute.width===n&&!e.needUpdateWidth)return!1;e.needUpdateWidth=!1,e.setAttribute("width",n);const f=e;if(!f)return!1;const v=t.table.isAutoRowHeight(o),b=(null===(h=t.table.getCellRawRecord(i,o))||void 0===h?void 0:h.vtableMerge)?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);let m=!1;if("progressbar"===b){const e=t.table.getBodyColumnDefine(i,o),r=t.table._getCellStyle(i,o),a=t.table.getCellValue(i,o),l=t.table.getCellOriginValue(i,o),h=Dm(VC("padding",r,i,o,t.table));let d;(null==e?void 0:e.mergeCell)&&(d=t.table.getCellRange(i,o));const c=hm.getFunction("createProgressBarCell")(e,r,f.attribute.width,a,l,i,o,h,t.table,d),u=f.getChildByName("progress-bar");f.insertBefore(c,u),f.removeChild(u),u.removeAllChild(),u.release();const g=zy(f,n,s,v,!0,t.table);m=m||g}else if("sparkline"===b){f.removeAllChild();const e=t.table._getCellStyle(i,o),r=Dm(VC("padding",e,i,o,t.table));hm.getFunction("createSparkLineCellGroup")(f,f.parent,f.attribute.x,f.attribute.y,i,o,f.attribute.width,f.attribute.height,r,t.table,wC(e,t.table,i,o,VC).theme,!1)}else if("image"===b||"video"===b)ey(f,i,o,s,0,t.table);else if("axis"===(null===(d=f.firstChild)||void 0===d?void 0:d.name)){const e=t.table.internalProps.layoutMap.getAxisConfigInPivotChart(i,o),r=Dm(VC("padding",t.table._getCellStyle(i,o),i,o,t.table));if(e){const i=new(hm.getComponent("axis"))(e,f.attribute.width,f.attribute.height,r,t.table);f.clear(),f.appendChild(i.component),i.overlap()}}else if("axis"===(null===(c=e.firstChild)||void 0===c?void 0:c.name))null===(u=e.firstChild)||void 0===u||u.originAxis.resize(e.attribute.width,e.attribute.height);else{let r=!0;const a=e.getChildByName(kC)||e.getChildByName(LC);if(a){let n;t.table.reactCustomLayout&&t.table.reactCustomLayout.removeCustomCell(i,o),a.removeAllChild(),e.removeChild(a);const s=hy(i,o,e,t.table);if(s)for(let e=s.start.col;e<=s.end.col;e++){if(e===i)continue;const r=t.getCell(e,o),n=r.getChildByName(kC)||r.getChildByName(LC);n.removeAllChild(),r.removeChild(n),hy(e,o,r,t.table)}else{let s,a;const l=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o);if(h&&t.table.options.groupTitleCustomLayout)a=t.table.options.groupTitleCustomLayout;else if("body"!==l){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,a=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,a=null==e?void 0:e.customLayout}if((s||a)&&dy(f))for(let e=f.mergeStartCol;e<=f.mergeEndCol;e++)if(e!==i)for(let i=f.mergeStartRow;i<=f.mergeEndRow;i++)t.updateCellContent(e,i);if(a||s){const e=Dm(VC("padding",t.table._getCellStyle(i,o),i,o,t.table));let l=f.attribute.width,h=f.attribute.height;dy(f)&&(l=t.table.getColsWidth(f.mergeStartCol,f.mergeEndCol),h=t.table.getRowsHeight(f.mergeStartRow,f.mergeEndRow));const d=HC(a,s,null!==(g=f.mergeStartCol)&&void 0!==g?g:i,null!==(p=f.mergeStartRow)&&void 0!==p?p:o,l,h,!1,t.table.isAutoRowHeight(o),e,dy(f)?{start:{col:f.mergeStartCol,row:f.mergeStartRow},end:{col:f.mergeEndCol,row:f.mergeEndRow}}:void 0,t.table);n=d.elementsGroup,r=d.renderDefault,m=!0}e.childrenCount>0&&n?e.insertBefore(n,e.firstChild):n&&e.appendChild(n)}}const l=zy(f,n,s,v,r,t.table);m=m||l}l||(l=t.table._getCellStyle(i,o).autoWrapText);return!(!v||!l)&&m}(o,t,t.col,t.row,0,u+e,e,"row-body"!==i||(t.col,o.table.rowHeaderLevelCount),o.table.internalProps.autoWrapText)){const e=lm(o.table,t.col,t.row);if(e&&e.end.row-e.start.row)for(let t=e.start.row;t<=e.end.row;t++)Fy(o,t);else Fy(o,t.row);c=!0}})),c){let t,e,r,c=0;for(let u=0;u<o.table.colCount;u++){if("col-corner"===i?(r=0,t=o.getColGroup(u,!0),e=null!==(n=o.colHeaderGroup.attribute.height)&&void 0!==n?n:0):"row-body"===i?(r=o.table.frozenRowCount,t=o.getColGroup(u,!1),e=null!==(s=o.bodyGroup.attribute.height)&&void 0!==s?s:0):"bottom"===i?(r=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInBottom(u),e=null!==(a=o.bottomFrozenGroup.attribute.height)&&void 0!==a?a:0):"left-bottom"===i?(r=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInLeftBottomCorner(u),e=null!==(l=o.leftBottomCornerGroup.attribute.height)&&void 0!==l?l:0):"right-top"===i?(r=0,t=o.getColGroupInRightTopCorner(u),e=null!==(h=o.rightTopCornerGroup.attribute.height)&&void 0!==h?h:0):"right-bottom"===i&&(r=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInRightBottomCorner(u),e=null!==(d=o.rightBottomCornerGroup.attribute.height)&&void 0!==d?d:0),!t)continue;let g=0;t.forEachChildren((t=>{var e;t.setAttribute("y",g),g+=null!==(e=o.table.getRowHeight(t.row))&&void 0!==e?e:0})),c=g}o.updateContainerHeight(r,c-e);for(let t=0;t<o.table.frozenColCount;t++){const e=o.getColGroupInLeftBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.colCount-o.table.rightFrozenColCount;t<o.table.colCount;t++){const e=o.getColGroupInRightBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.frozenColCount;t<o.table.colCount-o.table.rightFrozenColCount;t++){const e=o.getColGroupInBottom(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}}}function zy(t,e,i,o,r,n){if(dy(t)){e=0;let s=!1;for(let i=t.mergeStartCol;i<=t.mergeEndCol;i++)e+=n.getColWidth(i);let a=0;for(let e=t.mergeStartRow;e<=t.mergeEndRow;e++)a+=n.getRowHeight(e);const{colStart:l,colEnd:h,rowStart:d,rowEnd:c}=Py(t,n.scenegraph);for(let u=l;u<=h;u++)for(let h=d;h<=c;h++){if(u===t.col&&h!==t.row)continue;const c=n.scenegraph.getCell(u,h);c.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));let g=!1;if(r){const t=n._getCellStyle(l,d);g=JC(c,e,a,i,o,Dm(t.padding),t.textAlign,t.textBaseline,n.scenegraph);const r=$C(c.col,c.row,n);if(r){const t=c.getChildByName("text"),e=c.getChildByName("expand")||c.getChildByName("collapse");"icon-left"!==(null==e?void 0:e.role)&&t&&t.setAttribute("dx",r)}}const p=n.getRowHeight(h),f=n.getColWidth(u);c.contentWidth=e;const{heightChange:v}=ly(c,f,p,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},n);v&&(c.needUpdateHeight=!0),s=s||g}return s}const s=n._getCellStyle(t.col,t.row),a=Dm(s.padding),l=s.textAlign,h=s.textBaseline;return JC(t,e,n.getRowHeight(t.row),i,o,a,l,h,n.scenegraph)}function Fy(t,e){const i=Math.round(_y(e,0,t.table.colCount-1,t.table));t.table._setRowHeight(e,i,!0);for(let o=0;o<t.table.colCount;o++){const r=i,n=t.highPerformanceGetCell(o,e);if("empty"===n.role)return;Ly(t,n,o,e,r,r-n.attribute.height,t.table.isHeader(o,e))}}var Iy;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(Iy||(Iy={}));const Oy=12,Dy="Arial,sans-serif",Wy="#000",Ny="#2E68CF",Gy="#EEE",jy=30,Uy="#FFF",Vy=4,Xy=.5,Yy="#CCC",$y=6,Ky=9,qy=200;class Zy{constructor(t){this._table=t,this._menuInstance=new jC({x:0,y:0,fill:Uy,stroke:Yy,cornerRadius:Vy,lineWidth:Xy}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:Iy.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,r,n){if(r===Iy.dropDown&&this.checkDropDownMenuChange(i,o)){const t=this.getMenuInfo(i,o,r);if(!t)return;const{menuInfo:e,highlightIndex:n}=t;this.updateMenuInfo(i,o,r,e,n),this.updateMenuInstance(e,n)}else if(r===Iy.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(i,o,r);if(!t)return;const{menuInfo:e,highlightIndex:n}=t;this.updateMenuInfo(i,o,r,e,n),this.updateMenuInstance(e,n)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,r){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=r}checkDropDownMenuChange(t,e){const{type:i,col:o,row:r}=this._menuInfo;return i!==Iy.dropDown||t!==o||e!==r}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:r}=this._menuInfo;return o!==Iy.contextmenu||r!==(null===(i=this._table.internalProps.menu)||void 0===i?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=$y;const o=$y;let r=0;t.forEach(((t,n)=>{var s,a;const l=e===n;let h,d;"string"==typeof t?d=t:"object"==typeof t&&(d=t.text,h=l?t.selectedIcon:t.icon);const c=new jC({y:i,x:o,height:jy,fill:Uy});c.role="menu-item",this._menuInstance.appendChild(c),c.stateProxy=t=>"hover"===t?{fill:Gy}:{fill:Uy},c.addEventListener("pointerenter",(t=>{c.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),c.addEventListener("pointerleave",(t=>{c.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new Gl({x:Ky,y:Ky,fill:l?Ny:Wy,text:d,textBaseline:"top",fontSize:Oy,fontFamily:Dy,pickable:!1,maxLineWidth:qy,ellipsis:"…"});if(c.addChild(u),h){u.AABBBounds.height();const t=null!==(s=h.width)&&void 0!==s?s:16,e=null!==(a=h.height)&&void 0!==a?a:16,i=new SC({x:Ky,y:(jy-e)/2,width:t,height:e,image:h.svg,pickable:!1});i.role="menu-icon",c.insertBefore(i,u),u.setAttribute("x",t+Ky)}r=Math.max(c.AABBBounds.width(),r),i+=jy})),this._menuInstance.setAttributes({width:r+2*Ky+2*$y,height:i+$y}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",r+2*Ky)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===Iy.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=Iy.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===Iy.dropDown){const{dropDownMenu:i=this._table.globalDropDownMenu,pivotInfo:o}=this._table._getHeaderLayoutMap(t,e);let r=-1;if(Array.isArray(i))for(let o=0;o<i.length;o++)if(this._table._dropDownMenuIsHighlight(t,e,o)){r=o;break}return{menuInfo:i,highlightIndex:r}}if(i===Iy.contextmenu){const i=null===(o=this._table.internalProps.menu)||void 0===o?void 0:o.contextMenuItems;let r;if(Array.isArray(i))r=i;else if("function"==typeof i){const{field:o}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);r=i(o,e,t)}return{menuInfo:r,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),r=Object.assign(i,o);r.event=t.nativeEvent,this._table.fireListeners(kb.DROPDOWN_MENU_CLICK,r)}}))}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren(((e,o)=>e===t&&(i=o-1,!0)));const o="string"==typeof this._menuInfo.menuInfo[i]?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,r="string"==typeof this._menuInfo.menuInfo[i]?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:r}}get bounds(){return this._menuInstance.globalAABBBounds}}const Jy=GC();class Qy{constructor(){const t=Jy.drillDown;this.icon=new SC({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,r,n){if(!t||o&&r)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void n.updateNextFrame();const s=Jy.drillDown,a=Jy.drillUp;this.icon.setAttributes({x:e,y:i,image:o?s.svg:a.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),n.updateNextFrame()}}class tw{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=ed({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=rd({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=ad({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),r=lm(this.table,t,e);r&&(t=r.start.col,e=r.start.row);let n=0,s=0,a=0,l=0,h=0,d=0,c=0,u=0,g=Math.PI;const p=[];"columnHeader"===o?(n=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,s=this.table.getRowsHeight(0,this.table.frozenRowCount-1),l=this.table.tableNoFrameHeight,a=r?this.table.getColsWidth(r.start.col,r.end.col):this.table.getColWidth(t),h=n-i,c=n+a,u=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):("rowHeader"===o||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(s=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,n=this.table.getColsWidth(0,this.table.frozenColCount-1),a=this.table.tableNoFrameWidth,l=r?this.table.getRowsHeight(r.start.row,r.end.row):this.table.getRowHeight(e),d=s-i,c=2,u=s+l,g=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:n-h,y:s-d,width:a,height:l,dx:h,dy:d}),this.columnMoverLine.setAttributes({x:c,y:u,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:u,angle:g})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):"number"==typeof i&&"number"==typeof o&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function ew(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllColsWidth())-e.getColsWidth(t,e.colCount-1);let o=e.getColsWidth(0,t);return t>=e.frozenColCount&&(o-=e.scrollLeft),o}function iw(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllRowsHeight())-e.getRowsHeight(t,e.rowCount-1);let o=e.getRowsHeight(0,t);return t>=e.frozenRowCount&&(o-=e.scrollLeft),o}class ow{constructor(t){var e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b;this.table=t;const m=this.table.theme;this.createScrollBar();const C=null===(e=m.columnResize)||void 0===e?void 0:e.lineColor,y=null===(i=m.columnResize)||void 0===i?void 0:i.lineWidth,w=null===(o=m.columnResize)||void 0===o?void 0:o.bgColor,x=null===(r=m.columnResize)||void 0===r?void 0:r.width,S=null===(s=null===(n=m.columnResize)||void 0===n?void 0:n.labelVisible)||void 0===s||s,_=null===(a=m.columnResize)||void 0===a?void 0:a.labelColor,A=null===(l=m.columnResize)||void 0===l?void 0:l.labelFontSize,R=null===(h=m.columnResize)||void 0===h?void 0:h.labelFontFamily,B=null===(d=m.columnResize)||void 0===d?void 0:d.labelBackgroundFill,M=null===(c=m.columnResize)||void 0===c?void 0:c.labelBackgroundCornerRadius;this.labelVisible=S,this.columnResizeLine=rd({visible:!1,pickable:!1,stroke:C,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=rd({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const T=jl({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:_,fontFamily:R,text:"",textBaseline:"top",dx:16,dy:-A/2}),P=ad({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.columnResizeLabel=Fn({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(P),this.columnResizeLabel.appendChild(T),this.rowResizeLine=rd({visible:!1,pickable:!1,stroke:C,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=rd({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const k=jl({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:_,fontFamily:R,text:"",textBaseline:"top",dx:16,dy:-A/2}),L=ad({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.rowResizeLabel=Fn({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(L),this.rowResizeLabel.appendChild(k),this.cellMover=new tw(this.table);const H=null===(g=null===(u=m.frozenColumnLine)||void 0===u?void 0:u.shadow)||void 0===g?void 0:g.width,E=null===(f=null===(p=m.frozenColumnLine)||void 0===p?void 0:p.shadow)||void 0===f?void 0:f.startColor,z=null===(b=null===(v=m.frozenColumnLine)||void 0===v?void 0:v.shadow)||void 0===b?void 0:b.endColor;this.frozenShadowLine=ad({visible:!0,pickable:!1,x:0,y:0,width:H,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:E,offset:0},{color:z,offset:1}]}}),this.rightFrozenShadowLine=ad({visible:!0,pickable:!1,x:0,y:0,width:H,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:z,offset:0},{color:E,offset:1}]}}),this.menu=new Zy(this.table),this.drillIcon=new Qy}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o,r,n;const s=this.table.theme,a=null===(t=s.scrollStyle)||void 0===t?void 0:t.scrollRailColor,l=null===(e=s.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,h=null===(i=s.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,d=null===(o=s.scrollStyle)||void 0===o?void 0:o.width,c=null===(r=s.scrollStyle)||void 0===r?void 0:r.horizontalPadding,u=null===(n=s.scrollStyle)||void 0===n?void 0:n.verticalPadding;let g;g=J(h)?{cornerRadius:h,fill:l}:{fill:l},this.hScrollBar=new kf({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:d,padding:c,railStyle:{fill:a},sliderStyle:g,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new kf({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:d,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:u,railStyle:{fill:a},sliderStyle:g,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,r,n,s;const a=this.table.stateManager.scroll.horizontalBarPos,l=this.table.stateManager.scroll.verticalBarPos,h=this.table.theme,d=null===(t=h.scrollStyle)||void 0===t?void 0:t.width,c=null===(e=h.scrollStyle)||void 0===e?void 0:e.visible,u=null!==(o=null===(i=h.scrollStyle)||void 0===i?void 0:i.horizontalVisible)&&void 0!==o?o:c,g=null!==(n=null===(r=h.scrollStyle)||void 0===r?void 0:r.verticalVisible)&&void 0!==n?n:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),f=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),v=this.table.getAllRowsHeight(),b=this.table.getAllColsWidth(),m=this.table.getFrozenRowsHeight(),C=this.table.getFrozenColsWidth(),y=this.table.getBottomFrozenRowsHeight(),w=this.table.getRightFrozenColsWidth(),x=(null===(s=this.table.options.customConfig)||void 0===s?void 0:s._disableColumnAndRowSizeRound)?1:0;if(b>p+x){const t=Math.min(f,v),e=Math.max(.05,(p-C)/(b-C)),i=this.table.theme.scrollStyle.hoverOn;let o=0;o=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(i?d:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:t-(i?d:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:C+(i?0:this.table.scenegraph.tableGroup.attribute.x),y:o,width:p-C-w,range:[0,e],visible:"always"===u});const r=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:r.x1,y:r.y1},"always"===u&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(v>f+x){const t=Math.min(p,b),e=Math.max(.05,(f-m)/(v-m));let i=0;const o=this.table.theme.scrollStyle.hoverOn;i=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(o?d:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:t-(o?d:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:m+(o?0:this.table.scenegraph.tableGroup.attribute.y),height:f-m-y,range:[0,e],visible:"always"===g});const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1},"always"===g&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(a),this.table.stateManager.setScrollTop(l)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=ew(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`))}updateResizeCol(t,e,i){const o=ew(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`))}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=iw(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`))}updateResizeRow(t,e,i){const o=iw(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`))}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=ew(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=ew(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const r=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:r.x1,y:r.y1}}updateStyle(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x;const S=this.table.theme,_=null===(t=S.scrollStyle)||void 0===t?void 0:t.scrollRailColor,A=null===(e=S.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,R=null===(i=S.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,B=null===(o=S.scrollStyle)||void 0===o?void 0:o.width,M=null===(r=S.scrollStyle)||void 0===r?void 0:r.horizontalPadding,T=null===(n=S.scrollStyle)||void 0===n?void 0:n.verticalPadding;let P;P=J(R)?{cornerRadius:R,fill:A}:{fill:A},this.hScrollBar.setAttributes({height:B,padding:M,railStyle:{fill:_},sliderStyle:P}),this.vScrollBar.setAttributes({width:B,padding:T,railStyle:{fill:_},sliderStyle:P});const k=null===(s=S.columnResize)||void 0===s?void 0:s.lineColor,L=null===(a=S.columnResize)||void 0===a?void 0:a.lineWidth,H=null===(l=S.columnResize)||void 0===l?void 0:l.bgColor,E=null===(h=S.columnResize)||void 0===h?void 0:h.width;this.columnResizeLine.setAttributes({stroke:k,lineWidth:L}),this.columnResizeBgLine=rd({stroke:H,lineWidth:E});const z=null===(d=S.columnResize)||void 0===d?void 0:d.labelColor,F=null===(c=S.columnResize)||void 0===c?void 0:c.labelFontSize,I=null===(u=S.columnResize)||void 0===u?void 0:u.labelFontFamily,O=null===(g=S.columnResize)||void 0===g?void 0:g.labelBackgroundFill,D=null===(p=S.columnResize)||void 0===p?void 0:p.labelBackgroundCornerRadius,W=null===(v=null===(f=S.columnResize)||void 0===f?void 0:f.labelVisible)||void 0===v||v;this.labelVisible=W,this.columnResizeLabel.lastChild.setAttributes({fontSize:F,fill:z,fontFamily:I,dy:-F/2}),this.columnResizeLabel.firstChild.setAttributes({fill:O,width:5*F*.8,height:F+8,cornerRadius:D,dy:-F/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:F,fill:z,fontFamily:I,dy:-F/2}),this.rowResizeLabel.firstChild.setAttributes({fill:O,width:5*F*.8,height:F+8,cornerRadius:D,dy:-F/2-4});const N=null===(m=null===(b=S.frozenColumnLine)||void 0===b?void 0:b.shadow)||void 0===m?void 0:m.width,G=null===(y=null===(C=S.frozenColumnLine)||void 0===C?void 0:C.shadow)||void 0===y?void 0:y.startColor,j=null===(x=null===(w=S.frozenColumnLine)||void 0===w?void 0:w.shadow)||void 0===x?void 0:x.endColor;this.frozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:G,offset:0},{color:j,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:G,offset:1}]}}),this.cellMover.updateStyle()}}function rw(t,e,i,o,r){var n,s,a,l,h,d;if(!e)return;const c="table"===i,{shadowBlur:u,shadowOffsetX:g,shadowOffsetY:p,shadowColor:f,cornerRadius:v,borderColor:b,borderLineWidth:m,borderLineDash:C}=e;let y=!1;const w={},x={pickable:!1};u&&c&&(x.shadowBlur=u,x.shadowOffsetX=g,x.shadowOffsetY=p,x.shadowColor=f,x.stroke=!0,x.stroke=f,x.lineWidth=1,y=!0),m&&(x.stroke=!0,x.fill=!1,x.stroke=sw(b,o,m),x.lineWidth=m,C&&(x.lineDash=C),x.lineCap="butt"),Array.isArray(b)&&(x.strokeArrayColor=Dm(b)),Array.isArray(m)&&(x.strokeArrayWidth=Dm(m),x.lineWidth=1),v&&(x.cornerRadius=v,w.cornerRadius=v);const S=x.strokeArrayWidth?x.strokeArrayWidth[0]:null!==(n=x.lineWidth)&&void 0!==n?n:0,_=x.strokeArrayWidth?x.strokeArrayWidth[1]:null!==(s=x.lineWidth)&&void 0!==s?s:0,A=x.strokeArrayWidth?x.strokeArrayWidth[2]:null!==(a=x.lineWidth)&&void 0!==a?a:0,R=x.strokeArrayWidth?x.strokeArrayWidth[3]:null!==(l=x.lineWidth)&&void 0!==l?l:0;if(t.setAttributes(w),!r&&x.stroke)if(x.x=R/2,x.y=S/2,x.pickable=!1,c){if(v)if(Array.isArray(v)){const t=Dm(v);x.cornerRadius=t,w.cornerRadius=t,t[0]&&(t[0]=t[0]+Math.min(R,S)/2),t[1]&&(t[1]=t[1]+Math.min(S,_)/2),t[2]&&(t[2]=t[2]+Math.min(_,A)/2),t[3]&&(t[3]=t[3]+Math.min(A,R)/2)}else if(rt(m)){const t=[];x.cornerRadius=t,w.cornerRadius=t,t[0]=v+Math.min(R,S)/2,t[1]=v+Math.min(S,_)/2,t[2]=v+Math.min(_,A)/2,t[3]=v+Math.min(A,R)/2}else x.cornerRadius=v+(null!==(h=x.lineWidth)&&void 0!==h?h:0)/2,w.cornerRadius=v+(null!==(d=x.lineWidth)&&void 0!==d?d:0)/2;let i,o;if(e.innerBorder?(x.x=t.attribute.x+R/2,x.y=t.attribute.y+S/2,x.width=t.attribute.width-R/2-_/2,x.height=t.attribute.height-S/2-A/2):(x.x=t.attribute.x-R/2,x.y=t.attribute.y-S/2,x.width=t.attribute.width+R/2+_/2,x.height=t.attribute.height+S/2+A/2),y){x.fill="white",x.notAdjustPos=!0,o=Fn(x),o.name="table-border-rect",i=ad({x:R/2,y:S/2,width:t.attribute.width,height:t.attribute.height,fill:"red",cornerRadius:t.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),o.addChild(i);const e=ad({width:1,height:1,fill:"transparent",pickable:!1});o.addChild(e)}else o=ad(x),o.name="table-border-rect";e.innerBorder&&!y?t.parent.insertAfter(o,t):t.parent.insertBefore(o,t),t.border=o}else{x.width=t.attribute.width-R/2-_/2,x.height=t.attribute.height-S/2-A/2;const e=ad(x);e.name="border-rect",t.addChild(e),t.border=e}}function nw(t,e,i){var o;const{borderColor:r}=e;null===(o=t.border)||void 0===o||o.setAttribute("stroke",sw(r,i))}function sw(t,e,i){let o=!0;return!e&&!rt(i)||rt(t)?e?o=e:e||rt(t)?rt(t)&&(o=!0):o=t:o=(null!=e?e:i).map((e=>!!e&&t)),o}function aw(t){var e,i,o,r;if(!t.border)return;const n=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:null!==(e=t.border.attribute.lineWidth)&&void 0!==e?e:0,s=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:null!==(i=t.border.attribute.lineWidth)&&void 0!==i?i:0,a=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:null!==(o=t.border.attribute.lineWidth)&&void 0!==o?o:0,l=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:null!==(r=t.border.attribute.lineWidth)&&void 0!==r?r:0;t.border.setAttributes({width:t.attribute.width-l/2-s/2,height:t.attribute.height-n/2-a/2}),"group"===t.border.type&&t.border.firstChild.setAttributes({width:t.attribute.width,height:t.attribute.height})}function lw(t,e){t.setAttribute("cornerRadius",e),t.border&&t.border.setAttribute("cornerRadius",e)}const hw=gn();class dw extends zn{constructor(t,e){if(super(e),this.type="chart",this.numberType=hw,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const t=this.chartInstance=new e.ClassType(e.spec,xt({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:"node"===this.attribute.mode?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1}));t.renderSync(),t.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=t}}activate(t){var e,i,o,r;this.active=!0;const{col:n,row:s}=this.parent,{x1:a,y1:l,x2:h,y2:d}=this.getViewBox(),c=function(t,e,i){var o,r,n,s,a,l,h,d;const{layoutMap:c}=i.internalProps,u=new Qt,g=i.scenegraph.tableGroup.globalAABBBounds;return u.x1=g.x1,u.x2=g.x2,u.y1=g.y1,u.y2=g.y2,c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?c.isLeftBottomCorner(t,e)||c.isRightTopCorner(t,e)||(c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?(u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()):c.isBottomFrozenRow(t,e)&&(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth())):(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth(),u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()),u.x1=u.x1+(null!==(r=null===(o=i.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==r?r:0),u.x2=u.x2+(null!==(s=null===(n=i.options.viewBox)||void 0===n?void 0:n.x1)&&void 0!==s?s:0),u.y1=u.y1+(null!==(l=null===(a=i.options.viewBox)||void 0===a?void 0:a.y1)&&void 0!==l?l:0),u.y2=u.y2+(null!==(d=null===(h=i.options.viewBox)||void 0===h?void 0:h.y1)&&void 0!==d?d:0),u}(n,s,t).intersect({x1:a-t.scrollLeft,x2:h-t.scrollLeft,y1:l-t.scrollTop,y2:d-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,xt({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:h-a,y1:0,y2:d-l},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:e=>{const i=this.stage,o=e.window.getContext(),r=i.window.getViewBoxTransform(),n=i.window.getViewBox();o.inuse=!0,o.clearMatrix(),o.setTransform(r.a,r.b,r.c,r.d,r.e,r.f,!0),o.translate(n.x1,n.y1),o.setTransformForCurrent(!0),o.beginPath(),o.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),o.clip(),o.clearMatrix(),t.options.canvas&&!e.needRender&&(e.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(t){t.window.getContext().inuse=!1,t.needRender=!1,u.resumeRender()}}));const u=this.activeChartInstance.getStage(),g=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),u.window.setViewBoxTransform&&u.window.setViewBoxTransform(g.a,g.b,g.c,g.d,g.e,g.f),this.activeChartInstance.renderSync(),null===(i=null===(e=t.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",(e=>{dw.temp&&t.scenegraph.updateChartState(null==e?void 0:e.datum)})),this.activeChartInstance.on("brushEnd",(e=>{var i;t.scenegraph.updateChartState(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.inBrushData),dw.temp=0,setTimeout((()=>{dw.temp=1}),0)})),null===(r=(o=t)._bindChartEvent)||void 0===r||r.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,null===(t=this.activeChartInstance)||void 0===t||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),null===(e=this.activeChartInstance)||void 0===e||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,i,o,r,n,s,a;const l=this.parent,h=this.attribute.cellPadding,d=this.stage.table,{x1:c,y1:u,x2:g,y2:p}=l.globalAABBBounds;return{x1:Math.ceil(c+h[3]+d.scrollLeft+(null!==(e=null===(t=d.options.viewBox)||void 0===t?void 0:t.x1)&&void 0!==e?e:0)),x2:Math.ceil(c+l.attribute.width-h[1]+d.scrollLeft+(null!==(o=null===(i=d.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0)),y1:Math.ceil(u+h[0]+d.scrollTop+(null!==(n=null===(r=d.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==n?n:0)),y2:Math.ceil(u+l.attribute.height-h[2]+d.scrollTop+(null!==(a=null===(s=d.options.viewBox)||void 0===s?void 0:s.y1)&&void 0!==a?a:0))}}}dw.temp=1;const cw=[],uw=[];let gw=5,pw=!1;function fw(t){J(t)&&(gw=t)}function vw(t){var e,i,o,r,n,s;const{axes:a,dataId:l,data:h,spec:d,ClassType:c,canvas:u,mode:g,modeParams:p,dpr:f}=t.attribute;let{chartInstance:v}=t;v||(v=new c(d,{renderCanvas:u,mode:"node"===g?"node":"desktop-browser",modeParams:p,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:f,interactive:!1,animation:!1,autoFit:!1}),v.renderSync(),t.chartInstance=v);const b=t.getViewBox();b.x2<=b.x1&&(b.x2=b.x1+1),b.y2<=b.y1&&(b.y2=b.y1+1),v.updateViewBox({x1:0,x2:b.x2-b.x1,y1:0,y2:b.y2-b.y1},!1,!1);const m=v.getStage(),C=t.globalTransMatrix.clone(),y=t.stage.window.getViewBoxTransform();C.multiply(y.a,y.b,y.c,y.d,y.e,y.f),m.window.setViewBoxTransform&&m.window.setViewBoxTransform(C.a,C.b,C.c,C.d,C.e,C.f);const{table:w}=t.getRootNode();let x=!1;if(w.options.specFormat){const e=w.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;v.updateSpecSync(t),x=!0}}if(!x)if(null==a||a.forEach(((t,e)=>{var i,o,r,n;"band"===t.type?v.updateModelSpec({type:"axes",index:e},{domain:t.domain.slice(0)},!0):v.updateModelSpecSync({type:"axes",index:e},{min:null!==(o=null===(i=t.range)||void 0===i?void 0:i.min)&&void 0!==o?o:0,max:null!==(n=null===(r=t.range)||void 0===r?void 0:r.max)&&void 0!==n?n:0},!0)})),null===(i=null===(e=w.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,v),"string"==typeof l)v.updateDataSync(l,null!=h?h:[]);else{const t=[];for(const e in l){const i=l[e],s=d.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(o=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==o?o:[]:null!=h?h:[],fields:null===(r=null==s?void 0:s.data)||void 0===r?void 0:r.fields}),v.updateFullDataSync||v.updateDataSync(e,i?null!==(n=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==n?n:[]:null!=h?h:[])}null===(s=v.updateFullDataSync)||void 0===s||s.call(v,t)}!function(t,e){var i;const{viewWidth:o,viewHeight:r}=t;if(o<mw&&r<mw)return e.cacheCanvas=Cw(t),void(e.isShareChartSpec||(null===(i=e.chartInstance)||void 0===i||i.release(),e.chartInstance=null,e.setAttribute("chartInstance",null)));const n=Math.ceil(r/mw),s=Math.ceil(o/mw),a=[];for(let e=0;e<n;e++)for(let i=0;i<s;i++){const n=i*mw,s=e*mw,l=n+mw>o?o:n+mw,h=s+mw>r?r:s+mw,d=l-n,c=h-s,u=new Qt;u.setValue(n,s,l,h);const g=Cw(t,!1,u);a.push({canvas:g,x:n,y:s,width:d,height:c})}e.cacheCanvas=a}(v.getStage(),t)}function bw(t){pw=!0,uw.length>0?requestAnimationFrame((()=>{const e=uw.splice(0,gw);cw.splice(0,gw),e.forEach((t=>{vw(t),t.addUpdateBoundTag()})),t.render(),bw(t)})):pw=!1}const mw=2e3;function Cw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if("released"===t.releaseStatus)return null;const o=t.window.getViewBoxTransform(),r=function(t){let e=arguments.length>2?arguments[2]:void 0;const i=t.window.getViewBoxTransform(),o=Bo.get(Eo),r=e?-e.x1:0,n=e?-e.y1:0,s=e?e.x2:t.viewWidth,a=e?e.y2:t.viewHeight,l=e?e.width():t.viewWidth,h=e?e.height():t.viewHeight;return o.create({viewBox:{x1:r,y1:n,x2:s,y2:a},width:l*i.a,height:h*i.d,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""}),t.renderTo(o),o}(t,e,i);r.setViewBoxTransform(o.a,o.b,o.c,o.d,0,0),t.renderTo(r);const n=r.getNativeHandler();return n.nativeCanvas?n.nativeCanvas:null}var yw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};const ww=Symbol.for("ChartRender");let xw=class extends Ls{constructor(){super(...arguments),this.numberType=hw}drawShape(t,e,i,o,r,n,s,a){var l,h,d,c;const u=qo(t,null==n?void 0:n.theme).group,{dataId:g,data:p,spec:f}=t.attribute,{width:v=u.width,height:b=u.height}=(t.getViewBox(),t.attribute),{table:m}=t.getRootNode(),{active:C,cacheCanvas:y,activeChartInstance:w}=t;if(!C&&y)rt(y)?y.forEach((t=>{const{x:i,y:o,width:r,height:n,canvas:s}=t;e.drawImage(s,i,o,r,n)})):e.drawImage(y,i,o,v,b);else if(w){if(m.options.specFormat){const e=m.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;return void w.updateSpecSync(t)}}const e=t.getViewBox();w.updateViewBox({x1:0,x2:e.x2-e.x1,y1:0,y2:e.y2-e.y1},!1,!1);const i=w.getStage();i.needRender=!0;const o=t.globalTransMatrix.clone(),r=t.stage.window.getViewBoxTransform().clone();if(r.multiply(o.a,o.b,o.c,o.d,o.e,o.f),i.window.setViewBoxTransform(r.a,r.b,r.c,r.d,r.e,r.f),"string"==typeof g)w.updateDataSync(g,null!=p?p:[]);else{const t=[];for(const e in g){const i=g[e],o=f.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(l=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==l?l:[]:null!=p?p:[],fields:null===(h=null==o?void 0:o.data)||void 0===h?void 0:h.fields}),w.updateFullDataSync||w.updateDataSync(e,i?null!==(d=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==d?d:[]:null!=p?p:[])}null===(c=w.updateFullDataSync)||void 0===c||c.call(w,t)}}else m.internalProps.renderChartAsync?(-1===cw.indexOf(`${t.parent.col}+${t.parent.row}`)&&(cw.push(`${t.parent.col}+${t.parent.row}`),uw.push(t)),pw||bw(m)):vw(t)}draw(t,e,i,o){this._draw(t,{},!1,i,o)}};xw=yw([m()],xw);var Sw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let _w=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{shape:g}=t.attribute;if("circle"===g){const{width:r=l.width,height:n=l.height}=t.attribute;e.beginPath(),e.arc(i+r/2,o+n/2,Math.min(r,n)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};_w=Sw([m()],_w);let Aw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{shape:g}=t.attribute;"circle"===g&&e.restore()}};function Rw(t,e,i,o){var r;const{highlightScope:n,disableHeader:s,cellPos:a}=t.hover,l=t.table,h=l.isHeader(e,i);if(h&&s)return;let d;if(n===_v.single&&a.col===e&&a.row===i?d="cellBgColor":n===_v.column&&a.col===e?d=a.col===e&&a.row===i?"cellBgColor":"inlineColumnBgColor":n===_v.row&&a.row===i?d=a.col===e&&a.row===i?"cellBgColor":"inlineRowBgColor":n===_v.cross&&(a.col===e&&a.row===i?d="cellBgColor":a.col===e?d="inlineColumnBgColor":a.row===i&&(d="inlineRowBgColor")),d){let t;if(h){const n=l.getHeaderDefine(e,i);t=null==n?void 0:n.disableHeaderHover,o.firstChild&&"axis"===o.firstChild.name&&(null===(r=l.options.hover)||void 0===r?void 0:r.disableAxisHover)&&(t=!0)}else{const o=l.getBodyColumnDefine(e,i);t=null==o?void 0:o.disableHover}t&&(d=void 0)}return d}function Bw(t,e,i,o){const{highlightScope:r,disableHeader:n,cellPos:s,ranges:a}=t.select;let l;if(1===(null==a?void 0:a.length)&&a[0].end.col===a[0].start.col&&a[0].end.row===a[0].start.row){const o=t.table,a=o.isHeader(e,i);if(a&&n)return;if(r===_v.single&&s.col===e&&s.row===i?l="cellBgColor":r===_v.column&&s.col===e?l=s.col===e&&s.row===i?"cellBgColor":"inlineColumnBgColor":r===_v.row&&s.row===i?l=s.col===e&&s.row===i?"cellBgColor":"inlineRowBgColor":r===_v.cross&&(s.col===e&&s.row===i?l="cellBgColor":s.col===e?l="inlineColumnBgColor":s.row===i&&(l="inlineRowBgColor")),l){let t;if(a){const r=o.getHeaderDefine(e,i);t=null==r?void 0:r.disableHeaderSelect}else{const r=o.getBodyColumnDefine(e,i);t=null==r?void 0:r.disableSelect}t&&(l=void 0)}}else if("replace"===t.table.theme.selectionStyle.selectionFillMode)for(let t=0;t<a.length;t++){const o=a[t];if(o.start.col<=e&&o.start.row<=i&&o.end.col>=e&&o.end.row>=i){l="cellBgColor";break}}return l}function Mw(t,e,i){const o=t.getBodyColumnDefine(e,i),r=t.isHeader(e,i);return!(!(null==o?void 0:o.disableSelect)||r)||!(!r||!(null==o?void 0:o.disableHeaderSelect))}Aw=Sw([m()],Aw);var Tw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Pw=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{stroke:g=l.stroke,strokeArrayWidth:p=l.strokeArrayWidth,strokeArrayColor:f=l.strokeArrayColor}=t.attribute;g&&(Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};Pw=Tw([m()],Pw);let kw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){var u;const{stroke:g=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:f=l.strokeArrayWidth,lineWidth:v=l.lineWidth,strokeColor:b=l.stroke,cornerRadius:m=l.cornerRadius}=t.attribute;let C,y,{width:w=l.width,height:x=l.height}=t.attribute;if(g&&(Array.isArray(f)||0!==v)&&(Array.isArray(p)||Array.isArray(f))){if("number"==typeof v&&1&v||Array.isArray(f)&&f.some((t=>1&t))){const e=t.stage.table;if(!e)return;const r="bottom-right"===(null==e?void 0:e.theme.cellBorderClipDirection);r?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5),(null===(u=e.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(w=Math.round(w),x=Math.round(x));const{width:n,height:s}=Gw(t,Math.ceil(w),Math.ceil(x),r);C=n,y=s}else C=Math.ceil(w),y=Math.ceil(x);0===m||rt(m)&&m.every((t=>0===t))?Hw(t,e,i,o,l,g,f||v,p||b,C,y):(e.beginPath(),Qs(e,i,o,C,y,m,new Array(4).fill(0).map(((r,n)=>(r,s,a,h)=>{Xw(n,r,s,a,h,t,e,i,o,l,g,f||v,p||b,C,y)}))),e.stroke())}}};function Lw(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let i=0;i<t.length;i++){const o=t[i];if(o)if(e){if(o!==e)return{isSplitDraw:!0}}else e=o}return{isSplitDraw:!1,width:e}}function Hw(t,e,i,o,r,n,s,a,l,h,d,c){var u,g,p,f;const v=Lw(s),b=!Array.isArray(s),m=!Array.isArray(n),C=Array.isArray(c),y=Array.isArray(a)||v.isSplitDraw;e.setStrokeStyle(t,t.attribute,i,o,r);const{lineDash:w=r.lineDash}=t.attribute;let x=!1;w.length&&w.some((t=>Array.isArray(t)))&&(x=!0),e.beginPath(),e.moveTo(i,o);const S=(m||n[0])&&(b||s[0]),_=(m||n[1])&&(b||s[1]),A=(m||n[2])&&(b||s[2]),R=(m||n[3])&&(b||s[3]);if(S){const t=(b?v.width:s[0])/2,r=(b?v.width:s[0])/2;C&&Array.isArray(c[0])?(e.moveTo(i-t+(l+t+r)*c[0][0],o),e.lineTo(i-t+(l+t+r)*(c[0][1]-c[0][0]),o),e.moveTo(i+l+r,o)):(e.moveTo(i-t,o),e.lineTo(i+l+r,o)),(y||x)&&(a&&a[0]?e.strokeStyle=a[0]:e.strokeStyle="transparent",b||(e.lineWidth=s[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(u=w[0])&&void 0!==u?u:[]),e.stroke(),e.beginPath(),e.moveTo(i+l,o))}else e.moveTo(i+l,o);if(_){const t=(b?v.width:s[1])/2,r=(b?v.width:s[1])/2;C&&Array.isArray(c[1])?(e.moveTo(i+l,o-t+h*c[1][0]),e.lineTo(i+l,o-t+(h+t+r)*(c[1][1]-c[1][0])),e.moveTo(i+l,o+h+r)):(e.moveTo(i+l,o-t),e.lineTo(i+l,o+h+r)),(y||x)&&(a&&a[1]?e.strokeStyle=a[1]:e.strokeStyle="transparent",b||(e.lineWidth=s[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(g=w[1])&&void 0!==g?g:[]),e.stroke(),e.beginPath(),e.moveTo(i+l,o+h))}else e.moveTo(i+l,o+h);if(A){const t=(b?v.width:s[2])/2,r=(b?v.width:s[2])/2;C&&Array.isArray(c[2])?(e.moveTo(i-t+(l+t+r)*c[2][0],o+h),e.lineTo(i-t+(l+t+r)*(c[2][1]-c[2][0]),o+h),e.moveTo(i-t,o+h)):(e.moveTo(i-t,o+h),e.lineTo(i+l+r,o+h)),(y||x)&&(a&&a[2]?e.strokeStyle=a[2]:e.strokeStyle="transparent",b||(e.lineWidth=s[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(p=w[2])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+h))}else e.moveTo(i,o+h);if(R){const t=(b?v.width:s[3])/2,r=(b?v.width:s[3])/2;C&&Array.isArray(c[3])?(e.moveTo(i,o-t+(h+t+r)*c[3][0]),e.lineTo(i,o-t+(h+t+r)*(c[3][1]-c[3][0])),e.moveTo(i,o-t)):(e.moveTo(i,o-t),e.lineTo(i,o+h+r)),(y||x)&&(a&&a[3]?e.strokeStyle=a[3]:e.strokeStyle="transparent",b||(e.lineWidth=s[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(f=w[3])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o))}else e.moveTo(i,o);y||x||(!b&&v.width&&(e.lineWidth=v.width),e.stroke()),e.lineDashOffset=0,e.setLineDash([])}kw=Tw([m()],kw);let Ew=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){var g;const{lineDash:p=l.lineDash,stroke:f=l.stroke,strokeArrayColor:v=l.strokeArrayColor,strokeArrayWidth:b=l.strokeArrayWidth}=t.attribute;f&&Array.isArray(p)&&p.length&&(null===(g=p[0])||void 0===g?void 0:g.length)&&!Array.isArray(v)&&!Array.isArray(b)&&(u.doStroke=!1)}};Ew=Tw([m()],Ew);let zw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){var u,g,p,f,v,b;const{lineDash:m=l.lineDash,stroke:C=l.stroke,strokeArrayColor:y=l.strokeArrayColor,strokeArrayWidth:w=l.strokeArrayWidth,lineWidth:x=l.lineWidth}=t.attribute;if(!C||!(Array.isArray(m)&&m.length&&(null===(u=m[0])||void 0===u?void 0:u.length))||Array.isArray(y)||Array.isArray(w))return;const S=t.stage.table;if(!S)return;const _=rt(m[0])?function(t){return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:t}(m):[m,m,m,m];let A,R,{width:B=l.width,height:M=l.height}=t.attribute;if((null===(g=S.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)?(B=Math.round(B),M=Math.round(M)):(B=Math.ceil(B),M=Math.ceil(M)),1&x){const e="bottom-right"===S.theme.cellBorderClipDirection,r=0,n=0;e?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:s,height:a}=Gw(t,Math.ceil(B+r),Math.ceil(M+n),e);A=s,R=a}else A=Math.ceil(B),R=Math.ceil(M);e.setStrokeStyle(t,t.attribute,i,o,l),e.beginPath(),e.moveTo(i,o),e.lineTo(i+A,o),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(p=_[0])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i+A,o),e.lineTo(i+A,o+R),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(f=_[1])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+R),e.lineTo(i+A,o+R),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(v=_[2])&&void 0!==v?v:[]),e.stroke(),e.beginPath(),e.moveTo(i,o),e.lineTo(i,o+R),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(b=_[3])&&void 0!==b?b:[]),e.stroke(),e.lineDashOffset=0,e.setLineDash([])}};zw=Tw([m()],zw);let Fw=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{lineWidth:g=l.lineWidth,stroke:p=l.stroke,lineDash:f=l.lineDash,strokeArrayWidth:v=l.strokeArrayWidth,strokeArrayColor:b=l.strokeArrayColor,notAdjustPos:m}=t.attribute;!0!==m&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(b)&&!Array.isArray(v)&&1&g&&(u.doStroke=!1)}};Fw=Tw([m()],Fw);let Iw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){var u;const{lineWidth:g=l.lineWidth,stroke:p=l.stroke,lineDash:f=l.lineDash,strokeArrayWidth:v=l.strokeArrayWidth,strokeArrayColor:b=l.strokeArrayColor,notAdjustPos:m,cornerRadius:C=l.cornerRadius}=t.attribute;let{width:y=l.width,height:w=l.height}=t.attribute;if(!0!==m&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(b)&&!Array.isArray(v)&&1&g){const r=t.stage.table;if(!r)return;(null===(u=r.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(y=Math.round(y),w=Math.round(w)),e.beginPath();const n="bottom-right"===(null==r?void 0:r.theme.cellBorderClipDirection),s=0,a=0;n?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:h,height:d}=Gw(t,Math.ceil(y),Math.ceil(w),n);C?Qs(e,i,o,h+s,d+a,C):e.rect(i,o,h,d),e.setStrokeStyle(t,t.attribute,i,o,l),e.stroke()}}};Iw=Tw([m()],Iw);let Ow=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){if("cell"===t.role){const e=t.stage.table;if(e){const i=function(t,e){var i,o,r,n,s,a,l,h,d,c,u;let g,p;if("cell"===t.role&&J(t.mergeStartCol)&&J(t.mergeStartRow)&&J(t.mergeEndCol)&&J(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:r,rowEnd:n}=Py(t,e.scenegraph);for(let t=i;t<=o;t++)for(let i=r;i<=n;i++){const o=Bw(e.stateManager,t,i);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=Bw(e.stateManager,t.col,t.row));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.select)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.select):f.isColumnHeader(t.col,t.row)?p=null===(r=e.theme.headerStyle)||void 0===r?void 0:r.select:f.isRowHeader(t.col,t.row)?p=null===(n=e.theme.rowHeaderStyle)||void 0===n?void 0:n.select:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.select)||(e.isListTable()?null===(a=e.theme.bodyStyle)||void 0===a?void 0:a.select:null===(l=e.theme.headerStyle)||void 0===l?void 0:l.select):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.select)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.select:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.select):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.select),VC(g,p,t.col,t.row,e)}(t,e);if(i)t.attribute._vtableHightLightFill=i;else if(e.stateManager.interactionState!==Sv.scrolling){const i=function(t,e){var i,o,r,n,s,a,l,h,d,c,u;let g,p;if("cell"===t.role&&J(t.mergeStartCol)&&J(t.mergeStartRow)&&J(t.mergeEndCol)&&J(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:r,rowEnd:n}=Py(t,e.scenegraph);for(let s=i;s<=o;s++)for(let i=r;i<=n;i++){const o=Rw(e.stateManager,s,i,t);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=Rw(e.stateManager,t.col,t.row,t));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.hover)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.hover):f.isColumnHeader(t.col,t.row)?p=null===(r=e.theme.headerStyle)||void 0===r?void 0:r.hover:f.isRowHeader(t.col,t.row)?p=null===(n=e.theme.rowHeaderStyle)||void 0===n?void 0:n.hover:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.hover)||(e.isListTable()?null===(a=e.theme.bodyStyle)||void 0===a?void 0:a.hover:null===(l=e.theme.headerStyle)||void 0===l?void 0:l.hover):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.hover)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.hover:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.hover):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.hover),VC(g,p,t.col,t.row,e)}(t,e);i&&(t.attribute._vtableHightLightFill=i)}}}}};Ow=Tw([m()],Ow);let Dw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){if(t.attribute._vtableHightLightFill)if(d);else if(s){const r=t.attribute.fill;t.attribute.fill=t.attribute._vtableHightLightFill,e.setCommonStyle(t,t.attribute,i,o,l),e.fill(),t.attribute.fill=r,t.attribute._vtableHightLightFill=void 0}}};Dw=Tw([m()],Dw);let Ww=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){var g,p,f,v,b,m;const C=t.stage.table;if(C)if("body"===t.role){const i=-(null!==(g=t.attribute.x)&&void 0!==g?g:0)+C.getFrozenColsWidth(),o=-(null!==(p=t.attribute.y)&&void 0!==p?p:0)+C.getFrozenRowsHeight(),r=t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),n=t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,r,n)}else if("row-header"===t.role){const i=0,o=-(null!==(f=t.attribute.y)&&void 0!==f?f:0)+C.getFrozenRowsHeight(),r=C.getFrozenColsWidth(),n=t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,r,n)}else if("col-header"===t.role){const i=-(null!==(v=t.attribute.x)&&void 0!==v?v:0)+C.getFrozenColsWidth(),o=0,r=t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),n=C.getFrozenRowsHeight();e.beginPath(),e.rect(i,o,r,n)}else if("right-frozen"===t.role){const i=0,o=-(null!==(b=t.attribute.y)&&void 0!==b?b:0)+C.getFrozenRowsHeight(),r=C.getRightFrozenColsWidth(),n=t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,r,n)}else if("bottom-frozen"===t.role){const i=-(null!==(m=t.attribute.x)&&void 0!==m?m:0)+C.getFrozenColsWidth(),o=0,r=t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),n=C.getBottomFrozenRowsHeight();e.beginPath(),e.rect(i,o,r,n)}else if("corner-header"===t.role){const t=0,i=0,o=C.getFrozenColsWidth(),r=C.getFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,r)}else if("corner-right-top-header"===t.role){const t=0,i=0,o=C.getRightFrozenColsWidth(),r=C.getFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,r)}else if("corner-right-bottom-header"===t.role){const t=0,i=0,o=C.getRightFrozenColsWidth(),r=C.getBottomFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,r)}else if("corner-left-bottom-header"===t.role){const t=0,i=0,o=C.getFrozenColsWidth(),r=C.getBottomFrozenRowsHeight();e.beginPath(),e.rect(t,i,o,r)}}};Ww=Tw([m()],Ww);let Nw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){t.role}};function Gw(t,e,i,o){const r=t.stage.table;if("cell"===t.role){let n=t.col,s=t.row;const a=lm(r,n,s);a&&(n=a.end.col,s=a.end.row),(r&&n===r.colCount-1&&!o||r&&n===r.frozenColCount-1&&r.scrollLeft&&!o)&&(e-=1),(r&&s===r.rowCount-1&&!o||r&&s===r.frozenRowCount-1&&r.scrollTop&&!o)&&(i-=1)}else"corner-frozen"===t.role&&(r&&r.scrollLeft&&!o&&(e-=1),r&&r.scrollTop&&!o&&(i-=1));return{width:e,height:i}}Nw=Tw([m()],Nw);var jw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Uw=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{stroke:g=l.stroke,strokeArrayWidth:p=l.strokeArrayWidth,strokeArrayColor:f=l.strokeArrayColor}=t.attribute;g&&(Array.isArray(g)||Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};Uw=jw([m()],Uw);let Vw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){const{width:u=l.width,height:g=l.height,stroke:p=l.stroke,strokeArrayColor:f=l.strokeArrayColor,strokeArrayWidth:v=l.strokeArrayWidth,lineWidth:b=l.lineWidth,strokeColor:m=l.stroke,cornerRadius:C=l.cornerRadius}=t.attribute;if(p&&(Array.isArray(v)||0!==b)&&(Array.isArray(p)||Array.isArray(f)||Array.isArray(v))){const r=0,n=0;"border-rect"!==t.name&&"table-border-rect"!==t.name&&("number"==typeof b&&1&b||Array.isArray(v)&&v.some((t=>1&t)))&&(i=Math.floor(i)+.5,o=Math.floor(o)+.5),0===C||rt(C)&&C.every((t=>0===t))?Hw(t,e,i,o,l,p,v||b,f||m,Math.ceil(u+r),Math.ceil(g+n)):(e.beginPath(),Qs(e,i,o,u,g,C,new Array(4).fill(0).map(((s,a)=>(s,h,d,c)=>{Xw(a,s,h,d,c,t,e,i,o,l,p,v||b,f||m,Math.ceil(u+r),Math.ceil(g+n))}))),e.stroke())}}};function Xw(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f,v,b,m;const C=n,y=h,w=Lw(c),x=!Array.isArray(c),S=!Array.isArray(d),_=Array.isArray(u)||w.isSplitDraw;s.setStrokeStyle(n,n.attribute,a,l,h);const{lineDash:A=y.lineDash}=C.attribute;let R=!1;A.length&&A.some((t=>Array.isArray(t)))&&(R=!0),s.moveTo(a,l);const B=(S||d[0])&&(x||c[0]),M=(S||d[1])&&(x||c[1]),T=(S||d[2])&&(x||c[2]),P=(S||d[3])&&(x||c[3]);B&&0===t?(x?w.width:c[0],x?w.width:c[0],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[0]?s.strokeStyle=u[0]:s.strokeStyle="transparent",x||(s.lineWidth=c[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash(null!==(f=A[0])&&void 0!==f?f:[]),s.stroke(),s.beginPath())):0===t&&s.moveTo(a+g,l),M&&1===t?(x?w.width:c[1],x?w.width:c[1],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[1]?s.strokeStyle=u[1]:s.strokeStyle="transparent",x||(s.lineWidth=c[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash(null!==(v=A[1])&&void 0!==v?v:[]),s.stroke(),s.beginPath(),s.moveTo(a+g,l+p))):1===t&&s.moveTo(a+g,l+p),T&&2===t?(x?w.width:c[2],x?w.width:c[2],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[2]?s.strokeStyle=u[2]:s.strokeStyle="transparent",x||(s.lineWidth=c[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash(null!==(b=A[2])&&void 0!==b?b:[]),s.stroke(),s.beginPath(),s.moveTo(a,l+p))):2===t&&s.moveTo(a,l+p),P&&3===t?(x?w.width:c[3],x?w.width:c[3],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[3]?s.strokeStyle=u[3]:s.strokeStyle="transparent",x||(s.lineWidth=c[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash(null!==(m=A[3])&&void 0!==m?m:[]),s.stroke(),s.beginPath(),s.moveTo(a,l))):3===t&&s.moveTo(a,l),_||R||(!x&&w.width&&(s.lineWidth=w.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}Vw=jw([m()],Vw);var Yw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let $w,Kw=class{constructor(){this.order=1,this.interceptors=[new qw]}afterDrawItem(t,e,i,o,r){for(let n=0;n<this.interceptors.length;n++)if(this.interceptors[n].afterDrawItem&&this.interceptors[n].afterDrawItem(t,e,i,o,r))return!0;return!1}beforeDrawItem(t,e,i,o,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let n=0;n<this.interceptors.length;n++)if(this.interceptors[n].beforeDrawItem&&this.interceptors[n].beforeDrawItem(t,e,i,o,r))return!0;return!1}};Kw=Yw([m()],Kw);class qw{constructor(){this.order=1}afterDrawItem(t,e,i,o,r){return"image"===t.type&&this.drawItem(t,e,i,o,r),!1}drawItem(t,e,i,o,r){const{image:n}=t.attribute;if(!n||!t.resources)return!1;if("loading"!==t.resources.get(n).state)return!1;if(!$w){const t=GC(),e=t.loading_pic.svg,i=t.loading_pic.width,o=t.loading_pic.height;$w=ud({width:i,height:o,image:e})}const{image:s}=$w.attribute;if(!n||!$w.resources)return!1;const a=$w.resources.get(s);if("success"!==a.state)return!1;const{context:l}=i;l.highPerformanceSave(),t.parent&&l.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&l.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const h=t.AABBBounds,{width:d,height:c}=UC(a.data.width,a.data.height,h.width(),h.height());return l.drawImage(a.data,h.x1+(h.width()-d)/2,h.y1+(h.height()-c)/2,d,c),l.highPerformanceRestore(),!0}}var Zw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Jw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){var g,p;const{text:f,underline:v=l.underline,lineThrough:b=l.lineThrough,direction:m=l.direction,whiteSpace:C=l.whiteSpace,fontSize:y=l.fontSize,verticalMode:w=l.verticalMode,ellipsis:x=l.ellipsis,textAlign:S=l.textAlign,textBaseline:_=l.textBaseline,x:A=l.x,y:R=l.y}=t.attribute;let B=!1;if(Array.isArray(t)){const e=null===(g=t.cache)||void 0===g?void 0:g.layoutData;x&&e&&e.lines.every((t=>""===t.str))&&(B=!0)}else{const{cache:e}=t;x&&e&&""===e.clipedText&&0===e.clipedWidth&&(B=!0)}if(!B)return;const M=ot(x)?x:"...",T=null!==(p=Hr(t.attribute.lineHeight,y))&&void 0!==p?p:y;let P=0;T!==y&&("top"===_?P=(T-y)/2:"middle"===_||"bottom"===_&&(P=-(T-y)/2)),n&&(c?c(e,t.attribute,l):a&&(e.setStrokeStyle(t,t.attribute,A-i,R-o,l),e.strokeText(M,A,R+P))),r&&(d?d(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,A-i,R-o,l),e.fillText(M,A,R+P),this.drawUnderLine(v,b,t,A,R+P,0,l,e,M)))}drawUnderLine(t,e,i,o,r,n,s,a,l){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fontFamily:u=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:p=s.fontStyle,fill:f=s.fill,opacity:v=s.opacity,underlineOffset:b=s.underlineOffset,underlineDash:m=s.underlineDash,fillOpacity:C=s.fillOpacity}=i.attribute;if(!t&&!e)return;const y=Cy.measureTextWidth(l,{fontSize:c,fontFamily:u,fontWeight:g,fontStyle:p}),w=vs(h,y),x=bs(d,c,c),S={lineWidth:0,stroke:f,opacity:v,strokeOpacity:C};if(t){S.lineWidth=t,a.setStrokeStyle(i,S,o,r,s),a.setLineDash(m),a.beginPath();const e=r+x+c+b;a.moveTo(o+w,e,n),a.lineTo(o+w+y,e,n),a.stroke()}if(e){S.lineWidth=e,a.setStrokeStyle(i,S,o,r,s),a.beginPath();const t=r+x+c/2;a.moveTo(o+w,t,n),a.lineTo(o+w+y,t,n),a.stroke()}}};Jw=Zw([m()],Jw);var Qw=new n(((t,e,i,o)=>{i(ia)?o(ia).to(Uw).inSingletonScope():(t(Uw).toSelf().inSingletonScope(),t(us).toService(Uw)),i(oa)?o(oa).to(Vw).inSingletonScope():(t(Vw).toSelf().inSingletonScope(),t(us).toService(Vw)),t(xw).toSelf().inSingletonScope(),t(ww).to(xw),t(ll).to(xw),t(_w).toSelf().inSingletonScope(),t(cs).toService(_w),t(Aw).toSelf().inSingletonScope(),t(cs).toService(Aw),t(Ow).toSelf().inSingletonScope(),t(ds).toService(Ow),t(Dw).toSelf().inSingletonScope(),t(ds).toService(Dw),t(kw).toSelf().inSingletonScope(),t(ds).toService(kw),t(Pw).toSelf().inSingletonScope(),t(ds).toService(Pw),t(Ew).toSelf().inSingletonScope(),t(ds).toService(Ew),t(zw).toSelf().inSingletonScope(),t(ds).toService(zw),t(Fw).toSelf().inSingletonScope(),t(ds).toService(Fw),t(Iw).toSelf().inSingletonScope(),t(ds).toService(Iw),t(Ww).toSelf().inSingletonScope(),t(ds).toService(Ww),t(Nw).toSelf().inSingletonScope(),t(ds).toService(Nw),t(Kw).toSelf().inSingletonScope(),t(yl).toService(Kw),t(Jw).toSelf().inSingletonScope(),t(ps).toService(Jw)}));function tx(t,e,i,o){var r,n,s,a,l,h,d,c;"undefined"!=typeof window&&window.performance.now(),e=null!=e?e:0,i=null!=i?i:t.colCount-1,0===e&&i===t.colCount-1&&t._clearColRangeWidthsMap();const u=t.internalProps.layoutMap;t.isPivotTable()&&(u.enableUseGetBodyCache(),u.enableUseHeaderPathCache());const g=[],p=[];if(o)for(let e=0;e<t.colCount;e++)g[e]=t.getColWidth(e);for(let l=e;l<=i;l++){let e;if(t.internalProps.transpose||"only-header"!==(null===(n=null===(r=t.internalProps.layoutMap.columnObjects)||void 0===r?void 0:r[l])||void 0===n?void 0:n.columnWidthComputeMode)&&"only-header"!==t.columnWidthComputeMode||!("showHeader"in t.internalProps.layoutMap))e=t.internalProps.transpose||"only-body"!==(null===(a=null===(s=t.internalProps.layoutMap.columnObjects)||void 0===s?void 0:s[l])||void 0===a?void 0:a.columnWidthComputeMode)&&"only-body"!==t.columnWidthComputeMode?ex(l,0,t.rowCount-1,t):ex(l,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t);else{const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,e=ex(l,0,t.internalProps.layoutMap.headerLevelCount-1,t),t.internalProps.layoutMap.showHeader=i}t._setColContentWidth(l,e),t.getColWidth(l)!==e&&t._clearColRangeWidthsMap(l),o?p[l]=Math.round(t._adjustColWidth(l,e)):t._setColWidth(l,t._adjustColWidth(l,e),!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,r=0,n=t.colCount;if("only-body"===t.widthAdaptiveMode){for(let e=0;e<t.colCount;e++){const r=o&&null!==(l=p[e])&&void 0!==l?l:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r)}r=t.rowHeaderLevelCount,n=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount}sx(e-i,r,n,o,p,t)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,r=0;for(let e=0;e<t.colCount;e++){const n=o&&null!==(h=p[e])&&void 0!==h?h:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n),r+=n}r<e&&r>i&&sx(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,o,p,t)}if(o){for(let e=0;e<t.colCount;e++){const i=null!==(c=null!==(d=p[e])&&void 0!==d?d:t.getColWidth(e))&&void 0!==c?c:t.getColWidth(e);i!==g[e]&&t._setColWidth(e,i,!1,!0)}t.stateManager.checkFrozen();for(let e=0;e<t.colCount;e++){const i=t.getColWidth(e);i!==g[e]&&t.scenegraph.updateColWidth(e,i-g[e],!0,!0)}t.scenegraph.updateContainer(!0)}t.isPivotTable()&&(u.disableUseGetBodyCache(),u.disableUseHeaderPathCache())}function ex(t,e,i,o){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=function(t,e){const i=e.getColWidthDefined(t);return e.internalProps._widthResizedColMap.has(t)?e.getColWidth(t):i}(t,o);return o.internalProps.transpose&&"auto"===n&&("only-header"===o.columnWidthComputeMode&&t>=o.rowHeaderLevelCount||"only-body"===o.columnWidthComputeMode&&t<o.rowHeaderLevelCount)&&(n=o.getDefaultColumnWidth(t)),r&&!o.internalProps.transpose?ix(n,t,e,i,r,o):"number"==typeof n?n:"auto"!==n&&"string"==typeof n?o._adjustColWidth(t,o._colWidthDefineToPxWidth(n)):ix(n,t,e,i,r,o)}function ix(t,e,i,o,r,n){var s,a,l,h,d;let c=0,u=1,g=1;if(o-i>5e3&&(g=Math.ceil((o-i)/5e3)),n.isPivotChart()&&e>=n.rowHeaderLevelCount&&e<n.colCount-n.rightFrozenColCount){if(n.internalProps.layoutMap.indicatorsAsCol)return n.defaultColWidth;{const t=n.internalProps.layoutMap.getOptimunWidthForChart(e);if(t>0)return t}}for(let p=i;p<=o;p+=u){if(n.isPivotChart()){const t=n.internalProps.layoutMap,i=t.getAxisConfigInPivotChart(e,p);if(i){const t=hm.getFunction("computeAxisComponentWidth")(i,n);if("number"==typeof t){c=Math.max(t,c);continue}}else if(t.isLeftBottomCorner(e,p)||t.isRightTopCorner(e,p)||t.isRightBottomCorner(e,p))continue}const i=ox(e,p,n);if(i&&(c=Math.max(i.width,c),!i.renderDefault))continue;const o=t;if("number"==typeof o&&"standard"===n.widthMode&&!r){c=Math.max(o,c);continue}const f=n.isHeader(e,p)?null===(s=n._getHeaderLayoutMap(e,p))||void 0===s?void 0:s.headerType:n.getBodyColumnType(e,p);if(J(f)&&"text"!==f&&"link"!==f&&"progressbar"!==f&&"checkbox"!==f&&"radio"!==f){c=Math.max(c,n.getColWidthDefinedNumber(e)||0);continue}let v=0;const b=n.internalProps.layoutMap;if(b.isHeader(e,p)){const t=b.getHeader(e,p);if("only-body"===(null===(a=null==t?void 0:t.define)||void 0===a?void 0:a.columnWidthComputeMode))continue;J(null==t?void 0:t.hierarchyLevel)&&(v=(null!==(l=t.hierarchyLevel)&&void 0!==l?l:0)*(null!==(h=b.rowHierarchyIndent)&&void 0!==h?h:0),b.rowHierarchyTextStartAlignment&&!n.internalProps.headerHelper.getHierarchyIcon(e,p)&&(v+=n.internalProps.headerHelper.getHierarchyIconWidth()))}else if(n.isListTable()){u=g;const t=n.getBodyColumnDefine(e,p);if(null==t?void 0:t.tree){const t=n.dataSource.getIndexKey(n.getRecordShowIndexByCell(e,p));v=Array.isArray(t)&&n.getHierarchyState(e,p)!==Rv.none?(t.length-1)*(null!==(d=b.hierarchyIndent)&&void 0!==d?d:0):0,b.hierarchyTextStartAlignment&&!n.internalProps.bodyHelper.getHierarchyIcon(e,p)&&(v+=n.internalProps.headerHelper.getHierarchyIconWidth())}}const m=rx(e,p,f,n);c=Math.max(m+v,c),u>1&&n.bottomFrozenRowCount>0&&p<n.rowCount-n.bottomFrozenRowCount&&p+u>=n.rowCount-n.bottomFrozenRowCount&&(p=n.rowCount-n.bottomFrozenRowCount-u,u=1,g=1)}const p=n.getMinColWidth(e),f=n.getMaxColWidth(e);return c<p?p:c>f?f:(c<=0&&(c=n.defaultColWidth),c)}function ox(t,e,i){var o,r,n,s;const a=i.getCustomRender(t,e),l=i.getCustomLayout(t,e);if(a||l){let h=1,d=0,c=!1,u=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);h=o.end.col-o.start.col+1}const g={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:nx(t,e,i),table:i};if(q(l)){const t=l(g);if(t.rootContainer){t.rootContainer=FC(t.rootContainer),zC(t.rootContainer,0,i.getRowHeight(e));const o=t.rootContainer.attribute.width;t.rootContainer.setStage(i.scenegraph.stage),d=o>0?o:null!==(r=t.rootContainer.AABBBounds.width())&&void 0!==r?r:0,c=t.renderDefault,u=t.enableCellPadding}else d=0,c=t.renderDefault,u=t.enableCellPadding}else if("function"==typeof a){const t=a(g);d=null!==(n=null==t?void 0:t.expectedWidth)&&void 0!==n?n:0,c=null==t?void 0:t.renderDefault}else d=null!==(s=null==a?void 0:a.expectedWidth)&&void 0!==s?s:0,c=null==a?void 0:a.renderDefault;if(d=Math.ceil(d),u){const o=Dm(VC("padding",i._getCellStyle(t,e),t,e,i));d+=o[1]+o[3]}return{width:d/h,renderDefault:c}}}function rx(t,e,i,o){var r,n,s;let a=0;const l=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=!1;if("body"!==o.getCellLocation(t,e))c=!0;else{const i=o.getBodyColumnDefine(t,e);c=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(c){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o;t.positionType!==Tv.absoluteRight&&(d+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0))}))}let u=1;if(o.isHeader(t,e)||(null===(r=o.getBodyColumnDefine(t,e))||void 0===r?void 0:r.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);u=i.end.col-i.start.col+1}const g=Dm(VC("padding",h,t,e,o)),p=g[1]+g[3],f=VC("fontSize",h,t,e,o),v=VC("fontFamily",h,t,e,o),b=VC("fontWeight",h,t,e,o);let m;if("checkbox"===i)m=Q(l)?l.text:l;else if("radio"===i)if(rt(l)){m="";const i=o.getBodyColumnDefine(t,e),r=null!==(n=null==i?void 0:i.radioDirectionInCell)&&void 0!==n?n:"vertical";"vertical"===r?l.forEach((t=>{m+=(Q(t)?t.text:t).toString()+"\n"})):"horizontal"===r&&l.forEach((t=>{m+=(Q(t)?t.text:t).toString()}))}else m=Q(l)?l.text:l;else m=l;const C=KC(m,o).text;if(C.length>=1&&(1!==C.length||""!==C[0])?C.forEach((t=>{const e=o.measureText(t,{fontSize:f,fontFamily:v,fontWeight:b}).width;a=Math.max((e+p+4+d)/u,a)})):a=Math.max((p+4+d)/u,a),!1!==o.internalProps.limitMaxAutoWidth&&(a=Math.min("number"==typeof o.internalProps.limitMaxAutoWidth?o.internalProps.limitMaxAutoWidth:450,a)),"checkbox"===i){const i=VC("size",h,t,e,o);if(a+=i,m){const i=VC("spaceBetweenTextAndIcon",h,t,e,o);a+=i}}else if("radio"===i){const i=VC("size",h,t,e,o),r=VC("outerRadius",h,t,e,o),n=at(r)?2*r:i,d=VC("spaceBetweenTextAndIcon",h,t,e,o);if(rt(l)){const i=o.getBodyColumnDefine(t,e),r=VC("spaceBetweenRadio",h,t,e,o),c=null!==(s=null==i?void 0:i.radioDirectionInCell)&&void 0!==s?s:"vertical";"vertical"===c?(a+=n,a+=d):"horizontal"===c&&(a+=(n+d)*l.length,a+=r*(l.length-1))}else a+=n,m&&(a+=d)}return a}function nx(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:null,height:null}}function sx(t,e,i,o,r,n,s){var a,l,h,d;let c=0;const u=[],g=[];let p=0;for(let s=e;s<i;s++){const e=o&&null!==(a=r[s])&&void 0!==a?a:n.getColWidth(s),i=n.getMaxColWidth(s),h=n.getMinColWidth(s);e!==i&&e!==h?(c+=e,u.push(s)):t-=e,(null===(l=n.options.customConfig)||void 0===l?void 0:l.shrinkSparklineFirst)&&"sparkline"===n.getBodyColumnType(s,0)&&(g.push({col:s,width:e}),p+=e-n.defaultColWidth)}const f=t/c;if((null===(h=n.options.customConfig)||void 0===h?void 0:h.shrinkSparklineFirst)&&f<1&&c-t<p)for(let e=0;e<g.length;e++){const{col:i,width:a}=g[e],l=(c-t)/g.length,h=Math.floor(a-l);o?r[i]=n._adjustColWidth(i,h):s?n.scenegraph.setColWidth(i,n._adjustColWidth(i,h)):n._setColWidth(i,n._adjustColWidth(i,h),!1,!0)}else for(let e=0;e<u.length;e++){const i=u[e];let a;a=e===u.length-1?t-u.reduce(((t,e,s)=>{var a;return e!==i?t+(o?null!==(a=r[e])&&void 0!==a?a:n.getColWidth(i):n.getColWidth(e)):t}),0):Math.round((o&&null!==(d=r[i])&&void 0!==d?d:n.getColWidth(i))*f),o?r[i]=n._adjustColWidth(i,a):s?n.scenegraph.setColWidth(i,n._adjustColWidth(i,a)):n._setColWidth(i,n._adjustColWidth(i,a),!1,!0)}}const ax=new jC({});function lx(t,e,i,o,r,n,s,a,l,h){let d,c,u,g=0;t.lastChild&&t.lastChild.row===o-1?g=t.lastChild.attribute.y+t.lastChild.attribute.height:t.colHeight&&(g=t.colHeight);for(let p=o;p<=r;p++){const r=p;let f,v,b,m,C=a.getCellValue(e,r),y=i,w=a.getRowHeight(r);if(a.internalProps.customMergeCell){const t=a.getCustomMerge(e,r);if(t){const{range:e,text:i,style:s,customLayout:l,customRender:h}=t;if(f=e,v=f.start.col!==f.end.col||f.start.row!==f.end.row,v){const t=hx(f,n,a,o>f.start.row);y=t.cellWidth,w=t.cellHeight}C=i,b=s,(l||h)&&(m=HC(l,h,e.start.col,e.start.row,a.getColsWidth(e.start.col,e.end.col),a.getRowsHeight(e.start.row,e.end.row),!1,a.isAutoRowHeight(r),[0,0,0,0],f,a))}}let x=e,S=r;f&&(x=f.start.col,S=f.start.row),("columnHeader"===l||"cornerHeader"===l)&&r>=a.columnHeaderLevelCount&&(l="body");const _="body"!==l?a.getHeaderDefine(x,S):a.getBodyColumnDefine(x,S);let A="body"!==l||(null==_?void 0:_.dragOrder)||!!(null==_?void 0:_.icon)||!!(null==_?void 0:_.tree);if(!f&&(a.internalProps.enableTreeNodeMerge||"body"!==l||(null==_?void 0:_.mergeCell))&&(f=a.getCellRange(e,r),v=f.start.col!==f.end.col||f.start.row!==f.end.row,v)){const t=hx(f,n,a,o>f.start.row);y=t.cellWidth,w=t.cellHeight}let R=!1;if(a.internalProps.enableTreeNodeMerge&&v){const{vtableMergeName:t,vtableMerge:e}=a.getCellRawRecord(f.start.col,f.start.row);R=e,e&&(A=!0,a.options.groupTitleCustomLayout&&(m=HC(a.options.groupTitleCustomLayout,void 0,f.start.col,f.start.row,a.getColsWidth(f.start.col,f.end.col),a.getRowsHeight(f.start.row,f.end.row),!1,a.isAutoRowHeight(r),[0,0,0,0],f,a))),t&&(C=t)}const B=wC(b||a._getCellStyle(f?f.start.col:e,f?f.start.row:r),a,f?f.start.col:e,f?f.start.row:r,VC).theme;B.group.cornerRadius=xC(e,r,a),B.group.width=i,B.group.height=Array.isArray(s)?s[r]:s,B._vtable.padding&&(d=B._vtable.padding),B.text.textAlign&&(c=B.text.textAlign),B.text.textBaseline&&(u=B.text.textBaseline),"body"===l||B.group.fill||(B.group.fill="#fff");const M=R?"text":(a.isHeader(e,r)?a._getHeaderLayoutMap(e,r).headerType:a.getBodyColumnType(e,r))||"text";if(Cb(C)){dx(e,r,0,g,y,w,t),oy(C,a,ry.bind(null,M,C,_,a,e,r,i,y,w,t,g,d,c,u,A,B,f,m)),t.updateColumnRowNumber(r);const o=a.getRowHeight(r);t.updateColumnHeight(o),g+=o}else{const o=ry(M,C,_,a,e,r,i,y,w,t,g,d,c,u,A,B,f,m);if(t.updateColumnRowNumber(r),v){const i=a.getRowHeight(r),{width:n}=(a.getColWidth(e),o.attribute),{height:s}=o.attribute;o.contentWidth=n,o.contentHeight=s,ay(f,n,s,d,c,u,a),t.updateColumnHeight(i),g+=i}else t.updateColumnHeight(w),g+=w}if(h&&r>h)break}return t.setAttribute("width",i),{width:i,height:g}}function hx(t,e,i,o){let r=0,n=0;const s=e.get(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`);if(!s||o){for(let e=t.start.col;e<=t.end.col;e++)r+=i.getColWidth(e);for(let e=t.start.row;e<=t.end.row;e++)n+=i.getRowHeight(e);e.set(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`,{cellWidth:r,cellHeight:n})}else r=s.cellWidth,n=s.cellHeight;return{cellWidth:r,cellHeight:n}}function dx(t,e,i,o,r,n,s){const a=new jC({x:i,y:o,width:r,height:n});a.role="cell",a.col=t,a.row=e,s.addChild(a)}function cx(t,e,i,o,r,n,s,a,l,h){if(o>r||n>s)return;const{layoutMap:d,defaultRowHeight:c,defaultHeaderRowHeight:u,defaultColWidth:g}=l.internalProps;let p=0,f=0;for(let d=o;d<=r;d++){const o=d,r=l.getColWidth(o),g=new jC({x:e+p,y:i,width:r,height:0,clip:!1,pickable:!1});g.role="column",g.col=d,t.addChild(g);const{width:v,height:b}=lx(g,o,r,n,s,l.scenegraph.mergeMap,"columnHeader"===a&&at(u)?u:c,l,a,h);p+=v,f=Math.max(f,b)}t.setAttribute("width",p),t.setAttribute("height",f)}function ux(t){let e=t.firstChild;for(;"group"!==e.type;)e=e._next;return e}function gx(t){let e=t.lastChild;for(;"group"!==e.type;)e=e._prev;return e}function px(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left";for(let r=t;r<=e;r++){const t=i.scenegraph.getColGroup(r);t&&fx(t,i,o);const e=i.scenegraph.getColGroup(r,!0);e&&fx(e,i,o);const n=i.scenegraph.getColGroupInBottom(r);n&&fx(n,i,o)}const r=Math.min(i.scenegraph.proxy.colLimit,i.scenegraph.proxy.bodyRightCol-i.scenegraph.proxy.bodyLeftCol+1),n=i.getColsWidth(i.frozenColCount,i.frozenColCount+r),s=i.getColsWidth(i.frozenColCount,i.colCount-1);i.scenegraph.proxy.xLimitLeft=n/2,i.scenegraph.proxy.xLimitRight=s-n/2}function fx(t,e){if("left"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left")){let i;const o=function(t){let e=t._prev;for(;e&&"group"!==e.type;)e=e._prev;return e}(t);i=o?o.attribute.x+e.getColWidth(t._prev.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}else{let i;const o=function(t){let e=t._next;for(;e&&"group"!==e.type;)e=e._next;return e}(t);i=o?o.attribute.x-e.getColWidth(t.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}}ax.role="empty";var vx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};function bx(t,e,i,o){return vx(this,void 0,void 0,(function*(){if(!e)return;const r=e.col,n=e.left;let s;if(s=i?o.bodyRightCol-o.colEnd:o.screenLeftCol-o.referenceCol,function(t,e,i,o,r){t>0?(mx(t,"left",r.screenLeftCol,i,o,r),r.updateDeltaX(o,i,e),r.table.scenegraph.setBodyAndColHeaderX(-o+r.deltaX)):t<0?(mx(-t,"right",r.screenLeftCol,i,o,r),r.updateDeltaX(o,i,e),r.table.scenegraph.setBodyAndColHeaderX(-o+r.deltaX)):(r.updateDeltaX(o,i,e),r.table.scenegraph.setBodyAndColHeaderX(-o+r.deltaX))}(s,r,n,t,o),i){const e=o.table.scenegraph.getColGroup(o.colEnd);if(e){const i=e.attribute.x+e.attribute.width-(o.table.tableNoFrameWidth-o.table.getFrozenColsWidth()-o.table.getRightFrozenColsWidth())-t;o.deltaX=-i,o.table.scenegraph.setBodyAndColHeaderX(-t+o.deltaX)}}o.table.scenegraph.updateNextFrame()}))}function mx(t,e,i,o,r,n){return vx(this,void 0,void 0,(function*(){if("left"===e&&n.colEnd+t>n.bodyRightCol?t=n.bodyRightCol-n.colEnd:"right"===e&&n.colStart-t<n.bodyLeftCol&&(t=n.colStart-n.bodyLeftCol),0!==t)if(t<0&&(e="left"===e?"right":"left",t=-t),t<n.colEnd-n.colStart){const r="left"===e?n.colStart:n.colEnd-t+1,s="left"===e?n.colStart+t-1:n.colEnd,a="left"===e?n.colEnd+1:n.colStart-t,l="left"===e?n.colEnd+t:n.colStart-1;tx(n.table,a,l),function(t,e,i,o){for(let r=t;r<=e;r++)o.table.scenegraph.bodyGroup.childrenCount>0&&"group"===o.table.scenegraph.bodyGroup.firstChild.type&&xx(o.table.scenegraph.bodyGroup,i,o),o.table.scenegraph.colHeaderGroup.childrenCount>0&&"group"===o.table.scenegraph.colHeaderGroup.firstChild.type&&xx(o.table.scenegraph.colHeaderGroup,i,o),o.table.scenegraph.bottomFrozenGroup.childrenCount>0&&"group"===o.table.scenegraph.bottomFrozenGroup.firstChild.type&&xx(o.table.scenegraph.bottomFrozenGroup,i,o)}(r,s,e,n);const h=a,d=l;n.colStart="left"===e?n.colStart+t:n.colStart-t,n.colEnd="left"===e?n.colEnd+t:n.colEnd-t,Sx(h,d,n),px(h,d,n.table,e);const c=n.table.scenegraph.getColGroup(i)||n.table.scenegraph.getColGroup(i,!0),u=o-(c.attribute.x+n.table.getFrozenColsWidth()+n.table.scenegraph.proxy.deltaX);n.table.scenegraph.proxy.deltaX+=u,n.currentCol="left"===e?n.currentCol+t:n.currentCol-t,n.totalCol=Math.max(0,Math.min(n.table.colCount-1,"left"===e?n.totalCol+t:n.totalCol-t)),n.referenceCol=n.colStart+Math.floor((n.colEnd-n.colStart)/2),n.colUpdatePos=a,n.colUpdateDirection=e,n.table.scenegraph.updateNextFrame()}else{const i="left"===e?n.colStart+t:n.colStart-t,o="left"===e?n.colEnd+t:n.colEnd-t;tx(n.table,i,o),function(t,e,i,o){o.table.scenegraph.colHeaderGroup.forEachChildren(((r,n)=>{"group"===r.type&&Cx(r,"left"===i?r.col+e:r.col-e,0===n?t:r._prev.attribute.x+o.table.getColWidth(r._prev.col))})),o.table.scenegraph.bottomFrozenGroup.forEachChildren(((r,n)=>{"group"===r.type&&Cx(r,"left"===i?r.col+e:r.col-e,0===n?t:r._prev.attribute.x+o.table.getColWidth(r._prev.col))})),o.table.scenegraph.bodyGroup.forEachChildren(((r,n)=>{"group"===r.type&&Cx(r,"left"===i?r.col+e:r.col-e,0===n?t:r._prev.attribute.x+o.table.getColWidth(r._prev.col))}))}(n.table.getColsWidth(n.bodyLeftCol,i-1),t,e,n);const r=i,s=o;n.colStart=i,n.colEnd=o,Sx(r,s,n),px(r,s,n.table,o>n.bodyRightCol-(n.colEnd-n.colStart+1)?"right":"left"),n.currentCol="left"===e?n.currentCol+t:n.currentCol-t,n.totalCol=Math.max(0,Math.min(n.table.colCount-1,"left"===e?n.totalCol+t:n.totalCol-t)),n.referenceCol=n.colStart+Math.floor((n.colEnd-n.colStart)/2),n.colUpdatePos=n.colStart,n.colUpdateDirection=o>n.bodyRightCol-(n.colEnd-n.colStart+1)?"right":"left",n.table.scenegraph.updateNextFrame()}}))}function Cx(t,e,i){t.col=e,t.forEachChildren((t=>{t.col=e,t.needUpdate=!0})),t.setAttribute("x",i),t.needUpdate=!0}function yx(t,e){if(!t)return;let i=t.firstChild;for(;i;)i=e.updateCellGroupContent(i)._next;t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function wx(t,e){if(!t)return;const i=e.screenTopRow,o=Math.max(e.bodyTopRow,i-1*e.screenRowCount),r=Math.min(e.bodyBottomRow,i+2*e.screenRowCount);for(let i=o;i<=r;i++){const o=e.highPerformanceGetCell(t.col,i,!0);e.updateCellGroupContent(o)}e.rowUpdatePos=e.rowStart,t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function xx(t,e,i){if("left"===e){const e=ux(t),o=gx(t);Cx(e,o.col+1,o.attribute.x+i.table.getColWidth(o.col)),t.appendChild(e),t.border&&t.appendChild(t.border)}else{const e=gx(t),o=ux(t);Cx(e,o.col-1,o.attribute.x-i.table.getColWidth(o.col-1)),t.insertBefore(e,t.firstChild)}}function Sx(t,e,i){for(let o=t;o<=e;o++){const t=i.table.scenegraph.getColGroup(o,!0);t&&yx(t,i);const e=i.table.scenegraph.getColGroupInBottom(o);e&&yx(e,i);const r=i.table.scenegraph.getColGroupInRightTopCorner(o);r&&yx(r,i);const n=i.table.scenegraph.getColGroupInRightBottomCorner(o);n&&yx(n,i);const s=i.table.scenegraph.getColGroup(o);s&&wx(s,i)}i.progress()}function _x(t,e,i,o,r){let n=arguments.length>6?arguments[6]:void 0;var s,a;if("up"===(arguments.length>5&&void 0!==arguments[5]?arguments[5]:"up"))for(let a=t;a<=e;a++)for(let t=i;t<=o;t++){const e=r.scenegraph.highPerformanceGetCell(a,t,!0);if("cell"!==e.role||!e.row)continue;let i;if(e._prev)i=(null===(s=e._prev)||void 0===s?void 0:s.attribute.y)+r.getRowHeight(e._prev.row);else if(n){if(i=r.scenegraph.highPerformanceGetCell(a,o+1,!0).attribute.y,J(i))for(let e=t;e<=o;e++)i-=r.getRowHeight(e)}else i=r.getRowsHeight(r.frozenRowCount,e.row-1);J(i)&&e.setAttribute("y",i)}else for(let s=t;s<=e;s++)for(let t=o;t>=i;t--){const e=r.scenegraph.highPerformanceGetCell(s,t,!0);if("cell"!==e.role||!e.row)continue;let o;if(e._next)o=(null===(a=e._next)||void 0===a?void 0:a.attribute.y)-r.getRowHeight(e.row);else if(n){o=r.scenegraph.highPerformanceGetCell(s,i-1,!0).attribute.y;for(let e=i-1;e<t;e++)o+=r.getRowHeight(e)}else o=r.getRowsHeight(r.frozenRowCount,e.row-1);J(o)&&e.setAttribute("y",o)}const l=Math.min(r.scenegraph.proxy.rowLimit,r.scenegraph.proxy.bodyBottomRow-r.scenegraph.proxy.bodyTopRow+1),h=r.getRowsHeight(r.frozenRowCount,r.frozenRowCount+l),d=r.getRowsHeight(r.frozenRowCount,r.rowCount-1);r.scenegraph.proxy.yLimitTop=h/2,r.scenegraph.proxy.yLimitBottom=d-h/2}var Ax=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};function Rx(t,e,i,o){return Ax(this,void 0,void 0,(function*(){if(!e)return;const r=e.row,n=e.top;let s;if(s=i?o.bodyBottomRow-o.rowEnd:r-o.referenceRow,function(t,e,i,o,r){t>0?(Bx(t,"up",e,i,o,r),r.updateDeltaY(o,i,e),r.updateBody(o-r.deltaY)):t<0?(Bx(-t,"down",e,i,o,r),r.updateDeltaY(o,i,e),r.updateBody(o-r.deltaY)):(r.updateDeltaY(o,i,e),r.updateBody(o-r.deltaY))}(s,r,n,t,o),i){const e=o.table.scenegraph.highPerformanceGetCell(o.colStart,o.rowEnd,!0);if("cell"===e.role){const i=e.attribute.y+e.attribute.height-(o.table.tableNoFrameHeight-o.table.getFrozenRowsHeight()-o.table.getBottomFrozenRowsHeight())-t;o.deltaY=-i,o.updateBody(t-o.deltaY)}}}))}function Bx(t,e,i,o,r,n){return Ax(this,void 0,void 0,(function*(){if("up"===e&&n.rowEnd+t>n.bodyBottomRow?t=n.bodyBottomRow-n.rowEnd:"down"===e&&n.rowStart-t<n.bodyTopRow&&(t=n.rowStart-n.bodyTopRow),0!==t)if(t<0&&(e="up"===e?"down":"up",t=-t),t<n.rowEnd-n.rowStart){const o="up"===e?n.rowStart:n.rowEnd-t+1,r="up"===e?n.rowStart+t-1:n.rowEnd,s="up"===e?n.rowEnd+1:n.rowStart-t,a="up"===e?n.rowEnd+t:n.rowStart-1;let l,h;"autoHeight"===n.table.heightMode?(l=s,h=a):(l=Math.max(n.bodyTopRow,i-1*n.screenRowCount),h=Math.min(n.bodyBottomRow,i+2*n.screenRowCount)),Sy(n.table,l,h,!1),function(t,e,i,o){for(let r=0;r<o.table.frozenColCount;r++){const n=o.table.scenegraph.getColGroup(r);if(n)for(let r=t;r<=e;r++)Mx(n,i,o)}for(let r=o.table.colCount-o.table.rightFrozenColCount;r<o.table.colCount;r++){const n=o.table.scenegraph.getColGroup(r);if(n)for(let r=t;r<=e;r++)Mx(n,i,o)}for(let r=o.bodyLeftCol;r<=o.bodyRightCol;r++){const n=o.table.scenegraph.getColGroup(r);if(n)for(let r=t;r<=e;r++)Mx(n,i,o)}}(o,r,e,n),n.rowStart="up"===e?n.rowStart+t:n.rowStart-t,n.rowEnd="up"===e?n.rowEnd+t:n.rowEnd-t;const d=Tx(l,h,n,!0);"autoHeight"===n.table.heightMode&&(_x(n.bodyLeftCol,n.bodyRightCol,l,h,n.table,a>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",!0),_x(0,n.table.frozenColCount-1,l,h,n.table,a>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",!0),_x(n.table.colCount-n.table.rightFrozenColCount,n.table.colCount-1,l,h,n.table,a>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",!0)),n.currentRow="up"===e?n.currentRow+t:n.currentRow-t,n.totalRow=Math.max(0,Math.min(n.bodyBottomRow,"up"===e?n.totalRow+t:n.totalRow-t)),n.referenceRow=n.rowStart+Math.floor((n.rowEnd-n.rowStart)/2),"autoHeight"===n.table.heightMode&&d?n.rowUpdatePos=Math.min(n.rowUpdatePos,n.rowEnd+1):n.rowUpdatePos=Math.min(n.rowUpdatePos,s),n.rowUpdateDirection=e,n.table.scenegraph.updateNextFrame(),yield n.progress()}else{const o="up"===e?n.rowStart+t:n.rowStart-t,r="up"===e?n.rowEnd+t:n.rowEnd-t,s=n.table.getRowsHeight(n.bodyTopRow,o-1);let a,l;"autoHeight"===n.table.heightMode?(a=o,l=r):(a=Math.max(n.bodyTopRow,i-1*n.screenRowCount),l=Math.min(n.bodyBottomRow,i+2*n.screenRowCount)),Sy(n.table,a,l,!1),function(t,e,i,o){for(let r=0;r<o.table.frozenColCount;r++){const n=o.table.scenegraph.getColGroup(r);null==n||n.forEachChildren(((r,n)=>{o.updateCellGroupPosition(r,"up"===i?r.row+e:r.row-e,0===n?t:r._prev.attribute.y+o.table.getRowHeight(r._prev.row))}))}for(let r=o.table.colCount-o.table.rightFrozenColCount;r<o.table.colCount;r++){const n=o.table.scenegraph.getColGroup(r);null==n||n.forEachChildren(((r,n)=>{o.updateCellGroupPosition(r,"up"===i?r.row+e:r.row-e,0===n?t:r._prev.attribute.y+o.table.getRowHeight(r._prev.row))}))}for(let r=o.bodyLeftCol;r<=o.bodyRightCol;r++){const n=o.table.scenegraph.getColGroup(r);null==n||n.forEachChildren(((r,n)=>{o.updateCellGroupPosition(r,"up"===i?r.row+e:r.row-e,0===n?t:r._prev.attribute.y+o.table.getRowHeight(r._prev.row))}))}}(s,t,e,n),n.rowStart=o,n.rowEnd=r;const h=Tx(a,l,n,!0);"autoHeight"===n.table.heightMode&&(_x(n.bodyLeftCol,n.bodyRightCol,a,l,n.table,r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up"),_x(0,n.table.frozenColCount-1,a,l,n.table,r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up"),_x(n.table.colCount-n.table.rightFrozenColCount,n.table.colCount-1,a,l,n.table,r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up")),n.currentRow="up"===e?n.currentRow+t:n.currentRow-t,n.totalRow=Math.max(0,Math.min(n.bodyBottomRow,"up"===e?n.totalRow+t:n.totalRow-t)),n.referenceRow=n.rowStart+Math.floor((n.rowEnd-n.rowStart)/2),"autoHeight"===n.table.heightMode&&h?n.rowUpdatePos=n.rowEnd+1:n.rowUpdatePos=n.rowStart,n.rowUpdateDirection=r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",n.table.scenegraph.updateNextFrame(),yield n.progress()}}))}function Mx(t,e,i){if(t.childrenCount>=1)if("up"===e){const e=t.firstChild;i.updateCellGroupPosition(e,t.lastChild.row+1,t.lastChild.attribute.y+i.table.getRowHeight(t.lastChild.row)),t.appendChild(e)}else{const e=t.lastChild;i.updateCellGroupPosition(e,t.firstChild.row-1,t.firstChild.attribute.y-i.table.getRowHeight(e.row)),t.insertBefore(e,t.firstChild)}}function Tx(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(let o=0;o<i.table.frozenColCount;o++)for(let r=t;r<=e;r++){const t=i.highPerformanceGetCell(o,r,!0);i.updateCellGroupContent(t)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++)for(let r=t;r<=e;r++){const t=i.highPerformanceGetCell(o,r);i.updateCellGroupContent(t)}let r=i.bodyLeftCol,n=i.bodyRightCol,s=!0;if(o){const t=i.screenLeftCol;r=Math.max(i.bodyLeftCol,t-1*i.screenColCount),n=Math.min(i.bodyRightCol,t+2*i.screenColCount),r===i.bodyLeftCol&&n===i.bodyRightCol||(s=!1)}for(let o=r;o<=n;o++)for(let r=t;r<=e;r++){const t=i.highPerformanceGetCell(o,r);i.updateCellGroupContent(t)}return i.table.scenegraph.updateNextFrame(),s}var Px=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};var kx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};function Lx(t){const{changedCells:e}=t.internalProps.stick;e.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dx:e.dx,dy:e.dy})}))})),e.clear();const{scrollTop:i,scrollLeft:o,frozenRowCount:r,frozenColCount:n}=t,s=t.getFrozenRowsHeight(),a=t.getFrozenColsWidth(),{row:l}=t.getRowAt(i+s+1),{col:h}=t.getColAt(o+a+1),d=Math.max(l,t.frozenRowCount),c=Math.max(h,t.frozenColCount),u=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(i+t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()-1).row:t.rowCount-t.bottomFrozenRowCount-1,g=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(o+t.tableNoFrameWidth-t.getRightFrozenColsWidth()-1).col:t.colCount-t.rightFrozenColCount-1;if(!(g<0||u<0)){for(let i=0;i<r&&!(g<c);i++)[c,g].forEach((o=>{const r=t._getCellStyle(o,i);(null==r?void 0:r.textStick)&&"vertical"!==(null==r?void 0:r.textStick)&&zx(t.scenegraph.getCell(o,i),a+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==r?void 0:r.textStickBaseOnAlign,t)}));for(let i=0;i<n&&!(u<d);i++)[d,u].forEach((o=>{const r=t._getCellStyle(i,o);(null==r?void 0:r.textStick)&&"tree"!==t.internalProps.layoutMap.rowHierarchyType&&"horizontal"!==(null==r?void 0:r.textStick)&&Hx(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==r?void 0:r.textStickBaseOnAlign,t)}));for(let i=c;i<=g&&!(u<d);i++)[d,u].forEach((o=>{const r=t._getCellStyle(i,o);(null==r?void 0:r.textStick)&&"horizontal"!==(null==r?void 0:r.textStick)&&Hx(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==r?void 0:r.textStickBaseOnAlign,t)}));for(let i=d;i<=u&&!(g<c);i++)[c,g].forEach((o=>{const r=t._getCellStyle(o,i);(null==r?void 0:r.textStick)&&"vertical"!==(null==r?void 0:r.textStick)&&zx(t.scenegraph.getCell(o,i),a+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==r?void 0:r.textStickBaseOnAlign,t)}))}}function Hx(t,e,i,o,r,n){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:a,rowStart:l,rowEnd:h}=Py(t,n.scenegraph);for(let t=s;t<=a;t++)for(let s=l;s<=h;s++)Ex(n.scenegraph.getCell(t,s),e,i,o,r)}else Ex(t,e,i,o,r)}function Ex(t,e,i,o,r){var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w;const x=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!x)return;if("image"===x.type){const{image:t}=x.attribute;if(!t||!x.resources)return;if("success"!==x.resources.get(t).state)return}const S=null!==(n=x.textBaseline)&&void 0!==n?n:"top";x.AABBBounds.width();const _=x.globalAABBBounds.y1,A=x.globalAABBBounds.y2;if("middle"===S&&r){const r=t.globalAABBBounds.y1+(null!==(a=null===(s=t.firstChild)||void 0===s?void 0:s.attribute.dy)&&void 0!==a?a:0),n=r+(null!==(h=null!==(l=t.contentHeight)&&void 0!==l?l:t.attribute.height)&&void 0!==h?h:0);if(r<e||n>i){const s=Math.max(r,e),a=Math.min(n,i),l=x.globalTransMatrix.f-(a+s)/2+x.AABBBounds.height()/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(c=null===(d=t.firstChild)||void 0===d?void 0:d.attribute.dx)&&void 0!==c?c:0,dy:null!==(g=null===(u=t.firstChild)||void 0===u?void 0:u.attribute.dy)&&void 0!==g?g:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-l+2)}))}}else if(_<e){const i=_-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(f=null===(p=t.firstChild)||void 0===p?void 0:p.attribute.dx)&&void 0!==f?f:0,dy:null!==(b=null===(v=t.firstChild)||void 0===v?void 0:v.attribute.dy)&&void 0!==b?b:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-i+2)}))}else if(A>i){const e=A-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(C=null===(m=t.firstChild)||void 0===m?void 0:m.attribute.dx)&&void 0!==C?C:0,dy:null!==(w=null===(y=t.firstChild)||void 0===y?void 0:y.attribute.dy)&&void 0!==w?w:0}),t.forEachChildren((t=>{var i;t.setAttribute("dy",(null!==(i=t.attribute.dy)&&void 0!==i?i:0)-e)}))}}function zx(t,e,i,o,r,n){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:a,rowStart:l,rowEnd:h}=Py(t,n.scenegraph);for(let t=s;t<=a;t++)for(let s=l;s<=h;s++)Fx(n.scenegraph.getCell(t,s),e,i,o,r)}else Fx(t,e,i,o,r)}function Fx(t,e,i,o,r){var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x;const S=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!S)return;if("image"===S.type){const{image:t}=S.attribute;if(!t||!S.resources)return;if("success"!==S.resources.get(t).state)return}const _=null!==(s=null!==(n=S.attribute.textAlign)&&void 0!==n?n:S.textAlign)&&void 0!==s?s:"left";S.AABBBounds.width();const A=S.globalAABBBounds.x1,R=S.globalAABBBounds.x2;if("center"===_&&r){const r=t.globalAABBBounds.x1+(null!==(l=null===(a=t.firstChild)||void 0===a?void 0:a.attribute.dx)&&void 0!==l?l:0),n=r+(null!==(d=null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width)&&void 0!==d?d:0);if(r<e||n>i){const s=Math.max(r,e),a=Math.min(n,i),l=S.globalTransMatrix.e-(a+s)/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(u=null===(c=t.firstChild)||void 0===c?void 0:c.attribute.dx)&&void 0!==u?u:0,dy:null!==(p=null===(g=t.firstChild)||void 0===g?void 0:g.attribute.dy)&&void 0!==p?p:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-l+2)}))}}else if(A<e){const i=A-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(v=null===(f=t.firstChild)||void 0===f?void 0:f.attribute.dx)&&void 0!==v?v:0,dy:null!==(m=null===(b=t.firstChild)||void 0===b?void 0:b.attribute.dy)&&void 0!==m?m:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-i+2)}))}else if(R>i){const e=R-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(y=null===(C=t.firstChild)||void 0===C?void 0:C.attribute.dx)&&void 0!==y?y:0,dy:null!==(x=null===(w=t.firstChild)||void 0===w?void 0:w.attribute.dy)&&void 0!==x?x:0}),t.forEachChildren((t=>{var i;t.setAttribute("dx",(null!==(i=t.attribute.dx)&&void 0!==i?i:0)-e)}))}}function Ix(t){var e,i;const o=t.internalProps.layoutMap.headerObjects,r=t.internalProps.layoutMap.columnObjects;for(let t=0;t<o.length;t++){const i=o[t];if(i&&(null===(e=i.style)||void 0===e?void 0:e.textStick))return!0}for(let t=0;t<r.length;t++){const e=r[t];if(e&&(null===(i=e.style)||void 0===i?void 0:i.textStick))return!0}return!!(t.theme.headerStyle.textStick||t.theme.rowHeaderStyle.textStick||t.theme.bodyStyle.textStick)}var Ox=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};class Dx{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):"autoHeight"===this.table.heightMode?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):("autoWidth"===this.table.widthMode||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const r=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(r/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const r=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(r/e))),this.rowUpdatePos=this.bodyBottomRow}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,r,n,s,a){!function(t,e,i,o,r,n,s,a,l){var h,d,c,u,g,p,f,v,b,m,C,y;const{table:w}=l,{leftBottomCornerGroup:x,rightTopCornerGroup:S,rightBottomCornerGroup:_}=w.scenegraph;let A,R;l.setParamsForRow(),l.setParamsForColumn(),A="adaptive"===w.widthMode||w.options.autoWrapText&&("adaptive"===w.heightMode||"autoHeight"===w.heightMode)?w.colCount-1:Math.min(l.firstScreenColLimit,w.colCount-1),R="adaptive"===w.heightMode?w.rowCount-1:Math.min(l.firstScreenRowLimit,w.rowCount-1),0===w.internalProps._widthResizedColMap.size&&tx(w,0,A),0===w.internalProps._heightResizedRowMap.size&&Sy(w,0,R),A<w.colCount-w.rightFrozenColCount&&tx(w,w.colCount-w.rightFrozenColCount,w.colCount-1),R<w.rowCount-w.bottomFrozenRowCount&&Sy(w,w.rowCount-w.bottomFrozenRowCount,w.rowCount-1),w.scenegraph.colHeaderGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rowHeaderGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bottomFrozenGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rightFrozenGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bodyGroup.setAttributes({x:w.getFrozenColsWidth(),y:w.getFrozenRowsHeight()}),cx(t,s,a,0,w.frozenColCount-1,0,w.frozenRowCount-1,w.isListTable()?"columnHeader":"cornerHeader",w),A-w.rightFrozenColCount>=w.frozenColCount&&cx(e,s,a,w.frozenColCount,A-w.rightFrozenColCount,0,w.frozenRowCount-1,"columnHeader",w),w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&cx(i,s,a,0,w.leftRowSeriesNumberCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"rowHeader",w),w.rowHeaderLevelCount>0&&cx(i,s,a,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&cx(i,s,a,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"body",w)),w.bottomFrozenRowCount>0&&(w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&cx(x,s,a,0,w.leftRowSeriesNumberCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.rowHeaderLevelCount>0&&cx(x,s,a,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&cx(x,s,a,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w)),A-w.rightFrozenColCount>=w.frozenColCount&&cx(r,s,a,w.frozenColCount,A-w.rightFrozenColCount,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,w.isPivotChart()?"rowHeader":"body",w)),w.rightFrozenColCount>0&&(cx(S,s,a,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,0,w.frozenRowCount-1,"columnHeader",w),cx(o,s,a,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,w.isPivotChart()?"rowHeader":"body",w)),w.bottomFrozenRowCount>0&&w.rightFrozenColCount>0&&cx(_,s,a,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w),A-w.rightFrozenColCount>=w.frozenColCount&&cx(n,s,a,w.frozenColCount,A-w.rightFrozenColCount,w.frozenRowCount,R-w.bottomFrozenRowCount,"body",w),n.firstChild||e.firstChild||t.firstChild||i.firstChild?(l.currentRow=null!==(u=null!==(d=null===(h=n.firstChild)||void 0===h?void 0:h.rowNumber)&&void 0!==d?d:null===(c=i.firstChild)||void 0===c?void 0:c.rowNumber)&&void 0!==u?u:l.totalRow,l.rowEnd=l.currentRow,l.rowUpdatePos=l.rowEnd+1,l.referenceRow=l.rowStart+Math.floor((l.rowEnd-l.rowStart)/2),l.currentCol=null!==(y=null!==(m=null!==(v=null!==(p=null===(g=n.lastChild)||void 0===g?void 0:g.col)&&void 0!==p?p:null===(f=e.lastChild)||void 0===f?void 0:f.col)&&void 0!==v?v:null===(b=i.lastChild)||void 0===b?void 0:b.col)&&void 0!==m?m:null===(C=t.lastChild)||void 0===C?void 0:C.col)&&void 0!==y?y:l.totalCol,l.colEnd=l.currentCol,l.colUpdatePos=l.colEnd+1,l.referenceCol=l.colStart+Math.floor((l.colEnd-l.colStart)/2),l.progress()):(l.currentRow=l.totalRow,l.rowEnd=l.currentRow,l.rowUpdatePos=l.rowEnd+1,l.referenceRow=l.rowStart+Math.floor((l.rowEnd-l.rowStart)/2),l.currentCol=l.totalCol,l.colEnd=l.currentCol,l.colUpdatePos=l.colEnd+1,l.referenceCol=l.colStart+Math.floor((l.colEnd-l.colStart)/2))}(t,e,i,o,r,n,s,a,this)}progress(){return Ox(this,void 0,void 0,(function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise(((t,e)=>{setTimeout((()=>Ox(this,void 0,void 0,(function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),Lx(this.table),this.table.scenegraph.updateNextFrame(),t())}))),16)}))}))}createRow(){return Ox(this,void 0,void 0,(function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)}))}createCol(){return Ox(this,void 0,void 0,(function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)}))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(Sy(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let t=0;for(let i=0;i<this.table.frozenColCount;i++){const o=this.table.scenegraph.getColGroup(i),r=this.table.isListTable()?"body":"rowHeader",{height:n}=lx(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);t=Math.max(t,n),this.table.scenegraph.rowHeaderGroup.setAttribute("height",t)}}if(this.table.rightFrozenColCount){let t=0;for(let i=this.table.colCount-this.table.rightFrozenColCount;i<this.table.colCount;i++){const o=this.table.scenegraph.getColGroup(i),r=this.table.isPivotChart()?"rowHeader":"body",{height:n}=lx(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);t=Math.max(t,n),this.table.scenegraph.rightFrozenGroup.setAttribute("height",t)}}let i=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const o=this.table.scenegraph.getColGroup(t);if(!o)continue;const r=t<this.table.rowHeaderLevelCount?"rowHeader":"body",{height:n}=lx(o,t,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);i=Math.max(i,n)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);tx(this.table,this.currentCol+1,e),this.colEnd=e;for(let t=0;t<this.table.rowCount;t++){const e=this.highPerformanceGetCell(this.currentCol,t);"cell"===e.role&&at(e.mergeStartCol)&&e.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(e.col,e.row)}if(this.table.frozenRowCount){const t=this.table.scenegraph.colHeaderGroup.lastChild instanceof jC?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;cx(this.table.scenegraph.colHeaderGroup,i,o,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const t=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof jC?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;cx(this.table.scenegraph.bottomFrozenGroup,i,o,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof jC?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof jC?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,r=i.attribute.y;cx(this.table.scenegraph.bodyGroup,o,r,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ox(this,void 0,void 0,(function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,r=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);r&&(this.screenTopRow=r.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&0!==this.table.scenegraph.bodyGroup.firstChild.childrenCount||this.table.scenegraph.rowHeaderGroup.firstChild&&0!==this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount?this.dynamicSetY(t,r,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))}))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ox(this,void 0,void 0,(function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,r=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);r&&(this.screenLeftCol=r.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&0===this.table.scenegraph.bodyGroup.firstChild.childrenCount?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,r,e)}))}dynamicSetY(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Ox(this,void 0,void 0,(function*(){Rx(t,e,i,this)}))}dynamicSetX(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Ox(this,void 0,void 0,(function*(){bx(t,e,i,this)}))}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return Ox(this,void 0,void 0,(function*(){this.updateCellGroups(this.taskRowCount)}))}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);"autoHeight"===this.table.heightMode&&Sy(this.table,this.rowUpdatePos,e,!1),Tx(this.rowUpdatePos,e,this),"autoHeight"===this.table.heightMode&&(_x(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),_x(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),_x(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;"autoHeight"===this.table.heightMode&&Sy(this.table,t,e,!1),Tx(t,e,this),"autoHeight"===this.table.heightMode&&(_x(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),_x(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),_x(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;"autoWidth"===this.table.widthMode&&tx(this.table,t,e,!1),Sx(t,e,this),"autoHeight"===this.table.heightMode&&px(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return Ox(this,void 0,void 0,(function*(){this.updateColGroups(this.taskRowCount)}))}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);tx(this.table,this.colUpdatePos,e),Sx(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||"cell"!==t.role)return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return Ox(this,void 0,void 0,(function*(){yield function(t){var e;return Px(this,void 0,void 0,(function*(){let i,o;t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))})),"autoHeight"===t.table.heightMode?(i=t.rowStart,o=t.rowEnd):(i=Math.max(t.bodyTopRow,t.screenTopRow-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,t.screenTopRow+2*t.screenRowCount));const r=t.table.getAllRowsHeight();Sy(t.table,i,o);const n=t.table.getAllRowsHeight();r!==n&&t.table.scenegraph.updateContainerHeight(t.table.frozenRowCount,n-r);for(let i=0;null!==(e=i<t.table.frozenColCount)&&void 0!==e&&e;i++){const e=t.table.scenegraph.getColGroup(i);null==e||e.setAttribute("chartInstance",void 0);for(let e=t.rowStart;e<=t.rowEnd;e++)t.table.scenegraph.updateCellContent(i,e);for(let e=t.table.rowCount-t.table.bottomFrozenRowCount;e<t.table.rowCount;e++)t.table.scenegraph.updateCellContent(i,e)}for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}Tx(i,o,t),"autoHeight"===t.table.heightMode&&_x(t.bodyLeftCol,t.bodyRightCol,i,o,t.table,t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up"),t.rowUpdatePos=t.rowStart,t.rowUpdateDirection=t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up",t.table.scenegraph.updateNextFrame(),"autoHeight"!==t.table.heightMode&&(yield t.progress())}))}(this)}))}sortCellHorizontal(){return Ox(this,void 0,void 0,(function*(){yield function(t){return kx(this,void 0,void 0,(function*(){t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))}));const e=Math.max(t.bodyLeftCol,t.screenLeftCol-1*t.screenColCount),i=Math.min(t.bodyRightCol,t.screenLeftCol+2*t.screenColCount);tx(t.table,e,i);for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}Sx(e,i,t),t.colUpdatePos=t.colStart,t.colUpdateDirection=t.colEnd>t.bodyRightCol-(t.colEnd-t.colStart+1)?"right":"left",t.table.scenegraph.updateNextFrame(),yield t.progress()}))}(this)}))}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd))return ax;if(t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return ax;if(this.cellCache.get(t)){const o=this.cellCache.get(t);if((o._next||o._prev)&&Math.abs(o.row-e)<e){let r=Wx(o,e);return r&&(i||"shadow-cell"!==r.role)||(r=this.table.scenegraph.getCell(t,e,i)),r.row&&this.cellCache.set(t,r),r}const r=this.table.scenegraph.getCell(t,e,i);return r.col===t&&r.row&&this.cellCache.set(t,r),r}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if("cell"===t.role){const e=t.attribute.y;this.deltaY=-e}}else if(this.rowEnd===this.bodyBottomRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if("cell"===t.role){const e=t.attribute.y+t.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-e}}else if(J(e)&&J(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);"cell"!==o.role&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const r=t-this.deltaY,n=e-r,s=o.attribute.y-r+this.table.getFrozenRowsHeight();this.deltaY=n-s}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const t=this.table.scenegraph.getColGroup(this.colStart);if(t){const e=t.attribute.x;this.deltaX=-e}}else if(this.colEnd===this.bodyRightCol){const t=this.table.scenegraph.getColGroup(this.colEnd);if(t){const e=t.attribute.x+t.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-e}}else if(J(e)&&J(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),r=t-this.deltaX,n=e-r,s=o.attribute.x-r+this.table.getFrozenColsWidth();this.deltaX=n-s}}release(){this.isRelease=!0}}function Wx(t,e){if(!t)return null;if(t.row===e)return t;const i=t._prev,o=t._next;return t.row>e&&i&&i.row===t.row-1?Wx(i,e):t.row<e&&o&&o.row===t.row+1?Wx(o,e):null}function Nx(t,e,i){var o,r,n,s,a,l,h,d,c;const u=i.table,[g,p,f,v]=e.split("-"),b=parseInt(g,10),m=parseInt(p,10),C=parseInt(f,10),y=parseInt(v,10);let w,x=b,S=m,_=C,A=y;switch(t.role){case"rowHeader":w=u.getBodyVisibleRowRange(),w&&(S=Math.max(m,w.rowStart-1),A=Math.min(y,w.rowEnd+1));break;case"columnHeader":case"bottomFrozen":w=u.getBodyVisibleCellRange(),w&&(x=Math.max(b,w.colStart-1),_=Math.min(C,w.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":w=u.getBodyVisibleCellRange(),w&&(S=Math.max(m,w.rowStart-1),A=Math.min(y,w.rowEnd+1));break;default:w=u.getBodyVisibleCellRange(),w&&(S=Math.max(m,w.rowStart-1),A=Math.min(y,w.rowEnd+1),x=Math.max(b,w.colStart-1),_=Math.min(C,w.colEnd+1))}const R=u.getColsWidth(x,_),B=u.getRowsHeight(S,A),M=i.highPerformanceGetCell(x,S).globalAABBBounds,T=i.highPerformanceGetCell(_,A).globalAABBBounds;t.rect.setAttributes({x:M.x1-i.tableGroup.attribute.x,y:M.y1-i.tableGroup.attribute.y,width:R,height:B,visible:!0}),t.fillhandle&&(null===(o=t.fillhandle)||void 0===o||o.setAttributes({x:T.x2-i.tableGroup.attribute.x-3,y:T.y2-i.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let P=!!u.frozenColCount&&b===u.frozenColCount;!P&&u.frozenColCount&&u.scrollLeft>0&&b>=u.frozenColCount&&u.getColsWidth(0,b-1)-u.scrollLeft<u.getFrozenColsWidth()&&(P=!0);let k=!!u.rightFrozenColCount&&u.rightFrozenColCount>0&&C===u.colCount-u.rightFrozenColCount-1;!k&&u.rightFrozenColCount&&C<u.colCount-u.rightFrozenColCount&&u.getColsWidth(0,C)-u.scrollLeft>u.tableNoFrameWidth-u.getRightFrozenColsWidth()&&(k=!0);let L=!u.frozenRowCount||m===u.frozenRowCount;!L&&u.frozenRowCount&&u.scrollTop>0&&m>=u.frozenRowCount&&u.getRowsHeight(0,m-1)-u.scrollTop<u.getFrozenRowsHeight()&&(L=!0);let H=!!u.bottomFrozenRowCount&&y===u.rowCount-u.bottomFrozenRowCount-1;if(!H&&u.bottomFrozenRowCount&&y<u.rowCount-u.bottomFrozenRowCount&&u.getRowsHeight(0,y)-u.scrollTop>u.tableNoFrameHeight-u.getBottomFrozenRowsHeight()&&(H=!0),P&&t.rect.attribute.stroke[3]||k&&t.rect.attribute.stroke[1]||L&&t.rect.attribute.stroke[0]||H&&t.rect.attribute.stroke[2]){if(P&&t.rect.attribute.stroke[3]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.cornerHeaderGroup:"bottomFrozen"===t.role?i.leftBottomCornerGroup:i.rowHeaderGroup),H&&t.rect.attribute.stroke[2]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.leftBottomCornerGroup:"rightFrozen"===t.role?i.rightBottomCornerGroup:i.bottomFrozenGroup),L&&t.rect.attribute.stroke[0]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.cornerHeaderGroup:"rightFrozen"===t.role?i.rightTopCornerGroup:i.colHeaderGroup),k&&t.rect.attribute.stroke[1]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.rightTopCornerGroup:"bottomFrozen"===t.role?i.rightBottomCornerGroup:i.rightFrozenGroup),t.rect.attribute.x<u.getFrozenColsWidth()&&u.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=t.rect.attribute.width-(u.getFrozenColsWidth()-t.rect.attribute.x);t.rect.setAttributes({x:t.rect.attribute.x+(u.getFrozenColsWidth()-t.rect.attribute.x),width:e>0?e:0}),null===(r=t.fillhandle)||void 0===r||r.setAttributes({visible:e>0})}if(u.getRightFrozenColsWidth()>0&&i.rightFrozenGroup.attribute.height>0&&t.rect.attribute.x+t.rect.attribute.width>i.rightFrozenGroup.attribute.x&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=i.rightFrozenGroup.attribute.x-t.rect.attribute.x;t.rect.setAttributes({x:t.rect.attribute.x,width:e>0?e:0}),null===(n=t.fillhandle)||void 0===n||n.setAttributes({visible:e-R>0})}if(t.rect.attribute.y<i.colHeaderGroup.attribute.height&&u.scrollTop>0&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=t.rect.attribute.height-(i.colHeaderGroup.attribute.height-t.rect.attribute.y);t.rect.setAttributes({y:t.rect.attribute.y+(i.colHeaderGroup.attribute.height-t.rect.attribute.y),height:e>0?e:0}),null===(s=t.fillhandle)||void 0===s||s.setAttributes({visible:e>0})}if(i.bottomFrozenGroup.attribute.width>0&&i.bottomFrozenGroup.attribute.height>0&&t.rect.attribute.y+t.rect.attribute.height>i.bottomFrozenGroup.attribute.y&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=i.bottomFrozenGroup.attribute.y-t.rect.attribute.y;t.rect.setAttributes({y:t.rect.attribute.y,height:e>0?e:0}),null===(a=t.fillhandle)||void 0===a||a.setAttributes({visible:e-B>0})}}else i.tableGroup.insertAfter(t.rect,"body"===t.role?i.bodyGroup:"columnHeader"===t.role?i.colHeaderGroup:"rowHeader"===t.role?i.rowHeaderGroup:"cornerHeader"===t.role?i.cornerHeaderGroup:"rightTopCorner"===t.role?i.rightTopCornerGroup:"rightFrozen"===t.role?i.rightFrozenGroup:"leftBottomCorner"===t.role?i.leftBottomCornerGroup:"bottomFrozen"===t.role?i.bottomFrozenGroup:i.rightBottomCornerGroup);let E=0;"number"==typeof t.rect.attribute.lineWidth&&(E=Math.ceil(t.rect.attribute.lineWidth/2)),C===u.colCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(l=t.rect.attribute.lineWidth[1])&&void 0!==l?l:0)/2)),t.rect.setAttributes({width:t.rect.attribute.width-E})),0===b&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(h=t.rect.attribute.lineWidth[3])&&void 0!==h?h:0)/2)),t.rect.setAttributes({x:t.rect.attribute.x+E,width:t.rect.attribute.width-E})),y===u.rowCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(d=t.rect.attribute.lineWidth[2])&&void 0!==d?d:0)/2)),t.rect.setAttributes({height:t.rect.attribute.height-E})),0===m&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(c=t.rect.attribute.lineWidth[0])&&void 0!==c?c:0)/2)),t.rect.setAttributes({y:t.rect.attribute.y+E,height:t.rect.attribute.height-E}))}function Gx(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.table,r=e.start.col,n=e.start.row,s=e.end.col,a=e.end.row,l=e.skipBodyMerge;let h=Math.max(Math.min(s,r),0),d=Math.max(Math.min(a,n),0),c=Math.min(Math.max(s,r),o.colCount-1),u=Math.min(Math.max(a,n),o.rowCount-1);const g=()=>{let t=!1;for(let e=h;e<=c;e++){if(e===h)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&l)continue;const r=lm(o,e,i);if(r&&r.start.col<h){h=r.start.col,t=!0;break}}if(!t&&e===c)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&l)continue;const r=lm(o,e,i);if(r&&Math.min(r.end.col,o.colCount-1)>c){c=r.end.col,t=!0;break}}if(t)break}if(!t)for(let e=d;e<=u;e++){if(e===d)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&l)continue;const r=lm(o,i,e);if(r&&r.start.row<d){d=r.start.row,t=!0;break}}if(!t&&e===u)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&l)continue;const r=lm(o,i,e);if(r&&Math.min(r.end.row,o.rowCount-1)>u){u=r.end.row,t=!0;break}}if(t)break}t&&g()};i&&g(),t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map;let p=!1,f=!1,v=!1,b=!1,m=!1,C=!1,y=!1,w=!1,x=!1;if(h<=o.frozenColCount-1&&d<=o.frozenRowCount-1&&(C=!0),c>=o.colCount-o.rightFrozenColCount&&d<=o.frozenRowCount-1&&(y=!0),h<=o.frozenColCount-1&&u>=o.rowCount-o.bottomFrozenRowCount&&(x=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.rowCount-o.bottomFrozenRowCount&&(w=!0),h<=o.frozenColCount-1&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(p=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(f=!0),d<=o.frozenRowCount-1&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(v=!0),u>=o.rowCount-o.bottomFrozenRowCount&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(b=!0),h<=o.colCount-o.rightFrozenColCount-1&&c>=o.frozenColCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&u>=o.frozenRowCount&&(m=!0),C){const e=Math.min(c,o.frozenColCount-1),i=Math.min(u,o.frozenRowCount-1),r=[!0,!v,!p,!0];t.createCellSelectBorder(h,d,e,i,"cornerHeader",`${h}${d}${c}${u}`,r)}if(y){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.min(u,o.frozenRowCount-1),r=[!0,!0,!f,!v];t.createCellSelectBorder(e,d,c,i,"rightTopCorner",`${h}${d}${c}${u}`,r)}if(x){const e=Math.min(c,o.frozenColCount-1),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!p,!b,!0,!0];t.createCellSelectBorder(h,i,e,u,"leftBottomCorner",`${h}${d}${c}${u}`,r)}if(w){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!f,!0,!0,!b];t.createCellSelectBorder(e,i,c,u,"rightBottomCorner",`${h}${d}${c}${u}`,r)}if(v){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.min(u,o.frozenRowCount-1),n=[!0,!y,!m,!C];t.createCellSelectBorder(e,d,i,r,"columnHeader",`${h}${d}${c}${u}`,n)}if(b){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!m,!w,!0,!x];t.createCellSelectBorder(e,r,i,u,"bottomFrozen",`${h}${d}${c}${u}`,n)}if(p){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),r=Math.min(c,o.frozenColCount-1),n=[!C,!m,!x,!0];t.createCellSelectBorder(h,e,r,i,"rowHeader",`${h}${d}${c}${u}`,n)}if(f){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),r=Math.max(h,o.colCount-o.rightFrozenColCount),n=[!y,!0,!w,!m];t.createCellSelectBorder(r,e,c,i,"rightFrozen",`${h}${d}${c}${u}`,n)}if(m){const e=Math.max(h,o.frozenColCount),i=Math.max(d,o.frozenRowCount),r=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),s=[!v,!f,!b,!p];t.createCellSelectBorder(e,i,r,n,"body",`${h}${d}${c}${u}`,s)}}function jx(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)}))}function Ux(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)}))}function Vx(t){t.selectingRangeComponents.forEach(((e,i)=>{var o;t.selectedRangeComponents.get(i)&&(t.selectingRangeComponents.get(i).rect.delete(),null===(o=t.selectingRangeComponents.get(i).fillhandle)||void 0===o||o.delete()),t.selectedRangeComponents.set(i,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}function Xx(t){t.selectedRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectedRangeComponents=new Map}function Yx(t){t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map}function $x(t,e,i,o){const r=o.scenegraph,n=nb(t.map((t=>t.row))).sort(((t,e)=>e-t)),s=nb(e.map((t=>t.row))).sort(((t,e)=>t-e)),a=nb(i.map((t=>t.row))).sort(((t,e)=>t-e));let l;if(a.length&&(l=Zx(a[0]-1,a[a.length-1]+1,r)),s.length){const t=Zx(s[0]-1,s[s.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}if(n.length){const t=Zx(n[0]-1,n[n.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}n.forEach((t=>{!function(t,e){const i=e.proxy;t>=i.rowStart&&t<=i.rowEnd&&(function(t,e){for(let i=0;i<e.table.colCount;i++){const o=e.getColGroup(i,!1);if(!o)continue;let r;o.forEachChildren((e=>e.row===t&&(r=e,!0))),r&&(o.updateColumnHeight(-r.attribute.height),o.removeChild(r))}}(t,e),i.rowEnd--,i.currentRow--),i.bodyBottomRow--;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1}(t,r)}));const h=o.rowHeightsMap;if(n.forEach((t=>{h.delete(t)})),n.length){!function(t){function e(e,i){e.row=i;const o=lm(t.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))}))}(r);const t=qx(n[n.length-1]-1,n[0]-n.length+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}let d;if(r.table._clearRowRangeHeightsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyBottomRow++;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);if(i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1,!(t<i.rowStart))return t>i.rowEnd?i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,Kx(t,e),t):void 0:i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,Kx(t,e),t):t}(t,r);d=null!=d?d:e,h.insert(t)})),function(t){function e(e,i,o){e.row=i,e.setAttribute("y",o);const r=lm(t.table,e.col,e.row);r?(e.mergeStartCol=r.start.col,e.mergeEndCol=r.end.col,e.mergeStartRow=r.start.row,e.mergeEndRow=r.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart,r=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart,r=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart,r=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,r=0;null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,r=0;null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,r=0;null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))}))}(r),s.length){const t=qx(s[0]-1,s[s.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}for(let t=0;t<o.colCount;t++)a.forEach((e=>{const i=lm(r.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)ny(t,e,r.table,!1);else ny(t,e,r.table,!1)}));if(a.length){const t=qx(a[0]-1,a[a.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}if(at(d)){for(let t=0;t<o.colCount;t++)for(let e=d;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}l=J(l)?J(d)?Math.min(l,d):l:d}if(at(l)&&(r.proxy.rowUpdatePos=Math.min(r.proxy.rowUpdatePos,l)),s.length){if(!at(d)){const t=Math.min(...s);r.proxy.rowUpdatePos=Math.min(t,r.proxy.rowUpdatePos)}r.proxy.rowUpdateDirection="up",r.proxy.updateCellGroups(2*r.proxy.screenRowCount),u()}else n.length&&(function(t,e){if(e.table.isHasSeriesNumber())for(let i=t;i<=e.table.rowCount-1;i++)ny(0,i,e.table,!1)}(n[n.length-1],r),r.proxy.updateCellGroups(2*r.proxy.screenRowCount),u(),r.proxy.progress());r.proxy.progress();const c=o.getRowsHeight(o.frozenRowCount,o.rowCount-1-o.bottomFrozenRowCount);function u(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==a?void 0:a[(null==a?void 0:a.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==n?void 0:n[0])>=o.rowCount-o.bottomFrozenRowCount){for(let t=0;t<o.colCount;t++)for(let e=o.rowCount-o.bottomFrozenRowCount;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}r.proxy.updateBottomFrozenCellGroups()}}r.updateContainerHeight(r.table.frozenRowCount,c-r.bodyGroup.attribute.height)}function Kx(t,e){for(let i=0;i<e.table.colCount;i++){const o=new jC({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(t)});if(o.role="cell",o.col=i,o.row=t,o.needUpdate=!0,!o)continue;const r=e.getColGroup(i);if(r)if(r.firstChild&&t<r.firstChild.row)r.insertBefore(o,r.firstChild),r.firstChild.row=r.firstChild.row+1;else if(r.lastChild&&t>r.lastChild.row)r.appendChild(o);else{const n=e.highPerformanceGetCell(i,t,!0);n!==o&&(r.insertBefore(o,n),n&&(n.row=n.row+1),n!==r.lastChild&&r.lastChild&&(r.lastChild.row=r.lastChild.row+1))}}}function qx(t,e,i){let o;for(let r=0;r<i.table.colCount;r++){const n=i.table.getCellRange(r,t);let s;n.start.row<=t+1&&n.end.row>=t+1&&(Jx(n,i),s=n.start.row);const a=i.table.getCellRange(r,e);a.start.row<=e+1&&a.end.row>=e+1&&(Jx(a,i),s=a.start.row),J(s)&&(o=J(o)?Math.min(o,s):s)}return o}function Zx(t,e,i){let o;for(let r=0;r<i.table.colCount;r++){let n;const s=i.highPerformanceGetCell(r,t);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>t&&(Jx({start:{row:s.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:s.mergeEndCol}},i),n=s.mergeStartRow);const a=i.highPerformanceGetCell(r,e);a.mergeStartRow&&a.mergeEndRow&&a.mergeStartRow<e&&(Jx({start:{row:a.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:a.mergeStartCol},end:{row:a.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:a.mergeEndCol}},i),n=a.mergeStartRow),J(n)&&(o=J(o)?Math.min(o,n):n)}return o}function Jx(t,e){const{start:i,end:o}=t;for(let t=i.col;t<=o.col;t++)for(let r=i.row;r<=o.row;r++){const i=e.highPerformanceGetCell(t,r,!0);i&&(i.needUpdate=!0)}}function Qx(t){const e=t.bodyGroup.firstChild instanceof jC?t.bodyGroup.firstChild:null;e&&(t.rowHeaderGroup.appendChild(e),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width+e.attribute.width),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width-e.attribute.width))}function tS(t){const e=t.colHeaderGroup.firstChild instanceof jC?t.colHeaderGroup.firstChild:null;e&&(t.cornerHeaderGroup.appendChild(e),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width+e.attribute.width),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width-e.attribute.width))}function eS(t){var e;const i=t.rowHeaderGroup.lastChild instanceof jC?t.rowHeaderGroup.lastChild:null===(e=t.rowHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(nS(t.bodyGroup,i,t.bodyGroup.firstChild),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+i.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-i.attribute.width))}function iS(t){var e;const i=t.cornerHeaderGroup.lastChild instanceof jC?t.cornerHeaderGroup.lastChild:null===(e=t.cornerHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(nS(t.colHeaderGroup,i,t.colHeaderGroup.firstChild),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+i.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-i.attribute.width))}function oS(t){const e=t.bottomFrozenGroup.firstChild instanceof jC?t.bottomFrozenGroup.firstChild:null;e&&(t.leftBottomCornerGroup.appendChild(e),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width+e.attribute.width),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width-e.attribute.width),t.table.isPivotChart()&&e.forEachChildren((t=>{t.setAttributes({stroke:!1,fill:!1})})))}function rS(t){var e;const i=t.leftBottomCornerGroup.lastChild instanceof jC?t.leftBottomCornerGroup.lastChild:null===(e=t.leftBottomCornerGroup.lastChild)||void 0===e?void 0:e._prev;i&&(nS(t.bottomFrozenGroup,i,t.bottomFrozenGroup.firstChild),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width+i.attribute.width),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width-i.attribute.width),t.table.isPivotChart()&&i.forEachChildren((e=>{var i,o,r,n;const s=t.table._getCellStyle(e.col,e.row),a=t.table.getCellRange(e.col,e.row),l=wC(s,t.table,a?a.start.col:e.col,a?a.start.row:e.row,VC).theme;e.setAttributes({fill:null!==(o=null===(i=null==l?void 0:l.group)||void 0===i?void 0:i.fill)&&void 0!==o?o:void 0,stroke:null!==(n=null===(r=null==l?void 0:l.group)||void 0===r?void 0:r.stroke)&&void 0!==n?n:void 0})})))}function nS(t,e,i){e&&t&&(i?t.insertBefore(e,i):t.appendChild(e))}function sS(t){var e;for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++){const o=t.getColGroup(i);null===(e=null==o?void 0:o.getChildren())||void 0===e||e.forEach((t=>{t.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.addUpdateBoundTag())}))}))}}function aS(t,e){const i=t.table;if(i.isPivotChart()){const o=i._selectedDataItemsInChart.length;if((null===e||0===(null==e?void 0:e.length)||0===Object.keys(e).length)&&0===o)return;const r=[];if(Array.isArray(e))e.forEach((t=>{if(t&&0!==t.key&&Object.keys(t).length>0){const e={};for(const i in t)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(e[i]=t[i]);r.push(e)}}));else if(e&&0!==e.key&&Object.keys(e).length>0){const t={};for(const i in e)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(t[i]=e[i]);r.push(t)}At(i._selectedDataItemsInChart,r)||(i._selectedDataItemsInChart=r,i.internalProps.layoutMap.updateDataStateToChartInstance(),sS(t),i.scenegraph.updateNextFrame())}}function lS(t,e,i){t.forEachChildren((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttributes({width:Math.ceil(e-t.attribute.cellPadding[3]-t.attribute.cellPadding[1]),height:Math.ceil(i-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])}))}))}function hS(t,e,i){return new jC({x:0,y:0,width:t,height:e,clip:null!=i&&i,pickable:!1})}function dS(t,e){return t.forEachChildrenSkipChild(((t,i)=>{t.setAttribute("x",e),e+=t.attribute.width})),e}function cS(t,e,i,o,r){const n=t.name;pS(i,o,(t=>t.name===n),(t=>{qC(e,t),t.name=e.name}),r),r.updateNextFrame()}function uS(t,e,i,o,r,n,s,a){const l=a.table.internalProps.headerHelper.getSortIcon(o,a.table,t,e);if(i&&cS(i,l,t,e,a),!function(t,e,i,o,r){const n=r.getCellRange(t,e),s=r.getCellRange(i,o);return n.start.col===s.start.col&&n.start.row===s.start.row&&n.end.col===s.end.col&&n.end.row===s.end.row}(t,e,r,n,a.table)){const t=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,n);s?cS(s,t,r,n,a):function(t,e,i,o){const r=o.getCell(t,e);if(J(r.mergeStartCol)&&J(r.mergeStartRow)&&J(r.mergeEndCol)&&J(r.mergeEndRow))for(let t=r.mergeStartCol;t<=r.mergeEndCol;t++)for(let e=r.mergeStartRow;e<=r.mergeEndRow;e++){let r;o.getCell(t,e).forEachChildren((t=>"sort"===t.attribute.funcType&&(r=t,!0))),r&&(qC(i,r),r.name=i.name)}else{let t;r.forEachChildren((e=>"sort"===e.attribute.funcType&&(t=e,!0))),t&&(qC(i,t),t.name=i.name)}}(r,n,t,a)}}function gS(t,e,i){t.forEachChildren((t=>{"group"===t.type?gS(t,e,i):e(t)&&i(t)}))}function pS(t,e,i,o,r){const n=r.getCell(t,e);if("cell"===n.role&&J(n.mergeStartCol)&&J(n.mergeStartRow)&&J(n.mergeEndCol)&&J(n.mergeEndRow)){const{colStart:t,colEnd:e,rowStart:s,rowEnd:a}=Py(n,r);for(let n=t;n<=e;n++)for(let t=s;t<=a;t++)gS(r.highPerformanceGetCell(n,t),i,o)}else gS(n,i,o)}function fS(t,e){const{bgColor:i,borderColor:o,borderLineWidth:r,borderLineDash:n}=e,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:i};return s.stroke=sw(o,void 0),s.lineWidth=r,n&&(s.lineDash=n),s.lineCap="butt",Array.isArray(o)&&(s.strokeArrayColor=Dm(o)),Array.isArray(r)&&(s.strokeArrayWidth=Dm(r),s.lineWidth=1),t.setAttributes(s),t.role="corner-frozen",t}function vS(t,e,i,o){const r=o.scenegraph,n=bS(t.map((t=>t.col))).sort(((t,e)=>e-t)),s=bS(e.map((t=>t.col))).sort(((t,e)=>t-e)),a=bS(i.map((t=>t.col))).sort(((t,e)=>t-e));n.forEach((t=>{!function(t,e){const i=e.proxy;if(t>=e.table.rowHeaderLevelCount)if(t>=e.table.colCount-e.table.rightFrozenColCount);else{const i=e.getColGroup(t,!1);i&&i.parent===e.bodyGroup&&e.bodyGroup.removeChild(i);const o=e.getColGroupInBottom(t);o&&o.parent===e.bottomFrozenGroup&&e.bottomFrozenGroup.removeChild(o)}t>=i.colStart&&t<=i.colEnd&&(i.colEnd--,i.currentCol--),i.bodyRightCol--;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1}(t,r)}));const l=o.colWidthsMap;let h;if(n.forEach((t=>{l.delAndReorder(t)})),n.length&&mS(r),r.table._clearColRangeWidthsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyRightCol++;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);if(i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1,!(t<i.colStart))return t>i.colEnd?i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,CS(t,e),t):void 0:i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,CS(t,e),t):t}(t,r);mS(r),h=null!=h?h:e,l.addAndReorder(t)})),function(t){let e=t.bodyColStart,i=t.getCellGroupX(e);function o(i){i.col=e;const o=lm(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightTopCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightBottomCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++}))}(r),a.forEach((t=>{for(let e=0;e<o.rowCount;e++){const i=lm(r.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let t=i.start.col;t<=i.end.col;t++)ny(t,e,r.table,!1);else ny(t,e,r.table,!1)}})),at(h)){for(let t=h;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}r.proxy.colUpdatePos=h}if(s.length){if(!at(h)){const t=Math.min(...s);r.proxy.colUpdatePos=t}r.proxy.colUpdateDirection="left",r.proxy.updateColGroups(2*r.proxy.screenColCount),c(),r.proxy.progress()}else n.length&&(r.proxy.updateColGroups(2*r.proxy.screenColCount),c(),r.proxy.progress());const d=o.getColsWidth(o.frozenColCount,o.colCount-1);function c(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.colCount-o.rightFrozenColCount||(null==a?void 0:a[(null==a?void 0:a.length)-1])>=o.colCount-o.rightFrozenColCount||(null==n?void 0:n[0])>=o.colCount-o.rightFrozenColCount){for(let t=o.colCount-o.rightFrozenColCount;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}r.proxy.updateRightFrozenCellGroups()}}r.updateContainerWidth(r.table.frozenColCount,d-r.bodyGroup.attribute.width)}function bS(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function mS(t){let e=t.bodyColStart;function i(i){i.col=e;const o=lm(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++}))}function CS(t,e){if(e.colHeaderGroup&&e.table.columnHeaderLevelCount>0){const o=new jC({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const r=e.getColGroup(t,!0);r?e.colHeaderGroup.insertBefore(o,r):e.colHeaderGroup.appendChild(o),i(o,t,0,e.table.columnHeaderLevelCount-1)}if(e.bodyGroup){const o=new jC({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const r=e.getColGroup(t,!1);r?e.bodyGroup.insertBefore(o,r):e.bodyGroup.appendChild(o),i(o,t,e.bodyRowStart,e.bodyRowEnd)}if(e.bottomFrozenGroup&&e.table.bottomFrozenRowCount>0){const o=new jC({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const r=e.getColGroupInBottom(t);r?e.bottomFrozenGroup.insertBefore(o,r):e.bottomFrozenGroup.appendChild(o),i(o,t,e.table.rowCount-e.table.bottomFrozenRowCount,e.table.rowCount-1)}function i(t,i,o,r){for(let n=o;n<=r;n++){const o=new jC({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(n)});o.role="cell",o.col=i,o.row=n,o.needUpdate=!0,t.appendChild(o)}}}Yf(),Bo.load(Qw),Bo.load(fy);class yS{constructor(t){let e,i;var o;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,o=this.table.theme.textPopTipStyle,xt(Hf.poptip,Lf,o),t.options.canvas&&t.options.viewBox?(cc.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,i=t.options.viewBox.y2-t.options.viewBox.y1):"node"===Xv.mode?(cc.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(cc.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Bc(Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:t=>{this.table.options.beforeRender&&this.table.options.beforeRender(t)},afterRender:t=>{this.table.options.afterRender&&this.table.options.afterRender(t),this.table.fireListeners("after_render",null)},canvasControled:!t.options.canvas,viewBox:t.options.viewBox},t.options.renderOption)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.width)&&void 0!==e?e:0}get height(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.height)&&void 0!==e?e:0}get x(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.x)&&void 0!==e?e:0}get y(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.y)&&void 0!==e?e:0}get bodyRowStart(){var t;return null!==(t=this.proxy.rowStart)&&void 0!==t?t:0}get bodyRowEnd(){var t;return null!==(t=this.proxy.rowEnd)&&void 0!==t?t:this.table.rowCount-1}get bodyColStart(){var t;return null!==(t=this.proxy.colStart)&&void 0!==t?t:0}get bodyColEnd(){var t;return null!==(t=this.proxy.colEnd)&&void 0!==t?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),function(t){const e=t.table.tableNoFrameWidth,i=t.table.tableNoFrameHeight;t.tableGroup=new jC({x:0,y:0,width:e,height:i,clip:!0,pickable:!1}),t.tableGroup.role="table";const o=hS(0,0,!t.table.options.enableTreeStickCell);o.role="col-header",t.colHeaderGroup=o;const r=hS(0,0,!t.table.options.enableTreeStickCell);r.role="corner-header",t.cornerHeaderGroup=r;const n=hS(0,0,!0);n.role="row-header",t.rowHeaderGroup=n;const s=hS(e,0,!0);s.role="body",t.bodyGroup=s;const a=hS(0,0,!0);a.role="right-frozen",t.rightFrozenGroup=a;const l=hS(0,0,!0);l.role="bottom-frozen",t.bottomFrozenGroup=l;const h=hS(0,0);h.role="component",t.componentGroup=h;const d=hS(0,0,!0);d.role="corner-right-top-header",t.rightTopCornerGroup=d;const c=hS(0,0,!0);c.role="corner-right-bottom-header",t.rightBottomCornerGroup=c;const u=hS(0,0,!0);u.role="corner-left-bottom-header",t.leftBottomCornerGroup=u,t.tableGroup.addChild(s),t.tableGroup.addChild(n),t.tableGroup.addChild(l),t.tableGroup.addChild(o),t.tableGroup.addChild(a),t.tableGroup.addChild(c),t.tableGroup.addChild(d),t.tableGroup.addChild(u),t.tableGroup.addChild(r),t.tableGroup.addChild(h)}(this)}clearCells(){var t,e;(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach((t=>{t.deactivate(this.stage.pluginService)})),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),null===(t=this.proxy)||void 0===t||t.release(),null===(e=this.table.reactCustomLayout)||void 0===e||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new ow(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach((t=>{"poptipForText"===t.name&&this.stage.pluginService.register(t)})),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new Dx(this.table),rw(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(fS(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),fS(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),fS(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,r,n,s,a,l;let h;if(h=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?null===(o=this.rightTopCornerGroup.getColGroup(t))||void 0===o?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?null===(r=this.leftBottomCornerGroup.getColGroup(t))||void 0===r?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?null===(n=this.rightBottomCornerGroup.getColGroup(t))||void 0===n?void 0:n.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?null===(s=this.rightFrozenGroup.getColGroup(t))||void 0===s?void 0:s.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?null===(a=this.bottomFrozenGroup.getColGroup(t))||void 0===a?void 0:a.getRowGroup(e):null===(l=this.getColGroup(t,e<this.frozenRowCount))||void 0===l?void 0:l.getRowGroup(e),h&&"shadow-cell"===h.role&&!i){const i=this.table.getCellRange(t,e);i.start.col===t&&i.start.row===e||(h=this.getCell(i.start.col,i.start.row))}return h||ax}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=t<this.frozenColCount&&i?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):i?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),e||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=lm(this.table,t,e);let r=i.attribute.width,n=i.attribute.height;return o&&(r/=o.end.col-o.start.col+1,n/=o.end.row-o.start.row+1),{width:r,height:n}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i;(null===(e=null===(t=this.table.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0&&((i=this).selectingRangeComponents.forEach(((t,e)=>{Nx(t,e,i)})),i.selectedRangeComponents.forEach(((t,e)=>{Nx(t,e,i)})))}hideHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(pS(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0);const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1)}),i),i.updateNextFrame())}(t,e,this)}showHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(pS(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}hideClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(pS(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0)}),i),i.updateNextFrame())}(t,e,this)}showClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(pS(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}getIcon(t,e,i,o){return function(t,e,i,o,r){let n;return r.getCell(t,e).forEachChildren((t=>{t.role&&t.role.startsWith("icon")&&t.containsPoint(i,o,Xe.GLOBAL)&&(n=t)})),n}(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){!function(t,e,i,o,r){var n,s;if((t.attribute.backgroundColor||t.attribute.hoverImage)&&pS(e,i,(e=>e.name===t.name),(t=>{var e,i,o,r,n,s,a,l;if(t.attribute.backgroundColor){let h=t.parent.getChildByName("icon-back");h?h.setAttributes({x:(null!==(e=t.attribute.x)&&void 0!==e?e:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(i=t.attribute.y)&&void 0!==i?i:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(o=t.attribute.dx)&&void 0!==o?o:0,dy:null!==(r=t.attribute.dy)&&void 0!==r?r:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(h=ad({x:(null!==(n=t.attribute.x)&&void 0!==n?n:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(s=t.attribute.y)&&void 0!==s?s:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(a=t.attribute.dx)&&void 0!==a?a:0,dy:null!==(l=t.attribute.dy)&&void 0!==l?l:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),h.name="icon-back"),t.parent.insertBefore(h,t)}t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage)}),r),t.tooltip){const{x1:o,x2:a,y1:l,y2:h}=t.globalAABBBounds,d={content:t.tooltip.title,referencePosition:{rect:{left:o,right:a,top:l,bottom:h,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},disappearDelay:t.tooltip.disappearDelay,style:Object.assign({},null===(n=r.table.internalProps.theme)||void 0===n?void 0:n.tooltipStyle,null===(s=t.tooltip)||void 0===s?void 0:s.style)};r.table.internalProps.tooltipHandler.isBinded(d)||r.table.showTooltip(e,i,d)}}(t,e,i,0,this)}updateSortIcon(t,e,i,o,r,n,s){uS(t,e,i,o,r,n,s,this)}updateFrozenIcon(t,e){!function(t){for(let e=0;e<t.table.colCount;e++)for(let i=0;i<t.table.columnHeaderLevelCount;i++)pS(e,i,(t=>"frozen"===t.attribute.funcType),(o=>{const r=t.table.internalProps.headerHelper.getFrozenIcon(e,i);qC(r,o),o.name=r.name}),t)}(this)}updateHierarchyIcon(t,e){!function(t,e,i){let o;o=i.table.isHeader(t,e)?i.table.internalProps.headerHelper.getHierarchyIcon(t,e):i.table.internalProps.bodyHelper.getHierarchyIcon(t,e),pS(t,e,(t=>t.attribute.funcType===Pv.collapse||t.attribute.funcType===Pv.expand),(t=>{qC(o,t),t.name=o.name}),i)}(t,e,this)}setIconNormalStyle(t,e,i){!function(t,e,i,o){(t.attribute.backgroundColor||t.attribute.hoverImage)&&pS(e,i,(e=>e.name===t.name),(t=>{const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}),o)}(t,e,i,this)}residentHoverIcon(t,e){!function(t,e,i){pS(t,e,(t=>t.attribute.funcType===Pv.dropDown),(t=>{t.oldVisibleTime=t.attribute.visibleTime,t.setAttribute("visibleTime","always"),t.setAttribute("opacity",1)}),i)}(t,e,this)}resetResidentHoverIcon(t,e){!function(t,e,i){pS(t,e,(t=>t.attribute.funcType===Pv.dropDown),(t=>{t.oldVisibleTime&&t.setAttribute("visibleTime",t.oldVisibleTime),t.setAttribute("opacity","always"===t.attribute.visibleTime?1:0)}),i)}(t,e,this)}deactivateChart(t,e){var i,o;if(-1===t||-1===e)return;const r=this.getCell(t,e);null===(o=null===(i=null==r?void 0:r.firstChild)||void 0===i?void 0:i.deactivate)||void 0===o||o.call(i)}activateChart(t,e){var i,o;if(-1===t||-1===e)return;const r=this.getCell(t,e);null===(o=null===(i=null==r?void 0:r.firstChild)||void 0===i?void 0:i.activate)||void 0===o||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,r,n,s){!function(t,e,i,o,r,n,s,a){var l,h,d,c,u,g,p,f;let v=!!(null===(l=t.table.options.excelOptions)||void 0===l?void 0:l.fillHandle);if((null===(h=t.table.stateManager.select.ranges)||void 0===h?void 0:h.length)>1)v=!1,t.removeFillHandleFromSelectComponents();else if(1===(null===(d=t.table.stateManager.select.ranges)||void 0===d?void 0:d.length)){const e=Math.max(t.table.stateManager.select.ranges[0].start.row,t.table.stateManager.select.ranges[0].end.row),i=Math.max(t.table.stateManager.select.ranges[0].start.col,t.table.stateManager.select.ranges[0].end.col);t.table.isHeader(i,e)&&(v=!1)}!Array.isArray(a)||!1!==a[1]&&!1!==a[2]||(v=!1);const b=Math.min(e,o),m=Math.min(i,r),C=Math.max(e,o),y=Math.max(i,r),w=t.highPerformanceGetCell(b,m).globalAABBBounds,x=t.highPerformanceGetCell(C,y).globalAABBBounds,S=t.table.theme,_=null===(c=S.selectionStyle)||void 0===c?void 0:c.cellBorderColor,A=null===(u=S.selectionStyle)||void 0===u?void 0:u.cellBorderLineWidth,R=ad({pickable:!1,fill:"replace"!==(null===(g=S.selectionStyle)||void 0===g?void 0:g.selectionFillMode)&&(null!==(f=null===(p=S.selectionStyle)||void 0===p?void 0:p.cellBgColor)&&void 0!==f?f:"rgba(0, 0, 255,0.1)"),lineWidth:A,stroke:a.map((t=>!!t&&_)),x:w.x1-t.tableGroup.attribute.x,y:w.y1-t.tableGroup.attribute.y,width:0,height:0,visible:!0});let B;v&&(B=ad({pickable:!1,fill:_,stroke:_,x:x.x2-3,y:x.y2-3,width:6,height:6,visible:!0})),t.lastSelectId=s,t.selectingRangeComponents.set(`${b}-${m}-${C}-${y}-${s}`,{rect:R,fillhandle:B,role:n}),t.tableGroup.insertAfter(R,"body"===n?t.bodyGroup:"columnHeader"===n?t.colHeaderGroup:"rowHeader"===n?t.rowHeaderGroup:"cornerHeader"===n?t.cornerHeaderGroup:"rightTopCorner"===n?t.rightTopCornerGroup:"rightFrozen"===n?t.rightFrozenGroup:"leftBottomCorner"===n?t.leftBottomCornerGroup:"bottomFrozen"===n?t.bottomFrozenGroup:t.rightBottomCornerGroup),v&&t.tableGroup.insertAfter(B,"body"===n?t.bodyGroup:"columnHeader"===n?t.colHeaderGroup:"rowHeader"===n?t.rowHeaderGroup:"cornerHeader"===n?t.cornerHeaderGroup:"rightTopCorner"===n?t.rightTopCornerGroup:"rightFrozen"===n?t.rightFrozenGroup:"leftBottomCorner"===n?t.leftBottomCornerGroup:"bottomFrozen"===n?t.bottomFrozenGroup:t.rightBottomCornerGroup)}(this,t,e,i,o,r,n,s)}moveSelectingRangeComponentsToSelectedRangeComponents(){Vx(this)}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,i)=>{var o;i.split("-")[4]===t.lastSelectId&&(e.rect.delete(),null===(o=e.fillhandle)||void 0===o||o.delete(),t.selectedRangeComponents.delete(i))}))}deleteAllSelectBorder(){Xx(this),Yx(this)}updateCellSelectBorder(t){Gx(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}removeFillHandleFromSelectComponents(){this.selectedRangeComponents.forEach(((t,e)=>{var i;null===(i=t.fillhandle)||void 0===i||i.delete(),t.fillhandle=void 0}))}recreateAllSelectRangeComponents(){Xx(this),this.table.stateManager.select.ranges.forEach((t=>{Gx(this,t)})),Vx(this)}updateColWidth(t,e,i,o){(function(t,e,i,o){o||t.table._setColWidth(e,t.table.getColWidth(e)+i,!0);const r=t.getColGroup(e,!0),n=t.getColGroupInRightTopCorner(e);r&&!n&&Ey(r,i,"col-corner",t),n&&Ey(n,i,"right-top",t);const s=t.getColGroup(e);s&&Ey(s,i,"row-body",t);const a=t.getColGroupInLeftBottomCorner(e);a&&Ey(a,i,"left-bottom",t);const l=t.getColGroupInBottom(e);l&&Ey(l,i,"bottom",t);const h=t.getColGroupInRightBottomCorner(e);h&&Ey(h,i,"right-bottom",t),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.bodyGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))),a&&t.leftBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),l&&t.bottomFrozenGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),h&&t.rightBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))})(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){!function(t,e){const{table:i}=t,o=i.internalProps.layoutMap,r=-1===e?"all":i.internalProps.columnResizeType;if("column"===r){const o=t.getColGroup(e);if(null==o||o.forEachChildren((t=>{lS(t,i.getColWidth(t.col),i.getRowHeight(t.row))})),"adaptive"===i.widthMode&&e<i.colCount-1){const o=t.getColGroup(e+1);null==o||o.forEachChildren((t=>{lS(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}else{let n,s,a,l=i.rowHeaderLevelCount,h=i.colCount-1;if("indicator"===r)if(o.indicatorsAsCol)n=o.getIndicatorKey(e,i.columnHeaderLevelCount);else{const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),r=t.colHeaderPaths[t.colHeaderPaths.length-1];s=r.dimensionKey,a=r.value}else if("indicatorGroup"===r){const t=i.internalProps.layoutMap,e=t.getCellHeaderPaths(i.stateManager.columnResize.col,i.columnHeaderLevelCount),o=t.getHeadNodeByRowOrColDimensions(e.colHeaderPaths.slice(0,e.colHeaderPaths.length-1));l=o.startInTotal+i.frozenColCount,h=o.startInTotal+i.frozenColCount+o.size-1}for(let e=l;e<=h;e++){const l=t.getColGroup(e);if(l){if("indicator"===r){const t=o.getIndicatorKey(e,i.columnHeaderLevelCount);if(o.indicatorsAsCol&&t!==n)continue;if(!o.indicatorsAsCol){const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),r=null==t?void 0:t.colHeaderPaths[t.colHeaderPaths.length-1];if(!r||s!==r.dimensionKey||a!==r.value)continue}}l.forEachChildren((t=>{lS(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}}}(this,t)}updateChartSizeForResizeRowHeight(t){!function(t,e){var i;const{table:o}=t,r=o.internalProps.layoutMap,n=o.stateManager,s=-1===e?"all":o.internalProps.rowResizeType;let a,l,h,d=o.columnHeaderLevelCount,c=o.rowCount-1;if("indicator"===s)if(r.indicatorsAsCol){const t=r.getCellHeaderPaths(o.rowHeaderLevelCount-1,e),n=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];l=null==n?void 0:n.dimensionKey,h=null==n?void 0:n.value}else a=r.getIndicatorKey(o.rowHeaderLevelCount,e);else if("indicatorGroup"===s){const t=o.internalProps.layoutMap,i=t.getCellHeaderPaths(o.rowHeaderLevelCount,e),r=t.getHeadNodeByRowOrColDimensions(i.rowHeaderPaths.slice(0,i.rowHeaderPaths.length-1));d=r.startInTotal+o.frozenRowCount,c=r.startInTotal+o.frozenRowCount+r.size-1}for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++)if("row"===s){const r=t.highPerformanceGetCell(i,e);if("cell"!==r.role)continue;if(lS(r,o.getColWidth(r.col),o.getRowHeight(r.row)),"adaptive"===o.heightMode&&e<o.rowCount-1){const r=t.highPerformanceGetCell(i,e+1);lS(r,o.getColWidth(r.col),o.getRowHeight(r.row))}}else for(let e=d;e<=c;e++){if("indicator"===s){const t=r.getIndicatorKey(n.table.rowHeaderLevelCount,e);if(!r.indicatorsAsCol&&t!==a)continue;if(r.indicatorsAsCol){const t=r.getCellHeaderPaths(n.table.rowHeaderLevelCount-1,e),i=null==t?void 0:t.rowHeaderPaths[t.rowHeaderPaths.length-1];if(!i||l!==i.dimensionKey||h!==i.value)continue}}const d=t.highPerformanceGetCell(i,e);"cell"===d.role&&lS(d,o.getColWidth(d.col),o.getRowHeight(d.row))}}(this,t)}updateChartState(t){this.table.isPivotChart()&&aS(this,t)}updateCheckboxCellState(t,e,i){var o,r;this.table.transpose?null===(o=this.bodyGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))})):null===(r=this.getColGroup(t).children)||void 0===r||r.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}))}updateHeaderCheckboxCellState(t,e,i){var o,r;this.table.transpose?null===(o=this.rowHeaderGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))})):null===(r=this.getColGroup(t,!0).children)||void 0===r||r.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))}))}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=ex(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;"adaptive"===t.widthMode||t.autoFillWidth||t.internalProps.transpose?tx(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&tx(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&tx(this.table,t.rightFrozenColCount,t.colCount-1,!0),tx(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,"adaptive"===t.heightMode||t.autoFillHeight?Sy(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&Sy(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&Sy(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),Sy(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),("adaptive"===this.table.widthMode||this.table.autoFillWidth)&&(0===this.table.internalProps._widthResizedColMap.size?this.recalculateColWidths():this.dealWidthMode()),"adaptive"===this.table.heightMode?0===this.table.internalProps._heightResizedRowMap.size?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),("adaptive"===this.table.widthMode||"adaptive"===this.table.heightMode||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o,r,n,s,a,l,h,d,c,u;if(this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border){const g=null===(t=this.tableGroup.border)||void 0===t?void 0:t.attribute;let p,f,v,b;(null==g?void 0:g.strokeArrayWidth)?(p=g.strokeArrayWidth?g.strokeArrayWidth[0]:null!==(e=g.lineWidth)&&void 0!==e?e:0,f=g.strokeArrayWidth?g.strokeArrayWidth[1]:null!==(i=g.lineWidth)&&void 0!==i?i:0,v=g.strokeArrayWidth?g.strokeArrayWidth[2]:null!==(o=g.lineWidth)&&void 0!==o?o:0,b=g.strokeArrayWidth?g.strokeArrayWidth[3]:null!==(r=g.lineWidth)&&void 0!==r?r:0):(p=null!==(n=null==g?void 0:g.lineWidth)&&void 0!==n?n:0,f=null!==(s=null==g?void 0:g.lineWidth)&&void 0!==s?s:0,v=null!==(a=null==g?void 0:g.lineWidth)&&void 0!==a?a:0,b=null!==(l=null==g?void 0:g.lineWidth)&&void 0!==l?l:0),"rect"===this.tableGroup.border.type?(null===(h=this.table.theme.frameStyle)||void 0===h?void 0:h.innerBorder)?this.tableGroup.border.setAttributes({x:this.table.tableX+b/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-b/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-b/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+b/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}):"group"===this.tableGroup.border.type&&((null===(d=this.table.theme.frameStyle)||void 0===d?void 0:d.innerBorder)?(this.tableGroup.border.setAttributes({x:this.table.tableX+b/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-b/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}),null===(c=this.tableGroup.border.firstChild)||void 0===c||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-b/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-b/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+b/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}),null===(u=this.tableGroup.border.firstChild)||void 0===u||u.setAttributes({x:b/2,y:p/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height})))}this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){ky(this,t,e=Math.round(e),i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const r=t[o];if(r>=this.proxy.rowStart&&r<=this.proxy.rowEnd){const t=e[o];ky(this,r,Math.round(t),i),this._updateContainerHeight(r,t)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setX(-t,e)}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=null===(e=this.bodyGroup.firstChild)||void 0===e?void 0:e.firstChild,r=null===(i=this.bodyGroup.firstChild)||void 0===i?void 0:i.lastChild;0===t&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:r&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&r.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&r.attribute.y+r.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-r.attribute.y-r.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;0===t&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),Lx(this.table),this.table.options.animationAppear&&function(t){var e,i,o,r;if(!t.options.animationAppear)return;let n,s,a,l;!0===t.options.animationAppear?(n=500,s=0,a="one-by-one",l="column"):(n=null!==(e=t.options.animationAppear.duration)&&void 0!==e?e:500,s=null!==(i=t.options.animationAppear.delay)&&void 0!==i?i:0,a=null!==(o=t.options.animationAppear.type)&&void 0!==o?o:"one-by-one",l=null!==(r=t.options.animationAppear.direction)&&void 0!==r?r:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:c}=t,{colStart:u,colEnd:g,rowStart:p,rowEnd:f}=h.proxy;for(let t=0;t<=g;t++)for(let e=0;e<=f;e++){const i=h.highPerformanceGetCell(t,e);i&&"cell"===i.role&&i.forEachChildren((i=>{i.setAttribute("opacity",0),i.animate().wait("one-by-one"===a?("row"===l?e:t)*(n-s):s).to({opacity:1},n,"linear")}))}}(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0;for(let e=0;e<t.colCount;e++)(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=t.getColWidth(e));sx(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,o=0;for(let e=0;e<t.colCount;e++){const r=t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r),o+=r}if(o<e&&o>i){sx(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{o+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",o);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{r+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",r),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if("adaptive"===e.heightMode){e._clearRowRangeHeightsMap();const t=e.getRowsHeight(0,e.columnHeaderLevelCount-1),i=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,o=e.tableNoFrameHeight-t-i,r=e.columnHeaderLevelCount,n=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let s=0;for(let t=r;t<n;t++)s+=e.getRowHeight(t);const a=o/s;for(let t=r;t<n;t++){let i;i=t===n-1?o-e.getRowsHeight(r,n-2):Math.round(e.getRowHeight(t)*a),this.setRowHeight(t,i)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,r=0;for(let t=0;t<e.rowCount;t++){const i=e.getRowHeight(t);(t<e.columnHeaderLevelCount||e.isPivotChart()&&t>=e.rowCount-e.bottomFrozenRowCount)&&(r+=i),o+=i}if((null!==(t=this._dealAutoFillHeightOriginRowsHeight)&&void 0!==t?t:o)<i&&o-r>0){const t=e.columnHeaderLevelCount,n=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,s=(i-r)/(o-r);for(let o=t;o<n;o++){let a;a=o===n-1?i-r-e.getRowsHeight(t,n-2):Math.round(e.getRowHeight(o)*s),this.setRowHeight(o,a)}}}}dealFrozen(){!function(t){var e,i;if(t.table.frozenColCount>t.table.rowHeaderLevelCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.table.rowHeaderLevelCount;e++)Qx(t),tS(t),oS(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)eS(t),iS(t),rS(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.frozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0}(this)}resetFrozen(){!function(t){var e,i;if(t.frozenColCount>t.table.frozenColCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.frozenColCount-t.table.frozenColCount;e++)eS(t),iS(t),rS(t)}else if(t.frozenColCount<t.table.frozenColCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.frozenColCount;e++)Qx(t),tS(t),oS(t)}t.deleteAllSelectBorder(),t.table.stateManager.select.ranges.forEach((e=>{t.updateCellSelectBorder(e)})),t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0,t.proxy.colStart=t.table.frozenColCount,t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0}(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let r=!1;return t.forEachChildren(((t,n)=>{n+=e;const s=lm(this.table,i,n);s?t=this.getCell(s.start.col,s.start.row):t.setAttribute("width",o);const a=Dm(VC("padding",this.table._getCellStyle(i,n),i,n,this.table)),l=t.getChildByName("text");let h=0,d=0;if(l)h=l.AABBBounds.height()+(a[0]+a[2]),l.setAttribute("maxLineWidth",o-(a[1]+a[3])),d=l.AABBBounds.height()+(a[0]+a[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(a[0]+a[2]),e._cellWidth=o-(a[1]+a[3]),e.layout(),d=e.AABBBounds.height()+(a[0]+a[2])}const c=this.table.getRowHeight(n);t.attribute.height!==d&&(t.setAttribute("height",d),(c===h||d>c)&&(r=!0))})),r}updateHeaderPosition(t,e,i,o,r){!function(t,e,i,o,r,n){const s=n.scenegraph;for(let i=t;i<=e;i++){const t=n.getColWidth(i),e=n.scenegraph.getColGroup(i,!0),o=n.scenegraph.getColGroup(i),r=n.scenegraph.getColGroupInBottom(i),s=n.scenegraph.getColGroupInLeftBottomCorner(i),a=n.scenegraph.getColGroupInRightBottomCorner(i);e&&(e.setAttribute("width",t),e.forEachChildren((e=>{e.setAttribute("width",t)}))),o&&(o.setAttribute("width",t),o.forEachChildren((e=>{e.setAttribute("width",t)}))),r&&(r.setAttribute("width",t),r.forEachChildren((e=>{e.setAttribute("width",t)}))),a&&(a.setAttribute("width",t),a.forEachChildren((e=>{e.setAttribute("width",t)}))),s&&(s.setAttribute("width",t),s.forEachChildren((e=>{e.setAttribute("width",t)})))}if(s.updateContainer(),"column"===r)for(let i=t;i<=e;i++){const t=n.scenegraph.getColGroup(i);null==t||t.setAttribute("chartInstance",void 0);for(let t=0;t<=n.frozenRowCount-1;t++)s.updateCellContent(i,t);for(let t=s.bodyRowStart;t<=s.bodyRowEnd;t++)s.updateCellContent(i,t);for(let t=n.rowCount-n.bottomFrozenRowCount;t<=n.rowCount-1;t++)s.updateCellContent(i,t)}else{for(let t=0;t<=n.frozenColCount-1;t++){const e=n.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=s.bodyColStart;t<=s.bodyColEnd;t++){const e=n.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=n.colCount-n.rightFrozenColCount;t<=n.colCount-1;t++){const e=n.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}}}(t,e,i,o,r,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=dS(this.cornerHeaderGroup,0),r=dS(this.rowHeaderGroup,0),n=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?dS(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth(null!==(t=this.table.frozenColCount)&&void 0!==t?t:0,this.colHeaderGroup.firstChild.col-1):0):0,s=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?dS(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth(null!==(e=this.table.frozenColCount)&&void 0!==e?e:0,this.bodyGroup.firstChild.col-1):0):0,a=dS(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&dS(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth(null!==(i=this.table.frozenColCount)&&void 0!==i?i:0,this.bottomFrozenGroup.firstChild.col-1):0),dS(this.leftBottomCornerGroup,0),dS(this.rightTopCornerGroup,0),dS(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(n-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(r-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(n-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(a-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(a-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(a-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(s-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout((()=>{this.updateContainerSync()}),0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){var i;const o=(null===(i=this.table.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),r=this.getCell(t,e);"image"!==o&&"video"!==o||ey(r,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;rw(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),rw(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),rw(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),rw(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),rw(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i){let o,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(!i){const i=this.table.getDrawRange();return e>=i.top&&e<=i.bottom?(o=this.table.getCellAtRelativePosition(t-r,e),o):{col:-1,row:-1}}return t<i.globalAABBBounds.x1+r?o={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-r<t&&(o={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),o&&this.table.rightFrozenColCount>0&&o.col===this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(o.col=o.col+1,o.rightFrozen=!0),o||{col:-1,row:-1}}getResizeRowAt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(i){let t;if(e<i.globalAABBBounds.y1+o?t={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(t={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),t&&this.table.bottomFrozenRowCount>0&&t.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(t.row=t.row+1,t.bottomFrozen=!0),t)return t}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:function(t,e){const{table:i,proxy:o,rightTopCornerGroup:r,rightFrozenGroup:n,rightBottomCornerGroup:s,bottomFrozenGroup:a,bodyGroup:l,colHeaderGroup:h}=e,d=e.table.rightFrozenColCount;if(t>d){for(let o=i.colCount-d-1;o>=i.colCount-t;o--)nS(n,e.getColGroup(o),n.firstChild),nS(r,e.getColGroup(o,!0),r.firstChild),nS(s,e.getColGroupInBottom(o),s.firstChild);let o=0;n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}else if(t<d){for(let o=i.colCount-d;o<i.colCount-t;o++){const t=e.getColGroup(o);t.setAttribute("x",l.lastChild.attribute.x+i.getColWidth(l.lastChild.col)),l.appendChild(t);const r=e.getColGroupInRightTopCorner(o);r.setAttribute("x",h.lastChild.attribute.x+i.getColWidth(h.lastChild.col)),h.appendChild(r);const n=e.getColGroupInRightBottomCorner(o);n.setAttribute("x",a.lastChild.attribute.x+i.getColWidth(a.lastChild.col)),a.appendChild(n)}let o=0;n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}n.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),r.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),s.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),i.internalProps.rightFrozenColCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:function(t,e){const{table:i,proxy:o,bottomFrozenGroup:r,leftBottomCornerGroup:n,rightBottomCornerGroup:s}=e;r.childrenCount||(o.table.isPivotChart()||(cx(n,0,0,0,i.frozenColCount-1,0,-1,"rowHeader",i),cx(s,0,0,i.colCount-i.rightFrozenColCount,i.colCount-1,0,-1,"body",i)),cx(r,0,0,o.colStart,o.colEnd,0,-1,"body",i));const a=e.table.bottomFrozenRowCount;if(t>a){for(let o=0;o<i.frozenColCount;o++){const r=e.getColGroupInLeftBottomCorner(o);for(let n=i.rowCount-a-1;n>=i.rowCount-t;n--)nS(r,e.getCell(o,n,!0),r.firstChild);let n=0;r.forEachChildren((t=>{t.setAttribute("y",n),n+=i.getRowHeight(t.row)}))}for(let r=o.colStart;r<=o.colEnd;r++){const o=e.getColGroupInBottom(r);for(let n=i.rowCount-a-1;n>=i.rowCount-t;n--)nS(o,e.getCell(r,n,!0),o.firstChild);let n=0;o.forEachChildren((t=>{t.setAttribute("y",n),n+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const r=e.getColGroupInRightBottomCorner(o);for(let n=i.rowCount-a-1;n>=i.rowCount-t;n--)nS(r,e.getCell(o,n,!0),r.firstChild);let n=0;r.forEachChildren((t=>{t.setAttribute("y",n),n+=i.getRowHeight(t.row)}))}}else if(t<a){for(let o=0;o<i.rowHeaderLevelCount;o++){const r=e.getColGroup(o);for(let n=i.rowCount-a;n<i.rowCount-t;n++){const t=e.getCell(o,n,!0);t.setAttribute("y",r.lastChild.attribute.y+i.getRowHeight(r.lastChild.row)),r.appendChild(t)}const n=e.getColGroupInLeftBottomCorner(o);let s=0;n.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}for(let r=o.colStart;r<=o.colEnd;r++){const o=e.getColGroup(r);for(let n=i.rowCount-a;n<i.rowCount-t;n++){const t=e.getCell(r,n,!0);t.setAttribute("y",o.lastChild.attribute.y+i.getRowHeight(o.lastChild.row)),o.appendChild(t)}const n=e.getColGroupInBottom(r);let s=0;n.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const r=e.getColGroup(o);for(let n=i.rowCount-a;n<i.rowCount-t;n++){const t=e.getCell(o,n,!0);t.setAttribute("y",r.lastChild.attribute.y+i.getRowHeight(r.lastChild.row)),r.appendChild(t)}const n=e.getColGroupInRightBottomCorner(o);let s=0;n.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}}r.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),n.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),s.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),i.internalProps.bottomFrozenRowCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),aw(this.bodyGroup),this.rowHeaderGroup.attribute.width,nw(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),aw(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,nw(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),aw(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),aw(this.cornerHeaderGroup)),function(t){if(!t.theme.frameStyle.cornerRadius)return;const e=t.theme.frameStyle.cornerRadius,{cornerHeaderGroup:i,colHeaderGroup:o,rowHeaderGroup:r,bodyGroup:n,rightTopCornerGroup:s,leftBottomCornerGroup:a,rightBottomCornerGroup:l,rightFrozenGroup:h,bottomFrozenGroup:d}=t.scenegraph;i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0);const c=wb(e);i.attribute.width>0&&i.attribute.height>0?lw(i,[c[0],0,0,0]):o.attribute.height>0?lw(o,[c[0],0,0,0]):r.attribute.width>0?lw(r,[c[0],0,0,0]):lw(n,[c[0],0,0,0]),a.attribute.width>0&&a.attribute.height>0?lw(a,[0,0,0,c[3]]):d.attribute.height>0?lw(d,[0,0,0,c[3]]):r.attribute.width>0?lw(r,[0,0,0,c[3]]):lw(n,[0,0,0,c[3]]),s.attribute.width>0&&s.attribute.height>0?lw(s,[0,c[1],0,0]):o.attribute.height>0?lw(o,[0,c[1],0,0]):h.attribute.width>0?lw(h,[0,c[1],0,0]):lw(n,[0,c[1],0,0]),l.attribute.width>0&&l.attribute.height>0?lw(l,[0,0,c[2],0]):h.attribute.width>0?lw(h,[0,0,c[2],0]):d.attribute.height>0?lw(d,[0,0,c[2],0]):lw(n,[0,0,c[2],0])}(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const r=this.getCell(t,e).getChildByName("text",!0);if(r&&"text"===r.type){if(r.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const n=rt(r.attribute.text)?r.attribute.text.join(""):r.attribute.text;let s="";if(ot(r.cache.clipedText)?s=r.cache.clipedText:null===(o=null===(i=r.cache.layoutData)||void 0===i?void 0:i.lines)||void 0===o||o.forEach((t=>{s+=t.str})),s!==n)return this.table.getCellValue(t,e)}else if(r&&"richtext"===r.type){const i=r;if(i.attribute.ellipsis&&i._frameCache&&i.attribute.height<i._frameCache.actualHeight)return i.attribute.textConfig.find((t=>t.text)),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,r){this.component.drillIcon.update(t,e,i,o,r,this)}updateCellContent(t,e){if(!this.clear)return ny(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const o=nb(e.map((t=>t.row))).sort(((t,e)=>t-e)),r=nb(i.map((t=>t.row))).sort(((t,e)=>t-e)),n=this.table.getAllRowsHeight()-[...o,...r].reduce(((t,e)=>t+this.table.getRowHeight(e)),0)<=this.table.tableNoFrameHeight;if($x(t,e,i,this.table),this.recalculateColWidths(),"adaptive"===this.table.heightMode||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||n))this.table.scenegraph.recalculateRowHeights();else if("autoHeight"===this.table.heightMode)for(let t=0;t<r.length;t++){const e=r[t],i=this.table.getRowHeight(e),o=_y(e,0,this.table.colCount-1,this.table);(e>=this.proxy.rowStart&&e<=this.proxy.rowEnd||e>=this.table.rowCount-this.table.bottomFrozenRowCount&&e<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(e,o-i)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e){vS(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){var t,e;const{headerDomContainer:i,bodyDomContainer:o}=this.table.internalProps;if(this.table.frozenColCount>0&&(i||o)){const t=this.table.getFrozenColsWidth();i&&(i.style.left=`${t}px`),o&&(o.style.left=`${t}px`)}if(i&&(i.style.width=`${Math.min(this.table.getAllColsWidth(),this.table.tableNoFrameWidth)}px`,i.style.height=`${this.table.getFrozenRowsHeight()}px`),o){const i=this.table.getFrozenRowsHeight()+this.table.getBottomFrozenRowsHeight();o.style.width=`${Math.min(this.table.getAllColsWidth(),this.table.tableNoFrameWidth)}px`,o.style.height=(null!==(e=null===(t=o.parentElement)||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:1)-1-i+"px",o.style.top=`${this.table.getFrozenRowsHeight()}px`}}}function wS(t,e,i){const o=t.highPerformanceGetCell(e,i);if("cell"===o.role&&J(o.mergeStartCol)&&J(o.mergeStartRow)&&J(o.mergeEndCol)&&J(o.mergeEndRow)){const{colStart:e,colEnd:i,rowStart:r,rowEnd:n}=Py(o,t);for(let o=e;o<=i;o++)for(let e=r;e<=n;e++)t.highPerformanceGetCell(o,e).addUpdateBoundTag()}else o.addUpdateBoundTag()}function xS(t,e,i,o,r){const n=t.table;for(let i=0;i<n.columnHeaderLevelCount;i++)wS(t,e,i);const s=t.getColGroup(e);return null==s||s.addUpdateBoundTag(),!0}function SS(t,e,i,o,r,n){const s=t.table;for(let i=0;i<s.columnHeaderLevelCount;i++)wS(t,e,i);const a=t.getColGroup(e);return null==a||a.addUpdateBoundTag(),!0}function _S(t,e,i,o,r){const n=t.table;for(let e=0;e<n.colCount;e++)wS(t,e,i);return!0}function AS(t,e,i,o,r,n){const s=t.table;for(let e=0;e<s.colCount;e++)wS(t,e,i);return!0}function RS(t,e,i){const{table:o}=t,{scenegraph:r}=o,{highlightScope:n,singleStyle:s,disableHeader:a,cellPos:l,cellPosContainHeader:h}=t.hover,d=l.col,c=l.row;if(n===_v.none||a&&(h.col!==e||h.row!==i)){const t=h.col,o=h.row;r.hideHoverIcon(t,o),r.showHoverIcon(e,i),h.col=e,h.row=i}if((a&&o.isHeader(e,i)||n===_v.none)&&(e=-1,i=-1),d===e&&c===i)return;r.deactivateChart(d,c),r.activateChart(e,i);let u=!1;const{ranges:g,highlightScope:p}=t.select;if(-1!==d&&-1!==c&&(u=function(t,e,i,o,r,n,s){let a=!1;return n===_v.single?a=!!function(t,e,i,o,r){return wS(t,e,i),!0}(t,e,i):n===_v.row?a=!!_S(t,0,i):n===_v.column?a=!!xS(t,e):n===_v.cross&&(a=!!_S(t,0,i),a=!!xS(t,e)),a}(r,d,c,0,0,n),a||r.hideHoverIcon(d,c)),-1===e||-1===i)return l.col=-1,l.row=-1,void(!u||d===e&&c===i||t.table.scenegraph.updateNextFrame());n===_v.single?u=!!function(t,e,i,o,r){return wS(t,e,i),!0}(r,e,i):n===_v.row?u=!!AS(r,0,i):n===_v.column?u=!!SS(r,e):n===_v.cross&&(u=!!AS(r,0,i),u=!!SS(r,e)),n===_v.none||a||r.showHoverIcon(e,i),l.col=e,l.row=i,u&&t.table.scenegraph.updateNextFrame()}function BS(t,e,i,o){var r;let n,s=null,a=!1;if(Array.isArray(i.sortState))for(let o=0;o<i.sortState.length&&(n=i.sortState[o],n&&(s=i._getHeaderCellBySortState(n)),s&&(a=MS(t,e,s.col,s.row,i)),!a);o++);else n=i.sortState,n&&(s=i._getHeaderCellBySortState(n)),s&&(a=MS(t,e,s.col,s.row,i));const l=i.getHeaderDefine(t,e);if(n&&a&&(null==l?void 0:l.sort)?n.order="asc"===n.order?"desc":"desc"===n.order?"normal":"asc":(null==l?void 0:l.sort)?n={field:i.getHeaderField(t,e),order:"asc"}:a&&(null==l?void 0:l.showSort)||(n={field:i.getHeaderField(t,e),order:"normal"}),n.event=o,i.fireListeners(kb.SORT_CLICK,n).includes(!1))return;i.internalProps.sortState=n,i.stateManager.setSortState(n),(null==l?void 0:l.sort)&&function(t,e,i){const o=e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));if(!o)return;const{field:r}=o;null!==r&&("function"==typeof i.sort?e.dataSource.sort(r,t.order||"asc",i.sort):e.dataSource.sort(r,t.order||"asc",rb))}(n,i,l),i.internalProps.useOneRowHeightFillAll=!1,i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.sortCell();const h=!!(null===(r=i.stateManager.select.ranges)||void 0===r?void 0:r.length);i.stateManager.updateSelectPos(-1,-1),i.stateManager.endSelectCells(!0,h)}function MS(t,e,i,o,r){return r._getLayoutCellId(t,e)===r._getLayoutCellId(i,o)}const TS=fb(kb,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function PS(t,e,i,o,r){for(let i=t;i<=e;i++)r._clearColRangeWidthsMap(i);for(let t=i;t<=o;t++)r._clearRowRangeHeightsMap(t)}function kS(t){var e;if(!t)return;const i=(null===(e=t.role)||void 0===e?void 0:e.startsWith("icon"))?t:"richtext"===t.type?t._currentHoverIcon:void 0;return i?"richtext"===t.type?{icon:i,position:{left:t.globalAABBBounds.x1+i.globalAABBBounds.x1,right:t.globalAABBBounds.x1+i.globalAABBBounds.x2,top:t.globalAABBBounds.y1+i.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"richtext-icon"}:{icon:i,position:{left:i.globalAABBBounds.x1,right:i.globalAABBBounds.x2,top:i.globalAABBBounds.y1,bottom:i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"icon"}:void 0}function LS(t,e){"adaptive"===e.table.widthMode&&e.columnResize.col<e.table.colCount-1?(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.scenegraph.updateColWidth(e.columnResize.col+1,-t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col),e.table.internalProps._widthResizedColMap.add(e.columnResize.col+1)):(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col))}function HS(t,e){"adaptive"===e.table.heightMode&&e.rowResize.row<e.table.rowCount-1?(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.scenegraph.updateRowHeight(e.rowResize.row+1,-t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row+1)):(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row))}fb(kb,{VCHART_EVENT_TYPE:"vchart_event_type"});function ES(t){if(t.eventManager.bindSparklineHoverEvent)return;let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.cellType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.cellType||"function"==typeof t.cellType)),e&&(t.eventManager.bindSparklineHoverEvent=!0,t.on(kb.MOUSEMOVE_CELL,(e=>{const{col:i,row:o,x:r,y:n}=e;"sparkline"!==t.getBodyColumnType(i,o)&&t.stateManager.updateSparklineHoverPose(-1,-1,0,0),t.stateManager.updateSparklineHoverPose(i,o,r,n)})),t.on(kb.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateSparklineHoverPose(-1,-1,0,0)})))}function zS(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],{deltaX:o,deltaY:r}=t;t.shiftKey&&t.deltaY&&(o=r,r=0);const[n,s]=function(t,e,i){var o,r;const n=Math.abs(t/e),s=n<=.5?0:t,a=n>2?0:e;return[Math.ceil(s*(null!==(o=i.horizontal)&&void 0!==o?o:0)),Math.ceil(a*(null!==(r=i.vertical)&&void 0!==r?r:0))]}(o,r,{horizontal:1,vertical:1});(n||s)&&e.interactionState!==Sv.scrolling&&e.updateInteractionState(Sv.scrolling),n&&(e.setScrollLeft(e.scroll.horizontalBarPos+n,t),e.showHorizontalScrollBar(!0)),s&&(e.setScrollTop(e.scroll.verticalBarPos+s,t),e.showVerticalScrollBar(!0)),i&&e.resetInteractionState(),t.cancelable&&("none"===e.table.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(o)&&0!==r&&FS(r,e)||Math.abs(r)<=Math.abs(o)&&0!==o&&IS(o,e))&&t.preventDefault()}function FS(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&!function(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,r=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==r&&t>=0&&Math.abs(e.scroll.verticalBarPos-r)<1+o}(t,e)}function IS(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&!function(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,r=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==r&&t>=0&&Math.abs(e.scroll.horizontalBarPos-r)<1+o}(t,e)}class OS{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const r=Math.pow(this.friction,i/16),n=r*this.speedX,s=r*this.speedY;let a=0,l=0;Math.abs(n)>.05&&(o=!1,a=(this.speedX+n)/2*i),Math.abs(s)>.05&&(o=!1,l=(this.speedY+s)/2*i),null===(t=this.scrollHandle)||void 0===t||t.call(this,a,l),o?this.runingId=null:(this.lastTime=e,this.speedX=n,this.speedY=s,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function DS(t){const e=t.table,i=e.stateManager;e.scenegraph.tableGroup.addEventListener("pointermove",(o=>{var r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C;const y=null!==(n=null===(r=e.eventManager.LastPointerXY)||void 0===r?void 0:r.x)&&void 0!==n?n:o.x,w=null!==(a=null===(s=e.eventManager.LastPointerXY)||void 0===s?void 0:s.y)&&void 0!==a?a:o.y;e.eventManager.LastPointerXY={x:o.x,y:o.y},t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const x=RC(o);if(i.interactionState===Sv.grabing&&!(null===(l=e.editorManager)||void 0===l?void 0:l.editingEditor))return void(Math.abs(y-o.x)+Math.abs(w-o.y)>=1&&(i.isResizeCol()||(i.isMoveCol()?t.dealColumnMover(x):i.isFillHandle()?t.dealFillSelect(x,!0):(null===(h=e.options.select)||void 0===h?void 0:h.disableDragSelect)||t.dealTableSelect(x,!0))));e.eventManager.isDraging&&i.isSelecting()&&!(null===(d=e.editorManager)||void 0===d?void 0:d.editingEditor)&&t.dealTableSelect(x,!0);const S=o.path.find((t=>"cell"===t.role));if(e.hasListeners(kb.MOUSELEAVE_CELL)&&(-1===e.stateManager.hover.cellPos.col||-1===e.stateManager.hover.cellPos.row||(null==S?void 0:S.col)===e.stateManager.hover.cellPos.col&&(null==S?void 0:S.row)===e.stateManager.hover.cellPos.row||e.fireListeners(kb.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(c=null==x?void 0:x.eventArgs)||void 0===c?void 0:c.target})),e.hasListeners(kb.MOUSEENTER_CELL)&&("cell"!==(null==S?void 0:S.role)||!J(S.col)||!J(S.row)||S.col===e.stateManager.hover.cellPos.col&&S.row===e.stateManager.hover.cellPos.row||S.col===(null===(u=e.stateManager.hover.cellPosContainHeader)||void 0===u?void 0:u.col)&&S.row===(null===(g=e.stateManager.hover.cellPosContainHeader)||void 0===g?void 0:g.row)||e.fireListeners(kb.MOUSEENTER_CELL,{col:S.col,row:S.row,cellRange:e.getCellRangeRelativeRect({col:S.col,row:S.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(p=null==x?void 0:x.eventArgs)||void 0===p?void 0:p.target,mergeCellInfo:null===(f=x.eventArgs)||void 0===f?void 0:f.mergeInfo})),t.dealIconHover(x),t.dealTableHover(x),x.eventArgs&&e.hasListeners(kb.MOUSEMOVE_CELL)){let t,i;if(null===(v=x.eventArgs)||void 0===v?void 0:v.target){const e=kS(null===(b=x.eventArgs)||void 0===b?void 0:b.target);e&&(t=e.icon,i=e.position)}e.fireListeners(kb.MOUSEMOVE_CELL,{col:x.eventArgs.col,row:x.eventArgs.row,x:x.abstractPos.x,y:x.abstractPos.y,event:o.nativeEvent,targetIcon:t?{name:t.name,position:i,funcType:t.attribute.funcType}:void 0,target:null===(m=null==x?void 0:x.eventArgs)||void 0===m?void 0:m.target,mergeCellInfo:null===(C=x.eventArgs)||void 0===C?void 0:C.mergeInfo})}})),e.scenegraph.tableGroup.addEventListener("pointerout",(e=>{var i;const o=RC(e),r=null===(i=null==o?void 0:o.eventArgs)||void 0===i?void 0:i.target;"table"===(null==r?void 0:r.role)&&t.dealTableHover()})),e.scenegraph.tableGroup.addEventListener("pointerover",(t=>{var i,o;const r=RC(t),n=null===(i=null==r?void 0:r.eventArgs)||void 0===i?void 0:i.target;if(n&&e.hasListeners(kb.MOUSEOVER_CHART_SYMBOL)&&"symbol"===n.type){const i=t.composedPath().find((t=>"cell"===t.roll));if(i){const{col:n,row:s}=i,a={col:n,row:s,field:e.getHeaderField(n,s),value:e.getCellValue(n,s),dataValue:e.getCellOriginValue(n,s),cellHeaderPaths:e.internalProps.layoutMap.getCellHeaderPaths(n,s),title:e.getBodyColumnDefine(n,s).title,cellRange:e.getCellRelativeRect(n,s),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.target};e.fireListeners(kb.MOUSEOVER_CHART_SYMBOL,a)}}})),e.scenegraph.tableGroup.addEventListener("pointerenter",(t=>{(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showVerticalScrollBar(),e.hasListeners(kb.MOUSEENTER_TABLE)&&e.fireListeners(kb.MOUSEENTER_TABLE,{event:t.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerleave",(o=>{i.isResizeCol()||i.isMoveCol()||i.isSelecting()||(i.updateInteractionState(Sv.default),i.updateCursor()),(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideVerticalScrollBar(),e.hasListeners(kb.MOUSELEAVE_CELL)&&-1!==e.stateManager.hover.cellPos.col&&-1!==e.stateManager.hover.cellPos.row&&e.fireListeners(kb.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:void 0}),t.dealTableHover();const r=o.target;r&&!r.isDescendantsOf(e.scenegraph.tableGroup)&&e.fireListeners(kb.MOUSELEAVE_TABLE,{event:o.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerupoutside",(o=>{var r,n,s,a,l,h,d,c,u;const g=RC(o);if(i.menu.isShow&&(null===(r=g.eventArgs)||void 0===r?void 0:r.target)!==(null===(n=i.residentHoverIcon)||void 0===n?void 0:n.icon)&&setTimeout((()=>{e.internalProps.menuHandler.pointInMenuElement(o.client.x,o.client.y)||i.menu.isShow&&i.hideMenu()}),0),i.isResizeCol())NS(e);else if(i.isResizeRow())GS(e);else if(i.isMoveCol())e.stateManager.endMoveCol()&&-1!==(null===(s=e.stateManager.columnMove)||void 0===s?void 0:s.colSource)&&-1!==(null===(a=e.stateManager.columnMove)||void 0===a?void 0:a.rowSource)&&-1!==(null===(l=e.stateManager.columnMove)||void 0===l?void 0:l.colTarget)&&-1!==(null===(h=e.stateManager.columnMove)||void 0===h?void 0:h.rowTarget)&&e.hasListeners(kb.CHANGE_HEADER_POSITION)&&e.fireListeners(kb.CHANGE_HEADER_POSITION,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource}});else if(i.isSelecting()&&(null===(c=null===(d=e.stateManager.select)||void 0===d?void 0:d.ranges)||void 0===c?void 0:c.length)){const t=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.col,i=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.row;if(e.stateManager.endSelectCells(),e.hasListeners(kb.DRAG_SELECT_END)){const r={event:o.nativeEvent,cells:[],col:t,row:i,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:void 0};r.cells=e.getSelectedCellInfos(),e.fireListeners(kb.DRAG_SELECT_END,r)}}yb(null===(u=e.editorManager)||void 0===u?void 0:u.completeEdit(o.nativeEvent),(o=>{var r,n;if(!1!==o&&(i.updateInteractionState(Sv.default),t.dealTableHover(),null===(r=e.options.select)||void 0===r?void 0:r.outsideClickDeselect)){const e=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);t.dealTableSelect(),i.endSelectCells(!0,e)}}))})),e.scenegraph.tableGroup.addEventListener("pointerdown",(o=>{var r,n,s,a;if(e.hasListeners(kb.MOUSEDOWN_TABLE)&&e.fireListeners(kb.MOUSEDOWN_TABLE,{event:o.nativeEvent}),e.eventManager.isDown=!0,e.eventManager.LastBodyPointerXY={x:o.x,y:o.y},e.eventManager.LastPointerXY={x:o.x,y:o.y},0!==o.button)return;const l=RC(o);if(t.downIcon=void 0,i.interactionState!==Sv.default)return;e.isPivotChart()&&"chart"!==(null===(r=null==l?void 0:l.eventArgs)||void 0===r?void 0:r.target.type)&&e.scenegraph.updateChartState(null),(null===(n=l.eventArgs)||void 0===n?void 0:n.target)!==(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)&&i.hideMenu();yb(null===(a=e.editorManager)||void 0===a?void 0:a.completeEdit(o.nativeEvent),(r=>{var n,s,a,h,d;if(!1===r)return;const c=(null===(a=null===(s=null===(n=null==l?void 0:l.eventArgs)||void 0===n?void 0:n.target)||void 0===s?void 0:s.role)||void 0===a?void 0:a.startsWith("icon"))?l.eventArgs.target:(null===(h=o.target.role)||void 0===h?void 0:h.startsWith("icon"))?o.target:void 0;if(t.downIcon=c,c&&!1!==c.attribute.interactive)c.attribute.funcType===Pv.dragReorder&&(i.startMoveCol(l.eventArgs.col,l.eventArgs.row,l.abstractPos.x,l.abstractPos.y),i.updateInteractionState(Sv.grabing));else if("touch"===o.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&(t.checkColumnResize(l,!0)||t.checkRowResize(l,!0))||!t.touchEnd&&t.chechColumnMover(l)||t.dealTableSelect(l)&&!t.touchEnd)&&i.updateInteractionState(Sv.grabing)}),500),t.dealTableHover(l);else{if(!t.checkCellFillhandle(l)&&(t.checkColumnResize(l,!0)||t.checkRowResize(l,!0)))return e.scenegraph.updateChartState(null),void i.updateInteractionState(Sv.grabing);if(t.chechColumnMover(l))return void i.updateInteractionState(Sv.grabing);if(t.checkCellFillhandle(l,!0)&&t.dealFillSelect(l))return void i.updateInteractionState(Sv.grabing);t.dealTableSelect(l)&&i.updateInteractionState(Sv.grabing)}if(e.hasListeners(kb.MOUSEDOWN_CELL)){const t=RC(o);t.eventArgs&&e.fireListeners(kb.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:o.nativeEvent,target:null===(d=null==t?void 0:t.eventArgs)||void 0===d?void 0:d.target,mergeCellInfo:t.eventArgs.mergeInfo})}}))})),e.scenegraph.tableGroup.addEventListener("pointerup",(t=>{var o,r,n,s;if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(Sv.default),i.isResizeCol())NS(e);else if(i.isResizeRow())GS(e);else if(i.isMoveCol()){const i=RC(t);e.stateManager.endMoveCol()&&i.eventArgs&&e.hasListeners(kb.CHANGE_HEADER_POSITION)&&e.fireListeners(kb.CHANGE_HEADER_POSITION,{target:{col:i.eventArgs.col,row:i.eventArgs.row},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource}})}else if(i.isSelecting()){e.stateManager.endSelectCells(),e.stateManager.isFillHandle()&&e.stateManager.endFillSelect();const i=RC(t);if(e.eventManager.isDraging&&i.eventArgs&&e.hasListeners(kb.DRAG_SELECT_END)){const n={event:t.nativeEvent,cells:[],col:i.eventArgs.target.col,row:i.eventArgs.target.row,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==i?void 0:i.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(r=i.eventArgs)||void 0===r?void 0:r.mergeInfo};n.cells=e.getSelectedCellInfos(),e.fireListeners(kb.DRAG_SELECT_END,n)}}}else i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default);if(e.hasListeners(kb.MOUSEUP_CELL)){const i=RC(t);i.eventArgs&&e.fireListeners(kb.MOUSEUP_CELL,{col:i.eventArgs.col,row:i.eventArgs.row,event:t.nativeEvent,target:null===(n=null==i?void 0:i.eventArgs)||void 0===n?void 0:n.target,mergeCellInfo:null===(s=i.eventArgs)||void 0===s?void 0:s.mergeInfo})}}})),e.scenegraph.tableGroup.addEventListener("rightdown",(t=>{var o,r,n,s;const a=RC(t);if(a.eventArgs){i.triggerContextMenu(a.eventArgs.col,a.eventArgs.row,a.abstractPos.x,a.abstractPos.y);const{col:l,row:h}=a.eventArgs;if(e.hasListeners(kb.CONTEXTMENU_CELL)){const i=e.getCellInfo(l,h);let d,c;if(null===(o=a.eventArgs)||void 0===o?void 0:o.target){const t=kS(null===(r=a.eventArgs)||void 0===r?void 0:r.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(n=null==a?void 0:a.eventArgs)||void 0===n?void 0:n.target,mergeCellInfo:null===(s=a.eventArgs)||void 0===s?void 0:s.mergeInfo});!function(t,e,i){for(let o=0;o<t.length;o++){const r=t[o],n=Math.min(r.start.col,r.end.col),s=Math.max(r.start.col,r.end.col),a=Math.min(r.start.row,r.end.row),l=Math.max(r.start.row,r.end.row);if(n<=e&&e<=s&&a<=i&&i<=l||s<=e&&e<=n&&l<=i&&i<=a)return!0}return!1}(e.stateManager.select.ranges,l,h)?u.cells=[[i]]:u.cells=e.getSelectedCellInfos(),e.fireListeners(kb.CONTEXTMENU_CELL,u)}}})),e.scenegraph.tableGroup.addEventListener("pointertap",(o=>{var r,n,s,a,l;if(e.stateManager.columnResize.resizing||e.stateManager.columnMove.moving)return;const h=RC(o);if(t.dealIconClick(o,h),null==h?void 0:h.eventArgs){if(t.touchSetTimeout&&"touch"===o.pointerType){const e=RC(o);if(t.touchSetTimeout){clearTimeout(t.touchSetTimeout);const o=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);t.dealTableSelect(e),i.endSelectCells(!0,o),t.touchSetTimeout=void 0}}if(!t.touchMove&&0===o.button&&e.hasListeners(kb.CLICK_CELL)){const{col:t,row:i}=h.eventArgs,r=e.getCellInfo(t,i);let d,c;if(null===(n=h.eventArgs)||void 0===n?void 0:n.target){const t=kS(null===(s=h.eventArgs)||void 0===s?void 0:s.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},r),{event:o.nativeEvent,federatedEvent:o,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(a=null==h?void 0:h.eventArgs)||void 0===a?void 0:a.target,mergeCellInfo:null===(l=h.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(kb.CLICK_CELL,u)}}})),e.scenegraph.stage.addEventListener("pointerdown",(o=>{var r,n,s;const a=RC(o);(null===(r=a.eventArgs)||void 0===r?void 0:r.target)!==(null===(n=i.residentHoverIcon)||void 0===n?void 0:n.icon)&&i.hideMenu();yb(null===(s=e.editorManager)||void 0===s?void 0:s.completeEdit(o.nativeEvent),(r=>{var n;if(!1===r)return;const s=(null===(n=o.target.role)||void 0===n?void 0:n.startsWith("icon"))?o.target:void 0;if(t.downIcon=s,s||t.checkCellFillhandle(a)||i.columnResize.resizing||!t.checkColumnResize(a,!0));else{e.scenegraph.updateChartState(null),i.updateInteractionState(Sv.grabing);const{eventArgs:t}=a;(null==t?void 0:t.targetCell)||e.getCellAt(a.abstractPos.x-8,a.abstractPos.y)&&e.hasListeners(kb.MOUSEDOWN_TABLE)&&e.fireListeners(kb.MOUSEDOWN_TABLE,{event:o.nativeEvent})}}))})),e.scenegraph.stage.addEventListener("pointerup",(t=>{"grabing"===i.interactionState&&(i.updateInteractionState(Sv.default),i.isResizeCol()&&NS(e))})),e.scenegraph.stage.addEventListener("pointertap",(o=>{var r,n,s;const a=o.target;if(e.eventManager.isDraging||!a||!a.isDescendantsOf(e.scenegraph.stage)&&a.stage!==a||a.isDescendantsOf(e.scenegraph.tableGroup))e.eventManager.isDraging&&i.isSelecting()&&i.endSelectCells();else{i.updateInteractionState(Sv.default),t.dealTableHover();const o=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);(null===(s=null===(n=e.options.select)||void 0===n?void 0:n.blankAreaClickDeselect)||void 0===s||s)&&t.dealTableSelect(),i.endSelectCells(!0,o),i.updateCursor(),e.scenegraph.updateChartState(null)}})),e.scenegraph.stage.addEventListener("pointermove",(o=>{const r=RC(o);i.isResizeCol()||t.checkColumnResize(r)?e.stateManager.select&&t.checkCellFillhandle(r)?i.updateCursor("crosshair"):i.updateCursor("col-resize"):i.isResizeRow()||t.checkRowResize(r)?e.stateManager.select&&t.checkCellFillhandle(r)?i.updateCursor("crosshair"):i.updateCursor("row-resize"):i.isMoveCol()||i.updateCursor()})),e.scenegraph.tableGroup.addEventListener("checkbox_state_change",(t=>{var i,o;const r=RC(t),{col:n,row:s}=r.eventArgs,a=e.getCellInfo(n,s),l=lm(e,n,s);if(l)for(let i=l.start.col;i<=l.end.col;i++)for(let o=l.start.row;o<=l.end.row;o++)e.scenegraph.getCell(i,o).forEachChildren((e=>{"checkbox"===e.name&&e.setAttributes({checked:t.target.attribute.checked,indeterminate:t.target.attribute.indeterminate})}));const h=Object.assign(Object.assign({},a),{event:t.nativeEvent,target:null===(i=null==r?void 0:r.eventArgs)||void 0===i?void 0:i.target,mergeCellInfo:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.mergeInfo,checked:t.detail.checked});if(e.isHeader(n,s))e.stateManager.setHeaderCheckedState(a.field,t.detail.checked),"checkbox"===e.getCellType(n,s)&&e.scenegraph.updateCheckboxCellState(n,s,t.detail.checked);else if(e.stateManager.setCheckedState(n,s,a.field,t.detail.checked),"checkbox"===e.getCellType(n,s)){const t=e.stateManager.headerCheckedState[a.field],i=e.stateManager.updateHeaderCheckedState(a.field);t!==i&&e.scenegraph.updateHeaderCheckboxCellState(n,s,i)}e.fireListeners(kb.CHECKBOX_STATE_CHANGE,h),e.scenegraph.updateNextFrame()})),e.scenegraph.tableGroup.addEventListener("radio_checked",(t=>{var i,o,r;const n=RC(t),{col:s,row:a,target:l}=n.eventArgs,h=e.getCellInfo(s,a),d=null===(i=TC.exec(l.id))||void 0===i?void 0:i[1],c=lm(e,s,a);if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id===l.id&&t.setAttributes({checked:!0})}));const u=e.getBodyColumnDefine(s,a).radioCheckType||"column";if("cell"===u)if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id!==l.id&&t.setAttributes({checked:!1})}));else e.scenegraph.getCell(s,a).forEachChildren((t=>{"radio"===t.name&&t.id!==l.id&&t.setAttributes({checked:!1})}));else"column"===u&&e.scenegraph.getColGroup(s).forEachChildren((t=>{t.forEachChildren((t=>{"radio"===t.name&&t.id!==l.id&&t.setAttributes({checked:!1})}))}));const g=d?Number(d):void 0;e.stateManager.setRadioState(s,a,h.field,u,g);const p=Object.assign(Object.assign({},h),{event:t.nativeEvent,target:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(r=null==n?void 0:n.eventArgs)||void 0===r?void 0:r.mergeInfo,radioIndexInCell:g});e.fireListeners(kb.RADIO_STATE_CHANGE,p),e.scenegraph.updateNextFrame()})),e.scenegraph.stage.addEventListener("wheel",(t=>{var o;null===(o=e.editorManager)||void 0===o||o.completeEdit(),e.eventManager._enableTableScroll&&zS(t,i)}))}function WS(t){const e=t.table;t.gesture=new Tu(e.scenegraph.tableGroup,{tap:{interval:300}}),t.gesture.on("doubletap",(t=>{!function(t,e){var i,o,r,n,s,a;const l=RC(t);let h=-1,d=-1;l.eventArgs&&(h=l.eventArgs.col,d=l.eventArgs.row);const c=e.getCellValue(h,d),u=null===(o=null===(i=l.eventArgs)||void 0===i?void 0:i.targetCell)||void 0===o?void 0:o.globalAABBBounds;if(u&&e.internalProps.focusControl.setFocusRect(new Ib(u.x1+e.scrollLeft,u.y1+e.scrollTop,u.x2-u.x1,u.y2-u.y1),c),e.hasListeners(kb.DBLCLICK_CELL)){const i=e.getCellInfo(h,d);let o,c;if(null===(r=l.eventArgs)||void 0===r?void 0:r.target){const t=kS(null===(n=l.eventArgs)||void 0===n?void 0:n.target);t&&(o=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,federatedEvent:t,cells:[],targetIcon:o?{name:o.name,position:c,funcType:o.attribute.funcType}:void 0,target:null===(s=null==l?void 0:l.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(a=null==l?void 0:l.eventArgs)||void 0===a?void 0:a.mergeInfo});e.fireListeners(kb.DBLCLICK_CELL,u)}}(t,e)}))}function NS(t){t.stateManager.endResizeCol();const e=[];for(let i=0;i<t.colCount;i++)e.push(t.getColWidth(i));t.fireListeners(kb.RESIZE_COLUMN_END,{col:t.stateManager.columnResize.col,colWidths:e})}function GS(t){t.stateManager.endResizeRow(),t.fireListeners(kb.RESIZE_ROW_END,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})}let jS=1;function US(){return sb?jS=1:(jS=Math.ceil(window.devicePixelRatio||1),jS>1&&jS%2!=0&&(jS+=1)),jS}function VS(t){return!!t.changedTouches}function XS(t,e,i){if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"top";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom";if(t===i.rowHeaderLevelCount-1&&e>=i.rowHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left"}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left";if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"right";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom"}return"bottom"}US();let YS;const $S=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class KS extends Dv{static get DEFAULT(){return YS||(YS=new KS)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i,o,r,n,s,a,l,h,d,c,u,g,p,f;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._showBar=null===(e=t.showBar)||void 0===e||e,this._barColor=null!==(i=t.barColor)&&void 0!==i?i:$S,this._barPositiveColor=null!==(o=t.barPositiveColor)&&void 0!==o?o:"#4dbd74",this._barNegativeColor=null!==(r=t.barNegativeColor)&&void 0!==r?r:"#f86c6b",this._barAxisColor=null!==(n=t.barAxisColor)&&void 0!==n?n:"black",this._barBgColor=t.barBgColor,this._barHeight=null!==(s=t.barHeight)&&void 0!==s?s:3,this._barHeight=null!==(a=t.barHeight)&&void 0!==a?a:3,this._barBottom=null!==(l=t.barBottom)&&void 0!==l?l:0,this._barPadding=null!==(h=t.barPadding)&&void 0!==h?h:[0,0,0,0],this._showBarMark=null!==(d=t.showBarMark)&&void 0!==d&&d,this._barMarkPositiveColor=null!==(c=t.barMarkPositiveColor)&&void 0!==c?c:"#4dbd74",this._barMarkNegativeColor=null!==(u=t.barMarkNegativeColor)&&void 0!==u?u:"#f86c6b",this._barMarkWidth=null!==(g=t.barMarkWidth)&&void 0!==g?g:2,this._barMarkPosition=null!==(p=t.barMarkPosition)&&void 0!==p?p:"right",this._barRightToLeft=null!==(f=t.barRightToLeft)&&void 0!==f&&f}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new KS(this,null)}}const qS=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class ZS{constructor(t){this._table=t;const e=GC();this.expandIcon=e[kv.expandIconName],this.collapseIcon=e[kv.collapseIconName]}getIcons(t,e,i,o,r){const n=[],s=this.getHierarchyIcon(t,e);s&&n.push(s);const{icon:a}=this._table.getBodyColumnDefine(t,e);if(a){let r;r="function"==typeof a?a({col:t,row:e,value:i,dataValue:o,table:this._table}):a;const s=GC(),l=t=>{let e;e="string"==typeof t?s[t]:t,e&&n.push(e)};Array.isArray(r)?r.forEach(((t,e)=>{l(t)})):l(r)}return r&&n.forEach(((i,o)=>{(i.content||i.src)&&(n[o]=this.getCellIconFromRecordValue(i,t,e))})),n}getStyleClass(t){switch(t){case"text":case"link":return Nv;case"image":case"video":return Wv;case"chart":case"sparkline":return Dv;case"progressbar":return KS;case"checkbox":return jv;case"radio":return Uv}return Nv}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,i)));if(!Rb.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,i);const o={},r=t;return qS.forEach((t=>{var n,s;if(void 0!==r[t]){const a=this._table.getFieldData(r[t],e,i);null!=a?o[t]=a:(null===(s=(n=this._table)._hasField)||void 0===s?void 0:s.call(n,r[t],e,i))||(o[t]=r[t])}})),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===Rv.expand?this.expandIcon:i===Rv.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}}function JS(t,e,i,o,r,n){const s=t.getCellRange(o,r);for(let o=0;o<e.length;o++){const r=e[o];let{col:n,row:a}=r;const{field:l,menuKey:h}=r;if("number"!=typeof n||"number"!=typeof a)if(t.isPivotTable()){const e=t.internalProps.layoutMap.getPivotCellAdress(l);if(!e)continue;n=e.col,a=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!e)continue;n=e.col,a=e.row}if(J(n)&&J(a)&&xb(s,n,a)&&i===h)return!0}return!1}let QS;!function(){if("node"===Xv.mode)return;const t=document.createElement("style");t.id="vtable-menu-styleSheet",t.textContent="\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n",document.head.appendChild(t)}();const t_={CHANGE_STYLE:"change_style"};class e_ extends Ev{static get EVENT_TYPE(){return t_}static get DEFAULT(){return QS||(QS=new e_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R,B,M,T,P,k,L,H;super(),this._defaultPadding=[10,16,10,16],this._color=null!==(i=t.color)&&void 0!==i?i:null==e?void 0:e.color,this._strokeColor=null!==(o=null==t?void 0:t.strokeColor)&&void 0!==o?o:null==e?void 0:e.strokeColor,this._fontSize=null!==(r=t.fontSize)&&void 0!==r?r:null==e?void 0:e.fontSize,this._fontFamily=null!==(n=t.fontFamily)&&void 0!==n?n:null==e?void 0:e.fontFamily,this._fontWeight=null!==(s=t.fontWeight)&&void 0!==s?s:null==e?void 0:e.fontWeight,this._fontVariant=null!==(a=t.fontVariant)&&void 0!==a?a:null==e?void 0:e.fontVariant,this._fontStyle=null!==(l=t.fontStyle)&&void 0!==l?l:null==e?void 0:e.fontStyle,this._textOverflow=(null!==(h=t.textOverflow)&&void 0!==h?h:null==e?void 0:e.textOverflow)||"ellipsis",this._textStick=null!==(c=null!==(d=t.textStick)&&void 0!==d?d:null==e?void 0:e.textStick)&&void 0!==c&&c,this._textStickBaseOnAlign=null!==(g=null!==(u=t.textStickBaseOnAlign)&&void 0!==u?u:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==g&&g,this._marked=null!==(f=null!==(p=t.marked)&&void 0!==p?p:null==e?void 0:e.marked)&&void 0!==f&&f,this._textAlign=(null!==(v=t.textAlign)&&void 0!==v?v:null==e?void 0:e.textAlign)||"left",this._textBaseline=(null!==(b=t.textBaseline)&&void 0!==b?b:null==e?void 0:e.textBaseline)||"middle",this._bgColor=null!==(m=t.bgColor)&&void 0!==m?m:null==e?void 0:e.bgColor,this._padding=null!==(y=null!==(C=t.padding)&&void 0!==C?C:null==e?void 0:e.padding)&&void 0!==y?y:this._defaultPadding,this._borderColor=null!==(w=t.borderColor)&&void 0!==w?w:null==e?void 0:e.borderColor,this._lineHeight=null!==(x=t.lineHeight)&&void 0!==x?x:null==e?void 0:e.lineHeight,this._underline=null!==(S=t.underline)&&void 0!==S?S:null==e?void 0:e.underline,this._underlineColor=null!==(_=t.underlineColor)&&void 0!==_?_:null==e?void 0:e.underlineColor,this._underlineDash=null!==(A=t.underlineDash)&&void 0!==A?A:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(R=t.underlineOffset)&&void 0!==R?R:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(B=t.lineThrough)&&void 0!==B?B:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(M=t.lineThroughColor)&&void 0!==M?M:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(T=t.lineThroughDash)&&void 0!==T?T:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(P=t.linkColor)&&void 0!==P?P:null==e?void 0:e.linkColor,this._cursor=null!==(k=t.cursor)&&void 0!==k?k:null==e?void 0:e.cursor,this._borderLineWidth=null!==(L=t.borderLineWidth)&&void 0!==L?L:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(H=t.borderLineDash)&&void 0!==H?H:null==e?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return null!==(t=this._padding)&&void 0!==t?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new e_(this)}}let i_,o_,r_;class n_ extends e_{static get DEFAULT(){return i_||(i_=new n_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;super(t,e),this.textAlign=(null!==(i=t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign)||"center"}clone(){return new n_(this)}}class s_ extends e_{static get DEFAULT(){return o_||(o_=new s_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new s_(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}class a_ extends e_{static get DEFAULT(){return r_||(r_=new a_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_;super(t,e),this._size=(null!==(r=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==r?r:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(n=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==n?n:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(l=null===(a=null==t?void 0:t.checkboxStyle)||void 0===a?void 0:a.defaultFill)&&void 0!==l?l:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(m=null===(b=null==t?void 0:t.checkboxStyle)||void 0===b?void 0:b.disableCheckedFill)&&void 0!==m?m:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(y=null===(C=null==t?void 0:t.checkboxStyle)||void 0===C?void 0:C.disableCheckedStroke)&&void 0!==y?y:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(_=null===(S=null==t?void 0:t.checkboxStyle)||void 0===S?void 0:S.indeterminateIconImage)&&void 0!==_?_:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new a_(t,this)}clone(){return new a_(this)}}function l_(t,e,i,o,r,n){var s;return t||e?t instanceof e_?t:"function"==typeof t?l_(t(i),e,i,o,r,n):(t||(t={}),r&&!J(t.autoWrapText)&&(t.autoWrapText=!0),o===a_?new a_(null!=t?t:{},null!=e?e:{},null!==(s=n.checkboxStyle)&&void 0!==s?s:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class h_{constructor(t){this._table=t;const e=GC();this.freezeIcon=e[kv.freezeIconName],this.frozenIcon=e[kv.frozenIconName],this.frozenCurrentIcon=e[kv.frozenCurrentIconName],this.normalIcon=e[kv.normalIconName],this.upIcon=e[kv.upwardIconName],this.downIcon=e[kv.downwardIconName],this.dropDownAbsoluteIcon=e[kv.dropdownIconName],this.expandIcon=e[kv.expandIconName],this.collapseIcon=e[kv.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:o,sort:r}=this._table.internalProps.layoutMap.getHeader(t,e);if(o){let o=this._table.getPivotSortState(t,e);o&&(o=o.toUpperCase());const r="ASC"===o?this.downIcon:"DESC"===o?this.upIcon:this.normalIcon;r&&i.push(r)}else if(r){const o=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);o&&i.push(o)}}else{const o=this._table.sortState;let r;r=void 0;const n=this._table.getCellRange(t,e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){const e=o[t],i=this._table._getHeaderCellBySortState(e);if(i&&xb(n,i.col,i.row)){({order:r}=e);break}}else{const t=this._table._getHeaderCellBySortState(o);t&&xb(n,t.col,t.row)&&({order:r}=o)}const s=this.getSortIcon(r,this._table,t,e);s&&i.push(s)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const o=this.getFrozenIcon(t,e);o&&i.push(o)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:r}=this._table._getHeaderLayoutMap(t,e),n=this.getHierarchyIcon(t,e);if(n&&i.push(n),r){let o;o="function"==typeof r?r({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):r;const n=GC(),s=t=>{let e;e="string"==typeof t?n[t]:t,e&&i.push(e)};Array.isArray(o)?o.forEach(((t,e)=>{s(t)})):s(o)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;if(this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const r="asc"===t?this.downIcon:"desc"===t?this.upIcon:this.normalIcon,n=e.getHeaderDefine(i,o);return!n||!1===n.showSort||!J(n.showSort)&&!n.sort||n.columns&&n.columns.length>0?null:r}getSortIconForPivotTable(t,e,i,o){const r=e.getHeaderDefine(i,o);return!r||!1===r.showSort||!J(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:"ASC"===t?this.downIcon:"DESC"===t?this.upIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,r,n;const s=t.getHeaderDefine(e,i),a=t._getHeaderLayoutMap(e,i),{dropDownMenu:l}=a,h=[];if(Array.isArray(l)&&l.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==s?void 0:s.columns)||void 0===o?void 0:o.length)){const o=l||t.globalDropDownMenu;let s=-1,a=-1;for(let l=0;l<o.length;l++){const h=o[l];if("object"==typeof h&&h.children&&h.children.length)for(let o=0;o<h.children.length;o++){const d=h.children[o];if((null===(r=t.stateManager.menu)||void 0===r?void 0:r.dropDownMenuHighlight)&&JS(t,null===(n=t.stateManager.menu)||void 0===n?void 0:n.dropDownMenuHighlight,"object"==typeof d?null==d?void 0:d.menuKey:d,e,i)){s=l,a=o;break}}if(t._dropDownMenuIsHighlight(e,i,l)){s=l;break}}if(-1!==s){let e;e=-1!==a?(l||t.globalDropDownMenu)[s].children[a]:(l||t.globalDropDownMenu)[s],e.stateIcon&&(e.stateIcon.svg?h.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:Tv.right,marginRight:0,funcType:Pv.dropDownState,interactive:!1}):e.stateIcon.src&&h.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:Tv.right,marginRight:0,funcType:Pv.dropDownState,interactive:!1}))}}return h}getDropDownIconRect(t,e,i){var o,r,n,s,a,l,h,d;const c=null!==(s=null!==(r=null===(o=this.downIcon.hover)||void 0===o?void 0:o.width)&&void 0!==r?r:null===(n=this.downIcon)||void 0===n?void 0:n.width)&&void 0!==s?s:0,u=null!==(d=null!==(l=null===(a=this.downIcon.hover)||void 0===a?void 0:a.height)&&void 0!==l?l:null===(h=this.downIcon)||void 0===h?void 0:h.height)&&void 0!==d?d:0,g=t.right-2-c,p=t.right-2;let f;return f="middle"===i?t.top+t.height/2-c/2:"top"===i?t.top+e/2:"bottom"===i?t.bottom-2*e:t.top,{left:g,right:p,top:f,bottom:u+f,width:c,height:u}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===Rv.expand)return this.expandIcon;if(i===Rv.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const o=t._getHeaderLayoutMap(e,i);if(Array.isArray(o.dropDownMenu)&&o.dropDownMenu.length)return!0}else{const r=t.getHeaderDefine(e,i);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length||(!Array.isArray(r.dropDownMenu)||0!==r.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==r?void 0:r.columns)||void 0===o?void 0:o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return s_;case"image":case"video":return n_;case"checkbox":return a_}}setTableColumnsEditor(){const t=(e,i)=>{null==e||e.forEach(((e,o)=>{e.editor&&(i[o].editor=e.editor),e.columns&&t(e.columns,i[o].columns)}))};t(this._table.options.columns,this._table.internalProps.columns)}}class d_ extends EventTarget{constructor(t,e){if(super(),this._table=t,"node"===Xv.mode)return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i),this._container=i}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${r.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;null===(t=this._container.parentElement)||void 0===t||t.removeChild(this._container)}}class c_{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);-1!==i&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0)}updateDifference(t,e){var i;const o=null!==(i=this.difference.get(t))&&void 0!==i?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=null!==(e=this.data.get(o))&&void 0!==e?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout((()=>{this.dealDiffenence(),this.isUpdate=!1}),0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const e=this.cumulativeSum.get(t);this.cumulativeSum.set(t,e+i)}this.difference.clear()}insert(t,e){for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),J(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const r=[];for(let n=u_(o,t+i-1);n>=0;n--){const s=o[n];if(s>=t)r.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,r[i-1-t])}const{length:r}=o;if(t<e){const n=[];for(let s=u_(o,t);s<r;s++){const r=o[s];if(r>=t&&r<t+i)n.push(this.get(r));else if(t+i<=r&&r<=e)this.put(r-i,this.get(r));else if(r>e)break}for(let t=0;t<i;t++)this.put(e+t,n[t])}}exchangeOrder(t,e,i,o,r){const{_keys:n}=this;if(this._sorted||(n.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let r=u_(n,i);r<t+e;r++){const i=n[r];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,s[t]);for(let t=0;t<o.length;t++)this.put(r+e+t,o[t])}else{const s=[],a=[];for(let r=u_(n,t);r<i+o;r++){const i=n[r];i>=t&&i<t+e?a.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,a[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}}function u_(t,e){let i=0,o=t.length-1;for(;i<=o;){const r=Math.floor((i+o)/2);if(t[r]===e)return r;t[r]>e?o=r-1:i=r+1}return o<0?0:o}class g_{constructor(t){this._table=t;const e=GC();this.dragReorderIconName=e[kv.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class p_{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const t=this.getCustomCellStyleOption(i);return null==t?void 0:t.style}}getCustomCellStyleId(t,e){let i;return this.customCellStyleArrangement.forEach((o=>{o.cellPosition.range?o.cellPosition.range.start.col<=t&&o.cellPosition.range.end.col>=t&&o.cellPosition.range.start.row<=e&&o.cellPosition.range.end.row>=e&&(i=o.customStyleId):o.cellPosition.col===t&&o.cellPosition.row===e&&(i=o.customStyleId)})),i}getCustomCellStyleOption(t){return this.customCellStyle.find((e=>e.id===t))}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex((e=>e.id===t));-1===i?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach((e=>{const i=e.cellPosition;if(e.customStyleId===t)if(i.range)for(let t=i.range.start.col;t<=i.range.end.col;t++)for(let e=i.range.start.row;e<=i.range.end.row;e++)this.table.scenegraph.updateCellContent(t,e);else this.table.scenegraph.updateCellContent(i.col,i.row)})),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex((e=>e.cellPosition.range&&t.range?e.cellPosition.range.start.col===t.range.start.col&&e.cellPosition.range.start.row===t.range.start.row&&e.cellPosition.range.end.col===t.range.end.col&&e.cellPosition.range.end.row===t.range.end.row:e.cellPosition.col===t.col&&e.cellPosition.row===t.row));if(-1===i?this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e}):this.customCellStyleArrangement[i].customStyleId=e,t.range)for(let e=t.range.start.col;e<=t.range.end.col;e++)for(let i=t.range.start.row;i<=t.range.end.row;i++)this.table.scenegraph.updateCellContent(e,i);else this.table.scenegraph.updateCellContent(t.col,t.row);this.table.scenegraph.updateNextFrame()}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach((t=>{this.registerCustomCellStyle(t.id,t.style)})),e.forEach((t=>{this.arrangeCustomCellStyle(t.cellPosition,t.customStyleId)}))}hasCustomCellStyle(t){return this.customCellStyle.some((e=>e.id===t))}}function f_(t,e){t=t.clone();for(const i in e){const o=e[i];o&&(t[`_${i}`]=o)}return t}class v_{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"grid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new Fb,this.dimensionKeysIncludeVirtual=new Fb,this.cache=new Map,this.sizeIncludeParent=null!=o,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t){this.cache.clear(),this.dimensionKeys=new Fb,this.dimensionKeysIncludeVirtual=new Fb,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,r;t.startIndex=e,t.startInTotal=(null!==(o=i.startInTotal)&&void 0!==o?o:0)+t.startIndex,(null!==(r=t.dimensionKey)&&void 0!==r?r:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?Yb:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?Yb:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?Yb:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?Yb:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let n=t.dimensionKey&&this.sizeIncludeParent?1:0;const s=t.children||t.columns;return"grid"===this.hierarchyType?(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),n+=this.setTreeNode(e,n,t)})):n=1:t.hierarchyState===Rv.expand&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),n+=this.setTreeNode(e,n,t)})):t.hierarchyState===Rv.collapse&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,n,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((null==s?void 0:s.length)>=1||!0===s)?(t.hierarchyState=Rv.expand,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),n+=this.setTreeNode(e,n,t)}))):(null==s?void 0:s.length)>=1||!0===s?(t.hierarchyState=Rv.collapse,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,n,t)}))):(t.hierarchyState=Rv.none,n=1),t.size=n,n}getTreePath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const r=t[o],n=this.findNodeById(i,r);if(!n)break;e.push(n),i=n.children}return e}findNodeById(t,e){return t.find((t=>t.id===e))}searchPath(t,e,i,o){if(!e)return;if(t<e.startIndex||t>=e.startIndex+e.size)return;if(i.push(e),!e.children||0===e.children.length||e.level>=o)return;const r=t-e.startIndex;if(this.cache.has(e.level+1)){const t=this.cache.get(e.level+1);if(r>=t.startIndex&&r<t.startIndex+t.size)return void this.searchPath(r,t,i,o)}let n=0,s=e.children.length-1;for(;n<=s;){const t=Math.floor((n+s)/2),a=e.children[t];if(r>=a.startIndex&&r<a.startIndex+a.size){this.cache.set(a.level,a);const t=[];this.cache.forEach(((e,i)=>{i>a.level&&t.push(i)})),t.forEach((t=>{this.cache.delete(t)})),this.searchPath(r,a,i,o);break}r<a.startIndex?s=t-1:n=t+1}}movePosition(t,e,i){let o,r,n;const s=(a,l)=>{if(void 0!==r&&void 0!==n)return;a.level===t&&(a.startInTotal===e&&(r=l),a.startInTotal<=i&&i<=a.startInTotal+a.size-1&&(n=l));const h=a.children||a.columns;if(h&&a.level<t){o=a;for(let t=0;t<h.length;t++)(e>=h[t].startInTotal&&e<=h[t].startInTotal+h[t].size||i>=h[t].startInTotal&&i<=h[t].startInTotal+h[t].size)&&s(h[t],t)}};s(this.tree,0);const a=o.children||o.columns,l=a.splice(r,1);l.unshift(n,0),Array.prototype.splice.apply(a,l)}getCopiedTree(){const t=mt(this.tree.children);return b_(t),t}}function b_(t){for(let e=0;e<t.length;e++){const i=t[e];delete i.level,delete i.startIndex,delete i.id,delete i.levelSpan,delete i.size,delete i.startInTotal;const o=i.children||i.columns;o&&b_(o)}}function m_(t,e){const i=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:i}=t;const o=t.internalProps.frozenRowCount;for(let r=0;r<o;r++){const o=t.getRowHeight(r),n=i+o;if(n>e)return{top:i,row:r,bottom:n,height:o};i=n}return null}(e,t);if(i)return i;let o=w_(t,e);return o||(o={top:-1,row:-1,bottom:-1,height:-1}),o}function C_(t,e){const i=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:i}=t;const o=t.internalProps.frozenColCount;for(let r=0;r<o;r++){const o=t.getColWidth(r),n=i+o;if(n>e)return{left:i,col:r,right:n,width:o};i=n}return null}(e,t);if(i)return i;let o=y_(t,e);return o||(o={left:-1,col:-1,right:-1,width:1}),o}function y_(t,e){if(0===t)return{left:0,col:0,right:0,width:0};const i=function(t,e){if(e._colRangeWidthsMap.get("$0$"+(e.colCount-1))){let i=0,o=e.colCount-1;for(;o-i>1;){const r=Math.floor((i+o)/2);if(t<e._colRangeWidthsMap.get(`$0$${r}`))o=r;else{if(!(t>e._colRangeWidthsMap.get(`$0$${r}`)))return r;i=r}}return o}return Math.min(Math.ceil(t/e.internalProps.defaultColWidth),e.colCount-1)}(t,e),o=e.getColsWidth(0,i);return t>=o?((i,o)=>{let r=o-e.getColWidth(i);const{colCount:n}=e.internalProps;for(let o=i;o<n;o++){const i=e.getColWidth(o),n=r+i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{left:r,col:o,right:n,width:i};r=n}return null})(i,o):((i,o)=>{let r=o;for(let o=i;o>=0;o--){const i=e.getColWidth(o),n=r-i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:n,col:o,right:r,width:i};r=n}return null})(i,o)}function w_(t,e){if(0===t)return{top:0,row:0,bottom:0,height:0};const i=function(t,e){let i=e.internalProps.defaultRowHeight;return e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))&&(i=e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))/e.rowCount),Math.min(Math.ceil(t/i),e.rowCount-1)}(t,e),o=e.getRowsHeight(0,i);return t>=o?((i,o)=>{let r=o-e.getRowHeight(i);const{rowCount:n}=e.internalProps;for(let o=i;o<n;o++){const i=e.getRowHeight(o),n=r+i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{top:r,row:o,bottom:n,height:i};r=n}return null})(i,o):((i,o)=>{let r=o;for(let o=i;o>=0;o--){const i=e.getRowHeight(o),n=r-i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:n,row:o,bottom:r,height:i};r=n}return null})(i,o)}function x_(t,e,i){if(0===t)return{left:0,col:0,right:0,width:0};if(e&&t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth())for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameWidth-i.getColsWidth(i.colCount-e-1,i.colCount-1))return{col:i.colCount-e-1,left:void 0,right:void 0,width:void 0};return y_(t,i)}function S_(t,e,i){if(0===t)return{top:0,row:0,bottom:0,height:0};if(e&&t>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&t<i.tableNoFrameHeight)for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameHeight-i.getRowsHeight(i.rowCount-e-1,i.rowCount-1))return{row:i.rowCount-e-1,top:void 0,bottom:void 0,height:void 0};return w_(t,i)}var __;!function(t){t.vertical="vertical",t.horizontal="horizontal"}(__||(__={}));const A_={};const{toBoxArray:R_}=Tb,{isTouchEvent:B_}=Mb,M_=/^\$(\d+)\$(\d+)$/;!function(){if("node"===Xv.mode)return;const t=document.createElement("style");t.id="vtable-style-styleSheet",t.textContent="\n.vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n\n.vtable-gantt {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n.vtable .table-component-container {\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n",document.head.appendChild(t)}();class T_ extends Ev{static get EVENT_TYPE(){return kb}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,r,n,s,a,l,h,d,c,u;if(super(),this.showFrozenIcon=!0,this.version="1.7.2",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=function(t,e){let i=null;return function(){for(var o=arguments.length,r=new Array(o),n=0;n<o;n++)r[n]=arguments[n];i||(i=setTimeout((()=>{t.apply(this,r),i=null}),e))}}(this.render.bind(this),200),!t&&"node"!==e.mode&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:g=0,frozenRowCount:p,defaultRowHeight:f=40,defaultHeaderRowHeight:v,defaultColWidth:b=80,defaultHeaderColWidth:m,widthMode:C="standard",heightMode:y="standard",autoFillWidth:w=!1,autoFillHeight:x=!1,widthAdaptiveMode:S="only-body",heightAdaptiveMode:_="only-body",keyboardOptions:A,eventOptions:R,rowSeriesNumber:B,columnResizeMode:M,rowResizeMode:T="none",dragHeaderMode:P,showFrozenIcon:k,allowFrozenColCount:L,padding:H,hover:E,menu:z,select:F,customRender:I,pixelRatio:O=jS,renderChartAsync:D,renderChartAsyncBatchCount:W,mode:N,modeParams:G,canvasWidth:j,canvasHeight:U,overscrollBehavior:V,limitMinWidth:X,limitMinHeight:Y,clearDOM:$=!0}=e;this.container=t,this.options=e,this._widthMode=C,this._heightMode=y,this._widthAdaptiveMode=S,this._heightAdaptiveMode=_,this._autoFillWidth=w,this._autoFillHeight=x,this.customRender=I,this.padding={top:0,right:0,left:0,bottom:0},H&&("number"==typeof H?(this.padding.top=H,this.padding.left=H,this.padding.bottom=H,this.padding.right=H):(H.top&&(this.padding.top=H.top),H.bottom&&(this.padding.bottom=H.bottom),H.left&&(this.padding.left=H.left),H.right&&(this.padding.right=H.right))),J(U)&&J(j)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=j,this.canvasHeight=U,this.columnWidthComputeMode=null!==(i=e.columnWidthComputeMode)&&void 0!==i?i:"normal";const q=this.internalProps={};if(void 0!==k&&(this.showFrozenIcon=k),"number"==typeof L&&L<=0&&(this.showFrozenIcon=!1),this.options.canvas?(q.element=this.options.canvas.parentElement,q.element.style.position="relative",q.focusControl=new d_(this,q.element),q.canvas=this.options.canvas,q.context=q.canvas.getContext("2d")):"node"!==Xv.mode&&(q.element=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vtable";var i,o;const r=document.createElement("div");r.setAttribute("tabindex","0"),r.classList.add(e),r.style.outline="none",r.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const n=(r.offsetWidth||(null===(i=r.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,s=(r.offsetHeight||(null===(o=r.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;return r.style.width=n&&n-t.left-t.right+"px"||"0px",r.style.height=s&&s-t.top-t.bottom+"px"||"0px",r}(this.padding),q.focusControl=new d_(this,q.element),q.canvas=document.createElement("canvas"),q.element.appendChild(q.canvas),q.context=q.canvas.getContext("2d"),(null===(o=e.customConfig)||void 0===o?void 0:o.createReactContainer)&&(q.bodyDomContainer=document.createElement("div"),q.bodyDomContainer.classList.add("table-component-container"),q.element.appendChild(q.bodyDomContainer),q.headerDomContainer=document.createElement("div"),q.headerDomContainer.classList.add("table-component-container"),q.element.appendChild(q.headerDomContainer))),q.handler=new class{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i){if("node"===Xv.mode)return-1;const o=Eb++;for(var r=arguments.length,n=new Array(r>3?r-3:0),s=3;s<r;s++)n[s-3]=arguments[s];if(null==t?void 0:t.addEventListener)if("resize"!==e||t===window)null==t||t.addEventListener(e,i,...n);else{const e=new class{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:e}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=Hb(this.callBack,this.resizeTime),null===window||void 0===window||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),null===(o=this.observer)||void 0===o||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}(t,i,this.resizeTime);this.reseizeListeners[o]=e}const a={target:t,type:e,listener:i,options:n};return this.listeners[o]=a,o}once(t,e,i){var o=this;if("node"===Xv.mode)return-1;for(var r=arguments.length,n=new Array(r>3?r-3:0),s=3;s<r;s++)n[s-3]=arguments[s];const a=this.on(t,e,(function(){o.off(a),i(...arguments)}),...n);return a}off(t){var e;if("node"===Xv.mode)return;if(null==t)return;const i=null===(e=this.listeners)||void 0===e?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e){if("node"!==Xv.mode){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];for(const i in this.listeners){const r=this.listeners[i];r.target===t&&r.type===e&&r.listener.call(r.target,...o)}}}hasListener(t,e){if("node"===Xv.mode)return!1;let i=!1;for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&(i=!0)}return i}clear(){if("node"!==Xv.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];null==e||e.disConnect()}this.listeners={}}}release(){"node"!==Xv.mode&&(this.clear(),this.listeners={})}},at(this.options.resizeTime)&&(q.handler.resizeTime=this.options.resizeTime),q.pixelRatio=O,q.frozenColCount=g,q.frozenRowCount=p,q.defaultRowHeight=f,q.defaultHeaderRowHeight=null!=v?v:f,q.defaultColWidth=b,q.defaultHeaderColWidth=null!=m?m:b,q.keyboardOptions=A,q.eventOptions=R,q.rowSeriesNumber=B,q.columnResizeMode=M,q.rowResizeMode=T,q.dragHeaderMode=null!=P?P:"none",q.renderChartAsync=D,fw(W),q.overscrollBehavior=null!=V?V:"auto",q._rowHeightsMap=new c_(this),q._rowRangeHeightsMap=new Map,q._colRangeWidthsMap=new Map,q._widthResizedColMap=new Set,q._heightResizedRowMap=new Set,this.colWidthsMap=new Fb,this.colContentWidthsMap=new Fb,this.colWidthsLimit={},q.calcWidthContext={_:q,get full(){var t;return"node"===Xv.mode?j/(null!=O?O:1):this._.canvas.width/(null!==(t=this._.context.pixelRatio)&&void 0!==t?t:window.devicePixelRatio)}},q.cellTextOverflows={},q.focusedTable=!1,q.theme=am.of(null!==(r=e.theme)&&void 0!==r?r:am.DEFAULT),q.theme.isPivot=this.isPivotTable(),t?($&&(t.innerHTML=""),t.appendChild(q.element),this._updateSize()):this._updateSize(),this.options=e,q.theme=am.of(null!==(n=e.theme)&&void 0!==n?n:am.DEFAULT),q.theme.isPivot=this.isPivotTable(),q.bodyHelper=new ZS(this),q.headerHelper=new h_(this),q.rowSeriesNumberHelper=new g_(this),q.autoWrapText=e.autoWrapText,q.enableLineBreak=e.enableLineBreak,q.allowFrozenColCount=null!==(s=e.allowFrozenColCount)&&void 0!==s?s:0,q.limitMaxAutoWidth=null!==(a=e.limitMaxAutoWidth)&&void 0!==a?a:450,q.limitMinWidth=null!=X?"number"==typeof X?X:X?10:0:10,q.limitMinHeight=null!=Y?"number"==typeof Y?Y:Y?10:0:10,this.scenegraph=new yS(this),this.stateManager=new class{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=Hb((()=>{this.updateInteractionState(Sv.default)}),100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=Sv.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Qt,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:"normal"},this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=Sv.default,this.select={highlightScope:_v.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:_v.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Qt,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:"normal"},this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=null!==(t=this.table.options.hover)&&void 0!==t?t:{highlightMode:"cell"};i?this.hover.highlightScope=_v.none:"cross"===e?this.hover.highlightScope=_v.cross:"row"===e?this.hover.highlightScope=_v.row:"column"===e?this.hover.highlightScope=_v.column:"cell"===e&&(this.hover.highlightScope=_v.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===_v.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell"},this.table.options.select);this.select.highlightScope=e?_v.none:"cross"===o?_v.cross:"row"===o?_v.row:"column"===o?_v.column:_v.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t}isSelected(t,e){let i=!1;return this.select.ranges.forEach((o=>{xb(o,t,e)&&(i=!0)})),i}setSortState(t){this.sort.field=null==t?void 0:t.field,this.sort.order=null==t?void 0:t.order}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;const e=this.interactionState;this.interactionState=t,e===Sv.scrolling&&Sv.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){RS(this,t,e)}updateSelectPos(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,i,o,r,n){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];var l,h;const{table:d,interactionState:c}=t,{scenegraph:u}=d,{highlightScope:g,disableHeader:p,cellPos:f}=t.select;if((p&&d.isHeader(e,i)||"none"===g)&&(-1===e||-1===i||s||d._makeVisibleCell(e,i),e=-1,i=-1),-1!==e&&-1!==i&&!s)if(c===Sv.grabing&&t.select.ranges.length>0){const o=t.select.ranges[t.select.ranges.length-1];e>o.start.col&&e>o.end.col&&d._makeVisibleCell(e+1,i),i>o.start.row&&i>o.end.row&&d._makeVisibleCell(e,i+1),e<o.start.col&&e<o.end.col&&d._makeVisibleCell(e-1,i),i<o.start.row&&i<o.end.row&&d._makeVisibleCell(e,i-1)}else d._makeVisibleCell(e,i);if(n){t.select.ranges=[],u.deleteAllSelectBorder();let e=0,i=0;const{disableHeaderSelect:o,disableRowSeriesNumberSelect:r}=(null===(l=d.options.keyboardOptions)||void 0===l?void 0:l.selectAllOnCtrlA)||{};o&&(e=d.rowHeaderLevelCount,i=d.columnHeaderLevelCount),(r||o)&&d.options.rowSeriesNumber&&(e+=1),t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:d.rowCount-1}});const n=t.select.ranges[t.select.ranges.length-1];u.updateCellSelectBorder(n,!1)}else if(-1===f.col||-1===f.row||-1!==e&&-1!==i)if(c!==Sv.default||d.eventManager.isDraging||d.stateManager.isResizeCol()){if((c===Sv.grabing||d.eventManager.isDraging)&&!d.stateManager.isResizeCol()){let o=!0;-1===f.col&&(f.col=e),-1===f.row&&(f.row=i),f.col=e,f.row=i;const r=t.select.ranges[t.select.ranges.length-1];if(r){if(d.internalProps.layoutMap.isSeriesNumberInBody(r.start.col,r.start.row))o=!1,r.end={col:d.colCount-1,row:i};else if(t.fillHandle.isFilling){if("top"===t.fillHandle.direction)if(i===t.fillHandle.beforeFillMinRow&&i===t.fillHandle.beforeFillMaxRow)r.start.row=r.end.row=i;else if(i<=t.fillHandle.beforeFillMinRow){if(r.start.row<r.end.row){const t=r.start.row;r.start.row=r.end.row,r.end.row=t}r.end.row=i}else i===t.fillHandle.beforeFillMaxRow&&(r.start.row>r.end.row?r.start.row=i:r.end.row=i);else if("bottom"===t.fillHandle.direction){if(i>=t.fillHandle.beforeFillMaxRow){if(r.start.row>r.end.row){const t=r.start.row;r.start.row=r.end.row,r.end.row=t}r.end.row=i}}else if("left"===t.fillHandle.direction)if(e===t.fillHandle.beforeFillMinCol&&e===t.fillHandle.beforeFillMaxCol)r.start.col=r.end.col=e;else if(e<=t.fillHandle.beforeFillMinCol){if(r.start.col<r.end.col){const t=r.start.col;r.start.col=r.end.col,r.end.col=t}r.end.col=e}else e===t.fillHandle.beforeFillMaxCol&&(r.start.col>r.end.col?r.start.col=e:r.end.col=e);else if("right"===t.fillHandle.direction&&e>=t.fillHandle.beforeFillMaxCol){if(r.start.col>r.end.col){const t=r.start.col;r.start.col=r.end.col,r.end.col=t}r.end.col=e}}else r.end={col:e,row:i},a&&(r.skipBodyMerge=!0);u.updateCellSelectBorder(r,o)}}}else{const n=t.select.ranges[t.select.ranges.length-1];if(o&&n){if(r||(f.col=e,f.row=i),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const t=Math.min(n.start.col,n.end.col,e),o=Math.max(n.start.col,n.end.col,e),r=Math.min(n.start.row,n.end.row,i),s=d.rowCount-1;n.start={col:t,row:r},n.end={col:o,row:s}}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const t=Math.min(n.start.col,n.end.col,e),o=d.colCount-1,r=Math.min(n.start.row,n.end.row,i),s=Math.max(n.start.row,n.end.row,i);n.start={col:t,row:r},n.end={col:o,row:s}}else n.end={col:e,row:i};u.deleteLastSelectedRangeComponents(),u.updateCellSelectBorder(n)}else{let o=!0;if(-1===f.col||-1===f.row||r||(t.select.ranges=[],u.deleteAllSelectBorder()),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:i},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=d.getCellRange(e,i);t.select.ranges.push({start:{col:e,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0})}else if(d.internalProps.layoutMap.isSeriesNumberInHeader(e,i))o=!1,t.select.ranges.push({start:{col:0,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isSeriesNumberInBody(e,i))o=!1,t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0});else if(e>=0&&i>=0){const o=a?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:o.start.row},end:{col:o.end.col,row:o.end.row},skipBodyMerge:a||void 0})}f.col=e,f.row=i;const n=null===(h=t.select.ranges)||void 0===h?void 0:h[t.select.ranges.length-1];n&&u.updateCellSelectBorder(n,o)}}else f.col=-1,f.row=-1,t.select.ranges=[],u.deleteAllSelectBorder();u.updateNextFrame()}(this,t,e,i,o,r,n,s)}checkCellRangeInSelect(t,e){return function(t,e,i,o){for(let o=0;o<i.length;o++)if(_b(i[o],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o){var r,n,s,a,l,h,d,c,u;if((null===(r=this.residentHoverIcon)||void 0===r?void 0:r.icon)&&i===(null===(n=this.residentHoverIcon)||void 0===n?void 0:n.icon))return;const g=kS(i);if(g)if("richtext-icon"===g.type){const i=g.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(a=this.residentHoverIcon)||void 0===a?void 0:a.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),i.attribute.tooltip){const o={content:i.attribute.tooltip.title,referencePosition:{rect:g.position,placement:i.attribute.tooltip.placement},style:Object.assign({},null===(l=this.table.internalProps.theme)||void 0===l?void 0:l.tooltipStyle,null===(h=i.tooltip)||void 0===h?void 0:h.style,null===(c=null===(d=i.attribute)||void 0===d?void 0:d.tooltip)||void 0===c?void 0:c.style),disappearDelay:i.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(o)||this.table.showTooltip(t,e,o)}}else{const i=g.icon;i!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(u=this.residentHoverIcon)||void 0===u?void 0:u.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=i,this.table.scenegraph.setIconHoverStyle(i,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(s=this.residentHoverIcon)||void 0===s?void 0:s.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.select.selecting){if(this.select.selecting=!1,0===this.select.ranges.length)return;const e=this.select.ranges[this.select.ranges.length-1];let i=!1;for(let t=0;t<this.select.ranges.length-1;t++){const o=this.select.ranges[t];if(o&&o.start.col===e.start.col&&o.start.row===e.start.row&&o.end.col===e.end.col&&o.end.row===e.end.row){i=!0;break}}i?(this.select.ranges.pop(),Yx(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const o=this.select.ranges[this.select.ranges.length-1].end.col,r=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(kb.SELECTED_CELL,{ranges:this.select.ranges,col:o,row:r})}else e&&0===this.select.ranges.length&&this.table.fireListeners(kb.SELECTED_CLEAR,{})}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var r;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const n=!!(null===(r=this.select.ranges)||void 0===r?void 0:r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,n),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.columnResize.isRightFrozen?i.columnResize.x-t:t-i.columnResize.x;if(Math.abs(o)<1)return;const r=i.table.getColWidth(i.columnResize.col);let n=r;n+=o;const s=i.table.getMinColWidth(i.columnResize.col),a=i.table.getMaxColWidth(i.columnResize.col);if(n<s||n>a){if(r===s||r===a)return;o=r-s>a-r?a-r:s-r}let l=i.table.getColWidth(i.columnResize.col)+o;if(l<i.table.internalProps.limitMinWidth&&(l=i.table.internalProps.limitMinWidth,o=l-i.table.getColWidth(i.columnResize.col)),"adaptive"===i.table.widthMode&&i.columnResize.col<i.table.colCount-1){const t=i.table.getColWidth(i.columnResize.col+1),e=i.table.getMinColWidth(i.columnResize.col+1),r=i.table.getMaxColWidth(i.columnResize.col+1);let n=t;if(n-=o,n<e||n>r){if(t===e||t===r)return;o=t-e>r-t?r-t:e-t}n-o<i.table.internalProps.limitMinWidth&&(o=n-i.table.internalProps.limitMinWidth)}o=Math.ceil(o),i.columnResize.col<i.table.rowHeaderLevelCount||i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount?LS(o,i):"indicator"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;let o,r,n;if(i.indicatorsAsCol)o=i.getIndicatorKey(e.columnResize.col,e.table.columnHeaderLevelCount);else{const t=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount-1),o=t.colHeaderPaths[t.colHeaderPaths.length-1];r=o.dimensionKey,n=o.value}for(let s=e.table.rowHeaderLevelCount;s<e.table.colCount-e.table.rightFrozenColCount;s++){const a=i.getIndicatorKey(s,e.table.columnHeaderLevelCount);if(i.indicatorsAsCol&&a===o)e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s);else if(!i.indicatorsAsCol){const o=i.getCellHeaderPaths(s,e.table.columnHeaderLevelCount-1),a=null==o?void 0:o.colHeaderPaths[o.colHeaderPaths.length-1];a&&r===a.dimensionKey&&n===a.value&&(e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s))}}}(o,i):"indicatorGroup"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount),r=i.getHeadNodeByRowOrColDimensions(o.colHeaderPaths.slice(0,o.colHeaderPaths.length-1)),n=r.startInTotal+e.table.frozenColCount,s=r.startInTotal+e.table.frozenColCount+r.size-1,a=e.table.getColsWidth(n,s),l=t;for(let t=n;t<=s;t++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const o=i.getBody(t,e.table.columnHeaderLevelCount);if(null==o?void 0:o.disableColumnResize)continue}let o=e.table.getColWidth(t)/a*l;o>0&&o<.5?o=.5:o<0&&o>=-.5&&(o=-.5),e.table.scenegraph.updateColWidth(t,o),e.table.internalProps._widthResizedColMap.add(t)}}(o,i):"all"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;for(let o=e.table.frozenColCount;o<e.table.colCount-e.table.rightFrozenColCount;o++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const t=i.getBody(o,e.table.columnHeaderLevelCount);if(null==t?void 0:t.disableColumnResize)continue}e.table.scenegraph.updateColWidth(o,t),e.table.internalProps._widthResizedColMap.add(o)}}(o,i):LS(o,i),i.columnResize.x=t,i.table.scenegraph.component.updateResizeCol(i.columnResize.col,e,i.columnResize.isRightFrozen),i.columnResize.col<i.table.frozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1,i.columnResize.isRightFrozen):i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount):i.table.options.frozenColCount?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1):i.table.options.rightFrozenColCount&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame()}(t,e,this)}endResizeRow(){setTimeout((()=>{this.rowResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var r;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const n=!!(null===(r=this.select.ranges)||void 0===r?void 0:r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,n),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.rowResize.isBottomFrozen?i.rowResize.y-e:e-i.rowResize.y;if(Math.abs(o)<1)return;i.table.getRowHeight(i.rowResize.row);let r=i.table.getRowHeight(i.rowResize.row)+o;if(r<i.table.internalProps.limitMinHeight&&(r=i.table.internalProps.limitMinHeight,o=r-i.table.getRowHeight(i.rowResize.row)),"adaptive"===i.table.heightMode&&i.rowResize.row<i.table.rowCount-1){let t=i.table.getRowHeight(i.rowResize.row+1);t-=o,t-o<i.table.internalProps.limitMinHeight&&(o=t-i.table.internalProps.limitMinHeight)}o=Math.ceil(o),i.rowResize.row<i.table.columnHeaderLevelCount||i.rowResize.row>=i.table.rowCount-i.table.bottomFrozenRowCount?HS(o,i):"indicator"===i.table.internalProps.rowResizeType?function(t,e){var i,o;const r=e.table.internalProps.layoutMap;let n,s,a;if(r.indicatorsAsCol){const t=r.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,e.rowResize.row),o=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];s=null==o?void 0:o.dimensionKey,a=null==o?void 0:o.value}else n=r.getIndicatorKey(e.table.rowHeaderLevelCount,e.rowResize.row);for(let i=e.table.columnHeaderLevelCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++){const l=r.getIndicatorKey(e.table.rowHeaderLevelCount,i);if(r.indicatorsAsCol||l!==n){if(r.indicatorsAsCol){const n=r.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,i),l=null===(o=null==n?void 0:n.rowHeaderPaths)||void 0===o?void 0:o[n.rowHeaderPaths.length-1];l&&s===l.dimensionKey&&a===l.value&&(e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i))}}else e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}}(o,i):"indicatorGroup"===i.table.internalProps.rowResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.table.rowHeaderLevelCount,e.rowResize.row),r=i.getHeadNodeByRowOrColDimensions(o.rowHeaderPaths.slice(0,o.rowHeaderPaths.length-1)),n=r.startInTotal+e.table.frozenRowCount,s=r.startInTotal+e.table.frozenRowCount+r.size-1,a=e.table.getRowsHeight(n,s),l=t;for(let t=n;t<=s;t++){let i=e.table.getRowHeight(t)/a*l;i>0&&i<.5?i=.5:i<0&&i>=-.5&&(i=-.51),e.table.scenegraph.updateRowHeight(t,i),e.table.internalProps._heightResizedRowMap.add(t)}}(o,i):"all"===i.table.internalProps.rowResizeType?function(t,e){for(let i=e.table.frozenRowCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++)e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}(o,i):HS(o,i),i.rowResize.y=e,i.table.scenegraph.component.updateResizeRow(i.rowResize.row,t,i.rowResize.isBottomFrozen),i.table.scenegraph.updateNextFrame()}(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(kb.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(kb.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o){!function(t,e,i,o,r){var n;if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;r.columnMove.moving=!0,r.columnMove.colSource=t,r.columnMove.rowSource=e,r.columnMove.x=i-r.table.tableX,r.columnMove.y=o-r.table.tableY;const s=r.table.getCellLocation(t,e),a="columnHeader"===s?r.columnMove.x:"rowHeader"===s||r.table.internalProps.layoutMap.isSeriesNumberInBody(t,e)?r.columnMove.y:0;r.table.scenegraph.component.showMoveCol(t,e,a);const l=!!(null===(n=r.select.ranges)||void 0===n?void 0:n.length);r.table.stateManager.updateSelectPos(-1,-1),r.table.stateManager.endSelectCells(!0,l),r.table.scenegraph.updateNextFrame()}(t,e,i,o,this)}updateMoveCol(t,e,i,o){!function(t,e,i,o,r){if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;const n=function(t,e,i){const o=i.getCellRange(t.col,t.row);if(i.isColumnHeader(t.col,t.row)){const r=i.getCellRange(e.col,o.start.row);e.row>=i.columnHeaderLevelCount&&(e.row=i.columnHeaderLevelCount-1),e.col>=t.col?e.col=r.end.col:e.col=r.start.col}else if(i.isRowHeader(t.col,t.row)){const r=i.internalProps.layoutMap,n=i.getCellRange(o.start.col,e.row);if(e.col>=i.rowHeaderLevelCount+r.leftRowSeriesNumberColumnCount&&(e.col=i.rowHeaderLevelCount+r.leftRowSeriesNumberColumnCount-1),"tree"===r.rowHierarchyType){const o=r.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,n=r.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths;if(o.length<=n.length){const r=n[o.length-1];r&&(e.row>=t.row?e.row=r.startInTotal+r.size-1+i.columnHeaderLevelCount:e.row=r.startInTotal+i.columnHeaderLevelCount)}}else e.row>=t.row?e.row=n.end.row:e.row=n.start.row}return e}({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:t,row:e},r.table);if(r.table.internalProps.layoutMap.canMoveHeaderPosition({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:n.col,row:n.row})){let s,a,l,h;r.columnMove.x=i-r.table.tableX,r.columnMove.y=o-r.table.tableY,r.columnMove.colTarget=n.col,r.columnMove.rowTarget=n.row,r.updateCursor("grabbing");const d=r.table.getCellLocation(r.columnMove.colSource,r.columnMove.rowSource);"columnHeader"===d?(a=r.columnMove.x,s=r.table.isLeftFrozenColumn(t)?r.columnMove.colTarget>=r.columnMove.colSource?r.table.getColsWidth(0,r.columnMove.colTarget):r.table.getColsWidth(0,r.columnMove.colTarget-1):r.table.isRightFrozenColumn(t)?r.table.tableNoFrameWidth-r.table.getColsWidth(n.col+1,r.table.colCount-1):(r.columnMove.colTarget>=r.columnMove.colSource?r.table.getColsWidth(0,r.columnMove.colTarget):r.table.getColsWidth(0,r.columnMove.colTarget-1))-r.table.stateManager.scroll.horizontalBarPos):("rowHeader"===d||r.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(h=r.columnMove.y,l=r.table.isFrozenRow(e)?r.columnMove.rowTarget>=r.columnMove.rowSource?r.table.getRowsHeight(0,r.columnMove.rowTarget):r.table.getRowsHeight(0,r.columnMove.rowTarget-1):r.table.isBottomFrozenRow(e)?r.table.tableNoFrameHeight-r.table.getRowsHeight(n.row+1,r.table.rowCount-1):(r.columnMove.rowTarget>=r.columnMove.rowSource?r.table.getRowsHeight(0,r.columnMove.rowTarget):r.table.getRowsHeight(0,r.columnMove.rowTarget-1))-r.table.stateManager.scroll.verticalBarPos),r.table.scenegraph.component.updateMoveCol(a,s,h,l),r.table.scenegraph.updateNextFrame()}else r.updateCursor("not-allowed"),r.columnMove.colTarget=r.columnMove.colSource,r.columnMove.rowTarget=r.columnMove.rowSource}(t,e,i,o,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return function(t){let e=!1;if("canMoveHeaderPosition"in t.table.internalProps.layoutMap&&t.columnMove.moving&&t.columnMove.colSource>=0&&t.columnMove.rowSource>=0&&t.columnMove.colTarget>=0&&t.columnMove.rowTarget>=0){const i=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),o=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),r=t.table._moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget});if(!r||r.targetIndex===r.sourceIndex)return t.updateCursor(),t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget,t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame(),!1;{t.table.internalProps.useOneRowHeightFillAll=!1,t.table.internalProps.layoutMap.clearCellRangeMap();const n=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),s=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),a=Math.min(n.start.col,s.start.col,i.start.col,o.start.col),l=Math.max(n.end.col,s.end.col,i.end.col,o.end.col),h=Math.min(n.start.row,s.start.row,i.start.row,o.start.row);let d=Math.max(n.end.row,s.end.row,i.end.row,o.end.row);"row"===r.moveType&&"tree"===t.table.internalProps.layoutMap.rowHierarchyType&&(d=r.targetIndex>r.sourceIndex?d+r.targetSize-1:d+r.sourceSize-1),!t.table.transpose&&t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)&&(t.table.changeRecordOrder(r.sourceIndex,r.targetIndex),t.changeCheckboxAndRadioOrder(r.sourceIndex,r.targetIndex)),"column"===r.moveType?PS(a,l,0,-1,t.table):PS(0,-1,h,d,t.table),t.table.clearCellStyleCache(),t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)?t.table.scenegraph.updateHeaderPosition(t.table.scenegraph.proxy.colStart,t.table.scenegraph.proxy.colEnd,t.table.scenegraph.proxy.rowStart,t.table.scenegraph.proxy.rowEnd,r.moveType):"column"===r.moveType?t.table.scenegraph.updateHeaderPosition(a,l,0,-1,r.moveType):t.table.scenegraph.updateHeaderPosition(0,-1,h,d,r.moveType),"adjustFrozenCount"===t.table.internalProps.frozenColDragHeaderMode&&t.table.isListTable()&&(t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&!t.table.isLeftFrozenColumn(t.columnMove.colSource)?t.table.frozenColCount+=n.end.col-n.start.col+1:t.table.isLeftFrozenColumn(t.columnMove.colSource)&&!t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&(t.table.frozenColCount-=n.end.col-n.start.col+1),t.table.isRightFrozenColumn(t.columnMove.colTarget)&&!t.table.isRightFrozenColumn(t.columnMove.colSource)?t.table.rightFrozenColCount+=n.end.col-n.start.col+1:t.table.isRightFrozenColumn(t.columnMove.colSource)&&!t.table.isRightFrozenColumn(t.columnMove.colTarget)&&(t.table.rightFrozenColCount-=n.end.col-n.start.col+1)),e=!0}}return setTimeout((()=>{t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget}),0),t.table.scenegraph.component.hideMoveCol(),t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?(t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen),t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)):t.columnResize.col>=t.table.colCount-t.table.rightFrozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):t.table.options.frozenColCount?t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount),t.table.scenegraph.updateNextFrame(),e}(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?null!==(t=this.table.rowHeaderLevelCount)&&void 0!==t?t:0:Math.max((null!==(e=this.table.rowHeaderLevelCount)&&void 0!==e?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,null!==(i=this.table.options.frozenColCount)&&void 0!==i?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,r=this.table.tableNoFrameHeight;o+r>=i&&this.table.fireListeners(kb.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:r,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,r=this.table.tableNoFrameWidth;o+r>=i&&this.table.fireListeners(kb.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:r})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,1===t),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(kb.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),r!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(kb.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),r!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,r,n;const s=this.table.getAllRowsHeight(),a=(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0;t=Math.max(0,Math.min(t,s-this.table.scenegraph.height-a)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const l=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const h=t/(s-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(h),l!==t&&i&&(this.table.fireListeners(kb.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,scrollWidth:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:h}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,r,n;this.table.scrollLeft;const s=this.table.getAllColsWidth(),a=(this.table.getFrozenColsWidth(),(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0);t=Math.max(0,Math.min(t,s-this.table.scenegraph.width-a)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const l=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const h=t/(s-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(h),l!==t&&i&&(this.table.fireListeners(kb.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,scrollWidth:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:h}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var r;(null===(r=this.table.internalProps.menu)||void 0===r?void 0:r.contextMenuItems)&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,Iy.contextmenu)),this.table.fireListeners(kb.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,r){this.table.fireListeners(kb.DROPDOWN_ICON_CLICK,{col:t,row:e,event:r}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,Iy.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(kb.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let n;r.forEachChildren((t=>t.attribute.funcType===Pv.dropDown&&(n=t,!0))),n&&(this.residentHoverIcon={col:t,row:e,icon:n},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(kb.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(kb.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],r=this.table.getCellRange(i,o);if(r)for(let t=r.start.col;t<=r.end.col;t++)for(let e=r.start.row;e<=r.end.row;e++)this.table.scenegraph.updateCellContent(t,e)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let r=0;r<o.length;r++){const n=o[r];let{col:s,row:a}=n;const{field:l,menuKey:h}=n;if("number"!=typeof s||"number"!=typeof a)if(this.table.isPivotTable()){const t=this.table.internalProps.layoutMap.getPivotCellAdress(l);if(!t)continue;s=t.col,a=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!t)continue;s=t.col,a=t.row}if(J(s)&&J(a)&&this.table.isCellRangeEqual(t,e,s,a)){const o=this.table._getHeaderLayoutMap(null!=s?s:t,null!=a?a:e).dropDownMenu||this.table.globalDropDownMenu;if(o)for(let t=0;t<o.length;t++){const e=o[t];if(Q(e)&&(e.menuKey||e.text)===(h||"")&&t===i)return!0;if(ot(e)&&e===h&&t===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const i=this.table.getPivotSortState(t,e),r=i?i.toUpperCase():"DESC",n="ASC"===r?"DESC":"ASC";return this.table.sort(t,e,n),void this.table.fireListeners(TS.PIVOT_SORT_CLICK,{col:t,row:e,order:r||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const r=this.sort.col,n=this.sort.row;BS(t,e,this.table,o),this.sort.col=t,this.sort.row=e,this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,i,this.sort.order,r,n,this.sort.icon),this.sort.icon=i}updateSortState(t){if(t.field===this.sort.field&&t.order===this.sort.order)return;const e=this.sort.col,i=this.sort.row,o="asc"===this.sort.order?"sort_downward":"desc"===this.sort.order?"sort_upward":"sort_normal";this.setSortState(t);const r=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t.field);this.sort.col=r.col,this.sort.row=r.row;const n=this.table.scenegraph.getCell(this.sort.col,this.sort.row).getChildByName(o,!0);this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,n,this.sort.order,e,i,this.sort.icon)}triggerFreeze(t,e,i){this.table.isPivotTable()||this.table.transpose||(function(t,e,i){i.frozenColCount>0?t!==i.frozenColCount-1?i.setFrozenColCount(t+1):i.setFrozenColCount(0):i.setFrozenColCount(t+1)}(t,0,this.table),this.frozen.icon=i)}updateCursor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,r,n){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=r,this.drill.row=n,function(t,e,i,o,r){const n=r.getCellLocation(t,e);let s=0,a=0,l=!1;"columnHeader"===n?(s=r.getColsWidth(0,r.rowHeaderLevelCount-1)-(0===r.frozenColCount?r.scrollLeft:0),a=r.getRowsHeight(0,e-1)+r.getRowHeight(e)/2,l=!0):"rowHeader"===n&&(a=r.getRowsHeight(0,r.columnHeaderLevelCount-1),s=r.getColsWidth(0,t-1)+r.getColWidth(t)/2,l=!0),r.scenegraph.updateDrill(l,s,a,i,o)}(r,n,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,i){const o=i.scenegraph.getCell(t,e).getChildByName("sparkline"),r=null==o?void 0:o.getChildByName("highlight-line"),n=null==o?void 0:o.getChildByName("highlight-symbol");r&&r.setAttributes({visible:!1,pickable:!1}),n&&n.setAttributes({visible:!1,pickable:!1}),i.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table);let r=!1;-1!==t&&-1!==e&&(r=function(t,e,i,o,r){var n,s;const a=r.scenegraph.getCell(t,e).getChildByName("sparkline"),l=null==a?void 0:a.getChildByName("sparkline-line"),h=null==a?void 0:a.getChildByName("sparkline-symbol-group");if(!l)return!1;const d=l.bandwidth,c=l.min,u=l.max,g=l.attribute.points;let p;i-=a.globalAABBBounds.x1,a.globalAABBBounds.y1;for(let t=0;t<g.length;t++){const{x:e,y:o,defined:r,rawData:f}=g[t];if(Math.abs(i-e)<d/2&&(p={point:g[t],points:g,pointsBandWidth:d,pointData:f},r)){const t=a.getChildByName("highlight-line");if(t)t.setAttributes({points:[{x:e,y:u},{x:e,y:c}],visible:!0,pickable:!0});else{const t=rd({points:[{x:e,y:u},{x:e,y:c}],lineWidth:null===(n=l.hover)||void 0===n?void 0:n.strokeWidth,stroke:null===(s=l.hover)||void 0===s?void 0:s.stroke});t.name="highlight-line",a.addChild(t)}const i=a.getChildByName("highlight-symbol");if(i)i.setAttributes({x:e,y:o,visible:!0,pickable:!0});else{const t=ed({x:e,y:o,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});t.name="highlight-symbol",a.addChild(t)}break}}if(r.scenegraph.updateNextFrame(),p){const i={col:t,row:e,field:r.getHeaderField(t,e),value:r.getCellValue(t,e),dataValue:r.getCellOriginValue(t,e),cellHeaderPaths:r.internalProps.layoutMap.getCellHeaderPaths(t,e),title:r.getBodyColumnDefine(t,e).title,cellRange:r.getCellRelativeRect(t,e),sparkline:{pointData:p.pointData},scaleRatio:r.canvas.getBoundingClientRect().width/r.canvas.offsetWidth};r.fireListeners(kb.MOUSEOVER_CHART_SYMBOL,i)}return!0}(t,e,i,0,this.table)),r?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return function(t,e,i,o,r){const n=r.table.getRecordShowIndexByCell(t,e);if(n>=0){const t=r.table.dataSource.getIndexKey(n);r.checkedState[t]||(r.checkedState[t]={}),r.checkedState[t][i]=o}}(t,e,i,o,this)}setHeaderCheckedState(t,e){return function(t,e,i){var o;i.headerCheckedState[t]=e,null===(o=i.checkedState)||void 0===o||o.forEach((i=>{i[t]=e}))}(t,e,this)}syncCheckedState(t,e,i,o){return function(t,e,i,o,r){var n,s;if(r.table.isHeader(t,e)){if(J(r.headerCheckedState[i]))return r.headerCheckedState[i];if("function"==typeof o)return;if(J(o))r.headerCheckedState[i]=o;else if((null===(n=r.checkedState)||void 0===n?void 0:n.length)>0)return r.updateHeaderCheckedState(i);return r.headerCheckedState[i]}const a=r.table.getRecordShowIndexByCell(t,e);if(a>=0){const t=r.table.dataSource.getIndexKey(a);if(J(null===(s=r.checkedState[t])||void 0===s?void 0:s[i]))return r.checkedState[t][i];r.checkedState[t]||(r.checkedState[t]={}),r.checkedState[t][i]=o}return o}(t,e,i,o,this)}initCheckedState(t){return function(t,e){e.checkedState=[],e.headerCheckedState={},e.radioState={};let i=!1;e._checkboxCellTypeFields=[],e._headerCheckFuncs={},e.table.internalProps.layoutMap.headerObjects.forEach(((t,o)=>{if("checkbox"===t.headerType){const o=t.define.checked;null==o||"function"==typeof o?(i=!0,"function"==typeof o&&(e._headerCheckFuncs[t.field]=o)):e.headerCheckedState[t.field]=o,"checkbox"!==t.define.cellType||t.fieldFormat||e._checkboxCellTypeFields.push(t.field)}})),i&&t.forEach(((t,i)=>{e._checkboxCellTypeFields.forEach((o=>{const r=t[o];let n;if(Q(r)?n=r.checked:"boolean"==typeof r&&(n=r),null==n){const t=e._headerCheckFuncs[o];if(t){const s=e.table.getCellAddrByFieldRecord(o,i);n=mb(t,{col:s.col,row:s.row,table:e.table,context:null,value:r})}}e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][o]=n}))}))}(t,this)}updateHeaderCheckedState(t){return function(t,e){const i=e.checkedState.every((e=>!0===e[t]));return i?(e.headerCheckedState[t]=!0,i):e.checkedState.every((e=>!1===e[t]))?(e.headerCheckedState[t]=!1,!1):!!e.checkedState.find((e=>!0===e[t]))&&(e.headerCheckedState[t]="indeterminate","indeterminate")}(t,this)}initLeftRecordsCheckState(t){return function(t,e){for(let i=e.checkedState.length;i<t.length;i++){const o=t[i];e._checkboxCellTypeFields.forEach((t=>{const r=o[t];let n;Q(r)?n=r.checked:"boolean"==typeof r&&(n=r),e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][t]=n}))}}(t,this)}setRadioState(t,e,i,o,r){!function(t,e,i,o,r,n){const s=n.table.getRecordShowIndexByCell(t,e);if(s>=0){const t=n.table.dataSource.getIndexKey(s);"column"===o?at(r)?(n.radioState[i]={},n.radioState[i][t]=r):n.radioState[i]=t:(n.radioState[i]||(n.radioState[i]={}),at(r)?n.radioState[i][t]=r:n.radioState[i][t]=!0)}}(t,e,i,o,r,this)}syncRadioState(t,e,i,o,r,n){return function(t,e,i,o,r,n,s){var a,l,h,d,c;const u=s.table.getRecordShowIndexByCell(t,e);if(u>=0){const t=s.table.dataSource.getIndexKey(u);if("column"===o){if(!J(s.radioState[i])&&n)return at(r)?(s.radioState[i]={},s.radioState[i][t]=r):s.radioState[i]=t,!0;if(at(s.radioState[i])&&!at(r))return s.radioState[i]===t;if(at(s.radioState[i])&&at(r))return!1;if(Q(s.radioState[i])&&!at(r))return!1;if(Q(s.radioState[i])&&at(r))return s.radioState[i][t]===r}else if("cell"===o){if(!J(s.radioState[i])&&n)return s.radioState[i]={},at(r)?s.radioState[i][t]=r:s.radioState[i][t]=!0,!0;if(!J(null===(a=s.radioState[i])||void 0===a?void 0:a[t])&&n)return at(r)?s.radioState[i][t]=r:s.radioState[i][t]=!0,!0;if(K(null===(l=s.radioState[i])||void 0===l?void 0:l[t])&&!at(r))return s.radioState[i][t];if(K(null===(h=s.radioState[i])||void 0===h?void 0:h[t])&&at(r))return!1;if(at(null===(d=s.radioState[i])||void 0===d?void 0:d[t])&&!at(r))return!1;if(at(null===(c=s.radioState[i])||void 0===c?void 0:c[t])&&at(r))return s.radioState[i][t]===r}}return n}(t,e,i,o,r,n,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&function(t,e,i){const{checkedState:o,table:r}=i;if(r.internalProps.transpose?(t=r.getRecordShowIndexByCell(t,0),e=r.getRecordShowIndexByCell(e,0)):(t=r.getRecordShowIndexByCell(0,t),e=r.getRecordShowIndexByCell(0,e)),t!==e){const i=o[t];o[t]=o[e],o[e]=i}}(t,e,this),this.radioState.length&&function(t,e,i){const{radioState:o,table:r}=i;if(r.internalProps.transpose?(t=r.getRecordShowIndexByCell(t,0),e=r.getRecordShowIndexByCell(e,0)):(t=r.getRecordShowIndexByCell(0,t),e=r.getRecordShowIndexByCell(0,e)),t!==e){const i=o[t];o[t]=o[e],o[e]=i}}(t,e,this)}}(this),this.eventManager=new class{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new OS(t.stateManager),"node"===Xv.mode||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0))}bindOuterEvent(){DS(this),function(t){const e=t.table,i=e.stateManager,o=e.internalProps.handler;function r(t){var i;if(e.hasListeners(kb.KEYDOWN)){const o={keyCode:null!==(i=t.keyCode)&&void 0!==i?i:t.which,code:t.code,event:t,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(kb.KEYDOWN,o)}}o.on(e.getElement(),"blur",(e=>{t.dealTableHover()})),o.on(e.getElement(),"keydown",(o=>{var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S;if("a"===o.key&&(o.ctrlKey||o.metaKey))(null===(n=e.keyboardOptions)||void 0===n?void 0:n.selectAllOnCtrlA)&&(o.preventDefault(),t.deelTableSelectAll());else if(i.select.cellPos.col>=0&&i.select.cellPos.row>=0&&("ArrowUp"===o.key||"ArrowDown"===o.key||"ArrowLeft"===o.key||"ArrowRight"===o.key)){if((null===(a=null===(s=e.options.keyboardOptions)||void 0===s?void 0:s.moveEditCellOnArrowKeys)||void 0===a||!a)&&(null===(l=e.editorManager)||void 0===l?void 0:l.editingEditor))return;let t,r;if(o.preventDefault(),o.stopPropagation(),"ArrowUp"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,r=0):(o.shiftKey,t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row-1))):"ArrowDown"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,r=e.rowCount-1):(o.shiftKey,t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1))):"ArrowLeft"===o.key?o.ctrlKey||o.metaKey?(t=0,r=i.select.cellPos.row):(o.shiftKey,r=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col-1))):"ArrowRight"===o.key&&(o.ctrlKey||o.metaKey?(t=e.colCount-1,r=i.select.cellPos.row):(o.shiftKey,r=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col+1)))),Mw(e,t,r))return;e.selectCell(t,r,o.shiftKey),null!==(d=null===(h=e.options.keyboardOptions)||void 0===h?void 0:h.moveEditCellOnArrowKeys)&&void 0!==d&&d&&(null===(c=e.editorManager)||void 0===c?void 0:c.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,r)&&e.editorManager.startEditCell(t,r))}else if("Escape"===o.key)null===(u=e.editorManager)||void 0===u||u.cancelEdit();else if("Enter"===o.key){if(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor){if(r(o),e.editorManager.completeEdit(),e.getElement().focus(),!0===(null===(p=e.options.keyboardOptions)||void 0===p?void 0:p.moveFocusCellOnEnter)){const t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(Mw(e,t,r))return;e.selectCell(t,r,o.shiftKey)}return}if(!0===(null===(f=e.options.keyboardOptions)||void 0===f?void 0:f.moveFocusCellOnEnter)){const t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(Mw(e,t,r))return;e.selectCell(t,r,o.shiftKey)}else if((null===(b=null===(v=e.options.keyboardOptions)||void 0===v?void 0:v.editCellOnEnter)||void 0===b||b)&&1===(null!==(C=null===(m=e.stateManager.select.ranges)||void 0===m?void 0:m.length)&&void 0!==C?C:0)){const t=e.stateManager.select.ranges[0].start.col,i=e.stateManager.select.ranges[0].start.row,o=e.stateManager.select.ranges[0].end.col,r=e.stateManager.select.ranges[0].end.row;t===o&&i===r&&e.getEditor(t,i)&&e.editorManager.startEditCell(t,i)}}else if("Tab"===o.key){if((null===(w=null===(y=e.options.keyboardOptions)||void 0===y?void 0:y.moveFocusCellOnTab)||void 0===w||w)&&(o.preventDefault(),i.select.cellPos.col>=0&&i.select.cellPos.row>=0)){let t,o;if(i.select.cellPos.col===e.colCount-1?(o=Math.min(e.rowCount-1,i.select.cellPos.row+1),t=e.rowHeaderLevelCount):i.select.cellPos.row===e.rowCount-1?(o=e.rowCount-1,t=e.rowHeaderLevelCount):(o=i.select.cellPos.row,t=i.select.cellPos.col+1),Mw(e,t,o))return;e.selectCell(t,o),(null===(x=e.editorManager)||void 0===x?void 0:x.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,o)&&e.editorManager.startEditCell(t,o))}}else{const t=e.options.editCellTrigger;if(("keydown"===t||Array.isArray(t)&&t.includes("keydown"))&&!(null===(S=e.editorManager)||void 0===S?void 0:S.editingEditor)){const t=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;o.key.match(t)&&e.editorManager.startEditCell(i.select.cellPos.col,i.select.cellPos.row,"")}}r(o)})),o.on(e.getElement(),"copy",(t=>{var i,o;if(null===(i=e.keyboardOptions)||void 0===i?void 0:i.copySelected){const i=e.getCopyValue();if(J(i)){if(t.preventDefault(),null===(o=navigator.clipboard)||void 0===o?void 0:o.write){const t=t=>{const e=["<table>"],i=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),o=t.split("\r\n");return o.forEach((function(t,i){const r=t.split("\t"),n=[];0===i&&e.push("<tbody>"),r.forEach((function(t,e){const i=t?t.toString().replace(/&/g,"&amp;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,(t=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(t.length-1)} </span>`)).replace(/\t/gi,"&#9;"):" ";n.push(`<td>${i}</td>`)})),e.push("<tr>",...n,"</tr>"),i===o.length-1&&e.push("</tbody>")})),e.push("</table>"),[i,e.join("")].join("")},e=t(i);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})])}else Ab?window.clipboardData.setData("Text",i):t.clipboardData.setData("text/plain",i);e.fireListeners(kb.COPY_DATA,{cellRange:e.stateManager.select.ranges,copyData:i})}}})),o.on(e.getElement(),"paste",(t=>{var i,o,r,n;if((null===(i=e.keyboardOptions)||void 0===i?void 0:i.pasteValueToCell)&&e.changeCellValues){if(null===(o=e.editorManager)||void 0===o?void 0:o.editingEditor)return;if((null===(r=e.stateManager.select.ranges)||void 0===r?void 0:r.length)>0)if(null===(n=navigator.clipboard)||void 0===n?void 0:n.read)navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/html")?a(e):1===e.types.length&&"text/plain"===e.types[0]&&h(e)}));else{const i=e.stateManager.select.ranges,o=Math.min(i[0].start.col,i[0].end.col),r=Math.min(i[0].start.row,i[0].end.row),n=(t.clipboardData||window.Clipboard).getData("text").split("\n"),s=[];n.forEach((function(t,e){const i=t.split("\t"),o=[];s.push(o),i.forEach((function(t,e){e===i.length-1&&(t=t.trim()),o.push(t)}))})),e.changeCellValues(o,r,s)}}})),o.on(e.getElement(),"contextmenu",(t=>{var i;!1!==(null===(i=e.eventOptions)||void 0===i?void 0:i.preventDefaultContextMenu)&&t.preventDefault()})),e.options.canvas||o.on(e.getContainer(),"resize",(t=>{var i;0===t.width&&0===t.height||((e.autoFillWidth||e.autoFillHeight)&&(null===(i=e.editorManager)||void 0===i||i.completeEdit()),J(e.options.pixelRatio)||e.setPixelRatio(US()),t.windowSizeNotChange||e.resize())}));const n=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function a(t){const i=e.stateManager.select.ranges,o=i.length,r=Math.min(i[o-1].start.col,i[o-1].end.col),a=Math.min(i[o-1].start.row,i[o-1].end.row),h=Math.max(i[o-1].start.col,i[o-1].end.col),c=Math.max(i[o-1].start.row,i[o-1].end.row);let u=0,g=0,p=[];t.getType("text/html").then((t=>{t.text().then((t=>{var i,o;if(t&&/(<table)|(<TABLE)/g.test(t)){const l=Array.from(t.matchAll(n));for(const t of l){const e=t[1],o=Array.from(e.matchAll(s)).map((t=>t[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,"\n").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#9;/gi,"\t").replace(/&nbsp;/g," ")));p.push(o),u=Math.max(u,null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0)}g=null!==(o=p.length)&&void 0!==o?o:0,p=d(p,g,u,c-a+1,h-r+1),e.changeCellValues(r,a,p,!0)}else navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/plain")&&e.getType("text/plain").then((t=>{t.text().then(l)}))}))}))}))}function l(t){var i;const o=e.stateManager.select.ranges,r=o.length,n=Math.min(o[r-1].start.col,o[r-1].end.col),s=Math.min(o[r-1].start.row,o[r-1].end.row),a=Math.max(o[r-1].start.col,o[r-1].end.col),l=Math.max(o[r-1].start.row,o[r-1].end.row);let h=0,c=0,u=[];t.split("\n").forEach((function(t,e){var i;const o=t.split("\t"),r=[];u.push(r),o.forEach((function(t,e){e===o.length-1&&(t=t.trim()),r.push(t)})),h=Math.max(h,null!==(i=null==r?void 0:r.length)&&void 0!==i?i:0)})),c=null!==(i=u.length)&&void 0!==i?i:0,u=d(u,c,h,l-s+1,a-n+1),e.changeCellValues(n,s,u,!0)}function h(t){const i=e.stateManager.select.ranges,o=i.length,r=Math.min(i[o-1].start.col,i[o-1].end.col),n=Math.min(i[o-1].start.row,i[o-1].end.row),s=Math.max(i[o-1].start.col,i[o-1].end.col),a=Math.max(i[o-1].start.row,i[o-1].end.row);let l=0,h=0;t.getType("text/plain").then((t=>{t.text().then((t=>{var i;const o=t.replace(/\r(?!\n)/g,"\r\n").split("\r\n");let c=[];o.length>1&&""===o[o.length-1]&&o.pop(),o.forEach((function(t,e){var i;const o=t.split("\t"),r=[];c.push(r),o.forEach((function(t,e){t.includes("\n")&&(t=t.replace(/^"(.*)"$/,"$1").replace(/["]*/g,(t=>new Array(Math.floor(t.length/2)).fill('"').join("")))),r.push(t)})),l=Math.max(l,null!==(i=null==r?void 0:r.length)&&void 0!==i?i:0)})),h=null!==(i=c.length)&&void 0!==i?i:0,c=d(c,h,l,a-n+1,s-r+1),e.changeCellValues(r,n,c,!0)}))}))}function d(t,e,i,o,r){if(r>i||o>e){if(r%i==0&&o%e==0){const n=[];for(let s=0;s<o;s++){const o=[];n.push(o);for(let n=0;n<r;n++){const r=s%e,a=n%i;o.push(t[r][a])}}return n}return t}return t}const c=t=>{e.eventManager.LastBodyPointerXY={x:t.x,y:t.y},e.eventManager.isDown=!0};t.globalEventListeners.push({name:"pointerdown",env:"body",callback:c}),document.body.addEventListener("pointerdown",c);const u=t=>{e.eventManager.LastBodyPointerXY=null,e.eventManager.isDown=!1,e.eventManager.isDraging=!1,e.eventManager.inertiaScroll.endInertia(),"grabing"===i.interactionState&&i.isResizeCol()?NS(e):"grabing"===i.interactionState&&i.isResizeRow()&&GS(e)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:u}),document.addEventListener("pointerup",u);const g=o=>{var r,n,s,a,l;if(e.eventManager.isDown&&e.eventManager.LastBodyPointerXY){const t=null!==(n=null===(r=e.eventManager.LastBodyPointerXY)||void 0===r?void 0:r.x)&&void 0!==n?n:o.x,i=null!==(a=null===(s=e.eventManager.LastBodyPointerXY)||void 0===s?void 0:s.y)&&void 0!==a?a:o.y;(Math.abs(t-o.x)>1||Math.abs(i-o.y)>1)&&(e.eventManager.isDraging=!0)}const{x:h,y:d}=e._getMouseAbstractPoint(o,!1);i.interactionState===Sv.grabing&&(i.isResizeCol()?(t.dealColumnResize(h,d),e.hasListeners(kb.RESIZE_COLUMN)&&e.fireListeners(kb.RESIZE_COLUMN,{col:e.stateManager.columnResize.col,colWidth:e.getColWidth(e.stateManager.columnResize.col)})):i.isResizeRow()&&(t.dealRowResize(h,d),e.hasListeners(kb.RESIZE_ROW)&&e.fireListeners(kb.RESIZE_ROW,{row:e.stateManager.rowResize.row,rowHeight:e.getRowHeight(e.stateManager.rowResize.row)})));const c=e.stateManager.isSelecting();if(t._enableTableScroll&&t.isDraging&&c&&(null===(l=e.stateManager.select.ranges)||void 0===l?void 0:l.length)>0){const t=e.getDrawRange(),i=e.getFrozenRowsHeight(),o=e.getBottomFrozenRowsHeight(),r=e.getFrozenColsWidth(),n=e.getRightFrozenColsWidth(),s=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].start,a=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end,l=(!1===e.isFrozenRow(s.row)||!1===e.isFrozenRow(a.row))&&e.getAllRowsHeight()>e.tableNoFrameHeight,c=(!1===e.isFrozenColumn(s.col)||!1===e.isFrozenColumn(a.col))&&e.getAllColsWidth()>e.tableNoFrameWidth;if((d>t.bottom-o||d<t.top+i)&&l||(h>t.right-n||h<t.left+r)&&c){e.eventManager.scrollXSpeed=0,e.eventManager.scrollYSpeed=0;let s=!1,a=!1,u=!1,g=!1;d>t.bottom-o&&l&&e.scrollTop+e.tableNoFrameWidth<e.getAllRowsHeight()?(s=!0,e.eventManager.scrollYSpeed=-(d-t.bottom+o)/50):d<t.top+i&&l&&e.scrollTop>0&&(a=!0,e.eventManager.scrollYSpeed=-(d-t.top-i)/50),h>t.right-n&&c&&e.scrollLeft+e.tableNoFrameWidth<e.getAllColsWidth()?(u=!0,e.eventManager.scrollXSpeed=-(h-t.right+n)/50):h<t.left+r&&c&&e.scrollLeft>0&&(g=!0,e.eventManager.scrollXSpeed=-(h-t.left-r)/50),e.eventManager.inertiaScroll.startInertia(e.eventManager.scrollXSpeed,e.eventManager.scrollYSpeed,1),e.eventManager.inertiaScroll.setScrollHandle(((l,c)=>{let p,f;zS({deltaX:-l,deltaY:-c},e.stateManager,!1),s?f=e.scrollTop+t.height-o-20:a&&(f=e.scrollTop+i+20),u?p=e.scrollLeft+t.width-n-20:g&&(p=e.scrollLeft+r+20);let v=!1,b=!1;u||g||(h>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&h<e.tableNoFrameWidth||h>0&&h<e.getFrozenColsWidth()?(p=h,b=!0):p=e.scrollLeft+h),s||a||(d>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&d<e.tableNoFrameHeight||d>0&&d<e.getFrozenRowsHeight()?(f=d,v=!0):f=e.scrollTop+d),e.stateManager.updateInteractionState(Sv.grabing);const m=e.getTargetColAtConsiderRightFrozen(p,b),C=e.getTargetRowAtConsiderBottomFrozen(f,v);J(m)&&J(C)&&e.stateManager.updateSelectPos(m.col,C.row,!1,!1,!1,!0)}))}else e.eventManager.inertiaScroll.isInertiaScrolling()?e.eventManager.inertiaScroll.endInertia():e.eventManager.scrollYSpeed=0}};t.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;o.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==Sv.scrolling&&i.hideVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==Sv.scrolling&&i.hideHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.vScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.vScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1})),o.component.hScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.hScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1}));const r=tb(i.updateVerticalScrollBar,20),n=tb(i.updateHorizontalScrollBar,20);o.component.vScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e,t)})),o.component.hScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(e)}))}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.component.vScrollBar)||e.target.isChildOf(o.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const r=o=>{var r,n;if(t.touchMove&&o.preventDefault(),t.isTouchdown&&VS(o))if((null===(n=null===(r=t.downIcon)||void 0===r?void 0:r.attribute)||void 0===n?void 0:n.funcType)===Pv.dragReorder)o.preventDefault();else if(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll){const r=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,n=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;zS({deltaX:r,deltaY:n},i),o.cancelable&&("none"===e.internalProps.overscrollBehavior||Math.abs(n)>=Math.abs(r)&&0!==n&&FS(n,i)||Math.abs(n)<=Math.abs(r)&&0!==r&&IS(r,i))&&o.preventDefault()}};window.addEventListener("touchmove",r,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"window",callback:r});const n=i=>{var o,r,n,s;if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&VS(i)){if((null===(r=null===(o=t.downIcon)||void 0===o?void 0:o.attribute)||void 0===r?void 0:r.funcType)===Pv.dragReorder)i.preventDefault();else if((null===(n=t.touchMovePoints)||void 0===n?void 0:n.length)&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[(null===(s=t.touchMovePoints)||void 0===s?void 0:s.length)-1],r=(o.x-i.x)/(o.timestamp-i.timestamp),n=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(r,n,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{zS({deltaX:-t,deltaY:-i},e.stateManager)}))}t.isTouchdown=!1,t.touchMovePoints=[]}};window.addEventListener("touchend",n),t.globalEventListeners.push({name:"touchend",env:"window",callback:n});const s=e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])};window.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}(this),WS(this)}updateEventBinder(){setTimeout((()=>{var t;this.table.isReleased||(Ix(this.table)&&0===(null===(t=this.handleTextStickBindId)||void 0===t?void 0:t.length)?(this.handleTextStickBindId.push(this.table.on(kb.SCROLL,(t=>{Lx(this.table)}))),this.handleTextStickBindId.push(this.table.on(kb.RESIZE_COLUMN_END,(t=>{Lx(this.table)}))),this.handleTextStickBindId.push(this.table.on(kb.RESIZE_ROW_END,(t=>{Lx(this.table)})))):!Ix(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach((t=>{this.table.off(t)})),this.handleTextStickBindId=[]),ES(this.table))}),0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;var e;this.table.on(kb.ICON_CLICK,(e=>{var i;const{col:o,row:r,x:n,y:s,funcType:a,icon:l,event:h}=e;if(a===Pv.dropDown)t.triggerDropDownMenu(o,r,n,s,h);else if(a===Pv.sort)t.triggerSort(o,r,l,h);else if(a===Pv.frozen)t.triggerFreeze(o,r,l);else if(a===Pv.drillDown)(d=this.table).fireListeners(TS.DRILLMENU_CLICK,d.stateManager.drill);else if(a===Pv.collapse||a===Pv.expand){const e=!!(null===(i=t.select.ranges)||void 0===i?void 0:i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,e),this.table.toggleHierarchyState(o,r)}var d})),this.table.on(kb.DROPDOWN_MENU_CLICK,(()=>{t.hideMenu()})),this.updateEventBinder(),e=this.table,"browser"===Xv.mode&&e.on(kb.CLICK_CELL,(t=>{const{col:i,row:o}=t;if("image"===t.target.type&&t.target.role&&t.target.role.startsWith("icon"))return;let r;r=e.internalProps.layoutMap.isHeader(i,o)?e.isPivotTable()?e._getHeaderLayoutMap(i,o).headerType:e.getHeaderDefine(i,o).headerType:e.getBodyColumnType(i,o);const n=e.isHeader(i,o)?e.getHeaderDefine(i,o):e.getBodyColumnDefine(i,o),s=e.getCellValue(i,o),a=e.getCellOriginValue(i,o);if("link"===r){if(!1===n.linkJump)return;const t=n.templateLink,r=!1!==n.linkDetect;let l;if(t){const r=e.getCellOriginRecord(i,o),n=Object.assign({__value:s,__dataValue:a},r),h=/\{\s*(\S+?)\s*\}/g;l=t.replace(h,((t,e)=>n[e]))}else if(r){if(!Xb.test(s))return;l=s}else l=s;const h=n.linkTarget,d=n.linkWindowFeatures;window.open(l,h,d)}else if("image"===r){const{clickToPreview:t}=n;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=new Image;i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",e.appendChild(i),document.body.appendChild(e)}else if("video"===r){const{clickToPreview:t}=n;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=document.createElement("video");i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",i.setAttribute("preload","auto"),i.setAttribute("controls","true"),e.appendChild(i),document.body.appendChild(e)}})),this.table.on(kb.DBLCLICK_CELL,(t=>{var e;if(t.federatedEvent){const i=RC(t.federatedEvent),o=this.table.scenegraph.getResizeColAt(i.abstractPos.x,i.abstractPos.y,null===(e=i.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table.eventManager.checkCellFillhandle(i))this.table.fireListeners(kb.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(o.col,o.row)&&o.col>=0){this.table.scenegraph.updateAutoColWidth(o.col),this.table.internalProps._widthResizedColMap.add(o.col),this.table.scenegraph.updateChartSizeForResizeColWidth(o.col);const t=this.table.stateManager;t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose&&t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen);const e=[];for(let t=0;t<this.table.colCount;t++)e.push(this.table.getColWidth(t));this.table.fireListeners(kb.RESIZE_COLUMN_END,{col:o.col,colWidths:e})}}})),this.table.isPivotTable()&&function(t){const e=t.internalProps.layoutMap.rowsDefine,i=t.internalProps.layoutMap.columnsDefine;for(let t=0;t<e.length;t++){const i=e[t];if("string"!=typeof i&&(i.drillDown||i.drillUp))return!0}for(let t=0;t<i.length;t++){const e=i[t];if("string"!=typeof e&&(e.drillDown||e.drillUp))return!0}return!1}(this.table)&&function(t){t.on(kb.MOUSEENTER_CELL,(e=>{const{col:i,row:o}=e;if(-1===i||-1===o)return;const r=t.internalProps.layoutMap.getHeaderDimension(i,o);(null==r?void 0:r.drillDown)||(null==r?void 0:r.drillUp)?t.stateManager.updateDrillState(r.dimensionKey,r.title,r.drillDown,r.drillUp,i,o):t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})),t.on(kb.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),ES(this.table),function(t){t.isPivotChart()&&t.scenegraph.tableGroup.addEventListener("click",(e=>{var i;if(!t.stateManager.columnMove.moving&&!t.stateManager.columnResize.resizing)if("axis-label"===e.target.name){const i=RC(e),{col:o,row:r}=i.eventArgs,n=t.internalProps.layoutMap;let s,a;n.indicatorsAsCol?(s=n.getDimensionKeyInChartSpec(n.rowHeaderLevelCount,r),a=n.getCellHeaderPaths(n.rowHeaderLevelCount-2,r).rowHeaderPaths):(s=n.getDimensionKeyInChartSpec(o,n.columnHeaderLevelCount),a=n.getCellHeaderPaths(o,n.columnHeaderLevelCount-1).colHeaderPaths);const l=a.map((t=>({key:t.dimensionKey,value:t.value}))).filter((t=>t.key));if(l.push({key:s,value:e.target.attribute.text}),t._selectedDimensionInChart.length&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].key!==e[i].key||t[i].value!==e[i].value)return!1;return!0}(t._selectedDimensionInChart,l))return;t._selectedDimensionInChart=l,n.updateDataStateToChartInstance(),sS(t.scenegraph),t.scenegraph.updateNextFrame()}else(null===(i=t._selectedDimensionInChart)||void 0===i?void 0:i.length)&&(t._selectedDimensionInChart.length=0,t.internalProps.layoutMap.updateDataStateToChartInstance(),sS(t.scenegraph),t.scenegraph.updateNextFrame())}))}(this.table),function(t){t.isPivotChart()&&(t.on(kb.MOUSEENTER_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=XS(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(kb.MOUSEENTER_AXIS,e)}}))})),t.on(kb.MOUSELEAVE_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=XS(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(kb.MOUSELEAVE_AXIS,e)}}))})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,r;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:n}=t;if(n){if("checkbox"===n.target.name||"radio"===n.target.name)return!1;const s=this.table.getBodyColumnDefine(n.col,n.row);return this.table.isHeader(n.col,n.row)&&((null==s?void 0:s.disableHeaderSelect)||(null===(i=this.table.stateManager.select)||void 0===i?void 0:i.disableHeader))||!this.table.isHeader(n.col,n.row)&&(null==s?void 0:s.disableSelect)?(e||this.table.stateManager.updateSelectPos(-1,-1),!1):!this.table.isPivotChart()||"axis-label"!==(null===(o=null==t?void 0:t.eventArgs)||void 0===o?void 0:o.target.name)&&"chart"!==(null===(r=null==t?void 0:t.eventArgs)||void 0===r?void 0:r.target.type)?(this.table.stateManager.updateSelectPos(n.col,n.row,n.event.shiftKey,n.event.ctrlKey||n.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:r}=t;if(r){if((null===(o=null===(i=this.table.stateManager.select)||void 0===i?void 0:i.ranges)||void 0===o?void 0:o.length)&&this.table.stateManager.isFillHandle()){let i,o;const n=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(J(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(i=r.row,o=n.end.col):(i=n.end.row,o=r.col)),this.table.stateManager.updateSelectPos(e?o:n.end.col,e?i:n.end.row,!0,r.event.ctrlKey||r.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0)}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t;if(this.table.options.enableTreeStickCell&&!i)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,null==i?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,r,n;if(null===(i=this.table.options.excelOptions)||void 0===i?void 0:i.fillHandle){const{eventArgs:i}=t;if(i&&(null===(r=null===(o=this.table.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===r?void 0:r.length)){const i=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),o=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),r=this.table.scenegraph.highPerformanceGetCell(i,o).globalAABBBounds,s=Math.abs(t.abstractPos.x-r.x2),a=Math.abs(t.abstractPos.y-r.y2),l=18;if((null===(n=this.table.stateManager.fillHandle)||void 0===n?void 0:n.isFilling)||s<=l/2&&a<=l/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i;const{eventArgs:o}=t;return!!(o&&this.table.isHeader(o.col,o.row)&&(function(t,e,i){for(let o=0;o<i.length;o++)if(xb(i[o],t,e))return!0;return!1}(o.col,o.row,this.table.stateManager.select.ranges)||(null===(e=this.table.options.select)||void 0===e?void 0:e.disableHeaderSelect)||(null===(i=this.table.options.select)||void 0===i?void 0:i.disableSelect))&&this.table._canDragHeaderPosition(o.col,o.row))&&(this.table.stateManager.startMoveCol(o.col,o.row,t.abstractPos.x,t.abstractPos.y),!0)}dealColumnMover(t){const{eventArgs:e}=t;J(e.col)&&J(e.row)&&this.table.stateManager.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:r,col:n,row:s}=i||{target:t.target,event:t,col:-1,row:-1},a=o;if(a.role&&a.role.startsWith("icon-"))return this.table.fireListeners(kb.ICON_CLICK,{name:a.name,x:(a.globalAABBBounds.x1+a.globalAABBBounds.x2)/2,y:a.globalAABBBounds.y2,col:n,row:s,funcType:a.attribute.funcType,icon:a,event:r}),!0;if(o instanceof bd){const t=o.pickIcon(r.global);if(t)return this.table.fireListeners(kb.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:n,row:s,funcType:t.attribute.funcType,icon:t,event:r}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}(this),e.legends){q.legends=[];const t=hm.getFunction("createLegend");if(Array.isArray(e.legends)){for(let i=0;i<e.legends.length;i++)q.legends.push(t(e.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else q.legends.push(t(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(q.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),"html"===q.tooltip.renderMode){const t=hm.getComponent("tooltipHandler");t&&(q.tooltipHandler=new t(this,q.tooltip.confine))}if(q.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray(null===(l=e.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=e.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=e.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),"html"===q.menu.renderMode){const t=hm.getComponent("menuHandler");q.menuHandler=new t(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,q.stick={changedCells:new Map},q.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new p_(this,null!==(c=e.customCellStyle)&&void 0!==c?c:[],null!==(u=e.customCellStyleArrangement)&&void 0!==u?u:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.options.canvasHeight=e,this.options.canvasWidth=t,this.resize()}resize(){var t;this._updateSize(),null===(t=this.internalProps.legends)||void 0===t||t.forEach((t=>{null==t||t.resize()})),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return null!==(t=this.internalProps.colCount)&&void 0!==t?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenColCount)&&void 0!==r?r:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenRowCount)&&void 0!==r?r:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.rightFrozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.rightFrozenColCount)&&void 0!==r?r:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.bottomFrozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.bottomFrozenRowCount)&&void 0!==r?r:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return null!==(t=this.internalProps.keyboardOptions)&&void 0!==t?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=null!=t?t:void 0}get eventOptions(){var t;return null!==(t=this.internalProps.eventOptions)&&void 0!==t?t:null}set eventOptions(t){this.internalProps.eventOptions=null!=t?t:void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return"auto"===t?0:yC(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=yC(this,e.min),i.minDef=e.min),e.max&&(i.max=yC(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(function(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return"node"===Xv.mode?e/(null!=t?t:1):this._.canvas.width/(null!==(i=this._.context.pixelRatio)&&void 0!==i?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A;const{padding:R}=this;let B=0,M=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)B=this.options.viewBox.x2-this.options.viewBox.x1,M=this.options.viewBox.y2-this.options.viewBox.y1,(null===(t=null==this?void 0:this.scenegraph)||void 0===t?void 0:t.stage)&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(B,M));else if("browser"===Xv.mode){const t=this.getElement();let s=0,a=0;if(this.canvasSizeSeted)s=this.canvasWidth,a=this.canvasHeight;else if(t.parentElement){const e=t.parentElement.style||window.getComputedStyle(t.parentElement);s=t.parentElement.offsetWidth-parseInt(e.paddingLeft||"0px",10)-parseInt(e.paddingRight||"0px",10),a=t.parentElement.offsetHeight-parseInt(e.paddingTop||"0px",10)-parseInt(e.paddingBottom||"0px",20)}const l=null!=s?s:0,h=null!=a?a:0;t.style.width=l&&l-R.left-R.right+"px"||"0px",t.style.height=h&&h-R.top-R.bottom+"px"||"0px";const{canvas:d}=this.internalProps;B=null!==(i=null===(e=d.parentElement)||void 0===e?void 0:e.offsetWidth)&&void 0!==i?i:0,M=null!==(r=null===(o=d.parentElement)||void 0===o?void 0:o.offsetHeight)&&void 0!==r?r:0,(null===(n=null==this?void 0:this.scenegraph)||void 0===n?void 0:n.stage)?this.scenegraph.stage.resize(B,M):(d.style.width="",d.style.height="",d.width=B,d.height=M,d.style.width=`${B}px`,d.style.height=`${M}px`),this.internalProps.bodyDomContainer&&(this.internalProps.bodyDomContainer.style.width=`${B}px`,this.internalProps.bodyDomContainer.style.height=`${M}px`),this.internalProps.headerDomContainer&&(this.internalProps.headerDomContainer.style.width=`${B}px`,this.internalProps.headerDomContainer.style.height=`${M}px`)}else"node"===Xv.mode&&(B=this.canvasWidth-1,M=this.canvasHeight-1);const T=Math.floor(B-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.verticalVisible)||!(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle)),P=Math.floor(M-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.horizontalVisible)||!(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle));if(null===(s=this.internalProps.theme)||void 0===s?void 0:s.frameStyle){const t=R_(null!==(l=null===(a=this.internalProps.theme.frameStyle)||void 0===a?void 0:a.borderLineWidth)&&void 0!==l?l:[null]),e=R_(null!==(d=null===(h=this.internalProps.theme.frameStyle)||void 0===h?void 0:h.shadowBlur)&&void 0!==d?d:[0]);(null===(c=this.theme.frameStyle)||void 0===c?void 0:c.innerBorder)?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=T-(null!==(u=e[1])&&void 0!==u?u:0),this.tableNoFrameHeight=P-(null!==(g=e[2])&&void 0!==g?g:0)):(this.tableX=(null!==(p=t[3])&&void 0!==p?p:0)+(null!==(f=e[3])&&void 0!==f?f:0),this.tableY=(null!==(v=t[0])&&void 0!==v?v:0)+(null!==(b=e[0])&&void 0!==b?b:0),this.tableNoFrameWidth=T-((null!==(m=t[1])&&void 0!==m?m:0)+(null!==(C=e[1])&&void 0!==C?C:0))-((null!==(y=t[3])&&void 0!==y?y:0)+(null!==(w=e[3])&&void 0!==w?w:0)),this.tableNoFrameHeight=P-((null!==(x=t[0])&&void 0!==x?x:0)+(null!==(S=e[0])&&void 0!==S?S:0))-((null!==(_=t[2])&&void 0!==_?_:0)+(null!==(A=e[2])&&void 0!==A?A:0)))}}updateViewBox(t){var e,i,o,r,n,s,a,l;const h=null!==(r=null!==(i=null===(e=this.options)||void 0===e?void 0:e.viewBox.x2)&&void 0!==i?i:0-(null===(o=this.options)||void 0===o?void 0:o.viewBox.x1))&&void 0!==r?r:0,d=null!==(l=null!==(s=null===(n=this.options)||void 0===n?void 0:n.viewBox.y2)&&void 0!==s?s:0-(null===(a=this.options)||void 0===a?void 0:a.viewBox.y1))&&void 0!==l?l:0,c=t.x2-t.x1,u=t.y2-t.y1;this.options.viewBox=t,h!==c||d!==u?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,i,o,r,n){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,i,o,r,n)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.colCount)&&void 0!==i?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=o)return o;const r=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=r){const i=r+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(i)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(i)),Math.round(i)}let n=0;for(let i=t;i<=e;i++)n+=this.getColWidth(i);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(n)),Math.round(n)}getRowHeight(t){var e;if(J(this.rowHeightsMap.get(t))){if(null===(e=this.options.customConfig)||void 0===e?void 0:e._disableColumnAndRowSizeRound){const e=this.rowHeightsMap.get(t);let i;return i=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),i=Number(i.toFixed(2)),Number.isInteger(i)?Math.ceil(e):Math.floor(e)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return at(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?null!==(e=this.defaultHeaderColWidth[t])&&void 0!==e?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?null!==(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])&&void 0!==i?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(e=this.defaultHeaderRowHeight[t])&&void 0!==e?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])&&void 0!==i?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||0===this.rowCount)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.rowCount)&&void 0!==i?i:1/0)-1);let r=0;if("standard"!==this.heightMode||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||0!==this.internalProps._heightResizedRowMap.size){if(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound){const i=this.rowHeightsMap.getSumInRange(t,e);let o;return o=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),o=Number(o.toFixed(2)),Number.isInteger(o)?Math.ceil(i):Math.floor(i)}r=this.rowHeightsMap.getSumInRange(t,e)}else{for(let i=t;i<Math.min(e+1,this.columnHeaderLevelCount);i++)r+=this.getRowHeight(i);e>=this.columnHeaderLevelCount&&(r+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let t=this.rowCount-this.bottomFrozenRowCount;t<e+1;t++)r+=this.getRowHeight(t)}return Math.round(r)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if("autoWidth"===this.widthMode)return"auto";const{width:o}=null!==(e=null==i?void 0:i.getColumnWidthDefined(t))&&void 0!==e?e:{};return"number"==typeof o&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return"autoHeight"===this.heightMode||t>=0&&t<this.columnHeaderLevelCount&&"auto"===this.getDefaultRowHeight(t)}getColWidth(t){var e;const i=null!==(e=this.colWidthsMap.get(t))&&void 0!==e?e:this.getDefaultColumnWidth(t);return"adaptive"===this.widthMode&&"number"==typeof i||this.transpose&&"number"==typeof i?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.scenegraph.updateChartSizeForResizeColWidth(t),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const e=M_.exec(i);if(e){const o=Number(e[1]),r=Number(e[2]);t>=o&&t<=r&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.max)&&void 0!==e?e:1/0;return"string"==typeof o&&(o=yC(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.min)&&void 0!==e?e:0;return"string"==typeof o&&(o=yC(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const r=this.isFrozenCell(t,e);let n;const s=this.getColWidth(t);let a;n=r&&r.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-(null!==(i=this.getColsWidth(t,this.colCount-1))&&void 0!==i?i:0):this.getColsWidth(0,t-1)||0;const l=this.getRowHeight(e);return a=r&&r.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-(null!==(o=this.getRowsHeight(e,this.rowCount-1))&&void 0!==o?o:0):this.getRowsHeight(0,e-1),new Ib(Math.round(n),Math.round(a),Math.round(s),Math.round(l))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,r=this.getColsWidth(i.start.col,i.end.col),n=this.getRowsHeight(0,i.start.row-1)||0,s=this.getRowsHeight(i.start.row,i.end.row);return new Ib(Math.round(o),Math.round(n),Math.round(r),Math.round(s))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,r=!0;(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,r=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(r=!1);const n=this.getCellRect(t,e);return this._toRelativeRect(n,o,r)}getCellRangeRelativeRect(t){if(t.start){const e=this.isFrozenCell(t.start.col,t.start.row);let i=!0,o=!0;return(null==e?void 0:e.col)&&(null==e?void 0:e.row)?(i=!1,o=!1):(null==e?void 0:e.col)?i=!1:(null==e?void 0:e.row)&&(o=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),i,o)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,r=!0;return(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,r=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(r=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,r)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=i,r.right=o;const n=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,s=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=n,r.bottom=s,r}getCellsRect(t,e,i,o){var r,n,s,a,l,h;let d=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const u=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-(null!==(r=this.getColsWidth(t+1,this.colCount-1))&&void 0!==r?r:0)-d:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-u,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(d=Math.min(d-u,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-(null!==(n=this.getColsWidth(t+1,this.colCount-1))&&void 0!==n?n:0)-d):this.isRightFrozenColumn(t)&&(d=this.tableNoFrameWidth-(null!==(s=this.getColsWidth(t,this.colCount-1))&&void 0!==s?s:0));let g=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const f=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-(null!==(a=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==a?a:0)-g:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-f,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(g=Math.min(g-f,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-(null!==(l=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==l?l:0)-g):this.isBottomFrozenRow(e)&&(g=this.tableNoFrameHeight-(null!==(h=this.getRowsHeight(e,this.rowCount-1))&&void 0!==h?h:0)),new Ib(Math.round(d),Math.round(g),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const r=this.isFrozenCell(t,e),n=this.isFrozenCell(i,o);let s=this.getColsWidth(t,i);if(r&&r.col){const e=this.scrollLeft;n&&n.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}return s}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return m_(t,this)}getColAt(t){return C_(t,this)}getCellAt(t,e){return function(t,e,i){const o=m_(e,i),{row:r,top:n,bottom:s,height:a}=o,l=C_(t,i),{col:h,left:d,right:c,width:u}=l;return{row:r,col:h,rect:{left:d,right:c,top:n,bottom:s,width:u,height:a}}}(t,e,this)}getCellAtRelativePosition(t,e){return function(t,e,i){t-=i.tableX;let o=!1;(e-=i.tableY)>0&&e<i.getFrozenRowsHeight()&&(o=!0);let r=!1;t>0&&t<i.getFrozenColsWidth()&&(r=!0);let n=!1;e>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&e<i.tableNoFrameHeight&&e<=i.getAllRowsHeight()&&(n=!0);let s=!1;t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth()&&(s=!0);const a=x_(r||s?t:t+i.scrollLeft,s,i),l=S_(o||n?e:e+i.scrollTop,n,i);if(a&&l){const{row:t,top:e,bottom:i,height:o}=l,{col:r,left:n,right:s,width:h}=a;return{row:t,col:r,rect:{left:n,right:s,top:e,bottom:i,width:h,height:o}}}return{col:-1,row:-1}}(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),r=function(t){let e=0,i=0;t.frozenColCount>0&&(e=t.getFrozenColsWidth()),t.rightFrozenColCount>0&&(i=t.getRightFrozenColsWidth());let o=0,r=0;return t.frozenRowCount>0&&(o=t.getFrozenRowsHeight()),t.bottomFrozenRowCount>0&&(r=t.getBottomFrozenRowsHeight()),new Ib(t.scrollLeft+e,t.scrollTop+o,t.tableNoFrameWidth-e-i,t.tableNoFrameHeight-o-r)}(this);if(r.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<r.left?this.scrollLeft-=r.left-o.left:r.right<o.right&&(this.scrollLeft-=r.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<r.top?this.scrollTop-=r.top-o.top:r.bottom<o.bottom&&(this.scrollTop-=r.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise(((t,e)=>{setTimeout((()=>{t()}),0)}))}_toRelativeRect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,r,n,s;const a=t.copy(),l=this.getVisibleRect();return a.offsetLeft(this.tableX-(e?l.left:0)),a.offsetTop(this.tableY-(i?l.top:0)),a.offsetLeft(null!==(r=null===(o=this.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==r?r:0),a.offsetTop(null!==(s=null===(n=this.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==s?s:0),a}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new Ib(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const r=Math.max(o.top>=i?o.row:o.row+1,t);let n=this.getRowsHeight(0,r-1),s=0;const{rowCount:a}=this;for(let t=r;t<a;t++){const i=n+this.getRowHeight(t);if(e.bottom<i)break;s++,n=i}return s}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),r=this.getBottomFrozenRowsHeight(),n=this.getRightFrozenColsWidth(),{row:s}=this.getRowAt(t+i+1),{col:a}=this.getColAt(e+o+1),l=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-r).row:this.rowCount-1,h=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-n).col:this.colCount-1;return h<0||l<0?null:{rowStart:s,colStart:a,rowEnd:l,colEnd:h}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),r=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return r<0?null:{rowStart:o,rowEnd:r}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),r=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return r<0?null:{colStart:o,colEnd:r}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const r=Math.max(o.left>=i?o.col:o.col+1,t);let n=this.getColsWidth(0,r-1),s=0;const{colCount:a}=this;for(let t=r;t<a;t++){const i=n+this.getColWidth(t);if(e.right<i)break;s++,n=i}return s}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||"function"!=typeof t.release)throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f;const v=this.internalProps;null===(e=null===(t=v.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),null===(o=null===(i=v.menuHandler)||void 0===i?void 0:i.release)||void 0===o||o.call(i),WC.clearAll(),null===(r=super.release)||void 0===r||r.call(this),null===(s=null===(n=v.handler)||void 0===n?void 0:n.release)||void 0===s||s.call(n),this.eventManager.release(),null===(l=null===(a=v.focusControl)||void 0===a?void 0:a.release)||void 0===l||l.call(a),null===(h=v.legends)||void 0===h||h.forEach((t=>{null==t||t.release()})),null===(d=v.title)||void 0===d||d.release(),v.title=null,null===(c=v.emptyTip)||void 0===c||c.release(),v.emptyTip=null,v.layoutMap.release(),v.releaseList&&(v.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),v.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),v.focusControl.release();const{parentElement:b}=v.element;b&&!this.options.canvas&&b.removeChild(v.element),null===(p=null===(g=null===(u=this.editorManager)||void 0===u?void 0:u.editingEditor)||void 0===g?void 0:g.onEnd)||void 0===p||p.call(g),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,null===(f=this.reactCustomLayout)||void 0===f||f.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,r,n,s,a,l,h,d,c,u;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:g=0,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:b=80,keyboardOptions:m,eventOptions:C,rowSeriesNumber:y,columnResizeMode:w,rowResizeMode:x="none",dragHeaderMode:S,showFrozenIcon:_,allowFrozenColCount:A,padding:R,hover:B,menu:M,select:T,pixelRatio:P,widthMode:k,heightMode:L,autoFillWidth:H,autoFillHeight:E,widthAdaptiveMode:z,heightAdaptiveMode:F,customRender:I,renderChartAsync:O,renderChartAsyncBatchCount:D,overscrollBehavior:W,limitMinWidth:N,limitMinHeight:G}=t;P&&P!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=P),R&&("number"==typeof R?(this.padding.top=R,this.padding.left=R,this.padding.bottom=R,this.padding.right=R):(R.top&&(this.padding.top=R.top),R.bottom&&(this.padding.bottom=R.bottom),R.left&&(this.padding.left=R.left),R.right&&(this.padding.right=R.right))),this.showFrozenIcon="boolean"!=typeof _||_,"number"==typeof A&&A<=0&&(this.showFrozenIcon=!1),this.widthMode=null!=k?k:"standard",this.heightMode=null!=L?L:"standard",this._widthAdaptiveMode=null!=z?z:"only-body",this._heightAdaptiveMode=null!=F?F:"only-body",this.autoFillWidth=null!=H&&H,this.autoFillHeight=null!=E&&E,this.customRender=I;const j=this.internalProps;if("node"===Xv.mode||t.canvas||function(t,e){var i,o;t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const r=(t.offsetWidth||(null===(i=t.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,n=(t.offsetHeight||(null===(o=t.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;t.style.width=r&&r-e.left-e.right+"px"||"0px",t.style.height=n&&n-e.top-e.bottom+"px"||"0px"}(j.element,this.padding),this.columnWidthComputeMode=null!==(e=t.columnWidthComputeMode)&&void 0!==e?e:"normal",j.frozenColCount=g,j.defaultRowHeight=p,j.defaultHeaderRowHeight=null!=f?f:p,j.defaultColWidth=v,j.defaultHeaderColWidth=null!=b?b:v,j.keyboardOptions=m,j.eventOptions=C,j.rowSeriesNumber=y,j.columnResizeMode=w,j.rowResizeMode=x,j.dragHeaderMode=null!=S?S:"none",j.renderChartAsync=O,fw(D),j.overscrollBehavior=null!=W?W:"auto",j.cellTextOverflows={},j._rowHeightsMap=new c_(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new Fb,this.colContentWidthsMap=new Fb,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=am.of(null!==(i=t.theme)&&void 0!==i?i:am.DEFAULT),j.theme.isPivot=this.isPivotTable(),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=null!==(o=t.allowFrozenColCount)&&void 0!==o?o:0,j.limitMaxAutoWidth=null!==(r=t.limitMaxAutoWidth)&&void 0!==r?r:450,j.limitMinWidth=null!=N?"number"==typeof N?N:N?10:0:10,j.limitMinHeight=null!=G?"number"==typeof G?G:G?10:0:10,null===(n=j.legends)||void 0===n||n.forEach((t=>{null==t||t.release()})),null===(s=j.title)||void 0===s||s.release(),j.title=null,null===(a=j.emptyTip)||void 0===a||a.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const e=hm.getFunction("createLegend");if(Array.isArray(t.legends)){for(let i=0;i<t.legends.length;i++)j.legends.push(e(t.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(e(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===j.tooltip.renderMode&&!j.tooltipHandler){const t=hm.getComponent("tooltipHandler");j.tooltipHandler=new t(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(null===(l=t.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=t.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=t.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===j.menu.renderMode&&!j.menuHandler){const t=hm.getComponent("menuHandler");j.menuHandler=new t(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell(null!==(c=t.customCellStyle)&&void 0!==c?c:[],null!==(u=t.customCellStyleArrangement)&&void 0!==u?u:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new Ib(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,r,n;let s;if(!t)return{inTable:!1,x:void 0,y:void 0};s=B_(t)?t.changedTouches[0]:t;const a=s.clientX||s.pageX+window.scrollX,l=s.clientY||s.pageY+window.scrollY,h=this.internalProps.canvas.getBoundingClientRect();let d=!0;h.right<=a&&(d=!1),h.bottom<=l&&(d=!1);const c=h.width,u=c/(this.canvas.offsetWidth||c),g=h.height,p=g/(this.canvas.offsetHeight||g),f={x:(a-h.left)/u+(e?this.scrollLeft:0)-(null!==(o=null===(i=this.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0),y:(l-h.top)/p+(e?this.scrollTop:0)-(null!==(n=null===(r=this.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==n?n:0),inTable:d};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(f,f),f}getTheme(){return this.internalProps.theme}getTargetColAt(t){return y_(t,this)}getTargetRowAt(t){return w_(t,this)}getTargetColAtConsiderRightFrozen(t,e){return x_(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return S_(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];var n;const s=!!(null===(n=this.stateManager.select.ranges)||void 0===n?void 0:n.length);this.stateManager.updateSelectPos(t,e,i,o,!1,!r),this.stateManager.endSelectCells(!0,s)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach(((t,e)=>{t.start.col===t.end.col&&t.start.row===t.end.row?this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0):(this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0),this.stateManager.updateInteractionState(Sv.grabing),this.stateManager.updateSelectPos(t.end.col,t.end.row,!1,e>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(Sv.default)})),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return null===(t=this.records)||void 0===t?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),CC(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=am.of(null!=t?t:am.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=am.of(null!=t?t:am.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return null==i?void 0:i.define}getBodyColumnType(t,e){var i,o;return VC("cellType",{cellType:null!==(o=null===(i=this.internalProps.layoutMap.getBody(t,e))||void 0===i?void 0:i.cellType)&&void 0!==o?o:"text"},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,VC("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return null==i?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find((e=>e&&e.field===t.field));if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(J(i.text)||i.customLayout||i.customRender))return i.range}return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(J(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),r=Vv(i.style,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=r}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),r=null==o?void 0:o.define,n=null!==(i=null==r?void 0:r.description)&&void 0!==i?i:null==o?void 0:o.description;return"function"==typeof n?n({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):n}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:null==i?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(null==t)return!1;if(this.internalProps.layoutMap.isHeader(e,i))return!1;const r=this.getRecordShowIndexByCell(e,i);return null===(o=this.internalProps.dataSource)||void 0===o?void 0:o.hasField(r,t)}_getCellStyle(t,e){return function(t,e,i){var o,r,n,s,a,l,h,d,c;const u=i.customCellStylePlugin.getCustomCellStyle(t,e),{layoutMap:g}=i.internalProps;if(g.isHeader(t,e)){let a;if(!i.isPivotTable()||i.isBottomFrozenRow(e)||i.isRightFrozenColumn(t))a=`${t}-${e}`;else{const o=i.getHeaderDefine(t,e),r=i.isCornerHeader(t,e);a=(null==o?void 0:o.dimensionKey)?r?`dim-cor-${o.dimensionKey}`:`dim-${o.dimensionKey}`:(null==o?void 0:o.indicatorKey)?`ind-${o.indicatorKey}`:`${t}-${e}`}let l=i.headerStyleCache.get(a);if(l)return u?f_(l,u):l;const h=g.getHeader(t,e);let d;if(i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0}else if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;return!1}(t,e,g)&&g.isAxisCell(t,e)?d=null!==(r=null===(o=g.getBody(t,i.rowHeaderLevelCount).style)||void 0===o?void 0:o.padding)&&void 0!==r?r:i.theme.bodyStyle.padding:i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0;if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}return!1}(t,e,g)&&g.isAxisCell(t,e)&&(d=null!==(s=null===(n=g.getBody(i.columnHeaderLevelCount,e).style)||void 0===n?void 0:n.padding)&&void 0!==s?s:i.theme.bodyStyle.padding),(!h||h.isEmpty)&&(g.isLeftBottomCorner(t,e)||g.isRightBottomCorner(t,e)||g.isCornerHeader(t,e)||g.isRightTopCorner(t,e)))return A_;const c=i.internalProps.headerHelper.getStyleClass((null==h?void 0:h.headerType)||"text");if(g.isBottomFrozenRow(t,e)&&i.theme.bottomFrozenStyle)l=l_(d?{padding:d}:{},i.theme.bottomFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else if(g.isRightFrozenColumn(t,e)&&i.theme.rightFrozenStyle)l=l_(d?{padding:d}:{},i.theme.rightFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else{const o=(null==h?void 0:h.style)||{};d&&(o.padding=d),l=l_(o,g.isColumnHeader(t,e)||g.isBottomFrozenRow(t,e)?i.theme.headerStyle:g.isRowHeader(t,e)||g.isRightFrozenColumn(t,e)?i.theme.rowHeaderStyle:i.theme.cornerHeaderStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme)}return i.headerStyleCache.set(a,l),u?f_(l,u):l}let p,f;(null===(l=null===(a=i.internalProps)||void 0===a?void 0:a.dataConfig)||void 0===l?void 0:l.mappingRules)&&!i.isHeader(t,e)&&(null===(c=null===(d=null===(h=i.internalProps)||void 0===h?void 0:h.dataConfig)||void 0===d?void 0:d.mappingRules)||void 0===c||c.forEach(((o,r)=>{o.bgColor&&i.internalProps.layoutMap.getIndicatorKey(t,e)===o.bgColor.indicatorKey&&(p=o.bgColor.mapping)})));const v=i.getCellType(t,e),b=i.getCellOriginRecord(t,e);let m;if(f=(null==b?void 0:b.vtableMerge)?"merge-title":i.isSeriesNumberInBody(t,e)?`${t}-series-`+v:i.isListTable()&&!i.transpose||i.isPivotTable()&&i.internalProps.layoutMap.indicatorsAsCol?t+v:e+v,m=(null==b?void 0:b.vtableMerge)?i.bodyMergeTitleCache.get(f):g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.get(f):i.bodyStyleCache.get(f),m)return u?f_(m,u):m;const C=g.getBody(t,e),y=i.internalProps.bodyHelper.getStyleClass(i.getCellType(t,e)),w=null==C?void 0:C.style;return m=Vv(w,(null==b?void 0:b.vtableMerge)&&i.theme.groupTitleStyle?i.theme.groupTitleStyle:g.isBottomFrozenRow(e)&&i.theme.bottomFrozenStyle?i.theme.bottomFrozenStyle:g.isRightFrozenColumn(t)&&i.theme.rightFrozenStyle?i.theme.rightFrozenStyle:i.theme.bodyStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},y,i.options.autoWrapText,i.theme),p&&(m=f_(m,{bgColor:p})),q(w)||(g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.set(f,m):i.bodyStyleCache.set(f,m)),u?f_(m,u):m}(t,e,this)}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyMergeTitleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t,e+1))return!1;if("none"===this.internalProps.rowResizeMode)return!1;if("header"===this.internalProps.rowResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.rowResizeMode&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||(null===(i=this.options.select)||void 0===i?void 0:i.disableHeaderSelect)||(null===(o=this.options.select)||void 0===o?void 0:o.disableSelect))){if("disabled"===this.internalProps.frozenColDragHeaderMode&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const i=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(i.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(i.end.col!==this.colCount-1)return!1}}const i=this.getHeaderDefine(t,e);if(!i)return!1;if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){var i,o;let r;if(this.isHeader(t,e))r=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){(null===(o=null===(i=this.internalProps.layoutMap.getSeriesNumberBody(t,e))||void 0===i?void 0:i.define)||void 0===o?void 0:o.dragOrder)&&(r=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const n=this.getCellValue(t,e),s=this.getCellOriginValue(t,e),a=this.internalProps.context,l=this.internalProps.bodyHelper.getIcons(t,e,n,s,a);(null==r?void 0:r.length)>0?r=r.concat():(null==l?void 0:l.length)>0&&(r=l)}else{const i=this.getCellValue(t,e),o=this.getCellOriginValue(t,e),n=this.internalProps.context;r=this.internalProps.bodyHelper.getIcons(t,e,i,o,n)}return r}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=wC(i,this,t,e,VC).theme,{autoWrapText:r,lineClamp:n,textOverflow:s}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:K(o.group.fill)?VC("bgColor",i,t,e,this):o.group.fill,color:K(o.text.fill)?VC("color",i,t,e,this):o.text.fill,strokeColor:K(o.text.stroke)?VC("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:null!=r&&r,lineClamp:null!=n?n:"auto",textOverflow:s,borderColor:K(o.group.stroke)?VC("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:VC("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,r=this.colCount-1,n=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,n-o+1,this.rowCount)).fill(0).map(((e,n)=>Array(Math.min(null!=t?t:2e3,r-i+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+i,n+o)))))}getAllCells(t,e){const i=this.colCount-1,o=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,o-0+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(null!=t?t:2e3,i-0+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+0,o+0)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-0+1).fill(0).map(((i,o)=>Array(e-t+1).fill(0).map(((e,i)=>this.getCellInfo(i+t,o+0)))))}getAllRowHeaderCells(){const t=this.columnHeaderLevelCount,e=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-t+1).fill(0).map(((i,o)=>Array(e-0+1).fill(0).map(((e,i)=>this.getCellInfo(i+0,o+t)))))}scrollToCell(t){const e=this.getDrawRange();if(J(t.col)&&t.col>=this.frozenColCount){const i=this.getFrozenColsWidth(),o=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(o-i,this.getAllColsWidth()-e.width)}if(J(t.row)&&t.row>=this.frozenRowCount){const i=this.getFrozenRowsHeight(),o=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(o-i,this.getAllRowsHeight()-e.height)}this.render()}getCopyValue(){var t,e,i;if((null===(e=null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0){const t=this.stateManager.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),o=Math.max(t[0].start.col,t[0].end.col),r=Math.min(t[0].start.row,t[0].end.row),n=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),r=Math.min(r,t.start.row,t.end.row),n=Math.max(n,t.start.row,t.end.row)}));const s=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row);o<=e&&r>=e&&(i=!0)})),i},a=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.col,t.end.col),r=Math.max(t.start.col,t.end.col);o<=e&&r>=e&&(i=!0)})),i},l=(e,i)=>{let o;return t.forEach((t=>{const r=Math.min(t.start.row,t.end.row),n=Math.max(t.start.row,t.end.row),s=Math.min(t.start.col,t.end.col),a=Math.max(t.start.col,t.end.col);s<=e&&a>=e&&r<=i&&n>=i&&(o=t)})),o},h=(t,e,i)=>{const o=this.getCellRange(t,e);let r=o.start.col,n=o.start.row;if(i){const t=Math.min(i.start.col,i.end.col),e=Math.min(i.start.row,i.end.row);r=Math.max(t,o.start.col),n=Math.max(e,o.start.row)}return r!==t||n!==e?"":this.getCellValue(t,e)};let d="";for(let t=r;t<=n;t++)if(s(t)){for(let i=e;i<=o;i++)if(a(i)){const e=l(i,t);if(e){const r=h(i,t,e);if("undefined"!=typeof Promise&&r instanceof Promise);else{const t=J(r)?`${r}`:"";/^\[object .*\]$/.exec(t)||(d+=t)}(i<e.end.col||i<o)&&(d+="\t")}else d+="\t"}t<n&&(d+="\r\n")}return(null===(i=this.options)||void 0===i?void 0:i.formatCopyValue)&&(d=this.options.formatCopyValue(d)),d}return""}getSelectedCellInfos(){var t;if(!(null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),r=Math.min(e[0].start.row,e[0].end.row),n=Math.max(e[0].start.row,e[0].end.row);e.forEach((t=>{i=Math.min(i,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),r=Math.min(r,t.start.row,t.end.row),n=Math.max(n,t.start.row,t.end.row)}));const s=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.row,e.end.row),r=Math.max(e.start.row,e.end.row);o<=t&&r>=t&&(i=!0)})),i},a=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.col,e.end.col),r=Math.max(e.start.col,e.end.col);o<=t&&r>=t&&(i=!0)})),i},l=(t,i)=>{let o;return e.forEach((e=>{const r=Math.min(e.start.row,e.end.row),n=Math.max(e.start.row,e.end.row),s=Math.min(e.start.col,e.end.col),a=Math.max(e.start.col,e.end.col);s<=t&&a>=t&&r<=i&&n>=i&&(o=e)})),o},h=[];for(let t=r;t<=n;t++)if(s(t)){const e=[];for(let r=i;r<=o;r++)if(a(r)&&l(r,t)){const i=this.getCellInfo(r,t);e.push(i)}h.push(e)}return h}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?mt(t):[]}measureText(t,e){return Cy.measureText(t,e)}measureTextBounds(t){return wy(t)}getCustomRender(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(null==o?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=null==o?void 0:o.customLayout}return i}hasAutoImageColumn(){return void 0===this._hasAutoImageColumn&&(this._hasAutoImageColumn=function(t){const{columns:e,rows:i,indicators:o}=t.options;if(t.isPivotTable()){if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!ot(i)&&("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}if(rt(i)&&i.length>0)for(let t=0;t<i.length;t++){const e=i[t];if(!ot(e)&&("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing)return!0}if(rt(o)&&o.length>0)for(let t=0;t<o.length;t++){const e=o[t];if(!ot(e)&&(("image"===e.cellType||"video"===e.cellType||"function"==typeof e.cellType)&&e.imageAutoSizing||("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing))return!0}}else if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(("image"===i.cellType||"video"===i.cellType||"function"==typeof i.cellType)&&i.imageAutoSizing||("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}return!1}(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,r,n;const s=this.scenegraph.getCell(null===(e=null===(t=this.stateManager.hover)||void 0===t?void 0:t.cellPos)||void 0===e?void 0:e.col,null===(o=null===(i=this.stateManager.hover)||void 0===i?void 0:i.cellPos)||void 0===o?void 0:o.row);return"chart"===(null===(n=null===(r=null==s?void 0:s.getChildren())||void 0===r?void 0:r[0])||void 0===n?void 0:n.type)?s.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,r,n;const s=this.getDrawRange(),a=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let l,h,d,c;if(this.frozenRowCount>=1&&(l=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),a.top>=s.top&&a.bottom<=s.bottom&&a.left>=s.left&&a.right<=s.right){if(this.isFrozenCell(t,e))return!0;if(a.top>=(null!==(i=null==l?void 0:l.bottom)&&void 0!==i?i:a.top)&&a.left>=(null!==(o=null==h?void 0:h.right)&&void 0!==o?o:a.left)&&a.bottom<=(null!==(r=null==d?void 0:d.top)&&void 0!==r?r:a.bottom)&&a.right<=(null!==(n=null==c?void 0:c.left)&&void 0!==n?n:a.right))return!0}return!1}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:t}=i;return t}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,r,n,s;const a=this.cellIsInVisualView(t,e),{scrollTop:l,scrollLeft:h}=this;a||this.scrollToCell({col:t,row:e});const d=this.getCellRelativeRect(t,e);(null===(r=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===r?void 0:r.length)>0&&jx(this.scenegraph);const{col:c,row:u}=this.stateManager.hover.cellPos;let g,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),null==i?void 0:i.disableBackground){const i=this.scenegraph.getCell(t,e);g=i.attribute.fill,i.setAttribute("fill","transparent")}if(null==i?void 0:i.disableBorder){const i=this.scenegraph.getCell(t,e);p=i.attribute.stroke,i.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let f=0;"bottom-right"===this.theme.cellBorderClipDirection&&(f=1);const v=this.scenegraph.stage.toCanvas(!1,(new te).set(d.left+this.tableX+1,d.top+this.tableY+1,d.right+this.tableX-f,d.bottom+this.tableY-f));return a||(this.setScrollTop(l),this.setScrollLeft(h)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),g&&this.scenegraph.getCell(t,e).setAttribute("fill",g),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),(null===(s=null===(n=this.stateManager.select)||void 0===n?void 0:n.ranges)||void 0===s?void 0:s.length)>0&&Ux(this.scenegraph),this.stateManager.updateHoverPos(c,u),this.scenegraph.updateNextFrame(),v.toDataURL()}exportCellRangeImg(t){var e,i,o,r;const{scrollTop:n,scrollLeft:s}=this,a=Math.min(t.start.col,t.end.col),l=Math.min(t.start.row,t.end.row),h=Math.max(t.start.col,t.end.col),d=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(a,l),u=this.cellIsInVisualView(h,d);c&&u||this.scrollToCell({col:a,row:l});const g=this.getCellRangeRelativeRect({start:{col:a,row:l},end:{col:h,row:d}});(null===(i=null===(e=this.stateManager.select)||void 0===e?void 0:e.ranges)||void 0===i?void 0:i.length)>0&&jx(this.scenegraph);const{col:p,row:f}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const v=this.scenegraph.stage.toCanvas(!1,(new te).set(g.left+this.tableX+1,g.top+this.tableY+1,g.right+this.tableX,g.bottom+this.tableY)).toDataURL();return c&&u||(this.setScrollTop(n),this.setScrollLeft(s)),(null===(r=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===r?void 0:r.length)>0&&Ux(this.scenegraph),this.stateManager.updateHoverPos(p,f),v}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if("node"!==this.options.mode)return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,(new te).set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),"function"==typeof e?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter((t=>t.callback!==e)):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach((i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)}))}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return(null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return null!==(e=null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)&&void 0!==e?e:0}setMinMaxLimitWidth(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,i;const o=this.internalProps;for(let r=0;r<o.layoutMap.columnWidths.length;r++){if(this.internalProps._widthResizedColMap.has(r))continue;const{width:n,minWidth:s,maxWidth:a}=null!==(i=null===(e=o.layoutMap.columnWidths)||void 0===e?void 0:e[r])&&void 0!==i?i:{};t&&n&&("string"==typeof n&&"auto"!==n||"number"==typeof n&&n>0)&&this._setColWidth(r,n),s&&("number"==typeof s&&s>0||"string"==typeof s)&&this.setMinColWidth(r,s),a&&("number"==typeof a&&a>0||"string"==typeof a)&&this.setMaxColWidth(r,a)}}setSortedIndexMap(t,e){var i;null===(i=this.dataSource)||void 0===i||i.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new AC(t,this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}getGroupTitleLevel(t,e){}}const P_={};const k_=(t,e)=>{var i,o;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const r=e.fields,n=t[0],s={},a=[];for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const l=r[e];if(!l.type){let o=n;e in n||(o=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:n),l.type="number"==typeof o[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},a.push(h)),(null===(o=l.domain)||void 0===o?void 0:o.length)>0)if("ordinal"===l.type){l._domainCache={},s[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(s[e]=l)}return Object.keys(s).length>0&&(t=t.filter((t=>{for(const e in s){const i=s[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),a.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let o=0;o<i.length;o++){const r=i[o];let n=0;if("ordinal"===r.type?(void 0===r.sortIndex[e[r.key]]&&(r.sortIndex[e[r.key]]=r.sortIndexCount++),void 0===r.sortIndex[t[r.key]]&&(r.sortIndex[t[r.key]]=r.sortIndexCount++),n=r.sortIndex[t[r.key]]-r.sortIndex[e[r.key]]):"linear"===r.type&&(n=t[r.key]-e[r.key]),r.sortReverse&&(n=-n),0!==n)return n}return 0}(t,e,a))),t};let L_=0;const H_="_data-view-diff-rank";class E_{constructor(t,e){var i=this;let o;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new Y,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},o=(null==e?void 0:e.name)?e.name:function(){return L_>1e8&&(L_=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+L_++}("dataview"),this.name=o,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(o,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const r=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(o=this.dataSet.getParser(e.type))&&void 0!==o?o:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=t,this.history&&this.historyData.push(r,t),this.latestData=t}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,o;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(o=e.level)&&void 0!==o?o:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:o}=e,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(r),this.latestData=r,!1!==o&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[H_]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[H_]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[H_]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof E_||!0!==(null==e?void 0:e.clone)||(i=!0),i?mt(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?xt({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!Z(this._fields)&&Z(i)?(this.dataSet.registerTransform("fields",k_),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function z_(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["data"];const i=t;let o;if(!J(i)||"object"!=typeof i)return i;if(function(t){return t instanceof E_}(i)||function(t){try{return t instanceof Element}catch(e){const i=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],o=Object.keys(t);return i.every((t=>o.includes(t)))}}(i))return i;const r=rt(i),n=i.length;o=r?new Array(n):"object"==typeof i?{}:K(i)||at(i)||ot(i)?i:st(i)?new Date(+i):void 0;const s=r?void 0:Object.keys(Object(i));let a=-1;if(o)for(;++a<(s||i).length;){const t=s?s[a]:a,r=i[t];(null==e?void 0:e.includes(t.toString()))?o[t]=r:o[t]=z_(r,e)}return o}class F_{constructor(t,e,i,o){this.seqId=0,this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this.bodyRowSpanCount=1,this._transpose=!1,this._showHeader=!0,this._recordsCount=0,this._hasAggregation=!1,this._hasAggregationOnTopCount=0,this._hasAggregationOnBottomCount=0,this._cellRangeMap=new Map,this._showHeader=i,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=null!=o?o:20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new v_(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter((t=>!0!==t.define.hide)),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.rowHierarchyType=function(t){if(t._table.options.groupBy)return!0;const{columns:e}=t._table.options;if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!ot(i)&&i.tree)return!0}return!1}(this)?"tree":"grid",this._hasAggregation=function(t){const e=t.columnObjects;for(let t=0;t<e.length;t++){const i=e[t];if(null==i?void 0:i.aggregation)return!0}return!1}(this),this._hasAggregationOnBottomCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!1===t.showOnTop)).length):!1===o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this._hasAggregationOnTopCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!0===t.showOnTop)).length):!0===o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,i;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map((e=>{var i,o;return{id:this.seqId++,title:e.title,define:e,cellType:null!==(i=e.cellType)&&void 0!==i?i:"text",headerType:null!==(o=t.cellType)&&void 0!==o?o:"text",style:e.style,width:e.width,format:e.format,field:e.field,icon:e.icon,headerIcon:e.headerIcon,isChildNode:!1}})):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",headerType:null!==(i=t.cellType)&&void 0!==i?i:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!0)),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!1)),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isSeriesNumberInHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}return!1}isSeriesNumberInBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}return!1}isSeriesNumber(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0;return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getBody(t,e).aggregator}getAggregatorsByCellRange(t,e,i,o){let r=[];if(!this.transpose){for(let o=t;o<=i;o++){const t=this.getBody(o,e);t.aggregator&&(r=r.concat(Array.isArray(t.aggregator)?t.aggregator:[t.aggregator]))}return r}for(let i=e;i<=o;i++){const e=this.getBody(t,i);e.aggregator&&(r=r.concat(Array.isArray(e.aggregator)?e.aggregator:[e.aggregator]))}return[]}getAggregatorOnTop(t,e){const i=this.getBody(t,e),o=i.aggregator,r=i.aggregation;if(Array.isArray(r)){const i=r.reduce(((t,e,i)=>(e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-this.rowHeaderLevelCount]:i[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?(null==r?void 0:r.showOnTop)?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:(null==r?void 0:r.showOnTop)?o:null}getAggregatorOnBottom(t,e){const i=this.getBody(t,e),o=i.aggregator,r=i.aggregation;if(Array.isArray(r)){const i=r.reduce(((t,e,i)=>(!1===e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-(this.colCount-this.hasAggregationOnBottomCount)]:i[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?!1===(null==r?void 0:r.showOnTop)?o:null:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0?null:!1===(null==r?void 0:r.showOnTop)?o:null}getAggregatorCellAddress(t,e,i,o){const r=[],n=this.hasAggregationOnTopCount,s=this.hasAggregationOnBottomCount;if(this.transpose){for(let i=e;i<=o;i++)if(this.getBody(t,i).aggregator){for(let t=0;t<n;t++)r.push({col:this.headerLevelCount+t,row:i});for(let t=0;t<s;t++)r.push({col:this.rowCount-s+t,row:i})}}else for(let o=t;o<=i;o++)if(this.getBody(o,e).aggregator){for(let t=0;t<n;t++)r.push({col:o,row:this.headerLevelCount+t});for(let t=0;t<s;t++)r.push({col:o,row:this.rowCount-s+t})}return r}getCellLocation(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isRowHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)}isColumnHeader(t,e){return!this.transpose&&e>=0&&e<=this.headerLevelCount-1&&t>=this.leftRowSeriesNumberColumnCount&&t<this.colCount-this.rightRowSeriesNumberColumnCount}isFrozenColumn(t,e){if(J(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(J(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(J(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(J(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}isLeftBottomCorner(t,e){return t>=0&&t<this.rowHeaderLevelCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.columnHeaderLevelCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isCornerHeader(t,e){return!1}getColumnHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,i,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(null!==(t=this.colCount)&&void 0!==t?t:0)-1,row:(null!==(e=this.rowCount)&&void 0!==e?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(null!==(i=this.colCount)&&void 0!==i?i:0)-1,row:(null!==(o=this.rowCount)&&void 0!==o?o:0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}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 bottomFrozenRowCount(){return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0}get rightFrozenColCount(){return this._table.internalProps.rightFrozenColCount?this.colCount-this.frozenColCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:Math.max(0,this.colCount-this.frozenColCount):0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount:this._columns.length+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get bodyRowCount(){return this.transpose?this._columns.length:this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.transpose?this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount:this._columns.length}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get headerObjectsIncludeHided(){return this._headerObjectsIncludeHided}get columnWidths(){if(this.leftRowSeriesNumberColumnCount){const t=this.leftRowSeriesNumberColumn.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})));return t.push(...this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))),t}return this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))}getColumnWidthDefined(t){var e;if(t>=0){if(t<this.leftRowSeriesNumberColumnCount)return this.leftRowSeriesNumberColumn[t];if(this.transpose){let i,o,r=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let t;return this.columnObjects.forEach(((e,n)=>{"number"==typeof e.width?r=Math.max(e.width,r):"auto"===e.width&&(t=!0),"number"==typeof e.minWidth&&(o=Math.max(e.minWidth,o)),"number"==typeof e.maxWidth&&(i=Math.max(e.maxWidth,i))})),r=r>0?r:t?"auto":void 0,{width:r,minWidth:o,maxWidth:i}}if(this.isRowHeader(t,0)){const i=Array.isArray(this._table.defaultHeaderColWidth)?null!==(e=this._table.defaultHeaderColWidth[t])&&void 0!==e?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return"auto"===i?{width:"auto"}:{width:i}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var i,o,r,n;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?null===(i=this._columns[e])||void 0===i?void 0:i.id:this.isSeriesNumber(t,e)?e+"_series_number":null===(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?null===(r=this._columns[t-this.leftRowSeriesNumberColumnCount])||void 0===r?void 0:r.id:null===(n=this._headerCellIds[e])||void 0===n?void 0:n[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const i=this.getCellId(t,e);return this._headerObjectMap[i]}getHeaderField(t,e){var i;const o=this.getCellId(t,e);return(null===(i=this._headerObjectMap[o])||void 0===i?void 0:i.field)||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t-this.leftRowSeriesNumberColumnCount]&&this._columns[t-this.leftRowSeriesNumberColumnCount].field)}getHeaderCellAdressById(t){for(let e=0;e<this._headerCellIds.length;e++){const i=this._headerCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){return this.isSeriesNumber(t,e)?this.getSeriesNumberBody(t,e):this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}getBodyLayoutRangeById(t){var e,i;if(this.transpose){for(let i=0;i<(null!==(e=this.rowCount)&&void 0!==e?e:0);i++)if(t===this._columns[i].id)return{start:{col:0,row:i},end:{col:0,row:i}}}else for(let e=this.leftRowSeriesNumberColumnCount;e<(null!==(i=this.colCount)&&void 0!==i?i:0);e++)if(t===this._columns[e-this.leftRowSeriesNumberColumnCount].id)return{start:{col:e,row:0},end:{col:e,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return function(t,e,i){var o,r,n;if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(i._cellRangeMap.has(`$${t}$${e}`))return i._cellRangeMap.get(`$${t}$${e}`);let s={start:{col:t,row:e},end:{col:t,row:e}};if(i.transpose)s=function(t,e,i){var o,r,n,s;const a={start:{col:t,row:e},end:{col:t,row:e}};if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t||-1===t&&-1===e){if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t&&(null===(r=null===(o=i.columnObjects[e])||void 0===o?void 0:o.define)||void 0===r?void 0:r.mergeCell)){const o=i._table.getCellValue(t,e);for(let r=t-1;r>=i.headerLevelCount+i.leftRowSeriesNumberColumnCount;r--){const t=i._table.getCellValue(r,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;a.start.col=r}for(let r=t+1;r<(null!==(n=i.colCount)&&void 0!==n?n:0);r++){const t=i._table.getCellValue(r,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;a.end.col=r}}return a}const l=i.getCellId(t,e);for(let o=e-1;o>=0&&l===i.getCellId(t,o);o--)a.start.row=o;for(let o=e+1;o<(null!==(s=i.rowCount)&&void 0!==s?s:0)&&l===i.getCellId(t,o);o++)a.end.row=o;for(let o=t-1;o>=0&&l===i.getCellId(o,e);o--)a.start.col=o;for(let o=t+1;o<i.headerLevelCount+i.leftRowSeriesNumberColumnCount&&l===i.getCellId(o,e);o++)a.end.col=o;return a}(t,e,i);else if(i.headerLevelCount<=e){if(i.headerLevelCount<=e&&(null===(r=null===(o=i.columnObjects[t-i.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o.define)||void 0===r?void 0:r.mergeCell)){const o=i._table.getCellValue(t,e);for(let r=e-1;r>=i.headerLevelCount;r--){const e=i._table.getCellValue(t,r);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.start.row=r}for(let r=e+1;r<i.rowCount;r++){const e=i._table.getCellValue(t,r);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.end.row=r}}!function(t,e,i,o){if("tree"!==o.rowHierarchyType)return;const r=o._table.getCellRawRecord(t,e);(null==r?void 0:r.vtableMerge)&&(i.start.col=o.rowHeaderLevelCount,i.end.col=o.colCount-1,i.start.row=i.end.row=e)}(t,e,s,i)}else{const o=i.getCellId(t,e);for(let r=t-1;r>=0&&o===i.getCellId(r,e);r--)s.start.col=r;for(let r=t+1;r<(null!==(n=i.colCount)&&void 0!==n?n:0)&&o===i.getCellId(r,e);r++)s.end.col=r;for(let r=e-1;r>=0&&o===i.getCellId(t,r);r--)s.start.row=r;for(let r=e+1;r<i.headerLevelCount&&o===i.getCellId(t,r);r++)s.end.row=r}return i._cellRangeMap.set(`$${t}$${e}`,s),s}(t,e,this)}isCellRangeEqual(t,e,i,o){const r=this.getCellRange(t,e),n=this.getCellRange(i,o);return r.start.col===n.start.col&&r.end.col===n.end.col&&r.start.row===n.start.row&&r.end.row===n.end.row}getRecordShowIndexByCell(t,e){const i=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<i?-1:t-i:e<i?-1:e-i}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,i,o){const r=[],n=this._newRow(t,o);return e.forEach((e=>{var s,a,l,h;const d=this._columns.length,c=this.seqId++,u={id:c,title:null!==(s=e.title)&&void 0!==s?s:e.caption,headerIcon:e.headerIcon,field:e.field,style:e.headerStyle,headerType:null!==(a=e.headerType)&&void 0!==a?a:"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};r[c]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e]&&(this._headerCellIds[e][d]=i[e]);if(o?this._headerCellIds[t-1]&&(n[d]=this._headerCellIds[t-1][d]):n[d]=c,e.columns)this._addHeaders(t+1,e.columns,[...i,c],e.hideColumnsSubHeader||o).forEach((t=>r.push(t)));else{const i={id:this.seqId++,field:e.field,fieldFormat:e.fieldFormat,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,icon:e.icon,cellType:null!==(h=null!==(l=e.cellType)&&void 0!==l?l:e.columnType)&&void 0!==h?h:"text",chartModule:"chartModule"in e?e.chartModule:null,chartSpec:"chartSpec"in e?e.chartSpec:null,sparklineSpec:"sparklineSpec"in e?e.sparklineSpec:$b,style:e.style,define:e,columnWidthComputeMode:e.columnWidthComputeMode,disableColumnResize:null==e?void 0:e.disableColumnResize,aggregation:this._getAggregationForColumn(e,d),isChildNode:t>=1};if(this._columnsIncludeHided.push(i),!0!==e.hide){this._columns.push(i);for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][d]=c}}})),r}_getAggregationForColumn(t,e){let i;return t.aggregation?i=t.aggregation:this._table.options.aggregation&&(i="function"==typeof this._table.options.aggregation?this._table.options.aggregation({col:e,field:t.field}):this._table.options.aggregation),i?Array.isArray(i)?i.map((t=>(J(t.showOnTop)||(t.showOnTop=!1),t))):Object.assign({showOnTop:!1},i):null}_newRow(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let i=this._headerCellIds[t].length;i<e.length;i++)this._headerCellIds[t][i]=e[i];return this._headerCellIds[t]}if(e)return[];const i=this._headerCellIds[t]=[];if(!this._columns.length)return i;const o=this._headerCellIds[t-1];for(let t=0;t<o.length;t++)i[t]=o[t];return i}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let i=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:i=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(0!==e){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e)){if(this.isSeriesNumberInBody(t-1,e))return;return this.getCellId(t-1,e)}}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row))return!1;if(!this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)){const i=this.getRecordShowIndexByCell(0,t.row),o=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(i,o)}if(this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(this._getColumnDefine(t.col+this.leftRowSeriesNumberColumnCount,t.row).isChildNode&&this._getColumnDefine(e.col+this.leftRowSeriesNumberColumnCount,e.row).isChildNode?(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1):(t.col=t.col+this.leftRowSeriesNumberColumnCount,e.col=e.col+this.leftRowSeriesNumberColumnCount)),t.col<0||t.row<0||e.col<0||e.row<0)return!1;if("disabled"===this._table.internalProps.frozenColDragHeaderMode&&this._table.isFrozenColumn(e.col))return!1;const i=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row):!!this.isRowHeader(t.col,t.row)&&this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row)}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let r;const n=this.getCellRange(e.col,i.start.row);if(r=e.col>=t.col?n.end.col-o+1:n.start.col,r===i.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);e.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return s.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.row,i.start.col-this.leftRowSeriesNumberColumnCount,r-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.col,targetIndex:r,sourceSize:o,targetSize:n.end.col-n.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)||this.isSeriesNumberInBody(t.col,t.row)&&this.transpose){this.isSeriesNumberInBody(t.col,t.row)&&(i=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=i.end.row-i.start.row+1;let r;const n=this.getCellRange(i.start.col,e.row);if(r=e.row>=t.row?n.end.row-o+1:n.start.row,r===i.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.row,o);e.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.row,o);return s.unshift(r,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.col-this.leftRowSeriesNumberColumnCount,i.start.row,r+(e.row>t.row?i.end.row-i.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.row,targetIndex:r,sourceSize:o,targetSize:n.end.row-n.start.row+1,moveType:"row"}}if(this.isSeriesNumberInBody(t.col,t.row))return{sourceIndex:t.row,targetIndex:e.row,sourceSize:1,targetSize:1,moveType:"row"}}return null}toggleHierarchyState(t){return{addCellPositions:t.add.map((t=>({col:0,row:this._table.frozenRowCount+t}))),removeCellPositions:t.remove.map((t=>({col:0,row:this._table.frozenRowCount+t})))}}setChartInstance(t,e,i){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];"function"!=typeof o.chartSpec&&(o.chartInstance=i)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return function(t){let e=!1;for(let i=0;i<t.columnObjects.length;i++)if(t.columnObjects[i].chartSpec){e=!0;break}return e}(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const i=this.getBody(t,e);return"function"!=typeof(null==i?void 0:i.chartSpec)}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const i=this.getBody(t,e),o=null==i?void 0:i.chartSpec;return"function"==typeof o?o({col:t,row:e,dataValue:this._table.getCellOriginValue(t,e)||"",value:this._table.getCellValue(t,e)||"",rect:this._table.getCellRangeRelativeRect(this._table.getCellRange(t,e)),table:this._table}):o}getChartDataId(t,e){return function(t,e,i){var o;const r=i.getRawChartSpec(t,e);if(null==r?void 0:r.series){const t={};return(null===(o=r.data)||void 0===o?void 0:o.id)&&(t[r.data.id]=void 0),null==r||r.series.forEach((e=>{var i,o,n,s,a,l,h,d,c,u,g;if(!(null===(i=e.data)||void 0===i?void 0:i.fromDataId))if(null===(o=e.data)||void 0===o?void 0:o.transforms)t[null!==(g=null!==(c=null===(d=e.data)||void 0===d?void 0:d.id)&&void 0!==c?c:null===(u=r.data)||void 0===u?void 0:u.id)&&void 0!==g?g:"data"]=void 0;else{const i="horizontal"===e.direction?e.xField:e.yField;t[null!==(l=null!==(s=null===(n=e.data)||void 0===n?void 0:n.id)&&void 0!==s?s:null===(a=r.data)||void 0===a?void 0:a.id)&&void 0!==l?l:"data"]=(null===(h=e.data)||void 0===h?void 0:h.id)?i:void 0}})),t}return r.data.id}(t,e,this)}release(){const t=this._table._getActiveChartInstance();null==t||t.release(),this.columnObjects.forEach((t=>{var e;null===(e=t.chartInstance)||void 0===e||e.release()}))}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,i){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=i,o.define.title=i}getColumnByField(t){var e;return null===(e=this.columnObjects)||void 0===e?void 0:e.reduce(((e,i,o)=>(i.field===t&&e.push({col:o,columnDefine:i}),e)),[])}_getColumnDefine(t,e){if(t>=0)return t<this.leftRowSeriesNumberColumnCount?this.leftRowSeriesNumberColumn[t]:this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}}class I_{constructor(t){this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(kb.DBLCLICK_CELL,(e=>{var i;if(!t||"doubleclick"===t||Array.isArray(t)&&t.includes("doubleclick")){const{col:t,row:o}=e,r=RC(e.federatedEvent),n=this.table.scenegraph.getResizeColAt(r.abstractPos.x,r.abstractPos.y,null===(i=r.eventArgs)||void 0===i?void 0:i.targetCell);if(this.table._canResizeColumn(n.col,n.row)&&n.col>=0)return;this.startEditCell(t,o)}})),this.table.on(kb.CLICK_CELL,(e=>{if("click"===t||Array.isArray(t)&&t.includes("click")){const{col:t,row:i}=e;this.startEditCell(t,i)}}))}startEditCell(t,e,i){var o,r,n,s,a;const l=this.table.getEditor(t,e);if(l){if(null===(r=null===(o=this.table.internalProps.layoutMap)||void 0===o?void 0:o.isAggregation)||void 0===r?void 0:r.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=l;const h=J(i)?i:this.table.getCellOriginValue(t,e),d=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:d.left,top:d.top,width:d.width,height:d.height}};l.beginEditing,null===(n=l.beginEditing)||void 0===n||n.call(l,this.table.getElement(),c,h),l.bindSuccessCallback,null===(s=l.bindSuccessCallback)||void 0===s||s.call(l,(()=>{this.completeEdit()})),null===(a=l.onStart)||void 0===a||a.call(l,{value:h,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;const o=null==t?void 0:t.target,{editingEditor:r}=this;if(o)if(r.targetIsOnEditor){if(r.targetIsOnEditor(o))return!1}else if(!r.isEditorElement||r.isEditorElement(o))return!1;if(this.editingEditor.getValue,this.editingEditor.validateValue){const t=null===(i=(e=this.editingEditor).validateValue)||void 0===i?void 0:i.call(e);return Cb(t)?new Promise(((e,i)=>{t.then((t=>{t?(this.doExit(),e(!0)):e(!1)})).catch((t=>{i(t)}))})):!!t&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,r,n;const s=null===(e=(t=this.editingEditor).getValue)||void 0===e?void 0:e.call(t),a=this.table.getCellRange(this.editCell.col,this.editCell.row),l=[];for(let t=a.start.row;t<=a.end.row;t++){const t=[];for(let e=a.start.col;e<=a.end.col;e++)t.push(s);l.push(t)}this.table.changeCellValues(a.start.col,a.start.row,l),this.editingEditor.exit,null===(o=(i=this.editingEditor).exit)||void 0===o||o.call(i),null===(n=(r=this.editingEditor).onEnd)||void 0===n||n.call(r),this.editingEditor=null}cancelEdit(){var t,e,i,o;this.editingEditor&&(null===(e=(t=this.editingEditor).exit)||void 0===e||e.call(t),null===(o=(i=this.editingEditor).onEnd)||void 0===o||o.call(i),this.editingEditor=null)}}function O_(t){return ot(t)?{groupByRules:[t]}:rt(t)?{groupByRules:t.map((t=>ot(t)?t:t.key))}:{}}function D_(t,e,i,o){if("group"===o)return o;if("sort"===o&&!i.options.groupBy)return o;let r="normal";return i.options.groupBy?r="group":!i.isHeader(t,e)&&i.dataSource.lastOrderField&&i.getBodyField(t,e)===i.dataSource.lastOrderField&&(r="sort"),r}function W_(t){var e;if(t.sortState){let i,o;if(Array.isArray(t.sortState)?0!==t.sortState.length&&({order:i,field:o}=null===(e=t.sortState)||void 0===e?void 0:e[0]):({order:i,field:o}=t.sortState),i&&o&&"normal"!==i){const e=t._getSortFuncFromHeaderOption(void 0,o),r=t.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===o));r&&t.dataSource.sort(r.field,i,null!=e?e:rb)}}}class N_ extends T_{constructor(t,e){var i,o,r,n;"node"===Xv.mode?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const s=this.internalProps;if(s.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,s.sortState=e.sortState,s.dataConfig=e.groupBy?O_(e.groupBy):{},s.columns=e.columns?z_(e.columns,["children"]):e.header?z_(e.header,["children"]):[],s.enableTreeNodeMerge=null!==(o=null!==(i=e.enableTreeNodeMerge)&&void 0!==i?i:J(e.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=null===(r=e.showHeader)||void 0===r||r,this.transpose=null!==(n=e.transpose)&&void 0!==n&&n,"node"!==Xv.mode&&(this.editorManager=new I_(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?CC(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:s.sortState}):this.setRecords([]),e.title){const t=hm.getComponent("title");s.title=new t(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=hm.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const t=hm.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new t(this)}setTimeout((()=>{this.fireListeners(kb.INITIALIZED,null)}),0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return null===(t=this.dataSource)||void 0===t?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=z_(t,["children"]),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.renderAsync(),this.eventManager.updateEventBinder()}get columns(){return this.internalProps.layoutMap.columnTree.getCopiedTree()}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return null!==(t=this.internalProps.transpose)&&void 0!==t&&t}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.renderAsync()))}getCellValue(t,e,i){if(-1===t||-1===e)return null;if(!i){const i=this.getCustomMergeValue(t,e);if(i)return i}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return i}const{format:i}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof i?i(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}}const{field:r,fieldFormat:n}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(n||r,t,e)}getCellOriginValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isSeriesNumber(t,e)){if(i.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getSeriesNumberHeader(t,e);return o}const{format:o}=i.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof o?o(t,e,this):e-this.columnHeaderLevelCount}if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}if(i.internalProps.layoutMap.isAggregation(t,e)){if(i.internalProps.layoutMap.isTopAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnTop(t,e);return null==o?void 0:o.value()}if(i.internalProps.layoutMap.isBottomAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnBottom(t,e);return null==o?void 0:o.value()}}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getFieldData(o,t,e)}getCellRawValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:i}=this.internalProps;return i.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:i}=this.internalProps,o=i.getRecordShowIndexByCell(t,e);return this.dataSource.currentPagerIndexedData[o]}getTableIndexByRecordIndex(t){return this.transpose?this.dataSource.getTableIndex(t)+this.rowHeaderLevelCount:this.dataSource.getTableIndex(t)+this.columnHeaderLevelCount}getTableIndexByField(t){const e=this.internalProps.layoutMap.columnObjects.find((e=>e.field===t));if(!e)return-1;const i=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?i.start.row:i.start.col}getCellAddrByFieldRecord(t,e){return this.transpose?{col:this.getTableIndexByRecordIndex(e),row:this.getTableIndexByField(t)}:{col:this.getTableIndexByField(t),row:this.getTableIndexByRecordIndex(e)}}getCellOriginRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.get(i)}getCellRawRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.getRaw(i)}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i&&!this.transpose){const i=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),o=this.internalProps.layoutMap.isSeriesNumber(t,e);if(null==i?void 0:i.disableColumnResize)return!1;if(o&&!0===this.internalProps.rowSeriesNumber.disableColumnResize)return!1}return i}updateOption(t){var e,i,o,r;const n=this.internalProps;if(super.updateOption(t),n.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,n.sortState=t.sortState,n.dataConfig=t.groupBy?O_(t.groupBy):{},this.showHeader=null===(e=t.showHeader)||void 0===e||e,n.columns=t.columns?z_(t.columns,["children"]):t.header?z_(t.header,["children"]):[],n.enableTreeNodeMerge=null!==(o=null!==(i=t.enableTreeNodeMerge)&&void 0!==i?i:J(t.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=null!==(r=t.transpose)&&void 0!==r&&r,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,n.releaseList&&(n.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),n.releaseList=null),t.dataSource?CC(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const e=hm.getComponent("title");n.title=new e(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=hm.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise((t=>{setTimeout(t,0)}))}updatePagination(t){this.pagination&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.dataSource.updatePagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.renderAsync())}refreshHeader(){var t;const e=this.internalProps,i=this.transpose,o=this.showHeader;(e.layoutMap=new F_(this,null!==(t=e.columns)&&void 0!==t?t:[],o,this.options.hierarchyIndent)).transpose=i,i||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b;const m=this,{layoutMap:C}=m.internalProps;if(!C)return;const y=null!==(e=null===(t=m.internalProps.dataSource)||void 0===t?void 0:t.length)&&void 0!==e?e:0;C.recordsCount=y+(y>0?C.hasAggregationOnTopCount+C.hasAggregationOnBottomCount:0),m.transpose?(m.rowCount=null!==(i=C.rowCount)&&void 0!==i?i:0,m.colCount=null!==(o=C.colCount)&&void 0!==o?o:0,this.internalProps.frozenColCount=Math.max((null!==(r=C.headerLevelCount)&&void 0!==r?r:0)+C.leftRowSeriesNumberColumnCount,null!==(n=this.options.frozenColCount)&&void 0!==n?n:0),this.internalProps.frozenRowCount=null!==(s=this.options.frozenRowCount)&&void 0!==s?s:0,m.bottomFrozenRowCount!==(null!==(a=this.options.bottomFrozenRowCount)&&void 0!==a?a:0)&&(m.bottomFrozenRowCount=null!==(l=this.options.bottomFrozenRowCount)&&void 0!==l?l:0),m.rightFrozenColCount!==(null!==(h=this.options.rightFrozenColCount)&&void 0!==h?h:0)&&(m.rightFrozenColCount=null!==(d=this.options.rightFrozenColCount)&&void 0!==d?d:0)):(m.colCount=null!==(c=C.colCount)&&void 0!==c?c:0,m.rowCount=C.recordsCount*C.bodyRowSpanCount+C.headerLevelCount,this.internalProps.frozenColCount=null!==(u=this.options.frozenColCount)&&void 0!==u?u:0,m.frozenRowCount=Math.max(C.headerLevelCount,null!==(g=this.options.frozenRowCount)&&void 0!==g?g:0),m.bottomFrozenRowCount!==(null!==(p=this.options.bottomFrozenRowCount)&&void 0!==p?p:0)&&(m.bottomFrozenRowCount=null!==(f=this.options.bottomFrozenRowCount)&&void 0!==f?f:0),m.rightFrozenColCount!==(null!==(v=this.options.rightFrozenColCount)&&void 0!==v?v:0)&&(m.rightFrozenColCount=null!==(b=this.options.rightFrozenColCount)&&void 0!==b?b:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,i);return this.internalProps.dataSource.getField(o,t,e,i,this)}getRawFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(e,i);return this.internalProps.dataSource.getRawField(o,t,e,i,this)}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);return r?("column"===r.moveType?(this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):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),r):null}changeRecordOrder(t,e){this.transpose?(t=this.getRecordShowIndexByCell(t,0),e=this.getRecordShowIndexByCell(e,0)):(t=this.getRecordShowIndexByCell(0,t),e=this.getRecordShowIndexByCell(0,e)),this.dataSource.reorderRecord(t,e)}getCellAddress(t,e){let i;for(let e=0;e<this.internalProps.records.length;e++){const o=this.internalProps.records[e];if("function"==typeof t)t(o)&&(i=e);else{let r=!0;for(const e in t)if(o[e]!==t[e]){r=!1;break}r&&(i=e)}if(J(i))break}const o=this.getCellRangeByField(e,i);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:i}=this.internalProps,o=i.columnObjects.find((e=>e.field===t));if(o){const t=i.getBodyLayoutRangeById(o.id);let r;return J(e)&&(r=i.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:J(r)?r+t.start.col:void 0},end:{row:t.end.row,col:J(r)?r+t.end.col:void 0}}:{start:{col:t.start.col,row:J(r)?r+t.start.row:void 0},end:{col:t.end.col,row:J(r)?r+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return Rv.none;const i=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const i=this.getHierarchyState(t,e);if(i===Rv.expand)this._refreshHierarchyState(t,e),this.fireListeners(kb.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Rv.collapse});else if(i===Rv.collapse){const i=this.getCellOriginRecord(t,e);Array.isArray(i.children)&&this._refreshHierarchyState(t,e),this.fireListeners(kb.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Rv.expand,originData:i})}}_refreshHierarchyState(t,e){let i=!1,o=!1;const r=this.internalProps.layoutMap.checkHasChart();r&&(this.autoFillWidth&&(i=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(o=this.getAllRowsHeight()<=this.tableNoFrameHeight));const n=this.getRecordShowIndexByCell(t,e),s=this.dataSource.toggleHierarchyState(n,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount,Math.max(this.scenegraph.proxy.rowEnd-this.columnHeaderLevelCount,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount+this.scenegraph.proxy.rowLimit-1)),a=this.internalProps.layoutMap.toggleHierarchyState(s);this.refreshRowColCount(),this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions),r&&(this.autoFillWidth&&!i&&(i=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!o&&(o=this.getAllRowsHeight()<=this.tableNoFrameHeight),("adaptive"===this.widthMode||i||"adaptive"===this.heightMode||o)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return null===(e=null!==(t=this.options.columns)&&void 0!==t?t:this.options.header)||void 0===e?void 0:e.some(((t,e)=>t.tree))}getMenuInfo(t,e,i){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,i){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((i&&i===r.fieldKey||!i&&r.field===e)&&r.sort&&"function"==typeof r.sort)return r.sort;if(r.columns){const t=this._getSortFuncFromHeaderOption(r.columns,e,i);if(t)return t}}}updateSortState(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,r;let n,s;if(t?this.internalProps.sortState=t:this.internalProps.sortState&&(Array.isArray(this.internalProps.sortState)?(t=null===(i=this.internalProps.sortState)||void 0===i?void 0:i[0])&&(t.order="normal"):(this.internalProps.sortState.order="normal",t=this.internalProps.sortState)),Array.isArray(this.internalProps.sortState)?(null===(o=this.internalProps.sortState)||void 0===o?void 0:o[0])&&({order:n,field:s}=null===(r=this.internalProps.sortState)||void 0===r?void 0:r[0]):this.internalProps.sortState&&({order:n,field:s}=this.internalProps.sortState),s&&e){const t=this._getSortFuncFromHeaderOption(this.internalProps.columns,s),e=this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===s));e&&!1!==e.define.sort&&(this.dataSource.sort(e.field,n,t),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.sortCell())}t&&this.stateManager.updateSortState(t)}updateFilterRules(t){this.scenegraph.clearCells(),this.sortState?(this.dataSource.updateFilterRulesForSorted(t),W_(this)):this.dataSource.updateFilterRules(t),this.refreshRowColCount(),this.scenegraph.createSceneGraph()}getCheckboxState(t){return this.stateManager.checkedState.length<this.rowCount-this.columnHeaderLevelCount&&this.stateManager.initLeftRecordsCheckState(this.records),J(t)?this.stateManager.checkedState.map((e=>e[t])):this.stateManager.checkedState}getCellCheckboxState(t,e){var i;const o=this.getBodyColumnDefine(t,e),r=null==o?void 0:o.field,n=this.getCellType(t,e);if(J(r)&&"checkbox"===n){const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return null===(i=this.stateManager.checkedState[o])||void 0===i?void 0:i[r]}}getRadioState(t){return J(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return function(t,e,i){var o;const r=i.getBodyColumnDefine(t,e),n=null==r?void 0:r.field,s=i.getCellType(t,e);if(J(n)&&"checkbox"===s){const r=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),s=null===(o=i.stateManager.radioState)||void 0===o?void 0:o[n];if(at(s)){if(s===r)return!0}else if(Q(s)){const t=s[r];if(at(t))return t}}return!1}(t,e,this)}setCellCheckboxState(t,e,i){!function(t,e,i,o){const r=o.scenegraph.getCell(t,e),n=null==r?void 0:r.getChildByName("checkbox");if(!n)return;const{checked:s,indeterminate:a}=n.attribute;a?(i||n._handlePointerUp(),n._handlePointerUp()):s?i||n._handlePointerUp():i&&n._handlePointerUp()}(t,e,i,this)}setCellRadioState(t,e,i){!function(t,e,i,o){const r=o.scenegraph.getCell(t,e);if(r)if(at(i)){const t=r.getChildAt(i);null==t||t._handlePointerUp()}else{const t=r.getChildByName("radio");null==t||t._handlePointerUp()}}(t,e,i,this)}setRecords(t,e){var i,o,r;let n;null===(i=this.internalProps.dataSource)||void 0===i||i.release(),this.internalProps.releaseList=null===(o=this.internalProps.releaseList)||void 0===o?void 0:o.filter((t=>!t.dataSourceObj)),this.internalProps.dataSource=null,Array.isArray(e)||(null==e?void 0:e.order)?n=e:e?n=e.sortState:null===e&&(n=null),"undefined"!=typeof window&&window.performance.now();const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),void 0!==n&&(this.internalProps.sortState=n,this.stateManager.setSortState(this.sortState)),t){if(mC(this,t),this.sortState){let t,e;if(Array.isArray(this.sortState)?0!==this.sortState.length&&({order:t,field:e}=null===(r=this.sortState)||void 0===r?void 0:r[0]):({order:t,field:e}=this.sortState),t&&e&&"normal"!==t){const i=this._getSortFuncFromHeaderOption(void 0,e),o=this.internalProps.layoutMap.headerObjectsIncludeHided.find((t=>t&&t.field===e));o&&!1!==o.define.sort&&this.dataSource.sort(o.field,t,null!=i?i:rb)}}this.refreshRowColCount()}else mC(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(s.col,s.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=hm.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),J(s.col)&&J(s.row)&&s.col>=0&&s.row>=0&&setTimeout((()=>{var t;null===(t=this.internalProps)||void 0===t||t.tooltipHandler.showTooltip(s.col,s.row)}),0)}setRecordChildren(t,e,i){const o=this.getCellOriginRecord(e,i);o.children=t;const r=this.getRecordShowIndexByCell(e,i);this.dataSource.setRecord(o,r),this._refreshHierarchyState(e,i)}startEditCell(t,e,i){var o;if(J(t)&&J(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(null===(o=this.stateManager.select)||void 0===o?void 0:o.cellPos){const{col:t,row:e}=this.stateManager.select.cellPos;J(t)&&J(e)&&this.editorManager.startEditCell(t,e,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o;const r=this.getBodyColumnDefine(t,e);let n=this.isHeader(t,e)?null!==(i=null==r?void 0:r.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==r?void 0:r.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof n&&(n=n({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),"string"==typeof n?function(t){if(P_[t])return P_[t]}(n):n}isHasEditorDefine(t,e){var i,o;const r=this.getBodyColumnDefine(t,e);let n=this.isHeader(t,e)?null!==(i=null==r?void 0:r.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==r?void 0:r.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof n&&(n=n({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),J(n)}changeCellValue(t,e,i){return function(t,e,i,o,r){if(o&&r.isHasEditorDefine(t,e)||!1===o){const o=r.getRecordShowIndexByCell(t,e),{field:n}=r.internalProps.layoutMap.getBody(t,e),s=r.getCellRawValue(t,e),a=r.getCellOriginValue(t,e);r.isHeader(t,e)?r.internalProps.layoutMap.updateColumnTitle(t,e,i):r.dataSource.changeFieldValue(i,o,n,t,e,r);const l=r.getCellRange(t,e),h=r.internalProps.layoutMap.getAggregatorsByCell(t,e);if(h){if(Array.isArray(h))for(let t=0;t<(null==h?void 0:h.length);t++)h[t].recalculate();else h.recalculate();const t=r.internalProps.layoutMap.getAggregatorCellAddress(l.start.col,l.start.row,l.end.col,l.end.row);for(let e=0;e<t.length;e++){const i=r.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)r.scenegraph.updateCellContent(t,e)}}for(let t=l.start.col;t<=l.end.col;t++)for(let e=l.start.row;e<=l.end.row;e++)r.scenegraph.updateCellContent(t,e);if("adaptive"===r.widthMode||r.autoFillWidth&&r.getAllColsWidth()<=r.tableNoFrameWidth)0===r.internalProps._widthResizedColMap.size&&r.scenegraph.recalculateColWidths();else if(!r.internalProps._widthResizedColMap.has(t)){const e=r.getColWidth(t),i=ex(t,0,r.rowCount-1,r,!1);i!==e&&r.scenegraph.updateColWidth(t,i-e)}if("adaptive"===r.heightMode||r.autoFillHeight&&r.getAllRowsHeight()<=r.tableNoFrameHeight)0===r.internalProps._heightResizedRowMap.size&&r.scenegraph.recalculateRowHeights();else if("autoHeight"===r.heightMode&&!r.internalProps._heightResizedRowMap.has(e)){const t=r.getRowHeight(e),i=_y(e,0,r.colCount-1,r);r.scenegraph.updateRowHeight(e,i-t)}r.fireListeners(kb.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:s,currentValue:a,changedValue:r.getCellOriginValue(t,e)}),r.scenegraph.updateNextFrame()}}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}changeCellValues(t,e,i){return function(t,e,i,o,r){let n=t,s=e;const a=[],l=[];let h;for(let o=0;o<i.length&&!(e+o>r.rowCount-1);o++){const n=i[o],s=[],d=[];a.push(s),l.push(d);for(let i=0;i<n.length&&!(t+i>r.colCount-1);i++){h=D_(t+i,e+o,r,h);const n=r.getCellRawValue(t+i,e+o);s.push(n);const a=r.getCellOriginValue(t+i,e+o);d.push(a)}}for(let h=0;h<i.length&&!(e+h>r.rowCount-1);h++){s=e+h;const d=i[h];let c=t;for(let i=0;i<d.length&&!(t+i>r.colCount-1);i++)if(c=t+i,o&&r.isHasEditorDefine(t+i,e+h)||!1===o){const o=d[i],n=r.getRecordShowIndexByCell(t+i,e+h),{field:s}=r.internalProps.layoutMap.getBody(t+i,e+h),c=a[h][i],u=l[h][i];r.isHeader(t+i,e+h)?r.internalProps.layoutMap.updateColumnTitle(t+i,e+h,o):r.dataSource.changeFieldValue(o,n,s,t+i,e+h,r),r.fireListeners(kb.CHANGE_CELL_VALUE,{col:t+i,row:e+h,rawValue:c,currentValue:u,changedValue:r.getCellOriginValue(t+i,e+h)})}n=Math.max(n,c)}const d=r.getCellRange(t,e),c=r.getCellRange(n,s),u=r.internalProps.layoutMap.getAggregatorsByCellRange(d.start.col,d.start.row,c.end.col,c.end.row);if(u){for(let t=0;t<(null==u?void 0:u.length);t++)u[t].recalculate();if("normal"===h){const t=r.internalProps.layoutMap.getAggregatorCellAddress(d.start.col,d.start.row,c.end.col,c.end.row);for(let e=0;e<t.length;e++){const i=r.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)r.scenegraph.updateCellContent(t,e)}}}if("group"===h&&r.dataSource.updateRecordsForGroup([],[]),"sort"===h||"group"===h)return r.dataSource.sortedIndexMap.clear(),W_(r),r.refreshRowColCount(),r.internalProps.layoutMap.clearCellRangeMap(),r.scenegraph.clearCells(),void r.scenegraph.createSceneGraph();for(let t=d.start.col;t<=c.end.col;t++)for(let e=d.start.row;e<=c.end.row;e++)r.scenegraph.updateCellContent(t,e);if("adaptive"===r.widthMode||r.autoFillWidth&&r.getAllColsWidth()<=r.tableNoFrameWidth)0===r.internalProps._widthResizedColMap.size&&r.scenegraph.recalculateColWidths();else for(let e=t;e<=c.end.col;e++)if(!r.internalProps._widthResizedColMap.has(e)){const t=r.getColWidth(e),i=ex(e,0,r.rowCount-1,r,!1);i!==t&&r.scenegraph.updateColWidth(e,i-t)}if("adaptive"===r.heightMode||r.autoFillHeight&&r.getAllRowsHeight()<=r.tableNoFrameHeight)r.scenegraph.recalculateRowHeights();else if("autoHeight"===r.heightMode){const t=[],i=[];for(let o=e;o<=c.end.row;o++)if(r.rowHeightsMap.get(o)){const e=r.getRowHeight(o),n=_y(o,0,r.colCount-1,r);t.push(o),i.push(n-e)}r.scenegraph.updateRowsHeight(t,i)}r.scenegraph.updateNextFrame()}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}addRecord(t,e){!function(t,e,i){var o,r;if(i.options.groupBy)null===(r=(o=i.dataSource).addRecordsForGroup)||void 0===r||r.call(o,[t]),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordForSorted(t),W_(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{(void 0===e||e>i.dataSource.sourceLength)&&(e=i.dataSource.sourceLength);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecord(t,e);const r=i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const n=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:t,currentPage:s}=i.pagination,a=t*(s||0)+t;if(e<a)if(e<a-t)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const s=e-(a-t)+o;if(r-o===i.pagination.perPageCount){const t=[];for(let e=s;e<n;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const t=[];for(let e=s;e<Math.min(n,s+1);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}else{const t=[];for(let r=e+o;r<e+o+1;r++)i.transpose?t.push({col:r,row:0}):t.push({col:0,row:r});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}(t,e,this)}addRecords(t,e){!function(t,e,i){var o,r;if(i.options.groupBy)null===(r=(o=i.dataSource).addRecordsForGroup)||void 0===r||r.call(o,t),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordsForSorted(t),W_(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{void 0===e||e>i.dataSource.sourceLength?e=i.dataSource.sourceLength:e<0&&(e=0);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecords(t,e);const r=i.transpose?i.colCount:i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const n=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:s,currentPage:a}=i.pagination,l=s*(a||0)+s;if(e<l)if(e<l-s)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const a=e-(l-s)+o;if(r-o===i.pagination.perPageCount){const t=[];for(let e=a;e<n;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const e=[];for(let o=a;o<Math.min(n,a+(Array.isArray(t)?t.length:1));o++)i.transpose?e.push({col:o,row:0}):e.push({col:0,row:o});i.transpose?i.scenegraph.updateCol([],e,[]):i.scenegraph.updateRow([],e,[])}}}else{const r=[];for(let n=e+o;n<e+o+(Array.isArray(t)?t.length:1);n++)i.transpose?r.push({col:n,row:0}):r.push({col:0,row:n});i.transpose?i.scenegraph.updateCol([],r,[]):i.scenegraph.updateRow([],r,[])}}}(t,e,this)}deleteRecords(t){!function(t,e){var i,o;if((null==t?void 0:t.length)>0)if(e.options.groupBy)null===(o=(i=e.dataSource).deleteRecordsForGroup)||void 0===o||o.call(i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.deleteRecordsForSorted(t),W_(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.dataSource.deleteRecords(t);if(0===i.length)return;const o=e.transpose?e.colCount:e.rowCount;e.refreshRowColCount();const r=e.transpose?e.colCount:e.rowCount,n=i.sort(((t,e)=>t-e)),s=n[0];if(e.pagination){const{perPageCount:t,currentPage:i}=e.pagination,n=t*(i||0)+t;if(s<n)if(s<n-t)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=[],a=[];for(let o=s-(n-t)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount);o<r;o++)e.transpose?i.push({col:o,row:0}):i.push({col:0,row:o});if(r<o)for(let t=r;t<o;t++)e.transpose?a.push({col:t,row:0}):a.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(a,[],i):e.scenegraph.updateRow(a,[],i)}}else{const t=[];for(let i=0;i<n.length;i++){const o=n[i]+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount);e.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}e.transpose?e.scenegraph.updateCol(t,[],[]):e.scenegraph.updateRow(t,[],[])}}}(t,this)}updateRecords(t,e){!function(t,e,i){var o,r;if((null==e?void 0:e.length)>0)if(i.options.groupBy)null===(r=(o=i.dataSource).updateRecordsForGroup)||void 0===r||r.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.updateRecordsForSorted(t,e),W_(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const o=i.dataSource.updateRecords(t,e);if(0===o.length)return;const r=o.sort(((t,e)=>t-e));if(i.pagination){const{perPageCount:t,currentPage:e}=i.pagination,o=t*(e||0)+t,n=[];for(let e=0;e<r.length;e++){const s=r[e];if(s<o&&s>=o-t){const e=s-(o-t)+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount);n.push(e)}}if(n.length>=1){const t=[];for(let e=0;e<n.length;e++){const o=n[e];i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}else{const t=[];for(let e=0;e<r.length;e++){const o=r[e]+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount);i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}}(t,e,this)}_hasCustomRenderOrLayout(){var t,e,i,o;const{headerObjects:r}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let n=0;n<r.length;n++){const s=r[n];if((null===(t=null==s?void 0:s.define)||void 0===t?void 0:t.customLayout)||(null===(e=null==s?void 0:s.define)||void 0===e?void 0:e.headerCustomLayout)||(null===(i=null==s?void 0:s.define)||void 0===i?void 0:i.customRender)||(null===(o=null==s?void 0:s.define)||void 0===o?void 0:o.headerCustomRender))return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),i=[];for(let t=0;t<e.length;t++){const o=e[t].columnDefine.aggregator;if(delete e[t].columnDefine,o){const r={col:e[t].col,aggregateValue:null};if(r.aggregateValue=[],Array.isArray(o))for(let t=0;t<o.length;t++)r.aggregateValue.push({aggregationType:o[t].type,value:o[t].value()});else r.aggregateValue.push({aggregationType:o.type,value:o.value()});i.push(r)}}return i}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var i;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),r=null!==(i=this.dataSource.getGroupLength())&&void 0!==i?i:0;let n=rt(o)?o.length-1:0;return r>0&&n===r&&(n=void 0),n}}function G_(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b){var m,C,y,w,x,S,_,A,R,B,M,T,P,k,L,H,E,z,F,I,O,D,W,N;if(!t){const s=XC(r,n,p,g);b&&(t=g.scenegraph.highPerformanceGetCell(r,n,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:a,height:l,lineWidth:null!==(C=null===(m=null==p?void 0:p.group)||void 0===m?void 0:m.lineWidth)&&void 0!==C?C:void 0,fill:null!==(w=null===(y=null==p?void 0:p.group)||void 0===y?void 0:y.fill)&&void 0!==w?w:void 0,stroke:null!==(S=null===(x=null==p?void 0:p.group)||void 0===x?void 0:x.stroke)&&void 0!==S?S:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(A=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(B=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.cursor)&&void 0!==B?B:void 0,lineDash:null!==(T=null===(M=null==p?void 0:p.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),t&&"cell"===t.role||((t=new jC({x:i,y:o,width:a,height:l,lineWidth:null!==(k=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.lineWidth)&&void 0!==k?k:void 0,fill:null!==(H=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.fill)&&void 0!==H?H:void 0,stroke:null!==(z=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.stroke)&&void 0!==z?z:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(I=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==p?void 0:p.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==p?void 0:p.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",t.col=r,t.row=n,null==e||e.addCellGroup(t))}let G;if(u){let t=r,e=n;v&&(t=v.start.col,e=v.start.row),G=g.getCellIcons(t,e)}let j=0,U=0;if(Array.isArray(G)&&0!==G.length){const{leftIconWidth:e,rightIconWidth:i,absoluteLeftIconWidth:o,absoluteRightIconWidth:r}=ty(G,t,v,g);j=e+i,U=e,t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+a-i-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+a-r-h[1])})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(l-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",l-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])}))}const V=function(t,e,i,o,r,n,s,a,l){var h,d,c,u;const g=l._getCellStyle(t,e),p=VC("size",g,t,e,l),f=VC("spaceBetweenTextAndIcon",g,t,e,l),v=VC("defaultFill",g,t,e,l),b=VC("defaultStroke",g,t,e,l),m=VC("disableFill",g,t,e,l),C=VC("checkedFill",g,t,e,l),y=VC("checkedStroke",g,t,e,l),w=VC("disableCheckedFill",g,t,e,l),x=VC("disableCheckedStroke",g,t,e,l),S=VC("checkIconImage",g,t,e,l),_=VC("indeterminateIconImage",g,t,e,l),A=l.getCellValue(t,e),R=l.getCellOriginValue(t,e);let B,M,T=null!==(h=A)&&void 0!==h?h:"";Q(A)?(B=A.checked,M=A.disable,T=null!==(d=A.text)&&void 0!==d?d:""):"boolean"==typeof A&&(B=A,T=""),B=l.stateManager.syncCheckedState(t,e,a.field,B);const P=$C(t,e,l),k=l._getCellStyle(t,e),L=null!==(c=k.autoWrapText)&&void 0!==c?c:l.internalProps.autoWrapText,{lineClamp:H}=k,{checked:E,disable:z}=a;if(null==B||"function"==typeof B){const i=mb(E,{col:t,row:e,table:l,context:null,value:A,dataValue:R});B=l.stateManager.syncCheckedState(t,e,a.field,i)}const F=mb(z,{col:t,row:e,table:l,context:null,value:A,dataValue:R}),I="auto"===i,O=l.isAutoRowHeight(e),D={text:1===T.length?T[0]:T,maxLineWidth:I?1/0:o-(n[1]+n[3]+P)-p-f,textBaseline:"top",autoWrapText:L,lineClamp:H,wordBreak:"break-word",heightLimit:O?-1:r-Math.floor(n[0]+n[2]),pickable:!1,dx:P,whiteSpace:1!==T.length||L?"normal":"no-wrap"},W={x:0,y:0,text:s.text?Object.assign({},s.text,D):D,icon:{width:Math.floor(p/1.4),height:Math.floor(p/1.4)},box:{width:p,height:p},spaceBetweenTextAndIcon:f,disabled:null!==(u=null!=M?M:F)&&void 0!==u&&u};"indeterminate"===B?(W.checked=void 0,W.indeterminate=!0):(W.checked=B,W.indeterminate=void 0),v&&(W.box.fill=v),b&&(W.box.stroke=b),m&&(W.box.disableFill=m),C&&(W.box.checkedFill=C),y&&(W.box.checkedStroke=y),w&&(W.box.disableCheckedFill=w),x&&(W.box.disableCheckedStroke=x),S&&(W.icon.checkIconImage=S),_&&(W.icon.indeterminateIconImage=_);const N=new Uf(W);return N.name="checkbox",N}(r,n,s-j,a,l,h,p,f,g);return V&&t.appendChild(V),V.render(),a-=h[1]+h[3]+j,l-=h[0]+h[2],"center"===d?V.setAttribute("x",h[3]+U+(a-V.AABBBounds.width())/2):"right"===d?V.setAttribute("x",h[3]+U+a-V.AABBBounds.width()):V.setAttribute("x",h[3]+U),"middle"===c?V.setAttribute("y",h[0]+(l-V.AABBBounds.height())/2):"bottom"===c?V.setAttribute("y",h[0]+l-V.AABBBounds.height()):V.setAttribute("y",h[0]),t}function j_(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f,v,b,m,C,y,w,x,S,_,A,R;if(!t){const s=XC(r,n,g,u);(t=new jC({x:i,y:o,width:a,height:l,lineWidth:null!==(v=null===(f=null==g?void 0:g.group)||void 0===f?void 0:f.lineWidth)&&void 0!==v?v:void 0,fill:null!==(m=null===(b=null==g?void 0:g.group)||void 0===b?void 0:b.fill)&&void 0!==m?m:void 0,stroke:null!==(y=null===(C=null==g?void 0:g.group)||void 0===C?void 0:C.stroke)&&void 0!==y?y:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(x=null===(w=null==g?void 0:g.group)||void 0===w?void 0:w.strokeArrayColor)&&void 0!==x?x:void 0,cursor:null!==(_=null===(S=null==g?void 0:g.group)||void 0===S?void 0:S.cursor)&&void 0!==_?_:void 0,lineDash:null!==(R=null===(A=null==g?void 0:g.group)||void 0===A?void 0:A.lineDash)&&void 0!==R?R:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",t.col=r,t.row=n,null==e||e.addCellGroup(t)}const{width:B,height:M}=function(t,e,i,o,r,n,s,a,l,h){var d,c;const u=h._getCellStyle(t,e);let g=VC("size",u,t,e,h),p=VC("innerRadius",u,t,e,h),f=VC("outerRadius",u,t,e,h);const v=VC("spaceBetweenTextAndIcon",u,t,e,h),b=VC("spaceBetweenRadio",u,t,e,h),m=VC("defaultFill",u,t,e,h),C=VC("defaultStroke",u,t,e,h),y=VC("disableFill",u,t,e,h),w=VC("checkedFill",u,t,e,h),x=VC("checkedStroke",u,t,e,h),S=VC("disableCheckedFill",u,t,e,h),_=VC("disableCheckedStroke",u,t,e,h);at(f)?g=2*f:f=Math.round(g/2),(!at(p)||p<0)&&(p=Math.round(f/7*3));const A=h.getCellValue(t,e),R=h.getCellOriginValue(t,e),B=$C(t,e,h),M=h._getCellStyle(t,e),T=null!==(d=M.autoWrapText)&&void 0!==d?d:h.internalProps.autoWrapText,{lineClamp:P}=M,k="auto"===i,L="autoHeight"===h.heightMode,H={maxLineWidth:k?1/0:o-(n[1]+n[3]+B)-g-v,textBaseline:"top",autoWrapText:T,lineClamp:P,wordBreak:"break-word",heightLimit:L?-1:r-Math.floor(n[0]+n[2]),pickable:!1,dx:B},E={x:0,y:0,text:s.text?Object.assign({},s.text,H):H,circle:{innerRadius:p,outerRadius:f},spaceBetweenTextAndIcon:v};m&&(E.circle.fill=m),C&&(E.circle.stroke=C),y&&(E.circle.disableFill=y),w&&(E.circle.checkedFill=w),x&&(E.circle.checkedStroke=x),S&&(E.circle.disableCheckedFill=S),_&&(E.circle.disableCheckedStroke=_);let z=0,F=0;const I=null!==(c=a.radioDirectionInCell)&&void 0!==c?c:"vertical";if(rt(A))A.forEach(((i,o)=>{const r=U_(i,R,o,t,e,a,T,E,h);r&&l.appendChild(r),r.id=`radio-${t}-${e}-${o}`,r.render();const n=r.AABBBounds;"vertical"===I?(r.setAttribute("y",F),F+=n.height()+(o!==A.length-1?b:0),z=Math.max(z,n.width())):"horizontal"===I&&(r.setAttribute("x",z),z+=n.width()+(o!==A.length-1?b:0),F=Math.max(F,n.height()))}));else{const i=U_(A,R,void 0,t,e,a,T,E,h);i&&l.appendChild(i),i.id=`radio-${t}-${e}`,i.render();const o=i.AABBBounds;z=o.width(),F=o.height()}return{width:z,height:F}}(r,n,s,a,l,h,g,p,t,u);return a-=h[1]+h[3],l-=h[0]+h[2],t.forEachChildren((t=>{"center"===d?t.setAttribute("x",h[3]+t.attribute.x+(a-B)/2):"right"===d?t.setAttribute("x",h[3]+t.attribute.x+a-B):t.setAttribute("x",h[3]+t.attribute.x),"middle"===c?t.setAttribute("y",h[0]+t.attribute.y+(l-M)/2):"bottom"===c?t.setAttribute("y",h[0]+t.attribute.y+l-M):t.setAttribute("y",h[0]+t.attribute.y)})),t}function U_(t,e,i,o,r,n,s,a,l){const h=function(t,e,i,o,r,n,s){var a,l;const h=null!==(a=n.radioCheckType)&&void 0!==a?a:"column";let d,c;return Q(t)?d=t.checked:"boolean"==typeof t&&(d=t),d=s.stateManager.syncRadioState(o,r,n.field,h,i,d),null!=d&&"function"!=typeof d||(c=mb(n.checked,{col:o,row:r,table:s,context:null,value:t,dataValue:e}),d=s.stateManager.syncRadioState(o,r,n.field,h,i,c)),null!==(l=null!=d?d:c)&&void 0!==l&&l}(t,e,i,o,r,n,l),d=function(t,e,i,o,r,n){var s;let a;Q(t)&&(a=t.disable);const l=mb(r.disable,{col:i,row:o,table:n,context:null,value:t,dataValue:e});return null!==(s=null!=a?a:l)&&void 0!==s&&s}(t,e,o,r,n,l),c=Q(t)?t.text:K(t)?"":null!=t?t:"",u=xt({},a,{checked:h,disabled:d,text:{text:1===c.length?c[0]:c,whiteSpace:1!==c.length||s?"normal":"no-wrap"},boundsPadding:0}),g=new Vf(u);return g.name="radio",g}function V_(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m){var C,y,w,x,S,_,A,R,B,M,T,P,k,L,H,E,z,F,I,O,D,W,N,G,j,U,V,X,Y,$,K,q;const Z=t._getCellStyle(n,s),Q=function(t,e,i,o,r){const n=e&&J(e[t])?e[t]:void 0;if("function"==typeof n)return n({col:i,row:o,table:r,value:r.getCellValue(i,o),dataValue:r.getCellOriginValue(i,o),cellHeaderPaths:r.getCellHeaderPaths(i,o)})}("padding",Z,n,s,t);J(Q)&&(d=Q),(null===(C=null==v?void 0:v.text)||void 0===C?void 0:C.textAlign)&&(c=null===(y=null==v?void 0:v.text)||void 0===y?void 0:y.textAlign),(null===(w=null==v?void 0:v.text)||void 0===w?void 0:w.textBaseline)&&(u=null===(x=null==v?void 0:v.text)||void 0===x?void 0:x.textBaseline);const tt=t.isAutoRowHeight(s),et="auto"===a,it=null!==(S=Z.autoWrapText)&&void 0!==S?S:t.internalProps.autoWrapText,ot=Z.lineClamp,rt=XC(n,s,v,t);let nt;if(m&&(nt=t.scenegraph.getCell(n,s,!0),nt&&"cell"===nt.role&&nt.setAttributes({x:o,y:r,width:l,height:h,lineWidth:null!==(A=null===(_=null==v?void 0:v.group)||void 0===_?void 0:_.lineWidth)&&void 0!==A?A:void 0,fill:null!==(B=null===(R=null==v?void 0:v.group)||void 0===R?void 0:R.fill)&&void 0!==B?B:void 0,stroke:null!==(T=null===(M=null==v?void 0:v.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:null!=rt?rt:void 0,strokeArrayColor:null!==(k=null===(P=null==v?void 0:v.group)||void 0===P?void 0:P.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(H=null===(L=null==v?void 0:v.group)||void 0===L?void 0:L.cursor)&&void 0!==H?H:void 0,lineDash:null!==(z=null===(E=null==v?void 0:v.group)||void 0===E?void 0:E.lineDash)&&void 0!==z?z:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius})),nt&&"cell"===nt.role||(nt=new jC({x:o,y:r,width:l,height:h,lineWidth:null!==(I=null===(F=null==v?void 0:v.group)||void 0===F?void 0:F.lineWidth)&&void 0!==I?I:void 0,fill:null!==(D=null===(O=null==v?void 0:v.group)||void 0===O?void 0:O.fill)&&void 0!==D?D:void 0,stroke:null!==(N=null===(W=null==v?void 0:v.group)||void 0===W?void 0:W.stroke)&&void 0!==N?N:void 0,strokeArrayWidth:null!=rt?rt:void 0,strokeArrayColor:null!==(j=null===(G=null==v?void 0:v.group)||void 0===G?void 0:G.strokeArrayColor)&&void 0!==j?j:void 0,cursor:null!==(V=null===(U=null==v?void 0:v.group)||void 0===U?void 0:U.cursor)&&void 0!==V?V:void 0,lineDash:null!==(Y=null===(X=null==v?void 0:v.group)||void 0===X?void 0:X.lineDash)&&void 0!==Y?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius}),nt.role="cell",nt.col=n,nt.row=s,null==i||i.addCellGroup(nt)),p&&nt.appendChild(p),f){const i=e;let o;if(g){let e=n,i=s;b&&(e=b.start.col,i=b.start.row),o=t.getCellIcons(e,i)}if(function(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f,v,b,m,C;let y,w=0,x=0,S=0;if(Array.isArray(e)&&0!==e.length){const{inlineFrontIcons:f,inlineEndIcons:_,contentLeftIcons:A,contentRightIcons:R,leftIconWidth:B,rightIconWidth:M,absoluteRightIconWidth:T}=ty(e,t,p,u);let P;if(w=B,x=M,S=T,0===f.length&&0===_.length){let e=0;at(u.theme._contentOffset)&&("left"===d?e=u.theme._contentOffset:"right"===d&&(e=-u.theme._contentOffset));const c=p?$C(p.start.col,p.start.row,u):$C(t.col,t.row,u),{text:f,moreThanMaxCharacters:b}=KC(i,u),m={text:1===f.length?f[0]:f,moreThanMaxCharacters:b,maxLineWidth:r?1/0:l-(o[1]+o[3])-w-x-c,textBaseline:"top",heightLimit:n&&!(null===(v=u.options.customConfig)||void 0===v?void 0:v.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,autoWrapText:s,lineClamp:a,wordBreak:"break-word",whiteSpace:1!==f.length||s?"normal":"no-wrap",dx:("left"===d?A.length?0:c:0)+e},C=new Gl(g.text?Object.assign({},g.text,m):m);C.name="text",P=C}else{const e=Object.assign({text:null==i?void 0:i.toString()},(null===(C=null===(m=null===(b=t.parent)||void 0===b?void 0:b.theme)||void 0===m?void 0:m.userTheme)||void 0===C?void 0:C.text)||{});g.text&&Object.assign(e,g.text),e.textBaseline="middle";const a=[...f.map((t=>ZC(t))),e,..._.map((t=>ZC(t)))];a[0].textAlign=d;const u=new bd({width:r?0:l-(o[1]+o[3])-w-x,height:n&&s?0:Math.ceil(h-(o[0]+o[2])),textConfig:a,verticalDirection:n&&s?"top":c,ellipsis:e.ellipsis});u.name="text",P=u,u.bindIconEvent()}if(0!==A.length||0!==R.length){const e=new YC({x:0,y:0,fill:!1,stroke:!1,pickable:!1});e.name="content",e.setCellContentOption({autoWidth:r,autoHeight:n,cellWidth:l-(o[1]+o[3])-w-x,cellHeight:h-(o[0]+o[2]),align:d,baseline:c});const i={addedHierarchyOffset:0};A.forEach((o=>{const r=qC(o,void 0,t.col,t.row,p,u,i);r.role="icon-content-left",r.name=o.name,e.addLeftOccupyingIcon(r)})),R.forEach((o=>{const r=qC(o,void 0,t.col,t.row,p,u,i);r.role="icon-content-right",r.name=o.name,e.addRightOccupyingIcon(r)})),e.addContent(P),t.appendChild(e),e.layout(),y=e.AABBBounds.width(),e.AABBBounds.height()}else t.firstChild?t.insertBefore(P,t.firstChild):t.appendChild(P),y=P.AABBBounds.width(),P.AABBBounds.height()}else if(J(i)){const{text:e,moreThanMaxCharacters:v}=KC(i,u),b=p?$C(p.start.col,p.start.row,u):$C(t.col,t.row,u);let m=0;at(u.theme._contentOffset)&&("left"===d?m=u.theme._contentOffset:"right"===d&&(m=-u.theme._contentOffset));const C={text:1===e.length?e[0]:e,moreThanMaxCharacters:v,maxLineWidth:r?1/0:l-(o[1]+o[3]+b),textBaseline:"top",autoWrapText:s,lineClamp:a,wordBreak:"break-word",heightLimit:n&&!(null===(f=u.options.customConfig)||void 0===f?void 0:f.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,dx:("left"===d?b:0)+m,whiteSpace:1!==e.length||s?"normal":"no-wrap"},w=new Gl(g.text?Object.assign({},g.text,C):C);w.name="text",w.textBaseline=c,t.appendChild(w),y=w.AABBBounds.width(),w.AABBBounds.height()}const _=r?w+y+x:l-(o[1]+o[3]),A=h-(o[0]+o[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+o[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+_-x+o[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+_-S+o[3]+o[1]):"content"!==t.name&&"text"!==t.name||("center"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+w+(_-w-x)/2):"right"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+_-x):t.setAttribute("x",o[3]+w))})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",o[0]+(A-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",o[0]+A-t.AABBBounds.height()):t.setAttribute("y",o[0])})),t.setAttributes({width:_+o[1]+o[3],height:A+o[0]+o[2]})}(nt,o,i,d,et,tt,it,"number"==typeof ot?ot:void 0,nt.attribute.width,nt.attribute.height,c,u,t,v,b),null===($=null==v?void 0:v._vtable)||void 0===$?void 0:$.marked){const t=wd({x:nt.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",nt.appendChild(t)}}return p&&nt.setAttributes({width:Math.max(nt.attribute.width,null!==(K=p.attribute.width)&&void 0!==K?K:0),height:Math.max(nt.attribute.height,null!==(q=p.attribute.height)&&void 0!==q?q:0)}),nt}function X_(t,e,i,o,r,n,s,a,l,h){var d,c,u,g,p,f;t.dependField&&(r=null!==(c=null===(d=l.getCellOriginRecord(n,s))||void 0===d?void 0:d[t.dependField])&&void 0!==c?c:r),t.barType=null!==(u=t.barType)&&void 0!==u?u:"default",t.min=null!==(g=mb(t.min,{col:n,row:s,table:l,value:o,dataValue:r,cellHeaderPaths:void 0}))&&void 0!==g?g:0,t.max=null!==(p=mb(t.max,{col:n,row:s,table:l,value:o,dataValue:r,cellHeaderPaths:void 0}))&&void 0!==p?p:t.min+100;let v=0;v=h?l.getRowsHeight(h.start.row,h.end.row):l.getRowHeight(s);let b=i,m=v,C=0;at(l.theme._contentOffset)&&(C=l.theme._contentOffset);const y=new jC({x:-C,y:-C,width:b,height:m});y.name="progress-bar";const{showBar:w,barColor:x,barBgColor:S,barPositiveColor:_,barNegativeColor:A,barAxisColor:R,barRightToLeft:B,showBarMark:M,barMarkPositiveColor:T,barMarkNegativeColor:P,barMarkWidth:k,barMarkPosition:L}=e;let{barHeight:H,barBottom:E,barPadding:z}=e;1===z.length?z=[z[0],z[0],z[0],z[0]]:2===z.length?z=[z[0],z[1],z[0],z[1]]:3===z.length&&(z=[z[0],z[1],z[2],z[1]]),z=z.map(((t,e)=>{if("string"==typeof t&&Bb.endsWith(t,"%")){const o=Number(t.substr(0,t.length-1));return 0===e||2===e?v*o/100:i*o/100}return Number(t)}));const F=Dm(VC("borderLineWidth",e,n,s,l)),I=Math.max(z[0],Math.ceil(F[0]/2)),O=Math.max(z[1],Math.floor(F[1]/2)),D=Math.max(z[2],Math.floor(F[2]/2)),W=Math.max(z[3],Math.ceil(F[3]/2));b-=O+W,m-=D+I,s===l.rowCount-1&&[0,"0"].includes(E)&&(m-=1);const N=I,G=W,j=b;if("string"==typeof H&&Bb.endsWith(H,"%")?(H=Number(H.substr(0,H.length-1)),H=m*H/100):H=Number(H),"string"==typeof E&&Bb.endsWith(E,"%")?(E=Number(E.substr(0,E.length-1)),E=m*E/100):E=Number(E),mb(w,{col:n,row:s,table:l,context:null,value:o,dataValue:r})){let e=`${r}`;Bb.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const i=Number(e);if(isNaN(i))return y;if("default"===(null!==(f=t.barType)&&void 0!==f?f:"default")){const e=i<t.min?0:i>t.max?1:(i-t.min)/(t.max-t.min),a=b,h=N+m-H-E;let d=Math.min(a*e,a);const c=B?G+j-d:G;n!==l.colCount-1||1!==e||B||(d-=1);const u=mb(S,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:e});if(u){const t=ad({x:c,y:h,width:a,height:H,fill:u});y.addChild(t)}const g=ad({x:c,y:h,width:d,height:H,fill:mb(x,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:e})||"#20a8d8"});y.addChild(g)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,a=t.max>0?t.max:0,h=e/(e+a),d=1-h,c=i>0?i/a:0,u=i<0?-i/e:0,g=b,p=N+m-H-E,f=G,C=mb(S,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c});if(C){const t=ad({x:f,y:p,width:g,height:H,fill:C});y.addChild(t)}const w=B?d*g:h*g,x=Math.min(g*h*u,g),z=B?{left:f+w,top:p,width:x,height:H}:{left:f+w-x,top:p,width:x,height:H},F=mb(A,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:u})||"#20a8d8",I=ad({x:z.left,y:z.top,width:z.width,height:z.height,fill:F});y.addChild(I);let O=Math.min(g*d*c,g);n!==l.colCount-1||1!==c||B||(O-=1);const D=B?{left:f+w-O,top:p,width:O,height:H}:{left:f+w,top:p,width:O,height:H},W=mb(_,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c})||"#20a8d8",j=ad({x:D.left,y:D.top,width:D.width,height:D.height,fill:W});y.addChild(j);const U=B?z.left:D.left,V=rd({x:0,y:0,stroke:mb(R,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c}),lineWidth:1,lineDash:[2,2],points:[{x:U,y:0},{x:U,y:v}]});if(y.addChild(V),M&&(c||u)){const t=k,e=[];let i;if(c>0)if(i=mb(T,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c})||"#20a8d8","right"===L){const t=B?D.left+k/2:D.left+D.width-k/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===L&&(e.push({x:D.left,y:D.top+D.height-k/2}),e.push({x:D.left+D.width,y:D.top+D.height-k/2}));else if(u>0)if(i=mb(P,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:u})||"#20a8d8","right"===L){const t=B?z.left+z.width-k/2:z.left+k/2;e.push({x:t,y:z.top}),e.push({x:t,y:z.top+z.height})}else"bottom"===L&&(e.push({x:z.left,y:z.top+z.height-k/2}),e.push({x:z.left+z.width,y:z.top+z.height-k/2}));const a=rd({x:0,y:0,stroke:i,lineWidth:t,points:e});y.addChild(a)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,a=t.max>0?t.max:0,h=Math.max(e,a),d=0===h?0:Math.abs(i)/h,c=b;let u=Math.min(c*d,c);n!==l.colCount-1||1!==d||B||(u-=1);const g=N+m-H-E,p=B?G+j-u:G,f=mb(S,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d});if(f){const t=ad({x:p,y:g,width:c,height:H,fill:f});y.addChild(t)}const v={left:p,top:g,width:u,height:H};let C;C=i>=0?mb(_,{col:n,row:s,table:l,context:null,value:o,percentile:d,dataValue:r})||"#20a8d8":mb(A,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d})||"#20a8d8";const w=ad({x:v.left,y:v.top,width:v.width,height:v.height,fill:C});if(y.addChild(w),M&&i){const t=k,e=[];let a;if(a=i>=0?mb(T,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d})||"#20a8d8":mb(P,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d})||"#20a8d8","right"===L){const t=B?v.left+k/2:v.left+v.width-k/2;e.push({x:t,y:v.top}),e.push({x:t,y:v.top+v.height})}else"bottom"===L&&(e.push({x:v.left,y:v.top+v.height-k/2}),e.push({x:v.left+v.width,y:v.top+v.height-k/2}));const h=rd({x:0,y:0,stroke:a,lineWidth:t,points:e});y.addChild(h)}}}return y}hm.registerFunction("createTextCellGroup",V_);class Y_ extends N_{}Yf();const $_=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function K_(t,e,i){let o,r,n,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,n=r;return r=void 0,o=void 0,h=e,s=t.apply(n,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||d&&t-h>=n}function b(){const t=Date.now();if(v(t))return function(t){return a=void 0,u&&o?p(t):(r=void 0,o=void 0,s)}(t);a=f(b,function(t){const i=t-h,o=e&&-(t-l);return d?Math.min(o,n-i):o}(t))}return e=+e||0,$_(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(n=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),n=v(i);if(o=t,r=this,l=i,n){if(void 0===a)return function(t){return h=t,a=f(b,e),c?p(t):s}(l);if(d)return a=f(b,e),p(l)}return void 0===a&&(a=f(b,e)),s}}let q_=1;class Z_{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=K_(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}class J_{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===Kf.mode)return-1;const r=q_++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new Z_(t,i,this.resizeTime);this.reseizeListeners[r]=e}const n={target:t,type:e,listener:i,options:o};return this.listeners[r]=n,r}once(t,e,i,...o){if("node"===Kf.mode)return-1;const r=this.on(t,e,((...t)=>{this.off(r),i(...t)}),...o);return r}off(t){if("node"===Kf.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==Kf.mode)for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&r.listener.call(r.target,...i)}}hasListener(t,e){if("node"===Kf.mode)return!1;let i=!1;for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&(i=!0)}return i}clear(){if("node"!==Kf.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==Kf.mode&&(this.clear(),this.listeners={})}}let Q_=1;function tA(){return av?Q_=1:(Q_=Math.ceil(window.devicePixelRatio||1),Q_>1&&Q_%2!=0&&(Q_+=1)),Q_}tA();class eA{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;constructor(t){this._gantt=t,this._eventHandler=new J_,this.bindEvent()}release(){this._eventHandler.release()}bindEvent(){!function(t){const o=t._gantt.scenegraph,r=t._gantt,n=r.stateManager;let s;o.tableGroup.addEventListener("pointerdown",(t=>{if(s="down",0!==t.button)return;const i=t.detailPath.find((t=>"task-bar"===t.name));i&&("task-bar-hover-shadow-left-icon"===t.target.name?(n.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"left"),n.updateInteractionState(e.grabing)):"task-bar-hover-shadow-right-icon"===t.target.name?(n.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"right"),n.updateInteractionState(e.grabing)):r.parsedOptions.taskBarMoveable&&(n.startMoveTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y),n.updateInteractionState(e.grabing)))})),o.tableGroup.addEventListener("pointermove",(t=>{if("down"===s){const e=r.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=r.eventManager.lastDragPointerXYOnWindow.y,n=t.y;(i>=1||n-o>=1)&&(s="draging")}if(n.interactionState===e.default){t.detailPath.find((t=>"task-bar"===t.name))?n.showTaskBarHover(t):n.hideTaskBarHover(t)}})),o.tableGroup.addEventListener("pointerup",(t=>{if("down"===s&&r.hasListeners(i.CLICK_TASK_BAR)){const e=hv(t.nativeEvent.y,r),o=r.getRecordByIndex(e);r.fireListeners(i.CLICK_TASK_BAR,{event:t.nativeEvent,index:e,record:o})}s="up"})),o.tableGroup.addEventListener("pointerenter",(t=>{(r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.horizontalVisible||!r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.showHorizontalScrollBar(),(r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.verticalVisible||!r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.showVerticalScrollBar()})),o.tableGroup.addEventListener("pointerleave",(t=>{(r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.horizontalVisible||!r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.hideHorizontalScrollBar(),(r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.verticalVisible||!r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.hideVerticalScrollBar()}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,r=t._eventHandler;r.on(i.getElement(),"wheel",(e=>{sv(e,o,t._gantt)})),r.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(J(i.options.pixelRatio)||i.setPixelRatio(tA()),t.windowSizeNotChange||i._resize())})),i.taskListTableInstance&&i.parsedOptions.verticalSplitLineMoveable&&r.on(i.verticalSplitResizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)}));i.parsedOptions.verticalSplitLineHighlight&&(i.verticalSplitResizeLine&&r.on(i.verticalSplitResizeLine,"mouseover",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="1"})),i.verticalSplitResizeLine&&r.on(i.verticalSplitResizeLine,"mouseout",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="0"})));cc.addEventListener("mousedown",(t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y}})),cc.addEventListener("mousemove",(t=>{if(o.interactionState===e.grabing){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x;Math.abs(e-t.x)>=1&&(o.isResizingTableWidth()?o.dealResizeTableWidth(t):o.isMoveingTaskBar()?o.dealTaskBarMove(t):o.isResizingTaskBar()&&o.dealTaskBarResize(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}})),cc.addEventListener("mouseup",(t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar(t.x):o.isResizingTaskBar()&&o.endResizeTaskBar(t.x))}))}(this)}}function iA(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,void 0,!1)}class oA{friction;lastTime;speedX;speedY;runingId;stopped;scrollHandle;constructor(){}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.stopped=!1,this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){if(this.stopped)return;const t=Date.now(),e=t-this.lastTime;let i=!0;const o=Math.pow(this.friction,e/16),r=o*this.speedX,n=o*this.speedY;let s=0,a=0;Math.abs(r)>.05&&(i=!1,s=(this.speedX+r)/2*e),Math.abs(n)>.05&&(i=!1,a=(this.speedY+n)/2*e),this.scrollHandle?.(s,a),i?this.runingId=null:(this.lastTime=t,this.speedX=r,this.speedY=n,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null,this.stopped=!0}isInertiaScrolling(){return!!this.runingId}}class rA{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;resizeTableWidth;resetInteractionState=K_((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,deltaX:0,startOffsetY:null,startX:null,startY:null,moving:!1,target:null,moveTaskBarXSpeed:0,moveTaskBarXInertia:new oA},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.resizeTaskBar={startOffsetY:null,targetStartX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.resizeTableWidth={lastX:null,resizing:!1},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o,rawValue:r,changedValue:n}=e;t._refreshTaskBar(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{t._syncPropsFromTable(),t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.scenegraph.refreshTaskBarsAndGrid();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt)}setScrollTop(t,e=!0){const o=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,o-this._gantt.scenegraph.height)),t=Math.ceil(t);const r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const n=t/(o-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(n),r!==t&&e&&(iA(this._gantt),this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:n}))}get scrollLeft(){return this.scroll.horizontalBarPos}get scrollTop(){return this.scroll.verticalBarPos}setScrollLeft(t,e=!0){const o=this._gantt._getAllColsWidth();t=Math.max(0,Math.min(t,o-this._gantt.scenegraph.width)),t=Math.ceil(t);const r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const n=t/(o-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(n),r!==t&&e&&this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:n})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),iA(this._gantt),this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt._getAllColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i,o){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i,this.moveTaskBar.startOffsetY=o}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(t){this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()&&this.moveTaskBar.moveTaskBarXInertia.endInertia();const e=this.moveTaskBar.deltaX,o=Math.round(e/this._gantt.parsedOptions.colWidthPerDay),r=o*this._gantt.parsedOptions.colWidthPerDay,n=this.moveTaskBar.targetStartX+r;if(this._gantt.stateManager.moveTaskBar.target.setAttribute("x",n),Math.abs(o)>=1){const t=hv(this.moveTaskBar.startOffsetY,this._gantt),e=this._gantt.getRecordByIndex(t),r=e[this._gantt.parsedOptions.startDateField],n=e[this._gantt.parsedOptions.endDateField];if(this._gantt._updateDateToTaskRecord("move",o,t),this._gantt.hasListeners(i.CHANGE_DATE_RANGE)){const e=this._gantt.getRecordByIndex(t);this._gantt.fireListeners(i.CHANGE_DATE_RANGE,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:r,oldEndDate:n,index:t,record:e})}}this._gantt.scenegraph.updateNextFrame(),this.moveTaskBar.moving=!1,this.moveTaskBar.target=null,this.moveTaskBar.deltaX=0,this.moveTaskBar.moveTaskBarXSpeed=0}dealTaskBarMove(t){const e=this.moveTaskBar.target,i=this._gantt.eventManager.lastDragPointerXYOnWindow.x,o=t.x-i;this.moveTaskBar.deltaX+=o,e.setAttribute("x",e.attribute.x+o),e.attribute.x<=this._gantt.stateManager.scrollLeft&&o<0?(this.moveTaskBar.moveTaskBarXSpeed=-this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,i)=>{this.moveTaskBar.deltaX+=t,e.setAttribute("x",e.attribute.x+t),this._gantt.stateManager.setScrollLeft(e.attribute.x),0===this._gantt.stateManager.scrollLeft&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):e.attribute.x+e.attribute.width>=this._gantt.stateManager.scrollLeft+this._gantt.tableNoFrameWidth&&o>0?(this.moveTaskBar.moveTaskBarXSpeed=this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,i)=>{this.moveTaskBar.deltaX+=t,e.setAttribute("x",e.attribute.x+t),this._gantt.stateManager.setScrollLeft(e.attribute.x+e.attribute.width-this._gantt.tableNoFrameWidth),this._gantt.stateManager.scrollLeft===this._gantt._getAllColsWidth()-this._gantt.tableNoFrameWidth&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()?this.moveTaskBar.moveTaskBarXInertia.endInertia():this.moveTaskBar.moveTaskBarXSpeed=0,this._gantt.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o,r){this.resizeTaskBar.onIconName=r,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i,this.resizeTaskBar.startOffsetY=o}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,o=t-this.resizeTaskBar.startX;if(Math.abs(o)>=1){let t=Math.round(o/this._gantt.parsedOptions.colWidthPerDay);t="left"===e?-t:t;const r=this._gantt.stateManager.resizeTaskBar.target,n=this._gantt.stateManager.resizeTaskBar.target.barRect,s=this._gantt.stateManager.resizeTaskBar.target.progressRect,a=hv(this.resizeTaskBar.startOffsetY,this._gantt),l=this._gantt.getRecordByIndex(a),h=l[this._gantt.parsedOptions.startDateField],d=l[this._gantt.parsedOptions.endDateField],{taskDays:c,progress:u}=this._gantt.getTaskInfoByTaskListIndex(a);t<0&&c+t<=0&&(t=1-c);const g=("left"===e?-t:t)*this._gantt.parsedOptions.colWidthPerDay,p=this.resizeTaskBar.targetStartX+g,f=this._gantt.parsedOptions.colWidthPerDay*(c+t);if("left"===e?(r.setAttribute("x",p),r.setAttribute("width",f),n?.setAttribute("width",r.attribute.width),s?.setAttribute("width",u/100*r.attribute.width),this._gantt._updateDateToTaskRecord("start-move",-t,a)):"right"===e&&(r.setAttribute("width",f),n?.setAttribute("width",r.attribute.width),s?.setAttribute("width",u/100*r.attribute.width),this._gantt._updateDateToTaskRecord("end-move",t,a)),this._gantt.scenegraph.taskBar.showHoverBar(r.attribute.x,r.attribute.y,r.attribute.width,r.attribute.height),nA(this._gantt,r,a),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,Math.abs(t)>=1&&this._gantt.hasListeners(i.CHANGE_DATE_RANGE)){const t=this._gantt.getRecordByIndex(a);this._gantt.fireListeners(i.CHANGE_DATE_RANGE,{startDate:t[this._gantt.parsedOptions.startDateField],endDate:t[this._gantt.parsedOptions.endDateField],oldStartDate:h,oldEndDate:d,index:a,record:t})}this._gantt.scenegraph.updateNextFrame()}}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target,r=o.barRect,n=o.progressRect,s=o.textLabel,a=this._gantt.parsedOptions.progressField,l=hv(this.resizeTaskBar.startOffsetY,this._gantt),h=this._gantt.getRecordByIndex(l)[a];let d="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i,c=o.attribute.width+d;d<0&&c<=this._gantt.parsedOptions.colWidthPerDay&&(d=this._gantt.parsedOptions.colWidthPerDay-o.attribute.width,c+=d),o.setAttribute("width",c),"left"===this._gantt.stateManager.resizeTaskBar.onIconName&&o.setAttribute("x",o.attribute.x-d),r?.setAttribute("width",o.attribute.width),n?.setAttribute("width",h/100*o.attribute.width),s?.setAttribute("maxLineWidth",c-20);const u=o.attribute.x,g=o.attribute.y,p=o.attribute.width,f=o.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(u,g,p,f,this.resizeTaskBar.target),nA(this._gantt,o,l),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.maxTableWidth??1e5),r=Math.max(this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.minTableWidth??0);e>0&&i>o&&(i=o),e<0&&i<r&&(i=r),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.verticalSplitResizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX}}showTaskBarHover(t){const e=t.detailPath.find((t=>"task-bar"===t.name));if(this._gantt.stateManager.hoverTaskBar.target!==e){this._gantt.stateManager.hoverTaskBar.target=e;const o=this._gantt.stateManager.hoverTaskBar.target,r=o.attribute.x,n=o.attribute.y,s=o.attribute.width,a=o.attribute.height;if(this._gantt.scenegraph.taskBar.showHoverBar(r,n,s,a,e),this._gantt.scenegraph.updateNextFrame(),this._gantt.hasListeners(i.MOUSEENTER_TASK_BAR)){const e=hv(t.offset.y,this._gantt),o=this._gantt.getRecordByIndex(e);this._gantt.fireListeners(i.MOUSEENTER_TASK_BAR,{event:t.nativeEvent,index:e,record:o})}}}hideTaskBarHover(t){if(this._gantt.stateManager.hoverTaskBar.target&&(this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame(),this._gantt.hasListeners(i.MOUSELEAVE_TASK_BAR))){const e=hv(t.offset.y,this._gantt),o=this._gantt.getRecordByIndex(e);this._gantt.fireListeners(i.MOUSELEAVE_TASK_BAR,{event:t.nativeEvent,index:e,record:o})}}}function nA(t,e,i){const o=t.parsedOptions.taskBarCustomLayout;if(o){let r;if("function"==typeof o){const{startDate:n,endDate:s,taskDays:a,progress:l,taskRecord:h}=t.getTaskInfoByTaskListIndex(i);r=o({width:e.attribute.width,height:e.attribute.height,index:i,startDate:n,endDate:s,taskDays:a,progress:l,taskRecord:h,ganttInstance:t})}else r=o;if(r){const t=r.rootContainer;t.name="task-bar-custom-render";const i=e.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=e.children[i];e.removeChild(o),e.insertInto(t,i)}}}let sA=1,aA=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=sA++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const r=i.indexOf(e);i.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>J(t))):[]}release(){delete this.listenersData}};class lA{records;minDate;maxDate;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.minDate=t.parsedOptions.minDate,this.maxDate=t.parsedOptions.maxDate,this.processRecords()}processRecords(){const t=!this.minDate,e=!this.maxDate;let i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;if(t||e){for(let r=0;r<this.records.length;r++){const n=this.records[r];if(t){const t=nv(n[this._gantt.parsedOptions.startDateField]);i=Math.min(i,t.getTime())}if(e){const t=nv(n[this._gantt.parsedOptions.endDateField]);o=Math.max(o,t.getTime())}}t&&(this.minDate=nv(i)),e&&(this.maxDate=nv(o)),this._gantt.parsedOptions.minDate=this.minDate,this._gantt.parsedOptions.maxDate=this.maxDate,this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime(),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()}}}hm.registerFunction("createCheckboxCellGroup",G_),hm.registerFunction("createProgressBarCell",X_),hm.registerFunction("createRadioCellGroup",j_);var hA=Object.freeze({__proto__:null,formatDate:Jf,getTodayNearDay:function(t,e){const i=(new Date).getTime(),o=new Date(i+864e5*t);if(e){const t=o.getFullYear().toString(),i=(o.getMonth()+1).toString().padStart(2,"0"),r=o.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",t)).replace("mm",i)).replace("dd",r)}return o},getWeekNumber:rv,getWeekday:function(t,e="long"){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(t);return"short"===e?i[o.getDay()].substr(0,3):"long"===e?i[o.getDay()]:'Invalid format specified. Please use "short" or "long".'}});t.Gantt=class extends aA{options;container;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;verticalSplitResizeLine;horizontalSplitLine;context;timeLineHeaderLevel;itemCount;drawHeight;headerHeight;gridHeight;parsedOptions={};taskTableWidth;taskTableColumns;records;data;constructor(t,i){super(),this.container=t,this.options=i,this.taskTableWidth="number"==typeof i?.taskListTable?.tableWidth?i?.taskListTable?.tableWidth:-1,this.taskTableColumns=i?.taskListTable?.columns??[],this.records=i?.records??[],this._sortScales(),dv(this),this.data=new lA(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,r=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=r&&r-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),function(t){if(t.parsedOptions.horizontalSplitLine&&(t.horizontalSplitLine=document.createElement("div"),t.horizontalSplitLine.style.position="absolute",t.horizontalSplitLine.style.top=t.getAllHeaderRowsHeight()+"px",t.horizontalSplitLine.style.left=t.tableY+"px",t.horizontalSplitLine.style.height=(t.parsedOptions.horizontalSplitLine.lineWidth??2)+"px",t.horizontalSplitLine.style.width=t.tableNoFrameWidth+(t.taskListTableInstance?.tableNoFrameWidth??0)+ +(t.taskListTableInstance?t.parsedOptions.verticalSplitLine.lineWidth:0)+"px",t.horizontalSplitLine.style.backgroundColor=t.parsedOptions.horizontalSplitLine.lineColor,t.horizontalSplitLine.style.zIndex="100",t.horizontalSplitLine.style.userSelect="none",t.horizontalSplitLine.style.opacity="1",t.container.appendChild(t.horizontalSplitLine)),t.taskListTableInstance){t.verticalSplitResizeLine=document.createElement("div"),t.verticalSplitResizeLine.style.position="absolute",t.verticalSplitResizeLine.style.top=t.tableY+"px",t.verticalSplitResizeLine.style.left=t.taskTableWidth?t.taskTableWidth-7+t.parsedOptions.verticalSplitLine.lineWidth/2+"px":"0px",t.verticalSplitResizeLine.style.width="14px",t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.verticalSplitResizeLine.style.backgroundColor="rgba(0,0,0,0)",t.verticalSplitResizeLine.style.zIndex="100",t.parsedOptions.verticalSplitLineMoveable&&(t.verticalSplitResizeLine.style.cursor="col-resize"),t.verticalSplitResizeLine.style.userSelect="none",t.verticalSplitResizeLine.style.opacity="1";const e=document.createElement("div");if(e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLine.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLine.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLine.lineColor,e.style.zIndex="100",e.style.userSelect="none",e.style.pointerEvents="none",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e),t.parsedOptions.verticalSplitLineHighlight){const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)/2+"px",e.style.width=(t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLineHighlight.lineColor,e.style.zIndex="100",e.style.cursor="col-resize",e.style.userSelect="none",e.style.pointerEvents="none",e.style.opacity="0",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e)}t.container.appendChild(t.verticalSplitResizeLine)}}(this),this.scenegraph=new class{dateStepWidth;rowHeight;_scales;timelineHeader;grid;taskBar;_gantt;tableGroup;scrollbarComponent;markLine;frameBorder;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===Kf.mode||(cc.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Bc({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,enableLayout:!0,autoRender:!1,context:{appName:"vtable"},pluginList:["poptipForText"]}),this.stage.gantt=this._gantt,this.stage.table=this._gantt,this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.tableGroup=new zn({x:t._gantt.tableX,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.tableGroup),t.tableGroup.name="table",t.timelineHeader=new pv(t),t.grid=new $f(t),t.taskBar=new mv(t),t.markLine=new Cv(t),t.frameBorder=new yv(t),t.scrollbarComponent=new qf(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar)}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,r=i.scenegraph;r.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{r.scrollbarComponent.showVerticalScrollBar()})),r.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{r.scrollbarComponent.showHorizontalScrollBar()})),r.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&r.scrollbarComponent.hideVerticalScrollBar()})),r.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&r.scrollbarComponent.hideHorizontalScrollBar()})),r.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),r.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{r._gantt.eventManager.isDown=!0})),r.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{r._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{r._gantt.eventManager.isDraging=!1})),r.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),r.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),r.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{r._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),r.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{r._gantt.eventManager.isDraging=!1}));const n=Zf(o.updateVerticalScrollBar,20),s=Zf(o.updateHorizontalScrollBar,20);r.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{r._gantt.eventManager.isDown&&(r._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(i,t)})),r.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{r._gantt.eventManager.isDown&&(r._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshAll(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.timelineHeader.refresh(),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}refreshTaskBars(){this.taskBar.refresh(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttributes({x:this._gantt.tableX,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.frameBorder.resize()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.tableGroup.attribute?.width??0}get height(){return this.tableGroup.attribute?.height??0}get x(){return this.tableGroup.attribute?.x??0}get y(){return this.tableGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}getTaskBarNodeByY(t){hv(t,this._gantt)}}(this),this.stateManager=new rA(this),this.eventManager=new eA(this),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine()}renderTaskBarsTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===Kf.mode){const i=this.getElement();let o=0,r=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),r=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const n=(o??1)-1-this.taskTableWidth,s=(r??1)-1;i.style.width=n&&`${n}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:a}=this;t=a.parentElement?.offsetWidth??1,e=a.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(a.style.width="",a.style.height="",a.width=t,a.height=e,a.style.width=`${t}px`,a.style.height=`${e}px`)}const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const r=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.outerFrameStyle){const t=this.parsedOptions.outerFrameStyle?.borderLineWidth;this.tableX=this.taskListTableInstance?this.parsedOptions.verticalSplitLine.lineWidth??0:t,this.tableY=t,this.tableNoFrameWidth=i-t-this.parsedOptions.verticalSplitLine.lineWidth,this.tableNoFrameHeight=r-2*t}}_generateListTable(){if(this.taskTableColumns.length>=1||this.options?.rowSeriesNumber){const t=this._generateListTableOptions();if(this.taskListTableInstance=new Y_(this.container,t),"auto"!==this.options?.taskListTable?.tableWidth&&-1!==this.taskTableWidth||(this.taskTableWidth=this.taskListTableInstance.getAllColsWidth()+this.parsedOptions.outerFrameStyle.borderLineWidth,this.options?.taskListTable?.maxTableWidth&&(this.taskTableWidth=Math.min(this.options?.taskListTable?.maxTableWidth,this.taskTableWidth)),this.options?.taskListTable?.minTableWidth&&(this.taskTableWidth=Math.max(this.options?.taskListTable?.minTableWidth,this.taskTableWidth)),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._updateSize()),this.taskListTableInstance.columnHeaderLevelCount>1)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}}_generateListTableOptions(){const t={},e=["container","records","rowSeriesNumber","overscrollBehavior","pixelRatio"];for(const i in this.options)e.indexOf(i)>=0&&(t[i]=this.options[i]);for(const e in this.options.taskListTable)t[e]=this.options.taskListTable[e],"columns"===e&&(t[e][t[e].length-1].disableColumnResize=!0);if(this.options.taskListTable?.theme)if(t.theme=this.options.taskListTable?.theme,t.theme.bodyStyle&&!function(t,e){const i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set&&!0!==i.writable)}(t.theme,"bodyStyle")){const e=t.theme.getExtendTheme();t.theme.headerStyle?.bgColor||(e.headerStyle?e.headerStyle.bgColor||(e.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):e.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor}),e.cellInnerBorder=!1,e.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{shadowBlur:0,cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),e.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),e.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},e?.columnResize)}else t.theme.headerStyle?t.theme.headerStyle.bgColor||(t.theme.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):t.theme.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor},t.theme.cellInnerBorder=!1,t.theme.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),t.theme.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),t.theme.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize);else t.theme={scrollStyle:Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},om.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),bodyStyle:Object.assign({},om.bodyStyle,this.options.taskListTable?.theme?.bodyStyle),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),columnResize:Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize)};return t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),t.defaultRowHeight=this.parsedOptions.rowHeight,t.clearDOM=!1,t}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day"],o=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),r=i.indexOf(e.unit);return-1===o?1:-1===r?-1:o-r})),r=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),r=i.indexOf(e.unit);return-1===o?1:-1===r?-1:r-o}));this.parsedOptions.sortedTimelineScales=o,this.parsedOptions.reverseSortedTimelineScales=r}}_generateTimeLineDateMap(){const t=nv(this.parsedOptions.minDate),e=nv(this.parsedOptions.maxDate);let i=1e6;for(const i of this.parsedOptions.reverseSortedTimelineScales){const o=nv(t);i.timelineDates=cv(o,e,i)}const o=this.parsedOptions.reverseSortedTimelineScales[0],{unit:r,step:n}=o;"day"===r?i=n:"month"===r?i=30:"week"===r?i=7:"quarter"===r?i=90:"year"===r&&(i=365),this.parsedOptions.colWidthPerDay=this.parsedOptions.timelineColWidth/i}getAllRowsHeight(){return this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return this.parsedOptions.timeLineHeaderRowHeights.reduce(((t,e,i)=>t+e),0)}_getAllColsWidth(){return this.parsedOptions.colWidthPerDay*(Math.ceil(Math.abs(nv(this.parsedOptions.maxDate).getTime()-nv(this.parsedOptions.minDate).getTime())/864e5)+1)}getAllTaskBarsHeight(){return this.itemCount*this.parsedOptions.rowHeight}getRecordByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordByRowCol(0,t+this.taskListTableInstance.columnHeaderLevelCount):this.records[t]}_refreshTaskBar(t){this.scenegraph.taskBar.updateTaskBarNode(t),this.scenegraph.updateNextFrame()}_updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t){const e=this.getRecordByIndex(t),i=this.parsedOptions.startDateField,o=this.parsedOptions.endDateField,r=this.parsedOptions.progressField,n=nv(e[i]).getTime(),s=nv(e[o]).getTime();if(s<this.parsedOptions._minDateTime||n>this.parsedOptions._maxDateTime)return{taskDays:0,progress:0,startDate:null,endDate:null,taskRecord:e};const a=nv(Math.min(Math.max(this.parsedOptions._minDateTime,n),this.parsedOptions._maxDateTime)),l=nv(Math.max(Math.min(this.parsedOptions._maxDateTime,s),this.parsedOptions._minDateTime)),h=function(t){return"string"==typeof t&&(t=t.replace("%",""),t=parseFloat(t)),t<=1&&(t*=100),Math.round(t)}(e[r]);return{taskRecord:e,taskDays:Math.ceil(Math.abs(l.getTime()-a.getTime())/864e5)+1,startDate:a,endDate:l,progress:h}}_updateDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(i),r=this.parsedOptions.startDateField,n=this.parsedOptions.endDateField,s=function(t){const e=["yyyy-mm-dd","dd-mm-yyyy","mm/dd/yyyy","yyyy/mm/dd","dd/mm/yyyy","yyyy.mm.dd","dd.mm.yyyy","mm.dd.yyyy"];t=t.replace(/\s+/g,"");for(let i=0;i<e.length;i++){const o=e[i],r=t.split(ev(o)),n=Qf(r,o);if(3===r.length&&n)return o}return null}(o[r]),a=nv(o[r]),l=nv(o[n]);if("move"===t){const t=Jf(nv(e*lv+a.getTime()),s),i=Jf(nv(e*lv+l.getTime()),s);o[r]=t,o[n]=i}else if("start-move"===t){const t=Jf(nv(e*lv+a.getTime()),s);o[r]=t}else if("end-move"===t){const t=Jf(nv(e*lv+l.getTime()),s);o[n]=t}this._updateRecordToListTable(o,i)}updateTaskRecord(t,e){this._updateRecordToListTable(t,e),this._refreshTaskBar(e)}setPixelRatio(t){this.taskListTableInstance?.setPixelRatio(t),this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}_resize(){this._updateSize(),this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._syncPropsFromTable(),this.scenegraph.resize(),gv(this)}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.headerHeight+this.parsedOptions.rowHeight*this.itemCount,this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release();const{parentElement:t}=this.element;t&&(t.removeChild(this.element),this.verticalSplitResizeLine&&t.removeChild(this.verticalSplitResizeLine),this.horizontalSplitLine&&t.removeChild(this.horizontalSplitLine)),this.scenegraph=null}setRecords(t){this.records=t,this.taskListTableInstance.setRecords(t),this._syncPropsFromTable(),this.verticalSplitResizeLine.style.height=this.drawHeight+"px",this.scenegraph.refreshTaskBarsAndGrid();const e=this.stateManager.scroll.horizontalBarPos,i=this.stateManager.scroll.verticalBarPos;this.scenegraph.setX(-e),this.scenegraph.setY(-i)}updateScales(t){if(this.options.timelineHeader.scales=t,this._sortScales(),dv(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.scenegraph.refreshAll(),gv(this),this.taskListTableInstance)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}_scrollToMarkLine(){if(this.parsedOptions.scrollToMarkLineDate){const t=this.parsedOptions.minDate,e=(this.parsedOptions.scrollToMarkLineDate.getTime()-t.getTime())/864e5*this.parsedOptions.colWidthPerDay-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(e)}}},t.TYPES=o,t.tools=hA,t.version="1.7.2"}));
15
+ ***************************************************************************** */let wv=class{time=Qe.beforeFillStroke;useStyle=!0;order=0;supportedAppName="vtable";drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){"date-header-cell"===t.name&&t.forEachChildren((t=>{if("date-header-cell-text"===t.name&&!0===t.attribute.textStick){const e=t;e.setAttribute("dx",0);const i=e.globalAABBBounds,o=e.stage.globalAABBBounds,r=e.parent.globalAABBBounds,n=o.intersect(r);o.intersect(r)&&(i.width()>=n.width()&&e.attribute.last_dx?e.setAttribute("dx",e.attribute.last_dx??0):o.x1>=i.x1?(e.setAttribute("dx",o.x1-i.x1),e.setAttribute("last_dx",o.x1-i.x1)):o.x2<=i.x2&&(e.setAttribute("dx",o.x2-i.x2),e.setAttribute("last_dx",o.x1-i.x1)))}}))}};wv=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s}([m()],wv);var xv=new n(((t,e,i,o)=>{t(wv).toSelf().inSingletonScope(),t(ds).toService(wv)}));Bo.load(xv);var Sv,_v,Av,Rv,Bv,Mv,Tv,Pv,kv;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(Sv||(Sv={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(_v||(_v={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(Av||(Av={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(Rv||(Rv={})),function(t){t.RECORD="RECORD",t.NONE="NONE",t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT",t.CUSTOM="CUSTOM",t.RECALCULATE="RECALCULATE"}(Bv||(Bv={})),function(t){t.ASC="ASC",t.DESC="DESC",t.NORMAL="NORMAL",t.desc="desc",t.asc="asc",t.normal="normal"}(Mv||(Mv={})),function(t){t.inlineFront="inlineFront",t.inlineEnd="inlineEnd",t.left="left",t.right="right",t.absoluteRight="absoluteRight",t.contentLeft="contentLeft",t.contentRight="contentRight",t.absolute="absolute"}(Tv||(Tv={})),function(t){t.frozen="frozen",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp",t.dragReorder="dragReorder"}(Pv||(Pv={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.freezeIconName="freeze",t.frozenIconName="frozen",t.frozenCurrentIconName="frozenCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse",t.dragReorderIconName="dragReorder"}(kv||(kv={}));let Lv,Hv=1,Ev=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=Hv++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const r=i.indexOf(e);i.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;null===(i=this.listenersData.listenerData[e])||void 0===i||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>J(t))):[]}release(){delete this.listenersData}};const zv={CHANGE_STYLE:"change_style"};let Fv,Iv,Ov,Dv=class t extends Ev{static get EVENT_TYPE(){return zv}static get DEFAULT(){return Lv||(Lv=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R,B,M,T,P,k,L;super(),this._defaultPadding=[10,16,10,16],this._textAlign=null!==(i=null==t?void 0:t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign,this._textBaseline=null!==(o=null==t?void 0:t.textBaseline)&&void 0!==o?o:null==e?void 0:e.textBaseline,this._color=null!==(r=null==t?void 0:t.color)&&void 0!==r?r:null==e?void 0:e.color,this._strokeColor=null!==(n=null==t?void 0:t.strokeColor)&&void 0!==n?n:null==e?void 0:e.strokeColor,this._fontSize=null!==(s=t.fontSize)&&void 0!==s?s:null==e?void 0:e.fontSize,this._fontFamily=null!==(a=t.fontFamily)&&void 0!==a?a:null==e?void 0:e.fontFamily,this._fontWeight=null!==(l=t.fontWeight)&&void 0!==l?l:null==e?void 0:e.fontWeight,this._fontVariant=null!==(h=t.fontVariant)&&void 0!==h?h:null==e?void 0:e.fontVariant,this._fontStyle=null!==(d=t.fontStyle)&&void 0!==d?d:null==e?void 0:e.fontStyle,this._padding=null!==(u=null!==(c=null==t?void 0:t.padding)&&void 0!==c?c:null==e?void 0:e.padding)&&void 0!==u?u:this._defaultPadding,this._borderColor=null!==(g=null==t?void 0:t.borderColor)&&void 0!==g?g:null==e?void 0:e.borderColor,this._textOverflow=null!==(p=null==t?void 0:t.textOverflow)&&void 0!==p?p:null==e?void 0:e.textOverflow,this._textStick=null!==(v=null!==(f=t.textStick)&&void 0!==f?f:null==e?void 0:e.textStick)&&void 0!==v&&v,this._textStickBaseOnAlign=null!==(m=null!==(b=t.textStickBaseOnAlign)&&void 0!==b?b:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==m&&m,this._bgColor=null!==(C=null==t?void 0:t.bgColor)&&void 0!==C?C:null==e?void 0:e.bgColor,this._lineHeight=null!==(y=null==t?void 0:t.lineHeight)&&void 0!==y?y:null==e?void 0:e.lineHeight,this._underline=null!==(w=null==t?void 0:t.underline)&&void 0!==w?w:null==e?void 0:e.underline,this._underlineColor=null!==(x=null==t?void 0:t.underlineColor)&&void 0!==x?x:null==e?void 0:e.underlineColor,this._underlineDash=null!==(S=null==t?void 0:t.underlineDash)&&void 0!==S?S:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(_=null==t?void 0:t.underlineOffset)&&void 0!==_?_:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(A=null==t?void 0:t.lineThrough)&&void 0!==A?A:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(R=null==t?void 0:t.lineThroughColor)&&void 0!==R?R:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(B=null==t?void 0:t.lineThroughDash)&&void 0!==B?B:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(M=null==t?void 0:t.linkColor)&&void 0!==M?M:null==e?void 0:e.linkColor,this._cursor=null!==(T=t.cursor)&&void 0!==T?T:null==e?void 0:e.cursor,this._borderLineWidth=null!==(P=t.borderLineWidth)&&void 0!==P?P:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(k=t.borderLineDash)&&void 0!==k?k:null==e?void 0:e.borderLineDash,this._marked=null!==(L=t.marked)&&void 0!==L?L:null==e?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new t(this,null)}},Wv=class t extends Dv{static get DEFAULT(){return Fv||(Fv=new t)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}clone(){return new t(this,null)}};class Nv extends Dv{static get DEFAULT(){return Iv||(Iv=new Nv)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new Nv(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let Gv,jv=class t extends Dv{static get DEFAULT(){return Ov||(Ov=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_;super(t,e),this._size=(null!==(r=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==r?r:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(n=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==n?n:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(l=null===(a=null==t?void 0:t.checkboxStyle)||void 0===a?void 0:a.defaultFill)&&void 0!==l?l:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(m=null===(b=null==t?void 0:t.checkboxStyle)||void 0===b?void 0:b.disableCheckedFill)&&void 0!==m?m:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(y=null===(C=null==t?void 0:t.checkboxStyle)||void 0===C?void 0:C.disableCheckedStroke)&&void 0!==y?y:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(_=null===(S=null==t?void 0:t.checkboxStyle)||void 0===S?void 0:S.indeterminateIconImage)&&void 0!==_?_:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(e){return new t(e,this)}clone(){return new t(this)}};class Uv extends Dv{static get DEFAULT(){return Gv||(Gv=new Uv)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R;super(t,e),this._size=(null!==(r=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==r?r:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(n=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==n?n:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=(null!==(l=null!==(a=null==t?void 0:t.spaceBetweenRadio)&&void 0!==a?a:null==e?void 0:e.spaceBetweenRadio)&&void 0!==l?l:null==i?void 0:i.spaceBetweenRadio)||2,this._innerRadius=null!==(d=null===(h=null==t?void 0:t.radioStyle)||void 0===h?void 0:h.innerRadius)&&void 0!==d?d:null==i?void 0:i.innerRadius,this._outerRadius=null!==(u=null===(c=null==t?void 0:t.radioStyle)||void 0===c?void 0:c.outerRadius)&&void 0!==u?u:null==i?void 0:i.outerRadius,this._defaultFill=null!==(p=null===(g=null==t?void 0:t.radioStyle)||void 0===g?void 0:g.defaultFill)&&void 0!==p?p:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(v=null===(f=null==t?void 0:t.radioStyle)||void 0===f?void 0:f.defaultStroke)&&void 0!==v?v:null==i?void 0:i.defaultStroke,this._disableFill=null!==(m=null===(b=null==t?void 0:t.radioStyle)||void 0===b?void 0:b.disableFill)&&void 0!==m?m:null==i?void 0:i.disableFill,this._checkedFill=null!==(y=null===(C=null==t?void 0:t.radioStyle)||void 0===C?void 0:C.checkedFill)&&void 0!==y?y:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(x=null===(w=null==t?void 0:t.radioStyle)||void 0===w?void 0:w.checkedStroke)&&void 0!==x?x:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(_=null===(S=null==t?void 0:t.radioStyle)||void 0===S?void 0:S.disableCheckedFill)&&void 0!==_?_:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(R=null===(A=null==t?void 0:t.radioStyle)||void 0===A?void 0:A.disableCheckedStroke)&&void 0!==R?R:null==i?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new Uv(t,this)}clone(){return new Uv(this)}}function Vv(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Dv,r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0;var s,a;return t||e?t instanceof Dv?t:"function"==typeof t?Vv(t(i),e,i,o,r,n):(t||(t={}),r&&!J(t.autoWrapText)&&(t.autoWrapText=!0),o===jv?new jv(null!=t?t:{},null!=e?e:{},null!==(s=n.checkboxStyle)&&void 0!==s?s:{}):o===Uv?new Uv(null!=t?t:{},null!=e?e:{},null!==(a=n.radioStyle)&&void 0!==a?a:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class Xv{static get mode(){return Xv._mode||(Xv._mode=function(){let t="browser";try{"node"===window.type?t="node":"undefined"==typeof window||window.performance?"undefined"==typeof window&&(t="node"):t="miniApp"}catch(e){t="node"}return t}()),Xv._mode}static set mode(t){Xv._mode=t}static RegisterCreateCanvas(t){Xv.CreateCanvas=t}static RegisterLoadImage(t){Xv.LoadImage=t}static GetCreateCanvasFunc(){return Xv.CreateCanvas?Xv.CreateCanvas:"worker"===Xv.mode?function(){return new OffscreenCanvas(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:200)}:void 0}static RegisterRequestAnimationFrame(t){Xv.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(Xv.RequestAnimationFrame)return Xv.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){Xv.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(Xv.CancelAnimationFrame)return Xv.CancelAnimationFrame}}Xv.dpr=0;const Yv=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e,$v=t=>Yv(t,"object"),Kv=t=>Yv(t,"string"),qv=t=>Yv(t,"number"),Zv=t=>Yv(t,"boolean");function Jv(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!i.length)return t||{};const r=i.shift();if($v(t)&&$v(r))for(const e in r)$v(r[e])?(t[e]||Object.assign(t,{[e]:{}}),$v(t[e])||Object.assign(t,{[e]:r[e]}),Jv(t[e],r[e])):null!==r[e]&&void 0!==r[e]&&Object.assign(t,{[e]:r[e]});return Jv(t,...i)}function Qv(t){return"function"==typeof t&&(t=t()),J(t)?`${t}`:""}function tb(t,e){let i=null;return function(){for(var o=arguments.length,r=new Array(o),n=0;n<o;n++)r[n]=arguments[n];i||(t.apply(this,r),i=setTimeout((()=>{i=null}),e))}}function eb(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function ib(t,e,i){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const o=Math.round(256*e)*(i?-1:1),r=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),n=r&&J(r[4])?r[4]:null,s=r?[r[1],r[2],r[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return r?`rgb${null!==n?"a":""}(${Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255)}${null!==n?`, ${n}`:""})`:["#",eb(Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255).toString(16),2),eb(Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255).toString(16),2),eb(Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255).toString(16),2)].join("")}function ob(t){return Kv(t)||qv(t)||Zv(t)?t.toString():""}function rb(t,e,i){return"desc"!==i?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}function nb(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}const sb="undefined"==typeof window||void 0===window.window;let ab,lb;const hb={get find(){return ab||(ab=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const i=hb.findIndex(t,e);return i>=0?t[i]:void 0},ab)},get findIndex(){return lb||(lb=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:i}=t;for(let o=0;o<i;o++)if(e(t[o],o,t))return o;return-1},lb)}};const{IE:db,Chrome:cb,Firefox:ub,Edge:gb,Safari:pb}=function(){if(sb)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();return{IE:!!/(msie|trident)/.exec(t),Edge:t.indexOf("edge")>-1,Chrome:t.indexOf("chrome")>-1&&-1===t.indexOf("edge"),Firefox:t.indexOf("firefox")>-1,Safari:t.indexOf("safari")>-1&&-1===t.indexOf("edge")}}();function fb(){const t={};for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return i.forEach((e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(t){e[i]=t},configurable:!0,enumerable:!0})})),t}function vb(t,e){let i=t;for(let t=0;t<(arguments.length<=2?0:arguments.length-2)&&null!=i;t++)i=e(i,t+2<2||arguments.length<=t+2?void 0:arguments[t+2]);return i}function bb(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return vb(t,((t,e)=>t[e]),...i)}function mb(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return"function"==typeof t?t(...i):t}function Cb(t){return Boolean(t&&"function"==typeof t.then)}function yb(t,e){Cb(t)?t.then((t=>{e(t)})).catch((t=>{})):e(t)}function wb(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}function xb(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row}function Sb(t){return{start:{col:Math.min(t.start.col,t.end.col),row:Math.min(t.start.row,t.end.row)},end:{col:Math.max(t.start.col,t.end.col),row:Math.max(t.start.row,t.end.row)}}}function _b(t,e){const i=Sb(t),o=Sb(e);return Math.max(i.start.col,o.start.col)<=Math.min(i.end.col,o.end.col)&&Math.max(i.start.row,o.start.row)<=Math.min(i.end.row,o.end.row)}const Ab=db,Rb={isObject:function(t){return t===Object(t)}},Bb={endsWith:function(t,e,i){const o=ob(t);("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>o.length)&&(i=o.length),i-=e.length;const r=o.lastIndexOf(e,i);return-1!==r&&r===i}},Mb={isTouchEvent:function(t){return!!t.changedTouches}},Tb={toBoxArray:wb},Pb=Function.prototype,kb={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},Lb=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function Hb(t,e,i){let o,r,n,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,n=r;return r=void 0,o=void 0,h=e,s=t.apply(n,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||d&&t-h>=n}function b(){const t=Date.now();if(v(t))return function(t){return a=void 0,u&&o?p(t):(r=void 0,o=void 0,s)}(t);a=f(b,function(t){const i=t-h,o=e&&-(t-l);return d?Math.min(o,n-i):o}(t))}return e=+e||0,Lb(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(n=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(){const t=Date.now(),i=v(t);for(var n=arguments.length,u=new Array(n),g=0;g<n;g++)u[g]=arguments[g];if(o=u,r=this,l=t,i){if(void 0===a)return function(t){return h=t,a=f(b,e),c?p(t):s}(l);if(d)return a=f(b,e),p(l)}return void 0===a&&(a=f(b,e)),s}}let Eb=1;const zb=(t,e)=>{let i=0,o=t.length-1;for(;i<=o;){const r=Math.floor((i+o)/2);if(t[r]===e)return r;t[r]>e?o=r-1:i=r+1}return o<0?0:o};class Fb{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const r=[];for(let n=zb(o,t+i-1);n>=0;n--){const s=o[n];if(s>=t)r.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,r[i-1-t])}const{length:r}=o;if(t<e){const n=[];for(let s=zb(o,t);s<r;s++){const r=o[s];if(r>=t&&r<t+i)n.push(this.get(r));else if(t+i<=r&&r<=e)this.put(r-i,this.get(r));else if(r>e)break}for(let t=0;t<i;t++)this.put(e+t,n[t])}}exchangeOrder(t,e,i,o,r){const{_keys:n}=this;if(this._sorted||(n.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let r=zb(n,i);r<t+e;r++){const i=n[r];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,s[t]);for(let t=0;t<o.length;t++)this.put(r+e+t,o[t])}else{const s=[],a=[];for(let r=zb(n,t);r<i+o;r++){const i=n[r];i>=t&&i<t+e?a.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,a[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);-1!==e&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return J(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:r}=o;this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let n=zb(o,t);n<r;n++){const r=o[n];if(t<=r&&r<=e){if(!1===i(this.get(r),r))break}else if(e<r)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),J(e)&&this.put(t,e)}}class Ib{constructor(t,e,i,o){this.bounds=new Qt,this.bounds.set(t,e,t+i,e+o)}static bounds(t,e,i,o){return new Ib(t,e,Math.round(i-t),Math.round(o-e))}get left(){return this.bounds.x1}set left(t){this.bounds.x1=t}get top(){return this.bounds.y1}set top(t){this.bounds.y1=t}get right(){return this.bounds.x2}set right(t){this.bounds.x2=t}get bottom(){return this.bounds.y2}set bottom(t){this.bounds.y2=t}get width(){return this.bounds.width()}set width(t){this.bounds.x2=this.bounds.x1+t}get height(){return this.bounds.height()}set height(t){this.bounds.y2=this.bounds.y1+t}offsetLeft(t){this.bounds.translate(t,0)}offsetTop(t){this.bounds.translate(0,t)}copy(){return new Ib(this.left,this.top,this.width,this.height)}contains(t){return this.bounds.encloses(t.bounds)}inPoint(t,e){return this.bounds.contains(t,e)}}var Ob={underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Db={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Wb={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Nb={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Gb={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:i}=t,{colCount:o,frozenColCount:r}=i,n="#ccc7c7";return r-1===e||o-1===e?[n,"#f2f2f2","#ccc7c7",null]:[n,null,"#ccc7c7",null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:i}}=t;return i-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};const jb={},Ub="Arial,sans-serif",Vb=[],Xb=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,Yb="$$indicator$$",$b={type:"line"};function Kb(t){return t||{}}const qb={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function Zb(t,e,i,o){var r,n,s;return null!==(s=null!==(n=null!==(r=bb(t,...i))&&void 0!==r?r:bb(e,...i))&&void 0!==n?n:o&&bb(t,...o))&&void 0!==s?s:o&&bb(e,...o)}class Jb{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._groupTitle=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this.isPivot=!1,this.internalTheme={obj:t,superTheme:e}}getExtendTheme(){return this.internalTheme.obj}get font(){const{obj:t,superTheme:e}=this.internalTheme;return Zb(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return Zb(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null===(t=Zb(e,i,["cellInnerBorder"]))||void 0===t||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Zb(e,i,["cellBorderClipDirection"]))&&void 0!==t?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Zb(e,i,["_contentOffset"]))&&void 0!==t?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=Jv({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var t;return null!==(t=o.fontSize)&&void 0!==t?t:16},get fontFamily(){var t;return null!==(t=o.fontFamily)&&void 0!==t?t:Ub},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var t;return null!==(t=o.bgColor)&&void 0!==t?t:"#FFF"},get color(){var t;return null!==(t=o.color)&&void 0!==t?t:"#000"},get borderColor(){var t;return null!==(t=o.borderColor)&&void 0!==t?t:"#000"},get borderLineWidth(){var t;return null!==(t=o.borderLineWidth)&&void 0!==t?t:1},get borderLineDash(){var t;return null!==(t=o.borderLineDash)&&void 0!==t?t:Vb},get hover(){if(o.hover)return{get cellBgColor(){var t,e;return null!==(e=null===(t=o.hover)||void 0===t?void 0:t.cellBgColor)&&void 0!==e?e:void 0},get inlineColumnBgColor(){var t,e,i,r,n,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineColumnBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var t,e,i,r,n,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineRowBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var e,i,r,n,s,a;return null!==(a=null!==(n=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:null===(r=t.selectionStyle)||void 0===r?void 0:r.inlineColumnBgColor)&&void 0!==n?n:(null===(s=t.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?ib(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==a?a:void 0},get inlineRowBgColor(){var e,i,r,n,s;return null!==(s=null!==(r=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:t.selectionStyle.inlineRowBgColor)&&void 0!==r?r:(null===(n=t.selectionStyle)||void 0===n?void 0:n.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?ib(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get padding(){var t;return null!==(t=o.padding)&&void 0!==t?t:[10,16,10,16]},get textAlign(){var t;return null!==(t=o.textAlign)&&void 0!==t?t:"left"},get textBaseline(){var t;return null!==(t=o.textBaseline)&&void 0!==t?t:"middle"},get textOverflow(){var t;return null!==(t=o.textOverflow)&&void 0!==t?t:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var t;return null!==(t=o.autoWrapText)&&void 0!==t&&t},get lineClamp(){var t;return null!==(t=o.lineClamp)&&void 0!==t?t:"auto"},get linkColor(){var t;return null!==(t=o.linkColor)&&void 0!==t?t:"#3772ff"},get cursor(){var t;return null!==(t=o.cursor)&&void 0!==t?t:"auto"},get marked(){var t;return null!==(t=o.marked)&&void 0!==t&&t},get underline(){var t;return null!==(t=o.underline)&&void 0!==t&&t},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var t;return null!==(t=o.lineThrough)&&void 0!==t&&t},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=Jv({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=Jv({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=Jv({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=Jv({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=Jv({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=Jv({},this.defaultStyle,i.rowHeaderStyle,null!==(t=e.rowHeaderStyle)&&void 0!==t?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get groupTitleStyle(){if(!this._groupTitle){const{obj:t,superTheme:e}=this.internalTheme;if(!e.groupTitleStyle&&!t.groupTitleStyle)return this._groupTitle;const i=Jv({},this.defaultStyle,e.groupTitleStyle,t.groupTitleStyle);this._groupTitle=this.getStyle(i)}return this._groupTitle}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var t;return null!==(t=i.scrollSliderColor)&&void 0!==t?t:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var t;return null!==(t=i.visible)&&void 0!==t?t:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:7},get hoverOn(){var t;return null===(t=i.hoverOn)||void 0===t||t},get barToSide(){var t;return null!==(t=i.barToSide)&&void 0!==t&&t},get horizontalPadding(){var t;return null!==(t=i.horizontalPadding)&&void 0!==t?t:0},get verticalPadding(){var t;return null!==(t=i.verticalPadding)&&void 0!==t?t:0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var t;return null!==(t=i.fontFamily)&&void 0!==t?t:Ub},get fontSize(){var t;return null!==(t=i.fontSize)&&void 0!==t?t:16},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#000"},get padding(){var t;return null!==(t=i.padding)&&void 0!==t?t:[6,8]},get color(){var t;return null!==(t=i.color)&&void 0!==t?t:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"#416EFF"},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#D9E2FF"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:1},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:i.lineWidth+2},get labelColor(){var t;return null!==(t=i.labelColor)&&void 0!==t?t:"#FFF"},get labelFontSize(){var t;return null!==(t=i.labelFontSize)&&void 0!==t?t:10},get labelFontFamily(){var t;return null!==(t=i.labelFontFamily)&&void 0!==t?t:"sans-serif"},get labelBackgroundFill(){var t;return null!==(t=i.labelBackgroundFill)&&void 0!==t?t:"#3073F2"},get labelBackgroundCornerRadius(){var t;return null!==(t=i.labelBackgroundCornerRadius)&&void 0!==t?t:5},get labelVisible(){var t;return null===(t=i.labelVisible)||void 0===t||t}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"blue"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:2},get shadowBlockColor(){var t;return null!==(t=i.shadowBlockColor)&&void 0!==t?t:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.width)&&void 0!==e?e:24},get startColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.startColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get endColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.endColor)&&void 0!==e?e:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get bgColor(){var t,e,o,r;return null!==(r=null!==(e=null===(t=i.border)||void 0===t?void 0:t.bgColor)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineColor)&&void 0!==r?r:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineWidth)&&void 0!==e?e:4},get width(){var t,e,o,r;return null!==(r=null!==(e=null===(t=i.border)||void 0===t?void 0:t.width)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineWidth)&&void 0!==r?r:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var t;return null!==(t=null==i?void 0:i.cellBgColor)&&void 0!==t?t:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var t;return null!==(t=null==i?void 0:i.cellBorderColor)&&void 0!==t?t:"#3073f2"},get cellBorderLineWidth(){var t;return null!==(t=null==i?void 0:i.cellBorderLineWidth)&&void 0!==t?t:2},get inlineColumnBgColor(){return null==i?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return null==i?void 0:i.inlineRowBgColor},get selectionFillMode(){var t;return null!==(t=null==i?void 0:i.selectionFillMode)&&void 0!==t?t:"overlay"}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.axisStyle,t.axisStyle);this._axisStyle=function(t){return{defaultAxisStyle:Kb(t.defaultAxisStyle),leftAxisStyle:Kb(t.leftAxisStyle),rightAxisStyle:Kb(t.rightAxisStyle),topAxisStyle:Kb(t.topAxisStyle),bottomAxisStyle:Kb(t.bottomAxisStyle)}}(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Jv({},qb,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return Qb(e,t)||Qb(i,t)}extends(t){return new Jb(t,this.internalTheme.superTheme||this.internalTheme.obj)}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var e,i;return null!==(i=null===(e=t.hover)||void 0===e?void 0:e.cellBgColor)&&void 0!==i?i:void 0},get inlineColumnBgColor(){var e,i,o,r,n,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var e,i,o,r,n,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor)?ib(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,r,n,s,a;return null!==(a=null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineColumnBgColor)&&void 0!==o?o:null===(r=e.selectionStyle)||void 0===r?void 0:r.inlineColumnBgColor)&&void 0!==n?n:(null===(s=e.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?ib(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==a?a:void 0},get inlineRowBgColor(){var i,o,r,n,s;return null!==(s=null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineRowBgColor)&&void 0!==o?o:e.selectionStyle.inlineRowBgColor)&&void 0!==r?r:(null===(n=e.selectionStyle)||void 0===n?void 0:n.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?ib(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get cellBgColor(){var i,o,r;if("replace"===e.selectionStyle.selectionFillMode)return null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.cellBgColor)&&void 0!==o?o:e.selectionStyle.cellBgColor)&&void 0!==r?r:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderColor)&&void 0!==i?i:void 0},get borderLineWidth(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineWidth)&&void 0!==i?i:void 0},get borderLineDash(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineDash)&&void 0!==i?i:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var e;return null!==(e=t.underline)&&void 0!==e&&e},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var e;return null!==(e=t.lineThrough)&&void 0!==e&&e},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function Qb(t,e){if(t instanceof Jb)return t.hasProperty(e);let i=t;if(!i)return!1;for(let t=0;t<e.length;t++)if(i=i[e[t]],!i)return!1;return!!i}const tm=new Jb(Ob,Ob),em=new Jb(Db,Db),im=new Jb(Wb,Wb),om=new Jb(Nb,Nb),rm=new Jb(Gb,Gb),nm={DEFAULT:om,SIMPLIFY:rm,ARCO:im,DARK:tm,BRIGHT:em};function sm(){return fb(nm,jb)}var am={DARK:tm,BRIGHT:em,ARCO:im,DEFAULT:om,SIMPLIFY:rm,theme:{TableTheme:Jb},of:function(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const i=e.toLowerCase();if(t[i])return t[i];const o=e.toLowerCase();if(t[o])return t[o];for(const e in t)if(e.toLowerCase()===i)return t[e]}(sm(),t);return e?e instanceof Jb?e:new Jb(e,e):null}return t instanceof Jb?t:new Jb(t,t)},get:sm};function lm(t,e,i){var o;if(t.internalProps.customMergeCell){const o=t.getCustomMerge(e,i);if(o)return o.range}if(!t.internalProps.enableTreeNodeMerge&&!t.isHeader(e,i)&&!(null===(o=t.getBodyColumnDefine(e,i))||void 0===o?void 0:o.mergeCell))return!1;const r=t.getCellRange(e,i);return!(r.start.col===r.end.col&&r.start.row===r.end.row)&&r}class hm{static registerComponent(t,e){hm._components[t]=e}static getComponent(t){return hm._components[t]}static registerFunction(t,e){hm._functions[t]=e}static getFunction(t){return hm._functions[t]}static registerCellType(t,e){hm._cellTypes[t]=e}static getCellType(t){return hm._cellTypes[t]}}function dm(t,e,i,o,r,n){const s=function(t,e){const i=new Array(e);for(let o=0;o<e;o++)i[o]=t(o);return i}(t,i);s.sort(((t,e)=>o(n(t),n(e),r)));for(let t=0;t<i;t++)e(t,s[t])}hm._components={},hm._functions={},hm._cellTypes={};class cm{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=null!==(e=t.isRecord)&&void 0!==e?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[],this.clearCacheValue()}}class um extends cm{constructor(){super(...arguments),this.type=Bv.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t))}value(){return this.records}reset(){this.records=[]}recalculate(){}}class gm extends cm{constructor(){super(...arguments),this.type=Bv.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field]))}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class pm extends cm{constructor(t){super(t),this.type=Bv.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field]))}value(){var t;return this.fieldValue||(this.fieldValue=null===(t=this.aggregationFun)||void 0===t?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class fm extends cm{constructor(t){var e;super(t),this.type=Bv.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=null!==(e=t.needSplitPositiveAndNegative)&&void 0!==e&&e}push(t){if(t)if(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className){const e=t.value();this.sum+=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum:void 0}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){super.reset(),this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if("Aggregator"===e.className){const t=e.value();this.sum+=null!=t?t:0,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const t=parseFloat(e[this.field]);this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}}}}class vm extends cm{constructor(){super(...arguments),this.type=Bv.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++)}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.count+=e.value():this.count++}}}class bm extends cm{constructor(){super(...arguments),this.type=Bv.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===Bv.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++))}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum/this.count:void 0}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className&&e.type===Bv.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class mm extends cm{constructor(){super(...arguments),this.type=Bv.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.max=t.max>this.max?t.max:this.max:"number"==typeof t?this.max=t>this.max?t:this.max:this.field&&"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max))}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.max:void 0}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.max=e.max>this.max?e.max:this.max:"number"==typeof e?this.max=e>this.max?e:this.max:this.field&&"number"==typeof e[this.field]?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class Cm extends cm{constructor(){super(...arguments),this.type=Bv.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.min=t.min<this.min?t.min:this.min:"number"==typeof t?this.min=t<this.min?t:this.min:this.field&&"number"==typeof t[this.field]&&(this.min=t[this.field]<this.min?t[this.field]:this.min))}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.min:void 0}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.min=e.min<this.min?e.min:this.min:"number"==typeof e?this.min=e<this.min?e:this.min:this.field&&"number"==typeof e[this.field]&&(this.min=e[this.field]<this.min?e[this.field]:this.min)}}}const ym={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function wm(t,e){const i=mb(t);if(Cb(i)){const t=i.then((t=>(e(t),t)));return e(t),t}return i}function xm(t,e,i,o,r,n){if(null==t)return;if(Cb(t))return t.then((t=>xm(t,e,i,o,r,n)));const s=function(t){if(Rb.isObject(t)){const e=t;if(J(e.get)&&J(e.set))return!0}return!1}(e)?e.get:e;if(s in t)return wm(t[s],n);if("function"==typeof s)return wm(s(t,i,o,r),n);if(Array.isArray(s))return wm(function(t,e){let i,o=t;for(;i=e.shift();)o=o[i];return o}(t,[...s]),n);const a=`${s}`.split(".");return a.length<=1?wm(t[s],n):wm(vb(t,((t,e)=>xm(t,e,i,o,r,Pb)),...a),n)}function Sm(t,e){if(!t)return e;const i=t[e];return J(i)?i:e}let _m=class extends Ev{static get EVENT_TYPE(){return ym}constructor(t,e,i,o,r,n){var s;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap=[],this.registedAggregators={},this.fieldAggregators=[],this.layoutColumnObjects=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=null==t?void 0:t.get,this.layoutColumnObjects=o,this._source=(null==t?void 0:t.records)?this.processRecords(null==t?void 0:t.records):t,this._sourceLength=(null===(s=this._source)||void 0===s?void 0:s.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},n>=1&&(this.hierarchyExpandLevel=n),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),"tree"===r&&this.initTreeHierarchyState(),this.rowHierarchyType=r,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],r=this.getOriginalRecord(o),n=null!==(t=r.filteredChildren)&&void 0!==t?t:r.children;if((null==n?void 0:n.length)>0){if(this.hierarchyExpandLevel>1?!r.hierarchyState&&(r.hierarchyState=Rv.expand):!r.hierarchyState&&(r.hierarchyState=Rv.collapse),this.hasHierarchyStateExpand=!0,r.hierarchyState===Rv.collapse)continue;const t=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,r);i+=t,e+=t}else!0===r.children&&!r.hierarchyState&&(r.hierarchyState=Rv.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(Bv.RECORD,um),this.registerAggregator(Bv.SUM,fm),this.registerAggregator(Bv.COUNT,vm),this.registerAggregator(Bv.MAX,mm),this.registerAggregator(Bv.MIN,Cm),this.registerAggregator(Bv.AVG,bm),this.registerAggregator(Bv.NONE,gm),this.registerAggregator(Bv.CUSTOM,pm)}_generateFieldAggragations(){const t=this.layoutColumnObjects;for(let e=0;e<(null==t?void 0:t.length);e++){t[e].aggregator=null;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let r=0;r<o.length;r++){const n=o[r],s=new this.registedAggregators[n.aggregationType]({dimension:i,formatFun:n.formatFun,isRecord:!0,aggregationFun:n.aggregationFun});this.fieldAggregators.push(s),t[e].aggregator||(t[e].aggregator=[]),t[e].aggregator.push(s)}else{const r=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(r),t[e].aggregator=r}}}processRecords(t){var e,i,o,r,n,s,a,l;this._generateFieldAggragations();const h=[],d=this.fieldAggregators.length>=1;if((null===(i=null===(e=this.dataConfig)||void 0===e?void 0:e.filterRules)||void 0===i?void 0:i.length)>=1||(null===(o=this.lastFilterRules)||void 0===o?void 0:o.length)>=1||d){for(let e=0,i=t.length;e<i;e++){const i=t[e];(null===(n=null===(r=this.dataConfig)||void 0===r?void 0:r.filterRules)||void 0===n?void 0:n.length)>=1?this.filterRecord(i)&&(h.push(i),"tree"===this.rowHierarchyType&&i.children&&(i.filteredChildren=this.filteredChildren(i.children)),d&&this.processRecord(i)):(null===(s=this.lastFilterRules)||void 0===s?void 0:s.length)>=1?(this.clearFilteredChildren(i),d&&this.processRecord(i)):d&&this.processRecord(i)}if((null===(l=null===(a=this.dataConfig)||void 0===a?void 0:a.filterRules)||void 0===l?void 0:l.length)>=1)return h}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];this.filterRecord(o)&&(e.push(o),o.children&&(o.filteredChildren=this.filteredChildren(o.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var r,n,s;let a=0;const l=o.filteredChildren?o.filteredChildren.length:null!==(n=null===(r=o.children)||void 0===r?void 0:r.length)&&void 0!==n?n:0;for(let r=0;r<l;r++){(i<=e||o.hierarchyState===Rv.expand)&&(a+=1);const n=o.filteredChildren?o.filteredChildren[r]:o.children[r],l=Array.isArray(t)?t.concat(r):[t,r];(i<=e||o.hierarchyState===Rv.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+a,0,l),(n.filteredChildren?n.filteredChildren.length>0:(null===(s=n.children)||void 0===s?void 0:s.length)>0)&&(i<e||n.hierarchyState===Rv.expand?(!n.hierarchyState&&(n.hierarchyState=Rv.expand),this.hasHierarchyStateExpand=!0):!n.hierarchyState&&(n.hierarchyState=Rv.collapse)),n.hierarchyState===Rv.expand&&(a+=this.initChildrenNodeHierarchy(l,e,i+1,n))}return a}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),r=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let i=0;i<t.length;i++)if((Array.isArray(t[i])&&1===t[i].length||!Array.isArray(t[i]))&&e++,e>=o&&e<r)this._currentPagerIndexedData.push(t[i]);else if(e>=r)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(Sm(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(Sm(this.currentPagerIndexedData,t))}getIndexKey(t){return Sm(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex((e=>Rt(e,t))):this.currentPagerIndexedData.findIndex((e=>e===t))}getField(t,e,i,o,r){return this.getOriginalField(Sm(this.currentPagerIndexedData,t),e,i,o,r)}getRawField(t,e,i,o,r){return this.getRawFieldData(Sm(this.currentPagerIndexedData,t),e,i,o,r)}hasField(t,e){return this.hasOriginalField(Sm(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentIndexedData[t]);return null!==(e=null==i?void 0:i.hierarchyState)&&void 0!==e?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),r=this.getIndexKey(t),n=this.getHierarchyState(t),s=this.getOriginalRecord(r);if(this.clearSortedIndexMap(),n===Rv.collapse)s.hierarchyState=Rv.expand,this.pushChildrenNode(r,Rv.expand,s),this.hasHierarchyStateExpand=!0;else if(n===Rv.expand){let t=0;const e=(i,o,r)=>{if(!o||o===Rv.collapse||o===Rv.none)return;const n=r.filteredChildren?r.filteredChildren:r.children;if(n)for(let o=0;o<n.length;o++){t+=1;const r=Array.isArray(i)?i.concat([o]):[i,o];e(r,n[o].hierarchyState,n[o])}};e(r,n,s),this.currentIndexedData.splice(this.currentIndexedData.indexOf(r)+1,t),s.hierarchyState=Rv.collapse}this.updatePagerData();const a=[],l=[];if(n===Rv.collapse){const e=this.currentIndexedData.length-o.length;for(let i=0;i<e;i++)a.push(t+i+1)}else if(n===Rv.expand){const e=o.length-this.currentIndexedData.length;for(let i=0;i<e;i++)l.push(t+i+1)}return{add:a,remove:l}}pushChildrenNode(t,e,i){var o;if(!e||e===Rv.collapse||e===Rv.none)return 0;let r=0;const n=i.filteredChildren?i.filteredChildren:i.children;if(n){const e=Array.from({length:n.length},((t,e)=>e));this.lastOrder&&"normal"!==this.lastOrder&&this.lastOrderField&&dm((t=>J(e[t])?e[t]:e[t]=t),((t,i)=>{e[t]=i}),n.length,this.lastOrderFn,this.lastOrder,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],this.lastOrderField)));for(let i=0;i<e.length;i++){r+=1;const s=Array.isArray(t)?t.concat([e[i]]):[t,e[i]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,s);const a=this.getOriginalRecord(s);!a.hierarchyState&&(null!==(o=a.filteredChildren)&&void 0!==o?o:a.children)&&(a.hierarchyState=Rv.collapse),r+=this.pushChildrenNode(s,a.hierarchyState,n[e[i]])}}return r}changeFieldValue(t,e,i,o,r,n){var s;if(null!==i&&e>=0){const o=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[o]){const t=this.getOriginalRecord(o);this.beforeChangedRecordsMap[o]=null!==(s=mt(t))&&void 0!==s?s:{}}if("string"==typeof i||"number"==typeof i){const e=this.beforeChangedRecordsMap[o][i],r=this.getOriginalRecord(o);let n=t;"number"==typeof e&&function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t)&&(n=parseFloat(t)),Cb(r)?r.then((t=>{t[i]=n})).catch((t=>{})):r?r[i]=n:(this.records[o]={},this.records[o][i]=n)}}}setRecord(t,e){var i,o;let r=!0;if((null===(o=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules)||void 0===o?void 0:o.length)>=1&&(this.filterRecord(t)?"tree"===this.rowHierarchyType&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):r=!1),r&&Array.isArray(this.records)){const i=this.getIndexKey(e);Array.isArray(i)||this.records.splice(i,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){if(this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const t=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=t}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort(((t,e)=>e-t));for(let t=0;t<o.length;t++){const e=o[t];e>=this._sourceLength||e<0||(delete this.beforeChangedRecordsMap[e],i.push(e),this.records.splice(e,1),this.currentIndexedData.pop(),this._sourceLength-=1)}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),(null===(e=this.dataSourceObj)||void 0===e?void 0:e.deleted)&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];if(i>=this._sourceLength||i<0)continue;const o=this.currentIndexedData[i];delete this.beforeChangedRecordsMap[o],this.records.splice(o,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const r=e[o];r>=this._sourceLength||r<0||(delete this.beforeChangedRecordsMap[r],i.push(r),this.records[r]=t[o])}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const r=this.currentIndexedData[o];if("number"!=typeof r)return;delete this.beforeChangedRecordsMap[r],this.records[r]=t[i]}this.sortedIndexMap.clear()}sort(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"desc"!==e?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1;this.lastOrderField=t,this.lastOrder=e,this.lastOrderFn=i;let o,r=this.sortedIndexMap.get(t);if(r&&(o=r[e],o&&o.length>0))return this.currentIndexedData=o,this.updatePagerData(),void this.fireListeners(ym.CHANGE_ORDER,null);const n=[];if("normal"===e)for(let t=0;t<this._sourceLength;t++)n[t]=t;else dm((t=>J(n[t])?n[t]:n[t]=t),((t,e)=>{n[t]=e}),this._sourceLength,i,e,(e=>this.getOriginalField(e,t)));if(this.currentIndexedData=n,this.hierarchyExpandLevel){let t=n.length;window.performance.now();for(let e=0;e<t;e++){const i=this.getOriginalRecord(n[e]),o=this.pushChildrenNode(n[e],i.hierarchyState,this.getOriginalRecord(n[e]));t+=o,e+=o}}r||(r={asc:[],desc:[],normal:[]},this.sortedIndexMap.set(t,r)),r[e]=n,this.updatePagerData(),this.fireListeners(ym.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;null!==(i=o<(null===(e=t.children)||void 0===e?void 0:e.length))&&void 0!==i&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let r=!0;for(let n=0;n<(null===(e=this.dataConfig.filterRules)||void 0===e?void 0:e.length);n++){const e=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules[n];if(e.filterKey){const i=t[e.filterKey];if(-1===e.filteredValues.indexOf(i)){r=!1;break}}else if(!(null===(o=e.filterFunc)||void 0===o?void 0:o.call(e,t))){r=!1;break}}return r}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastOrderField&&this.lastOrder&&this.sortedIndexMap.forEach(((t,e)=>{e!==this.lastOrderField?this.sortedIndexMap.delete(e):"asc"===this.lastOrder?(t.desc=[],t.normal=[]):"desc"===this.lastOrder?(t.asc=[],t.normal=[]):(t.desc=[],t.asc=[])}))}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(ym.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?Am(this.records,t):this.records[t]:this._get(t),wm(e,(e=>{this.recordPromiseCallBack(t,e)}))}getRawRecord(t){var e;if(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?Am(this.records,t):this.records[t]:this._get(t),wm(i,(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e,i,o,r){if(null!==e)return xm(this.getOriginalRecord(t),e,i,o,r,(i=>{this.fieldPromiseCallBack(t,e,i)}))}getRawFieldData(t,e,i,o,r){if(null!==e)return xm(this.getRawRecord(t),e,i,o,r,(i=>{this.fieldPromiseCallBack(t,e,i)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const i=this.getOriginalRecord(t);return Boolean(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let t=0;t<=i.length-2;t++)if(i[t]!==o[t])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i;if("asc"!==this.lastOrder&&"desc"!==this.lastOrder&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let o,r,n=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];if(n=Array.isArray(n)?[...n]:[n],s=Array.isArray(s)?[...s]:[s],n.length>1||s.length>1){if(e>t&&s.length>n.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<s.length&&s.splice(s.length-1,1)}if(o=n.splice(n.length-1,1)[0],r=s.splice(s.length-1,1)[0],n.length>=1){const t=this.getOriginalRecord(n),e=t.filteredChildren?t.filteredChildren.splice(o,1):t.children.splice(o,1);e.unshift(r,0),Array.prototype.splice.apply(null!==(i=t.filteredChildren)&&void 0!==i?i:t.children,e)}else{const t=this.records.splice(o,1);t.unshift(r,0),Array.prototype.splice.apply(this.records,t)}}else{o=this.currentPagerIndexedData[t],r=this.currentPagerIndexedData[e];const i=this.records.splice(o,1);i.unshift(r,0),Array.prototype.splice.apply(this.records,i)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const i=this.records.splice(t,1);i.unshift(e,0),Array.prototype.splice.apply(this.records,i)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let e=0;e<this._sourceLength;e++){const i=this.getOriginalRecord(e);(null!==(t=i.filteredChildren)&&void 0!==t?t:i.children)&&!i.hierarchyState&&(i.hierarchyState=Rv.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let i=this._sourceLength;for(let t=0;t<i;t++){const o=this.currentIndexedData[t],r=this.getOriginalRecord(o),n=null!==(e=r.filteredChildren)&&void 0!==e?e:r.children;if((null==n?void 0:n.length)>0&&r.hierarchyState===Rv.expand){this.hasHierarchyStateExpand=!0;const e=this.restoreChildrenNodeHierarchy(o,r);t+=e,i+=e}else!0===r.children&&!r.hierarchyState&&(r.hierarchyState=Rv.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let r=0;const n=null!==(i=e.filteredChildren)&&void 0!==i?i:e.children,s=null!==(o=null==n?void 0:n.length)&&void 0!==o?o:0;for(let i=0;i<s;i++){e.hierarchyState===Rv.expand&&(r+=1);const o=n[i],s=Array.isArray(t)?t.concat(i):[t,i];e.hierarchyState===Rv.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,s),r+=this.restoreChildrenNodeHierarchy(s,o)}return r}};function Am(t,e){var i;let o=t;for(let t=0;t<e.length;t++){const r=e[t];if(!o[r])return;o=o[r];const n=null!==(i=o.filteredChildren)&&void 0!==i?i:null==o?void 0:o.children;n&&t+1<e.length&&(o=n)}return o}_m.EMPTY=new _m({get(){},length:0});class Rm extends _m{static get EVENT_TYPE(){return _m.EVENT_TYPE}static ofArray(t,e,i,o,r,n){return new Rm({get:e=>t[e],length:t.length,records:t},e,i,o,r,n)}constructor(t,e,i,o,r,n){rt(null==e?void 0:e.groupByRules)&&(r="tree"),super(t,e,i,o,r,n),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getRawRecord(t){var e;return(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])?this.beforeChangedRecordsMap[t]:this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getRawRecord(t)}getOriginalField(t,e,i,o,r){const n=this._fieldCache&&this._fieldCache[t];if(n){const t=n.get(e);if(t)return t}return super.getOriginalField(t,e,i,o,r)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){!function(t,e,i,o){(t[e]||(t[e]=new Map)).set(i,o)}(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache[t]=e}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this._recordCache=null,this._fieldCache=null}_generateFieldAggragations(){var t;if(super._generateFieldAggragations(),rt(null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)){const t=this.dataConfig.groupByRules;this.groupAggregator=new this.registedAggregators[Bv.CUSTOM]({dimension:"",aggregationFun:(e,i,o)=>{const r=new Map,n=[];for(let e=0;e<i.length;e++)Bm(i[e],n,r,t,0),i[e].vtableOriginIndex=e;return n}}),this.fieldAggregators.push(this.groupAggregator)}}processRecords(t){var e;const i=super.processRecords(t);return(null===(e=this.groupAggregator)||void 0===e?void 0:e.value())||i}getGroupLength(){var t,e,i;return null!==(i=null===(e=null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)||void 0===e?void 0:e.length)&&void 0!==i?i:0}updateGroup(){var t,e,i;this.clearCache();const o=this.source;this._source=this.processRecords(null!==(e=null===(t=this.dataSourceObj)||void 0===t?void 0:t.records)&&void 0!==e?e:this.dataSourceObj),o&&Mm(o,this.source),this.sourceLength=(null===(i=this.source)||void 0===i?void 0:i.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this.sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this.sourceLength,this.pagination.totalCount=this.sourceLength),this.initTreeHierarchyState(),this.updatePagerData()}addRecordsForGroup(t){rt(t)&&0!==t.length&&(this.dataSourceObj.records.push(...t),this.updateGroup())}deleteRecordsForGroup(t){if(!rt(t)||0===t.length)return;const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];i>=this.sourceLength||i<0||(delete this.beforeChangedRecordsMap[i],this.dataSourceObj.records.splice(i,1),this.sourceLength-=1)}this.updateGroup()}updateRecordsForGroup(t,e){for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records[o]=t[i])}this.updateGroup()}}function Bm(t,e,i,o,r){const n=o[r];if(!J(n))return void e.push(t);const s=t[n];if(void 0!==s){if(i.has(s)){const n=i.get(s);return Bm(t,e[n].children,e[n].map,o,r+1)}return i.set(s,e.length),e.push({vtableMerge:!0,vtableMergeName:s,children:[],map:new Map}),Bm(t,e[e.length-1].children,e[e.length-1].map,o,r+1)}}function Mm(t,e,i,o){if(!i){i=new Map;for(let e=0;e<t.length;e++){const o=t[e];o.vtableMerge&&i.set(o.vtableMergeName,e)}}if(!o){o=new Map;for(let t=0;t<e.length;t++){const i=e[t];i.vtableMerge&&o.set(i.vtableMergeName,t)}}for(let i=0;i<t.length;i++){const r=t[i],n=e[o.get(r.vtableMergeName)];J(n)&&(n.hierarchyState=t[i].hierarchyState),rt(r.children)&&rt(n.children)&&0!==r.map.size&&0!==n.map.size&&Mm(r.children,n.children,r.map,n.map)}}var Tm={exports:{}},Pm={},km=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Lm=["style","variant","weight","size","lineHeight","family"],Hm=/([\.0-9]+)(.*)/,Em=function(t,e,i){var o=t.match(Hm);if(o){t=parseFloat(o[1]);var r=o[2].toLowerCase().trim(),n=Math.round(t);switch(n===t&&(t=n),r){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/i);case"pc":return t/(6/i);case"mm":return t*(i/25.4);case"cm":return t*(i/2.54);case"in":return t*i;case"%":if(null===e)return;return e*(t/100)}}},zm={size:Em,lineHeight:Em},Fm={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},Im=Tm.exports=function(t,e,i){var o=t+"-"+(e||"null")+"@"+i;if(i=i||96,void 0!==Pm[o])return Pm[o];if(e&&(e=Im(e,null,i)),"inherit"===t)return e;var r=km.exec(t);if(r){r.shift();for(var n={},s=0;s<r.length;s++){var a=Lm[s],l=r[s];if(zm[a]&&l){var h=e&&e[a]||null,d=zm[a](l,h,i);l=void 0===d&&"lineHeight"===a&&l?n.size*parseFloat(l):d}if(l&&"normal"!==l){if("inherit"===l){if(!e)return;l=e[a]}l.trim&&(l=l.trim()),n[a]=l}}Object.keys(n).length||(n=null),Pm[o]=n;var c=[];n.style&&c.push(n.style),n.variant&&c.push(n.variant),n.weight&&"400"!==n.weight&&"normal"!==n.weight&&c.push(n.weight),c.push(n.size+"px"),n.lineHeight&&(c[c.length-1]+="/"+n.lineHeight+"px");var u=n.family.split(",");return n.family=u.map((function(t){return t=t.trim(),Fm[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(n.family),Object.defineProperty(n,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),n}Pm[o]=null};Tm.exports.generics=Fm;var Om=V(Tm.exports);function Dm(t){var e,i,o,r;if(at(t)||ot(t)||rt(t)){let e=Ar(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}return t&&(isFinite(t.bottom)||isFinite(t.left)||isFinite(t.right)||isFinite(t.top))?[null!==(e=t.top)&&void 0!==e?e:0,null!==(i=t.right)&&void 0!==i?i:0,null!==(o=t.bottom)&&void 0!==o?o:0,null!==(r=t.left)&&void 0!==r?r:0]:[0,0,0,0]}const Wm=0,Nm=1,Gm=2,jm=3,Um=10,Vm=11,Xm=12,Ym=9,$m=13,Km=10,qm=12,Zm=32,Jm=37,Qm=46,tC=48,eC=57,iC=65,oC=90,rC=97,nC=122;function sC(t){return function(t){return t>=rC&&t<=nC}(t)||function(t){return t>=iC&&t<=oC}(t)}function aC(t){return t===Ym||t===Km||t===qm||t===$m||t===Zm}function lC(t){return t>=tC&&t<=eC}function hC(t){return t===Qm}function dC(t){return sC(t)||t===Jm}function cC(t){return new Error(`calc parse error: ${t}`)}const uC={"*":3,"/":3,"+":2,"-":2};function gC(t,e){function i(t){const i=t.pop(),o=t.pop(),r=t.pop();if(!(r&&r.nodeType&&o&&o.type===Gm&&i&&i.nodeType))throw cC(e);return{nodeType:Vm,left:r,op:o,right:i}}const o=[];for(;t.length;){const r=t.shift();if(r.type===Wm&&"("===r.value){let i=0;const r=hb.findIndex(t,(t=>{if(t.type===Wm&&"("===t.value)i++;else if(t.type===Wm&&")"===t.value){if(!i)return!0;i--}return!1}));if(-1===r)throw cC(e);o.push(gC(t.splice(0,r),e)),t.shift()}else if(r.type===Gm){if(o.length>=3){const t=o[o.length-2].value;uC[r.value]<=uC[t]&&o.push(i(o))}o.push(r)}else if(r.type===Nm){const{value:t,unit:e}=r;o.push({nodeType:Um,value:t,unit:e})}else r.type===jm&&o.push({nodeType:Xm,value:r.value})}for(;o.length>1;)o.push(i(o));return o[0]}function pC(t){return gC(function(t){const e=t.replace(/calc\(/g,"(").trim(),i=[],o=e.length;for(let s=0;s<o;s++){const o=e[s],a=o.charCodeAt(0);if("("===o||")"===o)i.push({value:o,type:Wm});else if("*"===o||"/"===o)i.push({value:o,type:Gm});else if("+"===o||"-"===o)s=r(o,s+1)-1;else if(lC(a)||hC(a))s=n(o,s+1)-1;else if(!aC(a))throw cC(t)}function r(t,r){if(r<o){const i=e[r],o=i.charCodeAt(0);if(lC(o)||hC(o))return n(t+i,r+1)}return i.push({value:t,type:Gm}),r}function n(r,n){let a=n;for(;a<o;a++){const i=e[a],o=i.charCodeAt(0);if(lC(o))r+=i;else{if("."!==i){if(dC(o))return s(r,i,a+1);break}if(r.indexOf(".")>=0)throw cC(t);r+=i}}if("."===r)throw cC(t);return i.push({value:parseFloat(r),type:jm}),a}function s(t,r,n){let s=n;for(;s<o;s++){const t=e[s];if(!dC(t.charCodeAt(0)))break;r+=t}return i.push({value:parseFloat(t),unit:r,type:Nm}),s}return i}(t),t)}function fC(t,e){if(t.nodeType===Vm){const i=fC(t.left,e),o=fC(t.right,e);switch(t.op.value){case"+":return i+o;case"-":return i-o;case"*":return i*o;case"/":return i/o;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===Um)switch(t.unit){case"%":return t.value*e.full/100;case"px":return t.value;default:throw new Error(`calc error. unknown unit: ${t.unit}`)}else if(t.nodeType===Xm)return t.value;throw new Error("calc error.")}function vC(t,e){return fC(pC(t),e)}function bC(t,e){const{dataSourceEventIds:i}=t.internalProps;i&&i.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,_m.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.hierarchyExpandLevel&&t.refreshRowColCount(),t.render()}))]}function mC(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];bC(t,(()=>{t.internalProps.records=e;const i=t.internalProps.dataSource=Rm.ofArray(e,t.internalProps.dataConfig,t.pagination,t.internalProps.layoutMap.columnObjects,t.internalProps.layoutMap.rowHierarchyType,function(t){var e;return t.options.hierarchyExpandLevel?t.options.hierarchyExpandLevel:t.options.groupBy?1/0:(null===(e=t._hasHierarchyTreeHeader)||void 0===e?void 0:e.call(t))?1:void 0}(t));t.addReleaseObj(i)}))}function CC(t,e){bC(t,(()=>{if(e)if(e instanceof _m)t.internalProps.dataSource=e;else{const i=t.internalProps.dataSource=new Rm(e);t.addReleaseObj(i)}else t.internalProps.dataSource=_m.EMPTY;t.internalProps.records=null}))}function yC(t,e){return Math.round((i=e,o=t.internalProps.calcWidthContext,"string"==typeof i?vC(i.trim(),o):i-0));var i,o}function wC(t,e,i,o,r){let n=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=Dm(r("padding",t,i,o,e)),a=r("bgColor",t,i,o,e),l=r("font",t,i,o,e);let h,d,c,u,g;if(l){const{family:t,size:e,weight:i,style:o,variant:r}=function(t){return Om(t)}(l);h=t.join(" "),d=e,c=i,u=o,u=r}else h=r("fontFamily",t,i,o,e),d=r("fontSize",t,i,o,e),c=r("fontWeight",t,i,o,e),u=r("fontStyle",t,i,o,e),g=r("fontVariant",t,i,o,e);const p=r("textAlign",t,i,o,e),f=r("textBaseline",t,i,o,e),v=r("color",t,i,o,e),b=r("strokeColor",t,i,o,e),m=r("lineHeight",t,i,o,e),C=r("underline",t,i,o,e),y=r("underlineDash",t,i,o,e),w=r("underlineOffset",t,i,o,e),x=r("lineThrough",t,i,o,e),S=Math.max(1,Math.floor(d/10)),_=r("textOverflow",t,i,o,e),A=r("borderColor",t,i,o,e),R=r("borderLineWidth",t,i,o,e),B=r("borderLineDash",t,i,o,e),M=r("marked",t,i,o,e),T=r("cursor",t,i,o,e),P=!(s&&a&&l&&p&&f&&v&&_&&A&&R&&B&&"boolean"==typeof C&&"boolean"==typeof x&&"boolean"==typeof M);if(!n)return{hasFunctionPros:P};const k={text:{fontFamily:h,fontSize:d,fontWeight:c,fontStyle:u,fontVariant:g,fill:v,stroke:null!=b&&b,textAlign:p,textBaseline:f,lineHeight:null!=m?m:d,underline:C?S:void 0,underlineDash:y,underlineOffset:w,lineThrough:x?S:void 0,ellipsis:"clip"===_?"":"ellipsis"===_?"...":J(_)?_:void 0},group:{fill:a,lineDash:B,lineWidth:R,stroke:A,cursor:"auto"===T||"default"===T?void 0:T},_vtable:{padding:s,marked:M}};if(Array.isArray(R)&&(k.group.strokeArrayWidth=Dm(R)),Array.isArray(A)){const t=Dm(A);k.group.stroke=!t.every((t=>!t))&&t,k.group.strokeArrayColor=Dm(A)}return{theme:k,hasFunctionPros:P}}function xC(t,e,i){const o=i.theme.frameStyle.cornerRadius;if(Array.isArray(o)){if(0===t&&0===e)return[o[0],0,0,0];if(t===i.colCount-1&&0===e)return[0,o[1],0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o[3]];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o[2],0]}else if(o){if(0===t&&0===e)return[o,0,0,0];if(t===i.colCount-1&&0===e)return[0,o,0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o,0]}return 0}class SC extends cd{constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundWidth)&&void 0!==t?t:this.attribute.width)&&void 0!==e?e:0}get backgroundHeight(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundHeight)&&void 0!==t?t:this.attribute.height)&&void 0!==e?e:0}}function _C(t){return{rootContainer:new zn({}),renderDefault:!0}}class AC{constructor(t,e){this.removeAllContainer=t,this.table=e,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0,r=[],n=e.internalProps.layoutMap;if(i){const{headerObjects:e}=n,i=[];for(let o=0;o<e.length;o++){const r=e[o];r&&r.define.componentId===t&&i.push(r.id)}for(let t=0;t<i.length;t++){const e=i[t],o=n.getHeaderCellAdressById(e),s=n.getCellRange(o.col,o.row);r.push(s)}}else{let e;const{columnObjects:i,indicatorsAsCol:s}=n;for(let o=0;o<i.length;o++)if(i[o].define.componentId===t){e=o;break}if(s)for(let t=n.rowHeaderLevelCount+e;t<n.colCount;t+=i.length){const e={start:{col:t+o,row:n.columnHeaderLevelCount},end:{col:t+o,row:n.rowCount-1}};r.push(e)}else for(let t=n.columnHeaderLevelCount+e;t<n.rowCount;t+=i.length){const e={start:{col:n.rowHeaderLevelCount+o,row:t},end:{col:n.colCount-1,row:t}};r.push(e)}}return r}(t,i,e);for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start.col;t<=e.end.col;t++)for(let o=e.start.row;o<=e.end.row;o++)i.scenegraph.updateCellContent(t,o)}}else{const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0;if(i){const i=e.internalProps.layoutMap,{headerObjects:o}=e.internalProps.layoutMap;let r;for(let e=0;e<o.length;e++){const i=o[e];if(i.define.componentId===t){r=i.id;break}}const n=i.getHeaderCellAdressById(r);return i.getCellRange(n.col,n.row)}const{columnObjects:r}=e.internalProps.layoutMap;for(let i=0;i<r.length;i++)if(r[i].define.componentId===t)return{start:{col:o+i,row:e.columnHeaderLevelCount},end:{col:o+i,row:e.rowCount-1}};return{start:{col:0,row:0},end:{col:e.colCount-1,row:e.rowCount-1}}}(t,i,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)i.scenegraph.updateCellContent(t,e)}i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:o}=this.table.getHeaderDefine(t,e);return null!==(i=this.headerCustomLayoutFuncCache.get(o))&&void 0!==i?i:_C}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||_C}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:r}=o;i=this.headerReactRemoveGraphicCache.get(r)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:r}=o;i=this.reactRemoveGraphicCache.get(r)}i&&i(t,e)}clearCache(){this.removeAllContainer()}}function RC(t){const e={abstractPos:{x:t.viewport.x,y:t.viewport.y}},i=BC(t.target);return i&&(e.eventArgs={col:i.col,row:i.row,event:t,targetCell:i,mergeInfo:MC(i),target:t.target}),e}function BC(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}function MC(t){if(J(t.mergeStartCol)&&J(t.mergeStartRow)&&J(t.mergeEndCol)&&J(t.mergeEndRow))return{colStart:t.mergeStartCol,colEnd:t.mergeEndCol,rowStart:t.mergeStartRow,rowEnd:t.mergeEndRow}}const TC=/radio-\d+-\d+-(\d+)/,PC="_custom_",kC="custom-container",LC=PC+"_0";function HC(t,e,i,o,r,n,s,a,l,h,d){var c;let u,g,p,f,v=!0,b=!1;if("react-custom-layout"===t&&(t=(null===(c=d.reactCustomLayout)||void 0===c?void 0:c.getCustomLayoutFunc(i,o))||_C),"function"==typeof t){const e=t({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:r,bottom:n,width:r,height:n},table:d});e.rootContainer&&(e.rootContainer=FC(e.rootContainer)),e.rootContainer instanceof zn&&(f=e.rootContainer,f.name=kC,f.col=i,f.row=o),v=e.renderDefault,b=e.enableCellPadding}else if("function"==typeof e){const t=e({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:r,bottom:n,width:r,height:n},table:d});t&&(p=t.elements,v=t.renderDefault,u=t.expectedWidth,g=t.expectedHeight)}else e&&(u=e.expectedWidth,g=e.expectedHeight,p=e.elements,v=e.renderDefault);return p&&(f=function(t,e,i,o){const r=new zn({x:0,y:0,width:e,height:i,fill:!1,stroke:!1,pickable:!1});return r.name=kC,function(t,e,i,o){const r=[],n=[0,0,0,0];for(let s=0;s<t.length;s++){const a=t[s],l=Object.assign({},a);for(const t in l)l.hasOwnProperty(t)&&q(l[t])&&(l[t]=l[t](o));const h=l;J(h.x)&&(h.x=ot(h.x)?EC(h.x,e-n[1]):Number(h.x)),J(h.y)&&(h.y=ot(h.y)?EC(h.y,i-n[2]):Number(h.y)),"width"in l&&(l.width=ot(l.width)?EC(l.width,e-n[1]):Number(l.width)),"height"in l&&(l.height=ot(l.height)?EC(l.height,i-n[2]):Number(l.height)),"radius"in l&&(l.radius=ot(l.radius)?EC(l.radius,Math.min(e-n[1],i-n[2])):Number(l.radius)),"hover"in l&&(l.hover.x=ot(l.hover.x)?EC(l.hover.x,e-n[1]):Number(l.hover.x),l.hover.y=ot(l.hover.y)?EC(l.hover.y,i-n[2]):Number(l.hover.y),l.hover.width=ot(l.hover.width)?EC(l.hover.width,e-n[1]):Number(l.hover.width),l.hover.height=ot(l.hover.height)?EC(l.hover.height,i-n[2]):Number(l.hover.height),l.hover.x+=0,l.hover.y+=0),h.x=h.x+0,h.y=h.y+0,r.push(l)}return r}(t,e,i,o).forEach((t=>{var e,i,o,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R,B,M,T;switch(t.clickable&&(t.pickable=t.clickable),t.type){case"arc":const P=wd({x:t.x,y:t.y,dx:null!==(e=t.dx)&&void 0!==e?e:0,dy:null!==(i=t.dy)&&void 0!==i?i:0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.pickable,cursor:t.cursor});P.name=t.name,r.appendChild(P);break;case"text":if(t.background){const e=null!==(n=null===(o=t.background)||void 0===o?void 0:o.expandX)&&void 0!==n?n:0,i=null!==(a=null===(s=t.background)||void 0===s?void 0:s.expandY)&&void 0!==a?a:0,p=ad({x:t.x-e,y:t.y-i,dx:null!==(l=t.dx)&&void 0!==l?l:0,dy:null!==(h=t.dy)&&void 0!==h?h:0,width:t.width+2*e,height:t.height+2*i,cornerRadius:null!==(c=null===(d=t.background)||void 0===d?void 0:d.cornerRadius)&&void 0!==c?c:0,fill:null!==(g=null===(u=t.background)||void 0===u?void 0:u.fill)&&void 0!==g?g:"#888"});r.appendChild(p)}const k=new Gl(Object.assign({pickable:!!t.pickable,fill:null!==(p=t.color)&&void 0!==p?p:t.fill},t));k.name=t.name,r.appendChild(k);break;case"rect":const L=ad({x:t.x,y:t.y,dx:null!==(f=t.dx)&&void 0!==f?f:0,dy:null!==(v=t.dy)&&void 0!==v?v:0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});L.name=t.name,r.appendChild(L);break;case"circle":const H=Dl({x:t.x,y:t.y,dx:null!==(b=t.dx)&&void 0!==b?b:0,dy:null!==(m=t.dy)&&void 0!==m?m:0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});H.name=t.name,r.appendChild(H);break;case"icon":const E=new SC({x:t.x,y:t.y,dx:null!==(C=t.dx)&&void 0!==C?C:0,dy:null!==(y=t.dy)&&void 0!==y?y:0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?null!==(w=t.hover.width)&&void 0!==w?w:t.width:void 0,backgroundHeight:t.hover?null!==(x=t.hover.width)&&void 0!==x?x:t.width:void 0,backgroundColor:t.hover?null!==(S=t.hover.bgColor)&&void 0!==S?S:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor});E.name=t.name,E.role="icon-custom",r.appendChild(E);break;case"image":const z=new SC({x:t.x,y:t.y,dx:null!==(_=t.dx)&&void 0!==_?_:0,dy:null!==(A=t.dy)&&void 0!==A?A:0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?null!==(R=t.hover.width)&&void 0!==R?R:t.width:void 0,backgroundHeight:t.hover?null!==(B=t.hover.width)&&void 0!==B?B:t.width:void 0,backgroundColor:t.hover?null!==(M=t.hover.bgColor)&&void 0!==M?M:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor,shape:t.shape});z.name=t.name,z.role="image-custom",r.appendChild(z);break;case"line":const F=rd({points:t.points,lineWidth:null!==(T=t.lineWidth)&&void 0!==T?T:1,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});F.name=t.name,r.appendChild(F)}})),r}(p,s?u:r,a?g:n,d.getCellValue(i,o))),b&&f.setAttributes({x:l[3],y:l[0],width:r-l[1]-l[3],height:n-l[0]-l[2]}),zC(f,r,n),!h||h.start.col===h.end.col&&h.start.row===h.end.row||IC(f,i,o,0),{elementsGroup:f,renderDefault:v}}function EC(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}function zC(t,e,i){t&&t.forEachChildren((t=>{var o,r;t&&(Q(t.attribute.width)&&t.attribute.width.percent&&t.setAttribute("width",Math.max(0,t.attribute.width.percent/100*e+(null!==(o=t.attribute.width.delta)&&void 0!==o?o:0))),t.attribute.width<0&&t.setAttribute("width",0),Q(t.attribute.height)&&t.attribute.height.percent&&t.setAttribute("height",Math.max(0,t.attribute.height.percent/100*i+(null!==(r=t.attribute.height.delta)&&void 0!==r?r:0))),t.attribute.height<0&&t.setAttribute("height",0),"group"===t.type&&zC(t,t.attribute.width,t.attribute.height))}))}function FC(t){if(!t||!J(t.$$typeof)&&!J(t.vtype))return t;const e=t.type,{attribute:i,children:o,stateProxy:r}=t.props,n=e({attribute:i});return function(t,e){let i=!1;switch(t.type){case"richtext":case"rich/image":break;default:i=!0}i&&Object.keys(e).forEach((i=>{const o=Ru[i];o&&t.on(o,e[i])}))}(n,t.props),r&&(n.stateProxy=r),n.id=i.id,n.name=i.name,rt(o)?o.forEach((t=>{const e=FC(t);e&&e.type&&n.add(e)})):o&&n.add(FC(o)),n}function IC(t,e,i,o,r){t&&(t.name=`${PC}${null!=r?r:""}_${o}`,t.onBeforeAttributeUpdate=OC,"group"===t.type&&t.childrenCount&&t.forEachChildren(((t,n)=>{IC(t,e,i,n,(null!=r?r:"")+"_"+o)})))}function OC(t,e){const i=this;if(i.skipMergeUpdate)return;const o=BC(i);if(!o||!o.stage)return;const r=o.stage.table;i.skipAttributeUpdate=!0;const{mergeStartCol:n,mergeEndCol:s,mergeStartRow:a,mergeEndRow:l}=o;if(J(n)&&J(s)&&J(a)&&J(l)&&(n!==s||a!==l)){for(let e=n;e<=s;e++)for(let n=a;n<=l;n++){if(e===o.col&&n===o.row)continue;const s=r.scenegraph.highPerformanceGetCell(e,n);if("cell"===s.role){const e=s.getChildByName(i.name,!0);if(!e||e.skipAttributeUpdate)continue;for(const i in t)t[i]!==e.attribute[i]&&"dx"!==i&&"dy"!==i&&e.setAttribute(i,t[i])}}i.skipAttributeUpdate=void 0}}const DC={};class WC{static setIcon(t,e){this.cache.set(t,e)}static getIcon(t){return this.cache.has(t)?this.cache.get(t):null}static hasIcon(t){return this.cache.has(t)}static clear(t){return this.cache.delete(t)}static clearAll(){this.cache=new Map}}WC.cache=new Map;const NC={get sort_downward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#416EFF"/> </svg>',width:16,height:16,funcType:Pv.sort,name:"sort_downward",positionType:Tv.contentRight,marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_upward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#416EFF"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:Pv.sort,positionType:Tv.contentRight,name:"sort_upward",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_normal(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:Pv.sort,positionType:Tv.contentRight,name:"sort_normal",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get freeze(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M17.1313 8.42047C17.1932 8.48238 17.2423 8.55587 17.2759 8.63676C17.3094 8.71764 17.3266 8.80434 17.3266 8.89189C17.3266 8.97944 17.3094 9.06613 17.2759 9.14702C17.2423 9.2279 17.1932 9.3014 17.1313 9.3633L13.3843 13.1103C13.7007 14.3048 13.5305 15.4443 12.8388 16.2395C12.8104 16.2781 12.7778 16.3136 12.7417 16.3451L12.712 16.3755C12.6501 16.4374 12.5766 16.4865 12.4957 16.52C12.4148 16.5535 12.3281 16.5707 12.2406 16.5707C12.153 16.5707 12.0663 16.5535 11.9854 16.52C11.9046 16.4865 11.8311 16.4374 11.7692 16.3755L9.17633 13.7826L6.05316 16.9058L5.11983 17.0925C5.09291 17.0979 5.06508 17.0965 5.03881 17.0886C5.01254 17.0806 4.98863 17.0663 4.96923 17.0469C4.94982 17.0275 4.9355 17.0036 4.92755 16.9773C4.9196 16.951 4.91827 16.9232 4.92366 16.8963L5.11033 15.963L8.23333 12.8396L5.64066 10.2471C5.57875 10.1852 5.52964 10.1117 5.49614 10.0309C5.46263 9.94997 5.44539 9.86327 5.44539 9.77572C5.44539 9.68817 5.46263 9.60148 5.49614 9.52059C5.52964 9.43971 5.57875 9.36621 5.64066 9.3043C5.65066 9.2943 5.66066 9.2843 5.67099 9.27464C5.70266 9.2383 5.73833 9.20547 5.77766 9.17664C6.57283 8.48564 7.71199 8.31564 8.90599 8.63197L12.6528 4.88497C12.7147 4.82306 12.7882 4.77395 12.8691 4.74045C12.95 4.70694 13.0367 4.6897 13.1242 4.6897C13.2118 4.6897 13.2985 4.70694 13.3794 4.74045C13.4603 4.77395 13.5338 4.82306 13.5957 4.88497L17.1312 8.42047H17.1313ZM15.7172 8.8918L13.1243 6.29914L9.56483 9.8588C9.47574 9.94788 9.36323 10.0099 9.24034 10.0376C9.11746 10.0654 8.98922 10.0578 8.87049 10.0156C8.22783 9.78764 7.63899 9.7553 7.17749 9.89814L12.1182 14.8388C12.261 14.3771 12.2287 13.7885 12.0007 13.146C11.9585 13.0272 11.9509 12.899 11.9787 12.7761C12.0064 12.6532 12.0684 12.5407 12.1575 12.4516L15.7172 8.89164V8.8918Z" fill="#282F38" fill-opacity="0.2"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>',width:22,height:22,name:"freeze",funcType:Pv.frozen,positionType:Tv.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozen(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#282F38" fill-opacity="0.35"/></svg>',width:22,height:22,name:"frozen",funcType:Pv.frozen,positionType:Tv.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozenCurrent(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#416EFF"/></svg>',width:22,height:22,funcType:Pv.frozen,positionType:Tv.right,name:"frozenCurrent",marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get dropdownIcon(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>',width:24,height:24,funcType:Pv.dropDown,positionType:Tv.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)",image:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>'},cursor:"pointer",visibleTime:"mouseenter_cell"}},get play(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01" /><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /><path d="M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /></svg>',width:24,height:24,funcType:Pv.play,positionType:Tv.right,name:"play",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get damage_pic(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10V38C5 39.1046 5.89543 40 7 40H14H18L15 29L22 27L21 20L29 16L27 13L30 8H7C5.89543 8 5 8.89543 5 10Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 38V10C43 8.89543 42.1046 8 41 8H38L34 14L37 19L28 23L29 31L22 33L24 40H41C42.1046 40 43 39.1046 43 38Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',width:24,height:24,funcType:Pv.damagePic,positionType:Tv.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:Tv.left}},get expand(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:Pv.expand,name:"expand",positionType:Tv.contentLeft,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get collapse(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 7.60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:Pv.collapse,name:"collapse",positionType:Tv.contentLeft,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get drillDown(){return{name:"drillDown",type:"svg",positionType:Tv.absolute,funcType:Pv.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:Tv.absolute,funcType:Pv.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:'<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5172"></path></svg>',width:20,height:20,funcType:Pv.dragReorder,positionType:Tv.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function GC(){return fb(NC,DC)}class jC extends zn{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren((e=>e.name===t&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const o=e.getChildByName(t,!0);if(o)return i=o,!0}return!1})),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.width)&&void 0!==t?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.height)&&void 0!==t?t:0)}setDeltaWidth(t){var e;0!==t&&(this.setAttribute("width",(null!==(e=this.attribute.width)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;0!==t&&(this.setAttribute("height",(null!==(e=this.attribute.height)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){0!==t&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){0!==t&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"border-rect";if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){let i=this._lastChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(0===this.childrenCount||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}tryUpdateAABBBounds(){if("cell"===this.role){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),function(t,e){t.stage&&t.stage.dirtyBounds&&t.stage.renderCount&&(t.isContainer&&!e||t.stage.dirty(t.globalAABBBounds))}(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if("cell"===this.role){const t=this.attribute,{x:e,y:i,width:o,height:r}=t;return this._AABBBounds.setValue(e,i,e+o,i+r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._AABBBounds}return"body"===this.role||"row-header"===this.role||"col-header"===this.role||"right-frozen"===this.role||"bottom-frozen"===this.role||"corner-header"===this.role||"corner-right-top-header"===this.role||"corner-right-bottom-header"===this.role||"corner-left-bottom-header"===this.role?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}}function UC(t,e,i,o){const r=t/e;let n,s;return r>i/o?(n=i,s=n/r):(s=o,n=s*r),{width:n,height:s}}function VC(t,e,i,o,r){const n=e&&J(e[t])?e[t]:void 0;return"function"==typeof n?n({col:i,row:o,table:r,value:r.getCellValue(i,o),dataValue:r.getCellOriginValue(i,o),cellHeaderPaths:r.getCellHeaderPaths(i,o)}):n}function XC(t,e,i,o){var r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w;let x=null!==(n=null===(r=null==i?void 0:i.group)||void 0===r?void 0:r.strokeArrayWidth)&&void 0!==n?n:void 0;return o.theme.cellInnerBorder||(0===t&&(x=null!=x?x:[null===(s=null==i?void 0:i.group)||void 0===s?void 0:s.lineWidth,null===(a=null==i?void 0:i.group)||void 0===a?void 0:a.lineWidth,null===(l=null==i?void 0:i.group)||void 0===l?void 0:l.lineWidth,null===(h=null==i?void 0:i.group)||void 0===h?void 0:h.lineWidth],x[3]=0),t===o.colCount-1&&(x=null!=x?x:[null===(d=null==i?void 0:i.group)||void 0===d?void 0:d.lineWidth,null===(c=null==i?void 0:i.group)||void 0===c?void 0:c.lineWidth,null===(u=null==i?void 0:i.group)||void 0===u?void 0:u.lineWidth,null===(g=null==i?void 0:i.group)||void 0===g?void 0:g.lineWidth],x[1]=0),0===e&&(x=null!=x?x:[null===(p=null==i?void 0:i.group)||void 0===p?void 0:p.lineWidth,null===(f=null==i?void 0:i.group)||void 0===f?void 0:f.lineWidth,null===(v=null==i?void 0:i.group)||void 0===v?void 0:v.lineWidth,null===(b=null==i?void 0:i.group)||void 0===b?void 0:b.lineWidth],x[0]=0),e===o.rowCount-1&&(x=null!=x?x:[null===(m=null==i?void 0:i.group)||void 0===m?void 0:m.lineWidth,null===(C=null==i?void 0:i.group)||void 0===C?void 0:C.lineWidth,null===(y=null==i?void 0:i.group)||void 0===y?void 0:y.lineWidth,null===(w=null==i?void 0:i.group)||void 0===w?void 0:w.lineWidth],x[2]=0)),x}class YC extends jC{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new jC({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new jC({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new jC({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof Gl&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}else{const i=this._cellWidth-t-e;this.updateCenterLayout(i);const o=this._centerGroup.width;this._cellWidth=t+e+o,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,r=this._centerGroup.height;this._cellHeight=Math.max(i,o,r),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof SC&&(e-=t.AABBBounds.width())}));const i=this._centerGroup.getChildByName("text");i instanceof bd?i.setAttribute("width",e):i instanceof Gl&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",o),o+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth,this.layout()}}function $C(t,e,i){var o,r,n,s,a;let l=0;const h=i.internalProps.layoutMap;if(h.isHeader(t,e)){const n=h.getHeader(t,e);J(null==n?void 0:n.hierarchyLevel)&&(l=(null!==(o=n.hierarchyLevel)&&void 0!==o?o:0)*(null!==(r=h.rowHierarchyIndent)&&void 0!==r?r:0),h.rowHierarchyTextStartAlignment&&!i.internalProps.headerHelper.getHierarchyIcon(t,e)&&(l+=i.internalProps.headerHelper.getHierarchyIconWidth()))}else if(i.options.groupBy||(null===(n=i.getBodyColumnDefine(t,e))||void 0===n?void 0:n.tree)){const o=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),r=null!==(s=i.dataSource.getGroupLength())&&void 0!==s?s:0;let n=rt(o)?o.length-1:0;r>0&&n===r&&(n=0),l=Array.isArray(o)&&i.getHierarchyState(t,e)!==Rv.none?n*(null!==(a=h.hierarchyIndent)&&void 0!==a?a:0):0,h.hierarchyTextStartAlignment&&!i.internalProps.bodyHelper.getHierarchyIcon(t,e)&&(l+=i.internalProps.bodyHelper.getHierarchyIconWidth())}return l}function KC(t,e){var i,o;let r,n=!1;for(ot(t)&&t.length>(e.options.maxCharactersNumber||200)&&(t=t.slice(0,e.options.maxCharactersNumber||200),t+="…",n=!0),r=e.internalProps.enableLineBreak||(null===(i=e.options.customConfig)||void 0===i?void 0:i.multilinesForXTable)?Qv(t).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n")||[]:[Qv(t)];r.length&&r.length>1&&!r[r.length-1];)r.pop();if((null===(o=e.options.customConfig)||void 0===o?void 0:o.multilinesForXTable)&&!e.internalProps.autoWrapText)for(;r.length&&r.length>1&&!r[0];)r.shift();return{text:r,moreThanMaxCharacters:n}}function qC(t,e,i,o,r,n,s){var a,l,h,d,c,u;const g={};"image"===t.type?g.image=t.src:("svg"===t.type||"svg"in t)&&(g.image=t.svg),g.width=t.width,g.height=t.height,g.visibleTime=null!==(a=t.visibleTime)&&void 0!==a?a:"always",g.funcType=t.funcType,g.interactive=t.interactive;let p=0;if(s&&0!==(null==s?void 0:s.addedHierarchyOffset)||!at(i)||!at(o)||!n||t.funcType!==Pv.collapse&&t.funcType!==Pv.expand&&t.positionType!==Tv.contentLeft&&t.positionType!==Tv.contentRight||(p=r?$C(r.start.col,r.start.row,n):$C(i,o,n),s&&(s.addedHierarchyOffset=1)),g.marginLeft=(null!==(l=t.marginLeft)&&void 0!==l?l:0)+p,g.marginRight=null!==(h=t.marginRight)&&void 0!==h?h:0,!1===t.interactive&&(g.pickable=!1),t.hover&&(g.backgroundWidth=null!==(d=t.hover.width)&&void 0!==d?d:t.width,g.backgroundHeight=null!==(c=t.hover.width)&&void 0!==c?c:t.width,g.backgroundColor=null!==(u=t.hover.bgColor)&&void 0!==u?u:"rgba(22,44,66,0.2)",g.hoverImage=t.hover.image),t.cursor&&(g.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(g.shape=t.shape),e)return e.setAttributes(g),e.loadImage(g.image),e;const f=new SC(g);return f.tooltip=t.tooltip,f}function ZC(t){var e,i,o,r,n,s;const a={};return"image"===t.type?a.image=t.src:("svg"===t.type||"svg"in t)&&(a.image=t.svg),a.visibleTime=null!==(e=t.visibleTime)&&void 0!==e?e:"always",a.funcType=t.funcType,a.id=t.name,a.width=t.width,a.height=t.height,(t.marginRight||t.marginLeft)&&(a.margin=[0,null!==(i=t.marginRight)&&void 0!==i?i:0,0,null!==(o=t.marginLeft)&&void 0!==o?o:0]),t.hover&&(a.backgroundWidth=null!==(r=t.hover.width)&&void 0!==r?r:t.width,a.backgroundHeight=null!==(n=t.hover.height)&&void 0!==n?n:t.height,a.backgroundShowMode="hover",a.hoverImage=t.hover.image,a.backgroundStroke=!1,a.backgroundFill=null!==(s=t.hover.bgColor)&&void 0!==s?s:"rgba(22,44,66,0.2)"),t.cursor&&(a.cursor=t.cursor),a.tooltip=t.tooltip,a}function JC(t,e,i,o,r,n,s,a,l){var h,d,c,u;lt(t.contentWidth)&&(o=e-(null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width));let g,p=0,f=0,v=0,b=0;t.forEachChildren((t=>{var e,i,o,r;"icon-left"===t.role?(p+=t.AABBBounds.width()+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)+(null!==(i=t.attribute.marginRight)&&void 0!==i?i:0),f=Math.max(f,t.AABBBounds.height())):"icon-right"===t.role&&(v+=t.AABBBounds.width()+(null!==(o=t.attribute.marginLeft)&&void 0!==o?o:0)+(null!==(r=t.attribute.marginRight)&&void 0!==r?r:0),b=Math.max(b,t.AABBBounds.height()))}));const m=t.getChildByName("text"),C=t.getChildByName("content");let y;m instanceof Gl?(g=m.AABBBounds.height(),m.setAttribute("maxLineWidth",e-p-v-(n[1]+n[3])-(null!==(d=m.attribute.dx)&&void 0!==d?d:0)-(null!==(c=l.table.theme._contentOffset)&&void 0!==c?c:0)),y=m.AABBBounds.height()):m instanceof bd?(g=m.AABBBounds.height(),m.setAttribute("width",e-p-v-(n[1]+n[3])),y=m.AABBBounds.height()):C&&(g=C.AABBBounds.height(),C.updateWidth(e-p-v-(n[1]+n[3])),y=C.AABBBounds.height());const w=Math.round(Math.max(f,b,g)+n[0]+n[2]);if(t.forEachChildren((i=>{var r;if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("content"===i.name||"text"===i.name&&"richtext"!==i.type){const t=null!==(r=i.attribute.textAlign)&&void 0!==r?r:s;"center"===t?i.setAttribute("x",n[3]+p+(e-(n[1]+n[3])-p-v)/2):"right"===t&&i.setAttribute("x",n[3]+e-(n[1]+n[3])-v)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),r){let e=Math.max(f,y,b);if(function(t,e,i,o){const r=t.table,n=lm(r,e.col,e.row);if(n&&n.end.row-n.start.row){o/=n.end.row-n.start.row+1,i/=n.end.row-n.start.row+1;for(let t=n.start.row;t<=n.end.row;t++){const e=r.getRowHeight(t);if(e===o&&i!==e)return!0;if(i>e)return!0}}else{const t=r.getRowHeight(e.row);if(t===o&&i!==t)return!0;if(i>t)return!0}return!1}(l,t,Math.round(e+n[0]+n[2]),w))return!0;e=(null!==(u=t.contentHeight)&&void 0!==u?u:i)-(n[0]+n[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==kC&&("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",n[0]+(e-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",n[0]+e-t.AABBBounds.height()):t.setAttribute("y",n[0]))}))}else"middle"!==a&&"bottom"!==a||t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==kC&&("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",(i-n[2]+n[0]-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",i-t.AABBBounds.height()-n[2]):t.setAttribute("y",n[0]))}));return!1}function QC(t,e,i,o,r,n,s){const a=e-Math.floor(r[0]+r[2]),l=t.getChildByName("text");l instanceof Gl&&!o?l.setAttributes({heightLimit:a}):l instanceof bd&&!o?l.setAttributes({height:a}):t.getChildByName("content")&&t.getChildByName("content").updateHeight(a),t.forEachChildren((t=>{t.setAttribute("dy",0),"rect"===t.type||"chart"===t.type||t.name===kC||("mark"===t.name?t.setAttribute("y",0):"middle"===s?t.setAttribute("y",r[0]+(a-t.AABBBounds.height())/2):"bottom"===s?t.setAttribute("y",r[0]+a-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}function ty(t,e,i,o){const r=[],n=[],s=[],a=[],l=[],h=[],d=[],c=[];let u=0,g=0,p=0,f=0,v=0,b=0;return t.forEach((t=>{switch(t.positionType){case Tv.left:r.push(t);break;case Tv.right:n.push(t);break;case Tv.contentLeft:s.push(t);break;case Tv.contentRight:a.push(t);break;case Tv.absoluteRight:c.push(t);break;case Tv.inlineFront:l.push(t);break;case Tv.inlineEnd:h.push(t)}})),r.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-left",a.name=t.name,a.setAttribute("x",u+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),u+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),g=Math.max(g,a.AABBBounds.height()),e.appendChild(a)})),n.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-right",a.name=t.name,a.setAttribute("x",p+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),p+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),f=Math.max(f,a.AABBBounds.height()),e.appendChild(a)})),d.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-absolute-left",a.name=t.name,a.setAttribute("x",v+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),v+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(a)})),c.forEach((t=>{var r,n,s;const a=qC(t,void 0,e.col,e.row,i,o);a.role="icon-absolute-right",a.name=t.name,a.setAttribute("x",b+(null!==(r=a.attribute.marginLeft)&&void 0!==r?r:0)),b+=a.AABBBounds.width()+(null!==(n=a.attribute.marginLeft)&&void 0!==n?n:0)+(null!==(s=a.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(a)})),{leftIcons:r,rightIcons:n,contentLeftIcons:s,contentRightIcons:a,inlineFrontIcons:l,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:c,leftIconWidth:u,leftIconHeight:g,rightIconWidth:p,rightIconHeight:f,absoluteLeftIconWidth:v,absoluteRightIconWidth:b}}function ey(t,e,i,o,r,n){var s,a,l,h,d,c,u,g,p,f,v,b;const m=t.getChildByName("image");if(!m)return;const C="string"!=typeof m.attribute.image&&m.attribute.image||(null===(s=m.resources)||void 0===s?void 0:s.get(m.attribute.image).data);if(!C)return;const y=n._getCellStyle(e,i),w=null!==(a=VC("textAlign",y,e,i,n))&&void 0!==a?a:"left",x=null!==(l=VC("textBaseline",y,e,i,n))&&void 0!==l?l:"middle";let S;S=(null===(h=n.options.customConfig)||void 0===h?void 0:h.imageMargin)?Dm(null===(d=n.options.customConfig)||void 0===d?void 0:d.imageMargin):null!==(c=Dm(VC("padding",y,e,i,n)))&&void 0!==c?c:[0,0,0,0];const{width:_,height:A,isMerge:R}=iy(t,n),B=null!==(u=t.mergeStartCol)&&void 0!==u?u:t.col,M=null!==(g=t.mergeStartRow)&&void 0!==g?g:t.row,T=null!==(p=t.mergeEndCol)&&void 0!==p?p:t.col,P=null!==(f=t.mergeEndCol)&&void 0!==f?f:t.row,k=null!==(v=t._cellLeftIconWidth)&&void 0!==v?v:0,L=null!==(b=t._cellRightIconWidth)&&void 0!==b?b:0;if(m.keepAspectRatio){const{width:t,height:e}=UC(C.width||C.videoWidth,C.height||C.videoHeight,_-(S[1]+S[3]),A-(S[0]+S[2])),i=function(t,e,i,o,r,n){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"left",a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"middle",l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[0,0,0,0],h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,c=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,u=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0;const g=t+i,p=e+o;let f=t+l[3]+h;"right"===s||"end"===s?f=g-r-l[1]-d:"center"===s&&(f=t+(i-r+h-d)/2);let v=e+l[0]+c;return"bottom"===a||"alphabetic"===a||"ideographic"===a?v=p-n-l[2]-u:"middle"===a&&(v=e+(o-n+c-u)/2),{x:f,y:v}}(0,0,_,A,t,e,w,x,S);for(let o=B;o<=T;o++)for(let r=M;r<=P;r++){const s=n.scenegraph.getCell(o,r).getChildByName("image");null==s||s.setAttributes({x:i.x,y:i.y,width:t,height:e})}}else for(let t=B;t<=T;t++)for(let e=M;e<=P;e++){const i=n.scenegraph.getCell(t,e).getChildByName("image");null==i||i.setAttributes({x:k+S[3],y:S[0],width:_-S[1]-S[3]-L-k,height:A-S[0]-S[2]})}if(t.getChildByName("play-icon")){const e=0,i=0,{width:o,height:r}=iy(t,n),s=Math.floor(Math.min(o-S[1]-S[3],r-S[2]-S[0])/2),a=e+(o>m.attribute.width?m.attribute.x-e+m.attribute.width/2:o/2),l=i+(r>m.attribute.height?m.attribute.y-i+m.attribute.height/2:r/2);for(let t=B;t<=T;t++)for(let e=M;e<=P;e++)n.scenegraph.getCell(t,e).getChildByName("play-icon").setAttributes({x:a-s/2,y:l-s/2,width:s,height:s})}t.forEachChildren((t=>{"icon-left"===t.role||("icon-right"===t.role||"icon-absolute-right"===t.role)&&t.setAttribute("x",t.attribute.x+o)})),t.forEachChildren((t=>{("rect"===t.type||t.role&&t.role.startsWith("icon"))&&("middle"===x?t.setAttribute("y",S[0]+(A-S[0]-S[2]-t.AABBBounds.height())/2):"bottom"===x?t.setAttribute("y",S[0]+A-S[0]-S[2]-t.AABBBounds.height()):t.setAttribute("y",S[0]))})),R&&function(t,e,i,o,r){for(let n=t;n<=e;n++)for(let t=i;t<=o;t++){const e=r.scenegraph.getCell(n,t);if(e){const i=e.getChildByName("image");i&&i.setAttributes({dx:-r.getColsWidth(e.mergeStartCol,n-1),dy:-r.getRowsHeight(e.mergeStartRow,t-1)});const o=e.getChildByName("play-icon");o&&o.setAttributes({dx:-r.getColsWidth(e.mergeStartCol,n-1),dy:-r.getRowsHeight(e.mergeStartRow,t-1)})}}}(t.mergeStartCol,t.mergeEndCol,t.mergeStartRow,t.mergeEndRow,n)}function iy(t,e){return"cell"===t.role&&J(t.mergeStartCol)&&J(t.mergeEndCol)&&J(t.mergeStartRow)&&J(t.mergeEndRow)?{width:e.getColsWidth(t.mergeStartCol,t.mergeEndCol),height:e.getRowsHeight(t.mergeStartRow,t.mergeEndRow),isMerge:!0}:{width:t.attribute.width,height:t.attribute.height,isMerge:!1}}function oy(t,e,i){t.then((()=>{i(),e.scenegraph.updateNextFrame()})).catch((t=>{}))}function ry(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b){var m;let C,y=!1;if(Cb(e)&&(e=o.getCellValue(r,n),y=!0),"text"===t||"link"===t||b){if("link"===t){const s=e,a=o._getCellStyle(r,n);"link"===t&&("templateLink"in i&&i.templateLink||!("linkDetect"in i)||!i.linkDetect||Xb.test(s))&&(f?(f.text.fill=VC("linkColor",a,r,n,o),f.group.cursor="pointer"):f={text:{fill:VC("linkColor",a,r,n,o)},group:{cursor:"pointer"}})}let m,w=!0;if(b)m=b.elementsGroup,w=b.renderDefault;else{let t,e;if("body"!==o.getCellLocation(r,n)?(t=null==i?void 0:i.headerCustomRender,e=null==i?void 0:i.headerCustomLayout):(t=(null==i?void 0:i.customRender)||o.customRender,e=null==i?void 0:i.customLayout),e||t){const i=HC(e,t,r,n,a,l,!1,o.isAutoRowHeight(n),c,v,o);m=i.elementsGroup,w=i.renderDefault}}C=hm.getFunction("createTextCellGroup")(o,e,h,0,d,r,n,s,a,l,c,u,g,p,m,w,f,v,y);const x=o.internalProps.layoutMap.getAxisConfigInPivotChart(r,n);if(x){const t=new(hm.getComponent("axis"))(x,C.attribute.width,C.attribute.height,c,o);C.clear(),C.appendChild(t.component),t.overlap()}else o.internalProps.layoutMap.isEmpty(r,n)?(C.setAttributes({fill:!1,stroke:!1}),C.clear()):o.internalProps.layoutMap.isAxisCell(r,n)&&C.clear()}else if("image"===t)C=hm.getFunction("createImageCellGroup")(h,0,d,r,n,a,l,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,y);else if("video"===t)C=hm.getFunction("createVideoCellGroup")(h,0,d,r,n,a,l,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,y);else if("chart"===t){const t=o.internalProps.layoutMap.getChartInstance(r,n);C=hm.getFunction("createChartCellGroup")(null,h,0,d,r,n,a,l,c,e,i.chartModule,o.internalProps.layoutMap.getChartSpec(r,n),t,null!==(m=o.internalProps.layoutMap.getChartDataId(r,n))&&void 0!==m?m:"data",o,f,o.internalProps.layoutMap.isShareChartSpec(r,n),y)}else if("progressbar"===t){const t=o._getCellStyle(r,n),p=o.getCellOriginValue(r,n);C=hm.getFunction("createTextCellGroup")(o,e,h,0,d,r,n,s,a,l,c,u,g,!1,null,!0,f,v,y);const b=hm.getFunction("createProgressBarCell")(i,t,s,e,p,r,n,c,o,v);C.firstChild?C.insertBefore(b,C.firstChild):C.appendChild(b)}else"sparkline"===t?C=hm.getFunction("createSparkLineCellGroup")(null,h,0,d,r,n,a,l,c,o,f,y):"checkbox"===t?C=hm.getFunction("createCheckboxCellGroup")(null,h,0,d,r,n,s,a,l,c,u,g,p,o,f,i,v,y):"radio"===t&&(C=hm.getFunction("createRadioCellGroup")(null,h,0,d,r,n,s,a,l,c,u,g,o,f,i));return C}function ny(t,e,i,o,r){var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y;const w=i.scenegraph.highPerformanceGetCell(t,e,!0),x=i.getCellLocation(t,e);let S,_,A,R,B,M=i.getCellValue(t,e);if(i.internalProps.customMergeCell){const o=i.getCustomMerge(t,e);if(o){const{range:r,text:n,style:s,customLayout:a,customRender:l}=o;_=r,S=_.start.col!==_.end.col||_.start.row!==_.end.row,M=n,R=s,R&&(A=wC(R,i,_.start.col,_.start.row,VC).theme,A.group.cornerRadius=xC(t,e,i)),(a||l)&&(B=HC(a,l,r.start.col,r.start.row,i.getColsWidth(r.start.col,r.end.col),i.getRowsHeight(r.start.row,r.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],_,i))}}let T=t,P=e;_&&(T=_.start.col,P=_.start.row);const k="body"!==x?i.getHeaderDefine(T,P):i.getBodyColumnDefine(T,P);let L="body"!==x||(null==k?void 0:k.dragOrder)||!!(null==k?void 0:k.icon)||!!(null==k?void 0:k.tree);_||!i.internalProps.enableTreeNodeMerge&&"body"===x&&!(null==k?void 0:k.mergeCell)||(_=i.getCellRange(t,e),S=_.start.col!==_.end.col||_.start.row!==_.end.row);let H=!1;if(i.internalProps.enableTreeNodeMerge&&S){const{vtableMergeName:t,vtableMerge:o}=i.getCellRawRecord(_.start.col,_.start.row);H=o,o&&(L=!0,i.options.groupTitleCustomLayout&&(B=HC(i.options.groupTitleCustomLayout,void 0,_.start.col,_.start.row,i.getColsWidth(_.start.col,_.end.col),i.getRowsHeight(_.start.row,_.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],_,i))),t&&(M=t)}const E=i._getCellStyle(_?_.start.col:t,_?_.start.row:e),z=null!==(n=E.autoWrapText)&&void 0!==n?n:i.internalProps.autoWrapText;if(A||(A=wC(E,i,S?_.start.col:t,S?_.start.row:e,VC).theme),A.group.cornerRadius=xC(t,e,i),!o&&!S&&!((null==k?void 0:k.customLayout)||(null==k?void 0:k.customRender)||(null==k?void 0:k.headerCustomLayout)||(null==k?void 0:k.headerCustomRender))&&function(t,e,i,o,r,n){var s;const a=n.getBodyColumnType(t,e),l=n.isAutoRowHeight(e),h=n.getCellValue(t,e);return!(n.isHeader(t,e)||"cell"!==i.role||"text"!==a||o||l||r||"text"!==(null===(s=i.firstChild)||void 0===s?void 0:s.type)||Cb(h))}(t,e,w,z,L,i)){const o=i.getColWidth(t),r=i.getRowHeight(e);w.setAttributes({width:o,height:r,lineWidth:null!==(a=null===(s=null==A?void 0:A.group)||void 0===s?void 0:s.lineWidth)&&void 0!==a?a:void 0,fill:null!==(h=null===(l=null==A?void 0:A.group)||void 0===l?void 0:l.fill)&&void 0!==h?h:void 0,stroke:null!==(c=null===(d=null==A?void 0:A.group)||void 0===d?void 0:d.stroke)&&void 0!==c?c:void 0,strokeArrayWidth:null!==(g=null===(u=null==A?void 0:A.group)||void 0===u?void 0:u.strokeArrayWidth)&&void 0!==g?g:void 0,strokeArrayColor:null!==(f=null===(p=null==A?void 0:A.group)||void 0===p?void 0:p.strokeArrayColor)&&void 0!==f?f:void 0,cursor:null!==(b=null===(v=null==A?void 0:A.group)||void 0===v?void 0:v.cursor)&&void 0!==b?b:void 0,cornerRadius:null!==(C=null===(m=null==A?void 0:A.group)||void 0===m?void 0:m.cornerRadius)&&void 0!==C?C:0,y:i.scenegraph.getCellGroupY(e)}),w.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));const n=w.getChildByName("text");if(n){const s=i.getCellValue(t,e),{text:a,moreThanMaxCharacters:l}=KC(s,i),h=$C(t,e,i),d=E.lineClamp,c=null!==(y=Dm(VC("padding",E,t,e,i)))&&void 0!==y?y:[0,0,0,0],u=A.text.textAlign;let g=0;g="center"===u?c[3]+(o-(c[1]+c[3]))/2:"right"===u?c[3]+o-(c[1]+c[3]):c[3];const p={text:1!==a.length||z?a:a[0],moreThanMaxCharacters:l,maxLineWidth:o-(c[1]+c[3]+h),textBaseline:"top",autoWrapText:z,lineClamp:d,wordBreak:"break-word",heightLimit:r-Math.floor(c[0]+c[2]),pickable:!1,dx:"left"===u?h:0,x:g};if(n.setAttributes(A.text?Object.assign({},A.text,p):p),n.attribute.text){const t=A.text.textBaseline,e=r-(c[0]+c[2]);let i=0;i="middle"===t?c[0]+(e-n.AABBBounds.height())/2:"bottom"===t?c[0]+e-n.AABBBounds.height():c[0],n.setAttributes({y:i})}}return w}if(!o&&"empty"===w.role)return;const F=H?"text":i.isHeader(t,e)?i._getHeaderLayoutMap(t,e).headerType:i.getBodyColumnType(t,e),I=A._vtable.padding,O=A.text.textAlign,D=A.text.textBaseline;let W,N,G;if(_?(N=i.getColsWidth(_.start.col,_.end.col),G=i.getRowsHeight(_.start.row,_.end.row)):(N=i.getColWidth(t),G=i.getRowHeight(e)),Cb(M)?(w.removeAllChild(),oy(M,i,sy.bind(null,F,M,k,i,t,e,N,G,w,I,O,D,L,o,A,_,B))):W=sy(F,M,k,i,t,e,N,G,w,I,O,D,L,o,A,_,B),S){const{width:t}=W.attribute,{height:e}=W.attribute;W.contentWidth=t,W.contentHeight=e,r?function(t,e,i,o,r,n,s,a){const{col:l,row:h}=a;t.start.row!==t.end.row&&a.contentHeight!==i&&QC(a,i,0,s.isAutoRowHeight(h),o,0,n),t.start.col!==t.end.col&&a.contentWidth!==e&&JC(a,e,i,0,s.isAutoRowHeight(h),o,r,n,s.scenegraph),a.contentWidth=e,a.contentHeight=i;const d=s.getRowHeight(h);ly(a,s.getColWidth(l),d,t,s)}(_,N,G,I,O,D,i,W):ay(_,N,G,I,O,D,i)}return W}function sy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v){var b,m;if(Cb(e)&&(e=o.getCellValue(r,n)),!g&&(l.row!==n||l.col!==r))return null;if(!g&&l.parent&&o.reactCustomLayout){const t=l.getChildByName("custom-container");if(t){const{col:e,row:i}=t;o.reactCustomLayout.removeCustomCell(e,i)}}const C=ry(t,e,i,o,r,n,o.getColWidth(r),s,a,g?o.scenegraph.getColGroup(r):l.parent,g?0:o.scenegraph.getCellGroupY(n),h,d,c,u,p,f,v);return!g&&l.parent&&(l.parent.insertAfter(C,l),l.parent.removeChild(l),(null===(b=o.scenegraph)||void 0===b?void 0:b.proxy.cellCache.get(r))&&(null===(m=o.scenegraph)||void 0===m||m.proxy.cellCache.set(r,C))),C}function ay(t,e,i,o,r,n,s){for(let a=t.start.col;a<=t.end.col;a++)for(let l=t.start.row;l<=t.end.row;l++){const h=s.scenegraph.highPerformanceGetCell(a,l,!0);if("cell"!==h.role)continue;t.start.row!==t.end.row&&h.contentHeight!==i&&QC(h,i,0,s.isAutoRowHeight(l),o,0,n),t.start.col!==t.end.col&&h.contentWidth!==e&&JC(h,e,i,0,s.isAutoRowHeight(l),o,r,n,s.scenegraph),h.contentWidth=e,h.contentHeight=i;const d=s.getRowHeight(l);ly(h,s.getColWidth(a),d,t,s)}}function ly(t,e,i,o,r){var n;const{col:s,row:a}=t,l=-r.getColsWidth(o.start.col,s-1),h=-r.getRowsHeight(o.start.row,a-1);t.forEachChildren((t=>{var e,i,o,r,n,s;"number"==typeof t._dx?(t.skipMergeUpdate=!0,t.setAttributes({dx:(null!==(e=t._dx)&&void 0!==e?e:0)+l}),t.skipMergeUpdate=!1):(t.skipMergeUpdate=!0,t._dx=null!==(i=t.attribute.dx)&&void 0!==i?i:0,t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+l}),t.skipMergeUpdate=!1),"number"==typeof t._dy?(t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(r=t._dy)&&void 0!==r?r:0)+h}),t.skipMergeUpdate=!1):(t._dy=null!==(n=t.attribute.dy)&&void 0!==n?n:0,t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+h}),t.skipMergeUpdate=!1)}));const d=null!==(n=t.attribute.strokeArrayWidth)&&void 0!==n?n:t.attribute.lineWidth,c=rt(d),u=[0,0,0,0];s===o.start.col&&(u[3]=c?d[3]:d),a===o.start.row&&(u[0]=c?d[0]:d),s===o.end.col&&(u[1]=c?d[1]:d),a===o.end.row&&(u[2]=c?d[2]:d);const g=e!==t.attribute.width,p=i!==t.attribute.height;return t.skipMergeUpdate=!0,t.setAttributes({width:e,height:i,strokeArrayWidth:u}),t.skipMergeUpdate=!1,t.mergeStartCol=o.start.col,t.mergeStartRow=o.start.row,t.mergeEndCol=o.end.col,t.mergeEndRow=o.end.row,{widthChange:g,heightChange:p}}function hy(t,e,i,o){if(o.internalProps.customMergeCell){const r=o.getCustomMerge(t,e);if(r){const{range:n,text:s,style:a,customLayout:l,customRender:h}=r;if(l||h){const r=HC(l,h,n.start.col,n.start.row,o.getColsWidth(n.start.col,n.end.col),o.getRowsHeight(n.start.row,n.end.row),!1,o.isAutoRowHeight(e),[0,0,0,0],n,o).elementsGroup;i.childrenCount>0&&r?i.insertBefore(r,i.firstChild):r&&i.appendChild(r);const s=o.getRowHeight(e),a=o.getColWidth(t),{width:d}=i.attribute,{height:c}=i.attribute;return i.contentWidth=d,i.contentHeight=c,ly(i,a,s,n,o),n}}}}function dy(t){return!!("cell"===t.role&&at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow))}const cy=new Uf({}),uy=new Vf({});function gy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){const f=ob(Q(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),b=VC("size",r,e,i,p);let m=VC("outerRadius",r,e,i,p);const C=at(m)?2*m:b;let y=0;if(n){const t=VC("spaceBetweenTextAndIcon",r,e,i,p),o=v-(g[1]+g[3])-s-C-t;at(m)||(m=Math.round(b/2)),uy.setAttributes({text:{maxLineWidth:o,text:f,fontSize:a,fontStyle:l,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},circle:{outerRadius:m},spaceBetweenTextAndIcon:t}),uy.render(),y=uy.AABBBounds.height()}else y=Math.max(b,f.length*c);return y}let py="quick";const fy=new n(((t,e,i,o)=>{i(Ao)?o(Ao).to(my).inSingletonScope():t(Ao).to(my).inSingletonScope()}));new n(((t,e,i,o)=>{i(Ao)?o(Ao).to(Ro).inSingletonScope():t(Ao).to(Ro).inSingletonScope()}));const vy=new Map;function by(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";const r=`${t}-${e}-${i}-${o}`,n=vy.get(r);if(n)return n;const s=(a={fontSize:t,fontFamily:i,fontWeight:e,fontStyle:o},new Se(Object.assign({defaultFontParams:{fontFamily:Xi.fontFamily,fontSize:Xi.fontSize},getTextBounds:Ua,specialCharSet:`{}()//&-/: .,@%'"~…=${Se.ALPHABET_CHAR_SET}${Se.ALPHABET_CHAR_SET.toUpperCase()}0123456789`},{}),a));var a;return vy.set(r,s),s}class my extends Ro{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py)}}const Cy=new class{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:r="normal",fontStyle:n="normal"}=e;return by(i,r,o,n).measure(t,py).width}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,r){const n=Math.floor((o+r)/2),s=t.substring(0,n+1),a=this.measureTextWidth(s,e);let l;if(a>i){if(s.length<=1)return{str:"",width:0};const r=t.substring(0,n);return l=this.measureTextWidth(r,e),l<=i?{str:r,width:l}:this._clipText(t,e,i,o,n)}if(a<i){if(n>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,n+2);return l=this.measureTextWidth(o,e),l>=i?{str:s,width:a}:this._clipText(t,e,i,n,r)}return{str:s,width:a}}clipTextWithSuffix(t,e,i,o){if(""===o)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};const n=this.measureTextWidth(o,e);if(n>i)return{str:"",width:0};i-=n;const s=this._clipText(t,e,i,0,t.length-1);return s.str+=o,s.width+=n,s}},yy=new Gl({ignoreBuf:!0});function wy(t){return yy.initAttributes(Object.assign(Object.assign({},t),{ignoreBuf:!0})),yy.AABBBounds}const xy=new bd({width:0,height:0,textConfig:[]});function Sy(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;var n,s,a,l,h,d,c,u,g,p,f,v;"undefined"!=typeof window&&window.performance.now();const b=[],m=[];if(r)for(let o=e;o<=i;o++)b[o]=t.getRowHeight(o);const C=t.internalProps.layoutMap;t.isPivotTable()&&(C.enableUseGetBodyCache(),C.enableUseHeaderPathCache()),t.defaultHeaderRowHeight,t.defaultHeaderColWidth;const y="auto"===t.defaultHeaderRowHeight||rt(t.defaultHeaderRowHeight)&&t.defaultHeaderRowHeight.some((t=>"auto"===t)),w="autoHeight"===t.heightMode||"adaptive"===t.heightMode;if(w||y){e=null!=e?e:0,i=null!=i?i:t.rowCount-1,(0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap();for(let i=e;i<t.columnHeaderLevelCount;i++){let e=0,o=t.colCount-1;if((t.isPivotTable()&&!t.isPivotChart()||t.isPivotChart()&&!t.internalProps.layoutMap.indicatorsAsCol)&&Ry(t,i)&&!lm(t,t.rowHeaderLevelCount,i)&&(e=0,o=t.rowHeaderLevelCount),w||"auto"===t.getDefaultRowHeight(i)){const r=_y(i,e,o,t);m[i]=Math.round(r),t._setRowHeight(i,r)}}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++)if(w||"auto"===t.getDefaultRowHeight(e)){const i=_y(e,0,t.colCount-1,t);r?m[e]=Math.round(i):t._setRowHeight(e,i)}if(i<t.columnHeaderLevelCount||!w);else if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol||!function(t){var e,i,o;const{layoutMap:r}=t.internalProps,n=t.columnHeaderLevelCount;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak||t.isPivotChart())&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;for(let s=0;s<t.colCount;s++){const a=r.getBody(s,n);if("radio"===a.cellType)return!1;if("function"==typeof a.style||"function"==typeof a.icon||(null===(e=a.define)||void 0===e?void 0:e.customRender)||(null===(i=a.define)||void 0===i?void 0:i.customLayout)||"function"==typeof(null===(o=a.define)||void 0===o?void 0:o.icon))return!1;const l=t._getCellStyle(s,n);if("function"==typeof l.padding||"function"==typeof l.fontSize||"function"==typeof l.lineHeight||!0===l.autoWrapText)return!1}return!0}(t))if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol)for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){let e;e=Ay(t,o)?_y(o,0,t.rowHeaderLevelCount,t):_y(o,0,t.colCount-1,t),r?m[o]=Math.round(e):t._setRowHeight(o,e)}else for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){const e=_y(o,0,t.colCount-1,t);r?m[o]=Math.round(e):t._setRowHeight(o,e)}else{!function(t,e,i,o,r){if(!o.internalProps.useOneRowHeightFillAll){for(let n=e;n<=i;n++)r?r[n]=t:o._setRowHeight(n,t);o.internalProps.useOneRowHeightFillAll=!0}}(_y(t.columnHeaderLevelCount,0,t.colCount-1,t),t.columnHeaderLevelCount,t.rowCount-1-t.bottomFrozenRowCount,t,r?m:void 0);for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++){const i=_y(e,0,t.colCount-1,t);r?m[e]=Math.round(i):t._setRowHeight(e,i)}}}else if(("adaptive"===t.heightMode||t.autoFillHeight)&&t.clearRowHeightCache(),r)for(let o=e;o<=i;o++)m[o]=t.getRowHeight(o);if((0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap(),"adaptive"===t.heightMode){t._clearRowRangeHeightsMap();let e=t.tableNoFrameHeight,i=0,o=t.rowCount;if("only-body"===t.heightAdaptiveMode){const r=t.getRowsHeight(0,t.columnHeaderLevelCount-1),n=t.isPivotChart()?t.getBottomFrozenRowsHeight():0;e=t.tableNoFrameHeight-r-n,i=t.columnHeaderLevelCount,o=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount}let a=0;for(let e=i;e<o;e++)a+=r&&null!==(n=m[e])&&void 0!==n?n:t.getRowHeight(e);const l=e/a;for(let n=i;n<o;n++){let a;a=n===o-1?e-(r?m.reduce(((t,e,r)=>r>=i&&r<=o-2?t+e:t),0):t.getRowsHeight(i,o-2)):Math.round((r&&null!==(s=m[n])&&void 0!==s?s:t.getRowHeight(n))*l),r?m[n]=a:t._setRowHeight(n,a,!1)}}else if(t.autoFillHeight){t._clearRowRangeHeightsMap();const e=t.tableNoFrameHeight;let i=0,o=0;for(let e=0;e<t.rowCount;e++){const n=r&&null!==(a=m[e])&&void 0!==a?a:t.getRowHeight(e);(e<t.columnHeaderLevelCount||t.isPivotChart()&&e>=t.rowCount-t.bottomFrozenRowCount)&&(o+=n),i+=n}if(t.scenegraph._dealAutoFillHeightOriginRowsHeight=i,i<e&&i-o>0){const n=t.columnHeaderLevelCount,s=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount,a=(e-o)/(i-o);for(let i=n;i<s;i++){let h;h=i===s-1?e-o-(r?m.reduce(((t,e,i)=>i>=n&&i<=s-2?t+e:t),0):t.getRowsHeight(n,s-2)):Math.round((r&&null!==(l=m[i])&&void 0!==l?l:t.getRowHeight(i))*a),r?m[i]=h:t._setRowHeight(i,h,!1)}}}if(r){for(let o=e;o<=i;o++){const e=null!==(h=m[o])&&void 0!==h?h:t.getRowHeight(o);e!==(null!==(d=b[o])&&void 0!==d?d:t.getRowHeight(o))&&t._setRowHeight(o,e)}if("adaptive"===t.heightMode||t.autoFillHeight&&t.getAllRowsHeight()<=t.tableNoFrameHeight){for(let e=0;e<=t.columnHeaderLevelCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(c=b[e])&&void 0!==c?c:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(u=b[e])&&void 0!==u?u:t.getRowHeight(e)),!0)}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=t.rowCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(g=b[e])&&void 0!==g?g:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(p=b[e])&&void 0!==p?p:t.getRowHeight(e)),!0)}}for(let e=t.scenegraph.proxy.rowStart;e<=t.scenegraph.proxy.rowEnd;e++){const i=t.getRowHeight(e);i!==(null!==(f=b[e])&&void 0!==f?f:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(v=b[e])&&void 0!==v?v:t.getRowHeight(e)),!0)}}t.isPivotTable()&&(C.disableUseGetBodyCache(),C.disableUseHeaderPathCache())}function _y(t,e,i,o){var r;let n;if(o.isPivotChart()&&t>=o.columnHeaderLevelCount&&t<o.rowCount-o.bottomFrozenRowCount)if(o.internalProps.layoutMap.indicatorsAsCol){const e=o.internalProps.layoutMap.getOptimunHeightForChart(t);if(e>0)return e}else{const e=o.getDefaultRowHeight(t);if(at(e))return e}for(let s=e;s<=i;s++){const e=By(s,t,o);if(e&&(n=J(n)?Math.max(e.height,n):e.height,!e.renderDefault))continue;if(o.isPivotChart()){const e=o.internalProps.layoutMap.getAxisConfigInPivotChart(s,t);if(e){const t=hm.getFunction("computeAxisComponentHeight")(e,o);if("number"==typeof t){n=J(n)?Math.max(t,n):t;continue}}}if(o.isPivotChart()&&(o.isLeftFrozenColumn(s)&&o.isBottomFrozenRow(t)||o.isRightFrozenColumn(s)&&o.isBottomFrozenRow(t)))continue;const i=My(s,t,o.isHeader(s,t)?null===(r=o._getHeaderLayoutMap(s,t))||void 0===r?void 0:r.headerType:o.getBodyColumnType(s,t),o);n=J(n)?Math.max(i,n):i}if(J(n))return n;const s=o.getDefaultRowHeight(t);return at(s)?s:o.defaultRowHeight}function Ay(t,e){var i,o,r;const{layoutMap:n}=t.internalProps;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak)&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=n.getBody(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icon||(null===(i=s.define)||void 0===i?void 0:i.customRender)||(null===(o=s.define)||void 0===o?void 0:o.customLayout)||"function"==typeof(null===(r=s.define)||void 0===r?void 0:r.icon))return!1;const a=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof a.padding&&"function"!=typeof a.fontSize&&"function"!=typeof a.lineHeight&&!0!==a.autoWrapText}function Ry(t,e){var i,o,r;const{layoutMap:n}=t.internalProps;if(t.internalProps.autoWrapText&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=n.getHeader(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icons||(null===(i=s.define)||void 0===i?void 0:i.headerCustomRender)||(null===(o=s.define)||void 0===o?void 0:o.headerCustomLayout)||"function"==typeof(null===(r=s.define)||void 0===r?void 0:r.icon))return!1;const a=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof a.padding&&"function"!=typeof a.fontSize&&"function"!=typeof a.lineHeight&&!0!==a.autoWrapText}function By(t,e,i){var o,r,n,s;const a=i.getCustomRender(t,e),l=i.getCustomLayout(t,e);if(a||l){let h=1,d=0,c=!1,u=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);h=o.end.row-o.start.row+1}const g={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:Ty(t,e,i),table:i};if(q(l)){const e=l(g);e.rootContainer?(e.rootContainer=FC(e.rootContainer),zC(e.rootContainer,i.getColWidth(t),0),e.rootContainer.setStage(i.scenegraph.stage),d=null!==(r=e.rootContainer.AABBBounds.height())&&void 0!==r?r:0,c=e.renderDefault,u=e.enableCellPadding):(d=0,c=e.renderDefault,u=e.enableCellPadding)}else if("function"==typeof a){const t=a(g);d=null!==(n=null==t?void 0:t.expectedHeight)&&void 0!==n?n:0,c=null==t?void 0:t.renderDefault}else d=null!==(s=null==a?void 0:a.expectedHeight)&&void 0!==s?s:0,c=null==a?void 0:a.renderDefault;if(u){const o=Dm(VC("padding",i._getCellStyle(t,e),t,e,i));d+=o[0]+o[2]}return{height:d/h,renderDefault:c}}}function My(t,e,i,o){var r,n,s;let a=0;const l=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=0;const u=[];let g=0;const p=[];let f=0,v=!1;if("body"!==o.getCellLocation(t,e))v=!0;else{const i=o.getBodyColumnDefine(t,e);v=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(v){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o,r,n,s,a,l,h,v;t.positionType!==Tv.absoluteRight&&t.positionType!==Tv.inlineFront&&t.positionType!==Tv.inlineEnd?(c+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0),d=Math.max(d,null!==(r=t.height)&&void 0!==r?r:0)):t.positionType===Tv.inlineFront?(u.push(t),g=Math.max(g,(null!==(n=t.height)&&void 0!==n?n:0)+(null!==(s=t.marginLeft)&&void 0!==s?s:0)+(null!==(a=t.marginRight)&&void 0!==a?a:0))):t.positionType===Tv.inlineEnd&&(p.push(t),f=Math.max(f,(null!==(l=t.height)&&void 0!==l?l:0)+(null!==(h=t.marginLeft)&&void 0!==h?h:0)+(null!==(v=t.marginRight)&&void 0!==v?v:0)))}))}let b=1,m=t;if(o.isHeader(t,e)||(null===(r=o.getBodyColumnDefine(t,e))||void 0===r?void 0:r.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);b=i.end.row-i.start.row+1,t=i.start.col,m=i.end.col}const C=Dm(VC("padding",h,t,e,o)),y=VC("fontSize",h,t,e,o),w=VC("fontStyle",h,t,e,o),x=VC("fontWeight",h,t,e,o),S=null!==(n=VC("lineHeight",h,t,e,o))&&void 0!==n?n:y,_=VC("fontFamily",h,t,e,o),A=VC("autoWrapText",h,t,e,o),R=VC("lineClamp",h,t,e,o);let B;if("text"!==i&&"link"!==i&&"progressbar"!==i&&"checkbox"!==i&&"radio"!==i)a=S;else if("checkbox"===i)a=function(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){const f=ob(Q(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),b=VC("size",r,e,i,p);let m=0;if(n){const t=VC("spaceBetweenTextAndIcon",r,e,i,p),o=v-(g[1]+g[3])-s-b-t;cy.setAttributes({text:{maxLineWidth:o,text:f,fontSize:a,fontStyle:l,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},icon:{width:Math.floor(b/1.4),height:Math.floor(b/1.4)},box:{width:b,height:b},spaceBetweenTextAndIcon:t}),cy.render(),m=cy.AABBBounds.height()}else m=Math.max(b,f.length*c);return m}(l,t,e,m,h,A,c,y,w,x,_,S,R,C,o);else if("radio"===i)a=function(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f;if(rt(t)){let v=0;const b=p.getBodyColumnDefine(e,i),m=VC("spaceBetweenRadio",r,e,i,p),C=null!==(f=null==b?void 0:b.radioDirectionInCell)&&void 0!==f?f:"vertical";return"vertical"===C?t.forEach(((f,b)=>{const C=gy(f,e,i,o,r,n,s,a,l,h,d,c,u,g,p);v+=C,b!==t.length-1&&(v+=m)})):"horizontal"===C&&t.forEach((t=>{const f=gy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p);v=Math.max(f,v)})),v}return gy(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p)}(l,t,e,m,h,A,c,y,w,x,_,S,R,C,o);else{B=l;const i=KC(B,o).text,r=o.getColsWidth(t,m);if(u.length||p.length)if(A){const t=Object.assign({text:null==l?void 0:l.toString(),fontFamily:_,fontSize:y,fontStyle:w,fontWeight:x,lineHeight:S});t.textBaseline="middle";const e=[...u.map((t=>ZC(t))),t,...p.map((t=>ZC(t)))];xy.setAttributes({width:r-(C[1]+C[3])-c,height:0,textConfig:e}),a=xy.AABBBounds.height()}else a=0,i.forEach(((t,e)=>{var r;(null===(r=o.options.customConfig)||void 0===r?void 0:r.multilinesForXTable)&&0!==e||(0===e&&u.length?a+=Math.max(S,g):e===i.length-1&&p.length?a+=Math.max(S,f):a+=S)}));else if(A){const n=$C(t,e,o),s=wy({maxLineWidth:r-(C[1]+C[3])-c-n,text:i,fontSize:y,fontStyle:w,fontWeight:x,fontFamily:_,lineHeight:S,wordBreak:"break-word",whiteSpace:1!==i.length||A?"normal":"no-wrap",lineClamp:R});a=s.height()||("number"==typeof S?S:y)}else a=(null===(s=o.options.customConfig)||void 0===s?void 0:s.multilinesForXTable)?S:i.length*S}return(Math.max(a,d)+C[0]+C[2])/b}function Ty(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:i.getColWidth(t),height:0}}function Py(t,e){if(!e||!e.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:i,mergeEndCol:o,mergeStartRow:r,mergeEndRow:n,col:s,row:a}=t,{colStart:l,colEnd:h,rowStart:d,rowEnd:c,bodyLeftCol:u,bodyRightCol:g,bodyTopRow:p,bodyBottomRow:f}=e.proxy;let v=i,b=o,m=r,C=n;return s>=u&&s<=g&&(v=Math.max(t.mergeStartCol,l),b=Math.min(t.mergeEndCol,h)),a>=p&&a<=f&&(m=Math.max(t.mergeStartRow,d),C=Math.min(t.mergeEndRow,c)),{colStart:v,colEnd:b,rowStart:m,rowEnd:C}}function ky(t,e,i,o){o||t.table._setRowHeight(e,t.table.getRowHeight(e)+i,!0);for(let o=0;o<t.table.colCount;o++){const r=t.getCell(o,e);if("empty"===r.role)continue;const n=lm(t.table,o,e);n&&n.start.col!==o||(Ly(t,r,o,e,r.attribute.height+i,i,t.table.isHeader(o,e)),t.updateCellContentWhileResize(o,e))}let r=0,n=0;e<t.table.frozenRowCount?(r=e+1,n=t.table.frozenRowCount-1):e>=t.table.rowCount-t.table.bottomFrozenRowCount?(r=e+1,n=t.table.rowCount-1):(r=e+1,n=Math.min(t.proxy.rowEnd,t.table.rowCount-t.table.bottomFrozenRowCount-1));for(let e=0;e<t.table.colCount;e++)for(let o=r;o<=n;o++){const r=t.highPerformanceGetCell(e,o);"cell"===r.role&&r.setAttribute("y",r.attribute.y+i)}}function Ly(t,e,i,o,r,n,s){e&&function(t,e,i,o,r,n,s){var a,l,h;if(e.attribute.height===r&&!e.needUpdateHeight)return;e.needUpdateHeight=!1,e.setAttribute("height",r);const d=(null===(a=t.table.getCellRawRecord(i,o))||void 0===a?void 0:a.vtableMerge)?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);if("progressbar"===d){const s=t.table.getBodyColumnDefine(i,o),a=t.table._getCellStyle(i,o),l=t.table.getCellValue(i,o),h=t.table.getCellOriginValue(i,o),d=Dm(VC("padding",a,i,o,t.table));let c;(null==s?void 0:s.mergeCell)&&(c=t.table.getCellRange(i,o));const u=hm.getFunction("createProgressBarCell")(s,a,e.attribute.width,l,h,i,o,d,t.table,c),g=e.getChildByName("progress-bar");e.insertBefore(u,g),e.removeChild(g),g.removeAllChild(),g.release(),Hy(e,r,n,t.table.isAutoRowHeight(o),!0,t.table)}else if("sparkline"===d){e.removeAllChild();const r=t.table._getCellStyle(i,o),n=Dm(VC("padding",r,i,o,t.table));hm.getFunction("createSparkLineCellGroup")(e,e.parent,e.attribute.x,e.attribute.y,i,o,e.attribute.width,e.attribute.height,n,t.table,wC(r,t.table,i,o,VC).theme,!1)}else if("image"===d||"video"===d)ey(e,i,o,0,0,t.table);else if("axis"===(null===(l=e.firstChild)||void 0===l?void 0:l.name))null===(h=e.firstChild)||void 0===h||h.originAxis.resize(e.attribute.width,e.attribute.height);else{let s=!0;const a=e.getChildByName(kC)||e.getChildByName(LC);if(a){let r;t.table.reactCustomLayout&&t.table.reactCustomLayout.removeCustomCell(i,o),a.removeAllChild(),e.removeChild(a);const n=hy(i,o,e,t.table);if(n)for(let e=n.start.row;e<=n.end.row;e++){if(e===o)continue;const r=t.getCell(i,e),n=r.getChildByName(kC)||r.getChildByName(LC);n.removeAllChild(),r.removeChild(n),hy(i,e,r,t.table)}else{let n,a;const l=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)a=t.table.options.groupTitleCustomLayout;else if("body"!==l){const e=t.table.getHeaderDefine(i,o);n=null==e?void 0:e.headerCustomRender,a=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);n=(null==e?void 0:e.customRender)||t.table.customRender,a=null==e?void 0:e.customLayout}if((n||a)&&dy(e))for(let i=e.mergeStartCol;i<=e.mergeEndCol;i++)for(let r=e.mergeStartRow;r<=e.mergeEndRow;r++)r!==o&&t.updateCellContent(i,r);if(a||n){const l=Dm(VC("padding",t.table._getCellStyle(i,o),i,o,t.table));let h=e.attribute.width,d=e.attribute.height;dy(e)&&(h=t.table.getColsWidth(e.mergeStartCol,e.mergeEndCol),d=t.table.getRowsHeight(e.mergeStartRow,e.mergeEndRow));const c=HC(a,n,i,o,h,d,!1,t.table.isAutoRowHeight(o),l,dy(e)?{start:{col:e.mergeStartCol,row:e.mergeStartRow},end:{col:e.mergeEndCol,row:e.mergeEndRow}}:void 0,t.table);r=c.elementsGroup,s=c.renderDefault}e.childrenCount>0&&r?e.insertBefore(r,e.firstChild):r&&e.appendChild(r)}}Hy(e,r,n,t.table.isAutoRowHeight(o),s,t.table)}}(t,e,i,o,r,n)}function Hy(t,e,i,o,r,n){if(dy(t)){e=0;for(let i=t.mergeStartRow;i<=t.mergeEndRow;i++)e+=n.getRowHeight(i);const{colStart:i,colEnd:s,rowStart:a,rowEnd:l}=Py(t,n.scenegraph);for(let h=i;h<=s;h++)for(let s=a;s<=l;s++){const l=n.scenegraph.getCell(h,s);if(l.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})})),r){const t=n._getCellStyle(i,a);QC(l,e,0,o,Dm(t.padding),t.textAlign,t.textBaseline)}const d=n.getRowHeight(s),c=n.getColWidth(h);l.contentHeight=e;const{widthChange:u}=ly(l,c,d,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},n);u&&(l.needUpdateWidth=!0)}}else{const i=n._getCellStyle(t.col,t.row);QC(t,e,0,o,Dm(i.padding),i.textAlign,i.textBaseline)}}function Ey(t,e,i,o){var r,n,s,a,l,h,d;let c=!1;const u=null!==(r=null==t?void 0:t.attribute.width)&&void 0!==r?r:0;if(null==t||t.setAttribute("width",u+e),null==t||t.forEachChildren(((t,r)=>{if(function(t,e,i,o,r,n,s,a,l){var h,d,c,u,g,p;if(e.attribute.width===n&&!e.needUpdateWidth)return!1;e.needUpdateWidth=!1,e.setAttribute("width",n);const f=e;if(!f)return!1;const v=t.table.isAutoRowHeight(o),b=(null===(h=t.table.getCellRawRecord(i,o))||void 0===h?void 0:h.vtableMerge)?"text":t.table.isHeader(i,o)?t.table._getHeaderLayoutMap(i,o).headerType:t.table.getBodyColumnType(i,o);let m=!1;if("progressbar"===b){const e=t.table.getBodyColumnDefine(i,o),r=t.table._getCellStyle(i,o),a=t.table.getCellValue(i,o),l=t.table.getCellOriginValue(i,o),h=Dm(VC("padding",r,i,o,t.table));let d;(null==e?void 0:e.mergeCell)&&(d=t.table.getCellRange(i,o));const c=hm.getFunction("createProgressBarCell")(e,r,f.attribute.width,a,l,i,o,h,t.table,d),u=f.getChildByName("progress-bar");f.insertBefore(c,u),f.removeChild(u),u.removeAllChild(),u.release();const g=zy(f,n,s,v,!0,t.table);m=m||g}else if("sparkline"===b){f.removeAllChild();const e=t.table._getCellStyle(i,o),r=Dm(VC("padding",e,i,o,t.table));hm.getFunction("createSparkLineCellGroup")(f,f.parent,f.attribute.x,f.attribute.y,i,o,f.attribute.width,f.attribute.height,r,t.table,wC(e,t.table,i,o,VC).theme,!1)}else if("image"===b||"video"===b)ey(f,i,o,s,0,t.table);else if("axis"===(null===(d=f.firstChild)||void 0===d?void 0:d.name)){const e=t.table.internalProps.layoutMap.getAxisConfigInPivotChart(i,o),r=Dm(VC("padding",t.table._getCellStyle(i,o),i,o,t.table));if(e){const i=new(hm.getComponent("axis"))(e,f.attribute.width,f.attribute.height,r,t.table);f.clear(),f.appendChild(i.component),i.overlap()}}else if("axis"===(null===(c=e.firstChild)||void 0===c?void 0:c.name))null===(u=e.firstChild)||void 0===u||u.originAxis.resize(e.attribute.width,e.attribute.height);else{let r=!0;const a=e.getChildByName(kC)||e.getChildByName(LC);if(a){let n;t.table.reactCustomLayout&&t.table.reactCustomLayout.removeCustomCell(i,o),a.removeAllChild(),e.removeChild(a);const s=hy(i,o,e,t.table);if(s)for(let e=s.start.col;e<=s.end.col;e++){if(e===i)continue;const r=t.getCell(e,o),n=r.getChildByName(kC)||r.getChildByName(LC);n.removeAllChild(),r.removeChild(n),hy(e,o,r,t.table)}else{let s,a;const l=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)a=t.table.options.groupTitleCustomLayout;else if("body"!==l){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,a=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,a=null==e?void 0:e.customLayout}if((s||a)&&dy(f))for(let e=f.mergeStartCol;e<=f.mergeEndCol;e++)if(e!==i)for(let i=f.mergeStartRow;i<=f.mergeEndRow;i++)t.updateCellContent(e,i);if(a||s){const e=Dm(VC("padding",t.table._getCellStyle(i,o),i,o,t.table));let l=f.attribute.width,h=f.attribute.height;dy(f)&&(l=t.table.getColsWidth(f.mergeStartCol,f.mergeEndCol),h=t.table.getRowsHeight(f.mergeStartRow,f.mergeEndRow));const d=HC(a,s,null!==(g=f.mergeStartCol)&&void 0!==g?g:i,null!==(p=f.mergeStartRow)&&void 0!==p?p:o,l,h,!1,t.table.isAutoRowHeight(o),e,dy(f)?{start:{col:f.mergeStartCol,row:f.mergeStartRow},end:{col:f.mergeEndCol,row:f.mergeEndRow}}:void 0,t.table);n=d.elementsGroup,r=d.renderDefault,m=!0}e.childrenCount>0&&n?e.insertBefore(n,e.firstChild):n&&e.appendChild(n)}}const l=zy(f,n,s,v,r,t.table);m=m||l}l||(l=t.table._getCellStyle(i,o).autoWrapText);return!(!v||!l)&&m}(o,t,t.col,t.row,0,u+e,e,"row-body"!==i||(t.col,o.table.rowHeaderLevelCount),o.table.internalProps.autoWrapText)){const e=lm(o.table,t.col,t.row);if(e&&e.end.row-e.start.row)for(let t=e.start.row;t<=e.end.row;t++)Fy(o,t);else Fy(o,t.row);c=!0}})),c){let t,e,r,c=0;for(let u=0;u<o.table.colCount;u++){if("col-corner"===i?(r=0,t=o.getColGroup(u,!0),e=null!==(n=o.colHeaderGroup.attribute.height)&&void 0!==n?n:0):"row-body"===i?(r=o.table.frozenRowCount,t=o.getColGroup(u,!1),e=null!==(s=o.bodyGroup.attribute.height)&&void 0!==s?s:0):"bottom"===i?(r=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInBottom(u),e=null!==(a=o.bottomFrozenGroup.attribute.height)&&void 0!==a?a:0):"left-bottom"===i?(r=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInLeftBottomCorner(u),e=null!==(l=o.leftBottomCornerGroup.attribute.height)&&void 0!==l?l:0):"right-top"===i?(r=0,t=o.getColGroupInRightTopCorner(u),e=null!==(h=o.rightTopCornerGroup.attribute.height)&&void 0!==h?h:0):"right-bottom"===i&&(r=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInRightBottomCorner(u),e=null!==(d=o.rightBottomCornerGroup.attribute.height)&&void 0!==d?d:0),!t)continue;let g=0;t.forEachChildren((t=>{var e;t.setAttribute("y",g),g+=null!==(e=o.table.getRowHeight(t.row))&&void 0!==e?e:0})),c=g}o.updateContainerHeight(r,c-e);for(let t=0;t<o.table.frozenColCount;t++){const e=o.getColGroupInLeftBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.colCount-o.table.rightFrozenColCount;t<o.table.colCount;t++){const e=o.getColGroupInRightBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.frozenColCount;t<o.table.colCount-o.table.rightFrozenColCount;t++){const e=o.getColGroupInBottom(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}}}function zy(t,e,i,o,r,n){if(dy(t)){e=0;let s=!1;for(let i=t.mergeStartCol;i<=t.mergeEndCol;i++)e+=n.getColWidth(i);let a=0;for(let e=t.mergeStartRow;e<=t.mergeEndRow;e++)a+=n.getRowHeight(e);const{colStart:l,colEnd:h,rowStart:d,rowEnd:c}=Py(t,n.scenegraph);for(let u=l;u<=h;u++)for(let h=d;h<=c;h++){if(u===t.col&&h!==t.row)continue;const c=n.scenegraph.getCell(u,h);c.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));let g=!1;if(r){const t=n._getCellStyle(l,d);g=JC(c,e,a,i,o,Dm(t.padding),t.textAlign,t.textBaseline,n.scenegraph);const r=$C(c.col,c.row,n);if(r){const t=c.getChildByName("text"),e=c.getChildByName("expand")||c.getChildByName("collapse");"icon-left"!==(null==e?void 0:e.role)&&t&&t.setAttribute("dx",r)}}const p=n.getRowHeight(h),f=n.getColWidth(u);c.contentWidth=e;const{heightChange:v}=ly(c,f,p,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},n);v&&(c.needUpdateHeight=!0),s=s||g}return s}const s=n._getCellStyle(t.col,t.row),a=Dm(s.padding),l=s.textAlign,h=s.textBaseline;return JC(t,e,n.getRowHeight(t.row),i,o,a,l,h,n.scenegraph)}function Fy(t,e){const i=Math.round(_y(e,0,t.table.colCount-1,t.table));t.table._setRowHeight(e,i,!0);for(let o=0;o<t.table.colCount;o++){const r=i,n=t.highPerformanceGetCell(o,e);if("empty"===n.role)return;Ly(t,n,o,e,r,r-n.attribute.height,t.table.isHeader(o,e))}}var Iy;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(Iy||(Iy={}));const Oy=12,Dy="Arial,sans-serif",Wy="#000",Ny="#2E68CF",Gy="#EEE",jy=30,Uy="#FFF",Vy=4,Xy=.5,Yy="#CCC",$y=6,Ky=9,qy=200;class Zy{constructor(t){this._table=t,this._menuInstance=new jC({x:0,y:0,fill:Uy,stroke:Yy,cornerRadius:Vy,lineWidth:Xy}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:Iy.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,r,n){if(r===Iy.dropDown&&this.checkDropDownMenuChange(i,o)){const t=this.getMenuInfo(i,o,r);if(!t)return;const{menuInfo:e,highlightIndex:n}=t;this.updateMenuInfo(i,o,r,e,n),this.updateMenuInstance(e,n)}else if(r===Iy.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(i,o,r);if(!t)return;const{menuInfo:e,highlightIndex:n}=t;this.updateMenuInfo(i,o,r,e,n),this.updateMenuInstance(e,n)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,r){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=r}checkDropDownMenuChange(t,e){const{type:i,col:o,row:r}=this._menuInfo;return i!==Iy.dropDown||t!==o||e!==r}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:r}=this._menuInfo;return o!==Iy.contextmenu||r!==(null===(i=this._table.internalProps.menu)||void 0===i?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=$y;const o=$y;let r=0;t.forEach(((t,n)=>{var s,a;const l=e===n;let h,d;"string"==typeof t?d=t:"object"==typeof t&&(d=t.text,h=l?t.selectedIcon:t.icon);const c=new jC({y:i,x:o,height:jy,fill:Uy});c.role="menu-item",this._menuInstance.appendChild(c),c.stateProxy=t=>"hover"===t?{fill:Gy}:{fill:Uy},c.addEventListener("pointerenter",(t=>{c.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),c.addEventListener("pointerleave",(t=>{c.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new Gl({x:Ky,y:Ky,fill:l?Ny:Wy,text:d,textBaseline:"top",fontSize:Oy,fontFamily:Dy,pickable:!1,maxLineWidth:qy,ellipsis:"…"});if(c.addChild(u),h){u.AABBBounds.height();const t=null!==(s=h.width)&&void 0!==s?s:16,e=null!==(a=h.height)&&void 0!==a?a:16,i=new SC({x:Ky,y:(jy-e)/2,width:t,height:e,image:h.svg,pickable:!1});i.role="menu-icon",c.insertBefore(i,u),u.setAttribute("x",t+Ky)}r=Math.max(c.AABBBounds.width(),r),i+=jy})),this._menuInstance.setAttributes({width:r+2*Ky+2*$y,height:i+$y}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",r+2*Ky)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===Iy.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=Iy.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===Iy.dropDown){const{dropDownMenu:i=this._table.globalDropDownMenu,pivotInfo:o}=this._table._getHeaderLayoutMap(t,e);let r=-1;if(Array.isArray(i))for(let o=0;o<i.length;o++)if(this._table._dropDownMenuIsHighlight(t,e,o)){r=o;break}return{menuInfo:i,highlightIndex:r}}if(i===Iy.contextmenu){const i=null===(o=this._table.internalProps.menu)||void 0===o?void 0:o.contextMenuItems;let r;if(Array.isArray(i))r=i;else if("function"==typeof i){const{field:o}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);r=i(o,e,t)}return{menuInfo:r,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),r=Object.assign(i,o);r.event=t.nativeEvent,this._table.fireListeners(kb.DROPDOWN_MENU_CLICK,r)}}))}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren(((e,o)=>e===t&&(i=o-1,!0)));const o="string"==typeof this._menuInfo.menuInfo[i]?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,r="string"==typeof this._menuInfo.menuInfo[i]?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:r}}get bounds(){return this._menuInstance.globalAABBBounds}}const Jy=GC();class Qy{constructor(){const t=Jy.drillDown;this.icon=new SC({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,r,n){if(!t||o&&r)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void n.updateNextFrame();const s=Jy.drillDown,a=Jy.drillUp;this.icon.setAttributes({x:e,y:i,image:o?s.svg:a.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),n.updateNextFrame()}}class tw{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=ed({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=rd({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=ad({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),r=lm(this.table,t,e);r&&(t=r.start.col,e=r.start.row);let n=0,s=0,a=0,l=0,h=0,d=0,c=0,u=0,g=Math.PI;const p=[];"columnHeader"===o?(n=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,s=this.table.getRowsHeight(0,this.table.frozenRowCount-1),l=this.table.tableNoFrameHeight,a=r?this.table.getColsWidth(r.start.col,r.end.col):this.table.getColWidth(t),h=n-i,c=n+a,u=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):("rowHeader"===o||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(s=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,n=this.table.getColsWidth(0,this.table.frozenColCount-1),a=this.table.tableNoFrameWidth,l=r?this.table.getRowsHeight(r.start.row,r.end.row):this.table.getRowHeight(e),d=s-i,c=2,u=s+l,g=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:n-h,y:s-d,width:a,height:l,dx:h,dy:d}),this.columnMoverLine.setAttributes({x:c,y:u,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:u,angle:g})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):"number"==typeof i&&"number"==typeof o&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function ew(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllColsWidth())-e.getColsWidth(t,e.colCount-1);let o=e.getColsWidth(0,t);return t>=e.frozenColCount&&(o-=e.scrollLeft),o}function iw(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllRowsHeight())-e.getRowsHeight(t,e.rowCount-1);let o=e.getRowsHeight(0,t);return t>=e.frozenRowCount&&(o-=e.scrollLeft),o}class ow{constructor(t){var e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b;this.table=t;const m=this.table.theme;this.createScrollBar();const C=null===(e=m.columnResize)||void 0===e?void 0:e.lineColor,y=null===(i=m.columnResize)||void 0===i?void 0:i.lineWidth,w=null===(o=m.columnResize)||void 0===o?void 0:o.bgColor,x=null===(r=m.columnResize)||void 0===r?void 0:r.width,S=null===(s=null===(n=m.columnResize)||void 0===n?void 0:n.labelVisible)||void 0===s||s,_=null===(a=m.columnResize)||void 0===a?void 0:a.labelColor,A=null===(l=m.columnResize)||void 0===l?void 0:l.labelFontSize,R=null===(h=m.columnResize)||void 0===h?void 0:h.labelFontFamily,B=null===(d=m.columnResize)||void 0===d?void 0:d.labelBackgroundFill,M=null===(c=m.columnResize)||void 0===c?void 0:c.labelBackgroundCornerRadius;this.labelVisible=S,this.columnResizeLine=rd({visible:!1,pickable:!1,stroke:C,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=rd({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const T=jl({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:_,fontFamily:R,text:"",textBaseline:"top",dx:16,dy:-A/2}),P=ad({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.columnResizeLabel=Fn({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(P),this.columnResizeLabel.appendChild(T),this.rowResizeLine=rd({visible:!1,pickable:!1,stroke:C,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=rd({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const k=jl({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:_,fontFamily:R,text:"",textBaseline:"top",dx:16,dy:-A/2}),L=ad({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.rowResizeLabel=Fn({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(L),this.rowResizeLabel.appendChild(k),this.cellMover=new tw(this.table);const H=null===(g=null===(u=m.frozenColumnLine)||void 0===u?void 0:u.shadow)||void 0===g?void 0:g.width,E=null===(f=null===(p=m.frozenColumnLine)||void 0===p?void 0:p.shadow)||void 0===f?void 0:f.startColor,z=null===(b=null===(v=m.frozenColumnLine)||void 0===v?void 0:v.shadow)||void 0===b?void 0:b.endColor;this.frozenShadowLine=ad({visible:!0,pickable:!1,x:0,y:0,width:H,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:E,offset:0},{color:z,offset:1}]}}),this.rightFrozenShadowLine=ad({visible:!0,pickable:!1,x:0,y:0,width:H,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:z,offset:0},{color:E,offset:1}]}}),this.menu=new Zy(this.table),this.drillIcon=new Qy}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o,r,n;const s=this.table.theme,a=null===(t=s.scrollStyle)||void 0===t?void 0:t.scrollRailColor,l=null===(e=s.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,h=null===(i=s.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,d=null===(o=s.scrollStyle)||void 0===o?void 0:o.width,c=null===(r=s.scrollStyle)||void 0===r?void 0:r.horizontalPadding,u=null===(n=s.scrollStyle)||void 0===n?void 0:n.verticalPadding;let g;g=J(h)?{cornerRadius:h,fill:l}:{fill:l},this.hScrollBar=new kf({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:d,padding:c,railStyle:{fill:a},sliderStyle:g,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new kf({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:d,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:u,railStyle:{fill:a},sliderStyle:g,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,r,n,s;const a=this.table.stateManager.scroll.horizontalBarPos,l=this.table.stateManager.scroll.verticalBarPos,h=this.table.theme,d=null===(t=h.scrollStyle)||void 0===t?void 0:t.width,c=null===(e=h.scrollStyle)||void 0===e?void 0:e.visible,u=null!==(o=null===(i=h.scrollStyle)||void 0===i?void 0:i.horizontalVisible)&&void 0!==o?o:c,g=null!==(n=null===(r=h.scrollStyle)||void 0===r?void 0:r.verticalVisible)&&void 0!==n?n:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),f=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),v=this.table.getAllRowsHeight(),b=this.table.getAllColsWidth(),m=this.table.getFrozenRowsHeight(),C=this.table.getFrozenColsWidth(),y=this.table.getBottomFrozenRowsHeight(),w=this.table.getRightFrozenColsWidth(),x=(null===(s=this.table.options.customConfig)||void 0===s?void 0:s._disableColumnAndRowSizeRound)?1:0;if(b>p+x){const t=Math.min(f,v),e=Math.max(.05,(p-C)/(b-C)),i=this.table.theme.scrollStyle.hoverOn;let o=0;o=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(i?d:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:t-(i?d:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:C+(i?0:this.table.scenegraph.tableGroup.attribute.x),y:o,width:p-C-w,range:[0,e],visible:"always"===u});const r=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:r.x1,y:r.y1},"always"===u&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(v>f+x){const t=Math.min(p,b),e=Math.max(.05,(f-m)/(v-m));let i=0;const o=this.table.theme.scrollStyle.hoverOn;i=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(o?d:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:t-(o?d:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:m+(o?0:this.table.scenegraph.tableGroup.attribute.y),height:f-m-y,range:[0,e],visible:"always"===g});const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1},"always"===g&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(a),this.table.stateManager.setScrollTop(l)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=ew(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`))}updateResizeCol(t,e,i){const o=ew(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`))}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=iw(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`))}updateResizeRow(t,e,i){const o=iw(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`))}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=ew(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=ew(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const r=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:r.x1,y:r.y1}}updateStyle(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x;const S=this.table.theme,_=null===(t=S.scrollStyle)||void 0===t?void 0:t.scrollRailColor,A=null===(e=S.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,R=null===(i=S.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,B=null===(o=S.scrollStyle)||void 0===o?void 0:o.width,M=null===(r=S.scrollStyle)||void 0===r?void 0:r.horizontalPadding,T=null===(n=S.scrollStyle)||void 0===n?void 0:n.verticalPadding;let P;P=J(R)?{cornerRadius:R,fill:A}:{fill:A},this.hScrollBar.setAttributes({height:B,padding:M,railStyle:{fill:_},sliderStyle:P}),this.vScrollBar.setAttributes({width:B,padding:T,railStyle:{fill:_},sliderStyle:P});const k=null===(s=S.columnResize)||void 0===s?void 0:s.lineColor,L=null===(a=S.columnResize)||void 0===a?void 0:a.lineWidth,H=null===(l=S.columnResize)||void 0===l?void 0:l.bgColor,E=null===(h=S.columnResize)||void 0===h?void 0:h.width;this.columnResizeLine.setAttributes({stroke:k,lineWidth:L}),this.columnResizeBgLine=rd({stroke:H,lineWidth:E});const z=null===(d=S.columnResize)||void 0===d?void 0:d.labelColor,F=null===(c=S.columnResize)||void 0===c?void 0:c.labelFontSize,I=null===(u=S.columnResize)||void 0===u?void 0:u.labelFontFamily,O=null===(g=S.columnResize)||void 0===g?void 0:g.labelBackgroundFill,D=null===(p=S.columnResize)||void 0===p?void 0:p.labelBackgroundCornerRadius,W=null===(v=null===(f=S.columnResize)||void 0===f?void 0:f.labelVisible)||void 0===v||v;this.labelVisible=W,this.columnResizeLabel.lastChild.setAttributes({fontSize:F,fill:z,fontFamily:I,dy:-F/2}),this.columnResizeLabel.firstChild.setAttributes({fill:O,width:5*F*.8,height:F+8,cornerRadius:D,dy:-F/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:F,fill:z,fontFamily:I,dy:-F/2}),this.rowResizeLabel.firstChild.setAttributes({fill:O,width:5*F*.8,height:F+8,cornerRadius:D,dy:-F/2-4});const N=null===(m=null===(b=S.frozenColumnLine)||void 0===b?void 0:b.shadow)||void 0===m?void 0:m.width,G=null===(y=null===(C=S.frozenColumnLine)||void 0===C?void 0:C.shadow)||void 0===y?void 0:y.startColor,j=null===(x=null===(w=S.frozenColumnLine)||void 0===w?void 0:w.shadow)||void 0===x?void 0:x.endColor;this.frozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:G,offset:0},{color:j,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:G,offset:1}]}}),this.cellMover.updateStyle()}}function rw(t,e,i,o,r){var n,s,a,l,h,d;if(!e)return;const c="table"===i,{shadowBlur:u,shadowOffsetX:g,shadowOffsetY:p,shadowColor:f,cornerRadius:v,borderColor:b,borderLineWidth:m,borderLineDash:C}=e;let y=!1;const w={},x={pickable:!1};u&&c&&(x.shadowBlur=u,x.shadowOffsetX=g,x.shadowOffsetY=p,x.shadowColor=f,x.stroke=!0,x.stroke=f,x.lineWidth=1,y=!0),m&&(x.stroke=!0,x.fill=!1,x.stroke=sw(b,o,m),x.lineWidth=m,C&&(x.lineDash=C),x.lineCap="butt"),Array.isArray(b)&&(x.strokeArrayColor=Dm(b)),Array.isArray(m)&&(x.strokeArrayWidth=Dm(m),x.lineWidth=1),v&&(x.cornerRadius=v,w.cornerRadius=v);const S=x.strokeArrayWidth?x.strokeArrayWidth[0]:null!==(n=x.lineWidth)&&void 0!==n?n:0,_=x.strokeArrayWidth?x.strokeArrayWidth[1]:null!==(s=x.lineWidth)&&void 0!==s?s:0,A=x.strokeArrayWidth?x.strokeArrayWidth[2]:null!==(a=x.lineWidth)&&void 0!==a?a:0,R=x.strokeArrayWidth?x.strokeArrayWidth[3]:null!==(l=x.lineWidth)&&void 0!==l?l:0;if(t.setAttributes(w),!r&&x.stroke)if(x.x=R/2,x.y=S/2,x.pickable=!1,c){if(v)if(Array.isArray(v)){const t=Dm(v);x.cornerRadius=t,w.cornerRadius=t,t[0]&&(t[0]=t[0]+Math.min(R,S)/2),t[1]&&(t[1]=t[1]+Math.min(S,_)/2),t[2]&&(t[2]=t[2]+Math.min(_,A)/2),t[3]&&(t[3]=t[3]+Math.min(A,R)/2)}else if(rt(m)){const t=[];x.cornerRadius=t,w.cornerRadius=t,t[0]=v+Math.min(R,S)/2,t[1]=v+Math.min(S,_)/2,t[2]=v+Math.min(_,A)/2,t[3]=v+Math.min(A,R)/2}else x.cornerRadius=v+(null!==(h=x.lineWidth)&&void 0!==h?h:0)/2,w.cornerRadius=v+(null!==(d=x.lineWidth)&&void 0!==d?d:0)/2;let i,o;if(e.innerBorder?(x.x=t.attribute.x+R/2,x.y=t.attribute.y+S/2,x.width=t.attribute.width-R/2-_/2,x.height=t.attribute.height-S/2-A/2):(x.x=t.attribute.x-R/2,x.y=t.attribute.y-S/2,x.width=t.attribute.width+R/2+_/2,x.height=t.attribute.height+S/2+A/2),y){x.fill="white",x.notAdjustPos=!0,o=Fn(x),o.name="table-border-rect",i=ad({x:R/2,y:S/2,width:t.attribute.width,height:t.attribute.height,fill:"red",cornerRadius:t.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),o.addChild(i);const e=ad({x:R/2,y:S/2,width:t.attribute.width,height:t.attribute.height,fill:"transparent",pickable:!1,globalCompositeOperation:"source-over"});o.addChild(e)}else o=ad(x),o.name="table-border-rect";e.innerBorder&&!y?t.parent.insertAfter(o,t):t.parent.insertBefore(o,t),t.border=o}else{x.width=t.attribute.width-R/2-_/2,x.height=t.attribute.height-S/2-A/2;const e=ad(x);e.name="border-rect",t.addChild(e),t.border=e}}function nw(t,e,i){var o;const{borderColor:r}=e;null===(o=t.border)||void 0===o||o.setAttribute("stroke",sw(r,i))}function sw(t,e,i){let o=!0;return!e&&!rt(i)||rt(t)?e?o=e:e||rt(t)?rt(t)&&(o=!0):o=t:o=(null!=e?e:i).map((e=>!!e&&t)),o}function aw(t){var e,i,o,r;if(!t.border)return;const n=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:null!==(e=t.border.attribute.lineWidth)&&void 0!==e?e:0,s=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:null!==(i=t.border.attribute.lineWidth)&&void 0!==i?i:0,a=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:null!==(o=t.border.attribute.lineWidth)&&void 0!==o?o:0,l=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:null!==(r=t.border.attribute.lineWidth)&&void 0!==r?r:0;t.border.setAttributes({width:t.attribute.width-l/2-s/2,height:t.attribute.height-n/2-a/2}),"group"===t.border.type&&t.border.firstChild.setAttributes({width:t.attribute.width,height:t.attribute.height})}function lw(t,e){t.setAttribute("cornerRadius",e),t.border&&t.border.setAttribute("cornerRadius",e)}const hw=gn();class dw extends zn{constructor(t,e){if(super(e),this.type="chart",this.numberType=hw,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const t=this.chartInstance=new e.ClassType(e.spec,xt({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:"node"===this.attribute.mode?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1}));t.renderSync(),t.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=t}}activate(t){var e,i,o,r;this.active=!0;const{col:n,row:s}=this.parent,{x1:a,y1:l,x2:h,y2:d}=this.getViewBox(),c=function(t,e,i){var o,r,n,s,a,l,h,d;const{layoutMap:c}=i.internalProps,u=new Qt,g=i.scenegraph.tableGroup.globalAABBBounds;return u.x1=g.x1,u.x2=g.x2,u.y1=g.y1,u.y2=g.y2,c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?c.isLeftBottomCorner(t,e)||c.isRightTopCorner(t,e)||(c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)?(u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()):c.isBottomFrozenRow(t,e)&&(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth())):(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth(),u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()),u.x1=u.x1+(null!==(r=null===(o=i.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==r?r:0),u.x2=u.x2+(null!==(s=null===(n=i.options.viewBox)||void 0===n?void 0:n.x1)&&void 0!==s?s:0),u.y1=u.y1+(null!==(l=null===(a=i.options.viewBox)||void 0===a?void 0:a.y1)&&void 0!==l?l:0),u.y2=u.y2+(null!==(d=null===(h=i.options.viewBox)||void 0===h?void 0:h.y1)&&void 0!==d?d:0),u}(n,s,t).intersect({x1:a-t.scrollLeft,x2:h-t.scrollLeft,y1:l-t.scrollTop,y2:d-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,xt({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:h-a,y1:0,y2:d-l},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:e=>{const i=this.stage,o=e.window.getContext(),r=i.window.getViewBoxTransform(),n=i.window.getViewBox();o.inuse=!0,o.clearMatrix(),o.setTransform(r.a,r.b,r.c,r.d,r.e,r.f,!0),o.translate(n.x1,n.y1),o.setTransformForCurrent(!0),o.beginPath(),o.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),o.clip(),o.clearMatrix(),t.options.canvas&&!e.needRender&&(e.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(t){t.window.getContext().inuse=!1,t.needRender=!1,u.resumeRender()}}));const u=this.activeChartInstance.getStage(),g=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),u.window.setViewBoxTransform&&u.window.setViewBoxTransform(g.a,g.b,g.c,g.d,g.e,g.f),this.activeChartInstance.renderSync(),null===(i=null===(e=t.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",(e=>{dw.temp&&t.scenegraph.updateChartState(null==e?void 0:e.datum)})),this.activeChartInstance.on("brushEnd",(e=>{var i;t.scenegraph.updateChartState(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.inBrushData),dw.temp=0,setTimeout((()=>{dw.temp=1}),0)})),null===(r=(o=t)._bindChartEvent)||void 0===r||r.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,null===(t=this.activeChartInstance)||void 0===t||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),null===(e=this.activeChartInstance)||void 0===e||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,i,o,r,n,s,a;const l=this.parent,h=this.attribute.cellPadding,d=this.stage.table,{x1:c,y1:u,x2:g,y2:p}=l.globalAABBBounds;return{x1:Math.ceil(c+h[3]+d.scrollLeft+(null!==(e=null===(t=d.options.viewBox)||void 0===t?void 0:t.x1)&&void 0!==e?e:0)),x2:Math.ceil(c+l.attribute.width-h[1]+d.scrollLeft+(null!==(o=null===(i=d.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0)),y1:Math.ceil(u+h[0]+d.scrollTop+(null!==(n=null===(r=d.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==n?n:0)),y2:Math.ceil(u+l.attribute.height-h[2]+d.scrollTop+(null!==(a=null===(s=d.options.viewBox)||void 0===s?void 0:s.y1)&&void 0!==a?a:0))}}}dw.temp=1;const cw=[],uw=[];let gw=5,pw=!1;function fw(t){J(t)&&(gw=t)}function vw(t){var e,i,o,r,n,s;const{axes:a,dataId:l,data:h,spec:d,ClassType:c,canvas:u,mode:g,modeParams:p,dpr:f}=t.attribute;let{chartInstance:v}=t;v||(v=new c(d,{renderCanvas:u,mode:"node"===g?"node":"desktop-browser",modeParams:p,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:f,interactive:!1,animation:!1,autoFit:!1}),v.renderSync(),t.chartInstance=v);const b=t.getViewBox();b.x2<=b.x1&&(b.x2=b.x1+1),b.y2<=b.y1&&(b.y2=b.y1+1),v.updateViewBox({x1:0,x2:b.x2-b.x1,y1:0,y2:b.y2-b.y1},!1,!1);const m=v.getStage(),C=t.globalTransMatrix.clone(),y=t.stage.window.getViewBoxTransform();C.multiply(y.a,y.b,y.c,y.d,y.e,y.f),m.window.setViewBoxTransform&&m.window.setViewBoxTransform(C.a,C.b,C.c,C.d,C.e,C.f);const{table:w}=t.getRootNode();let x=!1;if(w.options.specFormat){const e=w.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;v.updateSpecSync(t),x=!0}}if(!x)if(null==a||a.forEach(((t,e)=>{var i,o,r,n;"band"===t.type?v.updateModelSpec({type:"axes",index:e},{domain:t.domain.slice(0)},!0):v.updateModelSpecSync({type:"axes",index:e},{min:null!==(o=null===(i=t.range)||void 0===i?void 0:i.min)&&void 0!==o?o:0,max:null!==(n=null===(r=t.range)||void 0===r?void 0:r.max)&&void 0!==n?n:0},!0)})),null===(i=null===(e=w.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,v),"string"==typeof l)v.updateDataSync(l,null!=h?h:[]);else{const t=[];for(const e in l){const i=l[e],s=d.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(o=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==o?o:[]:null!=h?h:[],fields:null===(r=null==s?void 0:s.data)||void 0===r?void 0:r.fields}),v.updateFullDataSync||v.updateDataSync(e,i?null!==(n=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==n?n:[]:null!=h?h:[])}null===(s=v.updateFullDataSync)||void 0===s||s.call(v,t)}!function(t,e){var i;const{viewWidth:o,viewHeight:r}=t;if(o<mw&&r<mw)return e.cacheCanvas=Cw(t),void(e.isShareChartSpec||(null===(i=e.chartInstance)||void 0===i||i.release(),e.chartInstance=null,e.setAttribute("chartInstance",null)));const n=Math.ceil(r/mw),s=Math.ceil(o/mw),a=[];for(let e=0;e<n;e++)for(let i=0;i<s;i++){const n=i*mw,s=e*mw,l=n+mw>o?o:n+mw,h=s+mw>r?r:s+mw,d=l-n,c=h-s,u=new Qt;u.setValue(n,s,l,h);const g=Cw(t,!1,u);a.push({canvas:g,x:n,y:s,width:d,height:c})}e.cacheCanvas=a}(v.getStage(),t)}function bw(t){pw=!0,uw.length>0?requestAnimationFrame((()=>{const e=uw.splice(0,gw);cw.splice(0,gw),e.forEach((t=>{vw(t),t.addUpdateBoundTag()})),t.render(),bw(t)})):pw=!1}const mw=2e3;function Cw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if("released"===t.releaseStatus)return null;const o=t.window.getViewBoxTransform(),r=function(t){let e=arguments.length>2?arguments[2]:void 0;const i=t.window.getViewBoxTransform(),o=Bo.get(Eo),r=e?-e.x1:0,n=e?-e.y1:0,s=e?e.x2:t.viewWidth,a=e?e.y2:t.viewHeight,l=e?e.width():t.viewWidth,h=e?e.height():t.viewHeight;return o.create({viewBox:{x1:r,y1:n,x2:s,y2:a},width:l*i.a,height:h*i.d,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""}),t.renderTo(o),o}(t,e,i);r.setViewBoxTransform(o.a,o.b,o.c,o.d,0,0),t.renderTo(r);const n=r.getNativeHandler();return n.nativeCanvas?n.nativeCanvas:null}var yw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};const ww=Symbol.for("ChartRender");let xw=class extends Ls{constructor(){super(...arguments),this.numberType=hw}drawShape(t,e,i,o,r,n,s,a){var l,h,d,c;const u=qo(t,null==n?void 0:n.theme).group,{dataId:g,data:p,spec:f}=t.attribute,{width:v=u.width,height:b=u.height}=(t.getViewBox(),t.attribute),{table:m}=t.getRootNode(),{active:C,cacheCanvas:y,activeChartInstance:w}=t;if(!C&&y)rt(y)?y.forEach((t=>{const{x:i,y:o,width:r,height:n,canvas:s}=t;e.drawImage(s,i,o,r,n)})):e.drawImage(y,i,o,v,b);else if(w){if(m.options.specFormat){const e=m.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;return void w.updateSpecSync(t)}}const e=t.getViewBox();w.updateViewBox({x1:0,x2:e.x2-e.x1,y1:0,y2:e.y2-e.y1},!1,!1);const i=w.getStage();i.needRender=!0;const o=t.globalTransMatrix.clone(),r=t.stage.window.getViewBoxTransform().clone();if(r.multiply(o.a,o.b,o.c,o.d,o.e,o.f),i.window.setViewBoxTransform(r.a,r.b,r.c,r.d,r.e,r.f),"string"==typeof g)w.updateDataSync(g,null!=p?p:[]);else{const t=[];for(const e in g){const i=g[e],o=f.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(l=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==l?l:[]:null!=p?p:[],fields:null===(h=null==o?void 0:o.data)||void 0===h?void 0:h.fields}),w.updateFullDataSync||w.updateDataSync(e,i?null!==(d=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==d?d:[]:null!=p?p:[])}null===(c=w.updateFullDataSync)||void 0===c||c.call(w,t)}}else m.internalProps.renderChartAsync?(-1===cw.indexOf(`${t.parent.col}+${t.parent.row}`)&&(cw.push(`${t.parent.col}+${t.parent.row}`),uw.push(t)),pw||bw(m)):vw(t)}draw(t,e,i,o){this._draw(t,{},!1,i,o)}};xw=yw([m()],xw);var Sw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let _w=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{shape:g}=t.attribute;if("circle"===g){const{width:r=l.width,height:n=l.height}=t.attribute;e.beginPath(),e.arc(i+r/2,o+n/2,Math.min(r,n)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};_w=Sw([m()],_w);let Aw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{shape:g}=t.attribute;"circle"===g&&e.restore()}};function Rw(t,e,i,o){var r;const{highlightScope:n,disableHeader:s,cellPos:a}=t.hover,l=t.table,h=l.isHeader(e,i);if(h&&s)return;let d;if(n===_v.single&&a.col===e&&a.row===i?d="cellBgColor":n===_v.column&&a.col===e?d=a.col===e&&a.row===i?"cellBgColor":"inlineColumnBgColor":n===_v.row&&a.row===i?d=a.col===e&&a.row===i?"cellBgColor":"inlineRowBgColor":n===_v.cross&&(a.col===e&&a.row===i?d="cellBgColor":a.col===e?d="inlineColumnBgColor":a.row===i&&(d="inlineRowBgColor")),d){let t;if(h){const n=l.getHeaderDefine(e,i);t=null==n?void 0:n.disableHeaderHover,o.firstChild&&"axis"===o.firstChild.name&&(null===(r=l.options.hover)||void 0===r?void 0:r.disableAxisHover)&&(t=!0)}else{const o=l.getBodyColumnDefine(e,i);t=null==o?void 0:o.disableHover}t&&(d=void 0)}return d}function Bw(t,e,i,o){const{highlightScope:r,disableHeader:n,cellPos:s,ranges:a}=t.select;let l;if(1===(null==a?void 0:a.length)&&a[0].end.col===a[0].start.col&&a[0].end.row===a[0].start.row){const o=t.table,a=o.isHeader(e,i);if(a&&n)return;if(r===_v.single&&s.col===e&&s.row===i?l="cellBgColor":r===_v.column&&s.col===e?l=s.col===e&&s.row===i?"cellBgColor":"inlineColumnBgColor":r===_v.row&&s.row===i?l=s.col===e&&s.row===i?"cellBgColor":"inlineRowBgColor":r===_v.cross&&(s.col===e&&s.row===i?l="cellBgColor":s.col===e?l="inlineColumnBgColor":s.row===i&&(l="inlineRowBgColor")),l){let t;if(a){const r=o.getHeaderDefine(e,i);t=null==r?void 0:r.disableHeaderSelect}else{const r=o.getBodyColumnDefine(e,i);t=null==r?void 0:r.disableSelect}t&&(l=void 0)}}else if("replace"===t.table.theme.selectionStyle.selectionFillMode)for(let t=0;t<a.length;t++){const o=a[t],r=Math.min(o.start.col,o.end.col),n=Math.max(o.start.col,o.end.col),s=Math.min(o.start.row,o.end.row),h=Math.max(o.start.row,o.end.row);if(r<=e&&s<=i&&n>=e&&h>=i){l="cellBgColor";break}}return l}function Mw(t,e,i){const o=t.getBodyColumnDefine(e,i),r=t.isHeader(e,i);return!(!(null==o?void 0:o.disableSelect)||r)||!(!r||!(null==o?void 0:o.disableHeaderSelect))}Aw=Sw([m()],Aw);var Tw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Pw=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{stroke:g=l.stroke,strokeArrayWidth:p=l.strokeArrayWidth,strokeArrayColor:f=l.strokeArrayColor}=t.attribute;g&&(Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};Pw=Tw([m()],Pw);let kw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){var u;const{stroke:g=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:f=l.strokeArrayWidth,lineWidth:v=l.lineWidth,strokeColor:b=l.stroke,cornerRadius:m=l.cornerRadius}=t.attribute;let C,y,{width:w=l.width,height:x=l.height}=t.attribute;if(g&&(Array.isArray(f)||0!==v)&&(Array.isArray(p)||Array.isArray(f))){if("number"==typeof v&&1&v||Array.isArray(f)&&f.some((t=>1&t))){const e=t.stage.table;if(!e)return;const r="bottom-right"===(null==e?void 0:e.theme.cellBorderClipDirection);r?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5),(null===(u=e.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(w=Math.round(w),x=Math.round(x));const{width:n,height:s}=jw(t,Math.ceil(w),Math.ceil(x),r);C=n,y=s}else C=Math.ceil(w),y=Math.ceil(x);0===m||rt(m)&&m.every((t=>0===t))?Hw(t,e,i,o,l,g,f||v,p||b,C,y):(e.beginPath(),Qs(e,i,o,C,y,m,new Array(4).fill(0).map(((r,n)=>(r,s,a,h)=>{Yw(n,r,s,a,h,t,e,i,o,l,g,f||v,p||b,C,y)}))),e.stroke())}}};function Lw(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let i=0;i<t.length;i++){const o=t[i];if(o)if(e){if(o!==e)return{isSplitDraw:!0}}else e=o}return{isSplitDraw:!1,width:e}}function Hw(t,e,i,o,r,n,s,a,l,h,d,c){var u,g,p,f;const v=Lw(s),b=!Array.isArray(s),m=!Array.isArray(n),C=Array.isArray(c),y=Array.isArray(a)||v.isSplitDraw;e.setStrokeStyle(t,t.attribute,i,o,r);const{lineDash:w=r.lineDash}=t.attribute;let x=!1;w.length&&w.some((t=>Array.isArray(t)))&&(x=!0),e.beginPath(),e.moveTo(i,o);const S=(m||n[0])&&(b||s[0]),_=(m||n[1])&&(b||s[1]),A=(m||n[2])&&(b||s[2]),R=(m||n[3])&&(b||s[3]);if(S){const t=(b?v.width:s[0])/2,r=(b?v.width:s[0])/2;C&&Array.isArray(c[0])?(e.moveTo(i-t+(l+t+r)*c[0][0],o),e.lineTo(i-t+(l+t+r)*(c[0][1]-c[0][0]),o),e.moveTo(i+l+r,o)):(e.moveTo(i-t,o),e.lineTo(i+l+r,o)),(y||x)&&(a&&a[0]?e.strokeStyle=a[0]:e.strokeStyle="transparent",b||(e.lineWidth=s[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(u=w[0])&&void 0!==u?u:[]),e.stroke(),e.beginPath(),e.moveTo(i+l,o))}else e.moveTo(i+l,o);if(_){const t=(b?v.width:s[1])/2,r=(b?v.width:s[1])/2;C&&Array.isArray(c[1])?(e.moveTo(i+l,o-t+h*c[1][0]),e.lineTo(i+l,o-t+(h+t+r)*(c[1][1]-c[1][0])),e.moveTo(i+l,o+h+r)):(e.moveTo(i+l,o-t),e.lineTo(i+l,o+h+r)),(y||x)&&(a&&a[1]?e.strokeStyle=a[1]:e.strokeStyle="transparent",b||(e.lineWidth=s[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(g=w[1])&&void 0!==g?g:[]),e.stroke(),e.beginPath(),e.moveTo(i+l,o+h))}else e.moveTo(i+l,o+h);if(A){const t=(b?v.width:s[2])/2,r=(b?v.width:s[2])/2;C&&Array.isArray(c[2])?(e.moveTo(i-t+(l+t+r)*c[2][0],o+h),e.lineTo(i-t+(l+t+r)*(c[2][1]-c[2][0]),o+h),e.moveTo(i-t,o+h)):(e.moveTo(i-t,o+h),e.lineTo(i+l+r,o+h)),(y||x)&&(a&&a[2]?e.strokeStyle=a[2]:e.strokeStyle="transparent",b||(e.lineWidth=s[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(p=w[2])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+h))}else e.moveTo(i,o+h);if(R){const t=(b?v.width:s[3])/2,r=(b?v.width:s[3])/2;C&&Array.isArray(c[3])?(e.moveTo(i,o-t+(h+t+r)*c[3][0]),e.lineTo(i,o-t+(h+t+r)*(c[3][1]-c[3][0])),e.moveTo(i,o-t)):(e.moveTo(i,o-t),e.lineTo(i,o+h+r)),(y||x)&&(a&&a[3]?e.strokeStyle=a[3]:e.strokeStyle="transparent",b||(e.lineWidth=s[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(f=w[3])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o))}else e.moveTo(i,o);y||x||(!b&&v.width&&(e.lineWidth=v.width),e.stroke()),e.lineDashOffset=0,e.setLineDash([])}kw=Tw([m()],kw);let Ew=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){var g;const{lineDash:p=l.lineDash,stroke:f=l.stroke,strokeArrayColor:v=l.strokeArrayColor,strokeArrayWidth:b=l.strokeArrayWidth}=t.attribute;f&&Array.isArray(p)&&p.length&&(null===(g=p[0])||void 0===g?void 0:g.length)&&!Array.isArray(v)&&!Array.isArray(b)&&(u.doStroke=!1)}};Ew=Tw([m()],Ew);let zw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){var u,g,p,f,v,b;const{lineDash:m=l.lineDash,stroke:C=l.stroke,strokeArrayColor:y=l.strokeArrayColor,strokeArrayWidth:w=l.strokeArrayWidth,lineWidth:x=l.lineWidth}=t.attribute;if(!C||!(Array.isArray(m)&&m.length&&(null===(u=m[0])||void 0===u?void 0:u.length))||Array.isArray(y)||Array.isArray(w))return;const S=t.stage.table;if(!S)return;const _=rt(m[0])?function(t){return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:t}(m):[m,m,m,m];let A,R,{width:B=l.width,height:M=l.height}=t.attribute;if((null===(g=S.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)?(B=Math.round(B),M=Math.round(M)):(B=Math.ceil(B),M=Math.ceil(M)),1&x){const e="bottom-right"===S.theme.cellBorderClipDirection,r=0,n=0;e?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:s,height:a}=jw(t,Math.ceil(B+r),Math.ceil(M+n),e);A=s,R=a}else A=Math.ceil(B),R=Math.ceil(M);e.setStrokeStyle(t,t.attribute,i,o,l),e.beginPath(),e.moveTo(i,o),e.lineTo(i+A,o),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(p=_[0])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i+A,o),e.lineTo(i+A,o+R),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(f=_[1])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+R),e.lineTo(i+A,o+R),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(v=_[2])&&void 0!==v?v:[]),e.stroke(),e.beginPath(),e.moveTo(i,o),e.lineTo(i,o+R),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(b=_[3])&&void 0!==b?b:[]),e.stroke(),e.lineDashOffset=0,e.setLineDash([])}};zw=Tw([m()],zw);let Fw=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{lineWidth:g=l.lineWidth,stroke:p=l.stroke,lineDash:f=l.lineDash,strokeArrayWidth:v=l.strokeArrayWidth,strokeArrayColor:b=l.strokeArrayColor,notAdjustPos:m}=t.attribute;!0!==m&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(b)&&!Array.isArray(v)&&1&g&&(u.doStroke=!1)}};Fw=Tw([m()],Fw);let Iw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){var u;const{lineWidth:g=l.lineWidth,stroke:p=l.stroke,lineDash:f=l.lineDash,strokeArrayWidth:v=l.strokeArrayWidth,strokeArrayColor:b=l.strokeArrayColor,notAdjustPos:m,cornerRadius:C=l.cornerRadius}=t.attribute;let{width:y=l.width,height:w=l.height}=t.attribute;if(!0!==m&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(b)&&!Array.isArray(v)&&1&g){const r=t.stage.table;if(!r)return;(null===(u=r.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(y=Math.round(y),w=Math.round(w)),e.beginPath();const n="bottom-right"===(null==r?void 0:r.theme.cellBorderClipDirection),s=0,a=0;n?(i=Math.floor(i)-.5,o=Math.floor(o)-.5):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:h,height:d}=jw(t,Math.ceil(y),Math.ceil(w),n);C?Qs(e,i,o,h+s,d+a,C):e.rect(i,o,h,d),e.setStrokeStyle(t,t.attribute,i,o,l),e.stroke()}}};Iw=Tw([m()],Iw);let Ow=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){if("cell"===t.role){const e=t.stage.table;if(e){const i=function(t,e){var i,o,r,n,s,a,l,h,d,c,u;let g,p;if("cell"===t.role&&J(t.mergeStartCol)&&J(t.mergeStartRow)&&J(t.mergeEndCol)&&J(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:r,rowEnd:n}=Py(t,e.scenegraph);for(let t=i;t<=o;t++)for(let i=r;i<=n;i++){const o=Bw(e.stateManager,t,i);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=Bw(e.stateManager,t.col,t.row));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.select)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.select):f.isColumnHeader(t.col,t.row)?p=null===(r=e.theme.headerStyle)||void 0===r?void 0:r.select:f.isRowHeader(t.col,t.row)?p=null===(n=e.theme.rowHeaderStyle)||void 0===n?void 0:n.select:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.select)||(e.isListTable()?null===(a=e.theme.bodyStyle)||void 0===a?void 0:a.select:null===(l=e.theme.headerStyle)||void 0===l?void 0:l.select):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.select)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.select:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.select):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.select),VC(g,p,t.col,t.row,e)}(t,e);if(i)t.attribute._vtableHightLightFill=i;else if(e.stateManager.interactionState!==Sv.scrolling){const i=function(t,e){var i,o,r,n,s,a,l,h,d,c,u;let g,p;if("cell"===t.role&&J(t.mergeStartCol)&&J(t.mergeStartRow)&&J(t.mergeEndCol)&&J(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:r,rowEnd:n}=Py(t,e.scenegraph);for(let s=i;s<=o;s++)for(let i=r;i<=n;i++){const o=Rw(e.stateManager,s,i,t);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=Rw(e.stateManager,t.col,t.row,t));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.hover)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.hover):f.isColumnHeader(t.col,t.row)?p=null===(r=e.theme.headerStyle)||void 0===r?void 0:r.hover:f.isRowHeader(t.col,t.row)?p=null===(n=e.theme.rowHeaderStyle)||void 0===n?void 0:n.hover:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.hover)||(e.isListTable()?null===(a=e.theme.bodyStyle)||void 0===a?void 0:a.hover:null===(l=e.theme.headerStyle)||void 0===l?void 0:l.hover):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.hover)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.hover:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.hover):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.hover),VC(g,p,t.col,t.row,e)}(t,e);i&&(t.attribute._vtableHightLightFill=i)}}}}};Ow=Tw([m()],Ow);let Dw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){if(t.attribute._vtableHightLightFill)if(d);else if(s){const r=t.attribute.fill;t.attribute.fill=t.attribute._vtableHightLightFill,e.setCommonStyle(t,t.attribute,i,o,l),e.fill(),t.attribute.fill=r,t.attribute._vtableHightLightFill=void 0}}};Dw=Tw([m()],Dw);let Ww=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){var g,p,f,v,b,m;const C=t.stage.table;C&&("body"===t.role?Gw(e,-(null!==(g=t.attribute.x)&&void 0!==g?g:0)+C.getFrozenColsWidth(),-(null!==(p=t.attribute.y)&&void 0!==p?p:0)+C.getFrozenRowsHeight(),t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight()):"row-header"===t.role?Gw(e,0,-(null!==(f=t.attribute.y)&&void 0!==f?f:0)+C.getFrozenRowsHeight(),C.getFrozenColsWidth(),t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight()):"col-header"===t.role?Gw(e,-(null!==(v=t.attribute.x)&&void 0!==v?v:0)+C.getFrozenColsWidth(),0,t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),C.getFrozenRowsHeight()):"right-frozen"===t.role?Gw(e,0,-(null!==(b=t.attribute.y)&&void 0!==b?b:0)+C.getFrozenRowsHeight(),C.getRightFrozenColsWidth(),t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight()):"bottom-frozen"===t.role?Gw(e,-(null!==(m=t.attribute.x)&&void 0!==m?m:0)+C.getFrozenColsWidth(),0,t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),C.getBottomFrozenRowsHeight()):"corner-header"===t.role?Gw(e,0,0,C.getFrozenColsWidth(),C.getFrozenRowsHeight()):"corner-right-top-header"===t.role?Gw(e,0,0,C.getRightFrozenColsWidth(),C.getFrozenRowsHeight()):"corner-right-bottom-header"===t.role?Gw(e,0,0,C.getRightFrozenColsWidth(),C.getBottomFrozenRowsHeight()):"corner-left-bottom-header"===t.role&&Gw(e,0,0,C.getFrozenColsWidth(),C.getBottomFrozenRowsHeight()))}};Ww=Tw([m()],Ww);const Nw=Math.pow(2,24);function Gw(t,e,i,o,r){t.beginPath();const n=t.applyedMatrix;Math.abs(n.f)>Nw||Math.abs(n.g)>Nw?t.rect(e-Nw,i-Nw,o+2*Nw,r+2*Nw):t.rect(e,i,o,r)}function jw(t,e,i,o){const r=t.stage.table;if("cell"===t.role){let n=t.col,s=t.row;const a=lm(r,n,s);a&&(n=a.end.col,s=a.end.row),(r&&n===r.colCount-1&&!o||r&&n===r.frozenColCount-1&&r.scrollLeft&&!o)&&(e-=1),(r&&s===r.rowCount-1&&!o||r&&s===r.frozenRowCount-1&&r.scrollTop&&!o)&&(i-=1)}else"corner-frozen"===t.role&&(r&&r.scrollLeft&&!o&&(e-=1),r&&r.scrollTop&&!o&&(i-=1));return{width:e,height:i}}var Uw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Vw=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){const{stroke:g=l.stroke,strokeArrayWidth:p=l.strokeArrayWidth,strokeArrayColor:f=l.strokeArrayColor}=t.attribute;g&&(Array.isArray(g)||Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};Vw=Uw([m()],Vw);let Xw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c){const{width:u=l.width,height:g=l.height,stroke:p=l.stroke,strokeArrayColor:f=l.strokeArrayColor,strokeArrayWidth:v=l.strokeArrayWidth,lineWidth:b=l.lineWidth,strokeColor:m=l.stroke,cornerRadius:C=l.cornerRadius}=t.attribute;if(p&&(Array.isArray(v)||0!==b)&&(Array.isArray(p)||Array.isArray(f)||Array.isArray(v))){const r=0,n=0;"border-rect"!==t.name&&"table-border-rect"!==t.name&&("number"==typeof b&&1&b||Array.isArray(v)&&v.some((t=>1&t)))&&(i=Math.floor(i)+.5,o=Math.floor(o)+.5),0===C||rt(C)&&C.every((t=>0===t))?Hw(t,e,i,o,l,p,v||b,f||m,Math.ceil(u+r),Math.ceil(g+n)):(e.beginPath(),Qs(e,i,o,u,g,C,new Array(4).fill(0).map(((s,a)=>(s,h,d,c)=>{Yw(a,s,h,d,c,t,e,i,o,l,p,v||b,f||m,Math.ceil(u+r),Math.ceil(g+n))}))),e.stroke())}}};function Yw(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f,v,b,m;const C=n,y=h,w=Lw(c),x=!Array.isArray(c),S=!Array.isArray(d),_=Array.isArray(u)||w.isSplitDraw;s.setStrokeStyle(n,n.attribute,a,l,h);const{lineDash:A=y.lineDash}=C.attribute;let R=!1;A.length&&A.some((t=>Array.isArray(t)))&&(R=!0),s.moveTo(a,l);const B=(S||d[0])&&(x||c[0]),M=(S||d[1])&&(x||c[1]),T=(S||d[2])&&(x||c[2]),P=(S||d[3])&&(x||c[3]);B&&0===t?(x?w.width:c[0],x?w.width:c[0],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[0]?s.strokeStyle=u[0]:s.strokeStyle="transparent",x||(s.lineWidth=c[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash(null!==(f=A[0])&&void 0!==f?f:[]),s.stroke(),s.beginPath())):0===t&&s.moveTo(a+g,l),M&&1===t?(x?w.width:c[1],x?w.width:c[1],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[1]?s.strokeStyle=u[1]:s.strokeStyle="transparent",x||(s.lineWidth=c[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash(null!==(v=A[1])&&void 0!==v?v:[]),s.stroke(),s.beginPath(),s.moveTo(a+g,l+p))):1===t&&s.moveTo(a+g,l+p),T&&2===t?(x?w.width:c[2],x?w.width:c[2],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[2]?s.strokeStyle=u[2]:s.strokeStyle="transparent",x||(s.lineWidth=c[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash(null!==(b=A[2])&&void 0!==b?b:[]),s.stroke(),s.beginPath(),s.moveTo(a,l+p))):2===t&&s.moveTo(a,l+p),P&&3===t?(x?w.width:c[3],x?w.width:c[3],s.moveTo(e,i),s.lineTo(o,r),(_||R)&&(u&&u[3]?s.strokeStyle=u[3]:s.strokeStyle="transparent",x||(s.lineWidth=c[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash(null!==(m=A[3])&&void 0!==m?m:[]),s.stroke(),s.beginPath(),s.moveTo(a,l))):3===t&&s.moveTo(a,l),_||R||(!x&&w.width&&(s.lineWidth=w.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}Xw=Uw([m()],Xw);var $w=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Kw,qw=class{constructor(){this.order=1,this.interceptors=[new Zw]}afterDrawItem(t,e,i,o,r){for(let n=0;n<this.interceptors.length;n++)if(this.interceptors[n].afterDrawItem&&this.interceptors[n].afterDrawItem(t,e,i,o,r))return!0;return!1}beforeDrawItem(t,e,i,o,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let n=0;n<this.interceptors.length;n++)if(this.interceptors[n].beforeDrawItem&&this.interceptors[n].beforeDrawItem(t,e,i,o,r))return!0;return!1}};qw=$w([m()],qw);class Zw{constructor(){this.order=1}afterDrawItem(t,e,i,o,r){return"image"===t.type&&this.drawItem(t,e,i,o,r),!1}drawItem(t,e,i,o,r){const{image:n}=t.attribute;if(!n||!t.resources)return!1;if("loading"!==t.resources.get(n).state)return!1;if(!Kw){const t=GC(),e=t.loading_pic.svg,i=t.loading_pic.width,o=t.loading_pic.height;Kw=ud({width:i,height:o,image:e})}const{image:s}=Kw.attribute;if(!n||!Kw.resources)return!1;const a=Kw.resources.get(s);if("success"!==a.state)return!1;const{context:l}=i;l.highPerformanceSave(),t.parent&&l.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&l.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const h=t.AABBBounds,{width:d,height:c}=UC(a.data.width,a.data.height,h.width(),h.height());return l.drawImage(a.data,h.x1+(h.width()-d)/2,h.y1+(h.height()-c)/2,d,c),l.highPerformanceRestore(),!0}}var Jw=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s};let Qw=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,r,n,s,a,l,h,d,c,u){var g,p;const{text:f,underline:v=l.underline,lineThrough:b=l.lineThrough,direction:m=l.direction,whiteSpace:C=l.whiteSpace,fontSize:y=l.fontSize,verticalMode:w=l.verticalMode,ellipsis:x=l.ellipsis,textAlign:S=l.textAlign,textBaseline:_=l.textBaseline,x:A=l.x,y:R=l.y}=t.attribute;let B=!1;if(Array.isArray(t)){const e=null===(g=t.cache)||void 0===g?void 0:g.layoutData;x&&e&&e.lines.every((t=>""===t.str))&&(B=!0)}else{const{cache:e}=t;x&&e&&""===e.clipedText&&0===e.clipedWidth&&(B=!0)}if(!B)return;const M=ot(x)?x:"...",T=null!==(p=Hr(t.attribute.lineHeight,y))&&void 0!==p?p:y;let P=0;T!==y&&("top"===_?P=(T-y)/2:"middle"===_||"bottom"===_&&(P=-(T-y)/2)),n&&(c?c(e,t.attribute,l):a&&(e.setStrokeStyle(t,t.attribute,A-i,R-o,l),e.strokeText(M,A,R+P))),r&&(d?d(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,A-i,R-o,l),e.fillText(M,A,R+P),this.drawUnderLine(v,b,t,A,R+P,0,l,e,M)))}drawUnderLine(t,e,i,o,r,n,s,a,l){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fontFamily:u=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:p=s.fontStyle,fill:f=s.fill,opacity:v=s.opacity,underlineOffset:b=s.underlineOffset,underlineDash:m=s.underlineDash,fillOpacity:C=s.fillOpacity}=i.attribute;if(!t&&!e)return;const y=Cy.measureTextWidth(l,{fontSize:c,fontFamily:u,fontWeight:g,fontStyle:p}),w=vs(h,y),x=bs(d,c,c),S={lineWidth:0,stroke:f,opacity:v,strokeOpacity:C};if(t){S.lineWidth=t,a.setStrokeStyle(i,S,o,r,s),a.setLineDash(m),a.beginPath();const e=r+x+c+b;a.moveTo(o+w,e,n),a.lineTo(o+w+y,e,n),a.stroke()}if(e){S.lineWidth=e,a.setStrokeStyle(i,S,o,r,s),a.beginPath();const t=r+x+c/2;a.moveTo(o+w,t,n),a.lineTo(o+w+y,t,n),a.stroke()}}};Qw=Jw([m()],Qw);var tx=new n(((t,e,i,o)=>{i(ia)?o(ia).to(Vw).inSingletonScope():(t(Vw).toSelf().inSingletonScope(),t(us).toService(Vw)),i(oa)?o(oa).to(Xw).inSingletonScope():(t(Xw).toSelf().inSingletonScope(),t(us).toService(Xw)),t(xw).toSelf().inSingletonScope(),t(ww).to(xw),t(ll).to(xw),t(_w).toSelf().inSingletonScope(),t(cs).toService(_w),t(Aw).toSelf().inSingletonScope(),t(cs).toService(Aw),t(Ow).toSelf().inSingletonScope(),t(ds).toService(Ow),t(Dw).toSelf().inSingletonScope(),t(ds).toService(Dw),t(kw).toSelf().inSingletonScope(),t(ds).toService(kw),t(Pw).toSelf().inSingletonScope(),t(ds).toService(Pw),t(Ew).toSelf().inSingletonScope(),t(ds).toService(Ew),t(zw).toSelf().inSingletonScope(),t(ds).toService(zw),t(Fw).toSelf().inSingletonScope(),t(ds).toService(Fw),t(Iw).toSelf().inSingletonScope(),t(ds).toService(Iw),t(Ww).toSelf().inSingletonScope(),t(ds).toService(Ww),t(qw).toSelf().inSingletonScope(),t(yl).toService(qw),t(Qw).toSelf().inSingletonScope(),t(ps).toService(Qw)}));function ex(t,e,i,o){var r,n,s,a,l,h,d,c;"undefined"!=typeof window&&window.performance.now(),e=null!=e?e:0,i=null!=i?i:t.colCount-1,0===e&&i===t.colCount-1&&t._clearColRangeWidthsMap();const u=t.internalProps.layoutMap;t.isPivotTable()&&(u.enableUseGetBodyCache(),u.enableUseHeaderPathCache());const g=[],p=[];if(o)for(let e=0;e<t.colCount;e++)g[e]=t.getColWidth(e);for(let l=e;l<=i;l++){let e;if(t.internalProps.transpose||"only-header"!==(null===(n=null===(r=t.internalProps.layoutMap.columnObjects)||void 0===r?void 0:r[l])||void 0===n?void 0:n.columnWidthComputeMode)&&"only-header"!==t.columnWidthComputeMode||!("showHeader"in t.internalProps.layoutMap))e=t.internalProps.transpose||"only-body"!==(null===(a=null===(s=t.internalProps.layoutMap.columnObjects)||void 0===s?void 0:s[l])||void 0===a?void 0:a.columnWidthComputeMode)&&"only-body"!==t.columnWidthComputeMode?ix(l,0,t.rowCount-1,t):ix(l,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t);else{const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,e=ix(l,0,t.internalProps.layoutMap.headerLevelCount-1,t),t.internalProps.layoutMap.showHeader=i}t._setColContentWidth(l,e),t.getColWidth(l)!==e&&t._clearColRangeWidthsMap(l),o?p[l]=Math.round(t._adjustColWidth(l,e)):t._setColWidth(l,t._adjustColWidth(l,e),!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,r=0,n=t.colCount;if("only-body"===t.widthAdaptiveMode){for(let e=0;e<t.colCount;e++){const r=o&&null!==(l=p[e])&&void 0!==l?l:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r)}r=t.rowHeaderLevelCount,n=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount}ax(e-i,r,n,o,p,t)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,r=0;for(let e=0;e<t.colCount;e++){const n=o&&null!==(h=p[e])&&void 0!==h?h:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n),r+=n}r<e&&r>i&&ax(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,o,p,t)}if(o){for(let e=0;e<t.colCount;e++){const i=null!==(c=null!==(d=p[e])&&void 0!==d?d:t.getColWidth(e))&&void 0!==c?c:t.getColWidth(e);i!==g[e]&&t._setColWidth(e,i,!1,!0)}t.stateManager.checkFrozen();for(let e=0;e<t.colCount;e++){const i=t.getColWidth(e);i!==g[e]&&t.scenegraph.updateColWidth(e,i-g[e],!0,!0)}t.scenegraph.updateContainer(!0)}t.isPivotTable()&&(u.disableUseGetBodyCache(),u.disableUseHeaderPathCache())}function ix(t,e,i,o){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=function(t,e){const i=e.getColWidthDefined(t);return e.internalProps._widthResizedColMap.has(t)?e.getColWidth(t):i}(t,o);return o.internalProps.transpose&&"auto"===n&&("only-header"===o.columnWidthComputeMode&&t>=o.rowHeaderLevelCount||"only-body"===o.columnWidthComputeMode&&t<o.rowHeaderLevelCount)&&(n=o.getDefaultColumnWidth(t)),r&&!o.internalProps.transpose?ox(n,t,e,i,r,o):"number"==typeof n?n:"auto"!==n&&"string"==typeof n?o._adjustColWidth(t,o._colWidthDefineToPxWidth(n)):ox(n,t,e,i,r,o)}function ox(t,e,i,o,r,n){var s,a,l,h,d;let c=0,u=1,g=1;if(o-i>5e3&&(g=Math.ceil((o-i)/5e3)),n.isPivotChart()&&e>=n.rowHeaderLevelCount&&e<n.colCount-n.rightFrozenColCount){if(n.internalProps.layoutMap.indicatorsAsCol)return n.defaultColWidth;{const t=n.internalProps.layoutMap.getOptimunWidthForChart(e);if(t>0)return t}}for(let p=i;p<=o;p+=u){if(n.isPivotChart()){const t=n.internalProps.layoutMap,i=t.getAxisConfigInPivotChart(e,p);if(i){const t=hm.getFunction("computeAxisComponentWidth")(i,n);if("number"==typeof t){c=Math.max(t,c);continue}}else if(t.isLeftBottomCorner(e,p)||t.isRightTopCorner(e,p)||t.isRightBottomCorner(e,p))continue}const i=rx(e,p,n);if(i&&(c=Math.max(i.width,c),!i.renderDefault))continue;const o=t;if("number"==typeof o&&"standard"===n.widthMode&&!r){c=Math.max(o,c);continue}const f=n.isHeader(e,p)?null===(s=n._getHeaderLayoutMap(e,p))||void 0===s?void 0:s.headerType:n.getBodyColumnType(e,p);if(J(f)&&"text"!==f&&"link"!==f&&"progressbar"!==f&&"checkbox"!==f&&"radio"!==f){c=Math.max(c,n.getColWidthDefinedNumber(e)||0);continue}let v=0;const b=n.internalProps.layoutMap;if(b.isHeader(e,p)){const t=b.getHeader(e,p);if("only-body"===(null===(a=null==t?void 0:t.define)||void 0===a?void 0:a.columnWidthComputeMode))continue;J(null==t?void 0:t.hierarchyLevel)&&(v=(null!==(l=t.hierarchyLevel)&&void 0!==l?l:0)*(null!==(h=b.rowHierarchyIndent)&&void 0!==h?h:0),b.rowHierarchyTextStartAlignment&&!n.internalProps.headerHelper.getHierarchyIcon(e,p)&&(v+=n.internalProps.headerHelper.getHierarchyIconWidth()))}else if(n.isListTable()){u=g;const t=n.getBodyColumnDefine(e,p);if(null==t?void 0:t.tree){const t=n.dataSource.getIndexKey(n.getRecordShowIndexByCell(e,p));v=Array.isArray(t)&&n.getHierarchyState(e,p)!==Rv.none?(t.length-1)*(null!==(d=b.hierarchyIndent)&&void 0!==d?d:0):0,b.hierarchyTextStartAlignment&&!n.internalProps.bodyHelper.getHierarchyIcon(e,p)&&(v+=n.internalProps.headerHelper.getHierarchyIconWidth())}}const m=nx(e,p,f,n);c=Math.max(m+v,c),u>1&&n.bottomFrozenRowCount>0&&p<n.rowCount-n.bottomFrozenRowCount&&p+u>=n.rowCount-n.bottomFrozenRowCount&&(p=n.rowCount-n.bottomFrozenRowCount-u,u=1,g=1)}const p=n.getMinColWidth(e),f=n.getMaxColWidth(e);return c<p?p:c>f?f:(c<=0&&(c=n.defaultColWidth),c)}function rx(t,e,i){var o,r,n,s;const a=i.getCustomRender(t,e),l=i.getCustomLayout(t,e);if(a||l){let h=1,d=0,c=!1,u=!1;if(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge()){const o=i.getCellRange(t,e);h=o.end.col-o.start.col+1}const g={col:t,row:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:sx(t,e,i),table:i};if(q(l)){const t=l(g);if(t.rootContainer){t.rootContainer=FC(t.rootContainer),zC(t.rootContainer,0,i.getRowHeight(e));const o=t.rootContainer.attribute.width;t.rootContainer.setStage(i.scenegraph.stage),d=o>0?o:null!==(r=t.rootContainer.AABBBounds.width())&&void 0!==r?r:0,c=t.renderDefault,u=t.enableCellPadding}else d=0,c=t.renderDefault,u=t.enableCellPadding}else if("function"==typeof a){const t=a(g);d=null!==(n=null==t?void 0:t.expectedWidth)&&void 0!==n?n:0,c=null==t?void 0:t.renderDefault}else d=null!==(s=null==a?void 0:a.expectedWidth)&&void 0!==s?s:0,c=null==a?void 0:a.renderDefault;if(d=Math.ceil(d),u){const o=Dm(VC("padding",i._getCellStyle(t,e),t,e,i));d+=o[1]+o[3]}return{width:d/h,renderDefault:c}}}function nx(t,e,i,o){var r,n,s;let a=0;const l=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=!1;if("body"!==o.getCellLocation(t,e))c=!0;else{const i=o.getBodyColumnDefine(t,e);c=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(c){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o;t.positionType!==Tv.absoluteRight&&(d+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0))}))}let u=1;if(o.isHeader(t,e)||(null===(r=o.getBodyColumnDefine(t,e))||void 0===r?void 0:r.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);u=i.end.col-i.start.col+1}const g=Dm(VC("padding",h,t,e,o)),p=g[1]+g[3],f=VC("fontSize",h,t,e,o),v=VC("fontFamily",h,t,e,o),b=VC("fontWeight",h,t,e,o);let m;if("checkbox"===i)m=Q(l)?l.text:l;else if("radio"===i)if(rt(l)){m="";const i=o.getBodyColumnDefine(t,e),r=null!==(n=null==i?void 0:i.radioDirectionInCell)&&void 0!==n?n:"vertical";"vertical"===r?l.forEach((t=>{m+=(Q(t)?t.text:t).toString()+"\n"})):"horizontal"===r&&l.forEach((t=>{m+=(Q(t)?t.text:t).toString()}))}else m=Q(l)?l.text:l;else m=l;const C=KC(m,o).text;if(C.length>=1&&(1!==C.length||""!==C[0])?C.forEach((t=>{const e=o.measureText(t,{fontSize:f,fontFamily:v,fontWeight:b}).width;a=Math.max((e+p+4+d)/u,a)})):a=Math.max((p+4+d)/u,a),!1!==o.internalProps.limitMaxAutoWidth&&(a=Math.min("number"==typeof o.internalProps.limitMaxAutoWidth?o.internalProps.limitMaxAutoWidth:450,a)),"checkbox"===i){const i=VC("size",h,t,e,o);if(a+=i,m){const i=VC("spaceBetweenTextAndIcon",h,t,e,o);a+=i}}else if("radio"===i){const i=VC("size",h,t,e,o),r=VC("outerRadius",h,t,e,o),n=at(r)?2*r:i,d=VC("spaceBetweenTextAndIcon",h,t,e,o);if(rt(l)){const i=o.getBodyColumnDefine(t,e),r=VC("spaceBetweenRadio",h,t,e,o),c=null!==(s=null==i?void 0:i.radioDirectionInCell)&&void 0!==s?s:"vertical";"vertical"===c?(a+=n,a+=d):"horizontal"===c&&(a+=(n+d)*l.length,a+=r*(l.length-1))}else a+=n,m&&(a+=d)}return a}function sx(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:null,height:null}}function ax(t,e,i,o,r,n,s){var a,l,h,d;let c=0;const u=[],g=[];let p=0;for(let s=e;s<i;s++){const e=o&&null!==(a=r[s])&&void 0!==a?a:n.getColWidth(s),i=n.getMaxColWidth(s),h=n.getMinColWidth(s);e!==i&&e!==h?(c+=e,u.push(s)):t-=e,(null===(l=n.options.customConfig)||void 0===l?void 0:l.shrinkSparklineFirst)&&"sparkline"===n.getBodyColumnType(s,0)&&(g.push({col:s,width:e}),p+=e-n.defaultColWidth)}const f=t/c;if((null===(h=n.options.customConfig)||void 0===h?void 0:h.shrinkSparklineFirst)&&f<1&&c-t<p)for(let e=0;e<g.length;e++){const{col:i,width:a}=g[e],l=(c-t)/g.length,h=Math.floor(a-l);o?r[i]=n._adjustColWidth(i,h):s?n.scenegraph.setColWidth(i,n._adjustColWidth(i,h)):n._setColWidth(i,n._adjustColWidth(i,h),!1,!0)}else for(let e=0;e<u.length;e++){const i=u[e];let a;a=e===u.length-1?t-u.reduce(((t,e,s)=>{var a;return e!==i?t+(o?null!==(a=r[e])&&void 0!==a?a:n.getColWidth(i):n.getColWidth(e)):t}),0):Math.round((o&&null!==(d=r[i])&&void 0!==d?d:n.getColWidth(i))*f),o?r[i]=n._adjustColWidth(i,a):s?n.scenegraph.setColWidth(i,n._adjustColWidth(i,a)):n._setColWidth(i,n._adjustColWidth(i,a),!1,!0)}}const lx=new jC({});function hx(t,e,i,o,r,n,s,a,l,h){let d,c,u,g=0;t.lastChild&&t.lastChild.row===o-1?g=t.lastChild.attribute.y+t.lastChild.attribute.height:t.colHeight&&(g=t.colHeight);for(let p=o;p<=r;p++){const r=p;let f,v,b,m,C=a.getCellValue(e,r),y=i,w=a.getRowHeight(r);if(a.internalProps.customMergeCell){const t=a.getCustomMerge(e,r);if(t){const{range:e,text:i,style:s,customLayout:l,customRender:h}=t;if(f=e,v=f.start.col!==f.end.col||f.start.row!==f.end.row,v){const t=dx(f,n,a,o>f.start.row);y=t.cellWidth,w=t.cellHeight}C=i,b=s,(l||h)&&(m=HC(l,h,e.start.col,e.start.row,a.getColsWidth(e.start.col,e.end.col),a.getRowsHeight(e.start.row,e.end.row),!1,a.isAutoRowHeight(r),[0,0,0,0],f,a))}}let x=e,S=r;f&&(x=f.start.col,S=f.start.row),("columnHeader"===l||"cornerHeader"===l)&&r>=a.columnHeaderLevelCount&&(l="body");const _="body"!==l?a.getHeaderDefine(x,S):a.getBodyColumnDefine(x,S);let A="body"!==l||(null==_?void 0:_.dragOrder)||!!(null==_?void 0:_.icon)||!!(null==_?void 0:_.tree);if(!f&&(a.internalProps.enableTreeNodeMerge||"body"!==l||(null==_?void 0:_.mergeCell))&&(f=a.getCellRange(e,r),v=f.start.col!==f.end.col||f.start.row!==f.end.row,v)){const t=dx(f,n,a,o>f.start.row);y=t.cellWidth,w=t.cellHeight}let R=!1;if(a.internalProps.enableTreeNodeMerge&&v){const{vtableMergeName:t,vtableMerge:e}=a.getCellRawRecord(f.start.col,f.start.row);R=e,e&&(A=!0,a.options.groupTitleCustomLayout&&(m=HC(a.options.groupTitleCustomLayout,void 0,f.start.col,f.start.row,a.getColsWidth(f.start.col,f.end.col),a.getRowsHeight(f.start.row,f.end.row),!1,a.isAutoRowHeight(r),[0,0,0,0],f,a))),t&&(C=t)}const B=wC(b||a._getCellStyle(f?f.start.col:e,f?f.start.row:r),a,f?f.start.col:e,f?f.start.row:r,VC).theme;B.group.cornerRadius=xC(e,r,a),B.group.width=i,B.group.height=Array.isArray(s)?s[r]:s,B._vtable.padding&&(d=B._vtable.padding),B.text.textAlign&&(c=B.text.textAlign),B.text.textBaseline&&(u=B.text.textBaseline),"body"===l||B.group.fill||(B.group.fill="#fff");const M=R?"text":(a.isHeader(e,r)?a._getHeaderLayoutMap(e,r).headerType:a.getBodyColumnType(e,r))||"text";if(Cb(C)){cx(e,r,0,g,y,w,t),oy(C,a,ry.bind(null,M,C,_,a,e,r,i,y,w,t,g,d,c,u,A,B,f,m)),t.updateColumnRowNumber(r);const o=a.getRowHeight(r);t.updateColumnHeight(o),g+=o}else{const o=ry(M,C,_,a,e,r,i,y,w,t,g,d,c,u,A,B,f,m);if(t.updateColumnRowNumber(r),v){const i=a.getRowHeight(r),{width:n}=(a.getColWidth(e),o.attribute),{height:s}=o.attribute;o.contentWidth=n,o.contentHeight=s,ay(f,n,s,d,c,u,a),t.updateColumnHeight(i),g+=i}else t.updateColumnHeight(w),g+=w}if(h&&r>h)break}return t.setAttribute("width",i),{width:i,height:g}}function dx(t,e,i,o){let r=0,n=0;const s=e.get(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`);if(!s||o){for(let e=t.start.col;e<=t.end.col;e++)r+=i.getColWidth(e);for(let e=t.start.row;e<=t.end.row;e++)n+=i.getRowHeight(e);e.set(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`,{cellWidth:r,cellHeight:n})}else r=s.cellWidth,n=s.cellHeight;return{cellWidth:r,cellHeight:n}}function cx(t,e,i,o,r,n,s){const a=new jC({x:i,y:o,width:r,height:n});a.role="cell",a.col=t,a.row=e,s.addChild(a)}function ux(t,e,i,o,r,n,s,a,l,h){if(o>r||n>s)return;const{layoutMap:d,defaultRowHeight:c,defaultHeaderRowHeight:u,defaultColWidth:g}=l.internalProps;let p=0,f=0;for(let d=o;d<=r;d++){const o=d,r=l.getColWidth(o),g=new jC({x:e+p,y:i,width:r,height:0,clip:!1,pickable:!1});g.role="column",g.col=d,t.addChild(g);const{width:v,height:b}=hx(g,o,r,n,s,l.scenegraph.mergeMap,"columnHeader"===a&&at(u)?u:c,l,a,h);p+=v,f=Math.max(f,b)}t.setAttribute("width",p),t.setAttribute("height",f)}function gx(t){let e=t.firstChild;for(;"group"!==e.type;)e=e._next;return e}function px(t){let e=t.lastChild;for(;"group"!==e.type;)e=e._prev;return e}function fx(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left";for(let r=t;r<=e;r++){const t=i.scenegraph.getColGroup(r);t&&vx(t,i,o);const e=i.scenegraph.getColGroup(r,!0);e&&vx(e,i,o);const n=i.scenegraph.getColGroupInBottom(r);n&&vx(n,i,o)}const r=Math.min(i.scenegraph.proxy.colLimit,i.scenegraph.proxy.bodyRightCol-i.scenegraph.proxy.bodyLeftCol+1),n=i.getColsWidth(i.frozenColCount,i.frozenColCount+r),s=i.getColsWidth(i.frozenColCount,i.colCount-1);i.scenegraph.proxy.xLimitLeft=n/2,i.scenegraph.proxy.xLimitRight=s-n/2}function vx(t,e){if("left"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left")){let i;const o=function(t){let e=t._prev;for(;e&&"group"!==e.type;)e=e._prev;return e}(t);i=o?o.attribute.x+e.getColWidth(t._prev.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}else{let i;const o=function(t){let e=t._next;for(;e&&"group"!==e.type;)e=e._next;return e}(t);i=o?o.attribute.x-e.getColWidth(t.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}}lx.role="empty";var bx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};function mx(t,e,i,o){return bx(this,void 0,void 0,(function*(){if(!e)return;const r=e.col,n=e.left;let s;if(s=i?o.bodyRightCol-o.colEnd:o.screenLeftCol-o.referenceCol,function(t,e,i,o,r){t>0?(Cx(t,"left",r.screenLeftCol,i,o,r),r.updateDeltaX(o,i,e),r.table.scenegraph.setBodyAndColHeaderX(-o+r.deltaX)):t<0?(Cx(-t,"right",r.screenLeftCol,i,o,r),r.updateDeltaX(o,i,e),r.table.scenegraph.setBodyAndColHeaderX(-o+r.deltaX)):(r.updateDeltaX(o,i,e),r.table.scenegraph.setBodyAndColHeaderX(-o+r.deltaX))}(s,r,n,t,o),i){const e=o.table.scenegraph.getColGroup(o.colEnd);if(e){const i=e.attribute.x+e.attribute.width-(o.table.tableNoFrameWidth-o.table.getFrozenColsWidth()-o.table.getRightFrozenColsWidth())-t;o.deltaX=-i,o.table.scenegraph.setBodyAndColHeaderX(-t+o.deltaX)}}o.table.scenegraph.updateNextFrame()}))}function Cx(t,e,i,o,r,n){return bx(this,void 0,void 0,(function*(){if("left"===e&&n.colEnd+t>n.bodyRightCol?t=n.bodyRightCol-n.colEnd:"right"===e&&n.colStart-t<n.bodyLeftCol&&(t=n.colStart-n.bodyLeftCol),0!==t)if(t<0&&(e="left"===e?"right":"left",t=-t),t<n.colEnd-n.colStart){const r="left"===e?n.colStart:n.colEnd-t+1,s="left"===e?n.colStart+t-1:n.colEnd,a="left"===e?n.colEnd+1:n.colStart-t,l="left"===e?n.colEnd+t:n.colStart-1;ex(n.table,a,l),function(t,e,i,o){for(let r=t;r<=e;r++)o.table.scenegraph.bodyGroup.childrenCount>0&&"group"===o.table.scenegraph.bodyGroup.firstChild.type&&Sx(o.table.scenegraph.bodyGroup,i,o),o.table.scenegraph.colHeaderGroup.childrenCount>0&&"group"===o.table.scenegraph.colHeaderGroup.firstChild.type&&Sx(o.table.scenegraph.colHeaderGroup,i,o),o.table.scenegraph.bottomFrozenGroup.childrenCount>0&&"group"===o.table.scenegraph.bottomFrozenGroup.firstChild.type&&Sx(o.table.scenegraph.bottomFrozenGroup,i,o)}(r,s,e,n);const h=a,d=l;n.colStart="left"===e?n.colStart+t:n.colStart-t,n.colEnd="left"===e?n.colEnd+t:n.colEnd-t,_x(h,d,n),fx(h,d,n.table,e);const c=n.table.scenegraph.getColGroup(i)||n.table.scenegraph.getColGroup(i,!0),u=o-(c.attribute.x+n.table.getFrozenColsWidth()+n.table.scenegraph.proxy.deltaX);n.table.scenegraph.proxy.deltaX+=u,n.currentCol="left"===e?n.currentCol+t:n.currentCol-t,n.totalCol=Math.max(0,Math.min(n.table.colCount-1,"left"===e?n.totalCol+t:n.totalCol-t)),n.referenceCol=n.colStart+Math.floor((n.colEnd-n.colStart)/2),n.colUpdatePos=a,n.colUpdateDirection=e,n.table.scenegraph.updateNextFrame()}else{const i="left"===e?n.colStart+t:n.colStart-t,o="left"===e?n.colEnd+t:n.colEnd-t;ex(n.table,i,o),function(t,e,i,o){o.table.scenegraph.colHeaderGroup.forEachChildren(((r,n)=>{"group"===r.type&&yx(r,"left"===i?r.col+e:r.col-e,0===n?t:r._prev.attribute.x+o.table.getColWidth(r._prev.col))})),o.table.scenegraph.bottomFrozenGroup.forEachChildren(((r,n)=>{"group"===r.type&&yx(r,"left"===i?r.col+e:r.col-e,0===n?t:r._prev.attribute.x+o.table.getColWidth(r._prev.col))})),o.table.scenegraph.bodyGroup.forEachChildren(((r,n)=>{"group"===r.type&&yx(r,"left"===i?r.col+e:r.col-e,0===n?t:r._prev.attribute.x+o.table.getColWidth(r._prev.col))}))}(n.table.getColsWidth(n.bodyLeftCol,i-1),t,e,n);const r=i,s=o;n.colStart=i,n.colEnd=o,_x(r,s,n),fx(r,s,n.table,o>n.bodyRightCol-(n.colEnd-n.colStart+1)?"right":"left"),n.currentCol="left"===e?n.currentCol+t:n.currentCol-t,n.totalCol=Math.max(0,Math.min(n.table.colCount-1,"left"===e?n.totalCol+t:n.totalCol-t)),n.referenceCol=n.colStart+Math.floor((n.colEnd-n.colStart)/2),n.colUpdatePos=n.colStart,n.colUpdateDirection=o>n.bodyRightCol-(n.colEnd-n.colStart+1)?"right":"left",n.table.scenegraph.updateNextFrame()}}))}function yx(t,e,i){t.col=e,t.forEachChildren((t=>{t.col=e,t.needUpdate=!0})),t.setAttribute("x",i),t.needUpdate=!0}function wx(t,e){if(!t)return;let i=t.firstChild;for(;i;)i=e.updateCellGroupContent(i)._next;t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function xx(t,e){if(!t)return;const i=e.screenTopRow,o=Math.max(e.bodyTopRow,i-1*e.screenRowCount),r=Math.min(e.bodyBottomRow,i+2*e.screenRowCount);for(let i=o;i<=r;i++){const o=e.highPerformanceGetCell(t.col,i,!0);e.updateCellGroupContent(o)}e.rowUpdatePos=e.rowStart,t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function Sx(t,e,i){if("left"===e){const e=gx(t),o=px(t);yx(e,o.col+1,o.attribute.x+i.table.getColWidth(o.col)),t.appendChild(e),t.border&&t.appendChild(t.border)}else{const e=px(t),o=gx(t);yx(e,o.col-1,o.attribute.x-i.table.getColWidth(o.col-1)),t.insertBefore(e,t.firstChild)}}function _x(t,e,i){for(let o=t;o<=e;o++){const t=i.table.scenegraph.getColGroup(o,!0);t&&wx(t,i);const e=i.table.scenegraph.getColGroupInBottom(o);e&&wx(e,i);const r=i.table.scenegraph.getColGroupInRightTopCorner(o);r&&wx(r,i);const n=i.table.scenegraph.getColGroupInRightBottomCorner(o);n&&wx(n,i);const s=i.table.scenegraph.getColGroup(o);s&&xx(s,i)}i.progress()}function Ax(t,e,i,o,r){let n=arguments.length>6?arguments[6]:void 0;var s,a;if("up"===(arguments.length>5&&void 0!==arguments[5]?arguments[5]:"up"))for(let a=t;a<=e;a++)for(let t=i;t<=o;t++){const e=r.scenegraph.highPerformanceGetCell(a,t,!0);if("cell"!==e.role||!e.row)continue;let i;if(e._prev)i=(null===(s=e._prev)||void 0===s?void 0:s.attribute.y)+r.getRowHeight(e._prev.row);else if(n){if(i=r.scenegraph.highPerformanceGetCell(a,o+1,!0).attribute.y,J(i))for(let e=t;e<=o;e++)i-=r.getRowHeight(e)}else i=r.getRowsHeight(r.frozenRowCount,e.row-1);J(i)&&e.setAttribute("y",i)}else for(let s=t;s<=e;s++)for(let t=o;t>=i;t--){const e=r.scenegraph.highPerformanceGetCell(s,t,!0);if("cell"!==e.role||!e.row)continue;let o;if(e._next)o=(null===(a=e._next)||void 0===a?void 0:a.attribute.y)-r.getRowHeight(e.row);else if(n){o=r.scenegraph.highPerformanceGetCell(s,i-1,!0).attribute.y;for(let e=i-1;e<t;e++)o+=r.getRowHeight(e)}else o=r.getRowsHeight(r.frozenRowCount,e.row-1);J(o)&&e.setAttribute("y",o)}const l=Math.min(r.scenegraph.proxy.rowLimit,r.scenegraph.proxy.bodyBottomRow-r.scenegraph.proxy.bodyTopRow+1),h=r.getRowsHeight(r.frozenRowCount,r.frozenRowCount+l),d=r.getRowsHeight(r.frozenRowCount,r.rowCount-1);r.scenegraph.proxy.yLimitTop=h/2,r.scenegraph.proxy.yLimitBottom=d-h/2}var Rx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};function Bx(t,e,i,o){return Rx(this,void 0,void 0,(function*(){if(!e)return;const r=e.row,n=e.top;let s;if(s=i?o.bodyBottomRow-o.rowEnd:r-o.referenceRow,function(t,e,i,o,r){t>0?(Mx(t,"up",e,i,o,r),r.updateDeltaY(o,i,e),r.updateBody(o-r.deltaY)):t<0?(Mx(-t,"down",e,i,o,r),r.updateDeltaY(o,i,e),r.updateBody(o-r.deltaY)):(r.updateDeltaY(o,i,e),r.updateBody(o-r.deltaY))}(s,r,n,t,o),i){const e=o.table.scenegraph.highPerformanceGetCell(o.colStart,o.rowEnd,!0);if("cell"===e.role){const i=e.attribute.y+e.attribute.height-(o.table.tableNoFrameHeight-o.table.getFrozenRowsHeight()-o.table.getBottomFrozenRowsHeight())-t;o.deltaY=-i,o.updateBody(t-o.deltaY)}}}))}function Mx(t,e,i,o,r,n){return Rx(this,void 0,void 0,(function*(){if("up"===e&&n.rowEnd+t>n.bodyBottomRow?t=n.bodyBottomRow-n.rowEnd:"down"===e&&n.rowStart-t<n.bodyTopRow&&(t=n.rowStart-n.bodyTopRow),0!==t)if(t<0&&(e="up"===e?"down":"up",t=-t),t<n.rowEnd-n.rowStart){const o="up"===e?n.rowStart:n.rowEnd-t+1,r="up"===e?n.rowStart+t-1:n.rowEnd,s="up"===e?n.rowEnd+1:n.rowStart-t,a="up"===e?n.rowEnd+t:n.rowStart-1;let l,h;"autoHeight"===n.table.heightMode?(l=s,h=a):(l=Math.max(n.bodyTopRow,i-1*n.screenRowCount),h=Math.min(n.bodyBottomRow,i+2*n.screenRowCount)),Sy(n.table,l,h,!1),function(t,e,i,o){for(let r=0;r<o.table.frozenColCount;r++){const n=o.table.scenegraph.getColGroup(r);if(n)for(let r=t;r<=e;r++)Tx(n,i,o)}for(let r=o.table.colCount-o.table.rightFrozenColCount;r<o.table.colCount;r++){const n=o.table.scenegraph.getColGroup(r);if(n)for(let r=t;r<=e;r++)Tx(n,i,o)}for(let r=o.bodyLeftCol;r<=o.bodyRightCol;r++){const n=o.table.scenegraph.getColGroup(r);if(n)for(let r=t;r<=e;r++)Tx(n,i,o)}}(o,r,e,n),n.rowStart="up"===e?n.rowStart+t:n.rowStart-t,n.rowEnd="up"===e?n.rowEnd+t:n.rowEnd-t;const d=Px(l,h,n,!0);"autoHeight"===n.table.heightMode&&(Ax(n.bodyLeftCol,n.bodyRightCol,l,h,n.table,a>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",!0),Ax(0,n.table.frozenColCount-1,l,h,n.table,a>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",!0),Ax(n.table.colCount-n.table.rightFrozenColCount,n.table.colCount-1,l,h,n.table,a>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",!0)),n.currentRow="up"===e?n.currentRow+t:n.currentRow-t,n.totalRow=Math.max(0,Math.min(n.bodyBottomRow,"up"===e?n.totalRow+t:n.totalRow-t)),n.referenceRow=n.rowStart+Math.floor((n.rowEnd-n.rowStart)/2),"autoHeight"===n.table.heightMode&&d?n.rowUpdatePos=Math.min(n.rowUpdatePos,n.rowEnd+1):n.rowUpdatePos=Math.min(n.rowUpdatePos,s),n.rowUpdateDirection=e,n.table.scenegraph.updateNextFrame(),yield n.progress()}else{const o="up"===e?n.rowStart+t:n.rowStart-t,r="up"===e?n.rowEnd+t:n.rowEnd-t,s=n.table.getRowsHeight(n.bodyTopRow,o-1);let a,l;"autoHeight"===n.table.heightMode?(a=o,l=r):(a=Math.max(n.bodyTopRow,i-1*n.screenRowCount),l=Math.min(n.bodyBottomRow,i+2*n.screenRowCount)),Sy(n.table,a,l,!1),function(t,e,i,o){for(let r=0;r<o.table.frozenColCount;r++){const n=o.table.scenegraph.getColGroup(r);null==n||n.forEachChildren(((r,n)=>{o.updateCellGroupPosition(r,"up"===i?r.row+e:r.row-e,0===n?t:r._prev.attribute.y+o.table.getRowHeight(r._prev.row))}))}for(let r=o.table.colCount-o.table.rightFrozenColCount;r<o.table.colCount;r++){const n=o.table.scenegraph.getColGroup(r);null==n||n.forEachChildren(((r,n)=>{o.updateCellGroupPosition(r,"up"===i?r.row+e:r.row-e,0===n?t:r._prev.attribute.y+o.table.getRowHeight(r._prev.row))}))}for(let r=o.bodyLeftCol;r<=o.bodyRightCol;r++){const n=o.table.scenegraph.getColGroup(r);null==n||n.forEachChildren(((r,n)=>{o.updateCellGroupPosition(r,"up"===i?r.row+e:r.row-e,0===n?t:r._prev.attribute.y+o.table.getRowHeight(r._prev.row))}))}}(s,t,e,n),n.rowStart=o,n.rowEnd=r;const h=Px(a,l,n,!0);"autoHeight"===n.table.heightMode&&(Ax(n.bodyLeftCol,n.bodyRightCol,a,l,n.table,r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up"),Ax(0,n.table.frozenColCount-1,a,l,n.table,r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up"),Ax(n.table.colCount-n.table.rightFrozenColCount,n.table.colCount-1,a,l,n.table,r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up")),n.currentRow="up"===e?n.currentRow+t:n.currentRow-t,n.totalRow=Math.max(0,Math.min(n.bodyBottomRow,"up"===e?n.totalRow+t:n.totalRow-t)),n.referenceRow=n.rowStart+Math.floor((n.rowEnd-n.rowStart)/2),"autoHeight"===n.table.heightMode&&h?n.rowUpdatePos=n.rowEnd+1:n.rowUpdatePos=n.rowStart,n.rowUpdateDirection=r>n.bodyBottomRow-(n.rowEnd-n.rowStart+1)?"down":"up",n.table.scenegraph.updateNextFrame(),yield n.progress()}}))}function Tx(t,e,i){if(t.childrenCount>=1)if("up"===e){const e=t.firstChild;i.updateCellGroupPosition(e,t.lastChild.row+1,t.lastChild.attribute.y+i.table.getRowHeight(t.lastChild.row)),t.appendChild(e)}else{const e=t.lastChild;i.updateCellGroupPosition(e,t.firstChild.row-1,t.firstChild.attribute.y-i.table.getRowHeight(e.row)),t.insertBefore(e,t.firstChild)}}function Px(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(let o=0;o<i.table.frozenColCount;o++)for(let r=t;r<=e;r++){const t=i.highPerformanceGetCell(o,r,!0);i.updateCellGroupContent(t)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++)for(let r=t;r<=e;r++){const t=i.highPerformanceGetCell(o,r);i.updateCellGroupContent(t)}let r=i.bodyLeftCol,n=i.bodyRightCol,s=!0;if(o){const t=i.screenLeftCol;r=Math.max(i.bodyLeftCol,t-1*i.screenColCount),n=Math.min(i.bodyRightCol,t+2*i.screenColCount),r===i.bodyLeftCol&&n===i.bodyRightCol||(s=!1)}for(let o=r;o<=n;o++)for(let r=t;r<=e;r++){const t=i.highPerformanceGetCell(o,r);i.updateCellGroupContent(t)}return i.table.scenegraph.updateNextFrame(),s}var kx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};var Lx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};function Hx(t){const{changedCells:e}=t.internalProps.stick;e.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dx:e.dx,dy:e.dy})}))})),e.clear();const{scrollTop:i,scrollLeft:o,frozenRowCount:r,frozenColCount:n}=t,s=t.getFrozenRowsHeight(),a=t.getFrozenColsWidth(),{row:l}=t.getRowAt(i+s+1),{col:h}=t.getColAt(o+a+1),d=Math.max(l,t.frozenRowCount),c=Math.max(h,t.frozenColCount),u=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(i+t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()-1).row:t.rowCount-t.bottomFrozenRowCount-1,g=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(o+t.tableNoFrameWidth-t.getRightFrozenColsWidth()-1).col:t.colCount-t.rightFrozenColCount-1;if(!(g<0||u<0)){for(let i=0;i<r&&!(g<c);i++)[c,g].forEach((o=>{const r=t._getCellStyle(o,i);(null==r?void 0:r.textStick)&&"vertical"!==(null==r?void 0:r.textStick)&&Fx(t.scenegraph.getCell(o,i),a+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==r?void 0:r.textStickBaseOnAlign,t)}));for(let i=0;i<n&&!(u<d);i++)[d,u].forEach((o=>{const r=t._getCellStyle(i,o);(null==r?void 0:r.textStick)&&"tree"!==t.internalProps.layoutMap.rowHierarchyType&&"horizontal"!==(null==r?void 0:r.textStick)&&Ex(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==r?void 0:r.textStickBaseOnAlign,t)}));for(let i=c;i<=g&&!(u<d);i++)[d,u].forEach((o=>{const r=t._getCellStyle(i,o);(null==r?void 0:r.textStick)&&"horizontal"!==(null==r?void 0:r.textStick)&&Ex(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==r?void 0:r.textStickBaseOnAlign,t)}));for(let i=d;i<=u&&!(g<c);i++)[c,g].forEach((o=>{const r=t._getCellStyle(o,i);(null==r?void 0:r.textStick)&&"vertical"!==(null==r?void 0:r.textStick)&&Fx(t.scenegraph.getCell(o,i),a+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==r?void 0:r.textStickBaseOnAlign,t)}))}}function Ex(t,e,i,o,r,n){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:a,rowStart:l,rowEnd:h}=Py(t,n.scenegraph);for(let t=s;t<=a;t++)for(let s=l;s<=h;s++)zx(n.scenegraph.getCell(t,s),e,i,o,r)}else zx(t,e,i,o,r)}function zx(t,e,i,o,r){var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w;const x=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!x)return;if("image"===x.type){const{image:t}=x.attribute;if(!t||!x.resources)return;if("success"!==x.resources.get(t).state)return}const S=null!==(n=x.textBaseline)&&void 0!==n?n:"top";x.AABBBounds.width();const _=x.globalAABBBounds.y1,A=x.globalAABBBounds.y2;if("middle"===S&&r){const r=t.globalAABBBounds.y1+(null!==(a=null===(s=t.firstChild)||void 0===s?void 0:s.attribute.dy)&&void 0!==a?a:0),n=r+(null!==(h=null!==(l=t.contentHeight)&&void 0!==l?l:t.attribute.height)&&void 0!==h?h:0);if(r<e||n>i){const s=Math.max(r,e),a=Math.min(n,i),l=x.globalTransMatrix.f-(a+s)/2+x.AABBBounds.height()/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(c=null===(d=t.firstChild)||void 0===d?void 0:d.attribute.dx)&&void 0!==c?c:0,dy:null!==(g=null===(u=t.firstChild)||void 0===u?void 0:u.attribute.dy)&&void 0!==g?g:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-l+2)}))}}else if(_<e){const i=_-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(f=null===(p=t.firstChild)||void 0===p?void 0:p.attribute.dx)&&void 0!==f?f:0,dy:null!==(b=null===(v=t.firstChild)||void 0===v?void 0:v.attribute.dy)&&void 0!==b?b:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-i+2)}))}else if(A>i){const e=A-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(C=null===(m=t.firstChild)||void 0===m?void 0:m.attribute.dx)&&void 0!==C?C:0,dy:null!==(w=null===(y=t.firstChild)||void 0===y?void 0:y.attribute.dy)&&void 0!==w?w:0}),t.forEachChildren((t=>{var i;t.setAttribute("dy",(null!==(i=t.attribute.dy)&&void 0!==i?i:0)-e)}))}}function Fx(t,e,i,o,r,n){if(at(t.mergeStartCol)&&at(t.mergeStartRow)&&at(t.mergeEndCol)&&at(t.mergeEndRow)){const{colStart:s,colEnd:a,rowStart:l,rowEnd:h}=Py(t,n.scenegraph);for(let t=s;t<=a;t++)for(let s=l;s<=h;s++)Ix(n.scenegraph.getCell(t,s),e,i,o,r)}else Ix(t,e,i,o,r)}function Ix(t,e,i,o,r){var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x;const S=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!S)return;if("image"===S.type){const{image:t}=S.attribute;if(!t||!S.resources)return;if("success"!==S.resources.get(t).state)return}const _=null!==(s=null!==(n=S.attribute.textAlign)&&void 0!==n?n:S.textAlign)&&void 0!==s?s:"left";S.AABBBounds.width();const A=S.globalAABBBounds.x1,R=S.globalAABBBounds.x2;if("center"===_&&r){const r=t.globalAABBBounds.x1+(null!==(l=null===(a=t.firstChild)||void 0===a?void 0:a.attribute.dx)&&void 0!==l?l:0),n=r+(null!==(d=null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width)&&void 0!==d?d:0);if(r<e||n>i){const s=Math.max(r,e),a=Math.min(n,i),l=S.globalTransMatrix.e-(a+s)/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(u=null===(c=t.firstChild)||void 0===c?void 0:c.attribute.dx)&&void 0!==u?u:0,dy:null!==(p=null===(g=t.firstChild)||void 0===g?void 0:g.attribute.dy)&&void 0!==p?p:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-l+2)}))}}else if(A<e){const i=A-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(v=null===(f=t.firstChild)||void 0===f?void 0:f.attribute.dx)&&void 0!==v?v:0,dy:null!==(m=null===(b=t.firstChild)||void 0===b?void 0:b.attribute.dy)&&void 0!==m?m:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-i+2)}))}else if(R>i){const e=R-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(y=null===(C=t.firstChild)||void 0===C?void 0:C.attribute.dx)&&void 0!==y?y:0,dy:null!==(x=null===(w=t.firstChild)||void 0===w?void 0:w.attribute.dy)&&void 0!==x?x:0}),t.forEachChildren((t=>{var i;t.setAttribute("dx",(null!==(i=t.attribute.dx)&&void 0!==i?i:0)-e)}))}}function Ox(t){var e,i;const o=t.internalProps.layoutMap.headerObjects,r=t.internalProps.layoutMap.columnObjects;for(let t=0;t<o.length;t++){const i=o[t];if(i&&(null===(e=i.style)||void 0===e?void 0:e.textStick))return!0}for(let t=0;t<r.length;t++){const e=r[t];if(e&&(null===(i=e.style)||void 0===i?void 0:i.textStick))return!0}return!!(t.theme.headerStyle.textStick||t.theme.rowHeaderStyle.textStick||t.theme.bodyStyle.textStick)}var Dx=function(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{l(o.next(t))}catch(t){n(t)}}function a(t){try{l(o.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((o=o.apply(t,e||[])).next())}))};class Wx{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):"autoHeight"===this.table.heightMode?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):("autoWidth"===this.table.widthMode||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const r=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(r/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const r=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(r/e))),this.rowUpdatePos=this.bodyBottomRow}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,r,n,s,a){!function(t,e,i,o,r,n,s,a,l){var h,d,c,u,g,p,f,v,b,m,C,y;const{table:w}=l,{leftBottomCornerGroup:x,rightTopCornerGroup:S,rightBottomCornerGroup:_}=w.scenegraph;let A,R;l.setParamsForRow(),l.setParamsForColumn(),A="adaptive"===w.widthMode||w.options.autoWrapText&&("adaptive"===w.heightMode||"autoHeight"===w.heightMode)?w.colCount-1:Math.min(l.firstScreenColLimit,w.colCount-1),R="adaptive"===w.heightMode?w.rowCount-1:Math.min(l.firstScreenRowLimit,w.rowCount-1),0===w.internalProps._widthResizedColMap.size&&ex(w,0,A),0===w.internalProps._heightResizedRowMap.size&&Sy(w,0,R),A<w.colCount-w.rightFrozenColCount&&ex(w,w.colCount-w.rightFrozenColCount,w.colCount-1),R<w.rowCount-w.bottomFrozenRowCount&&Sy(w,w.rowCount-w.bottomFrozenRowCount,w.rowCount-1),w.scenegraph.colHeaderGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rowHeaderGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bottomFrozenGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rightFrozenGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bodyGroup.setAttributes({x:w.getFrozenColsWidth(),y:w.getFrozenRowsHeight()}),ux(t,s,a,0,w.frozenColCount-1,0,w.frozenRowCount-1,w.isListTable()?"columnHeader":"cornerHeader",w),A-w.rightFrozenColCount>=w.frozenColCount&&ux(e,s,a,w.frozenColCount,A-w.rightFrozenColCount,0,w.frozenRowCount-1,"columnHeader",w),w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&ux(i,s,a,0,w.leftRowSeriesNumberCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"rowHeader",w),w.rowHeaderLevelCount>0&&ux(i,s,a,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&ux(i,s,a,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"body",w)),w.bottomFrozenRowCount>0&&(w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&ux(x,s,a,0,w.leftRowSeriesNumberCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.rowHeaderLevelCount>0&&ux(x,s,a,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&ux(x,s,a,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w)),A-w.rightFrozenColCount>=w.frozenColCount&&ux(r,s,a,w.frozenColCount,A-w.rightFrozenColCount,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,w.isPivotChart()?"rowHeader":"body",w)),w.rightFrozenColCount>0&&(ux(S,s,a,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,0,w.frozenRowCount-1,"columnHeader",w),ux(o,s,a,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,w.isPivotChart()?"rowHeader":"body",w)),w.bottomFrozenRowCount>0&&w.rightFrozenColCount>0&&ux(_,s,a,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w),A-w.rightFrozenColCount>=w.frozenColCount&&ux(n,s,a,w.frozenColCount,A-w.rightFrozenColCount,w.frozenRowCount,R-w.bottomFrozenRowCount,"body",w),n.firstChild||e.firstChild||t.firstChild||i.firstChild?(l.currentRow=null!==(u=null!==(d=null===(h=n.firstChild)||void 0===h?void 0:h.rowNumber)&&void 0!==d?d:null===(c=i.firstChild)||void 0===c?void 0:c.rowNumber)&&void 0!==u?u:l.totalRow,l.rowEnd=l.currentRow,l.rowUpdatePos=l.rowEnd+1,l.referenceRow=l.rowStart+Math.floor((l.rowEnd-l.rowStart)/2),l.currentCol=null!==(y=null!==(m=null!==(v=null!==(p=null===(g=n.lastChild)||void 0===g?void 0:g.col)&&void 0!==p?p:null===(f=e.lastChild)||void 0===f?void 0:f.col)&&void 0!==v?v:null===(b=i.lastChild)||void 0===b?void 0:b.col)&&void 0!==m?m:null===(C=t.lastChild)||void 0===C?void 0:C.col)&&void 0!==y?y:l.totalCol,l.colEnd=l.currentCol,l.colUpdatePos=l.colEnd+1,l.referenceCol=l.colStart+Math.floor((l.colEnd-l.colStart)/2),l.progress()):(l.currentRow=l.totalRow,l.rowEnd=l.currentRow,l.rowUpdatePos=l.rowEnd+1,l.referenceRow=l.rowStart+Math.floor((l.rowEnd-l.rowStart)/2),l.currentCol=l.totalCol,l.colEnd=l.currentCol,l.colUpdatePos=l.colEnd+1,l.referenceCol=l.colStart+Math.floor((l.colEnd-l.colStart)/2))}(t,e,i,o,r,n,s,a,this)}progress(){return Dx(this,void 0,void 0,(function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise(((t,e)=>{setTimeout((()=>Dx(this,void 0,void 0,(function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),Hx(this.table),this.table.scenegraph.updateNextFrame(),t())}))),16)}))}))}createRow(){return Dx(this,void 0,void 0,(function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)}))}createCol(){return Dx(this,void 0,void 0,(function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)}))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(Sy(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let t=0;for(let i=0;i<this.table.frozenColCount;i++){const o=this.table.scenegraph.getColGroup(i),r=this.table.isListTable()?"body":"rowHeader",{height:n}=hx(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);t=Math.max(t,n),this.table.scenegraph.rowHeaderGroup.setAttribute("height",t)}}if(this.table.rightFrozenColCount){let t=0;for(let i=this.table.colCount-this.table.rightFrozenColCount;i<this.table.colCount;i++){const o=this.table.scenegraph.getColGroup(i),r=this.table.isPivotChart()?"rowHeader":"body",{height:n}=hx(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);t=Math.max(t,n),this.table.scenegraph.rightFrozenGroup.setAttribute("height",t)}}let i=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const o=this.table.scenegraph.getColGroup(t);if(!o)continue;const r=t<this.table.rowHeaderLevelCount?"rowHeader":"body",{height:n}=hx(o,t,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table,r);i=Math.max(i,n)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);ex(this.table,this.currentCol+1,e),this.colEnd=e;for(let t=0;t<this.table.rowCount;t++){const e=this.highPerformanceGetCell(this.currentCol,t);"cell"===e.role&&at(e.mergeStartCol)&&e.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(e.col,e.row)}if(this.table.frozenRowCount){const t=this.table.scenegraph.colHeaderGroup.lastChild instanceof jC?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;ux(this.table.scenegraph.colHeaderGroup,i,o,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const t=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof jC?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;ux(this.table.scenegraph.bottomFrozenGroup,i,o,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof jC?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof jC?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,r=i.attribute.y;ux(this.table.scenegraph.bodyGroup,o,r,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Dx(this,void 0,void 0,(function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,r=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);r&&(this.screenTopRow=r.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&0!==this.table.scenegraph.bodyGroup.firstChild.childrenCount||this.table.scenegraph.rowHeaderGroup.firstChild&&0!==this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount?this.dynamicSetY(t,r,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))}))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Dx(this,void 0,void 0,(function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,r=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);r&&(this.screenLeftCol=r.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&0===this.table.scenegraph.bodyGroup.firstChild.childrenCount?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,r,e)}))}dynamicSetY(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Dx(this,void 0,void 0,(function*(){Bx(t,e,i,this)}))}dynamicSetX(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Dx(this,void 0,void 0,(function*(){mx(t,e,i,this)}))}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return Dx(this,void 0,void 0,(function*(){this.updateCellGroups(this.taskRowCount)}))}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);"autoHeight"===this.table.heightMode&&Sy(this.table,this.rowUpdatePos,e,!1),Px(this.rowUpdatePos,e,this),"autoHeight"===this.table.heightMode&&(Ax(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Ax(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),Ax(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;"autoHeight"===this.table.heightMode&&Sy(this.table,t,e,!1),Px(t,e,this),"autoHeight"===this.table.heightMode&&(Ax(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),Ax(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),Ax(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;"autoWidth"===this.table.widthMode&&ex(this.table,t,e,!1),_x(t,e,this),"autoHeight"===this.table.heightMode&&fx(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return Dx(this,void 0,void 0,(function*(){this.updateColGroups(this.taskRowCount)}))}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);ex(this.table,this.colUpdatePos,e),_x(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||"cell"!==t.role)return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return Dx(this,void 0,void 0,(function*(){yield function(t){var e;return kx(this,void 0,void 0,(function*(){let i,o;t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))})),"autoHeight"===t.table.heightMode?(i=t.rowStart,o=t.rowEnd):(i=Math.max(t.bodyTopRow,t.screenTopRow-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,t.screenTopRow+2*t.screenRowCount));const r=t.table.getAllRowsHeight();Sy(t.table,i,o);const n=t.table.getAllRowsHeight();r!==n&&t.table.scenegraph.updateContainerHeight(t.table.frozenRowCount,n-r);for(let i=0;null!==(e=i<t.table.frozenColCount)&&void 0!==e&&e;i++){const e=t.table.scenegraph.getColGroup(i);null==e||e.setAttribute("chartInstance",void 0);for(let e=t.rowStart;e<=t.rowEnd;e++)t.table.scenegraph.updateCellContent(i,e);for(let e=t.table.rowCount-t.table.bottomFrozenRowCount;e<t.table.rowCount;e++)t.table.scenegraph.updateCellContent(i,e)}for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}Px(i,o,t),"autoHeight"===t.table.heightMode&&Ax(t.bodyLeftCol,t.bodyRightCol,i,o,t.table,t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up"),t.rowUpdatePos=t.rowStart,t.rowUpdateDirection=t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up",t.table.scenegraph.updateNextFrame(),"autoHeight"!==t.table.heightMode&&(yield t.progress())}))}(this)}))}sortCellHorizontal(){return Dx(this,void 0,void 0,(function*(){yield function(t){return Lx(this,void 0,void 0,(function*(){t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))}));const e=Math.max(t.bodyLeftCol,t.screenLeftCol-1*t.screenColCount),i=Math.min(t.bodyRightCol,t.screenLeftCol+2*t.screenColCount);ex(t.table,e,i);for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}_x(e,i,t),t.colUpdatePos=t.colStart,t.colUpdateDirection=t.colEnd>t.bodyRightCol-(t.colEnd-t.colStart+1)?"right":"left",t.table.scenegraph.updateNextFrame(),yield t.progress()}))}(this)}))}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd))return lx;if(t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return lx;if(this.cellCache.get(t)){const o=this.cellCache.get(t);if((o._next||o._prev)&&Math.abs(o.row-e)<e){let r=Nx(o,e);return r&&(i||"shadow-cell"!==r.role)||(r=this.table.scenegraph.getCell(t,e,i)),r.row&&this.cellCache.set(t,r),r}const r=this.table.scenegraph.getCell(t,e,i);return r.col===t&&r.row&&this.cellCache.set(t,r),r}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if("cell"===t.role){const e=t.attribute.y;this.deltaY=-e}}else if(this.rowEnd===this.bodyBottomRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if("cell"===t.role){const e=t.attribute.y+t.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-e}}else if(J(e)&&J(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);"cell"!==o.role&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const r=t-this.deltaY,n=e-r,s=o.attribute.y-r+this.table.getFrozenRowsHeight();this.deltaY=n-s}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const t=this.table.scenegraph.getColGroup(this.colStart);if(t){const e=t.attribute.x;this.deltaX=-e}}else if(this.colEnd===this.bodyRightCol){const t=this.table.scenegraph.getColGroup(this.colEnd);if(t){const e=t.attribute.x+t.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-e}}else if(J(e)&&J(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),r=t-this.deltaX,n=e-r,s=o.attribute.x-r+this.table.getFrozenColsWidth();this.deltaX=n-s}}release(){this.isRelease=!0}}function Nx(t,e){if(!t)return null;if(t.row===e)return t;const i=t._prev,o=t._next;return t.row>e&&i&&i.row===t.row-1?Nx(i,e):t.row<e&&o&&o.row===t.row+1?Nx(o,e):null}function Gx(t,e,i){var o,r,n,s,a,l,h,d,c;const u=i.table,[g,p,f,v]=e.split("-"),b=parseInt(g,10),m=parseInt(p,10),C=parseInt(f,10),y=parseInt(v,10);let w,x=b,S=m,_=C,A=y;switch(t.role){case"rowHeader":w=u.getBodyVisibleRowRange(),w&&(S=Math.max(m,w.rowStart-1),A=Math.min(y,w.rowEnd+1));break;case"columnHeader":case"bottomFrozen":w=u.getBodyVisibleCellRange(),w&&(x=Math.max(b,w.colStart-1),_=Math.min(C,w.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":w=u.getBodyVisibleCellRange(),w&&(S=Math.max(m,w.rowStart-1),A=Math.min(y,w.rowEnd+1));break;default:w=u.getBodyVisibleCellRange(),w&&(S=Math.max(m,w.rowStart-1),A=Math.min(y,w.rowEnd+1),x=Math.max(b,w.colStart-1),_=Math.min(C,w.colEnd+1))}const R=u.getColsWidth(x,_),B=u.getRowsHeight(S,A),M=i.highPerformanceGetCell(x,S).globalAABBBounds,T=i.highPerformanceGetCell(_,A).globalAABBBounds;t.rect.setAttributes({x:M.x1-i.tableGroup.attribute.x,y:M.y1-i.tableGroup.attribute.y,width:R,height:B,visible:!0}),t.fillhandle&&(null===(o=t.fillhandle)||void 0===o||o.setAttributes({x:T.x2-i.tableGroup.attribute.x-3,y:T.y2-i.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let P=!!u.frozenColCount&&b===u.frozenColCount;!P&&u.frozenColCount&&u.scrollLeft>0&&b>=u.frozenColCount&&u.getColsWidth(0,b-1)-u.scrollLeft<u.getFrozenColsWidth()&&(P=!0);let k=!!u.rightFrozenColCount&&u.rightFrozenColCount>0&&C===u.colCount-u.rightFrozenColCount-1;!k&&u.rightFrozenColCount&&C<u.colCount-u.rightFrozenColCount&&u.getColsWidth(0,C)-u.scrollLeft>u.tableNoFrameWidth-u.getRightFrozenColsWidth()&&(k=!0);let L=!u.frozenRowCount||m===u.frozenRowCount;!L&&u.frozenRowCount&&u.scrollTop>0&&m>=u.frozenRowCount&&u.getRowsHeight(0,m-1)-u.scrollTop<u.getFrozenRowsHeight()&&(L=!0);let H=!!u.bottomFrozenRowCount&&y===u.rowCount-u.bottomFrozenRowCount-1;if(!H&&u.bottomFrozenRowCount&&y<u.rowCount-u.bottomFrozenRowCount&&u.getRowsHeight(0,y)-u.scrollTop>u.tableNoFrameHeight-u.getBottomFrozenRowsHeight()&&(H=!0),P&&t.rect.attribute.stroke[3]||k&&t.rect.attribute.stroke[1]||L&&t.rect.attribute.stroke[0]||H&&t.rect.attribute.stroke[2]){if(P&&t.rect.attribute.stroke[3]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.cornerHeaderGroup:"bottomFrozen"===t.role?i.leftBottomCornerGroup:i.rowHeaderGroup),H&&t.rect.attribute.stroke[2]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.leftBottomCornerGroup:"rightFrozen"===t.role?i.rightBottomCornerGroup:i.bottomFrozenGroup),L&&t.rect.attribute.stroke[0]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.cornerHeaderGroup:"rightFrozen"===t.role?i.rightTopCornerGroup:i.colHeaderGroup),k&&t.rect.attribute.stroke[1]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.rightTopCornerGroup:"bottomFrozen"===t.role?i.rightBottomCornerGroup:i.rightFrozenGroup),t.rect.attribute.x<u.getFrozenColsWidth()&&u.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=t.rect.attribute.width-(u.getFrozenColsWidth()-t.rect.attribute.x);t.rect.setAttributes({x:t.rect.attribute.x+(u.getFrozenColsWidth()-t.rect.attribute.x),width:e>0?e:0}),null===(r=t.fillhandle)||void 0===r||r.setAttributes({visible:e>0})}if(u.getRightFrozenColsWidth()>0&&i.rightFrozenGroup.attribute.height>0&&t.rect.attribute.x+t.rect.attribute.width>i.rightFrozenGroup.attribute.x&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=i.rightFrozenGroup.attribute.x-t.rect.attribute.x;t.rect.setAttributes({x:t.rect.attribute.x,width:e>0?e:0}),null===(n=t.fillhandle)||void 0===n||n.setAttributes({visible:e-R>0})}if(t.rect.attribute.y<i.colHeaderGroup.attribute.height&&u.scrollTop>0&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=t.rect.attribute.height-(i.colHeaderGroup.attribute.height-t.rect.attribute.y);t.rect.setAttributes({y:t.rect.attribute.y+(i.colHeaderGroup.attribute.height-t.rect.attribute.y),height:e>0?e:0}),null===(s=t.fillhandle)||void 0===s||s.setAttributes({visible:e>0})}if(i.bottomFrozenGroup.attribute.width>0&&i.bottomFrozenGroup.attribute.height>0&&t.rect.attribute.y+t.rect.attribute.height>i.bottomFrozenGroup.attribute.y&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=i.bottomFrozenGroup.attribute.y-t.rect.attribute.y;t.rect.setAttributes({y:t.rect.attribute.y,height:e>0?e:0}),null===(a=t.fillhandle)||void 0===a||a.setAttributes({visible:e-B>0})}}else i.tableGroup.insertAfter(t.rect,"body"===t.role?i.bodyGroup:"columnHeader"===t.role?i.colHeaderGroup:"rowHeader"===t.role?i.rowHeaderGroup:"cornerHeader"===t.role?i.cornerHeaderGroup:"rightTopCorner"===t.role?i.rightTopCornerGroup:"rightFrozen"===t.role?i.rightFrozenGroup:"leftBottomCorner"===t.role?i.leftBottomCornerGroup:"bottomFrozen"===t.role?i.bottomFrozenGroup:i.rightBottomCornerGroup);let E=0;"number"==typeof t.rect.attribute.lineWidth&&(E=Math.ceil(t.rect.attribute.lineWidth/2)),C===u.colCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(l=t.rect.attribute.lineWidth[1])&&void 0!==l?l:0)/2)),t.rect.setAttributes({width:t.rect.attribute.width-E})),0===b&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(h=t.rect.attribute.lineWidth[3])&&void 0!==h?h:0)/2)),t.rect.setAttributes({x:t.rect.attribute.x+E,width:t.rect.attribute.width-E})),y===u.rowCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(d=t.rect.attribute.lineWidth[2])&&void 0!==d?d:0)/2)),t.rect.setAttributes({height:t.rect.attribute.height-E})),0===m&&(Array.isArray(t.rect.attribute.lineWidth)&&(E=Math.ceil((null!==(c=t.rect.attribute.lineWidth[0])&&void 0!==c?c:0)/2)),t.rect.setAttributes({y:t.rect.attribute.y+E,height:t.rect.attribute.height-E}))}function jx(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.table,r=e.start.col,n=e.start.row,s=e.end.col,a=e.end.row,l=e.skipBodyMerge;let h=Math.max(Math.min(s,r),0),d=Math.max(Math.min(a,n),0),c=Math.min(Math.max(s,r),o.colCount-1),u=Math.min(Math.max(a,n),o.rowCount-1);const g=()=>{let t=!1;for(let e=h;e<=c;e++){if(e===h)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&l)continue;const r=lm(o,e,i);if(r&&r.start.col<h){h=r.start.col,t=!0;break}}if(!t&&e===c)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&l)continue;const r=lm(o,e,i);if(r&&Math.min(r.end.col,o.colCount-1)>c){c=r.end.col,t=!0;break}}if(t)break}if(!t)for(let e=d;e<=u;e++){if(e===d)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&l)continue;const r=lm(o,i,e);if(r&&r.start.row<d){d=r.start.row,t=!0;break}}if(!t&&e===u)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&l)continue;const r=lm(o,i,e);if(r&&Math.min(r.end.row,o.rowCount-1)>u){u=r.end.row,t=!0;break}}if(t)break}t&&g()};i&&g(),t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map;let p=!1,f=!1,v=!1,b=!1,m=!1,C=!1,y=!1,w=!1,x=!1;if(h<=o.frozenColCount-1&&d<=o.frozenRowCount-1&&(C=!0),c>=o.colCount-o.rightFrozenColCount&&d<=o.frozenRowCount-1&&(y=!0),h<=o.frozenColCount-1&&u>=o.rowCount-o.bottomFrozenRowCount&&(x=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.rowCount-o.bottomFrozenRowCount&&(w=!0),h<=o.frozenColCount-1&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(p=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(f=!0),d<=o.frozenRowCount-1&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(v=!0),u>=o.rowCount-o.bottomFrozenRowCount&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(b=!0),h<=o.colCount-o.rightFrozenColCount-1&&c>=o.frozenColCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&u>=o.frozenRowCount&&(m=!0),C){const e=Math.min(c,o.frozenColCount-1),i=Math.min(u,o.frozenRowCount-1),r=[!0,!v,!p,!0];t.createCellSelectBorder(h,d,e,i,"cornerHeader",`${h}${d}${c}${u}`,r)}if(y){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.min(u,o.frozenRowCount-1),r=[!0,!0,!f,!v];t.createCellSelectBorder(e,d,c,i,"rightTopCorner",`${h}${d}${c}${u}`,r)}if(x){const e=Math.min(c,o.frozenColCount-1),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!p,!b,!0,!0];t.createCellSelectBorder(h,i,e,u,"leftBottomCorner",`${h}${d}${c}${u}`,r)}if(w){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!f,!0,!0,!b];t.createCellSelectBorder(e,i,c,u,"rightBottomCorner",`${h}${d}${c}${u}`,r)}if(v){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.min(u,o.frozenRowCount-1),n=[!0,!y,!m,!C];t.createCellSelectBorder(e,d,i,r,"columnHeader",`${h}${d}${c}${u}`,n)}if(b){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!m,!w,!0,!x];t.createCellSelectBorder(e,r,i,u,"bottomFrozen",`${h}${d}${c}${u}`,n)}if(p){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),r=Math.min(c,o.frozenColCount-1),n=[!C,!m,!x,!0];t.createCellSelectBorder(h,e,r,i,"rowHeader",`${h}${d}${c}${u}`,n)}if(f){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),r=Math.max(h,o.colCount-o.rightFrozenColCount),n=[!y,!0,!w,!m];t.createCellSelectBorder(r,e,c,i,"rightFrozen",`${h}${d}${c}${u}`,n)}if(m){const e=Math.max(h,o.frozenColCount),i=Math.max(d,o.frozenRowCount),r=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),s=[!v,!f,!b,!p];t.createCellSelectBorder(e,i,r,n,"body",`${h}${d}${c}${u}`,s)}}function Ux(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)}))}function Vx(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)}))}function Xx(t){t.selectingRangeComponents.forEach(((e,i)=>{var o;t.selectedRangeComponents.get(i)&&(t.selectingRangeComponents.get(i).rect.delete(),null===(o=t.selectingRangeComponents.get(i).fillhandle)||void 0===o||o.delete()),t.selectedRangeComponents.set(i,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}function Yx(t){t.selectedRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectedRangeComponents=new Map}function $x(t){t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map}function Kx(t,e,i,o){const r=o.scenegraph,n=nb(t.map((t=>t.row))).sort(((t,e)=>e-t)),s=nb(e.map((t=>t.row))).sort(((t,e)=>t-e)),a=nb(i.map((t=>t.row))).sort(((t,e)=>t-e));let l;if(a.length&&(l=Jx(a[0]-1,a[a.length-1]+1,r)),s.length){const t=Jx(s[0]-1,s[s.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}if(n.length){const t=Jx(n[0]-1,n[n.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}n.forEach((t=>{!function(t,e){const i=e.proxy;t>=i.rowStart&&t<=i.rowEnd&&(function(t,e){for(let i=0;i<e.table.colCount;i++){const o=e.getColGroup(i,!1);if(!o)continue;let r;o.forEachChildren((e=>e.row===t&&(r=e,!0))),r&&(o.updateColumnHeight(-r.attribute.height),o.removeChild(r))}}(t,e),i.rowEnd--,i.currentRow--),i.bodyBottomRow--;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1}(t,r)}));const h=o.rowHeightsMap;if(n.forEach((t=>{h.delete(t)})),n.length){!function(t){function e(e,i){e.row=i;const o=lm(t.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))}))}(r);const t=Zx(n[n.length-1]-1,n[0]-n.length+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}let d;if(r.table._clearRowRangeHeightsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyBottomRow++;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);if(i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1,!(t<i.rowStart))return t>i.rowEnd?i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,qx(t,e),t):void 0:i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,qx(t,e),t):t}(t,r);d=null!=d?d:e,h.insert(t)})),function(t){function e(e,i,o){e.row=i,e.setAttribute("y",o);const r=lm(t.table,e.col,e.row);r?(e.mergeStartCol=r.start.col,e.mergeEndCol=r.end.col,e.mergeStartRow=r.start.row,e.mergeEndRow=r.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart,r=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart,r=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart,r=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,r=0;null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,r=0;null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,r=0;null==i||i.forEachChildren((t=>{e(t,o,r),o++,r+=t.attribute.height}))}))}(r),s.length){const t=Zx(s[0]-1,s[s.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}for(let t=0;t<o.colCount;t++)a.forEach((e=>{const i=lm(r.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)ny(t,e,r.table,!1);else ny(t,e,r.table,!1)}));if(a.length){const t=Zx(a[0]-1,a[a.length-1]+1,r);l=J(l)?J(t)?Math.min(l,t):l:t}if(at(d)){for(let t=0;t<o.colCount;t++)for(let e=d;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}l=J(l)?J(d)?Math.min(l,d):l:d}if(at(l)&&(r.proxy.rowUpdatePos=Math.min(r.proxy.rowUpdatePos,l)),s.length){if(!at(d)){const t=Math.min(...s);r.proxy.rowUpdatePos=Math.min(t,r.proxy.rowUpdatePos)}r.proxy.rowUpdateDirection="up",r.proxy.updateCellGroups(2*r.proxy.screenRowCount),u()}else n.length&&(function(t,e){if(e.table.isHasSeriesNumber())for(let i=t;i<=e.table.rowCount-1;i++)ny(0,i,e.table,!1)}(n[n.length-1],r),r.proxy.updateCellGroups(2*r.proxy.screenRowCount),u(),r.proxy.progress());r.proxy.progress();const c=o.getRowsHeight(o.frozenRowCount,o.rowCount-1-o.bottomFrozenRowCount);function u(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==a?void 0:a[(null==a?void 0:a.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==n?void 0:n[0])>=o.rowCount-o.bottomFrozenRowCount){for(let t=0;t<o.colCount;t++)for(let e=o.rowCount-o.bottomFrozenRowCount;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}r.proxy.updateBottomFrozenCellGroups()}}r.updateContainerHeight(r.table.frozenRowCount,c-r.bodyGroup.attribute.height)}function qx(t,e){for(let i=0;i<e.table.colCount;i++){const o=new jC({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(t)});if(o.role="cell",o.col=i,o.row=t,o.needUpdate=!0,!o)continue;const r=e.getColGroup(i);if(r)if(r.firstChild&&t<r.firstChild.row)r.insertBefore(o,r.firstChild),r.firstChild.row=r.firstChild.row+1;else if(r.lastChild&&t>r.lastChild.row)r.appendChild(o);else{const n=e.highPerformanceGetCell(i,t,!0);n!==o&&(r.insertBefore(o,n),n&&(n.row=n.row+1),n!==r.lastChild&&r.lastChild&&(r.lastChild.row=r.lastChild.row+1))}}}function Zx(t,e,i){let o;for(let r=0;r<i.table.colCount;r++){const n=i.table.getCellRange(r,t);let s;n.start.row<=t+1&&n.end.row>=t+1&&(Qx(n,i),s=n.start.row);const a=i.table.getCellRange(r,e);a.start.row<=e+1&&a.end.row>=e+1&&(Qx(a,i),s=a.start.row),J(s)&&(o=J(o)?Math.min(o,s):s)}return o}function Jx(t,e,i){let o;for(let r=0;r<i.table.colCount;r++){let n;const s=i.highPerformanceGetCell(r,t);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>t&&(Qx({start:{row:s.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:s.mergeEndCol}},i),n=s.mergeStartRow);const a=i.highPerformanceGetCell(r,e);a.mergeStartRow&&a.mergeEndRow&&a.mergeStartRow<e&&(Qx({start:{row:a.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:a.mergeStartCol},end:{row:a.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:a.mergeEndCol}},i),n=a.mergeStartRow),J(n)&&(o=J(o)?Math.min(o,n):n)}return o}function Qx(t,e){const{start:i,end:o}=t;for(let t=i.col;t<=o.col;t++)for(let r=i.row;r<=o.row;r++){const i=e.highPerformanceGetCell(t,r,!0);i&&(i.needUpdate=!0)}}function tS(t){const e=t.bodyGroup.firstChild instanceof jC?t.bodyGroup.firstChild:null;e&&(t.rowHeaderGroup.appendChild(e),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width+e.attribute.width),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width-e.attribute.width))}function eS(t){const e=t.colHeaderGroup.firstChild instanceof jC?t.colHeaderGroup.firstChild:null;e&&(t.cornerHeaderGroup.appendChild(e),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width+e.attribute.width),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width-e.attribute.width))}function iS(t){var e;const i=t.rowHeaderGroup.lastChild instanceof jC?t.rowHeaderGroup.lastChild:null===(e=t.rowHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(sS(t.bodyGroup,i,t.bodyGroup.firstChild),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+i.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-i.attribute.width))}function oS(t){var e;const i=t.cornerHeaderGroup.lastChild instanceof jC?t.cornerHeaderGroup.lastChild:null===(e=t.cornerHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(sS(t.colHeaderGroup,i,t.colHeaderGroup.firstChild),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+i.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-i.attribute.width))}function rS(t){const e=t.bottomFrozenGroup.firstChild instanceof jC?t.bottomFrozenGroup.firstChild:null;e&&(t.leftBottomCornerGroup.appendChild(e),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width+e.attribute.width),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width-e.attribute.width),t.table.isPivotChart()&&e.forEachChildren((t=>{t.setAttributes({stroke:!1,fill:!1})})))}function nS(t){var e;const i=t.leftBottomCornerGroup.lastChild instanceof jC?t.leftBottomCornerGroup.lastChild:null===(e=t.leftBottomCornerGroup.lastChild)||void 0===e?void 0:e._prev;i&&(sS(t.bottomFrozenGroup,i,t.bottomFrozenGroup.firstChild),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width+i.attribute.width),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width-i.attribute.width),t.table.isPivotChart()&&i.forEachChildren((e=>{var i,o,r,n;const s=t.table._getCellStyle(e.col,e.row),a=t.table.getCellRange(e.col,e.row),l=wC(s,t.table,a?a.start.col:e.col,a?a.start.row:e.row,VC).theme;e.setAttributes({fill:null!==(o=null===(i=null==l?void 0:l.group)||void 0===i?void 0:i.fill)&&void 0!==o?o:void 0,stroke:null!==(n=null===(r=null==l?void 0:l.group)||void 0===r?void 0:r.stroke)&&void 0!==n?n:void 0})})))}function sS(t,e,i){e&&t&&(i?t.insertBefore(e,i):t.appendChild(e))}function aS(t){var e;for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++){const o=t.getColGroup(i);null===(e=null==o?void 0:o.getChildren())||void 0===e||e.forEach((t=>{t.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.addUpdateBoundTag())}))}))}}function lS(t,e){const i=t.table;if(i.isPivotChart()){const o=i._selectedDataItemsInChart.length;if((null===e||0===(null==e?void 0:e.length)||0===Object.keys(e).length)&&0===o)return;const r=[];if(Array.isArray(e))e.forEach((t=>{if(t&&0!==t.key&&Object.keys(t).length>0){const e={};for(const i in t)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(e[i]=t[i]);r.push(e)}}));else if(e&&0!==e.key&&Object.keys(e).length>0){const t={};for(const i in e)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(t[i]=e[i]);r.push(t)}At(i._selectedDataItemsInChart,r)||(i._selectedDataItemsInChart=r,i.internalProps.layoutMap.updateDataStateToChartInstance(),aS(t),i.scenegraph.updateNextFrame())}}function hS(t,e,i){t.forEachChildren((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttributes({width:Math.ceil(e-t.attribute.cellPadding[3]-t.attribute.cellPadding[1]),height:Math.ceil(i-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])}))}))}function dS(t,e,i){return new jC({x:0,y:0,width:t,height:e,clip:null!=i&&i,pickable:!1})}function cS(t,e){return t.forEachChildrenSkipChild(((t,i)=>{t.setAttribute("x",e),e+=t.attribute.width})),e}function uS(t,e,i,o,r){const n=t.name;fS(i,o,(t=>t.name===n),(t=>{qC(e,t),t.name=e.name}),r),r.updateNextFrame()}function gS(t,e,i,o,r,n,s,a){const l=a.table.internalProps.headerHelper.getSortIcon(o,a.table,t,e);if(i&&uS(i,l,t,e,a),!function(t,e,i,o,r){const n=r.getCellRange(t,e),s=r.getCellRange(i,o);return n.start.col===s.start.col&&n.start.row===s.start.row&&n.end.col===s.end.col&&n.end.row===s.end.row}(t,e,r,n,a.table)){const t=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,n);s?uS(s,t,r,n,a):function(t,e,i,o){const r=o.getCell(t,e);if(J(r.mergeStartCol)&&J(r.mergeStartRow)&&J(r.mergeEndCol)&&J(r.mergeEndRow))for(let t=r.mergeStartCol;t<=r.mergeEndCol;t++)for(let e=r.mergeStartRow;e<=r.mergeEndRow;e++){let r;o.getCell(t,e).forEachChildren((t=>"sort"===t.attribute.funcType&&(r=t,!0))),r&&(qC(i,r),r.name=i.name)}else{let t;r.forEachChildren((e=>"sort"===e.attribute.funcType&&(t=e,!0))),t&&(qC(i,t),t.name=i.name)}}(r,n,t,a)}}function pS(t,e,i){t.forEachChildren((t=>{"group"===t.type?pS(t,e,i):e(t)&&i(t)}))}function fS(t,e,i,o,r){const n=r.getCell(t,e);if("cell"===n.role&&J(n.mergeStartCol)&&J(n.mergeStartRow)&&J(n.mergeEndCol)&&J(n.mergeEndRow)){const{colStart:t,colEnd:e,rowStart:s,rowEnd:a}=Py(n,r);for(let n=t;n<=e;n++)for(let t=s;t<=a;t++)pS(r.highPerformanceGetCell(n,t),i,o)}else pS(n,i,o)}function vS(t,e){const{bgColor:i,borderColor:o,borderLineWidth:r,borderLineDash:n}=e,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:i};return s.stroke=sw(o,void 0),s.lineWidth=r,n&&(s.lineDash=n),s.lineCap="butt",Array.isArray(o)&&(s.strokeArrayColor=Dm(o)),Array.isArray(r)&&(s.strokeArrayWidth=Dm(r),s.lineWidth=1),t.setAttributes(s),t.role="corner-frozen",t}function bS(t,e,i,o){const r=o.scenegraph,n=mS(t.map((t=>t.col))).sort(((t,e)=>e-t)),s=mS(e.map((t=>t.col))).sort(((t,e)=>t-e)),a=mS(i.map((t=>t.col))).sort(((t,e)=>t-e));n.forEach((t=>{!function(t,e){const i=e.proxy;if(t>=e.table.rowHeaderLevelCount)if(t>=e.table.colCount-e.table.rightFrozenColCount);else{const i=e.getColGroup(t,!1);i&&i.parent===e.bodyGroup&&e.bodyGroup.removeChild(i);const o=e.getColGroupInBottom(t);o&&o.parent===e.bottomFrozenGroup&&e.bottomFrozenGroup.removeChild(o)}t>=i.colStart&&t<=i.colEnd&&(i.colEnd--,i.currentCol--),i.bodyRightCol--;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1}(t,r)}));const l=o.colWidthsMap;let h;if(n.forEach((t=>{l.delAndReorder(t)})),n.length&&CS(r),r.table._clearColRangeWidthsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyRightCol++;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);if(i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1,!(t<i.colStart))return t>i.colEnd?i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,yS(t,e),t):void 0:i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,yS(t,e),t):t}(t,r);CS(r),h=null!=h?h:e,l.addAndReorder(t)})),function(t){let e=t.bodyColStart,i=t.getCellGroupX(e);function o(i){i.col=e;const o=lm(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightTopCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightBottomCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++}))}(r),a.forEach((t=>{for(let e=0;e<o.rowCount;e++){const i=lm(r.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let t=i.start.col;t<=i.end.col;t++)ny(t,e,r.table,!1);else ny(t,e,r.table,!1)}})),at(h)){for(let t=h;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}r.proxy.colUpdatePos=h}if(s.length){if(!at(h)){const t=Math.min(...s);r.proxy.colUpdatePos=t}r.proxy.colUpdateDirection="left",r.proxy.updateColGroups(2*r.proxy.screenColCount),c(),r.proxy.progress()}else n.length&&(r.proxy.updateColGroups(2*r.proxy.screenColCount),c(),r.proxy.progress());const d=o.getColsWidth(o.frozenColCount,o.colCount-1);function c(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.colCount-o.rightFrozenColCount||(null==a?void 0:a[(null==a?void 0:a.length)-1])>=o.colCount-o.rightFrozenColCount||(null==n?void 0:n[0])>=o.colCount-o.rightFrozenColCount){for(let t=o.colCount-o.rightFrozenColCount;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=r.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}r.proxy.updateRightFrozenCellGroups()}}r.updateContainerWidth(r.table.frozenColCount,d-r.bodyGroup.attribute.width)}function mS(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function CS(t){let e=t.bodyColStart;function i(i){i.col=e;const o=lm(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++}))}function yS(t,e){if(e.colHeaderGroup&&e.table.columnHeaderLevelCount>0){const o=new jC({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const r=e.getColGroup(t,!0);r?e.colHeaderGroup.insertBefore(o,r):e.colHeaderGroup.appendChild(o),i(o,t,0,e.table.columnHeaderLevelCount-1)}if(e.bodyGroup){const o=new jC({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const r=e.getColGroup(t,!1);r?e.bodyGroup.insertBefore(o,r):e.bodyGroup.appendChild(o),i(o,t,e.bodyRowStart,e.bodyRowEnd)}if(e.bottomFrozenGroup&&e.table.bottomFrozenRowCount>0){const o=new jC({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const r=e.getColGroupInBottom(t);r?e.bottomFrozenGroup.insertBefore(o,r):e.bottomFrozenGroup.appendChild(o),i(o,t,e.table.rowCount-e.table.bottomFrozenRowCount,e.table.rowCount-1)}function i(t,i,o,r){for(let n=o;n<=r;n++){const o=new jC({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(n)});o.role="cell",o.col=i,o.row=n,o.needUpdate=!0,t.appendChild(o)}}}Yf(),Bo.load(tx),Bo.load(fy);class wS{constructor(t){let e,i;var o;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,o=this.table.theme.textPopTipStyle,xt(Hf.poptip,Lf,o),t.options.canvas&&t.options.viewBox?(cc.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,i=t.options.viewBox.y2-t.options.viewBox.y1):"node"===Xv.mode?(cc.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(cc.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Bc(Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:t=>{this.table.options.beforeRender&&this.table.options.beforeRender(t)},afterRender:t=>{this.table.options.afterRender&&this.table.options.afterRender(t),this.table.fireListeners("after_render",null)},canvasControled:!t.options.canvas,viewBox:t.options.viewBox},t.options.renderOption)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.width)&&void 0!==e?e:0}get height(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.height)&&void 0!==e?e:0}get x(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.x)&&void 0!==e?e:0}get y(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.y)&&void 0!==e?e:0}get bodyRowStart(){var t;return null!==(t=this.proxy.rowStart)&&void 0!==t?t:0}get bodyRowEnd(){var t;return null!==(t=this.proxy.rowEnd)&&void 0!==t?t:this.table.rowCount-1}get bodyColStart(){var t;return null!==(t=this.proxy.colStart)&&void 0!==t?t:0}get bodyColEnd(){var t;return null!==(t=this.proxy.colEnd)&&void 0!==t?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),function(t){const e=t.table.tableNoFrameWidth,i=t.table.tableNoFrameHeight;t.tableGroup=new jC({x:0,y:0,width:e,height:i,clip:!0,pickable:!1}),t.tableGroup.role="table";const o=dS(0,0,!t.table.options.enableTreeStickCell);o.role="col-header",t.colHeaderGroup=o;const r=dS(0,0,!t.table.options.enableTreeStickCell);r.role="corner-header",t.cornerHeaderGroup=r;const n=dS(0,0,!0);n.role="row-header",t.rowHeaderGroup=n;const s=dS(e,0,!0);s.role="body",t.bodyGroup=s;const a=dS(0,0,!0);a.role="right-frozen",t.rightFrozenGroup=a;const l=dS(0,0,!0);l.role="bottom-frozen",t.bottomFrozenGroup=l;const h=dS(0,0);h.role="component",t.componentGroup=h;const d=dS(0,0,!0);d.role="corner-right-top-header",t.rightTopCornerGroup=d;const c=dS(0,0,!0);c.role="corner-right-bottom-header",t.rightBottomCornerGroup=c;const u=dS(0,0,!0);u.role="corner-left-bottom-header",t.leftBottomCornerGroup=u,t.tableGroup.addChild(s),t.tableGroup.addChild(n),t.tableGroup.addChild(l),t.tableGroup.addChild(o),t.tableGroup.addChild(a),t.tableGroup.addChild(c),t.tableGroup.addChild(d),t.tableGroup.addChild(u),t.tableGroup.addChild(r),t.tableGroup.addChild(h)}(this)}clearCells(){var t,e;(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach((t=>{t.deactivate(this.stage.pluginService)})),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),null===(t=this.proxy)||void 0===t||t.release(),null===(e=this.table.reactCustomLayout)||void 0===e||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new ow(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach((t=>{"poptipForText"===t.name&&this.stage.pluginService.register(t)})),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new Wx(this.table),rw(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(vS(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),vS(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),vS(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,r,n,s,a,l;let h;if(h=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?null===(o=this.rightTopCornerGroup.getColGroup(t))||void 0===o?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?null===(r=this.leftBottomCornerGroup.getColGroup(t))||void 0===r?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?null===(n=this.rightBottomCornerGroup.getColGroup(t))||void 0===n?void 0:n.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?null===(s=this.rightFrozenGroup.getColGroup(t))||void 0===s?void 0:s.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?null===(a=this.bottomFrozenGroup.getColGroup(t))||void 0===a?void 0:a.getRowGroup(e):null===(l=this.getColGroup(t,e<this.frozenRowCount))||void 0===l?void 0:l.getRowGroup(e),h&&"shadow-cell"===h.role&&!i){const i=this.table.getCellRange(t,e);i.start.col===t&&i.start.row===e||(h=this.getCell(i.start.col,i.start.row))}return h||lx}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=t<this.frozenColCount&&i?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):i?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),e||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=lm(this.table,t,e);let r=i.attribute.width,n=i.attribute.height;return o&&(r/=o.end.col-o.start.col+1,n/=o.end.row-o.start.row+1),{width:r,height:n}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i;(null===(e=null===(t=this.table.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0&&((i=this).selectingRangeComponents.forEach(((t,e)=>{Gx(t,e,i)})),i.selectedRangeComponents.forEach(((t,e)=>{Gx(t,e,i)})))}hideHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(fS(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0);const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1)}),i),i.updateNextFrame())}(t,e,this)}showHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(fS(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}hideClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(fS(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0)}),i),i.updateNextFrame())}(t,e,this)}showClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(fS(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}getIcon(t,e,i,o){return function(t,e,i,o,r){let n;return r.getCell(t,e).forEachChildren((t=>{t.role&&t.role.startsWith("icon")&&t.containsPoint(i,o,Xe.GLOBAL)&&(n=t)})),n}(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){!function(t,e,i,o,r){var n,s;if((t.attribute.backgroundColor||t.attribute.hoverImage)&&fS(e,i,(e=>e.name===t.name),(t=>{var e,i,o,r,n,s,a,l;if(t.attribute.backgroundColor){let h=t.parent.getChildByName("icon-back");h?h.setAttributes({x:(null!==(e=t.attribute.x)&&void 0!==e?e:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(i=t.attribute.y)&&void 0!==i?i:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(o=t.attribute.dx)&&void 0!==o?o:0,dy:null!==(r=t.attribute.dy)&&void 0!==r?r:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(h=ad({x:(null!==(n=t.attribute.x)&&void 0!==n?n:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(s=t.attribute.y)&&void 0!==s?s:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(a=t.attribute.dx)&&void 0!==a?a:0,dy:null!==(l=t.attribute.dy)&&void 0!==l?l:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),h.name="icon-back"),t.parent.insertBefore(h,t)}t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage)}),r),t.tooltip){const{x1:o,x2:a,y1:l,y2:h}=t.globalAABBBounds,d={content:t.tooltip.title,referencePosition:{rect:{left:o,right:a,top:l,bottom:h,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},disappearDelay:t.tooltip.disappearDelay,style:Object.assign({},null===(n=r.table.internalProps.theme)||void 0===n?void 0:n.tooltipStyle,null===(s=t.tooltip)||void 0===s?void 0:s.style)};r.table.internalProps.tooltipHandler.isBinded(d)||r.table.showTooltip(e,i,d)}}(t,e,i,0,this)}updateSortIcon(t,e,i,o,r,n,s){gS(t,e,i,o,r,n,s,this)}updateFrozenIcon(t,e){!function(t){for(let e=0;e<t.table.colCount;e++)for(let i=0;i<t.table.columnHeaderLevelCount;i++)fS(e,i,(t=>"frozen"===t.attribute.funcType),(o=>{const r=t.table.internalProps.headerHelper.getFrozenIcon(e,i);qC(r,o),o.name=r.name}),t)}(this)}updateHierarchyIcon(t,e){!function(t,e,i){let o;o=i.table.isHeader(t,e)?i.table.internalProps.headerHelper.getHierarchyIcon(t,e):i.table.internalProps.bodyHelper.getHierarchyIcon(t,e),fS(t,e,(t=>t.attribute.funcType===Pv.collapse||t.attribute.funcType===Pv.expand),(t=>{qC(o,t),t.name=o.name}),i)}(t,e,this)}setIconNormalStyle(t,e,i){!function(t,e,i,o){(t.attribute.backgroundColor||t.attribute.hoverImage)&&fS(e,i,(e=>e.name===t.name),(t=>{const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}),o)}(t,e,i,this)}residentHoverIcon(t,e){!function(t,e,i){fS(t,e,(t=>t.attribute.funcType===Pv.dropDown),(t=>{t.oldVisibleTime=t.attribute.visibleTime,t.setAttribute("visibleTime","always"),t.setAttribute("opacity",1)}),i)}(t,e,this)}resetResidentHoverIcon(t,e){!function(t,e,i){fS(t,e,(t=>t.attribute.funcType===Pv.dropDown),(t=>{t.oldVisibleTime&&t.setAttribute("visibleTime",t.oldVisibleTime),t.setAttribute("opacity","always"===t.attribute.visibleTime?1:0)}),i)}(t,e,this)}deactivateChart(t,e){var i,o;if(-1===t||-1===e)return;const r=this.getCell(t,e);null===(o=null===(i=null==r?void 0:r.firstChild)||void 0===i?void 0:i.deactivate)||void 0===o||o.call(i)}activateChart(t,e){var i,o;if(-1===t||-1===e)return;const r=this.getCell(t,e);null===(o=null===(i=null==r?void 0:r.firstChild)||void 0===i?void 0:i.activate)||void 0===o||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,r,n,s){!function(t,e,i,o,r,n,s,a){var l,h,d,c,u,g,p,f;let v=!!(null===(l=t.table.options.excelOptions)||void 0===l?void 0:l.fillHandle);if((null===(h=t.table.stateManager.select.ranges)||void 0===h?void 0:h.length)>1)v=!1,t.removeFillHandleFromSelectComponents();else if(1===(null===(d=t.table.stateManager.select.ranges)||void 0===d?void 0:d.length)){const e=Math.max(t.table.stateManager.select.ranges[0].start.row,t.table.stateManager.select.ranges[0].end.row),i=Math.max(t.table.stateManager.select.ranges[0].start.col,t.table.stateManager.select.ranges[0].end.col);t.table.isHeader(i,e)&&(v=!1)}!Array.isArray(a)||!1!==a[1]&&!1!==a[2]||(v=!1);const b=Math.min(e,o),m=Math.min(i,r),C=Math.max(e,o),y=Math.max(i,r),w=t.highPerformanceGetCell(b,m).globalAABBBounds,x=t.highPerformanceGetCell(C,y).globalAABBBounds,S=t.table.theme,_=null===(c=S.selectionStyle)||void 0===c?void 0:c.cellBorderColor,A=null===(u=S.selectionStyle)||void 0===u?void 0:u.cellBorderLineWidth,R=ad({pickable:!1,fill:"replace"!==(null===(g=S.selectionStyle)||void 0===g?void 0:g.selectionFillMode)&&(null!==(f=null===(p=S.selectionStyle)||void 0===p?void 0:p.cellBgColor)&&void 0!==f?f:"rgba(0, 0, 255,0.1)"),lineWidth:A,stroke:a.map((t=>!!t&&_)),x:w.x1-t.tableGroup.attribute.x,y:w.y1-t.tableGroup.attribute.y,width:0,height:0,visible:!0});let B;v&&(B=ad({pickable:!1,fill:_,stroke:_,x:x.x2-3,y:x.y2-3,width:6,height:6,visible:!0})),t.lastSelectId=s,t.selectingRangeComponents.set(`${b}-${m}-${C}-${y}-${s}`,{rect:R,fillhandle:B,role:n}),t.tableGroup.insertAfter(R,"body"===n?t.bodyGroup:"columnHeader"===n?t.colHeaderGroup:"rowHeader"===n?t.rowHeaderGroup:"cornerHeader"===n?t.cornerHeaderGroup:"rightTopCorner"===n?t.rightTopCornerGroup:"rightFrozen"===n?t.rightFrozenGroup:"leftBottomCorner"===n?t.leftBottomCornerGroup:"bottomFrozen"===n?t.bottomFrozenGroup:t.rightBottomCornerGroup),v&&t.tableGroup.insertAfter(B,"body"===n?t.bodyGroup:"columnHeader"===n?t.colHeaderGroup:"rowHeader"===n?t.rowHeaderGroup:"cornerHeader"===n?t.cornerHeaderGroup:"rightTopCorner"===n?t.rightTopCornerGroup:"rightFrozen"===n?t.rightFrozenGroup:"leftBottomCorner"===n?t.leftBottomCornerGroup:"bottomFrozen"===n?t.bottomFrozenGroup:t.rightBottomCornerGroup)}(this,t,e,i,o,r,n,s)}moveSelectingRangeComponentsToSelectedRangeComponents(){Xx(this)}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,i)=>{var o;i.split("-")[4]===t.lastSelectId&&(e.rect.delete(),null===(o=e.fillhandle)||void 0===o||o.delete(),t.selectedRangeComponents.delete(i))}))}deleteAllSelectBorder(){Yx(this),$x(this)}updateCellSelectBorder(t){jx(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}removeFillHandleFromSelectComponents(){this.selectedRangeComponents.forEach(((t,e)=>{var i;null===(i=t.fillhandle)||void 0===i||i.delete(),t.fillhandle=void 0}))}recreateAllSelectRangeComponents(){Yx(this),this.table.stateManager.select.ranges.forEach((t=>{jx(this,t)})),Xx(this)}updateColWidth(t,e,i,o){(function(t,e,i,o){o||t.table._setColWidth(e,t.table.getColWidth(e)+i,!0);const r=t.getColGroup(e,!0),n=t.getColGroupInRightTopCorner(e);r&&!n&&Ey(r,i,"col-corner",t),n&&Ey(n,i,"right-top",t);const s=t.getColGroup(e);s&&Ey(s,i,"row-body",t);const a=t.getColGroupInLeftBottomCorner(e);a&&Ey(a,i,"left-bottom",t);const l=t.getColGroupInBottom(e);l&&Ey(l,i,"bottom",t);const h=t.getColGroupInRightBottomCorner(e);h&&Ey(h,i,"right-bottom",t),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.bodyGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))),a&&t.leftBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),l&&t.bottomFrozenGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),h&&t.rightBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))})(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){!function(t,e){const{table:i}=t,o=i.internalProps.layoutMap,r=-1===e?"all":i.internalProps.columnResizeType;if("column"===r){const o=t.getColGroup(e);if(null==o||o.forEachChildren((t=>{hS(t,i.getColWidth(t.col),i.getRowHeight(t.row))})),"adaptive"===i.widthMode&&e<i.colCount-1){const o=t.getColGroup(e+1);null==o||o.forEachChildren((t=>{hS(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}else{let n,s,a,l=i.rowHeaderLevelCount,h=i.colCount-1;if("indicator"===r)if(o.indicatorsAsCol)n=o.getIndicatorKey(e,i.columnHeaderLevelCount);else{const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),r=t.colHeaderPaths[t.colHeaderPaths.length-1];s=r.dimensionKey,a=r.value}else if("indicatorGroup"===r){const t=i.internalProps.layoutMap,e=t.getCellHeaderPaths(i.stateManager.columnResize.col,i.columnHeaderLevelCount),o=t.getHeadNodeByRowOrColDimensions(e.colHeaderPaths.slice(0,e.colHeaderPaths.length-1));l=o.startInTotal+i.frozenColCount,h=o.startInTotal+i.frozenColCount+o.size-1}for(let e=l;e<=h;e++){const l=t.getColGroup(e);if(l){if("indicator"===r){const t=o.getIndicatorKey(e,i.columnHeaderLevelCount);if(o.indicatorsAsCol&&t!==n)continue;if(!o.indicatorsAsCol){const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),r=null==t?void 0:t.colHeaderPaths[t.colHeaderPaths.length-1];if(!r||s!==r.dimensionKey||a!==r.value)continue}}l.forEachChildren((t=>{hS(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}}}(this,t)}updateChartSizeForResizeRowHeight(t){!function(t,e){var i;const{table:o}=t,r=o.internalProps.layoutMap,n=o.stateManager,s=-1===e?"all":o.internalProps.rowResizeType;let a,l,h,d=o.columnHeaderLevelCount,c=o.rowCount-1;if("indicator"===s)if(r.indicatorsAsCol){const t=r.getCellHeaderPaths(o.rowHeaderLevelCount-1,e),n=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];l=null==n?void 0:n.dimensionKey,h=null==n?void 0:n.value}else a=r.getIndicatorKey(o.rowHeaderLevelCount,e);else if("indicatorGroup"===s){const t=o.internalProps.layoutMap,i=t.getCellHeaderPaths(o.rowHeaderLevelCount,e),r=t.getHeadNodeByRowOrColDimensions(i.rowHeaderPaths.slice(0,i.rowHeaderPaths.length-1));d=r.startInTotal+o.frozenRowCount,c=r.startInTotal+o.frozenRowCount+r.size-1}for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++)if("row"===s){const r=t.highPerformanceGetCell(i,e);if("cell"!==r.role)continue;if(hS(r,o.getColWidth(r.col),o.getRowHeight(r.row)),"adaptive"===o.heightMode&&e<o.rowCount-1){const r=t.highPerformanceGetCell(i,e+1);hS(r,o.getColWidth(r.col),o.getRowHeight(r.row))}}else for(let e=d;e<=c;e++){if("indicator"===s){const t=r.getIndicatorKey(n.table.rowHeaderLevelCount,e);if(!r.indicatorsAsCol&&t!==a)continue;if(r.indicatorsAsCol){const t=r.getCellHeaderPaths(n.table.rowHeaderLevelCount-1,e),i=null==t?void 0:t.rowHeaderPaths[t.rowHeaderPaths.length-1];if(!i||l!==i.dimensionKey||h!==i.value)continue}}const d=t.highPerformanceGetCell(i,e);"cell"===d.role&&hS(d,o.getColWidth(d.col),o.getRowHeight(d.row))}}(this,t)}updateChartState(t){this.table.isPivotChart()&&lS(this,t)}updateCheckboxCellState(t,e,i){var o,r;if(this.table.transpose)null===(o=this.bodyGroup.children)||void 0===o||o.forEach((t=>{var o;null===(o=t.getChildAt(e))||void 0===o||o.getChildren().forEach((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}));else{const e=this.getColGroup(t);null===(r=null==e?void 0:e.children)||void 0===r||r.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}))}}updateHeaderCheckboxCellState(t,e,i){var o,r;this.table.transpose?null===(o=this.rowHeaderGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))})):null===(r=this.getColGroup(t,!0).children)||void 0===r||r.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))}))}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=ix(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;"adaptive"===t.widthMode||t.autoFillWidth||t.internalProps.transpose?ex(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&ex(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&ex(this.table,t.rightFrozenColCount,t.colCount-1,!0),ex(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,"adaptive"===t.heightMode||t.autoFillHeight?Sy(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&Sy(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&Sy(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),Sy(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),("adaptive"===this.table.widthMode||this.table.autoFillWidth)&&(0===this.table.internalProps._widthResizedColMap.size?this.recalculateColWidths():this.dealWidthMode()),"adaptive"===this.table.heightMode?0===this.table.internalProps._heightResizedRowMap.size?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),("adaptive"===this.table.widthMode||"adaptive"===this.table.heightMode||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o,r,n,s,a,l,h,d,c,u;if(this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border){const g=null===(t=this.tableGroup.border)||void 0===t?void 0:t.attribute;let p,f,v,b;(null==g?void 0:g.strokeArrayWidth)?(p=g.strokeArrayWidth?g.strokeArrayWidth[0]:null!==(e=g.lineWidth)&&void 0!==e?e:0,f=g.strokeArrayWidth?g.strokeArrayWidth[1]:null!==(i=g.lineWidth)&&void 0!==i?i:0,v=g.strokeArrayWidth?g.strokeArrayWidth[2]:null!==(o=g.lineWidth)&&void 0!==o?o:0,b=g.strokeArrayWidth?g.strokeArrayWidth[3]:null!==(r=g.lineWidth)&&void 0!==r?r:0):(p=null!==(n=null==g?void 0:g.lineWidth)&&void 0!==n?n:0,f=null!==(s=null==g?void 0:g.lineWidth)&&void 0!==s?s:0,v=null!==(a=null==g?void 0:g.lineWidth)&&void 0!==a?a:0,b=null!==(l=null==g?void 0:g.lineWidth)&&void 0!==l?l:0),"rect"===this.tableGroup.border.type?(null===(h=this.table.theme.frameStyle)||void 0===h?void 0:h.innerBorder)?this.tableGroup.border.setAttributes({x:this.table.tableX+b/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-b/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-b/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+b/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}):"group"===this.tableGroup.border.type&&((null===(d=this.table.theme.frameStyle)||void 0===d?void 0:d.innerBorder)?(this.tableGroup.border.setAttributes({x:this.table.tableX+b/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-b/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}),null===(c=this.tableGroup.border.firstChild)||void 0===c||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-b/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-b/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+b/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}),null===(u=this.tableGroup.border.firstChild)||void 0===u||u.setAttributes({x:b/2,y:p/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height})))}this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){ky(this,t,e=Math.round(e),i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const r=t[o];if(r>=this.proxy.rowStart&&r<=this.proxy.rowEnd){const t=e[o];ky(this,r,Math.round(t),i),this._updateContainerHeight(r,t)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setX(-t,e)}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=null===(e=this.bodyGroup.firstChild)||void 0===e?void 0:e.firstChild,r=null===(i=this.bodyGroup.firstChild)||void 0===i?void 0:i.lastChild;0===t&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:r&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&r.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&r.attribute.y+r.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-r.attribute.y-r.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;0===t&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),Hx(this.table),this.table.options.animationAppear&&function(t){var e,i,o,r;if(!t.options.animationAppear)return;let n,s,a,l;!0===t.options.animationAppear?(n=500,s=0,a="one-by-one",l="column"):(n=null!==(e=t.options.animationAppear.duration)&&void 0!==e?e:500,s=null!==(i=t.options.animationAppear.delay)&&void 0!==i?i:0,a=null!==(o=t.options.animationAppear.type)&&void 0!==o?o:"one-by-one",l=null!==(r=t.options.animationAppear.direction)&&void 0!==r?r:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:c}=t,{colStart:u,colEnd:g,rowStart:p,rowEnd:f}=h.proxy;for(let t=0;t<=g;t++)for(let e=0;e<=f;e++){const i=h.highPerformanceGetCell(t,e);i&&"cell"===i.role&&i.forEachChildren((i=>{i.setAttribute("opacity",0),i.animate().wait("one-by-one"===a?("row"===l?e:t)*(n-s):s).to({opacity:1},n,"linear")}))}}(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0;for(let e=0;e<t.colCount;e++)(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=t.getColWidth(e));ax(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,o=0;for(let e=0;e<t.colCount;e++){const r=t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r),o+=r}if(o<e&&o>i){ax(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{o+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",o);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{r+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",r),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if("adaptive"===e.heightMode){e._clearRowRangeHeightsMap();const t=e.getRowsHeight(0,e.columnHeaderLevelCount-1),i=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,o=e.tableNoFrameHeight-t-i,r=e.columnHeaderLevelCount,n=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let s=0;for(let t=r;t<n;t++)s+=e.getRowHeight(t);const a=o/s;for(let t=r;t<n;t++){let i;i=t===n-1?o-e.getRowsHeight(r,n-2):Math.round(e.getRowHeight(t)*a),this.setRowHeight(t,i)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,r=0;for(let t=0;t<e.rowCount;t++){const i=e.getRowHeight(t);(t<e.columnHeaderLevelCount||e.isPivotChart()&&t>=e.rowCount-e.bottomFrozenRowCount)&&(r+=i),o+=i}if((null!==(t=this._dealAutoFillHeightOriginRowsHeight)&&void 0!==t?t:o)<i&&o-r>0){const t=e.columnHeaderLevelCount,n=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,s=(i-r)/(o-r);for(let o=t;o<n;o++){let a;a=o===n-1?i-r-e.getRowsHeight(t,n-2):Math.round(e.getRowHeight(o)*s),this.setRowHeight(o,a)}}}}dealFrozen(){!function(t){var e,i;if(t.table.frozenColCount>t.table.rowHeaderLevelCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.table.rowHeaderLevelCount;e++)tS(t),eS(t),rS(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)iS(t),oS(t),nS(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.frozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0}(this)}resetFrozen(){!function(t){var e,i;if(t.frozenColCount>t.table.frozenColCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.frozenColCount-t.table.frozenColCount;e++)iS(t),oS(t),nS(t)}else if(t.frozenColCount<t.table.frozenColCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.frozenColCount;e++)tS(t),eS(t),rS(t)}t.deleteAllSelectBorder(),t.table.stateManager.select.ranges.forEach((e=>{t.updateCellSelectBorder(e)})),t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0,t.proxy.colStart=t.table.frozenColCount,t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0}(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let r=!1;return t.forEachChildren(((t,n)=>{n+=e;const s=lm(this.table,i,n);s?t=this.getCell(s.start.col,s.start.row):t.setAttribute("width",o);const a=Dm(VC("padding",this.table._getCellStyle(i,n),i,n,this.table)),l=t.getChildByName("text");let h=0,d=0;if(l)h=l.AABBBounds.height()+(a[0]+a[2]),l.setAttribute("maxLineWidth",o-(a[1]+a[3])),d=l.AABBBounds.height()+(a[0]+a[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(a[0]+a[2]),e._cellWidth=o-(a[1]+a[3]),e.layout(),d=e.AABBBounds.height()+(a[0]+a[2])}const c=this.table.getRowHeight(n);t.attribute.height!==d&&(t.setAttribute("height",d),(c===h||d>c)&&(r=!0))})),r}updateHeaderPosition(t,e,i,o,r){!function(t,e,i,o,r,n){const s=n.scenegraph;for(let i=t;i<=e;i++){const t=n.getColWidth(i),e=n.scenegraph.getColGroup(i,!0),o=n.scenegraph.getColGroup(i),r=n.scenegraph.getColGroupInBottom(i),s=n.scenegraph.getColGroupInLeftBottomCorner(i),a=n.scenegraph.getColGroupInRightBottomCorner(i);e&&(e.setAttribute("width",t),e.forEachChildren((e=>{e.setAttribute("width",t)}))),o&&(o.setAttribute("width",t),o.forEachChildren((e=>{e.setAttribute("width",t)}))),r&&(r.setAttribute("width",t),r.forEachChildren((e=>{e.setAttribute("width",t)}))),a&&(a.setAttribute("width",t),a.forEachChildren((e=>{e.setAttribute("width",t)}))),s&&(s.setAttribute("width",t),s.forEachChildren((e=>{e.setAttribute("width",t)})))}if(s.updateContainer(),"column"===r)for(let i=t;i<=e;i++){const t=n.scenegraph.getColGroup(i);null==t||t.setAttribute("chartInstance",void 0);for(let t=0;t<=n.frozenRowCount-1;t++)s.updateCellContent(i,t);for(let t=s.bodyRowStart;t<=s.bodyRowEnd;t++)s.updateCellContent(i,t);for(let t=n.rowCount-n.bottomFrozenRowCount;t<=n.rowCount-1;t++)s.updateCellContent(i,t)}else{for(let t=0;t<=n.frozenColCount-1;t++){const e=n.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=s.bodyColStart;t<=s.bodyColEnd;t++){const e=n.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=n.colCount-n.rightFrozenColCount;t<=n.colCount-1;t++){const e=n.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}}}(t,e,i,o,r,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=cS(this.cornerHeaderGroup,0),r=cS(this.rowHeaderGroup,0),n=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?cS(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth(null!==(t=this.table.frozenColCount)&&void 0!==t?t:0,this.colHeaderGroup.firstChild.col-1):0):0,s=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?cS(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth(null!==(e=this.table.frozenColCount)&&void 0!==e?e:0,this.bodyGroup.firstChild.col-1):0):0,a=cS(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&cS(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth(null!==(i=this.table.frozenColCount)&&void 0!==i?i:0,this.bottomFrozenGroup.firstChild.col-1):0),cS(this.leftBottomCornerGroup,0),cS(this.rightTopCornerGroup,0),cS(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(n-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(r-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(n-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(a-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(a-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(a-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(s-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout((()=>{this.updateContainerSync()}),0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){var i;const o=(null===(i=this.table.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),r=this.getCell(t,e);"image"!==o&&"video"!==o||ey(r,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;rw(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),rw(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),rw(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),rw(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),rw(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i){let o,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(!i){const i=this.table.getDrawRange();return e>=i.top&&e<=i.bottom&&(o=this.table.getCellAtRelativePosition(t-r,e),o.col===this.table.colCount-1)?o:{col:-1,row:-1}}return i.stage?(t<i.globalAABBBounds.x1+r?o={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-r<t&&(o={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),o&&this.table.rightFrozenColCount>0&&o.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(o.col=o.col+1,o.rightFrozen=!0),o||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(i){let t;if(e<i.globalAABBBounds.y1+o?t={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(t={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),t&&this.table.bottomFrozenRowCount>0&&t.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(t.row=t.row+1,t.bottomFrozen=!0),t)return t}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:function(t,e){const{table:i,proxy:o,rightTopCornerGroup:r,rightFrozenGroup:n,rightBottomCornerGroup:s,bottomFrozenGroup:a,bodyGroup:l,colHeaderGroup:h}=e,d=e.table.rightFrozenColCount;if(t>d){for(let o=i.colCount-d-1;o>=i.colCount-t;o--)sS(n,e.getColGroup(o),n.firstChild),sS(r,e.getColGroup(o,!0),r.firstChild),sS(s,e.getColGroupInBottom(o),s.firstChild);let o=0;n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}else if(t<d){for(let o=i.colCount-d;o<i.colCount-t;o++){const t=e.getColGroup(o);t.setAttribute("x",l.lastChild.attribute.x+i.getColWidth(l.lastChild.col)),l.appendChild(t);const r=e.getColGroupInRightTopCorner(o);r.setAttribute("x",h.lastChild.attribute.x+i.getColWidth(h.lastChild.col)),h.appendChild(r);const n=e.getColGroupInRightBottomCorner(o);n.setAttribute("x",a.lastChild.attribute.x+i.getColWidth(a.lastChild.col)),a.appendChild(n)}let o=0;n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}n.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),r.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),s.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),i.internalProps.rightFrozenColCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:function(t,e){const{table:i,proxy:o,bottomFrozenGroup:r,leftBottomCornerGroup:n,rightBottomCornerGroup:s}=e;r.childrenCount||(o.table.isPivotChart()||(ux(n,0,0,0,i.frozenColCount-1,0,-1,"rowHeader",i),ux(s,0,0,i.colCount-i.rightFrozenColCount,i.colCount-1,0,-1,"body",i)),ux(r,0,0,o.colStart,o.colEnd,0,-1,"body",i));const a=e.table.bottomFrozenRowCount;if(t>a){for(let o=0;o<i.frozenColCount;o++){const r=e.getColGroupInLeftBottomCorner(o);for(let n=i.rowCount-a-1;n>=i.rowCount-t;n--)sS(r,e.getCell(o,n,!0),r.firstChild);let n=0;r.forEachChildren((t=>{t.setAttribute("y",n),n+=i.getRowHeight(t.row)}))}for(let r=o.colStart;r<=o.colEnd;r++){const o=e.getColGroupInBottom(r);for(let n=i.rowCount-a-1;n>=i.rowCount-t;n--)sS(o,e.getCell(r,n,!0),o.firstChild);let n=0;o.forEachChildren((t=>{t.setAttribute("y",n),n+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const r=e.getColGroupInRightBottomCorner(o);for(let n=i.rowCount-a-1;n>=i.rowCount-t;n--)sS(r,e.getCell(o,n,!0),r.firstChild);let n=0;r.forEachChildren((t=>{t.setAttribute("y",n),n+=i.getRowHeight(t.row)}))}}else if(t<a){for(let o=0;o<i.rowHeaderLevelCount;o++){const r=e.getColGroup(o);for(let n=i.rowCount-a;n<i.rowCount-t;n++){const t=e.getCell(o,n,!0);t.setAttribute("y",r.lastChild.attribute.y+i.getRowHeight(r.lastChild.row)),r.appendChild(t)}const n=e.getColGroupInLeftBottomCorner(o);let s=0;n.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}for(let r=o.colStart;r<=o.colEnd;r++){const o=e.getColGroup(r);for(let n=i.rowCount-a;n<i.rowCount-t;n++){const t=e.getCell(r,n,!0);t.setAttribute("y",o.lastChild.attribute.y+i.getRowHeight(o.lastChild.row)),o.appendChild(t)}const n=e.getColGroupInBottom(r);let s=0;n.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const r=e.getColGroup(o);for(let n=i.rowCount-a;n<i.rowCount-t;n++){const t=e.getCell(o,n,!0);t.setAttribute("y",r.lastChild.attribute.y+i.getRowHeight(r.lastChild.row)),r.appendChild(t)}const n=e.getColGroupInRightBottomCorner(o);let s=0;n.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}}r.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),n.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),s.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),i.internalProps.bottomFrozenRowCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),aw(this.bodyGroup),this.rowHeaderGroup.attribute.width,nw(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),aw(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,nw(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),aw(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),aw(this.cornerHeaderGroup)),function(t){if(!t.theme.frameStyle.cornerRadius)return;const e=t.theme.frameStyle.cornerRadius,{cornerHeaderGroup:i,colHeaderGroup:o,rowHeaderGroup:r,bodyGroup:n,rightTopCornerGroup:s,leftBottomCornerGroup:a,rightBottomCornerGroup:l,rightFrozenGroup:h,bottomFrozenGroup:d}=t.scenegraph;i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0);const c=wb(e);i.attribute.width>0&&i.attribute.height>0?lw(i,[c[0],0,0,0]):o.attribute.height>0?lw(o,[c[0],0,0,0]):r.attribute.width>0?lw(r,[c[0],0,0,0]):lw(n,[c[0],0,0,0]),a.attribute.width>0&&a.attribute.height>0?lw(a,[0,0,0,c[3]]):d.attribute.height>0?lw(d,[0,0,0,c[3]]):r.attribute.width>0?lw(r,[0,0,0,c[3]]):lw(n,[0,0,0,c[3]]),s.attribute.width>0&&s.attribute.height>0?lw(s,[0,c[1],0,0]):o.attribute.height>0?lw(o,[0,c[1],0,0]):h.attribute.width>0?lw(h,[0,c[1],0,0]):lw(n,[0,c[1],0,0]),l.attribute.width>0&&l.attribute.height>0?lw(l,[0,0,c[2],0]):h.attribute.width>0?lw(h,[0,0,c[2],0]):d.attribute.height>0?lw(d,[0,0,c[2],0]):lw(n,[0,0,c[2],0])}(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const r=this.getCell(t,e).getChildByName("text",!0);if(r&&"text"===r.type){if(r.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const n=rt(r.attribute.text)?r.attribute.text.join(""):r.attribute.text;let s="";if(ot(r.cache.clipedText)?s=r.cache.clipedText:null===(o=null===(i=r.cache.layoutData)||void 0===i?void 0:i.lines)||void 0===o||o.forEach((t=>{s+=t.str})),s!==n)return this.table.getCellValue(t,e)}else if(r&&"richtext"===r.type){const i=r;if(i.attribute.ellipsis&&i._frameCache&&i.attribute.height<i._frameCache.actualHeight)return i.attribute.textConfig.find((t=>t.text)),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,r){this.component.drillIcon.update(t,e,i,o,r,this)}updateCellContent(t,e){if(!this.clear)return ny(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const o=nb(e.map((t=>t.row))).sort(((t,e)=>t-e)),r=nb(i.map((t=>t.row))).sort(((t,e)=>t-e)),n=this.table.getAllRowsHeight()-[...o,...r].reduce(((t,e)=>t+this.table.getRowHeight(e)),0)<=this.table.tableNoFrameHeight;if(Kx(t,e,i,this.table),this.recalculateColWidths(),"adaptive"===this.table.heightMode||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||n))this.table.scenegraph.recalculateRowHeights();else if("autoHeight"===this.table.heightMode)for(let t=0;t<r.length;t++){const e=r[t],i=this.table.getRowHeight(e),o=_y(e,0,this.table.colCount-1,this.table);(e>=this.proxy.rowStart&&e<=this.proxy.rowEnd||e>=this.table.rowCount-this.table.bottomFrozenRowCount&&e<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(e,o-i)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e){bS(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){var t,e;const{headerDomContainer:i,bodyDomContainer:o}=this.table.internalProps;if(this.table.frozenColCount>0&&(i||o)){const t=this.table.getFrozenColsWidth();i&&(i.style.left=`${t}px`),o&&(o.style.left=`${t}px`)}if(i&&(i.style.width=`${Math.min(this.table.getAllColsWidth(),this.table.tableNoFrameWidth)}px`,i.style.height=`${this.table.getFrozenRowsHeight()}px`),o){const i=this.table.getFrozenRowsHeight()+this.table.getBottomFrozenRowsHeight();o.style.width=`${Math.min(this.table.getAllColsWidth(),this.table.tableNoFrameWidth)}px`,o.style.height=(null!==(e=null===(t=o.parentElement)||void 0===t?void 0:t.offsetHeight)&&void 0!==e?e:1)-1-i+"px",o.style.top=`${this.table.getFrozenRowsHeight()}px`}}}function xS(t,e,i){const o=t.highPerformanceGetCell(e,i);if("cell"===o.role&&J(o.mergeStartCol)&&J(o.mergeStartRow)&&J(o.mergeEndCol)&&J(o.mergeEndRow)){const{colStart:e,colEnd:i,rowStart:r,rowEnd:n}=Py(o,t);for(let o=e;o<=i;o++)for(let e=r;e<=n;e++)t.highPerformanceGetCell(o,e).addUpdateBoundTag()}else o.addUpdateBoundTag()}function SS(t,e,i,o,r){const n=t.table;for(let i=0;i<n.columnHeaderLevelCount;i++)xS(t,e,i);const s=t.getColGroup(e);return null==s||s.addUpdateBoundTag(),!0}function _S(t,e,i,o,r,n){const s=t.table;for(let i=0;i<s.columnHeaderLevelCount;i++)xS(t,e,i);const a=t.getColGroup(e);return null==a||a.addUpdateBoundTag(),!0}function AS(t,e,i,o,r){const n=t.table;for(let e=0;e<n.colCount;e++)xS(t,e,i);return!0}function RS(t,e,i,o,r,n){const s=t.table;for(let e=0;e<s.colCount;e++)xS(t,e,i);return!0}function BS(t,e,i){const{table:o}=t,{scenegraph:r}=o,{highlightScope:n,singleStyle:s,disableHeader:a,cellPos:l,cellPosContainHeader:h}=t.hover,d=l.col,c=l.row;if(n===_v.none||a&&(h.col!==e||h.row!==i)){const t=h.col,o=h.row;r.hideHoverIcon(t,o),r.showHoverIcon(e,i),h.col=e,h.row=i}if((a&&o.isHeader(e,i)||n===_v.none)&&(e=-1,i=-1),d===e&&c===i)return;r.deactivateChart(d,c),r.activateChart(e,i);let u=!1;const{ranges:g,highlightScope:p}=t.select;if(-1!==d&&-1!==c&&(u=function(t,e,i,o,r,n,s){let a=!1;return n===_v.single?a=!!function(t,e,i,o,r){return xS(t,e,i),!0}(t,e,i):n===_v.row?a=!!AS(t,0,i):n===_v.column?a=!!SS(t,e):n===_v.cross&&(a=!!AS(t,0,i),a=!!SS(t,e)),a}(r,d,c,0,0,n),a||r.hideHoverIcon(d,c)),-1===e||-1===i)return l.col=-1,l.row=-1,void(!u||d===e&&c===i||t.table.scenegraph.updateNextFrame());n===_v.single?u=!!function(t,e,i,o,r){return xS(t,e,i),!0}(r,e,i):n===_v.row?u=!!RS(r,0,i):n===_v.column?u=!!_S(r,e):n===_v.cross&&(u=!!RS(r,0,i),u=!!_S(r,e)),n===_v.none||a||r.showHoverIcon(e,i),l.col=e,l.row=i,u&&t.table.scenegraph.updateNextFrame()}function MS(t,e,i,o){var r;let n,s=null,a=!1;if(Array.isArray(i.sortState))for(let o=0;o<i.sortState.length&&(n=i.sortState[o],n&&(s=i._getHeaderCellBySortState(n)),s&&(a=TS(t,e,s.col,s.row,i)),!a);o++);else n=i.sortState,n&&(s=i._getHeaderCellBySortState(n)),s&&(a=TS(t,e,s.col,s.row,i));const l=i.getHeaderDefine(t,e);if(n&&a&&(null==l?void 0:l.sort)?n.order="asc"===n.order?"desc":"desc"===n.order?"normal":"asc":(null==l?void 0:l.sort)?n={field:i.getHeaderField(t,e),order:"asc"}:a&&(null==l?void 0:l.showSort)||(n={field:i.getHeaderField(t,e),order:"normal"}),n.event=o,i.fireListeners(kb.SORT_CLICK,n).includes(!1))return;i.internalProps.sortState=n,i.stateManager.setSortState(n),(null==l?void 0:l.sort)&&function(t,e,i){const o=e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));if(!o)return;const{field:r}=o;null!==r&&("function"==typeof i.sort?e.dataSource.sort(r,t.order||"asc",i.sort):e.dataSource.sort(r,t.order||"asc",rb))}(n,i,l),i.internalProps.useOneRowHeightFillAll=!1,i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.sortCell();const h=!!(null===(r=i.stateManager.select.ranges)||void 0===r?void 0:r.length);i.stateManager.updateSelectPos(-1,-1),i.stateManager.endSelectCells(!0,h)}function TS(t,e,i,o,r){return r._getLayoutCellId(t,e)===r._getLayoutCellId(i,o)}const PS=fb(kb,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function kS(t,e,i,o,r){for(let i=t;i<=e;i++)r._clearColRangeWidthsMap(i);for(let t=i;t<=o;t++)r._clearRowRangeHeightsMap(t)}function LS(t){var e;if(!t)return;const i=(null===(e=t.role)||void 0===e?void 0:e.startsWith("icon"))?t:"richtext"===t.type?t._currentHoverIcon:void 0;return i?"richtext"===t.type?{icon:i,position:{left:t.globalAABBBounds.x1+i.globalAABBBounds.x1,right:t.globalAABBBounds.x1+i.globalAABBBounds.x2,top:t.globalAABBBounds.y1+i.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"richtext-icon"}:{icon:i,position:{left:i.globalAABBBounds.x1,right:i.globalAABBBounds.x2,top:i.globalAABBBounds.y1,bottom:i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"icon"}:void 0}function HS(t,e){"adaptive"===e.table.widthMode&&e.columnResize.col<e.table.colCount-1?(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.scenegraph.updateColWidth(e.columnResize.col+1,-t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col),e.table.internalProps._widthResizedColMap.add(e.columnResize.col+1)):(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col))}function ES(t,e){"adaptive"===e.table.heightMode&&e.rowResize.row<e.table.rowCount-1?(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.scenegraph.updateRowHeight(e.rowResize.row+1,-t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row+1)):(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row))}fb(kb,{VCHART_EVENT_TYPE:"vchart_event_type"});function zS(t){if(t.eventManager.bindSparklineHoverEvent)return;let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.cellType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.cellType||"function"==typeof t.cellType)),e&&(t.eventManager.bindSparklineHoverEvent=!0,t.on(kb.MOUSEMOVE_CELL,(e=>{const{col:i,row:o,x:r,y:n}=e;"sparkline"!==t.getBodyColumnType(i,o)&&t.stateManager.updateSparklineHoverPose(-1,-1,0,0),t.stateManager.updateSparklineHoverPose(i,o,r,n)})),t.on(kb.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateSparklineHoverPose(-1,-1,0,0)})))}function FS(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],{deltaX:o,deltaY:r}=t;t.shiftKey&&t.deltaY&&(o=r,r=0);const[n,s]=function(t,e,i){var o,r;const n=Math.abs(t/e),s=n<=.5?0:t,a=n>2?0:e;return[Math.ceil(s*(null!==(o=i.horizontal)&&void 0!==o?o:0)),Math.ceil(a*(null!==(r=i.vertical)&&void 0!==r?r:0))]}(o,r,{horizontal:1,vertical:1});(n||s)&&e.interactionState!==Sv.scrolling&&e.updateInteractionState(Sv.scrolling),n&&(e.setScrollLeft(e.scroll.horizontalBarPos+n,t),e.showHorizontalScrollBar(!0)),s&&(e.setScrollTop(e.scroll.verticalBarPos+s,t),e.showVerticalScrollBar(!0)),i&&e.resetInteractionState(),t.nativeEvent.cancelable&&("none"===e.table.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(o)&&0!==r&&IS(r,e)||Math.abs(r)<=Math.abs(o)&&0!==o&&OS(o,e))&&t.nativeEvent.preventDefault()}function IS(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&!function(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,r=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==r&&t>=0&&Math.abs(e.scroll.verticalBarPos-r)<1+o}(t,e)}function OS(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&!function(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,r=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==r&&t>=0&&Math.abs(e.scroll.horizontalBarPos-r)<1+o}(t,e)}class DS{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const r=Math.pow(this.friction,i/16),n=r*this.speedX,s=r*this.speedY;let a=0,l=0;Math.abs(n)>.05&&(o=!1,a=(this.speedX+n)/2*i),Math.abs(s)>.05&&(o=!1,l=(this.speedY+s)/2*i),null===(t=this.scrollHandle)||void 0===t||t.call(this,a,l),o?this.runingId=null:(this.lastTime=e,this.speedX=n,this.speedY=s,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function WS(t){const e=t.table,i=e.stateManager;e.scenegraph.tableGroup.addEventListener("pointermove",(o=>{var r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C;const y=null!==(n=null===(r=e.eventManager.LastPointerXY)||void 0===r?void 0:r.x)&&void 0!==n?n:o.x,w=null!==(a=null===(s=e.eventManager.LastPointerXY)||void 0===s?void 0:s.y)&&void 0!==a?a:o.y;e.eventManager.LastPointerXY={x:o.x,y:o.y},t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const x=RC(o);if(i.interactionState===Sv.grabing&&!(null===(l=e.editorManager)||void 0===l?void 0:l.editingEditor))return void(Math.abs(y-o.x)+Math.abs(w-o.y)>=1&&(i.isResizeCol()||(i.isMoveCol()?t.dealColumnMover(x):i.isFillHandle()?t.dealFillSelect(x,!0):(null===(h=e.options.select)||void 0===h?void 0:h.disableDragSelect)||t.dealTableSelect(x,!0))));e.eventManager.isDraging&&i.isSelecting()&&!(null===(d=e.editorManager)||void 0===d?void 0:d.editingEditor)&&t.dealTableSelect(x,!0);const S=o.path.find((t=>"cell"===t.role));if(e.hasListeners(kb.MOUSELEAVE_CELL)&&(-1===e.stateManager.hover.cellPos.col||-1===e.stateManager.hover.cellPos.row||(null==S?void 0:S.col)===e.stateManager.hover.cellPos.col&&(null==S?void 0:S.row)===e.stateManager.hover.cellPos.row||e.fireListeners(kb.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(c=null==x?void 0:x.eventArgs)||void 0===c?void 0:c.target})),e.hasListeners(kb.MOUSEENTER_CELL)&&("cell"!==(null==S?void 0:S.role)||!J(S.col)||!J(S.row)||S.col===e.stateManager.hover.cellPos.col&&S.row===e.stateManager.hover.cellPos.row||S.col===(null===(u=e.stateManager.hover.cellPosContainHeader)||void 0===u?void 0:u.col)&&S.row===(null===(g=e.stateManager.hover.cellPosContainHeader)||void 0===g?void 0:g.row)||e.fireListeners(kb.MOUSEENTER_CELL,{col:S.col,row:S.row,cellRange:e.getCellRangeRelativeRect({col:S.col,row:S.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(p=null==x?void 0:x.eventArgs)||void 0===p?void 0:p.target,mergeCellInfo:null===(f=x.eventArgs)||void 0===f?void 0:f.mergeInfo})),t.dealIconHover(x),t.dealTableHover(x),x.eventArgs&&e.hasListeners(kb.MOUSEMOVE_CELL)){let t,i;if(null===(v=x.eventArgs)||void 0===v?void 0:v.target){const e=LS(null===(b=x.eventArgs)||void 0===b?void 0:b.target);e&&(t=e.icon,i=e.position)}e.fireListeners(kb.MOUSEMOVE_CELL,{col:x.eventArgs.col,row:x.eventArgs.row,x:x.abstractPos.x,y:x.abstractPos.y,event:o.nativeEvent,targetIcon:t?{name:t.name,position:i,funcType:t.attribute.funcType}:void 0,target:null===(m=null==x?void 0:x.eventArgs)||void 0===m?void 0:m.target,mergeCellInfo:null===(C=x.eventArgs)||void 0===C?void 0:C.mergeInfo})}})),e.scenegraph.tableGroup.addEventListener("pointerout",(e=>{var i;const o=RC(e),r=null===(i=null==o?void 0:o.eventArgs)||void 0===i?void 0:i.target;"table"===(null==r?void 0:r.role)&&t.dealTableHover()})),e.scenegraph.tableGroup.addEventListener("pointerover",(t=>{var i,o;const r=RC(t),n=null===(i=null==r?void 0:r.eventArgs)||void 0===i?void 0:i.target;if(n&&e.hasListeners(kb.MOUSEOVER_CHART_SYMBOL)&&"symbol"===n.type){const i=t.composedPath().find((t=>"cell"===t.roll));if(i){const{col:n,row:s}=i,a={col:n,row:s,field:e.getHeaderField(n,s),value:e.getCellValue(n,s),dataValue:e.getCellOriginValue(n,s),cellHeaderPaths:e.internalProps.layoutMap.getCellHeaderPaths(n,s),title:e.getBodyColumnDefine(n,s).title,cellRange:e.getCellRelativeRect(n,s),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.target};e.fireListeners(kb.MOUSEOVER_CHART_SYMBOL,a)}}})),e.scenegraph.tableGroup.addEventListener("pointerenter",(t=>{(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showVerticalScrollBar(),e.hasListeners(kb.MOUSEENTER_TABLE)&&e.fireListeners(kb.MOUSEENTER_TABLE,{event:t.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerleave",(o=>{i.isResizeCol()||i.isMoveCol()||i.isSelecting()||(i.updateInteractionState(Sv.default),i.updateCursor()),(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideVerticalScrollBar(),e.hasListeners(kb.MOUSELEAVE_CELL)&&-1!==e.stateManager.hover.cellPos.col&&-1!==e.stateManager.hover.cellPos.row&&e.fireListeners(kb.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:void 0}),t.dealTableHover();const r=o.target;r&&!r.isDescendantsOf(e.scenegraph.tableGroup)&&e.fireListeners(kb.MOUSELEAVE_TABLE,{event:o.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerupoutside",(o=>{var r,n,s,a,l,h,d,c,u;const g=RC(o);if(i.menu.isShow&&(null===(r=g.eventArgs)||void 0===r?void 0:r.target)!==(null===(n=i.residentHoverIcon)||void 0===n?void 0:n.icon)&&setTimeout((()=>{e.internalProps.menuHandler.pointInMenuElement(o.client.x,o.client.y)||i.menu.isShow&&i.hideMenu()}),0),i.isResizeCol())GS(e);else if(i.isResizeRow())jS(e);else if(i.isMoveCol())e.stateManager.endMoveCol()&&-1!==(null===(s=e.stateManager.columnMove)||void 0===s?void 0:s.colSource)&&-1!==(null===(a=e.stateManager.columnMove)||void 0===a?void 0:a.rowSource)&&-1!==(null===(l=e.stateManager.columnMove)||void 0===l?void 0:l.colTarget)&&-1!==(null===(h=e.stateManager.columnMove)||void 0===h?void 0:h.rowTarget)&&e.hasListeners(kb.CHANGE_HEADER_POSITION)&&e.fireListeners(kb.CHANGE_HEADER_POSITION,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource}});else if(i.isSelecting()&&(null===(c=null===(d=e.stateManager.select)||void 0===d?void 0:d.ranges)||void 0===c?void 0:c.length)){const t=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.col,i=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.row;if(e.stateManager.endSelectCells(),e.hasListeners(kb.DRAG_SELECT_END)){const r={event:o.nativeEvent,cells:[],col:t,row:i,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:void 0};r.cells=e.getSelectedCellInfos(),e.fireListeners(kb.DRAG_SELECT_END,r)}}yb(null===(u=e.editorManager)||void 0===u?void 0:u.completeEdit(o.nativeEvent),(o=>{var r,n;if(!1!==o&&(i.updateInteractionState(Sv.default),t.dealTableHover(),null===(r=e.options.select)||void 0===r?void 0:r.outsideClickDeselect)){const e=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);t.dealTableSelect(),i.endSelectCells(!0,e)}}))})),e.scenegraph.tableGroup.addEventListener("pointerdown",(o=>{var r,n,s,a;if(e.hasListeners(kb.MOUSEDOWN_TABLE)&&e.fireListeners(kb.MOUSEDOWN_TABLE,{event:o.nativeEvent}),e.eventManager.isDown=!0,e.eventManager.LastBodyPointerXY={x:o.x,y:o.y},e.eventManager.LastPointerXY={x:o.x,y:o.y},0!==o.button)return;const l=RC(o);if(t.downIcon=void 0,i.interactionState!==Sv.default)return;e.isPivotChart()&&"chart"!==(null===(r=null==l?void 0:l.eventArgs)||void 0===r?void 0:r.target.type)&&e.scenegraph.updateChartState(null),(null===(n=l.eventArgs)||void 0===n?void 0:n.target)!==(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)&&i.hideMenu();yb(null===(a=e.editorManager)||void 0===a?void 0:a.completeEdit(o.nativeEvent),(r=>{var n,s,a,h,d;if(!1===r)return;const c=(null===(a=null===(s=null===(n=null==l?void 0:l.eventArgs)||void 0===n?void 0:n.target)||void 0===s?void 0:s.role)||void 0===a?void 0:a.startsWith("icon"))?l.eventArgs.target:(null===(h=o.target.role)||void 0===h?void 0:h.startsWith("icon"))?o.target:void 0;if(t.downIcon=c,c&&!1!==c.attribute.interactive)c.attribute.funcType===Pv.dragReorder&&(i.startMoveCol(l.eventArgs.col,l.eventArgs.row,l.abstractPos.x,l.abstractPos.y),i.updateInteractionState(Sv.grabing));else if("touch"===o.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&(t.checkColumnResize(l,!0)||t.checkRowResize(l,!0))||!t.touchEnd&&t.chechColumnMover(l)||t.dealTableSelect(l)&&!t.touchEnd)&&i.updateInteractionState(Sv.grabing)}),500),t.dealTableHover(l);else{if(!t.checkCellFillhandle(l)&&(t.checkColumnResize(l,!0)||t.checkRowResize(l,!0)))return e.scenegraph.updateChartState(null),void i.updateInteractionState(Sv.grabing);if(t.chechColumnMover(l))return void i.updateInteractionState(Sv.grabing);if(t.checkCellFillhandle(l,!0)&&t.dealFillSelect(l))return void i.updateInteractionState(Sv.grabing);t.dealTableSelect(l)&&i.updateInteractionState(Sv.grabing)}if(e.hasListeners(kb.MOUSEDOWN_CELL)){const t=RC(o);t.eventArgs&&e.fireListeners(kb.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:o.nativeEvent,target:null===(d=null==t?void 0:t.eventArgs)||void 0===d?void 0:d.target,mergeCellInfo:t.eventArgs.mergeInfo})}}))})),e.scenegraph.tableGroup.addEventListener("pointerup",(t=>{var o,r,n,s;if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(Sv.default),i.isResizeCol())GS(e);else if(i.isResizeRow())jS(e);else if(i.isMoveCol()){const i=RC(t);e.stateManager.endMoveCol()&&i.eventArgs&&e.hasListeners(kb.CHANGE_HEADER_POSITION)&&e.fireListeners(kb.CHANGE_HEADER_POSITION,{target:{col:i.eventArgs.col,row:i.eventArgs.row},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource}})}else if(i.isSelecting()){e.stateManager.endSelectCells(),e.stateManager.isFillHandle()&&e.stateManager.endFillSelect();const i=RC(t);if(e.eventManager.isDraging&&i.eventArgs&&e.hasListeners(kb.DRAG_SELECT_END)){const n={event:t.nativeEvent,cells:[],col:i.eventArgs.target.col,row:i.eventArgs.target.row,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==i?void 0:i.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(r=i.eventArgs)||void 0===r?void 0:r.mergeInfo};n.cells=e.getSelectedCellInfos(),e.fireListeners(kb.DRAG_SELECT_END,n)}}}else i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default);if(e.hasListeners(kb.MOUSEUP_CELL)){const i=RC(t);i.eventArgs&&e.fireListeners(kb.MOUSEUP_CELL,{col:i.eventArgs.col,row:i.eventArgs.row,event:t.nativeEvent,target:null===(n=null==i?void 0:i.eventArgs)||void 0===n?void 0:n.target,mergeCellInfo:null===(s=i.eventArgs)||void 0===s?void 0:s.mergeInfo})}}})),e.scenegraph.tableGroup.addEventListener("rightdown",(t=>{var o,r,n,s;const a=RC(t);if(a.eventArgs){i.triggerContextMenu(a.eventArgs.col,a.eventArgs.row,a.abstractPos.x,a.abstractPos.y);const{col:l,row:h}=a.eventArgs;if(e.hasListeners(kb.CONTEXTMENU_CELL)){const i=e.getCellInfo(l,h);let d,c;if(null===(o=a.eventArgs)||void 0===o?void 0:o.target){const t=LS(null===(r=a.eventArgs)||void 0===r?void 0:r.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(n=null==a?void 0:a.eventArgs)||void 0===n?void 0:n.target,mergeCellInfo:null===(s=a.eventArgs)||void 0===s?void 0:s.mergeInfo});!function(t,e,i){for(let o=0;o<t.length;o++){const r=t[o],n=Math.min(r.start.col,r.end.col),s=Math.max(r.start.col,r.end.col),a=Math.min(r.start.row,r.end.row),l=Math.max(r.start.row,r.end.row);if(n<=e&&e<=s&&a<=i&&i<=l||s<=e&&e<=n&&l<=i&&i<=a)return!0}return!1}(e.stateManager.select.ranges,l,h)?u.cells=[[i]]:u.cells=e.getSelectedCellInfos(),e.fireListeners(kb.CONTEXTMENU_CELL,u)}}})),e.scenegraph.tableGroup.addEventListener("pointertap",(o=>{var r,n,s,a,l;const h=RC(o);if(!t.touchMove&&0===o.button&&h.eventArgs&&e.hasListeners(kb.CLICK_CELL)){const{col:t,row:i}=h.eventArgs,l=e.getCellInfo(t,i);let d,c;if(null===(r=h.eventArgs)||void 0===r?void 0:r.target){const t=LS(null===(n=h.eventArgs)||void 0===n?void 0:n.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},l),{event:o.nativeEvent,federatedEvent:o,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(s=null==h?void 0:h.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(a=h.eventArgs)||void 0===a?void 0:a.mergeInfo});e.fireListeners(kb.CLICK_CELL,u)}if(!e.stateManager.columnResize.resizing&&!e.stateManager.columnMove.moving&&(t.dealIconClick(o,h),(null==h?void 0:h.eventArgs)&&t.touchSetTimeout&&"touch"===o.pointerType)){const e=RC(o);if(t.touchSetTimeout){clearTimeout(t.touchSetTimeout);const o=!!(null===(l=i.select.ranges)||void 0===l?void 0:l.length);t.dealTableSelect(e),i.endSelectCells(!0,o),t.touchSetTimeout=void 0}}})),e.scenegraph.stage.addEventListener("pointerdown",(o=>{var r,n,s;const a=RC(o);(null===(r=a.eventArgs)||void 0===r?void 0:r.target)!==(null===(n=i.residentHoverIcon)||void 0===n?void 0:n.icon)&&i.hideMenu();yb(null===(s=e.editorManager)||void 0===s?void 0:s.completeEdit(o.nativeEvent),(r=>{var n;if(!1===r)return;const s=(null===(n=o.target.role)||void 0===n?void 0:n.startsWith("icon"))?o.target:void 0;if(t.downIcon=s,s||t.checkCellFillhandle(a)||i.columnResize.resizing||!t.checkColumnResize(a,!0));else{e.scenegraph.updateChartState(null),i.updateInteractionState(Sv.grabing);const{eventArgs:t}=a;(null==t?void 0:t.targetCell)||e.getCellAt(a.abstractPos.x-8,a.abstractPos.y)&&e.hasListeners(kb.MOUSEDOWN_TABLE)&&e.fireListeners(kb.MOUSEDOWN_TABLE,{event:o.nativeEvent})}}))})),e.scenegraph.stage.addEventListener("pointerup",(t=>{"grabing"===i.interactionState&&(i.updateInteractionState(Sv.default),i.isResizeCol()&&GS(e))})),e.scenegraph.stage.addEventListener("pointertap",(o=>{var r,n,s;const a=o.target;if(e.eventManager.isDraging||!a||!a.isDescendantsOf(e.scenegraph.stage)&&a.stage!==a||a.isDescendantsOf(e.scenegraph.tableGroup))e.eventManager.isDraging&&i.isSelecting()&&i.endSelectCells();else{i.updateInteractionState(Sv.default),t.dealTableHover();const o=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);(null===(s=null===(n=e.options.select)||void 0===n?void 0:n.blankAreaClickDeselect)||void 0===s||s)&&t.dealTableSelect(),i.endSelectCells(!0,o),i.updateCursor(),e.scenegraph.updateChartState(null)}})),e.scenegraph.stage.addEventListener("pointermove",(o=>{const r=RC(o);i.isResizeCol()||t.checkColumnResize(r)?e.stateManager.select&&t.checkCellFillhandle(r)?i.updateCursor("crosshair"):i.updateCursor("col-resize"):i.isResizeRow()||t.checkRowResize(r)?e.stateManager.select&&t.checkCellFillhandle(r)?i.updateCursor("crosshair"):i.updateCursor("row-resize"):i.isMoveCol()||i.updateCursor()})),e.scenegraph.tableGroup.addEventListener("checkbox_state_change",(t=>{var i,o;const r=RC(t),{col:n,row:s}=r.eventArgs,a=e.getCellInfo(n,s),l=lm(e,n,s);if(l)for(let i=l.start.col;i<=l.end.col;i++)for(let o=l.start.row;o<=l.end.row;o++)e.scenegraph.getCell(i,o).forEachChildren((e=>{"checkbox"===e.name&&e.setAttributes({checked:t.target.attribute.checked,indeterminate:t.target.attribute.indeterminate})}));const h=Object.assign(Object.assign({},a),{event:t.nativeEvent,target:null===(i=null==r?void 0:r.eventArgs)||void 0===i?void 0:i.target,mergeCellInfo:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.mergeInfo,checked:t.detail.checked});if(e.isHeader(n,s))e.stateManager.setHeaderCheckedState(a.field,t.detail.checked),"checkbox"===e.getCellType(n,s)&&e.scenegraph.updateCheckboxCellState(n,s,t.detail.checked);else if(e.stateManager.setCheckedState(n,s,a.field,t.detail.checked),"checkbox"===e.getCellType(n,s)){const t=e.stateManager.headerCheckedState[a.field],i=e.stateManager.updateHeaderCheckedState(a.field);t!==i&&e.scenegraph.updateHeaderCheckboxCellState(n,s,i)}e.fireListeners(kb.CHECKBOX_STATE_CHANGE,h),e.scenegraph.updateNextFrame()})),e.scenegraph.tableGroup.addEventListener("radio_checked",(t=>{var i,o,r;const n=RC(t),{col:s,row:a,target:l}=n.eventArgs,h=e.getCellInfo(s,a),d=null===(i=TC.exec(l.id))||void 0===i?void 0:i[1],c=lm(e,s,a);if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id===l.id&&t.setAttributes({checked:!0})}));const u=e.getBodyColumnDefine(s,a).radioCheckType||"column";if("cell"===u)if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id!==l.id&&t.setAttributes({checked:!1})}));else e.scenegraph.getCell(s,a).forEachChildren((t=>{"radio"===t.name&&t.id!==l.id&&t.setAttributes({checked:!1})}));else"column"===u&&e.scenegraph.getColGroup(s).forEachChildren((t=>{t.forEachChildren((t=>{"radio"===t.name&&t.id!==l.id&&t.setAttributes({checked:!1})}))}));const g=d?Number(d):void 0;e.stateManager.setRadioState(s,a,h.field,u,g);const p=Object.assign(Object.assign({},h),{event:t.nativeEvent,target:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(r=null==n?void 0:n.eventArgs)||void 0===r?void 0:r.mergeInfo,radioIndexInCell:g});e.fireListeners(kb.RADIO_STATE_CHANGE,p),e.scenegraph.updateNextFrame()})),e.scenegraph.stage.addEventListener("wheel",(t=>{var o;null===(o=e.editorManager)||void 0===o||o.completeEdit(),e.eventManager._enableTableScroll&&FS(t,i)}))}function NS(t){const e=t.table;t.gesture=new Tu(e.scenegraph.tableGroup,{tap:{interval:300}}),t.gesture.on("doubletap",(t=>{!function(t,e){var i,o,r,n,s,a;const l=RC(t);let h=-1,d=-1;l.eventArgs&&(h=l.eventArgs.col,d=l.eventArgs.row);const c=e.getCellValue(h,d),u=null===(o=null===(i=l.eventArgs)||void 0===i?void 0:i.targetCell)||void 0===o?void 0:o.globalAABBBounds;if(u&&e.internalProps.focusControl.setFocusRect(new Ib(u.x1+e.scrollLeft,u.y1+e.scrollTop,u.x2-u.x1,u.y2-u.y1),c),e.hasListeners(kb.DBLCLICK_CELL)){const i=e.getCellInfo(h,d);let o,c;if(null===(r=l.eventArgs)||void 0===r?void 0:r.target){const t=LS(null===(n=l.eventArgs)||void 0===n?void 0:n.target);t&&(o=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,federatedEvent:t,cells:[],targetIcon:o?{name:o.name,position:c,funcType:o.attribute.funcType}:void 0,target:null===(s=null==l?void 0:l.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(a=null==l?void 0:l.eventArgs)||void 0===a?void 0:a.mergeInfo});e.fireListeners(kb.DBLCLICK_CELL,u)}}(t,e)}))}function GS(t){t.stateManager.endResizeCol();const e=[];for(let i=0;i<t.colCount;i++)e.push(t.getColWidth(i));t.fireListeners(kb.RESIZE_COLUMN_END,{col:t.stateManager.columnResize.col,colWidths:e})}function jS(t){t.stateManager.endResizeRow(),t.fireListeners(kb.RESIZE_ROW_END,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})}let US=1;function VS(){return sb?US=1:(US=Math.ceil(window.devicePixelRatio||1),US>1&&US%2!=0&&(US+=1)),US}function XS(t){return!!t.changedTouches}function YS(t,e,i){if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"top";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom";if(t===i.rowHeaderLevelCount-1&&e>=i.rowHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left"}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left";if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"right";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom"}return"bottom"}VS();let $S;const KS=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class qS extends Dv{static get DEFAULT(){return $S||($S=new qS)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i,o,r,n,s,a,l,h,d,c,u,g,p,f;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._showBar=null===(e=t.showBar)||void 0===e||e,this._barColor=null!==(i=t.barColor)&&void 0!==i?i:KS,this._barPositiveColor=null!==(o=t.barPositiveColor)&&void 0!==o?o:"#4dbd74",this._barNegativeColor=null!==(r=t.barNegativeColor)&&void 0!==r?r:"#f86c6b",this._barAxisColor=null!==(n=t.barAxisColor)&&void 0!==n?n:"black",this._barBgColor=t.barBgColor,this._barHeight=null!==(s=t.barHeight)&&void 0!==s?s:3,this._barHeight=null!==(a=t.barHeight)&&void 0!==a?a:3,this._barBottom=null!==(l=t.barBottom)&&void 0!==l?l:0,this._barPadding=null!==(h=t.barPadding)&&void 0!==h?h:[0,0,0,0],this._showBarMark=null!==(d=t.showBarMark)&&void 0!==d&&d,this._barMarkPositiveColor=null!==(c=t.barMarkPositiveColor)&&void 0!==c?c:"#4dbd74",this._barMarkNegativeColor=null!==(u=t.barMarkNegativeColor)&&void 0!==u?u:"#f86c6b",this._barMarkWidth=null!==(g=t.barMarkWidth)&&void 0!==g?g:2,this._barMarkPosition=null!==(p=t.barMarkPosition)&&void 0!==p?p:"right",this._barRightToLeft=null!==(f=t.barRightToLeft)&&void 0!==f&&f}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new qS(this,null)}}const ZS=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class JS{constructor(t){this._table=t;const e=GC();this.expandIcon=e[kv.expandIconName],this.collapseIcon=e[kv.collapseIconName]}getIcons(t,e,i,o,r){const n=[],s=this.getHierarchyIcon(t,e);s&&n.push(s);const{icon:a}=this._table.getBodyColumnDefine(t,e);if(a){let r;r="function"==typeof a?a({col:t,row:e,value:i,dataValue:o,table:this._table}):a;const s=GC(),l=t=>{let e;e="string"==typeof t?s[t]:t,e&&n.push(e)};Array.isArray(r)?r.forEach(((t,e)=>{l(t)})):l(r)}return r&&n.forEach(((i,o)=>{(i.content||i.src)&&(n[o]=this.getCellIconFromRecordValue(i,t,e))})),n}getStyleClass(t){switch(t){case"text":case"link":return Nv;case"image":case"video":return Wv;case"chart":case"sparkline":return Dv;case"progressbar":return qS;case"checkbox":return jv;case"radio":return Uv}return Nv}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,i)));if(!Rb.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,i);const o={},r=t;return ZS.forEach((t=>{var n,s;if(void 0!==r[t]){const a=this._table.getFieldData(r[t],e,i);null!=a?o[t]=a:(null===(s=(n=this._table)._hasField)||void 0===s?void 0:s.call(n,r[t],e,i))||(o[t]=r[t])}})),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===Rv.expand?this.expandIcon:i===Rv.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}}function QS(t,e,i,o,r,n){const s=t.getCellRange(o,r);for(let o=0;o<e.length;o++){const r=e[o];let{col:n,row:a}=r;const{field:l,menuKey:h}=r;if("number"!=typeof n||"number"!=typeof a)if(t.isPivotTable()){const e=t.internalProps.layoutMap.getPivotCellAdress(l);if(!e)continue;n=e.col,a=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!e)continue;n=e.col,a=e.row}if(J(n)&&J(a)&&xb(s,n,a)&&i===h)return!0}return!1}let t_;!function(){if("node"===Xv.mode)return;const t=document.createElement("style");t.id="vtable-menu-styleSheet",t.textContent="\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n",document.head.appendChild(t)}();const e_={CHANGE_STYLE:"change_style"};class i_ extends Ev{static get EVENT_TYPE(){return e_}static get DEFAULT(){return t_||(t_=new i_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A,R,B,M,T,P,k,L,H;super(),this._defaultPadding=[10,16,10,16],this._color=null!==(i=t.color)&&void 0!==i?i:null==e?void 0:e.color,this._strokeColor=null!==(o=null==t?void 0:t.strokeColor)&&void 0!==o?o:null==e?void 0:e.strokeColor,this._fontSize=null!==(r=t.fontSize)&&void 0!==r?r:null==e?void 0:e.fontSize,this._fontFamily=null!==(n=t.fontFamily)&&void 0!==n?n:null==e?void 0:e.fontFamily,this._fontWeight=null!==(s=t.fontWeight)&&void 0!==s?s:null==e?void 0:e.fontWeight,this._fontVariant=null!==(a=t.fontVariant)&&void 0!==a?a:null==e?void 0:e.fontVariant,this._fontStyle=null!==(l=t.fontStyle)&&void 0!==l?l:null==e?void 0:e.fontStyle,this._textOverflow=(null!==(h=t.textOverflow)&&void 0!==h?h:null==e?void 0:e.textOverflow)||"ellipsis",this._textStick=null!==(c=null!==(d=t.textStick)&&void 0!==d?d:null==e?void 0:e.textStick)&&void 0!==c&&c,this._textStickBaseOnAlign=null!==(g=null!==(u=t.textStickBaseOnAlign)&&void 0!==u?u:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==g&&g,this._marked=null!==(f=null!==(p=t.marked)&&void 0!==p?p:null==e?void 0:e.marked)&&void 0!==f&&f,this._textAlign=(null!==(v=t.textAlign)&&void 0!==v?v:null==e?void 0:e.textAlign)||"left",this._textBaseline=(null!==(b=t.textBaseline)&&void 0!==b?b:null==e?void 0:e.textBaseline)||"middle",this._bgColor=null!==(m=t.bgColor)&&void 0!==m?m:null==e?void 0:e.bgColor,this._padding=null!==(y=null!==(C=t.padding)&&void 0!==C?C:null==e?void 0:e.padding)&&void 0!==y?y:this._defaultPadding,this._borderColor=null!==(w=t.borderColor)&&void 0!==w?w:null==e?void 0:e.borderColor,this._lineHeight=null!==(x=t.lineHeight)&&void 0!==x?x:null==e?void 0:e.lineHeight,this._underline=null!==(S=t.underline)&&void 0!==S?S:null==e?void 0:e.underline,this._underlineColor=null!==(_=t.underlineColor)&&void 0!==_?_:null==e?void 0:e.underlineColor,this._underlineDash=null!==(A=t.underlineDash)&&void 0!==A?A:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(R=t.underlineOffset)&&void 0!==R?R:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(B=t.lineThrough)&&void 0!==B?B:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(M=t.lineThroughColor)&&void 0!==M?M:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(T=t.lineThroughDash)&&void 0!==T?T:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(P=t.linkColor)&&void 0!==P?P:null==e?void 0:e.linkColor,this._cursor=null!==(k=t.cursor)&&void 0!==k?k:null==e?void 0:e.cursor,this._borderLineWidth=null!==(L=t.borderLineWidth)&&void 0!==L?L:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(H=t.borderLineDash)&&void 0!==H?H:null==e?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return null!==(t=this._padding)&&void 0!==t?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new i_(this)}}let o_,r_,n_;class s_ extends i_{static get DEFAULT(){return o_||(o_=new s_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;super(t,e),this.textAlign=(null!==(i=t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign)||"center"}clone(){return new s_(this)}}class a_ extends i_{static get DEFAULT(){return r_||(r_=new a_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new a_(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}class l_ extends i_{static get DEFAULT(){return n_||(n_=new l_)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_;super(t,e),this._size=(null!==(r=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==r?r:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(n=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==n?n:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(l=null===(a=null==t?void 0:t.checkboxStyle)||void 0===a?void 0:a.defaultFill)&&void 0!==l?l:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(m=null===(b=null==t?void 0:t.checkboxStyle)||void 0===b?void 0:b.disableCheckedFill)&&void 0!==m?m:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(y=null===(C=null==t?void 0:t.checkboxStyle)||void 0===C?void 0:C.disableCheckedStroke)&&void 0!==y?y:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(_=null===(S=null==t?void 0:t.checkboxStyle)||void 0===S?void 0:S.indeterminateIconImage)&&void 0!==_?_:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new l_(t,this)}clone(){return new l_(this)}}function h_(t,e,i,o,r,n){var s;return t||e?t instanceof i_?t:"function"==typeof t?h_(t(i),e,i,o,r,n):(t||(t={}),r&&!J(t.autoWrapText)&&(t.autoWrapText=!0),o===l_?new l_(null!=t?t:{},null!=e?e:{},null!==(s=n.checkboxStyle)&&void 0!==s?s:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class d_{constructor(t){this._table=t;const e=GC();this.freezeIcon=e[kv.freezeIconName],this.frozenIcon=e[kv.frozenIconName],this.frozenCurrentIcon=e[kv.frozenCurrentIconName],this.normalIcon=e[kv.normalIconName],this.upIcon=e[kv.upwardIconName],this.downIcon=e[kv.downwardIconName],this.dropDownAbsoluteIcon=e[kv.dropdownIconName],this.expandIcon=e[kv.expandIconName],this.collapseIcon=e[kv.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:o,sort:r}=this._table.internalProps.layoutMap.getHeader(t,e);if(o){let o=this._table.getPivotSortState(t,e);o&&(o=o.toUpperCase());const r="ASC"===o?this.downIcon:"DESC"===o?this.upIcon:this.normalIcon;r&&i.push(r)}else if(r){const o=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);o&&i.push(o)}}else{const o=this._table.sortState;let r;r=void 0;const n=this._table.getCellRange(t,e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){const e=o[t],i=this._table._getHeaderCellBySortState(e);if(i&&xb(n,i.col,i.row)){({order:r}=e);break}}else{const t=this._table._getHeaderCellBySortState(o);t&&xb(n,t.col,t.row)&&({order:r}=o)}const s=this.getSortIcon(r,this._table,t,e);s&&i.push(s)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const o=this.getFrozenIcon(t,e);o&&i.push(o)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:r}=this._table._getHeaderLayoutMap(t,e),n=this.getHierarchyIcon(t,e);if(n&&i.push(n),r){let o;o="function"==typeof r?r({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):r;const n=GC(),s=t=>{let e;e="string"==typeof t?n[t]:t,e&&i.push(e)};Array.isArray(o)?o.forEach(((t,e)=>{s(t)})):s(o)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;if(this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const r="asc"===t?this.downIcon:"desc"===t?this.upIcon:this.normalIcon,n=e.getHeaderDefine(i,o);return!n||!1===n.showSort||!J(n.showSort)&&!n.sort||n.columns&&n.columns.length>0?null:r}getSortIconForPivotTable(t,e,i,o){const r=e.getHeaderDefine(i,o);return!r||!1===r.showSort||!J(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:"ASC"===(null==t?void 0:t.toUpperCase())?this.downIcon:"DESC"===(null==t?void 0:t.toUpperCase())?this.upIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,r,n;const s=t.getHeaderDefine(e,i),a=t._getHeaderLayoutMap(e,i),{dropDownMenu:l}=a,h=[];if(Array.isArray(l)&&l.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==s?void 0:s.columns)||void 0===o?void 0:o.length)){const o=l||t.globalDropDownMenu;let s=-1,a=-1;for(let l=0;l<o.length;l++){const h=o[l];if("object"==typeof h&&h.children&&h.children.length)for(let o=0;o<h.children.length;o++){const d=h.children[o];if((null===(r=t.stateManager.menu)||void 0===r?void 0:r.dropDownMenuHighlight)&&QS(t,null===(n=t.stateManager.menu)||void 0===n?void 0:n.dropDownMenuHighlight,"object"==typeof d?null==d?void 0:d.menuKey:d,e,i)){s=l,a=o;break}}if(t._dropDownMenuIsHighlight(e,i,l)){s=l;break}}if(-1!==s){let e;e=-1!==a?(l||t.globalDropDownMenu)[s].children[a]:(l||t.globalDropDownMenu)[s],e.stateIcon&&(e.stateIcon.svg?h.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:Tv.right,marginRight:0,funcType:Pv.dropDownState,interactive:!1}):e.stateIcon.src&&h.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:Tv.right,marginRight:0,funcType:Pv.dropDownState,interactive:!1}))}}return h}getDropDownIconRect(t,e,i){var o,r,n,s,a,l,h,d;const c=null!==(s=null!==(r=null===(o=this.downIcon.hover)||void 0===o?void 0:o.width)&&void 0!==r?r:null===(n=this.downIcon)||void 0===n?void 0:n.width)&&void 0!==s?s:0,u=null!==(d=null!==(l=null===(a=this.downIcon.hover)||void 0===a?void 0:a.height)&&void 0!==l?l:null===(h=this.downIcon)||void 0===h?void 0:h.height)&&void 0!==d?d:0,g=t.right-2-c,p=t.right-2;let f;return f="middle"===i?t.top+t.height/2-c/2:"top"===i?t.top+e/2:"bottom"===i?t.bottom-2*e:t.top,{left:g,right:p,top:f,bottom:u+f,width:c,height:u}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===Rv.expand)return this.expandIcon;if(i===Rv.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const o=t._getHeaderLayoutMap(e,i);if(Array.isArray(o.dropDownMenu)&&o.dropDownMenu.length)return!0}else{const r=t.getHeaderDefine(e,i);if(Array.isArray(r.dropDownMenu)&&r.dropDownMenu.length||(!Array.isArray(r.dropDownMenu)||0!==r.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==r?void 0:r.columns)||void 0===o?void 0:o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return a_;case"image":case"video":return s_;case"checkbox":return l_}}setTableColumnsEditor(){const t=(e,i)=>{null==e||e.forEach(((e,o)=>{e.editor&&(i[o].editor=e.editor),e.columns&&t(e.columns,i[o].columns)}))};t(this._table.options.columns,this._table.internalProps.columns)}}class c_ extends EventTarget{constructor(t,e){if(super(),this._table=t,"node"===Xv.mode)return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i),this._container=i}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${r.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;null===(t=this._container.parentElement)||void 0===t||t.removeChild(this._container)}}class u_{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);-1!==i&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0)}updateDifference(t,e){var i;const o=null!==(i=this.difference.get(t))&&void 0!==i?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=null!==(e=this.data.get(o))&&void 0!==e?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout((()=>{this.dealDiffenence(),this.isUpdate=!1}),0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const e=this.cumulativeSum.get(t);this.cumulativeSum.set(t,e+i)}this.difference.clear()}insert(t,e){for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),J(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const r=[];for(let n=g_(o,t+i-1);n>=0;n--){const s=o[n];if(s>=t)r.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,r[i-1-t])}const{length:r}=o;if(t<e){const n=[];for(let s=g_(o,t);s<r;s++){const r=o[s];if(r>=t&&r<t+i)n.push(this.get(r));else if(t+i<=r&&r<=e)this.put(r-i,this.get(r));else if(r>e)break}for(let t=0;t<i;t++)this.put(e+t,n[t])}}exchangeOrder(t,e,i,o,r){const{_keys:n}=this;if(this._sorted||(n.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let r=g_(n,i);r<t+e;r++){const i=n[r];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,s[t]);for(let t=0;t<o.length;t++)this.put(r+e+t,o[t])}else{const s=[],a=[];for(let r=g_(n,t);r<i+o;r++){const i=n[r];i>=t&&i<t+e?a.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(r+t,a[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}}function g_(t,e){let i=0,o=t.length-1;for(;i<=o;){const r=Math.floor((i+o)/2);if(t[r]===e)return r;t[r]>e?o=r-1:i=r+1}return o<0?0:o}class p_{constructor(t){this._table=t;const e=GC();this.dragReorderIconName=e[kv.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class f_{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const t=this.getCustomCellStyleOption(i);return null==t?void 0:t.style}}getCustomCellStyleId(t,e){let i;return this.customCellStyleArrangement.forEach((o=>{o.cellPosition.range?o.cellPosition.range.start.col<=t&&o.cellPosition.range.end.col>=t&&o.cellPosition.range.start.row<=e&&o.cellPosition.range.end.row>=e&&(i=o.customStyleId):o.cellPosition.col===t&&o.cellPosition.row===e&&(i=o.customStyleId)})),i}getCustomCellStyleOption(t){return this.customCellStyle.find((e=>e.id===t))}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex((e=>e.id===t));-1===i?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach((e=>{const i=e.cellPosition;if(e.customStyleId===t)if(i.range)for(let t=i.range.start.col;t<=i.range.end.col;t++)for(let e=i.range.start.row;e<=i.range.end.row;e++)this.table.scenegraph.updateCellContent(t,e);else this.table.scenegraph.updateCellContent(i.col,i.row)})),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex((e=>e.cellPosition.range&&t.range?e.cellPosition.range.start.col===t.range.start.col&&e.cellPosition.range.start.row===t.range.start.row&&e.cellPosition.range.end.col===t.range.end.col&&e.cellPosition.range.end.row===t.range.end.row:e.cellPosition.col===t.col&&e.cellPosition.row===t.row));if(-1===i)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[i].customStyleId===e)return;this.customCellStyleArrangement[i].customStyleId=e}if(t.range)for(let e=t.range.start.col;e<=t.range.end.col;e++)for(let i=t.range.start.row;i<=t.range.end.row;i++)this.table.scenegraph.updateCellContent(e,i);else this.table.scenegraph.updateCellContent(t.col,t.row);this.table.scenegraph.updateNextFrame()}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach((t=>{this.registerCustomCellStyle(t.id,t.style)})),e.forEach((t=>{this.arrangeCustomCellStyle(t.cellPosition,t.customStyleId)}))}hasCustomCellStyle(t){return this.customCellStyle.some((e=>e.id===t))}}function v_(t,e){t=t.clone();for(const i in e){const o=e[i];o&&(t[`_${i}`]=o)}return t}class b_{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"grid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new Fb,this.dimensionKeysIncludeVirtual=new Fb,this.cache=new Map,this.sizeIncludeParent=null!=o,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t){this.cache.clear(),this.dimensionKeys=new Fb,this.dimensionKeysIncludeVirtual=new Fb,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,r;t.startIndex=e,t.startInTotal=(null!==(o=i.startInTotal)&&void 0!==o?o:0)+t.startIndex,(null!==(r=t.dimensionKey)&&void 0!==r?r:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?Yb:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?Yb:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?Yb:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?Yb:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let n=t.dimensionKey&&this.sizeIncludeParent?1:0;const s=t.children||t.columns;return"grid"===this.hierarchyType?(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),n+=this.setTreeNode(e,n,t)})):n=1:t.hierarchyState===Rv.expand&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),n+=this.setTreeNode(e,n,t)})):t.hierarchyState===Rv.collapse&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,n,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((null==s?void 0:s.length)>=1||!0===s)?(t.hierarchyState=Rv.expand,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),n+=this.setTreeNode(e,n,t)}))):(null==s?void 0:s.length)>=1||!0===s?(t.hierarchyState=Rv.collapse,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,n,t)}))):(t.hierarchyState=Rv.none,n=1),t.size=n,n}getTreePath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const r=t[o],n=this.findNodeById(i,r);if(!n)break;e.push(n),i=n.children}return e}findNodeById(t,e){return t.find((t=>t.id===e))}searchPath(t,e,i,o){if(!e)return;if(t<e.startIndex||t>=e.startIndex+e.size)return;if(i.push(e),!e.children||0===e.children.length||e.level>=o)return;const r=t-e.startIndex;if(this.cache.has(e.level+1)){const t=this.cache.get(e.level+1);if(r>=t.startIndex&&r<t.startIndex+t.size)return void this.searchPath(r,t,i,o)}let n=0,s=e.children.length-1;for(;n<=s;){const t=Math.floor((n+s)/2),a=e.children[t];if(r>=a.startIndex&&r<a.startIndex+a.size){this.cache.set(a.level,a);const t=[];this.cache.forEach(((e,i)=>{i>a.level&&t.push(i)})),t.forEach((t=>{this.cache.delete(t)})),this.searchPath(r,a,i,o);break}r<a.startIndex?s=t-1:n=t+1}}movePosition(t,e,i){let o,r,n;const s=(a,l)=>{if(void 0!==r&&void 0!==n)return;a.level===t&&(a.startInTotal===e&&(r=l),a.startInTotal<=i&&i<=a.startInTotal+a.size-1&&(n=l));const h=a.children||a.columns;if(h&&a.level<t){o=a;for(let t=0;t<h.length;t++)(e>=h[t].startInTotal&&e<=h[t].startInTotal+h[t].size||i>=h[t].startInTotal&&i<=h[t].startInTotal+h[t].size)&&s(h[t],t)}};s(this.tree,0);const a=o.children||o.columns,l=a.splice(r,1);l.unshift(n,0),Array.prototype.splice.apply(a,l)}getCopiedTree(){const t=mt(this.tree.children);return m_(t),t}}function m_(t){for(let e=0;e<t.length;e++){const i=t[e];delete i.level,delete i.startIndex,delete i.id,delete i.levelSpan,delete i.size,delete i.startInTotal;const o=i.children||i.columns;o&&m_(o)}}function C_(t,e){const i=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:i}=t;const o=t.internalProps.frozenRowCount;for(let r=0;r<o;r++){const o=t.getRowHeight(r),n=i+o;if(n>e)return{top:i,row:r,bottom:n,height:o};i=n}return null}(e,t);if(i)return i;let o=x_(t,e);return o||(o={top:-1,row:-1,bottom:-1,height:-1}),o}function y_(t,e){const i=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:i}=t;const o=t.internalProps.frozenColCount;for(let r=0;r<o;r++){const o=t.getColWidth(r),n=i+o;if(n>e)return{left:i,col:r,right:n,width:o};i=n}return null}(e,t);if(i)return i;let o=w_(t,e);return o||(o={left:-1,col:-1,right:-1,width:1}),o}function w_(t,e){if(0===t)return{left:0,col:0,right:0,width:0};const i=function(t,e){if(e._colRangeWidthsMap.get("$0$"+(e.colCount-1))){let i=0,o=e.colCount-1;for(;o-i>1;){const r=Math.floor((i+o)/2);if(t<e._colRangeWidthsMap.get(`$0$${r}`))o=r;else{if(!(t>e._colRangeWidthsMap.get(`$0$${r}`)))return r;i=r}}return o}return Math.min(Math.ceil(t/e.internalProps.defaultColWidth),e.colCount-1)}(t,e),o=e.getColsWidth(0,i);return t>=o?((i,o)=>{let r=o-e.getColWidth(i);const{colCount:n}=e.internalProps;for(let o=i;o<n;o++){const i=e.getColWidth(o),n=r+i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{left:r,col:o,right:n,width:i};r=n}return null})(i,o):((i,o)=>{let r=o;for(let o=i;o>=0;o--){const i=e.getColWidth(o),n=r-i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:n,col:o,right:r,width:i};r=n}return null})(i,o)}function x_(t,e){if(0===t)return{top:0,row:0,bottom:0,height:0};const i=function(t,e){let i=e.internalProps.defaultRowHeight;return e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))&&(i=e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))/e.rowCount),Math.min(Math.ceil(t/i),e.rowCount-1)}(t,e),o=e.getRowsHeight(0,i);return t>=o?((i,o)=>{let r=o-e.getRowHeight(i);const{rowCount:n}=e.internalProps;for(let o=i;o<n;o++){const i=e.getRowHeight(o),n=r+i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{top:r,row:o,bottom:n,height:i};r=n}return null})(i,o):((i,o)=>{let r=o;for(let o=i;o>=0;o--){const i=e.getRowHeight(o),n=r-i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:n,row:o,bottom:r,height:i};r=n}return null})(i,o)}function S_(t,e,i){if(0===t)return{left:0,col:0,right:0,width:0};if(e&&t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth())for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameWidth-i.getColsWidth(i.colCount-e-1,i.colCount-1))return{col:i.colCount-e-1,left:void 0,right:void 0,width:void 0};return w_(t,i)}function __(t,e,i){if(0===t)return{top:0,row:0,bottom:0,height:0};if(e&&t>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&t<i.tableNoFrameHeight)for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameHeight-i.getRowsHeight(i.rowCount-e-1,i.rowCount-1))return{row:i.rowCount-e-1,top:void 0,bottom:void 0,height:void 0};return x_(t,i)}var A_;!function(t){t.vertical="vertical",t.horizontal="horizontal"}(A_||(A_={}));const R_={};const{toBoxArray:B_}=Tb,{isTouchEvent:M_}=Mb,T_=/^\$(\d+)\$(\d+)$/;!function(){if("node"===Xv.mode)return;const t=document.createElement("style");t.id="vtable-style-styleSheet",t.textContent="\n.vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n\n.vtable-gantt {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n.vtable .table-component-container {\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n",document.head.appendChild(t)}();class P_ extends Ev{static get EVENT_TYPE(){return kb}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,r,n,s,a,l,h,d,c,u;if(super(),this.showFrozenIcon=!0,this.version="1.7.4",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=function(t,e){let i=null;return function(){for(var o=arguments.length,r=new Array(o),n=0;n<o;n++)r[n]=arguments[n];i||(i=setTimeout((()=>{t.apply(this,r),i=null}),e))}}(this.render.bind(this),200),!t&&"node"!==e.mode&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:g=0,frozenRowCount:p,defaultRowHeight:f=40,defaultHeaderRowHeight:v,defaultColWidth:b=80,defaultHeaderColWidth:m,widthMode:C="standard",heightMode:y="standard",autoFillWidth:w=!1,autoFillHeight:x=!1,widthAdaptiveMode:S="only-body",heightAdaptiveMode:_="only-body",keyboardOptions:A,eventOptions:R,rowSeriesNumber:B,columnResizeMode:M,rowResizeMode:T="none",dragHeaderMode:P,showFrozenIcon:k,allowFrozenColCount:L,padding:H,hover:E,menu:z,select:F,customRender:I,pixelRatio:O=US,renderChartAsync:D,renderChartAsyncBatchCount:W,mode:N,modeParams:G,canvasWidth:j,canvasHeight:U,overscrollBehavior:V,limitMinWidth:X,limitMinHeight:Y,clearDOM:$=!0}=e;this.container=t,this.options=e,this._widthMode=C,this._heightMode=y,this._widthAdaptiveMode=S,this._heightAdaptiveMode=_,this._autoFillWidth=w,this._autoFillHeight=x,this.customRender=I,this.padding={top:0,right:0,left:0,bottom:0},H&&("number"==typeof H?(this.padding.top=H,this.padding.left=H,this.padding.bottom=H,this.padding.right=H):(H.top&&(this.padding.top=H.top),H.bottom&&(this.padding.bottom=H.bottom),H.left&&(this.padding.left=H.left),H.right&&(this.padding.right=H.right))),J(U)&&J(j)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=j,this.canvasHeight=U,this.columnWidthComputeMode=null!==(i=e.columnWidthComputeMode)&&void 0!==i?i:"normal";const q=this.internalProps={};if(void 0!==k&&(this.showFrozenIcon=k),"number"==typeof L&&L<=0&&(this.showFrozenIcon=!1),this.options.canvas?(q.element=this.options.canvas.parentElement,q.element.style.position="relative",q.focusControl=new c_(this,q.element),q.canvas=this.options.canvas,q.context=q.canvas.getContext("2d")):"node"!==Xv.mode&&(q.element=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vtable";var i,o;const r=document.createElement("div");r.setAttribute("tabindex","0"),r.classList.add(e),r.style.outline="none",r.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const n=(r.offsetWidth||(null===(i=r.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,s=(r.offsetHeight||(null===(o=r.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;return r.style.width=n&&n-t.left-t.right+"px"||"0px",r.style.height=s&&s-t.top-t.bottom+"px"||"0px",r}(this.padding),q.focusControl=new c_(this,q.element),q.canvas=document.createElement("canvas"),q.element.appendChild(q.canvas),q.context=q.canvas.getContext("2d"),(null===(o=e.customConfig)||void 0===o?void 0:o.createReactContainer)&&(q.bodyDomContainer=document.createElement("div"),q.bodyDomContainer.classList.add("table-component-container"),q.element.appendChild(q.bodyDomContainer),q.headerDomContainer=document.createElement("div"),q.headerDomContainer.classList.add("table-component-container"),q.element.appendChild(q.headerDomContainer))),q.handler=new class{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i){if("node"===Xv.mode)return-1;const o=Eb++;for(var r=arguments.length,n=new Array(r>3?r-3:0),s=3;s<r;s++)n[s-3]=arguments[s];if(null==t?void 0:t.addEventListener)if("resize"!==e||t===window)null==t||t.addEventListener(e,i,...n);else{const e=new class{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:e}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=Hb(this.callBack,this.resizeTime),null===window||void 0===window||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),null===(o=this.observer)||void 0===o||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}(t,i,this.resizeTime);this.reseizeListeners[o]=e}const a={target:t,type:e,listener:i,options:n};return this.listeners[o]=a,o}once(t,e,i){var o=this;if("node"===Xv.mode)return-1;for(var r=arguments.length,n=new Array(r>3?r-3:0),s=3;s<r;s++)n[s-3]=arguments[s];const a=this.on(t,e,(function(){o.off(a),i(...arguments)}),...n);return a}off(t){var e;if("node"===Xv.mode)return;if(null==t)return;const i=null===(e=this.listeners)||void 0===e?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e){if("node"!==Xv.mode){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];for(const i in this.listeners){const r=this.listeners[i];r.target===t&&r.type===e&&r.listener.call(r.target,...o)}}}hasListener(t,e){if("node"===Xv.mode)return!1;let i=!1;for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&(i=!0)}return i}clear(){if("node"!==Xv.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];null==e||e.disConnect()}this.listeners={}}}release(){"node"!==Xv.mode&&(this.clear(),this.listeners={})}},at(this.options.resizeTime)&&(q.handler.resizeTime=this.options.resizeTime),q.pixelRatio=O,q.frozenColCount=g,q.frozenRowCount=p,q.defaultRowHeight=f,q.defaultHeaderRowHeight=null!=v?v:f,q.defaultColWidth=b,q.defaultHeaderColWidth=null!=m?m:b,q.keyboardOptions=A,q.eventOptions=R,q.rowSeriesNumber=B,q.columnResizeMode=M,q.rowResizeMode=T,q.dragHeaderMode=null!=P?P:"none",q.renderChartAsync=D,fw(W),q.overscrollBehavior=null!=V?V:"auto",q._rowHeightsMap=new u_(this),q._rowRangeHeightsMap=new Map,q._colRangeWidthsMap=new Map,q._widthResizedColMap=new Set,q._heightResizedRowMap=new Set,this.colWidthsMap=new Fb,this.colContentWidthsMap=new Fb,this.colWidthsLimit={},q.calcWidthContext={_:q,get full(){var t;return"node"===Xv.mode?j/(null!=O?O:1):this._.canvas.width/(null!==(t=this._.context.pixelRatio)&&void 0!==t?t:window.devicePixelRatio)}},q.cellTextOverflows={},q.focusedTable=!1,q.theme=am.of(null!==(r=e.theme)&&void 0!==r?r:am.DEFAULT),q.theme.isPivot=this.isPivotTable(),t?($&&(t.innerHTML=""),t.appendChild(q.element),this._updateSize()):this._updateSize(),this.options=e,q.theme=am.of(null!==(n=e.theme)&&void 0!==n?n:am.DEFAULT),q.theme.isPivot=this.isPivotTable(),q.bodyHelper=new JS(this),q.headerHelper=new d_(this),q.rowSeriesNumberHelper=new p_(this),q.autoWrapText=e.autoWrapText,q.enableLineBreak=e.enableLineBreak,q.allowFrozenColCount=null!==(s=e.allowFrozenColCount)&&void 0!==s?s:0,q.limitMaxAutoWidth=null!==(a=e.limitMaxAutoWidth)&&void 0!==a?a:450,q.limitMinWidth=null!=X?"number"==typeof X?X:X?10:0:10,q.limitMinHeight=null!=Y?"number"==typeof Y?Y:Y?10:0:10,this.scenegraph=new wS(this),this.stateManager=new class{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=Hb((()=>{this.updateInteractionState(Sv.default)}),100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=Sv.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Qt,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:"normal"},this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=Sv.default,this.select={highlightScope:_v.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:_v.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Qt,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:"normal"},this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=null!==(t=this.table.options.hover)&&void 0!==t?t:{highlightMode:"cell"};i?this.hover.highlightScope=_v.none:"cross"===e?this.hover.highlightScope=_v.cross:"row"===e?this.hover.highlightScope=_v.row:"column"===e?this.hover.highlightScope=_v.column:"cell"===e&&(this.hover.highlightScope=_v.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===_v.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell"},this.table.options.select);this.select.highlightScope=e?_v.none:"cross"===o?_v.cross:"row"===o?_v.row:"column"===o?_v.column:_v.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t}isSelected(t,e){let i=!1;return this.select.ranges.forEach((o=>{xb(o,t,e)&&(i=!0)})),i}setSortState(t){this.sort.field=null==t?void 0:t.field,this.sort.order=null==t?void 0:t.order}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;const e=this.interactionState;this.interactionState=t,e===Sv.scrolling&&Sv.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){BS(this,t,e)}updateSelectPos(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,i,o,r,n){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];var l,h;const{table:d,interactionState:c}=t,{scenegraph:u}=d,{highlightScope:g,disableHeader:p,cellPos:f}=t.select;if((p&&d.isHeader(e,i)||"none"===g)&&(-1===e||-1===i||s||d._makeVisibleCell(e,i),e=-1,i=-1),-1!==e&&-1!==i&&!s)if(c===Sv.grabing&&t.select.ranges.length>0){const o=t.select.ranges[t.select.ranges.length-1];e>o.start.col&&e>o.end.col&&d._makeVisibleCell(e+1,i),i>o.start.row&&i>o.end.row&&d._makeVisibleCell(e,i+1),e<o.start.col&&e<o.end.col&&d._makeVisibleCell(e-1,i),i<o.start.row&&i<o.end.row&&d._makeVisibleCell(e,i-1)}else d._makeVisibleCell(e,i);if(n){t.select.ranges=[],u.deleteAllSelectBorder();let e=0,i=0;const{disableHeaderSelect:o,disableRowSeriesNumberSelect:r}=(null===(l=d.options.keyboardOptions)||void 0===l?void 0:l.selectAllOnCtrlA)||{};o&&(e=d.rowHeaderLevelCount,i=d.columnHeaderLevelCount),(r||o)&&d.options.rowSeriesNumber&&(e+=1),t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:d.rowCount-1}});const n=t.select.ranges[t.select.ranges.length-1];u.updateCellSelectBorder(n,!1)}else if(-1===f.col||-1===f.row||-1!==e&&-1!==i)if(c!==Sv.default||d.eventManager.isDraging||d.stateManager.isResizeCol()){if((c===Sv.grabing||d.eventManager.isDraging)&&!d.stateManager.isResizeCol()){let o=!0;-1===f.col&&(f.col=e),-1===f.row&&(f.row=i),f.col=e,f.row=i;const r=t.select.ranges[t.select.ranges.length-1];if(r){if(d.internalProps.layoutMap.isSeriesNumberInBody(r.start.col,r.start.row))o=!1,r.end={col:d.colCount-1,row:i};else if(t.fillHandle.isFilling){if("top"===t.fillHandle.direction)if(i===t.fillHandle.beforeFillMinRow&&i===t.fillHandle.beforeFillMaxRow)r.start.row=r.end.row=i;else if(i<=t.fillHandle.beforeFillMinRow){if(r.start.row<r.end.row){const t=r.start.row;r.start.row=r.end.row,r.end.row=t}r.end.row=i}else i===t.fillHandle.beforeFillMaxRow&&(r.start.row>r.end.row?r.start.row=i:r.end.row=i);else if("bottom"===t.fillHandle.direction){if(i>=t.fillHandle.beforeFillMaxRow){if(r.start.row>r.end.row){const t=r.start.row;r.start.row=r.end.row,r.end.row=t}r.end.row=i}}else if("left"===t.fillHandle.direction)if(e===t.fillHandle.beforeFillMinCol&&e===t.fillHandle.beforeFillMaxCol)r.start.col=r.end.col=e;else if(e<=t.fillHandle.beforeFillMinCol){if(r.start.col<r.end.col){const t=r.start.col;r.start.col=r.end.col,r.end.col=t}r.end.col=e}else e===t.fillHandle.beforeFillMaxCol&&(r.start.col>r.end.col?r.start.col=e:r.end.col=e);else if("right"===t.fillHandle.direction&&e>=t.fillHandle.beforeFillMaxCol){if(r.start.col>r.end.col){const t=r.start.col;r.start.col=r.end.col,r.end.col=t}r.end.col=e}}else r.end={col:e,row:i},a&&(r.skipBodyMerge=!0);u.updateCellSelectBorder(r,o)}}}else{const n=t.select.ranges[t.select.ranges.length-1];if(o&&n){if(r||(f.col=e,f.row=i),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const t=Math.min(n.start.col,n.end.col,e),o=Math.max(n.start.col,n.end.col,e),r=Math.min(n.start.row,n.end.row,i),s=d.rowCount-1;n.start={col:t,row:r},n.end={col:o,row:s}}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const t=Math.min(n.start.col,n.end.col,e),o=d.colCount-1,r=Math.min(n.start.row,n.end.row,i),s=Math.max(n.start.row,n.end.row,i);n.start={col:t,row:r},n.end={col:o,row:s}}else n.end={col:e,row:i};u.deleteLastSelectedRangeComponents(),u.updateCellSelectBorder(n)}else{let o=!0;if(-1===f.col||-1===f.row||r||(t.select.ranges=[],u.deleteAllSelectBorder()),"cell"!==t.select.headerSelectMode&&d.isColumnHeader(e,i)){const o=d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:i},end:{col:o.end.col,row:d.rowCount-1},skipBodyMerge:!0})}else if("cell"!==t.select.headerSelectMode&&d.isRowHeader(e,i)){const o=d.getCellRange(e,i);t.select.ranges.push({start:{col:e,row:o.start.row},end:{col:d.colCount-1,row:o.end.row},skipBodyMerge:!0})}else if(d.internalProps.layoutMap.isSeriesNumberInHeader(e,i))o=!1,t.select.ranges.push({start:{col:0,row:0},end:{col:d.colCount-1,row:d.rowCount-1},skipBodyMerge:!0});else if(d.internalProps.layoutMap.isSeriesNumberInBody(e,i))o=!1,t.select.ranges.push({start:{col:e,row:i},end:{col:d.colCount-1,row:i},skipBodyMerge:!0});else if(e>=0&&i>=0){const o=a?{start:{col:e,row:i},end:{col:e,row:i}}:d.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:o.start.row},end:{col:o.end.col,row:o.end.row},skipBodyMerge:a||void 0})}f.col=e,f.row=i;const n=null===(h=t.select.ranges)||void 0===h?void 0:h[t.select.ranges.length-1];n&&u.updateCellSelectBorder(n,o)}}else f.col=-1,f.row=-1,t.select.ranges=[],u.deleteAllSelectBorder();u.updateNextFrame()}(this,t,e,i,o,r,n,s)}checkCellRangeInSelect(t,e){return function(t,e,i,o){for(let o=0;o<i.length;o++)if(_b(i[o],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o){var r,n,s,a,l,h,d,c,u;if((null===(r=this.residentHoverIcon)||void 0===r?void 0:r.icon)&&i===(null===(n=this.residentHoverIcon)||void 0===n?void 0:n.icon))return;const g=LS(i);if(g)if("richtext-icon"===g.type){const i=g.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(a=this.residentHoverIcon)||void 0===a?void 0:a.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),i.attribute.tooltip){const o={content:i.attribute.tooltip.title,referencePosition:{rect:g.position,placement:i.attribute.tooltip.placement},style:Object.assign({},null===(l=this.table.internalProps.theme)||void 0===l?void 0:l.tooltipStyle,null===(h=i.tooltip)||void 0===h?void 0:h.style,null===(c=null===(d=i.attribute)||void 0===d?void 0:d.tooltip)||void 0===c?void 0:c.style),disappearDelay:i.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(o)||this.table.showTooltip(t,e,o)}}else{const i=g.icon;i!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(u=this.residentHoverIcon)||void 0===u?void 0:u.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=i,this.table.scenegraph.setIconHoverStyle(i,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(s=this.residentHoverIcon)||void 0===s?void 0:s.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.select.selecting){if(this.select.selecting=!1,0===this.select.ranges.length)return;const e=this.select.ranges[this.select.ranges.length-1];let i=!1;for(let t=0;t<this.select.ranges.length-1;t++){const o=this.select.ranges[t];if(o&&o.start.col===e.start.col&&o.start.row===e.start.row&&o.end.col===e.end.col&&o.end.row===e.end.row){i=!0;break}}i?(this.select.ranges.pop(),$x(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const o=this.select.ranges[this.select.ranges.length-1].end.col,r=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(kb.SELECTED_CELL,{ranges:this.select.ranges,col:o,row:r})}else e&&0===this.select.ranges.length&&this.table.fireListeners(kb.SELECTED_CLEAR,{})}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var r;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const n=!!(null===(r=this.select.ranges)||void 0===r?void 0:r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,n),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.columnResize.isRightFrozen?i.columnResize.x-t:t-i.columnResize.x;if(Math.abs(o)<1)return;const r=i.table.getColWidth(i.columnResize.col);let n=r;n+=o;const s=i.table.getMinColWidth(i.columnResize.col),a=i.table.getMaxColWidth(i.columnResize.col);if(n<s||n>a){if(r===s||r===a)return;o=r-s>a-r?a-r:s-r}let l=i.table.getColWidth(i.columnResize.col)+o;if(l<i.table.internalProps.limitMinWidth&&(l=i.table.internalProps.limitMinWidth,o=l-i.table.getColWidth(i.columnResize.col)),"adaptive"===i.table.widthMode&&i.columnResize.col<i.table.colCount-1){const t=i.table.getColWidth(i.columnResize.col+1),e=i.table.getMinColWidth(i.columnResize.col+1),r=i.table.getMaxColWidth(i.columnResize.col+1);let n=t;if(n-=o,n<e||n>r){if(t===e||t===r)return;o=t-e>r-t?r-t:e-t}n-o<i.table.internalProps.limitMinWidth&&(o=n-i.table.internalProps.limitMinWidth)}o=Math.ceil(o),i.columnResize.col<i.table.rowHeaderLevelCount||i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount?HS(o,i):"indicator"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;let o,r,n;if(i.indicatorsAsCol)o=i.getIndicatorKey(e.columnResize.col,e.table.columnHeaderLevelCount);else{const t=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount-1),o=t.colHeaderPaths[t.colHeaderPaths.length-1];r=o.dimensionKey,n=o.value}for(let s=e.table.rowHeaderLevelCount;s<e.table.colCount-e.table.rightFrozenColCount;s++){const a=i.getIndicatorKey(s,e.table.columnHeaderLevelCount);if(i.indicatorsAsCol&&a===o)e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s);else if(!i.indicatorsAsCol){const o=i.getCellHeaderPaths(s,e.table.columnHeaderLevelCount-1),a=null==o?void 0:o.colHeaderPaths[o.colHeaderPaths.length-1];a&&r===a.dimensionKey&&n===a.value&&(e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s))}}}(o,i):"indicatorGroup"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount),r=i.getHeadNodeByRowOrColDimensions(o.colHeaderPaths.slice(0,o.colHeaderPaths.length-1)),n=r.startInTotal+e.table.frozenColCount,s=r.startInTotal+e.table.frozenColCount+r.size-1,a=e.table.getColsWidth(n,s),l=t;for(let t=n;t<=s;t++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const o=i.getBody(t,e.table.columnHeaderLevelCount);if(null==o?void 0:o.disableColumnResize)continue}let o=e.table.getColWidth(t)/a*l;o>0&&o<.5?o=.5:o<0&&o>=-.5&&(o=-.5),e.table.scenegraph.updateColWidth(t,o),e.table.internalProps._widthResizedColMap.add(t)}}(o,i):"all"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;for(let o=e.table.frozenColCount;o<e.table.colCount-e.table.rightFrozenColCount;o++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const t=i.getBody(o,e.table.columnHeaderLevelCount);if(null==t?void 0:t.disableColumnResize)continue}e.table.scenegraph.updateColWidth(o,t),e.table.internalProps._widthResizedColMap.add(o)}}(o,i):HS(o,i),i.columnResize.x=t,i.table.scenegraph.component.updateResizeCol(i.columnResize.col,e,i.columnResize.isRightFrozen),i.columnResize.col<i.table.frozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1,i.columnResize.isRightFrozen):i.table.options.frozenColCount&&i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1),(i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose||i.table.options.rightFrozenColCount)&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame()}(t,e,this)}endResizeRow(){setTimeout((()=>{this.rowResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var r;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const n=!!(null===(r=this.select.ranges)||void 0===r?void 0:r.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,n),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.rowResize.isBottomFrozen?i.rowResize.y-e:e-i.rowResize.y;if(Math.abs(o)<1)return;i.table.getRowHeight(i.rowResize.row);let r=i.table.getRowHeight(i.rowResize.row)+o;if(r<i.table.internalProps.limitMinHeight&&(r=i.table.internalProps.limitMinHeight,o=r-i.table.getRowHeight(i.rowResize.row)),"adaptive"===i.table.heightMode&&i.rowResize.row<i.table.rowCount-1){let t=i.table.getRowHeight(i.rowResize.row+1);t-=o,t-o<i.table.internalProps.limitMinHeight&&(o=t-i.table.internalProps.limitMinHeight)}o=Math.ceil(o),i.rowResize.row<i.table.columnHeaderLevelCount||i.rowResize.row>=i.table.rowCount-i.table.bottomFrozenRowCount?ES(o,i):"indicator"===i.table.internalProps.rowResizeType?function(t,e){var i,o;const r=e.table.internalProps.layoutMap;let n,s,a;if(r.indicatorsAsCol){const t=r.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,e.rowResize.row),o=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];s=null==o?void 0:o.dimensionKey,a=null==o?void 0:o.value}else n=r.getIndicatorKey(e.table.rowHeaderLevelCount,e.rowResize.row);for(let i=e.table.columnHeaderLevelCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++){const l=r.getIndicatorKey(e.table.rowHeaderLevelCount,i);if(r.indicatorsAsCol||l!==n){if(r.indicatorsAsCol){const n=r.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,i),l=null===(o=null==n?void 0:n.rowHeaderPaths)||void 0===o?void 0:o[n.rowHeaderPaths.length-1];l&&s===l.dimensionKey&&a===l.value&&(e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i))}}else e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}}(o,i):"indicatorGroup"===i.table.internalProps.rowResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.table.rowHeaderLevelCount,e.rowResize.row),r=i.getHeadNodeByRowOrColDimensions(o.rowHeaderPaths.slice(0,o.rowHeaderPaths.length-1)),n=r.startInTotal+e.table.frozenRowCount,s=r.startInTotal+e.table.frozenRowCount+r.size-1,a=e.table.getRowsHeight(n,s),l=t;for(let t=n;t<=s;t++){let i=e.table.getRowHeight(t)/a*l;i>0&&i<.5?i=.5:i<0&&i>=-.5&&(i=-.51),e.table.scenegraph.updateRowHeight(t,i),e.table.internalProps._heightResizedRowMap.add(t)}}(o,i):"all"===i.table.internalProps.rowResizeType?function(t,e){for(let i=e.table.frozenRowCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++)e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}(o,i):ES(o,i),i.rowResize.y=e,i.table.scenegraph.component.updateResizeRow(i.rowResize.row,t,i.rowResize.isBottomFrozen),i.table.scenegraph.updateNextFrame()}(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(kb.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(kb.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o){!function(t,e,i,o,r){var n;if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;r.columnMove.moving=!0,r.columnMove.colSource=t,r.columnMove.rowSource=e,r.columnMove.x=i-r.table.tableX,r.columnMove.y=o-r.table.tableY;const s=r.table.getCellLocation(t,e),a="columnHeader"===s?r.columnMove.x:"rowHeader"===s||r.table.internalProps.layoutMap.isSeriesNumberInBody(t,e)?r.columnMove.y:0;r.table.scenegraph.component.showMoveCol(t,e,a);const l=!!(null===(n=r.select.ranges)||void 0===n?void 0:n.length);r.table.stateManager.updateSelectPos(-1,-1),r.table.stateManager.endSelectCells(!0,l),r.table.scenegraph.updateNextFrame()}(t,e,i,o,this)}updateMoveCol(t,e,i,o){!function(t,e,i,o,r){if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;const n=function(t,e,i){const o=i.getCellRange(t.col,t.row);if(i.isColumnHeader(t.col,t.row)){const r=i.getCellRange(e.col,o.start.row);e.row>=i.columnHeaderLevelCount&&(e.row=i.columnHeaderLevelCount-1),e.col>=t.col?e.col=r.end.col:e.col=r.start.col}else if(i.isRowHeader(t.col,t.row)){const r=i.internalProps.layoutMap,n=i.getCellRange(o.start.col,e.row);if(e.col>=i.rowHeaderLevelCount+r.leftRowSeriesNumberColumnCount&&(e.col=i.rowHeaderLevelCount+r.leftRowSeriesNumberColumnCount-1),"tree"===r.rowHierarchyType){const o=r.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,n=r.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths;if(o.length<=n.length){const r=n[o.length-1];r&&(e.row>=t.row?e.row=r.startInTotal+r.size-1+i.columnHeaderLevelCount:e.row=r.startInTotal+i.columnHeaderLevelCount)}}else e.row>=t.row?e.row=n.end.row:e.row=n.start.row}return e}({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:t,row:e},r.table);if(r.table.internalProps.layoutMap.canMoveHeaderPosition({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:n.col,row:n.row})){let s,a,l,h;r.columnMove.x=i-r.table.tableX,r.columnMove.y=o-r.table.tableY,r.columnMove.colTarget=n.col,r.columnMove.rowTarget=n.row,r.updateCursor("grabbing");const d=r.table.getCellLocation(r.columnMove.colSource,r.columnMove.rowSource);"columnHeader"===d?(a=r.columnMove.x,s=r.table.isLeftFrozenColumn(t)?r.columnMove.colTarget>=r.columnMove.colSource?r.table.getColsWidth(0,r.columnMove.colTarget):r.table.getColsWidth(0,r.columnMove.colTarget-1):r.table.isRightFrozenColumn(t)?r.table.tableNoFrameWidth-r.table.getColsWidth(n.col+1,r.table.colCount-1):(r.columnMove.colTarget>=r.columnMove.colSource?r.table.getColsWidth(0,r.columnMove.colTarget):r.table.getColsWidth(0,r.columnMove.colTarget-1))-r.table.stateManager.scroll.horizontalBarPos):("rowHeader"===d||r.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(h=r.columnMove.y,l=r.table.isFrozenRow(e)?r.columnMove.rowTarget>=r.columnMove.rowSource?r.table.getRowsHeight(0,r.columnMove.rowTarget):r.table.getRowsHeight(0,r.columnMove.rowTarget-1):r.table.isBottomFrozenRow(e)?r.table.tableNoFrameHeight-r.table.getRowsHeight(n.row+1,r.table.rowCount-1):(r.columnMove.rowTarget>=r.columnMove.rowSource?r.table.getRowsHeight(0,r.columnMove.rowTarget):r.table.getRowsHeight(0,r.columnMove.rowTarget-1))-r.table.stateManager.scroll.verticalBarPos),r.table.scenegraph.component.updateMoveCol(a,s,h,l),r.table.scenegraph.updateNextFrame()}else r.updateCursor("not-allowed"),r.columnMove.colTarget=r.columnMove.colSource,r.columnMove.rowTarget=r.columnMove.rowSource}(t,e,i,o,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return function(t){let e=!1;if("canMoveHeaderPosition"in t.table.internalProps.layoutMap&&t.columnMove.moving&&t.columnMove.colSource>=0&&t.columnMove.rowSource>=0&&t.columnMove.colTarget>=0&&t.columnMove.rowTarget>=0){const i=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),o=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),r=t.table._moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget});if(!r||r.targetIndex===r.sourceIndex)return t.updateCursor(),t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget,t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame(),!1;{t.table.internalProps.useOneRowHeightFillAll=!1,t.table.internalProps.layoutMap.clearCellRangeMap();const n=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),s=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),a=Math.min(n.start.col,s.start.col,i.start.col,o.start.col),l=Math.max(n.end.col,s.end.col,i.end.col,o.end.col),h=Math.min(n.start.row,s.start.row,i.start.row,o.start.row);let d=Math.max(n.end.row,s.end.row,i.end.row,o.end.row);"row"===r.moveType&&"tree"===t.table.internalProps.layoutMap.rowHierarchyType&&(d=r.targetIndex>r.sourceIndex?d+r.targetSize-1:d+r.sourceSize-1),!t.table.transpose&&t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)&&(t.table.changeRecordOrder(r.sourceIndex,r.targetIndex),t.changeCheckboxAndRadioOrder(r.sourceIndex,r.targetIndex)),"column"===r.moveType?kS(a,l,0,-1,t.table):kS(0,-1,h,d,t.table),t.table.clearCellStyleCache(),t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)?t.table.scenegraph.updateHeaderPosition(t.table.scenegraph.proxy.colStart,t.table.scenegraph.proxy.colEnd,t.table.scenegraph.proxy.rowStart,t.table.scenegraph.proxy.rowEnd,r.moveType):"column"===r.moveType?t.table.scenegraph.updateHeaderPosition(a,l,0,-1,r.moveType):t.table.scenegraph.updateHeaderPosition(0,-1,h,d,r.moveType),"adjustFrozenCount"===t.table.internalProps.frozenColDragHeaderMode&&t.table.isListTable()&&(t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&!t.table.isLeftFrozenColumn(t.columnMove.colSource)?t.table.frozenColCount+=n.end.col-n.start.col+1:t.table.isLeftFrozenColumn(t.columnMove.colSource)&&!t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&(t.table.frozenColCount-=n.end.col-n.start.col+1),t.table.isRightFrozenColumn(t.columnMove.colTarget)&&!t.table.isRightFrozenColumn(t.columnMove.colSource)?t.table.rightFrozenColCount+=n.end.col-n.start.col+1:t.table.isRightFrozenColumn(t.columnMove.colSource)&&!t.table.isRightFrozenColumn(t.columnMove.colTarget)&&(t.table.rightFrozenColCount-=n.end.col-n.start.col+1)),e=!0}}return setTimeout((()=>{t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget}),0),t.table.scenegraph.component.hideMoveCol(),t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?(t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen),t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)):t.columnResize.col>=t.table.colCount-t.table.rightFrozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):t.table.options.frozenColCount?t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount),t.table.scenegraph.updateNextFrame(),e}(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?null!==(t=this.table.rowHeaderLevelCount)&&void 0!==t?t:0:Math.max((null!==(e=this.table.rowHeaderLevelCount)&&void 0!==e?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,null!==(i=this.table.options.frozenColCount)&&void 0!==i?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,r=this.table.tableNoFrameHeight;o+r>=i&&this.table.fireListeners(kb.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:r,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,r=this.table.tableNoFrameWidth;o+r>=i&&this.table.fireListeners(kb.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:r})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,1===t),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(kb.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),r!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(kb.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),r!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,r,n;const s=this.table.getAllRowsHeight(),a=(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0;t=Math.max(0,Math.min(t,s-this.table.scenegraph.height-a)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const l=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const h=t/(s-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(h),l!==t&&i&&(this.table.fireListeners(kb.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,scrollWidth:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:h}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,r,n;this.table.scrollLeft;const s=this.table.getAllColsWidth(),a=(this.table.getFrozenColsWidth(),(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0);t=Math.max(0,Math.min(t,s-this.table.scenegraph.width-a)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const l=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const h=t/(s-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(h),l!==t&&i&&(this.table.fireListeners(kb.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,scrollWidth:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:h}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var r;(null===(r=this.table.internalProps.menu)||void 0===r?void 0:r.contextMenuItems)&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,Iy.contextmenu)),this.table.fireListeners(kb.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,r){this.table.fireListeners(kb.DROPDOWN_ICON_CLICK,{col:t,row:e,event:r}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,Iy.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(kb.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let n;r.forEachChildren((t=>t.attribute.funcType===Pv.dropDown&&(n=t,!0))),n&&(this.residentHoverIcon={col:t,row:e,icon:n},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(kb.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(kb.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],r=this.table.getCellRange(i,o);if(r)for(let t=r.start.col;t<=r.end.col;t++)for(let e=r.start.row;e<=r.end.row;e++)this.table.scenegraph.updateCellContent(t,e)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let r=0;r<o.length;r++){const n=o[r];let{col:s,row:a}=n;const{field:l,menuKey:h}=n;if("number"!=typeof s||"number"!=typeof a)if(this.table.isPivotTable()){const t=this.table.internalProps.layoutMap.getPivotCellAdress(l);if(!t)continue;s=t.col,a=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!t)continue;s=t.col,a=t.row}if(J(s)&&J(a)&&this.table.isCellRangeEqual(t,e,s,a)){const o=this.table._getHeaderLayoutMap(null!=s?s:t,null!=a?a:e).dropDownMenu||this.table.globalDropDownMenu;if(o)for(let t=0;t<o.length;t++){const e=o[t];if(Q(e)&&(e.menuKey||e.text)===(h||"")&&t===i)return!0;if(ot(e)&&e===h&&t===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const i=this.table.getPivotSortState(t,e),r=i?i.toUpperCase():"NORMAL",n="ASC"===r?"DESC":"DESC"===r?"NORMAL":"ASC";return this.table.sort(t,e,n),void this.table.fireListeners(PS.PIVOT_SORT_CLICK,{col:t,row:e,order:r||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const r=this.sort.col,n=this.sort.row;MS(t,e,this.table,o),this.sort.col=t,this.sort.row=e,this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,i,this.sort.order,r,n,this.sort.icon),this.sort.icon=i}updateSortState(t){if(t.field===this.sort.field&&t.order===this.sort.order)return;const e=this.sort.col,i=this.sort.row,o="asc"===this.sort.order?"sort_downward":"desc"===this.sort.order?"sort_upward":"sort_normal";this.setSortState(t);const r=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t.field);this.sort.col=r.col,this.sort.row=r.row;const n=this.table.scenegraph.getCell(this.sort.col,this.sort.row).getChildByName(o,!0);this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,n,this.sort.order,e,i,this.sort.icon)}triggerFreeze(t,e,i){this.table.isPivotTable()||this.table.transpose||(function(t,e,i){i.frozenColCount>0?t!==i.frozenColCount-1?i.setFrozenColCount(t+1):i.setFrozenColCount(0):i.setFrozenColCount(t+1)}(t,0,this.table),this.frozen.icon=i)}updateCursor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,r,n){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=r,this.drill.row=n,function(t,e,i,o,r){const n=r.getCellLocation(t,e);let s=0,a=0,l=!1;"columnHeader"===n?(s=r.getColsWidth(0,r.rowHeaderLevelCount-1)-(0===r.frozenColCount?r.scrollLeft:0),a=r.getRowsHeight(0,e-1)+r.getRowHeight(e)/2,l=!0):"rowHeader"===n&&(a=r.getRowsHeight(0,r.columnHeaderLevelCount-1),s=r.getColsWidth(0,t-1)+r.getColWidth(t)/2,l=!0),r.scenegraph.updateDrill(l,s,a,i,o)}(r,n,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,i){const o=i.scenegraph.getCell(t,e).getChildByName("sparkline"),r=null==o?void 0:o.getChildByName("highlight-line"),n=null==o?void 0:o.getChildByName("highlight-symbol");r&&r.setAttributes({visible:!1,pickable:!1}),n&&n.setAttributes({visible:!1,pickable:!1}),i.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table);let r=!1;-1!==t&&-1!==e&&(r=function(t,e,i,o,r){var n,s;const a=r.scenegraph.getCell(t,e).getChildByName("sparkline"),l=null==a?void 0:a.getChildByName("sparkline-line"),h=null==a?void 0:a.getChildByName("sparkline-symbol-group");if(!l)return!1;const d=l.bandwidth,c=l.min,u=l.max,g=l.attribute.points;let p;i-=a.globalAABBBounds.x1,a.globalAABBBounds.y1;for(let t=0;t<g.length;t++){const{x:e,y:o,defined:r,rawData:f}=g[t];if(Math.abs(i-e)<d/2&&(p={point:g[t],points:g,pointsBandWidth:d,pointData:f},r)){const t=a.getChildByName("highlight-line");if(t)t.setAttributes({points:[{x:e,y:u},{x:e,y:c}],visible:!0,pickable:!0});else{const t=rd({points:[{x:e,y:u},{x:e,y:c}],lineWidth:null===(n=l.hover)||void 0===n?void 0:n.strokeWidth,stroke:null===(s=l.hover)||void 0===s?void 0:s.stroke});t.name="highlight-line",a.addChild(t)}const i=a.getChildByName("highlight-symbol");if(i)i.setAttributes({x:e,y:o,visible:!0,pickable:!0});else{const t=ed({x:e,y:o,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});t.name="highlight-symbol",a.addChild(t)}break}}if(r.scenegraph.updateNextFrame(),p){const i={col:t,row:e,field:r.getHeaderField(t,e),value:r.getCellValue(t,e),dataValue:r.getCellOriginValue(t,e),cellHeaderPaths:r.internalProps.layoutMap.getCellHeaderPaths(t,e),title:r.getBodyColumnDefine(t,e).title,cellRange:r.getCellRelativeRect(t,e),sparkline:{pointData:p.pointData},scaleRatio:r.canvas.getBoundingClientRect().width/r.canvas.offsetWidth};r.fireListeners(kb.MOUSEOVER_CHART_SYMBOL,i)}return!0}(t,e,i,0,this.table)),r?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return function(t,e,i,o,r){const n=r.table.getRecordShowIndexByCell(t,e);if(n>=0){const t=r.table.dataSource.getIndexKey(n);r.checkedState[t]||(r.checkedState[t]={}),r.checkedState[t][i]=o}}(t,e,i,o,this)}setHeaderCheckedState(t,e){return function(t,e,i){var o;i.headerCheckedState[t]=e,null===(o=i.checkedState)||void 0===o||o.forEach((i=>{i[t]=e}))}(t,e,this)}syncCheckedState(t,e,i,o){return function(t,e,i,o,r){var n,s;if(r.table.isHeader(t,e)){if(J(r.headerCheckedState[i]))return r.headerCheckedState[i];if("function"==typeof o)return;if(J(o))r.headerCheckedState[i]=o;else if((null===(n=r.checkedState)||void 0===n?void 0:n.length)>0)return r.updateHeaderCheckedState(i);return r.headerCheckedState[i]}const a=r.table.getRecordShowIndexByCell(t,e);if(a>=0){const t=r.table.dataSource.getIndexKey(a);if(J(null===(s=r.checkedState[t])||void 0===s?void 0:s[i]))return r.checkedState[t][i];r.checkedState[t]||(r.checkedState[t]={}),r.checkedState[t][i]=o}return o}(t,e,i,o,this)}initCheckedState(t){return function(t,e){e.checkedState=[],e.headerCheckedState={},e.radioState={};let i=!1;e._checkboxCellTypeFields=[],e._headerCheckFuncs={},e.table.internalProps.layoutMap.headerObjects.forEach(((t,o)=>{if("checkbox"===t.headerType){const o=t.define.checked;null==o||"function"==typeof o?(i=!0,"function"==typeof o&&(e._headerCheckFuncs[t.field]=o)):e.headerCheckedState[t.field]=o,"checkbox"!==t.define.cellType||t.fieldFormat||e._checkboxCellTypeFields.push(t.field)}})),i&&t.forEach(((t,i)=>{e._checkboxCellTypeFields.forEach((o=>{const r=t[o];let n;if(Q(r)?n=r.checked:"boolean"==typeof r&&(n=r),null==n){const t=e._headerCheckFuncs[o];if(t){const s=e.table.getCellAddrByFieldRecord(o,i);n=mb(t,{col:s.col,row:s.row,table:e.table,context:null,value:r})}}e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][o]=n}))}))}(t,this)}updateHeaderCheckedState(t){return function(t,e){const i=e.checkedState.every((e=>!0===e[t]));return i?(e.headerCheckedState[t]=!0,i):e.checkedState.every((e=>!1===e[t]))?(e.headerCheckedState[t]=!1,!1):!!e.checkedState.find((e=>!0===e[t]))&&(e.headerCheckedState[t]="indeterminate","indeterminate")}(t,this)}initLeftRecordsCheckState(t){return function(t,e){for(let i=e.checkedState.length;i<t.length;i++){const o=t[i];e._checkboxCellTypeFields.forEach((t=>{const r=o[t];let n;Q(r)?n=r.checked:"boolean"==typeof r&&(n=r),e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][t]=n}))}}(t,this)}setRadioState(t,e,i,o,r){!function(t,e,i,o,r,n){const s=n.table.getRecordShowIndexByCell(t,e);if(s>=0){const t=n.table.dataSource.getIndexKey(s);"column"===o?at(r)?(n.radioState[i]={},n.radioState[i][t]=r):n.radioState[i]=t:(n.radioState[i]||(n.radioState[i]={}),at(r)?n.radioState[i][t]=r:n.radioState[i][t]=!0)}}(t,e,i,o,r,this)}syncRadioState(t,e,i,o,r,n){return function(t,e,i,o,r,n,s){var a,l,h,d,c;const u=s.table.getRecordShowIndexByCell(t,e);if(u>=0){const t=s.table.dataSource.getIndexKey(u);if("column"===o){if(!J(s.radioState[i])&&n)return at(r)?(s.radioState[i]={},s.radioState[i][t]=r):s.radioState[i]=t,!0;if(at(s.radioState[i])&&!at(r))return s.radioState[i]===t;if(at(s.radioState[i])&&at(r))return!1;if(Q(s.radioState[i])&&!at(r))return!1;if(Q(s.radioState[i])&&at(r))return s.radioState[i][t]===r}else if("cell"===o){if(!J(s.radioState[i])&&n)return s.radioState[i]={},at(r)?s.radioState[i][t]=r:s.radioState[i][t]=!0,!0;if(!J(null===(a=s.radioState[i])||void 0===a?void 0:a[t])&&n)return at(r)?s.radioState[i][t]=r:s.radioState[i][t]=!0,!0;if(K(null===(l=s.radioState[i])||void 0===l?void 0:l[t])&&!at(r))return s.radioState[i][t];if(K(null===(h=s.radioState[i])||void 0===h?void 0:h[t])&&at(r))return!1;if(at(null===(d=s.radioState[i])||void 0===d?void 0:d[t])&&!at(r))return!1;if(at(null===(c=s.radioState[i])||void 0===c?void 0:c[t])&&at(r))return s.radioState[i][t]===r}}return n}(t,e,i,o,r,n,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&function(t,e,i){const{checkedState:o,table:r}=i;if(r.internalProps.transpose?(t=r.getRecordShowIndexByCell(t,0),e=r.getRecordShowIndexByCell(e,0)):(t=r.getRecordShowIndexByCell(0,t),e=r.getRecordShowIndexByCell(0,e)),t!==e){const i=o[t];o[t]=o[e],o[e]=i}}(t,e,this),this.radioState.length&&function(t,e,i){const{radioState:o,table:r}=i;if(r.internalProps.transpose?(t=r.getRecordShowIndexByCell(t,0),e=r.getRecordShowIndexByCell(e,0)):(t=r.getRecordShowIndexByCell(0,t),e=r.getRecordShowIndexByCell(0,e)),t!==e){const i=o[t];o[t]=o[e],o[e]=i}}(t,e,this)}}(this),this.eventManager=new class{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new DS(t.stateManager),"node"===Xv.mode||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0))}bindOuterEvent(){WS(this),function(t){const e=t.table,i=e.stateManager,o=e.internalProps.handler;function r(t){var i;if(e.hasListeners(kb.KEYDOWN)){const o={keyCode:null!==(i=t.keyCode)&&void 0!==i?i:t.which,code:t.code,event:t,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(kb.KEYDOWN,o)}}o.on(e.getElement(),"blur",(e=>{t.dealTableHover()})),o.on(e.getElement(),"keydown",(o=>{var n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S;if("a"===o.key&&(o.ctrlKey||o.metaKey))(null===(n=e.keyboardOptions)||void 0===n?void 0:n.selectAllOnCtrlA)&&(o.preventDefault(),t.deelTableSelectAll());else if(i.select.cellPos.col>=0&&i.select.cellPos.row>=0&&("ArrowUp"===o.key||"ArrowDown"===o.key||"ArrowLeft"===o.key||"ArrowRight"===o.key)){if((null===(a=null===(s=e.options.keyboardOptions)||void 0===s?void 0:s.moveEditCellOnArrowKeys)||void 0===a||!a)&&(null===(l=e.editorManager)||void 0===l?void 0:l.editingEditor))return;let t,r;if(o.preventDefault(),o.stopPropagation(),"ArrowUp"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,r=0):(o.shiftKey,t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row-1))):"ArrowDown"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,r=e.rowCount-1):(o.shiftKey,t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1))):"ArrowLeft"===o.key?o.ctrlKey||o.metaKey?(t=0,r=i.select.cellPos.row):(o.shiftKey,r=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col-1))):"ArrowRight"===o.key&&(o.ctrlKey||o.metaKey?(t=e.colCount-1,r=i.select.cellPos.row):(o.shiftKey,r=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col+1)))),Mw(e,t,r))return;e.selectCell(t,r,o.shiftKey),null!==(d=null===(h=e.options.keyboardOptions)||void 0===h?void 0:h.moveEditCellOnArrowKeys)&&void 0!==d&&d&&(null===(c=e.editorManager)||void 0===c?void 0:c.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,r)&&e.editorManager.startEditCell(t,r))}else if("Escape"===o.key)null===(u=e.editorManager)||void 0===u||u.cancelEdit();else if("Enter"===o.key){if(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor){if(r(o),e.editorManager.completeEdit(),e.getElement().focus(),!0===(null===(p=e.options.keyboardOptions)||void 0===p?void 0:p.moveFocusCellOnEnter)){const t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(Mw(e,t,r))return;e.selectCell(t,r,o.shiftKey)}return}if(!0===(null===(f=e.options.keyboardOptions)||void 0===f?void 0:f.moveFocusCellOnEnter)){const t=i.select.cellPos.col,r=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(Mw(e,t,r))return;e.selectCell(t,r,o.shiftKey)}else if((null===(b=null===(v=e.options.keyboardOptions)||void 0===v?void 0:v.editCellOnEnter)||void 0===b||b)&&1===(null!==(C=null===(m=e.stateManager.select.ranges)||void 0===m?void 0:m.length)&&void 0!==C?C:0)){const t=e.stateManager.select.ranges[0].start.col,i=e.stateManager.select.ranges[0].start.row,o=e.stateManager.select.ranges[0].end.col,r=e.stateManager.select.ranges[0].end.row;t===o&&i===r&&e.getEditor(t,i)&&e.editorManager.startEditCell(t,i)}}else if("Tab"===o.key){if((null===(w=null===(y=e.options.keyboardOptions)||void 0===y?void 0:y.moveFocusCellOnTab)||void 0===w||w)&&(o.preventDefault(),i.select.cellPos.col>=0&&i.select.cellPos.row>=0)){let t,o;if(i.select.cellPos.col===e.colCount-1?(o=Math.min(e.rowCount-1,i.select.cellPos.row+1),t=e.rowHeaderLevelCount):i.select.cellPos.row===e.rowCount-1?(o=e.rowCount-1,t=e.rowHeaderLevelCount):(o=i.select.cellPos.row,t=i.select.cellPos.col+1),Mw(e,t,o))return;e.selectCell(t,o),(null===(x=e.editorManager)||void 0===x?void 0:x.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,o)&&e.editorManager.startEditCell(t,o))}}else if(!(o.ctrlKey||o.metaKey||o.shiftKey)){const t=e.options.editCellTrigger;if(("keydown"===t||Array.isArray(t)&&t.includes("keydown"))&&!(null===(S=e.editorManager)||void 0===S?void 0:S.editingEditor)){const t=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;o.key.match(t)&&e.editorManager.startEditCell(i.select.cellPos.col,i.select.cellPos.row,"")}}r(o)})),o.on(e.getElement(),"copy",(t=>{var i,o;if(null===(i=e.keyboardOptions)||void 0===i?void 0:i.copySelected){const i=e.getCopyValue();if(J(i)){if(t.preventDefault(),null===(o=navigator.clipboard)||void 0===o?void 0:o.write){const t=t=>{const e=["<table>"],i=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),o=t.split("\r\n");return o.forEach((function(t,i){const r=t.split("\t"),n=[];0===i&&e.push("<tbody>"),r.forEach((function(t,e){const i=t?t.toString().replace(/&/g,"&amp;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,(t=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(t.length-1)} </span>`)).replace(/\t/gi,"&#9;"):" ";n.push(`<td>${i}</td>`)})),e.push("<tr>",...n,"</tr>"),i===o.length-1&&e.push("</tbody>")})),e.push("</table>"),[i,e.join("")].join("")},e=t(i);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})])}else Ab?window.clipboardData.setData("Text",i):t.clipboardData.setData("text/plain",i);e.fireListeners(kb.COPY_DATA,{cellRange:e.stateManager.select.ranges,copyData:i})}}})),o.on(e.getElement(),"paste",(t=>{var i,o,r,n;if((null===(i=e.keyboardOptions)||void 0===i?void 0:i.pasteValueToCell)&&e.changeCellValues){if(null===(o=e.editorManager)||void 0===o?void 0:o.editingEditor)return;if((null===(r=e.stateManager.select.ranges)||void 0===r?void 0:r.length)>0)if(null===(n=navigator.clipboard)||void 0===n?void 0:n.read)navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/html")?a(e):1===e.types.length&&"text/plain"===e.types[0]&&h(e)}));else{const i=e.stateManager.select.ranges,o=Math.min(i[0].start.col,i[0].end.col),r=Math.min(i[0].start.row,i[0].end.row),n=(t.clipboardData||window.Clipboard).getData("text").split("\n"),s=[];n.forEach((function(t,e){const i=t.split("\t"),o=[];s.push(o),i.forEach((function(t,e){e===i.length-1&&(t=t.trim()),o.push(t)}))})),e.changeCellValues(o,r,s)}}})),o.on(e.getElement(),"contextmenu",(t=>{var i;!1!==(null===(i=e.eventOptions)||void 0===i?void 0:i.preventDefaultContextMenu)&&t.preventDefault()})),e.options.canvas||o.on(e.getContainer(),"resize",(t=>{var i;0===t.width&&0===t.height||((e.autoFillWidth||e.autoFillHeight)&&(null===(i=e.editorManager)||void 0===i||i.completeEdit()),J(e.options.pixelRatio)||e.setPixelRatio(VS()),t.windowSizeNotChange||e.resize())}));const n=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function a(t){const i=e.stateManager.select.ranges,o=i.length,r=Math.min(i[o-1].start.col,i[o-1].end.col),a=Math.min(i[o-1].start.row,i[o-1].end.row),h=Math.max(i[o-1].start.col,i[o-1].end.col),c=Math.max(i[o-1].start.row,i[o-1].end.row);let u=0,g=0,p=[];t.getType("text/html").then((t=>{t.text().then((t=>{var i,o;if(t&&/(<table)|(<TABLE)/g.test(t)){const l=Array.from(t.matchAll(n));for(const t of l){const e=t[1],o=Array.from(e.matchAll(s)).map((t=>t[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,"\n").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#9;/gi,"\t").replace(/&nbsp;/g," ")));p.push(o),u=Math.max(u,null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0)}g=null!==(o=p.length)&&void 0!==o?o:0,p=d(p,g,u,c-a+1,h-r+1),e.changeCellValues(r,a,p,!0)}else navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/plain")&&e.getType("text/plain").then((t=>{t.text().then(l)}))}))}))}))}function l(t){var i;const o=e.stateManager.select.ranges,r=o.length,n=Math.min(o[r-1].start.col,o[r-1].end.col),s=Math.min(o[r-1].start.row,o[r-1].end.row),a=Math.max(o[r-1].start.col,o[r-1].end.col),l=Math.max(o[r-1].start.row,o[r-1].end.row);let h=0,c=0,u=[];t.split("\n").forEach((function(t,e){var i;const o=t.split("\t"),r=[];u.push(r),o.forEach((function(t,e){e===o.length-1&&(t=t.trim()),r.push(t)})),h=Math.max(h,null!==(i=null==r?void 0:r.length)&&void 0!==i?i:0)})),c=null!==(i=u.length)&&void 0!==i?i:0,u=d(u,c,h,l-s+1,a-n+1),e.changeCellValues(n,s,u,!0)}function h(t){const i=e.stateManager.select.ranges,o=i.length,r=Math.min(i[o-1].start.col,i[o-1].end.col),n=Math.min(i[o-1].start.row,i[o-1].end.row),s=Math.max(i[o-1].start.col,i[o-1].end.col),a=Math.max(i[o-1].start.row,i[o-1].end.row);let l=0,h=0;t.getType("text/plain").then((t=>{t.text().then((t=>{var i;const o=t.replace(/\r(?!\n)/g,"\r\n").split("\r\n");let c=[];o.length>1&&""===o[o.length-1]&&o.pop(),o.forEach((function(t,e){var i;const o=t.split("\t"),r=[];c.push(r),o.forEach((function(t,e){t.includes("\n")&&(t=t.replace(/^"(.*)"$/,"$1").replace(/["]*/g,(t=>new Array(Math.floor(t.length/2)).fill('"').join("")))),r.push(t)})),l=Math.max(l,null!==(i=null==r?void 0:r.length)&&void 0!==i?i:0)})),h=null!==(i=c.length)&&void 0!==i?i:0,c=d(c,h,l,a-n+1,s-r+1),e.changeCellValues(r,n,c,!0)}))}))}function d(t,e,i,o,r){if(r>i||o>e){if(r%i==0&&o%e==0){const n=[];for(let s=0;s<o;s++){const o=[];n.push(o);for(let n=0;n<r;n++){const r=s%e,a=n%i;o.push(t[r][a])}}return n}return t}return t}const c=t=>{e.eventManager.LastBodyPointerXY={x:t.x,y:t.y},e.eventManager.isDown=!0};t.globalEventListeners.push({name:"pointerdown",env:"body",callback:c}),document.body.addEventListener("pointerdown",c);const u=t=>{e.eventManager.LastBodyPointerXY=null,e.eventManager.isDown=!1,e.eventManager.isDraging=!1,e.eventManager.inertiaScroll.endInertia(),"grabing"===i.interactionState&&i.isResizeCol()?GS(e):"grabing"===i.interactionState&&i.isResizeRow()&&jS(e)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:u}),document.addEventListener("pointerup",u);const g=o=>{var r,n,s,a,l;if(e.eventManager.isDown&&e.eventManager.LastBodyPointerXY){const t=null!==(n=null===(r=e.eventManager.LastBodyPointerXY)||void 0===r?void 0:r.x)&&void 0!==n?n:o.x,i=null!==(a=null===(s=e.eventManager.LastBodyPointerXY)||void 0===s?void 0:s.y)&&void 0!==a?a:o.y;(Math.abs(t-o.x)>1||Math.abs(i-o.y)>1)&&(e.eventManager.isDraging=!0)}const{x:h,y:d}=e._getMouseAbstractPoint(o,!1);i.interactionState===Sv.grabing&&(i.isResizeCol()?(t.dealColumnResize(h,d),e.hasListeners(kb.RESIZE_COLUMN)&&e.fireListeners(kb.RESIZE_COLUMN,{col:e.stateManager.columnResize.col,colWidth:e.getColWidth(e.stateManager.columnResize.col)})):i.isResizeRow()&&(t.dealRowResize(h,d),e.hasListeners(kb.RESIZE_ROW)&&e.fireListeners(kb.RESIZE_ROW,{row:e.stateManager.rowResize.row,rowHeight:e.getRowHeight(e.stateManager.rowResize.row)})));const c=e.stateManager.isSelecting();if(t._enableTableScroll&&t.isDraging&&c&&(null===(l=e.stateManager.select.ranges)||void 0===l?void 0:l.length)>0){const t=e.getDrawRange(),i=e.getFrozenRowsHeight(),o=e.getBottomFrozenRowsHeight(),r=e.getFrozenColsWidth(),n=e.getRightFrozenColsWidth(),s=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].start,a=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end,l=(!1===e.isFrozenRow(s.row)||!1===e.isFrozenRow(a.row))&&e.getAllRowsHeight()>e.tableNoFrameHeight,c=(!1===e.isFrozenColumn(s.col)||!1===e.isFrozenColumn(a.col))&&e.getAllColsWidth()>e.tableNoFrameWidth;if((d>t.bottom-o||d<t.top+i)&&l||(h>t.right-n||h<t.left+r)&&c){e.eventManager.scrollXSpeed=0,e.eventManager.scrollYSpeed=0;let s=!1,a=!1,u=!1,g=!1;d>t.bottom-o&&l&&e.scrollTop+e.tableNoFrameWidth<e.getAllRowsHeight()?(s=!0,e.eventManager.scrollYSpeed=-(d-t.bottom+o)/50):d<t.top+i&&l&&e.scrollTop>0&&(a=!0,e.eventManager.scrollYSpeed=-(d-t.top-i)/50),h>t.right-n&&c&&e.scrollLeft+e.tableNoFrameWidth<e.getAllColsWidth()?(u=!0,e.eventManager.scrollXSpeed=-(h-t.right+n)/50):h<t.left+r&&c&&e.scrollLeft>0&&(g=!0,e.eventManager.scrollXSpeed=-(h-t.left-r)/50),e.eventManager.inertiaScroll.startInertia(e.eventManager.scrollXSpeed,e.eventManager.scrollYSpeed,1),e.eventManager.inertiaScroll.setScrollHandle(((l,c)=>{let p,f;FS({deltaX:-l,deltaY:-c},e.stateManager,!1),s?f=e.scrollTop+t.height-o-20:a&&(f=e.scrollTop+i+20),u?p=e.scrollLeft+t.width-n-20:g&&(p=e.scrollLeft+r+20);let v=!1,b=!1;u||g||(h>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&h<e.tableNoFrameWidth||h>0&&h<e.getFrozenColsWidth()?(p=h,b=!0):p=e.scrollLeft+h),s||a||(d>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&d<e.tableNoFrameHeight||d>0&&d<e.getFrozenRowsHeight()?(f=d,v=!0):f=e.scrollTop+d),e.stateManager.updateInteractionState(Sv.grabing);const m=e.getTargetColAtConsiderRightFrozen(p,b),C=e.getTargetRowAtConsiderBottomFrozen(f,v);J(m)&&J(C)&&e.stateManager.updateSelectPos(m.col,C.row,!1,!1,!1,!0)}))}else e.eventManager.inertiaScroll.isInertiaScrolling()?e.eventManager.inertiaScroll.endInertia():e.eventManager.scrollYSpeed=0}};t.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;o.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==Sv.scrolling&&i.hideVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==Sv.scrolling&&i.hideHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.vScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.vScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1})),o.component.hScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(kb.MOUSEDOWN_TABLE)&&o.table.fireListeners(kb.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===Sv.scrolling&&i.updateInteractionState(Sv.default)})),o.component.hScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1}));const r=tb(i.updateVerticalScrollBar,20),n=tb(i.updateHorizontalScrollBar,20);o.component.vScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e,t)})),o.component.hScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==Sv.scrolling&&i.updateInteractionState(Sv.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(e)}))}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.component.vScrollBar)||e.target.isChildOf(o.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const r=o=>{var r,n;if(t.touchMove&&o.preventDefault(),t.isTouchdown&&XS(o))if((null===(n=null===(r=t.downIcon)||void 0===r?void 0:r.attribute)||void 0===n?void 0:n.funcType)===Pv.dragReorder)o.preventDefault();else if(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll){const r=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,n=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;FS({deltaX:r,deltaY:n},i),o.cancelable&&("none"===e.internalProps.overscrollBehavior||Math.abs(n)>=Math.abs(r)&&0!==n&&IS(n,i)||Math.abs(n)<=Math.abs(r)&&0!==r&&OS(r,i))&&o.preventDefault()}};window.addEventListener("touchmove",r,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"window",callback:r});const n=i=>{var o,r,n,s;if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&XS(i)){if((null===(r=null===(o=t.downIcon)||void 0===o?void 0:o.attribute)||void 0===r?void 0:r.funcType)===Pv.dragReorder)i.preventDefault();else if((null===(n=t.touchMovePoints)||void 0===n?void 0:n.length)&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[(null===(s=t.touchMovePoints)||void 0===s?void 0:s.length)-1],r=(o.x-i.x)/(o.timestamp-i.timestamp),n=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(r,n,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{FS({deltaX:-t,deltaY:-i},e.stateManager)}))}t.isTouchdown=!1,t.touchMovePoints=[]}};window.addEventListener("touchend",n),t.globalEventListeners.push({name:"touchend",env:"window",callback:n});const s=e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])};window.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}(this),NS(this)}updateEventBinder(){setTimeout((()=>{var t;this.table.isReleased||(Ox(this.table)&&0===(null===(t=this.handleTextStickBindId)||void 0===t?void 0:t.length)?(this.handleTextStickBindId.push(this.table.on(kb.SCROLL,(t=>{Hx(this.table)}))),this.handleTextStickBindId.push(this.table.on(kb.RESIZE_COLUMN_END,(t=>{Hx(this.table)}))),this.handleTextStickBindId.push(this.table.on(kb.RESIZE_ROW_END,(t=>{Hx(this.table)})))):!Ox(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach((t=>{this.table.off(t)})),this.handleTextStickBindId=[]),zS(this.table))}),0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;var e;this.table.on(kb.ICON_CLICK,(e=>{var i;const{col:o,row:r,x:n,y:s,funcType:a,icon:l,event:h}=e;if(a===Pv.dropDown)t.triggerDropDownMenu(o,r,n,s,h);else if(a===Pv.sort)t.triggerSort(o,r,l,h);else if(a===Pv.frozen)t.triggerFreeze(o,r,l);else if(a===Pv.drillDown)(d=this.table).fireListeners(PS.DRILLMENU_CLICK,d.stateManager.drill);else if(a===Pv.collapse||a===Pv.expand){const e=!!(null===(i=t.select.ranges)||void 0===i?void 0:i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,e),this.table.toggleHierarchyState(o,r)}var d})),this.table.on(kb.DROPDOWN_MENU_CLICK,(()=>{t.hideMenu()})),this.updateEventBinder(),e=this.table,"browser"===Xv.mode&&e.on(kb.CLICK_CELL,(t=>{const{col:i,row:o}=t;if("image"===t.target.type&&t.target.role&&t.target.role.startsWith("icon"))return;let r;r=e.internalProps.layoutMap.isHeader(i,o)?e.isPivotTable()?e._getHeaderLayoutMap(i,o).headerType:e.getHeaderDefine(i,o).headerType:e.getBodyColumnType(i,o);const n=e.isHeader(i,o)?e.getHeaderDefine(i,o):e.getBodyColumnDefine(i,o),s=e.getCellValue(i,o),a=e.getCellOriginValue(i,o);if("link"===r){if(!1===n.linkJump)return;const t=n.templateLink,r=!1!==n.linkDetect;let l;if(t){const r=e.getCellOriginRecord(i,o),n=Object.assign({__value:s,__dataValue:a},r),h=/\{\s*(\S+?)\s*\}/g;l=t.replace(h,((t,e)=>n[e]))}else if(r){if(!Xb.test(s))return;l=s}else l=s;const h=n.linkTarget,d=n.linkWindowFeatures;window.open(l,h,d)}else if("image"===r){const{clickToPreview:t}=n;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=new Image;i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",e.appendChild(i),document.body.appendChild(e)}else if("video"===r){const{clickToPreview:t}=n;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=document.createElement("video");i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",i.setAttribute("preload","auto"),i.setAttribute("controls","true"),e.appendChild(i),document.body.appendChild(e)}})),this.table.on(kb.DBLCLICK_CELL,(t=>{var e;if(t.federatedEvent){const i=RC(t.federatedEvent),o=this.table.scenegraph.getResizeColAt(i.abstractPos.x,i.abstractPos.y,null===(e=i.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table.eventManager.checkCellFillhandle(i))this.table.fireListeners(kb.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(o.col,o.row)&&o.col>=0){this.table.scenegraph.updateAutoColWidth(o.col),this.table.internalProps._widthResizedColMap.add(o.col),this.table.scenegraph.updateChartSizeForResizeColWidth(o.col);const t=this.table.stateManager;t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose&&t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen);const e=[];for(let t=0;t<this.table.colCount;t++)e.push(this.table.getColWidth(t));this.table.fireListeners(kb.RESIZE_COLUMN_END,{col:o.col,colWidths:e})}}})),this.table.isPivotTable()&&function(t){const e=t.internalProps.layoutMap.rowsDefine,i=t.internalProps.layoutMap.columnsDefine;for(let t=0;t<e.length;t++){const i=e[t];if("string"!=typeof i&&(i.drillDown||i.drillUp))return!0}for(let t=0;t<i.length;t++){const e=i[t];if("string"!=typeof e&&(e.drillDown||e.drillUp))return!0}return!1}(this.table)&&function(t){t.on(kb.MOUSEENTER_CELL,(e=>{const{col:i,row:o}=e;if(-1===i||-1===o)return;const r=t.internalProps.layoutMap.getHeaderDimension(i,o);(null==r?void 0:r.drillDown)||(null==r?void 0:r.drillUp)?t.stateManager.updateDrillState(r.dimensionKey,r.title,r.drillDown,r.drillUp,i,o):t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})),t.on(kb.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),zS(this.table),function(t){t.isPivotChart()&&t.scenegraph.tableGroup.addEventListener("click",(e=>{var i;if(!t.stateManager.columnMove.moving&&!t.stateManager.columnResize.resizing)if("axis-label"===e.target.name){const i=RC(e),{col:o,row:r}=i.eventArgs,n=t.internalProps.layoutMap;let s,a;n.indicatorsAsCol?(s=n.getDimensionKeyInChartSpec(n.rowHeaderLevelCount,r),a=n.getCellHeaderPaths(n.rowHeaderLevelCount-2,r).rowHeaderPaths):(s=n.getDimensionKeyInChartSpec(o,n.columnHeaderLevelCount),a=n.getCellHeaderPaths(o,n.columnHeaderLevelCount-1).colHeaderPaths);const l=a.map((t=>({key:t.dimensionKey,value:t.value}))).filter((t=>t.key));if(l.push({key:s,value:e.target.attribute.text}),t._selectedDimensionInChart.length&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].key!==e[i].key||t[i].value!==e[i].value)return!1;return!0}(t._selectedDimensionInChart,l))return;t._selectedDimensionInChart=l,n.updateDataStateToChartInstance(),aS(t.scenegraph),t.scenegraph.updateNextFrame()}else(null===(i=t._selectedDimensionInChart)||void 0===i?void 0:i.length)&&(t._selectedDimensionInChart.length=0,t.internalProps.layoutMap.updateDataStateToChartInstance(),aS(t.scenegraph),t.scenegraph.updateNextFrame())}))}(this.table),function(t){t.isPivotChart()&&(t.on(kb.MOUSEENTER_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=YS(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(kb.MOUSEENTER_AXIS,e)}}))})),t.on(kb.MOUSELEAVE_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=YS(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(kb.MOUSELEAVE_AXIS,e)}}))})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,r;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:n}=t;if(n){if("checkbox"===n.target.name||"radio"===n.target.name)return!1;const s=this.table.getBodyColumnDefine(n.col,n.row);return this.table.isHeader(n.col,n.row)&&((null==s?void 0:s.disableHeaderSelect)||(null===(i=this.table.stateManager.select)||void 0===i?void 0:i.disableHeader))||!this.table.isHeader(n.col,n.row)&&(null==s?void 0:s.disableSelect)?(e||this.table.stateManager.updateSelectPos(-1,-1),!1):!this.table.isPivotChart()||"axis-label"!==(null===(o=null==t?void 0:t.eventArgs)||void 0===o?void 0:o.target.name)&&"chart"!==(null===(r=null==t?void 0:t.eventArgs)||void 0===r?void 0:r.target.type)?(this.table.stateManager.updateSelectPos(n.col,n.row,n.event.shiftKey,n.event.ctrlKey||n.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:r}=t;if(r){if((null===(o=null===(i=this.table.stateManager.select)||void 0===i?void 0:i.ranges)||void 0===o?void 0:o.length)&&this.table.stateManager.isFillHandle()){let i,o;const n=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(J(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(i=r.row,o=n.end.col):(i=n.end.row,o=r.col)),this.table.stateManager.updateSelectPos(e?o:n.end.col,e?i:n.end.row,!0,r.event.ctrlKey||r.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(r.col,r.row,r.event.shiftKey,r.event.ctrlKey||r.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0)}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t;if(this.table.options.enableTreeStickCell&&!i)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,null==i?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,r,n;if(null===(i=this.table.options.excelOptions)||void 0===i?void 0:i.fillHandle){const{eventArgs:i}=t;if(i&&(null===(r=null===(o=this.table.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===r?void 0:r.length)){const i=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),o=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),r=this.table.scenegraph.highPerformanceGetCell(i,o).globalAABBBounds,s=Math.abs(t.abstractPos.x-r.x2),a=Math.abs(t.abstractPos.y-r.y2),l=18;if((null===(n=this.table.stateManager.fillHandle)||void 0===n?void 0:n.isFilling)||s<=l/2&&a<=l/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i;const{eventArgs:o}=t;return!!(o&&this.table.isHeader(o.col,o.row)&&(function(t,e,i){for(let o=0;o<i.length;o++)if(xb(i[o],t,e))return!0;return!1}(o.col,o.row,this.table.stateManager.select.ranges)||(null===(e=this.table.options.select)||void 0===e?void 0:e.disableHeaderSelect)||(null===(i=this.table.options.select)||void 0===i?void 0:i.disableSelect))&&this.table._canDragHeaderPosition(o.col,o.row))&&(this.table.stateManager.startMoveCol(o.col,o.row,t.abstractPos.x,t.abstractPos.y),!0)}dealColumnMover(t){const{eventArgs:e}=t;J(e.col)&&J(e.row)&&this.table.stateManager.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:r,col:n,row:s}=i||{target:t.target,event:t,col:-1,row:-1},a=o;if(a.role&&a.role.startsWith("icon-"))return this.table.fireListeners(kb.ICON_CLICK,{name:a.name,x:(a.globalAABBBounds.x1+a.globalAABBBounds.x2)/2,y:a.globalAABBBounds.y2,col:n,row:s,funcType:a.attribute.funcType,icon:a,event:r}),!0;if(o instanceof bd){const t=o.pickIcon(r.global);if(t)return this.table.fireListeners(kb.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:n,row:s,funcType:t.attribute.funcType,icon:t,event:r}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}(this),e.legends){q.legends=[];const t=hm.getFunction("createLegend");if(Array.isArray(e.legends)){for(let i=0;i<e.legends.length;i++)q.legends.push(t(e.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else q.legends.push(t(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(q.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),"html"===q.tooltip.renderMode){const t=hm.getComponent("tooltipHandler");t&&(q.tooltipHandler=new t(this,q.tooltip.confine))}if(q.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray(null===(l=e.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=e.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=e.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),"html"===q.menu.renderMode){const t=hm.getComponent("menuHandler");q.menuHandler=new t(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,q.stick={changedCells:new Map},q.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new f_(this,null!==(c=e.customCellStyle)&&void 0!==c?c:[],null!==(u=e.customCellStyleArrangement)&&void 0!==u?u:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.options.canvasHeight=e,this.options.canvasWidth=t,this.resize()}resize(){var t;this._updateSize(),null===(t=this.internalProps.legends)||void 0===t||t.forEach((t=>{null==t||t.resize()})),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return null!==(t=this.internalProps.colCount)&&void 0!==t?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenColCount)&&void 0!==r?r:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenRowCount)&&void 0!==r?r:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.rightFrozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.rightFrozenColCount)&&void 0!==r?r:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,r;return null!==(r=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.bottomFrozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.bottomFrozenRowCount)&&void 0!==r?r:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return null!==(t=this.internalProps.keyboardOptions)&&void 0!==t?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=null!=t?t:void 0}get eventOptions(){var t;return null!==(t=this.internalProps.eventOptions)&&void 0!==t?t:null}set eventOptions(t){this.internalProps.eventOptions=null!=t?t:void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return"auto"===t?0:yC(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=yC(this,e.min),i.minDef=e.min),e.max&&(i.max=yC(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(function(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return"node"===Xv.mode?e/(null!=t?t:1):this._.canvas.width/(null!==(i=this._.context.pixelRatio)&&void 0!==i?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m,C,y,w,x,S,_,A;const{padding:R}=this;let B=0,M=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)B=this.options.viewBox.x2-this.options.viewBox.x1,M=this.options.viewBox.y2-this.options.viewBox.y1,(null===(t=null==this?void 0:this.scenegraph)||void 0===t?void 0:t.stage)&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(B,M));else if("browser"===Xv.mode){const t=this.getElement();let s=0,a=0;if(this.canvasSizeSeted)s=this.canvasWidth,a=this.canvasHeight;else if(t.parentElement){const e=t.parentElement.style||window.getComputedStyle(t.parentElement);s=t.parentElement.offsetWidth-parseInt(e.paddingLeft||"0px",10)-parseInt(e.paddingRight||"0px",10),a=t.parentElement.offsetHeight-parseInt(e.paddingTop||"0px",10)-parseInt(e.paddingBottom||"0px",20)}const l=null!=s?s:0,h=null!=a?a:0;t.style.width=l&&l-R.left-R.right+"px"||"0px",t.style.height=h&&h-R.top-R.bottom+"px"||"0px";const{canvas:d}=this.internalProps;B=null!==(i=null===(e=d.parentElement)||void 0===e?void 0:e.offsetWidth)&&void 0!==i?i:0,M=null!==(r=null===(o=d.parentElement)||void 0===o?void 0:o.offsetHeight)&&void 0!==r?r:0,(null===(n=null==this?void 0:this.scenegraph)||void 0===n?void 0:n.stage)?this.scenegraph.stage.resize(B,M):(d.style.width="",d.style.height="",d.width=B,d.height=M,d.style.width=`${B}px`,d.style.height=`${M}px`),this.internalProps.bodyDomContainer&&(this.internalProps.bodyDomContainer.style.width=`${B}px`,this.internalProps.bodyDomContainer.style.height=`${M}px`),this.internalProps.headerDomContainer&&(this.internalProps.headerDomContainer.style.width=`${B}px`,this.internalProps.headerDomContainer.style.height=`${M}px`)}else"node"===Xv.mode&&(B=this.canvasWidth-1,M=this.canvasHeight-1);const T=Math.floor(B-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.verticalVisible)||!(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle)),P=Math.floor(M-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.horizontalVisible)||!(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle));if(null===(s=this.internalProps.theme)||void 0===s?void 0:s.frameStyle){const t=B_(null!==(l=null===(a=this.internalProps.theme.frameStyle)||void 0===a?void 0:a.borderLineWidth)&&void 0!==l?l:[null]),e=B_(null!==(d=null===(h=this.internalProps.theme.frameStyle)||void 0===h?void 0:h.shadowBlur)&&void 0!==d?d:[0]);(null===(c=this.theme.frameStyle)||void 0===c?void 0:c.innerBorder)?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=T-(null!==(u=e[1])&&void 0!==u?u:0),this.tableNoFrameHeight=P-(null!==(g=e[2])&&void 0!==g?g:0)):(this.tableX=(null!==(p=t[3])&&void 0!==p?p:0)+(null!==(f=e[3])&&void 0!==f?f:0),this.tableY=(null!==(v=t[0])&&void 0!==v?v:0)+(null!==(b=e[0])&&void 0!==b?b:0),this.tableNoFrameWidth=T-((null!==(m=t[1])&&void 0!==m?m:0)+(null!==(C=e[1])&&void 0!==C?C:0))-((null!==(y=t[3])&&void 0!==y?y:0)+(null!==(w=e[3])&&void 0!==w?w:0)),this.tableNoFrameHeight=P-((null!==(x=t[0])&&void 0!==x?x:0)+(null!==(S=e[0])&&void 0!==S?S:0))-((null!==(_=t[2])&&void 0!==_?_:0)+(null!==(A=e[2])&&void 0!==A?A:0)))}}updateViewBox(t){var e,i,o,r,n,s,a,l;const h=null!==(r=null!==(i=null===(e=this.options)||void 0===e?void 0:e.viewBox.x2)&&void 0!==i?i:0-(null===(o=this.options)||void 0===o?void 0:o.viewBox.x1))&&void 0!==r?r:0,d=null!==(l=null!==(s=null===(n=this.options)||void 0===n?void 0:n.viewBox.y2)&&void 0!==s?s:0-(null===(a=this.options)||void 0===a?void 0:a.viewBox.y1))&&void 0!==l?l:0,c=t.x2-t.x1,u=t.y2-t.y1;this.options.viewBox=t,h!==c||d!==u?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,i,o,r,n){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,i,o,r,n)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.colCount)&&void 0!==i?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=o)return o;const r=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=r){const i=r+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(i)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(i)),Math.round(i)}let n=0;for(let i=t;i<=e;i++)n+=this.getColWidth(i);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(n)),Math.round(n)}getRowHeight(t){var e;if(J(this.rowHeightsMap.get(t))){if(null===(e=this.options.customConfig)||void 0===e?void 0:e._disableColumnAndRowSizeRound){const e=this.rowHeightsMap.get(t);let i;return i=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),i=Number(i.toFixed(2)),Number.isInteger(i)?Math.ceil(e):Math.floor(e)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return at(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?null!==(e=this.defaultHeaderColWidth[t])&&void 0!==e?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?null!==(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])&&void 0!==i?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(e=this.defaultHeaderRowHeight[t])&&void 0!==e?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])&&void 0!==i?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||0===this.rowCount)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.rowCount)&&void 0!==i?i:1/0)-1);let r=0;if("standard"!==this.heightMode||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||0!==this.internalProps._heightResizedRowMap.size){if(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound){const i=this.rowHeightsMap.getSumInRange(t,e);let o;return o=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),o=Number(o.toFixed(2)),Number.isInteger(o)?Math.ceil(i):Math.floor(i)}r=this.rowHeightsMap.getSumInRange(t,e)}else{for(let i=t;i<Math.min(e+1,this.columnHeaderLevelCount);i++)r+=this.getRowHeight(i);e>=this.columnHeaderLevelCount&&(r+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let t=this.rowCount-this.bottomFrozenRowCount;t<e+1;t++)r+=this.getRowHeight(t)}return Math.round(r)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if("autoWidth"===this.widthMode)return"auto";const{width:o}=null!==(e=null==i?void 0:i.getColumnWidthDefined(t))&&void 0!==e?e:{};return"number"==typeof o&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return"autoHeight"===this.heightMode||t>=0&&t<this.columnHeaderLevelCount&&"auto"===this.getDefaultRowHeight(t)}getColWidth(t){var e;const i=null!==(e=this.colWidthsMap.get(t))&&void 0!==e?e:this.getDefaultColumnWidth(t);return"adaptive"===this.widthMode&&"number"==typeof i||this.transpose&&"number"==typeof i?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.scenegraph.updateChartSizeForResizeColWidth(t),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const e=T_.exec(i);if(e){const o=Number(e[1]),r=Number(e[2]);t>=o&&t<=r&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.max)&&void 0!==e?e:1/0;return"string"==typeof o&&(o=yC(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.min)&&void 0!==e?e:0;return"string"==typeof o&&(o=yC(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const r=this.isFrozenCell(t,e);let n;const s=this.getColWidth(t);let a;n=r&&r.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-(null!==(i=this.getColsWidth(t,this.colCount-1))&&void 0!==i?i:0):this.getColsWidth(0,t-1)||0;const l=this.getRowHeight(e);return a=r&&r.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-(null!==(o=this.getRowsHeight(e,this.rowCount-1))&&void 0!==o?o:0):this.getRowsHeight(0,e-1),new Ib(Math.round(n),Math.round(a),Math.round(s),Math.round(l))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,r=this.getColsWidth(i.start.col,i.end.col),n=this.getRowsHeight(0,i.start.row-1)||0,s=this.getRowsHeight(i.start.row,i.end.row);return new Ib(Math.round(o),Math.round(n),Math.round(r),Math.round(s))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,r=!0;(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,r=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(r=!1);const n=this.getCellRect(t,e);return this._toRelativeRect(n,o,r)}getCellRangeRelativeRect(t){if(t.start){const e=this.isFrozenCell(t.start.col,t.start.row);let i=!0,o=!0;return(null==e?void 0:e.col)&&(null==e?void 0:e.row)?(i=!1,o=!1):(null==e?void 0:e.col)?i=!1:(null==e?void 0:e.row)&&(o=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),i,o)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,r=!0;return(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,r=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(r=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,r)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=i,r.right=o;const n=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,s=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=n,r.bottom=s,r}getCellsRect(t,e,i,o){var r,n,s,a,l,h;let d=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const u=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-(null!==(r=this.getColsWidth(t+1,this.colCount-1))&&void 0!==r?r:0)-d:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-u,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(d=Math.min(d-u,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-(null!==(n=this.getColsWidth(t+1,this.colCount-1))&&void 0!==n?n:0)-d):this.isRightFrozenColumn(t)&&(d=this.tableNoFrameWidth-(null!==(s=this.getColsWidth(t,this.colCount-1))&&void 0!==s?s:0));let g=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const f=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-(null!==(a=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==a?a:0)-g:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-f,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(g=Math.min(g-f,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-(null!==(l=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==l?l:0)-g):this.isBottomFrozenRow(e)&&(g=this.tableNoFrameHeight-(null!==(h=this.getRowsHeight(e,this.rowCount-1))&&void 0!==h?h:0)),new Ib(Math.round(d),Math.round(g),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const r=this.isFrozenCell(t,e),n=this.isFrozenCell(i,o);let s=this.getColsWidth(t,i);if(r&&r.col){const e=this.scrollLeft;n&&n.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}return s}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return C_(t,this)}getColAt(t){return y_(t,this)}getCellAt(t,e){return function(t,e,i){const o=C_(e,i),{row:r,top:n,bottom:s,height:a}=o,l=y_(t,i),{col:h,left:d,right:c,width:u}=l;return{row:r,col:h,rect:{left:d,right:c,top:n,bottom:s,width:u,height:a}}}(t,e,this)}getCellAtRelativePosition(t,e){return function(t,e,i){t-=i.tableX;let o=!1;(e-=i.tableY)>0&&e<i.getFrozenRowsHeight()&&(o=!0);let r=!1;t>0&&t<i.getFrozenColsWidth()&&(r=!0);let n=!1;e>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&e<i.tableNoFrameHeight&&e<=i.getAllRowsHeight()&&(n=!0);let s=!1;t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth()&&(s=!0);const a=S_(r||s?t:t+i.scrollLeft,s,i),l=__(o||n?e:e+i.scrollTop,n,i);if(a&&l){const{row:t,top:e,bottom:i,height:o}=l,{col:r,left:n,right:s,width:h}=a;return{row:t,col:r,rect:{left:n,right:s,top:e,bottom:i,width:h,height:o}}}return{col:-1,row:-1}}(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),r=function(t){let e=0,i=0;t.frozenColCount>0&&(e=t.getFrozenColsWidth()),t.rightFrozenColCount>0&&(i=t.getRightFrozenColsWidth());let o=0,r=0;return t.frozenRowCount>0&&(o=t.getFrozenRowsHeight()),t.bottomFrozenRowCount>0&&(r=t.getBottomFrozenRowsHeight()),new Ib(t.scrollLeft+e,t.scrollTop+o,t.tableNoFrameWidth-e-i,t.tableNoFrameHeight-o-r)}(this);if(r.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<r.left?this.scrollLeft-=r.left-o.left:r.right<o.right&&(this.scrollLeft-=r.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<r.top?this.scrollTop-=r.top-o.top:r.bottom<o.bottom&&(this.scrollTop-=r.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise(((t,e)=>{setTimeout((()=>{t()}),0)}))}_toRelativeRect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,r,n,s;const a=t.copy(),l=this.getVisibleRect();return a.offsetLeft(this.tableX-(e?l.left:0)),a.offsetTop(this.tableY-(i?l.top:0)),a.offsetLeft(null!==(r=null===(o=this.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==r?r:0),a.offsetTop(null!==(s=null===(n=this.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==s?s:0),a}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new Ib(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const r=Math.max(o.top>=i?o.row:o.row+1,t);let n=this.getRowsHeight(0,r-1),s=0;const{rowCount:a}=this;for(let t=r;t<a;t++){const i=n+this.getRowHeight(t);if(e.bottom<i)break;s++,n=i}return s}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),r=this.getBottomFrozenRowsHeight(),n=this.getRightFrozenColsWidth(),{row:s}=this.getRowAt(t+i+1),{col:a}=this.getColAt(e+o+1),l=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-r).row:this.rowCount-1,h=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-n).col:this.colCount-1;return h<0||l<0?null:{rowStart:s,colStart:a,rowEnd:l,colEnd:h}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),r=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return r<0?null:{rowStart:o,rowEnd:r}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),r=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return r<0?null:{colStart:o,colEnd:r}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const r=Math.max(o.left>=i?o.col:o.col+1,t);let n=this.getColsWidth(0,r-1),s=0;const{colCount:a}=this;for(let t=r;t<a;t++){const i=n+this.getColWidth(t);if(e.right<i)break;s++,n=i}return s}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||"function"!=typeof t.release)throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f;const v=this.internalProps;null===(e=null===(t=v.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),null===(o=null===(i=v.menuHandler)||void 0===i?void 0:i.release)||void 0===o||o.call(i),WC.clearAll(),null===(r=super.release)||void 0===r||r.call(this),null===(s=null===(n=v.handler)||void 0===n?void 0:n.release)||void 0===s||s.call(n),this.eventManager.release(),null===(l=null===(a=v.focusControl)||void 0===a?void 0:a.release)||void 0===l||l.call(a),null===(h=v.legends)||void 0===h||h.forEach((t=>{null==t||t.release()})),null===(d=v.title)||void 0===d||d.release(),v.title=null,null===(c=v.emptyTip)||void 0===c||c.release(),v.emptyTip=null,v.layoutMap.release(),v.releaseList&&(v.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),v.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),v.focusControl.release();const{parentElement:b}=v.element;b&&!this.options.canvas&&b.removeChild(v.element),null===(p=null===(g=null===(u=this.editorManager)||void 0===u?void 0:u.editingEditor)||void 0===g?void 0:g.onEnd)||void 0===p||p.call(g),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,null===(f=this.reactCustomLayout)||void 0===f||f.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,r,n,s,a,l,h,d,c,u;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:g=0,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:b=80,keyboardOptions:m,eventOptions:C,rowSeriesNumber:y,columnResizeMode:w,rowResizeMode:x="none",dragHeaderMode:S,showFrozenIcon:_,allowFrozenColCount:A,padding:R,hover:B,menu:M,select:T,pixelRatio:P,widthMode:k,heightMode:L,autoFillWidth:H,autoFillHeight:E,widthAdaptiveMode:z,heightAdaptiveMode:F,customRender:I,renderChartAsync:O,renderChartAsyncBatchCount:D,overscrollBehavior:W,limitMinWidth:N,limitMinHeight:G}=t;P&&P!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=P),R&&("number"==typeof R?(this.padding.top=R,this.padding.left=R,this.padding.bottom=R,this.padding.right=R):(R.top&&(this.padding.top=R.top),R.bottom&&(this.padding.bottom=R.bottom),R.left&&(this.padding.left=R.left),R.right&&(this.padding.right=R.right))),this.showFrozenIcon="boolean"!=typeof _||_,"number"==typeof A&&A<=0&&(this.showFrozenIcon=!1),this.widthMode=null!=k?k:"standard",this.heightMode=null!=L?L:"standard",this._widthAdaptiveMode=null!=z?z:"only-body",this._heightAdaptiveMode=null!=F?F:"only-body",this.autoFillWidth=null!=H&&H,this.autoFillHeight=null!=E&&E,this.customRender=I;const j=this.internalProps;if("node"===Xv.mode||t.canvas||function(t,e){var i,o;t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const r=(t.offsetWidth||(null===(i=t.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,n=(t.offsetHeight||(null===(o=t.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;t.style.width=r&&r-e.left-e.right+"px"||"0px",t.style.height=n&&n-e.top-e.bottom+"px"||"0px"}(j.element,this.padding),this.columnWidthComputeMode=null!==(e=t.columnWidthComputeMode)&&void 0!==e?e:"normal",j.frozenColCount=g,j.defaultRowHeight=p,j.defaultHeaderRowHeight=null!=f?f:p,j.defaultColWidth=v,j.defaultHeaderColWidth=null!=b?b:v,j.keyboardOptions=m,j.eventOptions=C,j.rowSeriesNumber=y,j.columnResizeMode=w,j.rowResizeMode=x,j.dragHeaderMode=null!=S?S:"none",j.renderChartAsync=O,fw(D),j.overscrollBehavior=null!=W?W:"auto",j.cellTextOverflows={},j._rowHeightsMap=new u_(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new Fb,this.colContentWidthsMap=new Fb,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=am.of(null!==(i=t.theme)&&void 0!==i?i:am.DEFAULT),j.theme.isPivot=this.isPivotTable(),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=null!==(o=t.allowFrozenColCount)&&void 0!==o?o:0,j.limitMaxAutoWidth=null!==(r=t.limitMaxAutoWidth)&&void 0!==r?r:450,j.limitMinWidth=null!=N?"number"==typeof N?N:N?10:0:10,j.limitMinHeight=null!=G?"number"==typeof G?G:G?10:0:10,null===(n=j.legends)||void 0===n||n.forEach((t=>{null==t||t.release()})),null===(s=j.title)||void 0===s||s.release(),j.title=null,null===(a=j.emptyTip)||void 0===a||a.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const e=hm.getFunction("createLegend");if(Array.isArray(t.legends)){for(let i=0;i<t.legends.length;i++)j.legends.push(e(t.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(e(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===j.tooltip.renderMode&&!j.tooltipHandler){const t=hm.getComponent("tooltipHandler");j.tooltipHandler=new t(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(null===(l=t.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=t.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=t.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===j.menu.renderMode&&!j.menuHandler){const t=hm.getComponent("menuHandler");j.menuHandler=new t(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell(null!==(c=t.customCellStyle)&&void 0!==c?c:[],null!==(u=t.customCellStyleArrangement)&&void 0!==u?u:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new Ib(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,r,n;let s;if(!t)return{inTable:!1,x:void 0,y:void 0};s=M_(t)?t.changedTouches[0]:t;const a=s.clientX||s.pageX+window.scrollX,l=s.clientY||s.pageY+window.scrollY,h=this.internalProps.canvas.getBoundingClientRect();let d=!0;h.right<=a&&(d=!1),h.bottom<=l&&(d=!1);const c=h.width,u=c/(this.canvas.offsetWidth||c),g=h.height,p=g/(this.canvas.offsetHeight||g),f={x:(a-h.left)/u+(e?this.scrollLeft:0)-(null!==(o=null===(i=this.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0),y:(l-h.top)/p+(e?this.scrollTop:0)-(null!==(n=null===(r=this.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==n?n:0),inTable:d};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(f,f),f}getTheme(){return this.internalProps.theme}getTargetColAt(t){return w_(t,this)}getTargetRowAt(t){return x_(t,this)}getTargetColAtConsiderRightFrozen(t,e){return S_(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return __(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];var n;const s=!!(null===(n=this.stateManager.select.ranges)||void 0===n?void 0:n.length);this.stateManager.updateSelectPos(t,e,i,o,!1,!r),this.stateManager.endSelectCells(!0,s)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach(((t,e)=>{t.start.col===t.end.col&&t.start.row===t.end.row?this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0):(this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0),this.stateManager.updateInteractionState(Sv.grabing),this.stateManager.updateSelectPos(t.end.col,t.end.row,!1,e>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(Sv.default)})),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return null===(t=this.records)||void 0===t?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),CC(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=am.of(null!=t?t:am.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=am.of(null!=t?t:am.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return null==i?void 0:i.define}getBodyColumnType(t,e){var i,o;return VC("cellType",{cellType:null!==(o=null===(i=this.internalProps.layoutMap.getBody(t,e))||void 0===i?void 0:i.cellType)&&void 0!==o?o:"text"},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,VC("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return null==i?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find((e=>e&&e.field===t.field));if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(J(i.text)||i.customLayout||i.customRender))return i.range}return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(J(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),r=Vv(i.style,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=r}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),r=null==o?void 0:o.define,n=null!==(i=null==r?void 0:r.description)&&void 0!==i?i:null==o?void 0:o.description;return"function"==typeof n?n({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):n}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:null==i?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(null==t)return!1;if(this.internalProps.layoutMap.isHeader(e,i))return!1;const r=this.getRecordShowIndexByCell(e,i);return null===(o=this.internalProps.dataSource)||void 0===o?void 0:o.hasField(r,t)}_getCellStyle(t,e){return function(t,e,i){var o,r,n,s,a,l,h,d,c;const u=i.customCellStylePlugin.getCustomCellStyle(t,e),{layoutMap:g}=i.internalProps;if(g.isHeader(t,e)){let a;if(!i.isPivotTable()||i.isBottomFrozenRow(e)||i.isRightFrozenColumn(t))a=`${t}-${e}`;else{const o=i.getHeaderDefine(t,e),r=i.isCornerHeader(t,e);a=(null==o?void 0:o.dimensionKey)?r?`dim-cor-${o.dimensionKey}`:`dim-${o.dimensionKey}`:(null==o?void 0:o.indicatorKey)?`ind-${o.indicatorKey}`:`${t}-${e}`}let l=i.headerStyleCache.get(a);if(l)return u?v_(l,u):l;const h=g.getHeader(t,e);let d;if(i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0}else if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;return!1}(t,e,g)&&g.isAxisCell(t,e)?d=null!==(r=null===(o=g.getBody(t,i.rowHeaderLevelCount).style)||void 0===o?void 0:o.padding)&&void 0!==r?r:i.theme.bodyStyle.padding:i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0;if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}return!1}(t,e,g)&&g.isAxisCell(t,e)&&(d=null!==(s=null===(n=g.getBody(i.columnHeaderLevelCount,e).style)||void 0===n?void 0:n.padding)&&void 0!==s?s:i.theme.bodyStyle.padding),(!h||h.isEmpty)&&(g.isLeftBottomCorner(t,e)||g.isRightBottomCorner(t,e)||g.isCornerHeader(t,e)||g.isRightTopCorner(t,e)))return R_;const c=i.internalProps.headerHelper.getStyleClass((null==h?void 0:h.headerType)||"text");if(g.isBottomFrozenRow(t,e)&&i.theme.bottomFrozenStyle)l=h_(d?{padding:d}:{},i.theme.bottomFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else if(g.isRightFrozenColumn(t,e)&&i.theme.rightFrozenStyle)l=h_(d?{padding:d}:{},i.theme.rightFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else{const o=(null==h?void 0:h.style)||{};d&&(o.padding=d),l=h_(o,g.isColumnHeader(t,e)||g.isBottomFrozenRow(t,e)?i.theme.headerStyle:g.isRowHeader(t,e)||g.isRightFrozenColumn(t,e)?i.theme.rowHeaderStyle:i.theme.cornerHeaderStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme)}return i.headerStyleCache.set(a,l),u?v_(l,u):l}let p,f;(null===(l=null===(a=i.internalProps)||void 0===a?void 0:a.dataConfig)||void 0===l?void 0:l.mappingRules)&&!i.isHeader(t,e)&&(null===(c=null===(d=null===(h=i.internalProps)||void 0===h?void 0:h.dataConfig)||void 0===d?void 0:d.mappingRules)||void 0===c||c.forEach(((o,r)=>{o.bgColor&&i.internalProps.layoutMap.getIndicatorKey(t,e)===o.bgColor.indicatorKey&&(p=o.bgColor.mapping)})));const v=i.getCellType(t,e),b=i.getCellOriginRecord(t,e);let m;if(f=(null==b?void 0:b.vtableMerge)?"merge-title":i.isSeriesNumberInBody(t,e)?`${t}-series-`+v:i.isListTable()&&!i.transpose||i.isPivotTable()&&i.internalProps.layoutMap.indicatorsAsCol?t+v:e+v,m=(null==b?void 0:b.vtableMerge)?i.bodyMergeTitleCache.get(f):g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.get(f):i.bodyStyleCache.get(f),m)return u?v_(m,u):m;const C=g.getBody(t,e),y=i.internalProps.bodyHelper.getStyleClass(i.getCellType(t,e)),w=null==C?void 0:C.style;return m=Vv(w,(null==b?void 0:b.vtableMerge)&&i.theme.groupTitleStyle?i.theme.groupTitleStyle:g.isBottomFrozenRow(e)&&i.theme.bottomFrozenStyle?i.theme.bottomFrozenStyle:g.isRightFrozenColumn(t)&&i.theme.rightFrozenStyle?i.theme.rightFrozenStyle:i.theme.bodyStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},y,i.options.autoWrapText,i.theme),p&&(m=v_(m,{bgColor:p})),q(w)||(g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.set(f,m):i.bodyStyleCache.set(f,m)),u?v_(m,u):m}(t,e,this)}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyMergeTitleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t,e+1))return!1;if("none"===this.internalProps.rowResizeMode)return!1;if("header"===this.internalProps.rowResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.rowResizeMode&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||(null===(i=this.options.select)||void 0===i?void 0:i.disableHeaderSelect)||(null===(o=this.options.select)||void 0===o?void 0:o.disableSelect))){if("disabled"===this.internalProps.frozenColDragHeaderMode&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const i=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(i.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(i.end.col!==this.colCount-1)return!1}}const i=this.getHeaderDefine(t,e);if(!i)return!1;if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){var i,o;let r;if(this.isHeader(t,e))r=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){(null===(o=null===(i=this.internalProps.layoutMap.getSeriesNumberBody(t,e))||void 0===i?void 0:i.define)||void 0===o?void 0:o.dragOrder)&&(r=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const n=this.getCellValue(t,e),s=this.getCellOriginValue(t,e),a=this.internalProps.context,l=this.internalProps.bodyHelper.getIcons(t,e,n,s,a);(null==r?void 0:r.length)>0?r=r.concat():(null==l?void 0:l.length)>0&&(r=l)}else{const i=this.getCellValue(t,e),o=this.getCellOriginValue(t,e),n=this.internalProps.context;r=this.internalProps.bodyHelper.getIcons(t,e,i,o,n)}return r}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=wC(i,this,t,e,VC).theme,{autoWrapText:r,lineClamp:n,textOverflow:s}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:K(o.group.fill)?VC("bgColor",i,t,e,this):o.group.fill,color:K(o.text.fill)?VC("color",i,t,e,this):o.text.fill,strokeColor:K(o.text.stroke)?VC("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:null!=r&&r,lineClamp:null!=n?n:"auto",textOverflow:s,borderColor:K(o.group.stroke)?VC("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:VC("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,r=this.colCount-1,n=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,n-o+1,this.rowCount)).fill(0).map(((e,n)=>Array(Math.min(null!=t?t:2e3,r-i+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+i,n+o)))))}getAllCells(t,e){const i=this.colCount-1,o=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,o-0+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(null!=t?t:2e3,i-0+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+0,o+0)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-0+1).fill(0).map(((i,o)=>Array(e-t+1).fill(0).map(((e,i)=>this.getCellInfo(i+t,o+0)))))}getAllRowHeaderCells(){const t=this.columnHeaderLevelCount,e=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-t+1).fill(0).map(((i,o)=>Array(e-0+1).fill(0).map(((e,i)=>this.getCellInfo(i+0,o+t)))))}scrollToCell(t){const e=this.getDrawRange();if(J(t.col)&&t.col>=this.frozenColCount){const i=this.getFrozenColsWidth(),o=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(o-i,this.getAllColsWidth()-e.width)}if(J(t.row)&&t.row>=this.frozenRowCount){const i=this.getFrozenRowsHeight(),o=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(o-i,this.getAllRowsHeight()-e.height)}this.render()}getCopyValue(){var t,e,i;if((null===(e=null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0){const t=this.stateManager.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),o=Math.max(t[0].start.col,t[0].end.col),r=Math.min(t[0].start.row,t[0].end.row),n=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),r=Math.min(r,t.start.row,t.end.row),n=Math.max(n,t.start.row,t.end.row)}));const s=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row);o<=e&&r>=e&&(i=!0)})),i},a=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.col,t.end.col),r=Math.max(t.start.col,t.end.col);o<=e&&r>=e&&(i=!0)})),i},l=(e,i)=>{let o;return t.forEach((t=>{const r=Math.min(t.start.row,t.end.row),n=Math.max(t.start.row,t.end.row),s=Math.min(t.start.col,t.end.col),a=Math.max(t.start.col,t.end.col);s<=e&&a>=e&&r<=i&&n>=i&&(o=t)})),o},h=(t,e,i)=>{const o=this.getCellRange(t,e);let r=o.start.col,n=o.start.row;if(i){const t=Math.min(i.start.col,i.end.col),e=Math.min(i.start.row,i.end.row);r=Math.max(t,o.start.col),n=Math.max(e,o.start.row)}return r!==t||n!==e?"":this.getCellValue(t,e)};let d="";for(let t=r;t<=n;t++)if(s(t)){for(let i=e;i<=o;i++)if(a(i)){const e=l(i,t);if(e){const r=h(i,t,e);if("undefined"!=typeof Promise&&r instanceof Promise);else{const t=J(r)?`${r}`:"";/^\[object .*\]$/.exec(t)||(d+=t)}(i<e.end.col||i<o)&&(d+="\t")}else d+="\t"}t<n&&(d+="\r\n")}return(null===(i=this.options)||void 0===i?void 0:i.formatCopyValue)&&(d=this.options.formatCopyValue(d)),d}return""}getSelectedCellInfos(){var t;if(!(null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),r=Math.min(e[0].start.row,e[0].end.row),n=Math.max(e[0].start.row,e[0].end.row);e.forEach((t=>{i=Math.min(i,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),r=Math.min(r,t.start.row,t.end.row),n=Math.max(n,t.start.row,t.end.row)}));const s=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.row,e.end.row),r=Math.max(e.start.row,e.end.row);o<=t&&r>=t&&(i=!0)})),i},a=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.col,e.end.col),r=Math.max(e.start.col,e.end.col);o<=t&&r>=t&&(i=!0)})),i},l=(t,i)=>{let o;return e.forEach((e=>{const r=Math.min(e.start.row,e.end.row),n=Math.max(e.start.row,e.end.row),s=Math.min(e.start.col,e.end.col),a=Math.max(e.start.col,e.end.col);s<=t&&a>=t&&r<=i&&n>=i&&(o=e)})),o},h=[];for(let t=r;t<=n;t++)if(s(t)){const e=[];for(let r=i;r<=o;r++)if(a(r)&&l(r,t)){const i=this.getCellInfo(r,t);e.push(i)}h.push(e)}return h}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?mt(t):[]}measureText(t,e){return Cy.measureText(t,e)}measureTextBounds(t){return wy(t)}getCustomRender(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(null==o?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=null==o?void 0:o.customLayout}return i}hasAutoImageColumn(){return void 0===this._hasAutoImageColumn&&(this._hasAutoImageColumn=function(t){const{columns:e,rows:i,indicators:o}=t.options;if(t.isPivotTable()){if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!ot(i)&&("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}if(rt(i)&&i.length>0)for(let t=0;t<i.length;t++){const e=i[t];if(!ot(e)&&("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing)return!0}if(rt(o)&&o.length>0)for(let t=0;t<o.length;t++){const e=o[t];if(!ot(e)&&(("image"===e.cellType||"video"===e.cellType||"function"==typeof e.cellType)&&e.imageAutoSizing||("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing))return!0}}else if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(("image"===i.cellType||"video"===i.cellType||"function"==typeof i.cellType)&&i.imageAutoSizing||("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}return!1}(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,r,n;const s=this.scenegraph.getCell(null===(e=null===(t=this.stateManager.hover)||void 0===t?void 0:t.cellPos)||void 0===e?void 0:e.col,null===(o=null===(i=this.stateManager.hover)||void 0===i?void 0:i.cellPos)||void 0===o?void 0:o.row);return"chart"===(null===(n=null===(r=null==s?void 0:s.getChildren())||void 0===r?void 0:r[0])||void 0===n?void 0:n.type)?s.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,r,n;const s=this.getDrawRange(),a=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let l,h,d,c;if(this.frozenRowCount>=1&&(l=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),a.top>=s.top&&a.bottom<=s.bottom&&a.left>=s.left&&a.right<=s.right){if(this.isFrozenCell(t,e))return!0;if(a.top>=(null!==(i=null==l?void 0:l.bottom)&&void 0!==i?i:a.top)&&a.left>=(null!==(o=null==h?void 0:h.right)&&void 0!==o?o:a.left)&&a.bottom<=(null!==(r=null==d?void 0:d.top)&&void 0!==r?r:a.bottom)&&a.right<=(null!==(n=null==c?void 0:c.left)&&void 0!==n?n:a.right))return!0}return!1}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:t}=i;return t}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,r,n,s;const a=this.cellIsInVisualView(t,e),{scrollTop:l,scrollLeft:h}=this;a||this.scrollToCell({col:t,row:e});const d=this.getCellRelativeRect(t,e);(null===(r=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===r?void 0:r.length)>0&&Ux(this.scenegraph);const{col:c,row:u}=this.stateManager.hover.cellPos;let g,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),null==i?void 0:i.disableBackground){const i=this.scenegraph.getCell(t,e);g=i.attribute.fill,i.setAttribute("fill","transparent")}if(null==i?void 0:i.disableBorder){const i=this.scenegraph.getCell(t,e);p=i.attribute.stroke,i.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let f=0;"bottom-right"===this.theme.cellBorderClipDirection&&(f=1);const v=this.scenegraph.stage.toCanvas(!1,(new te).set(d.left+this.tableX+1,d.top+this.tableY+1,d.right+this.tableX-f,d.bottom+this.tableY-f));return a||(this.setScrollTop(l),this.setScrollLeft(h)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),g&&this.scenegraph.getCell(t,e).setAttribute("fill",g),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),(null===(s=null===(n=this.stateManager.select)||void 0===n?void 0:n.ranges)||void 0===s?void 0:s.length)>0&&Vx(this.scenegraph),this.stateManager.updateHoverPos(c,u),this.scenegraph.updateNextFrame(),v.toDataURL()}exportCellRangeImg(t){var e,i,o,r;const{scrollTop:n,scrollLeft:s}=this,a=Math.min(t.start.col,t.end.col),l=Math.min(t.start.row,t.end.row),h=Math.max(t.start.col,t.end.col),d=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(a,l),u=this.cellIsInVisualView(h,d);c&&u||this.scrollToCell({col:a,row:l});const g=this.getCellRangeRelativeRect({start:{col:a,row:l},end:{col:h,row:d}});(null===(i=null===(e=this.stateManager.select)||void 0===e?void 0:e.ranges)||void 0===i?void 0:i.length)>0&&Ux(this.scenegraph);const{col:p,row:f}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const v=this.scenegraph.stage.toCanvas(!1,(new te).set(g.left+this.tableX+1,g.top+this.tableY+1,g.right+this.tableX,g.bottom+this.tableY)).toDataURL();return c&&u||(this.setScrollTop(n),this.setScrollLeft(s)),(null===(r=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===r?void 0:r.length)>0&&Vx(this.scenegraph),this.stateManager.updateHoverPos(p,f),v}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if("node"!==this.options.mode)return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,(new te).set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),"function"==typeof e?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter((t=>t.callback!==e)):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach((i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)}))}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return(null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return null!==(e=null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)&&void 0!==e?e:0}setMinMaxLimitWidth(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,i;const o=this.internalProps;for(let r=0;r<o.layoutMap.columnWidths.length;r++){if(this.internalProps._widthResizedColMap.has(r))continue;const{width:n,minWidth:s,maxWidth:a}=null!==(i=null===(e=o.layoutMap.columnWidths)||void 0===e?void 0:e[r])&&void 0!==i?i:{};t&&n&&("string"==typeof n&&"auto"!==n||"number"==typeof n&&n>0)&&this._setColWidth(r,n),s&&("number"==typeof s&&s>0||"string"==typeof s)&&this.setMinColWidth(r,s),a&&("number"==typeof a&&a>0||"string"==typeof a)&&this.setMaxColWidth(r,a)}}setSortedIndexMap(t,e){var i;null===(i=this.dataSource)||void 0===i||i.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new AC(t,this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}getGroupTitleLevel(t,e){}}const k_={};const L_=(t,e)=>{var i,o;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const r=e.fields,n=t[0],s={},a=[];for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const l=r[e];if(!l.type){let o=n;e in n||(o=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:n),l.type="number"==typeof o[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},a.push(h)),(null===(o=l.domain)||void 0===o?void 0:o.length)>0)if("ordinal"===l.type){l._domainCache={},s[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(s[e]=l)}return Object.keys(s).length>0&&(t=t.filter((t=>{for(const e in s){const i=s[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),a.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let o=0;o<i.length;o++){const r=i[o];let n=0;if("ordinal"===r.type?(void 0===r.sortIndex[e[r.key]]&&(r.sortIndex[e[r.key]]=r.sortIndexCount++),void 0===r.sortIndex[t[r.key]]&&(r.sortIndex[t[r.key]]=r.sortIndexCount++),n=r.sortIndex[t[r.key]]-r.sortIndex[e[r.key]]):"linear"===r.type&&(n=t[r.key]-e[r.key]),r.sortReverse&&(n=-n),0!==n)return n}return 0}(t,e,a))),t};let H_=0;const E_="_data-view-diff-rank";class z_{constructor(t,e){var i=this;let o;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new Y,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},o=(null==e?void 0:e.name)?e.name:function(){return H_>1e8&&(H_=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+H_++}("dataview"),this.name=o,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(o,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const r=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(o=this.dataSet.getParser(e.type))&&void 0!==o?o:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=t,this.history&&this.historyData.push(r,t),this.latestData=t}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,o;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(o=e.level)&&void 0!==o?o:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:o}=e,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(r),this.latestData=r,!1!==o&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[E_]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[E_]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[E_]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof z_||!0!==(null==e?void 0:e.clone)||(i=!0),i?mt(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?xt({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!Z(this._fields)&&Z(i)?(this.dataSet.registerTransform("fields",L_),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function F_(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["data"];const i=t;let o;if(!J(i)||"object"!=typeof i)return i;if(function(t){return t instanceof z_}(i)||function(t){try{return t instanceof Element}catch(e){const i=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],o=Object.keys(t);return i.every((t=>o.includes(t)))}}(i))return i;const r=rt(i),n=i.length;o=r?new Array(n):"object"==typeof i?{}:K(i)||at(i)||ot(i)?i:st(i)?new Date(+i):void 0;const s=r?void 0:Object.keys(Object(i));let a=-1;if(o)for(;++a<(s||i).length;){const t=s?s[a]:a,r=i[t];(null==e?void 0:e.includes(t.toString()))?o[t]=r:o[t]=F_(r,e)}return o}class I_{constructor(t,e,i,o){this.seqId=0,this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this.bodyRowSpanCount=1,this._transpose=!1,this._showHeader=!0,this._recordsCount=0,this._hasAggregation=!1,this._hasAggregationOnTopCount=0,this._hasAggregationOnBottomCount=0,this._cellRangeMap=new Map,this._showHeader=i,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=null!=o?o:20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new b_(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter((t=>!0!==t.define.hide)),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.rowHierarchyType=function(t){if(t._table.options.groupBy)return!0;const{columns:e}=t._table.options;if(rt(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!ot(i)&&i.tree)return!0}return!1}(this)?"tree":"grid",this._hasAggregation=function(t){const e=t.columnObjects;for(let t=0;t<e.length;t++){const i=e[t];if(null==i?void 0:i.aggregation)return!0}return!1}(this),this._hasAggregationOnBottomCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!1===t.showOnTop)).length):!1===o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this._hasAggregationOnTopCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!0===t.showOnTop)).length):!0===o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,i;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map((e=>{var i,o;return{id:this.seqId++,title:e.title,define:e,cellType:null!==(i=e.cellType)&&void 0!==i?i:"text",headerType:null!==(o=t.cellType)&&void 0!==o?o:"text",style:e.style,width:e.width,format:e.format,field:e.field,icon:e.icon,headerIcon:e.headerIcon,isChildNode:!1}})):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",headerType:null!==(i=t.cellType)&&void 0!==i?i:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!0)),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!1)),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isSeriesNumberInHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}return!1}isSeriesNumberInBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}return!1}isSeriesNumber(t,e){return this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount||this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0;return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getBody(t,e).aggregator}getAggregatorsByCellRange(t,e,i,o){let r=[];if(!this.transpose){for(let o=t;o<=i;o++){const t=this.getBody(o,e);t.aggregator&&(r=r.concat(Array.isArray(t.aggregator)?t.aggregator:[t.aggregator]))}return r}for(let i=e;i<=o;i++){const e=this.getBody(t,i);e.aggregator&&(r=r.concat(Array.isArray(e.aggregator)?e.aggregator:[e.aggregator]))}return[]}getAggregatorOnTop(t,e){const i=this.getBody(t,e),o=i.aggregator,r=i.aggregation;if(Array.isArray(r)){const i=r.reduce(((t,e,i)=>(e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-this.rowHeaderLevelCount]:i[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?(null==r?void 0:r.showOnTop)?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:(null==r?void 0:r.showOnTop)?o:null}getAggregatorOnBottom(t,e){const i=this.getBody(t,e),o=i.aggregator,r=i.aggregation;if(Array.isArray(r)){const i=r.reduce(((t,e,i)=>(!1===e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-(this.colCount-this.hasAggregationOnBottomCount)]:i[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?!1===(null==r?void 0:r.showOnTop)?o:null:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0?null:!1===(null==r?void 0:r.showOnTop)?o:null}getAggregatorCellAddress(t,e,i,o){const r=[],n=this.hasAggregationOnTopCount,s=this.hasAggregationOnBottomCount;if(this.transpose){for(let i=e;i<=o;i++)if(this.getBody(t,i).aggregator){for(let t=0;t<n;t++)r.push({col:this.headerLevelCount+t,row:i});for(let t=0;t<s;t++)r.push({col:this.rowCount-s+t,row:i})}}else for(let o=t;o<=i;o++)if(this.getBody(o,e).aggregator){for(let t=0;t<n;t++)r.push({col:o,row:this.headerLevelCount+t});for(let t=0;t<s;t++)r.push({col:o,row:this.rowCount-s+t})}return r}getCellLocation(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isRowHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)}isColumnHeader(t,e){return!this.transpose&&e>=0&&e<=this.headerLevelCount-1&&t>=this.leftRowSeriesNumberColumnCount&&t<this.colCount-this.rightRowSeriesNumberColumnCount}isFrozenColumn(t,e){if(J(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(J(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(J(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(J(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}isLeftBottomCorner(t,e){return t>=0&&t<this.rowHeaderLevelCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.columnHeaderLevelCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isCornerHeader(t,e){return!1}getColumnHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,i,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(null!==(t=this.colCount)&&void 0!==t?t:0)-1,row:(null!==(e=this.rowCount)&&void 0!==e?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(null!==(i=this.colCount)&&void 0!==i?i:0)-1,row:(null!==(o=this.rowCount)&&void 0!==o?o:0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}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 bottomFrozenRowCount(){return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0}get rightFrozenColCount(){return this._table.internalProps.rightFrozenColCount?this.colCount-this.frozenColCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:Math.max(0,this.colCount-this.frozenColCount):0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount:this._columns.length+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get bodyRowCount(){return this.transpose?this._columns.length:this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.transpose?this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount:this._columns.length}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get headerObjectsIncludeHided(){return this._headerObjectsIncludeHided}get columnWidths(){if(this.leftRowSeriesNumberColumnCount){const t=this.leftRowSeriesNumberColumn.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})));return t.push(...this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))),t}return this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))}getColumnWidthDefined(t){var e;if(t>=0){if(t<this.leftRowSeriesNumberColumnCount)return this.leftRowSeriesNumberColumn[t];if(this.transpose){let i,o,r=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let t;return this.columnObjects.forEach(((e,n)=>{"number"==typeof e.width?r=Math.max(e.width,r):"auto"===e.width&&(t=!0),"number"==typeof e.minWidth&&(o=Math.max(e.minWidth,o)),"number"==typeof e.maxWidth&&(i=Math.max(e.maxWidth,i))})),r=r>0?r:t?"auto":void 0,{width:r,minWidth:o,maxWidth:i}}if(this.isRowHeader(t,0)){const i=Array.isArray(this._table.defaultHeaderColWidth)?null!==(e=this._table.defaultHeaderColWidth[t])&&void 0!==e?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return"auto"===i?{width:"auto"}:{width:i}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var i,o,r,n;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?null===(i=this._columns[e])||void 0===i?void 0:i.id:this.isSeriesNumber(t,e)?e+"_series_number":null===(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?null===(r=this._columns[t-this.leftRowSeriesNumberColumnCount])||void 0===r?void 0:r.id:null===(n=this._headerCellIds[e])||void 0===n?void 0:n[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const i=this.getCellId(t,e);return this._headerObjectMap[i]}getHeaderField(t,e){var i;const o=this.getCellId(t,e);return(null===(i=this._headerObjectMap[o])||void 0===i?void 0:i.field)||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t-this.leftRowSeriesNumberColumnCount]&&this._columns[t-this.leftRowSeriesNumberColumnCount].field)}getHeaderCellAdressById(t){for(let e=0;e<this._headerCellIds.length;e++){const i=this._headerCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){return this.isSeriesNumber(t,e)?this.getSeriesNumberBody(t,e):this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}getBodyLayoutRangeById(t){var e,i;if(this.transpose){for(let i=0;i<(null!==(e=this.rowCount)&&void 0!==e?e:0);i++)if(t===this._columns[i].id)return{start:{col:0,row:i},end:{col:0,row:i}}}else for(let e=this.leftRowSeriesNumberColumnCount;e<(null!==(i=this.colCount)&&void 0!==i?i:0);e++)if(t===this._columns[e-this.leftRowSeriesNumberColumnCount].id)return{start:{col:e,row:0},end:{col:e,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return function(t,e,i){var o,r,n;if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(i._cellRangeMap.has(`$${t}$${e}`))return i._cellRangeMap.get(`$${t}$${e}`);let s={start:{col:t,row:e},end:{col:t,row:e}};if(i.transpose)s=function(t,e,i){var o,r,n,s;const a={start:{col:t,row:e},end:{col:t,row:e}};if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t||-1===t&&-1===e){if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t&&(null===(r=null===(o=i.columnObjects[e])||void 0===o?void 0:o.define)||void 0===r?void 0:r.mergeCell)){const o=i._table.getCellValue(t,e);for(let r=t-1;r>=i.headerLevelCount+i.leftRowSeriesNumberColumnCount;r--){const t=i._table.getCellValue(r,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;a.start.col=r}for(let r=t+1;r<(null!==(n=i.colCount)&&void 0!==n?n:0);r++){const t=i._table.getCellValue(r,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;a.end.col=r}}return a}const l=i.getCellId(t,e);for(let o=e-1;o>=0&&l===i.getCellId(t,o);o--)a.start.row=o;for(let o=e+1;o<(null!==(s=i.rowCount)&&void 0!==s?s:0)&&l===i.getCellId(t,o);o++)a.end.row=o;for(let o=t-1;o>=0&&l===i.getCellId(o,e);o--)a.start.col=o;for(let o=t+1;o<i.headerLevelCount+i.leftRowSeriesNumberColumnCount&&l===i.getCellId(o,e);o++)a.end.col=o;return a}(t,e,i);else if(i.headerLevelCount<=e){if(i.headerLevelCount<=e&&(null===(r=null===(o=i.columnObjects[t-i.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o.define)||void 0===r?void 0:r.mergeCell)){const o=i._table.getCellValue(t,e);for(let r=e-1;r>=i.headerLevelCount;r--){const e=i._table.getCellValue(t,r);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.start.row=r}for(let r=e+1;r<i.rowCount;r++){const e=i._table.getCellValue(t,r);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.end.row=r}}!function(t,e,i,o){if("tree"!==o.rowHierarchyType)return;const r=o._table.getCellRawRecord(t,e);(null==r?void 0:r.vtableMerge)&&(i.start.col=o.rowHeaderLevelCount,i.end.col=o.colCount-1,i.start.row=i.end.row=e)}(t,e,s,i)}else{const o=i.getCellId(t,e);for(let r=t-1;r>=0&&o===i.getCellId(r,e);r--)s.start.col=r;for(let r=t+1;r<(null!==(n=i.colCount)&&void 0!==n?n:0)&&o===i.getCellId(r,e);r++)s.end.col=r;for(let r=e-1;r>=0&&o===i.getCellId(t,r);r--)s.start.row=r;for(let r=e+1;r<i.headerLevelCount&&o===i.getCellId(t,r);r++)s.end.row=r}return i._cellRangeMap.set(`$${t}$${e}`,s),s}(t,e,this)}isCellRangeEqual(t,e,i,o){const r=this.getCellRange(t,e),n=this.getCellRange(i,o);return r.start.col===n.start.col&&r.end.col===n.end.col&&r.start.row===n.start.row&&r.end.row===n.end.row}getRecordShowIndexByCell(t,e){const i=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<i?-1:t-i:e<i?-1:e-i}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,i,o){const r=[],n=this._newRow(t,o);return e.forEach((e=>{var s,a,l,h;const d=this._columns.length,c=this.seqId++,u={id:c,title:null!==(s=e.title)&&void 0!==s?s:e.caption,headerIcon:e.headerIcon,field:e.field,style:e.headerStyle,headerType:null!==(a=e.headerType)&&void 0!==a?a:"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};r[c]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e]&&(this._headerCellIds[e][d]=i[e]);if(o?this._headerCellIds[t-1]&&(n[d]=this._headerCellIds[t-1][d]):n[d]=c,e.columns)this._addHeaders(t+1,e.columns,[...i,c],e.hideColumnsSubHeader||o).forEach((t=>r.push(t)));else{const i={id:this.seqId++,field:e.field,fieldFormat:e.fieldFormat,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,icon:e.icon,cellType:null!==(h=null!==(l=e.cellType)&&void 0!==l?l:e.columnType)&&void 0!==h?h:"text",chartModule:"chartModule"in e?e.chartModule:null,chartSpec:"chartSpec"in e?e.chartSpec:null,sparklineSpec:"sparklineSpec"in e?e.sparklineSpec:$b,style:e.style,define:e,columnWidthComputeMode:e.columnWidthComputeMode,disableColumnResize:null==e?void 0:e.disableColumnResize,aggregation:this._getAggregationForColumn(e,d),isChildNode:t>=1};if(this._columnsIncludeHided.push(i),!0!==e.hide){this._columns.push(i);for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][d]=c}}})),r}_getAggregationForColumn(t,e){let i;return t.aggregation?i=t.aggregation:this._table.options.aggregation&&(i="function"==typeof this._table.options.aggregation?this._table.options.aggregation({col:e,field:t.field}):this._table.options.aggregation),i?Array.isArray(i)?i.map((t=>(J(t.showOnTop)||(t.showOnTop=!1),t))):Object.assign({showOnTop:!1},i):null}_newRow(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let i=this._headerCellIds[t].length;i<e.length;i++)this._headerCellIds[t][i]=e[i];return this._headerCellIds[t]}if(e)return[];const i=this._headerCellIds[t]=[];if(!this._columns.length)return i;const o=this._headerCellIds[t-1];for(let t=0;t<o.length;t++)i[t]=o[t];return i}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let i=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:i=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(0!==e){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e)){if(this.isSeriesNumberInBody(t-1,e))return;return this.getCellId(t-1,e)}}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row))return!1;if(!this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)){const i=this.getRecordShowIndexByCell(0,t.row),o=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(i,o)}if(this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(this._getColumnDefine(t.col+this.leftRowSeriesNumberColumnCount,t.row).isChildNode&&this._getColumnDefine(e.col+this.leftRowSeriesNumberColumnCount,e.row).isChildNode?(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1):(t.col=t.col+this.leftRowSeriesNumberColumnCount,e.col=e.col+this.leftRowSeriesNumberColumnCount)),t.col<0||t.row<0||e.col<0||e.row<0)return!1;if("disabled"===this._table.internalProps.frozenColDragHeaderMode&&this._table.isFrozenColumn(e.col))return!1;const i=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row):!!this.isRowHeader(t.col,t.row)&&this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row)}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let r;const n=this.getCellRange(e.col,i.start.row);if(r=e.col>=t.col?n.end.col-o+1:n.start.col,r===i.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);e.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return s.unshift(r-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.row,i.start.col-this.leftRowSeriesNumberColumnCount,r-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.col,targetIndex:r,sourceSize:o,targetSize:n.end.col-n.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)||this.isSeriesNumberInBody(t.col,t.row)&&this.transpose){this.isSeriesNumberInBody(t.col,t.row)&&(i=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=i.end.row-i.start.row+1;let r;const n=this.getCellRange(i.start.col,e.row);if(r=e.row>=t.row?n.end.row-o+1:n.start.row,r===i.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.row,o);e.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.row,o);return s.unshift(r,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.col-this.leftRowSeriesNumberColumnCount,i.start.row,r+(e.row>t.row?i.end.row-i.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.row,targetIndex:r,sourceSize:o,targetSize:n.end.row-n.start.row+1,moveType:"row"}}if(this.isSeriesNumberInBody(t.col,t.row))return{sourceIndex:t.row,targetIndex:e.row,sourceSize:1,targetSize:1,moveType:"row"}}return null}toggleHierarchyState(t){return{addCellPositions:t.add.map((t=>({col:0,row:this._table.frozenRowCount+t}))),removeCellPositions:t.remove.map((t=>({col:0,row:this._table.frozenRowCount+t})))}}setChartInstance(t,e,i){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];"function"!=typeof o.chartSpec&&(o.chartInstance=i)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return function(t){let e=!1;for(let i=0;i<t.columnObjects.length;i++)if(t.columnObjects[i].chartSpec){e=!0;break}return e}(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const i=this.getBody(t,e);return"function"!=typeof(null==i?void 0:i.chartSpec)}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const i=this.getBody(t,e),o=null==i?void 0:i.chartSpec;return"function"==typeof o?o({col:t,row:e,dataValue:this._table.getCellOriginValue(t,e)||"",value:this._table.getCellValue(t,e)||"",rect:this._table.getCellRangeRelativeRect(this._table.getCellRange(t,e)),table:this._table}):o}getChartDataId(t,e){return function(t,e,i){var o;const r=i.getRawChartSpec(t,e);if(null==r?void 0:r.series){const t={};return(null===(o=r.data)||void 0===o?void 0:o.id)&&(t[r.data.id]=void 0),null==r||r.series.forEach((e=>{var i,o,n,s,a,l,h,d,c,u,g;if(!(null===(i=e.data)||void 0===i?void 0:i.fromDataId))if(null===(o=e.data)||void 0===o?void 0:o.transforms)t[null!==(g=null!==(c=null===(d=e.data)||void 0===d?void 0:d.id)&&void 0!==c?c:null===(u=r.data)||void 0===u?void 0:u.id)&&void 0!==g?g:"data"]=void 0;else{const i="horizontal"===e.direction?e.xField:e.yField;t[null!==(l=null!==(s=null===(n=e.data)||void 0===n?void 0:n.id)&&void 0!==s?s:null===(a=r.data)||void 0===a?void 0:a.id)&&void 0!==l?l:"data"]=(null===(h=e.data)||void 0===h?void 0:h.id)?i:void 0}})),t}return r.data.id}(t,e,this)}release(){const t=this._table._getActiveChartInstance();null==t||t.release(),this.columnObjects.forEach((t=>{var e;null===(e=t.chartInstance)||void 0===e||e.release()}))}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,i){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=i,o.define.title=i}getColumnByField(t){var e;return null===(e=this.columnObjects)||void 0===e?void 0:e.reduce(((e,i,o)=>(i.field===t&&e.push({col:o,columnDefine:i}),e)),[])}_getColumnDefine(t,e){if(t>=0)return t<this.leftRowSeriesNumberColumnCount?this.leftRowSeriesNumberColumn[t]:this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}}class O_{constructor(t){this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(kb.DBLCLICK_CELL,(e=>{var i;if(!t||"doubleclick"===t||Array.isArray(t)&&t.includes("doubleclick")){const{col:t,row:o}=e,r=RC(e.federatedEvent),n=this.table.scenegraph.getResizeColAt(r.abstractPos.x,r.abstractPos.y,null===(i=r.eventArgs)||void 0===i?void 0:i.targetCell);if(this.table._canResizeColumn(n.col,n.row)&&n.col>=0)return;this.startEditCell(t,o)}})),this.table.on(kb.CLICK_CELL,(e=>{if("click"===t||Array.isArray(t)&&t.includes("click")){const{col:t,row:i}=e;this.startEditCell(t,i)}}))}startEditCell(t,e,i){var o,r,n,s,a;const l=this.table.getEditor(t,e);if(l){if(null===(r=null===(o=this.table.internalProps.layoutMap)||void 0===o?void 0:o.isAggregation)||void 0===r?void 0:r.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=l;const h=J(i)?i:this.table.getCellOriginValue(t,e),d=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:d.left,top:d.top,width:d.width,height:d.height}};l.beginEditing,null===(n=l.beginEditing)||void 0===n||n.call(l,this.table.getElement(),c,h),l.bindSuccessCallback,null===(s=l.bindSuccessCallback)||void 0===s||s.call(l,(()=>{this.completeEdit()})),null===(a=l.onStart)||void 0===a||a.call(l,{value:h,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;const o=null==t?void 0:t.target,{editingEditor:r}=this;if(o)if(r.targetIsOnEditor){if(r.targetIsOnEditor(o))return!1}else if(!r.isEditorElement||r.isEditorElement(o))return!1;if(this.editingEditor.getValue,this.editingEditor.validateValue){const t=null===(i=(e=this.editingEditor).validateValue)||void 0===i?void 0:i.call(e);return Cb(t)?new Promise(((e,i)=>{t.then((t=>{t?(this.doExit(),e(!0)):e(!1)})).catch((t=>{i(t)}))})):!!t&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,r,n;const s=null===(e=(t=this.editingEditor).getValue)||void 0===e?void 0:e.call(t),a=this.table.getCellRange(this.editCell.col,this.editCell.row),l=[];for(let t=a.start.row;t<=a.end.row;t++){const t=[];for(let e=a.start.col;e<=a.end.col;e++)t.push(s);l.push(t)}this.table.changeCellValues(a.start.col,a.start.row,l),this.editingEditor.exit,null===(o=(i=this.editingEditor).exit)||void 0===o||o.call(i),null===(n=(r=this.editingEditor).onEnd)||void 0===n||n.call(r),this.editingEditor=null}cancelEdit(){var t,e,i,o;this.editingEditor&&(null===(e=(t=this.editingEditor).exit)||void 0===e||e.call(t),null===(o=(i=this.editingEditor).onEnd)||void 0===o||o.call(i),this.editingEditor=null)}}function D_(t){return ot(t)?{groupByRules:[t]}:rt(t)?{groupByRules:t.map((t=>ot(t)?t:t.key))}:{}}function W_(t,e,i,o){if("group"===o)return o;if("sort"===o&&!i.options.groupBy)return o;let r="normal";return i.options.groupBy?r="group":!i.isHeader(t,e)&&i.dataSource.lastOrderField&&i.getBodyField(t,e)===i.dataSource.lastOrderField&&(r="sort"),r}function N_(t){var e;if(t.sortState){let i,o;if(Array.isArray(t.sortState)?0!==t.sortState.length&&({order:i,field:o}=null===(e=t.sortState)||void 0===e?void 0:e[0]):({order:i,field:o}=t.sortState),i&&o&&"normal"!==i){const e=t._getSortFuncFromHeaderOption(void 0,o),r=t.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===o));r&&t.dataSource.sort(r.field,i,null!=e?e:rb)}}}class G_ extends P_{constructor(t,e){var i,o,r,n;"node"===Xv.mode?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const s=this.internalProps;if(s.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,s.sortState=e.sortState,s.dataConfig=e.groupBy?D_(e.groupBy):{},s.columns=e.columns?F_(e.columns,["children"]):e.header?F_(e.header,["children"]):[],s.enableTreeNodeMerge=null!==(o=null!==(i=e.enableTreeNodeMerge)&&void 0!==i?i:J(e.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=null===(r=e.showHeader)||void 0===r||r,this.transpose=null!==(n=e.transpose)&&void 0!==n&&n,"node"!==Xv.mode&&(this.editorManager=new O_(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?CC(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:s.sortState}):this.setRecords([]),e.title){const t=hm.getComponent("title");s.title=new t(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=hm.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const t=hm.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new t(this)}setTimeout((()=>{this.fireListeners(kb.INITIALIZED,null)}),0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return null===(t=this.dataSource)||void 0===t?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=F_(t,["children"]),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.renderAsync(),this.eventManager.updateEventBinder()}get columns(){return this.internalProps.layoutMap.columnTree.getCopiedTree()}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return null!==(t=this.internalProps.transpose)&&void 0!==t&&t}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.renderAsync()))}getCellValue(t,e,i){if(-1===t||-1===e)return null;if(!i){const i=this.getCustomMergeValue(t,e);if(i)return i}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return i}const{format:i}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof i?i(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}}const{field:r,fieldFormat:n}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(n||r,t,e)}getCellOriginValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isSeriesNumber(t,e)){if(i.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getSeriesNumberHeader(t,e);return o}const{format:o}=i.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof o?o(t,e,this):e-this.columnHeaderLevelCount}if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}if(i.internalProps.layoutMap.isAggregation(t,e)){if(i.internalProps.layoutMap.isTopAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnTop(t,e);return null==o?void 0:o.value()}if(i.internalProps.layoutMap.isBottomAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnBottom(t,e);return null==o?void 0:o.value()}}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getFieldData(o,t,e)}getCellRawValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:i}=this.internalProps;return i.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:i}=this.internalProps,o=i.getRecordShowIndexByCell(t,e);return this.dataSource.currentPagerIndexedData[o]}getTableIndexByRecordIndex(t){return this.transpose?this.dataSource.getTableIndex(t)+this.rowHeaderLevelCount:this.dataSource.getTableIndex(t)+this.columnHeaderLevelCount}getTableIndexByField(t){const e=this.internalProps.layoutMap.columnObjects.find((e=>e.field===t));if(!e)return-1;const i=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?i.start.row:i.start.col}getCellAddrByFieldRecord(t,e){return this.transpose?{col:this.getTableIndexByRecordIndex(e),row:this.getTableIndexByField(t)}:{col:this.getTableIndexByField(t),row:this.getTableIndexByRecordIndex(e)}}getCellOriginRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.get(i)}getCellRawRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.getRaw(i)}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i&&!this.transpose){const i=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),o=this.internalProps.layoutMap.isSeriesNumber(t,e);if(null==i?void 0:i.disableColumnResize)return!1;if(o&&!0===this.internalProps.rowSeriesNumber.disableColumnResize)return!1}return i}updateOption(t){var e,i,o,r;const n=this.internalProps;if(super.updateOption(t),n.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,n.sortState=t.sortState,n.dataConfig=t.groupBy?D_(t.groupBy):{},this.showHeader=null===(e=t.showHeader)||void 0===e||e,n.columns=t.columns?F_(t.columns,["children"]):t.header?F_(t.header,["children"]):[],n.enableTreeNodeMerge=null!==(o=null!==(i=t.enableTreeNodeMerge)&&void 0!==i?i:J(t.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=null!==(r=t.transpose)&&void 0!==r&&r,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,n.releaseList&&(n.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),n.releaseList=null),t.dataSource?CC(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const e=hm.getComponent("title");n.title=new e(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=hm.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise((t=>{setTimeout(t,0)}))}updatePagination(t){this.pagination&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.dataSource.updatePagination(this.pagination),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.renderAsync())}refreshHeader(){var t;const e=this.internalProps,i=this.transpose,o=this.showHeader;(e.layoutMap=new I_(this,null!==(t=e.columns)&&void 0!==t?t:[],o,this.options.hierarchyIndent)).transpose=i,i||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b;const m=this,{layoutMap:C}=m.internalProps;if(!C)return;const y=null!==(e=null===(t=m.internalProps.dataSource)||void 0===t?void 0:t.length)&&void 0!==e?e:0;C.recordsCount=y+(y>0?C.hasAggregationOnTopCount+C.hasAggregationOnBottomCount:0),m.transpose?(m.rowCount=null!==(i=C.rowCount)&&void 0!==i?i:0,m.colCount=null!==(o=C.colCount)&&void 0!==o?o:0,this.internalProps.frozenColCount=Math.max((null!==(r=C.headerLevelCount)&&void 0!==r?r:0)+C.leftRowSeriesNumberColumnCount,null!==(n=this.options.frozenColCount)&&void 0!==n?n:0),this.internalProps.frozenRowCount=null!==(s=this.options.frozenRowCount)&&void 0!==s?s:0,m.bottomFrozenRowCount!==(null!==(a=this.options.bottomFrozenRowCount)&&void 0!==a?a:0)&&(m.bottomFrozenRowCount=null!==(l=this.options.bottomFrozenRowCount)&&void 0!==l?l:0),m.rightFrozenColCount!==(null!==(h=this.options.rightFrozenColCount)&&void 0!==h?h:0)&&(m.rightFrozenColCount=null!==(d=this.options.rightFrozenColCount)&&void 0!==d?d:0)):(m.colCount=null!==(c=C.colCount)&&void 0!==c?c:0,m.rowCount=C.recordsCount*C.bodyRowSpanCount+C.headerLevelCount,this.internalProps.frozenColCount=null!==(u=this.options.frozenColCount)&&void 0!==u?u:0,m.frozenRowCount=Math.max(C.headerLevelCount,null!==(g=this.options.frozenRowCount)&&void 0!==g?g:0),m.bottomFrozenRowCount!==(null!==(p=this.options.bottomFrozenRowCount)&&void 0!==p?p:0)&&(m.bottomFrozenRowCount=null!==(f=this.options.bottomFrozenRowCount)&&void 0!==f?f:0),m.rightFrozenColCount!==(null!==(v=this.options.rightFrozenColCount)&&void 0!==v?v:0)&&(m.rightFrozenColCount=null!==(b=this.options.rightFrozenColCount)&&void 0!==b?b:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,i);return this.internalProps.dataSource.getField(o,t,e,i,this)}getRawFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(e,i);return this.internalProps.dataSource.getRawField(o,t,e,i,this)}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),r=this.internalProps.layoutMap.moveHeaderPosition(t,e);return r?("column"===r.moveType?(this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,r.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):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),r):null}changeRecordOrder(t,e){this.transpose?(t=this.getRecordShowIndexByCell(t,0),e=this.getRecordShowIndexByCell(e,0)):(t=this.getRecordShowIndexByCell(0,t),e=this.getRecordShowIndexByCell(0,e)),this.dataSource.reorderRecord(t,e)}getCellAddress(t,e){let i;for(let e=0;e<this.internalProps.records.length;e++){const o=this.internalProps.records[e];if("function"==typeof t)t(o)&&(i=e);else{let r=!0;for(const e in t)if(o[e]!==t[e]){r=!1;break}r&&(i=e)}if(J(i))break}const o=this.getCellRangeByField(e,i);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:i}=this.internalProps,o=i.columnObjects.find((e=>e.field===t));if(o){const t=i.getBodyLayoutRangeById(o.id);let r;return J(e)&&(r=i.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:J(r)?r+t.start.col:void 0},end:{row:t.end.row,col:J(r)?r+t.end.col:void 0}}:{start:{col:t.start.col,row:J(r)?r+t.start.row:void 0},end:{col:t.end.col,row:J(r)?r+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return Rv.none;const i=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){this.stateManager.updateHoverIcon(t,e,void 0,void 0);const i=this.getHierarchyState(t,e);if(i===Rv.expand)this._refreshHierarchyState(t,e),this.fireListeners(kb.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Rv.collapse});else if(i===Rv.collapse){const i=this.getCellOriginRecord(t,e);Array.isArray(i.children)&&this._refreshHierarchyState(t,e),this.fireListeners(kb.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:Rv.expand,originData:i})}}_refreshHierarchyState(t,e){let i=!1,o=!1;const r=this.internalProps.layoutMap.checkHasChart();r&&(this.autoFillWidth&&(i=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(o=this.getAllRowsHeight()<=this.tableNoFrameHeight));const n=this.getRecordShowIndexByCell(t,e),s=this.dataSource.toggleHierarchyState(n,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount,Math.max(this.scenegraph.proxy.rowEnd-this.columnHeaderLevelCount,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount+this.scenegraph.proxy.rowLimit-1)),a=this.internalProps.layoutMap.toggleHierarchyState(s);this.refreshRowColCount(),this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.updateHierarchyIcon(t,e),this.scenegraph.updateRow(a.removeCellPositions,a.addCellPositions),r&&(this.autoFillWidth&&!i&&(i=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!o&&(o=this.getAllRowsHeight()<=this.tableNoFrameHeight),("adaptive"===this.widthMode||i||"adaptive"===this.heightMode||o)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return null===(e=null!==(t=this.options.columns)&&void 0!==t?t:this.options.header)||void 0===e?void 0:e.some(((t,e)=>t.tree))}getMenuInfo(t,e,i){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,i){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const r=t[o];if((i&&i===r.fieldKey||!i&&r.field===e)&&r.sort&&"function"==typeof r.sort)return r.sort;if(r.columns){const t=this._getSortFuncFromHeaderOption(r.columns,e,i);if(t)return t}}}updateSortState(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,r;let n,s;if(t?this.internalProps.sortState=t:this.internalProps.sortState&&(Array.isArray(this.internalProps.sortState)?(t=null===(i=this.internalProps.sortState)||void 0===i?void 0:i[0])&&(t.order="normal"):(this.internalProps.sortState.order="normal",t=this.internalProps.sortState)),Array.isArray(this.internalProps.sortState)?(null===(o=this.internalProps.sortState)||void 0===o?void 0:o[0])&&({order:n,field:s}=null===(r=this.internalProps.sortState)||void 0===r?void 0:r[0]):this.internalProps.sortState&&({order:n,field:s}=this.internalProps.sortState),s&&e){const t=this._getSortFuncFromHeaderOption(this.internalProps.columns,s),e=this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===s));e&&!1!==e.define.sort&&(this.dataSource.sort(e.field,n,t),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.sortCell())}t&&this.stateManager.updateSortState(t)}updateFilterRules(t){this.scenegraph.clearCells(),this.sortState?(this.dataSource.updateFilterRulesForSorted(t),N_(this)):this.dataSource.updateFilterRules(t),this.refreshRowColCount(),this.scenegraph.createSceneGraph()}getCheckboxState(t){if(this.stateManager.checkedState.length<this.rowCount-this.columnHeaderLevelCount&&this.stateManager.initLeftRecordsCheckState(this.records),J(t)){let e=this.stateManager.checkedState;return this.options.groupBy&&(e=function(t){const e=[],i=t.dataSource,o=i.dataConfig.groupByRules.length+1;return i.currentIndexedData.forEach(((r,n)=>{if(rt(r)&&r.length===o){const{vtableOriginIndex:o}=i.getRawRecord(r);e[o]=t.stateManager.checkedState[r]}})),e}(this)),e.map((e=>e[t]))}return this.stateManager.checkedState}getCellCheckboxState(t,e){var i;const o=this.getBodyColumnDefine(t,e),r=null==o?void 0:o.field,n=this.getCellType(t,e);if(J(r)&&"checkbox"===n){const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return null===(i=this.stateManager.checkedState[o])||void 0===i?void 0:i[r]}}getRadioState(t){return J(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return function(t,e,i){var o;const r=i.getBodyColumnDefine(t,e),n=null==r?void 0:r.field,s=i.getCellType(t,e);if(J(n)&&"checkbox"===s){const r=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),s=null===(o=i.stateManager.radioState)||void 0===o?void 0:o[n];if(at(s)){if(s===r)return!0}else if(Q(s)){const t=s[r];if(at(t))return t}}return!1}(t,e,this)}setCellCheckboxState(t,e,i){!function(t,e,i,o){const r=o.scenegraph.getCell(t,e),n=null==r?void 0:r.getChildByName("checkbox");if(!n)return;const{checked:s,indeterminate:a}=n.attribute;a?(i||n._handlePointerUp(),n._handlePointerUp()):s?i||n._handlePointerUp():i&&n._handlePointerUp()}(t,e,i,this)}setCellRadioState(t,e,i){!function(t,e,i,o){const r=o.scenegraph.getCell(t,e);if(r)if(at(i)){const t=r.getChildAt(i);null==t||t._handlePointerUp()}else{const t=r.getChildByName("radio");null==t||t._handlePointerUp()}}(t,e,i,this)}setRecords(t,e){var i,o,r;let n;null===(i=this.internalProps.dataSource)||void 0===i||i.release(),this.internalProps.releaseList=null===(o=this.internalProps.releaseList)||void 0===o?void 0:o.filter((t=>!t.dataSourceObj)),this.internalProps.dataSource=null,Array.isArray(e)||(null==e?void 0:e.order)?n=e:e?n=e.sortState:null===e&&(n=null),"undefined"!=typeof window&&window.performance.now();const s={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),void 0!==n&&(this.internalProps.sortState=n,this.stateManager.setSortState(this.sortState)),t){if(mC(this,t),this.sortState){let t,e;if(Array.isArray(this.sortState)?0!==this.sortState.length&&({order:t,field:e}=null===(r=this.sortState)||void 0===r?void 0:r[0]):({order:t,field:e}=this.sortState),t&&e&&"normal"!==t){const i=this._getSortFuncFromHeaderOption(void 0,e),o=this.internalProps.layoutMap.headerObjectsIncludeHided.find((t=>t&&t.field===e));o&&!1!==o.define.sort&&this.dataSource.sort(o.field,t,null!=i?i:rb)}}this.refreshRowColCount()}else mC(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(s.col,s.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=hm.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),J(s.col)&&J(s.row)&&s.col>=0&&s.row>=0&&setTimeout((()=>{var t;null===(t=this.internalProps)||void 0===t||t.tooltipHandler.showTooltip(s.col,s.row)}),0)}setRecordChildren(t,e,i){const o=this.getCellOriginRecord(e,i);o.children=t;const r=this.getRecordShowIndexByCell(e,i);this.dataSource.setRecord(o,r),this._refreshHierarchyState(e,i)}startEditCell(t,e,i){var o;if(J(t)&&J(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(null===(o=this.stateManager.select)||void 0===o?void 0:o.cellPos){const{col:t,row:e}=this.stateManager.select.cellPos;J(t)&&J(e)&&this.editorManager.startEditCell(t,e,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o;const r=this.getBodyColumnDefine(t,e);let n=this.isHeader(t,e)?null!==(i=null==r?void 0:r.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==r?void 0:r.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof n&&(n=n({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),"string"==typeof n?function(t){if(k_[t])return k_[t]}(n):n}isHasEditorDefine(t,e){var i,o;const r=this.getBodyColumnDefine(t,e);let n=this.isHeader(t,e)?null!==(i=null==r?void 0:r.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==r?void 0:r.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof n&&(n=n({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),J(n)}changeCellValue(t,e,i){return function(t,e,i,o,r){if(o&&r.isHasEditorDefine(t,e)||!1===o){const o=r.getRecordShowIndexByCell(t,e),{field:n}=r.internalProps.layoutMap.getBody(t,e),s=r.getCellRawValue(t,e),a=r.getCellOriginValue(t,e);r.isHeader(t,e)?r.internalProps.layoutMap.updateColumnTitle(t,e,i):r.dataSource.changeFieldValue(i,o,n,t,e,r);const l=r.getCellRange(t,e),h=r.internalProps.layoutMap.getAggregatorsByCell(t,e);if(h){if(Array.isArray(h))for(let t=0;t<(null==h?void 0:h.length);t++)h[t].recalculate();else h.recalculate();const t=r.internalProps.layoutMap.getAggregatorCellAddress(l.start.col,l.start.row,l.end.col,l.end.row);for(let e=0;e<t.length;e++){const i=r.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)r.scenegraph.updateCellContent(t,e)}}for(let t=l.start.col;t<=l.end.col;t++)for(let e=l.start.row;e<=l.end.row;e++)r.scenegraph.updateCellContent(t,e);if("adaptive"===r.widthMode||r.autoFillWidth&&r.getAllColsWidth()<=r.tableNoFrameWidth)0===r.internalProps._widthResizedColMap.size&&r.scenegraph.recalculateColWidths();else if(!r.internalProps._widthResizedColMap.has(t)){const e=r.getColWidth(t),i=ix(t,0,r.rowCount-1,r,!1);i!==e&&r.scenegraph.updateColWidth(t,i-e)}if("adaptive"===r.heightMode||r.autoFillHeight&&r.getAllRowsHeight()<=r.tableNoFrameHeight)0===r.internalProps._heightResizedRowMap.size&&r.scenegraph.recalculateRowHeights();else if("autoHeight"===r.heightMode&&!r.internalProps._heightResizedRowMap.has(e)){const t=r.getRowHeight(e),i=_y(e,0,r.colCount-1,r);r.scenegraph.updateRowHeight(e,i-t)}r.fireListeners(kb.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:s,currentValue:a,changedValue:r.getCellOriginValue(t,e)}),r.scenegraph.updateNextFrame()}}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}changeCellValues(t,e,i){return function(t,e,i,o,r){let n=t,s=e;const a=[],l=[];let h;for(let o=0;o<i.length&&!(e+o>r.rowCount-1);o++){const n=i[o],s=[],d=[];a.push(s),l.push(d);for(let i=0;i<n.length&&!(t+i>r.colCount-1);i++){h=W_(t+i,e+o,r,h);const n=r.getCellRawValue(t+i,e+o);s.push(n);const a=r.getCellOriginValue(t+i,e+o);d.push(a)}}for(let h=0;h<i.length&&!(e+h>r.rowCount-1);h++){s=e+h;const d=i[h];let c=t;for(let i=0;i<d.length&&!(t+i>r.colCount-1);i++)if(c=t+i,o&&r.isHasEditorDefine(t+i,e+h)||!1===o){const o=d[i],n=r.getRecordShowIndexByCell(t+i,e+h),{field:s}=r.internalProps.layoutMap.getBody(t+i,e+h),c=a[h][i],u=l[h][i];r.isHeader(t+i,e+h)?r.internalProps.layoutMap.updateColumnTitle(t+i,e+h,o):r.dataSource.changeFieldValue(o,n,s,t+i,e+h,r),r.fireListeners(kb.CHANGE_CELL_VALUE,{col:t+i,row:e+h,rawValue:c,currentValue:u,changedValue:r.getCellOriginValue(t+i,e+h)})}n=Math.max(n,c)}const d=r.getCellRange(t,e),c=r.getCellRange(n,s),u=r.internalProps.layoutMap.getAggregatorsByCellRange(d.start.col,d.start.row,c.end.col,c.end.row);if(u){for(let t=0;t<(null==u?void 0:u.length);t++)u[t].recalculate();if("normal"===h){const t=r.internalProps.layoutMap.getAggregatorCellAddress(d.start.col,d.start.row,c.end.col,c.end.row);for(let e=0;e<t.length;e++){const i=r.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)r.scenegraph.updateCellContent(t,e)}}}if("group"===h&&r.dataSource.updateRecordsForGroup([],[]),"sort"===h||"group"===h)return r.dataSource.sortedIndexMap.clear(),N_(r),r.refreshRowColCount(),r.internalProps.layoutMap.clearCellRangeMap(),r.scenegraph.clearCells(),void r.scenegraph.createSceneGraph();for(let t=d.start.col;t<=c.end.col;t++)for(let e=d.start.row;e<=c.end.row;e++)r.scenegraph.updateCellContent(t,e);if("adaptive"===r.widthMode||r.autoFillWidth&&r.getAllColsWidth()<=r.tableNoFrameWidth)0===r.internalProps._widthResizedColMap.size&&r.scenegraph.recalculateColWidths();else for(let e=t;e<=c.end.col;e++)if(!r.internalProps._widthResizedColMap.has(e)){const t=r.getColWidth(e),i=ix(e,0,r.rowCount-1,r,!1);i!==t&&r.scenegraph.updateColWidth(e,i-t)}if("adaptive"===r.heightMode||r.autoFillHeight&&r.getAllRowsHeight()<=r.tableNoFrameHeight)r.scenegraph.recalculateRowHeights();else if("autoHeight"===r.heightMode){const t=[],i=[];for(let o=e;o<=c.end.row;o++)if(r.rowHeightsMap.get(o)){const e=r.getRowHeight(o),n=_y(o,0,r.colCount-1,r);t.push(o),i.push(n-e)}r.scenegraph.updateRowsHeight(t,i)}r.scenegraph.updateNextFrame()}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}addRecord(t,e){!function(t,e,i){var o,r;if(i.options.groupBy)null===(r=(o=i.dataSource).addRecordsForGroup)||void 0===r||r.call(o,[t]),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordForSorted(t),N_(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{(void 0===e||e>i.dataSource.sourceLength)&&(e=i.dataSource.sourceLength);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecord(t,e);const r=i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const n=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:t,currentPage:s}=i.pagination,a=t*(s||0)+t;if(e<a)if(e<a-t)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const s=e-(a-t)+o;if(r-o===i.pagination.perPageCount){const t=[];for(let e=s;e<n;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const t=[];for(let e=s;e<Math.min(n,s+1);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}else{const t=[];for(let r=e+o;r<e+o+1;r++)i.transpose?t.push({col:r,row:0}):t.push({col:0,row:r});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}(t,e,this)}addRecords(t,e){!function(t,e,i){var o,r;if(i.options.groupBy)null===(r=(o=i.dataSource).addRecordsForGroup)||void 0===r||r.call(o,t),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordsForSorted(t),N_(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{void 0===e||e>i.dataSource.sourceLength?e=i.dataSource.sourceLength:e<0&&(e=0);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecords(t,e);const r=i.transpose?i.colCount:i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const n=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:s,currentPage:a}=i.pagination,l=s*(a||0)+s;if(e<l)if(e<l-s)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const a=e-(l-s)+o;if(r-o===i.pagination.perPageCount){const t=[];for(let e=a;e<n;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const e=[];for(let o=a;o<Math.min(n,a+(Array.isArray(t)?t.length:1));o++)i.transpose?e.push({col:o,row:0}):e.push({col:0,row:o});i.transpose?i.scenegraph.updateCol([],e,[]):i.scenegraph.updateRow([],e,[])}}}else{const r=[];for(let n=e+o;n<e+o+(Array.isArray(t)?t.length:1);n++)i.transpose?r.push({col:n,row:0}):r.push({col:0,row:n});i.transpose?i.scenegraph.updateCol([],r,[]):i.scenegraph.updateRow([],r,[])}}}(t,e,this)}deleteRecords(t){!function(t,e){var i,o;if((null==t?void 0:t.length)>0)if(e.options.groupBy)null===(o=(i=e.dataSource).deleteRecordsForGroup)||void 0===o||o.call(i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.deleteRecordsForSorted(t),N_(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.dataSource.deleteRecords(t);if(0===i.length)return;const o=e.transpose?e.colCount:e.rowCount;e.refreshRowColCount();const r=e.transpose?e.colCount:e.rowCount,n=i.sort(((t,e)=>t-e)),s=n[0];if(e.pagination){const{perPageCount:t,currentPage:i}=e.pagination,n=t*(i||0)+t;if(s<n)if(s<n-t)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=[],a=[];for(let o=s-(n-t)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount);o<r;o++)e.transpose?i.push({col:o,row:0}):i.push({col:0,row:o});if(r<o)for(let t=r;t<o;t++)e.transpose?a.push({col:t,row:0}):a.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(a,[],i):e.scenegraph.updateRow(a,[],i)}}else{const t=[];for(let i=0;i<n.length;i++){const o=n[i]+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount);e.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}e.transpose?e.scenegraph.updateCol(t,[],[]):e.scenegraph.updateRow(t,[],[])}}}(t,this)}updateRecords(t,e){!function(t,e,i){var o,r;if((null==e?void 0:e.length)>0)if(i.options.groupBy)null===(r=(o=i.dataSource).updateRecordsForGroup)||void 0===r||r.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.updateRecordsForSorted(t,e),N_(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const o=i.dataSource.updateRecords(t,e);if(0===o.length)return;const r=o.sort(((t,e)=>t-e));if(i.pagination){const{perPageCount:t,currentPage:e}=i.pagination,o=t*(e||0)+t,n=[];for(let e=0;e<r.length;e++){const s=r[e];if(s<o&&s>=o-t){const e=s-(o-t)+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount);n.push(e)}}if(n.length>=1){const t=[];for(let e=0;e<n.length;e++){const o=n[e];i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}else{const t=[];for(let e=0;e<r.length;e++){const o=r[e]+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount);i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}}(t,e,this)}_hasCustomRenderOrLayout(){var t,e,i,o;const{headerObjects:r}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let n=0;n<r.length;n++){const s=r[n];if((null===(t=null==s?void 0:s.define)||void 0===t?void 0:t.customLayout)||(null===(e=null==s?void 0:s.define)||void 0===e?void 0:e.headerCustomLayout)||(null===(i=null==s?void 0:s.define)||void 0===i?void 0:i.customRender)||(null===(o=null==s?void 0:s.define)||void 0===o?void 0:o.headerCustomRender))return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),i=[];for(let t=0;t<e.length;t++){const o=e[t].columnDefine.aggregator;if(delete e[t].columnDefine,o){const r={col:e[t].col,aggregateValue:null};if(r.aggregateValue=[],Array.isArray(o))for(let t=0;t<o.length;t++)r.aggregateValue.push({aggregationType:o[t].type,value:o[t].value()});else r.aggregateValue.push({aggregationType:o.type,value:o.value()});i.push(r)}}return i}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var i;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),r=null!==(i=this.dataSource.getGroupLength())&&void 0!==i?i:0;let n=rt(o)?o.length-1:0;return r>0&&n===r&&(n=void 0),n}}function j_(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b){var m,C,y,w,x,S,_,A,R,B,M,T,P,k,L,H,E,z,F,I,O,D,W,N;if(!t){const s=XC(r,n,p,g);b&&(t=g.scenegraph.highPerformanceGetCell(r,n,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:a,height:l,lineWidth:null!==(C=null===(m=null==p?void 0:p.group)||void 0===m?void 0:m.lineWidth)&&void 0!==C?C:void 0,fill:null!==(w=null===(y=null==p?void 0:p.group)||void 0===y?void 0:y.fill)&&void 0!==w?w:void 0,stroke:null!==(S=null===(x=null==p?void 0:p.group)||void 0===x?void 0:x.stroke)&&void 0!==S?S:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(A=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(B=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.cursor)&&void 0!==B?B:void 0,lineDash:null!==(T=null===(M=null==p?void 0:p.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),t&&"cell"===t.role||((t=new jC({x:i,y:o,width:a,height:l,lineWidth:null!==(k=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.lineWidth)&&void 0!==k?k:void 0,fill:null!==(H=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.fill)&&void 0!==H?H:void 0,stroke:null!==(z=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.stroke)&&void 0!==z?z:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(I=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==p?void 0:p.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==p?void 0:p.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",t.col=r,t.row=n,null==e||e.addCellGroup(t))}let G;if(u){let t=r,e=n;v&&(t=v.start.col,e=v.start.row),G=g.getCellIcons(t,e)}let j=0,U=0;if(Array.isArray(G)&&0!==G.length){const{leftIconWidth:e,rightIconWidth:i,absoluteLeftIconWidth:o,absoluteRightIconWidth:r}=ty(G,t,v,g);j=e+i,U=e,t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+a-i-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+a-r-h[1])})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(l-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",l-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])}))}const V=function(t,e,i,o,r,n,s,a,l){var h,d,c,u;const g=l._getCellStyle(t,e),p=VC("size",g,t,e,l),f=VC("spaceBetweenTextAndIcon",g,t,e,l),v=VC("defaultFill",g,t,e,l),b=VC("defaultStroke",g,t,e,l),m=VC("disableFill",g,t,e,l),C=VC("checkedFill",g,t,e,l),y=VC("checkedStroke",g,t,e,l),w=VC("disableCheckedFill",g,t,e,l),x=VC("disableCheckedStroke",g,t,e,l),S=VC("checkIconImage",g,t,e,l),_=VC("indeterminateIconImage",g,t,e,l),A=l.getCellValue(t,e),R=l.getCellOriginValue(t,e);let B,M,T=null!==(h=A)&&void 0!==h?h:"";Q(A)?(B=A.checked,M=A.disable,T=null!==(d=A.text)&&void 0!==d?d:""):"boolean"==typeof A&&(B=A,T=""),B=l.stateManager.syncCheckedState(t,e,a.field,B);const P=$C(t,e,l),k=l._getCellStyle(t,e),L=null!==(c=k.autoWrapText)&&void 0!==c?c:l.internalProps.autoWrapText,{lineClamp:H}=k,{checked:E,disable:z}=a;if(null==B||"function"==typeof B){const i=mb(E,{col:t,row:e,table:l,context:null,value:A,dataValue:R});B=l.stateManager.syncCheckedState(t,e,a.field,i)}const F=mb(z,{col:t,row:e,table:l,context:null,value:A,dataValue:R}),I="auto"===i,O=l.isAutoRowHeight(e),D={text:1===T.length?T[0]:T,maxLineWidth:I?1/0:o-(n[1]+n[3]+P)-p-f,textBaseline:"top",autoWrapText:L,lineClamp:H,wordBreak:"break-word",heightLimit:O?-1:r-Math.floor(n[0]+n[2]),pickable:!1,dx:P,whiteSpace:1!==T.length||L?"normal":"no-wrap"},W={x:0,y:0,text:s.text?Object.assign({},s.text,D):D,icon:{width:Math.floor(p/1.4),height:Math.floor(p/1.4)},box:{width:p,height:p},spaceBetweenTextAndIcon:f,disabled:null!==(u=null!=M?M:F)&&void 0!==u&&u};"indeterminate"===B?(W.checked=void 0,W.indeterminate=!0):(W.checked=B,W.indeterminate=void 0),v&&(W.box.fill=v),b&&(W.box.stroke=b),m&&(W.box.disableFill=m),C&&(W.box.checkedFill=C),y&&(W.box.checkedStroke=y),w&&(W.box.disableCheckedFill=w),x&&(W.box.disableCheckedStroke=x),S&&(W.icon.checkIconImage=S),_&&(W.icon.indeterminateIconImage=_);const N=new Uf(W);return N.name="checkbox",N}(r,n,s-j,a,l,h,p,f,g);return V&&t.appendChild(V),V.render(),a-=h[1]+h[3]+j,l-=h[0]+h[2],"center"===d?V.setAttribute("x",h[3]+U+(a-V.AABBBounds.width())/2):"right"===d?V.setAttribute("x",h[3]+U+a-V.AABBBounds.width()):V.setAttribute("x",h[3]+U),"middle"===c?V.setAttribute("y",h[0]+(l-V.AABBBounds.height())/2):"bottom"===c?V.setAttribute("y",h[0]+l-V.AABBBounds.height()):V.setAttribute("y",h[0]),t}function U_(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f,v,b,m,C,y,w,x,S,_,A,R;if(!t){const s=XC(r,n,g,u);(t=new jC({x:i,y:o,width:a,height:l,lineWidth:null!==(v=null===(f=null==g?void 0:g.group)||void 0===f?void 0:f.lineWidth)&&void 0!==v?v:void 0,fill:null!==(m=null===(b=null==g?void 0:g.group)||void 0===b?void 0:b.fill)&&void 0!==m?m:void 0,stroke:null!==(y=null===(C=null==g?void 0:g.group)||void 0===C?void 0:C.stroke)&&void 0!==y?y:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(x=null===(w=null==g?void 0:g.group)||void 0===w?void 0:w.strokeArrayColor)&&void 0!==x?x:void 0,cursor:null!==(_=null===(S=null==g?void 0:g.group)||void 0===S?void 0:S.cursor)&&void 0!==_?_:void 0,lineDash:null!==(R=null===(A=null==g?void 0:g.group)||void 0===A?void 0:A.lineDash)&&void 0!==R?R:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",t.col=r,t.row=n,null==e||e.addCellGroup(t)}const{width:B,height:M}=function(t,e,i,o,r,n,s,a,l,h){var d,c;const u=h._getCellStyle(t,e);let g=VC("size",u,t,e,h),p=VC("innerRadius",u,t,e,h),f=VC("outerRadius",u,t,e,h);const v=VC("spaceBetweenTextAndIcon",u,t,e,h),b=VC("spaceBetweenRadio",u,t,e,h),m=VC("defaultFill",u,t,e,h),C=VC("defaultStroke",u,t,e,h),y=VC("disableFill",u,t,e,h),w=VC("checkedFill",u,t,e,h),x=VC("checkedStroke",u,t,e,h),S=VC("disableCheckedFill",u,t,e,h),_=VC("disableCheckedStroke",u,t,e,h);at(f)?g=2*f:f=Math.round(g/2),(!at(p)||p<0)&&(p=Math.round(f/7*3));const A=h.getCellValue(t,e),R=h.getCellOriginValue(t,e),B=$C(t,e,h),M=h._getCellStyle(t,e),T=null!==(d=M.autoWrapText)&&void 0!==d?d:h.internalProps.autoWrapText,{lineClamp:P}=M,k="auto"===i,L="autoHeight"===h.heightMode,H={maxLineWidth:k?1/0:o-(n[1]+n[3]+B)-g-v,textBaseline:"top",autoWrapText:T,lineClamp:P,wordBreak:"break-word",heightLimit:L?-1:r-Math.floor(n[0]+n[2]),pickable:!1,dx:B},E={x:0,y:0,text:s.text?Object.assign({},s.text,H):H,circle:{innerRadius:p,outerRadius:f},spaceBetweenTextAndIcon:v};m&&(E.circle.fill=m),C&&(E.circle.stroke=C),y&&(E.circle.disableFill=y),w&&(E.circle.checkedFill=w),x&&(E.circle.checkedStroke=x),S&&(E.circle.disableCheckedFill=S),_&&(E.circle.disableCheckedStroke=_);let z=0,F=0;const I=null!==(c=a.radioDirectionInCell)&&void 0!==c?c:"vertical";if(rt(A))A.forEach(((i,o)=>{const r=V_(i,R,o,t,e,a,T,E,h);r&&l.appendChild(r),r.id=`radio-${t}-${e}-${o}`,r.render();const n=r.AABBBounds;"vertical"===I?(r.setAttribute("y",F),F+=n.height()+(o!==A.length-1?b:0),z=Math.max(z,n.width())):"horizontal"===I&&(r.setAttribute("x",z),z+=n.width()+(o!==A.length-1?b:0),F=Math.max(F,n.height()))}));else{const i=V_(A,R,void 0,t,e,a,T,E,h);i&&l.appendChild(i),i.id=`radio-${t}-${e}`,i.render();const o=i.AABBBounds;z=o.width(),F=o.height()}return{width:z,height:F}}(r,n,s,a,l,h,g,p,t,u);return a-=h[1]+h[3],l-=h[0]+h[2],t.forEachChildren((t=>{"center"===d?t.setAttribute("x",h[3]+t.attribute.x+(a-B)/2):"right"===d?t.setAttribute("x",h[3]+t.attribute.x+a-B):t.setAttribute("x",h[3]+t.attribute.x),"middle"===c?t.setAttribute("y",h[0]+t.attribute.y+(l-M)/2):"bottom"===c?t.setAttribute("y",h[0]+t.attribute.y+l-M):t.setAttribute("y",h[0]+t.attribute.y)})),t}function V_(t,e,i,o,r,n,s,a,l){const h=function(t,e,i,o,r,n,s){var a,l;const h=null!==(a=n.radioCheckType)&&void 0!==a?a:"column";let d,c;return Q(t)?d=t.checked:"boolean"==typeof t&&(d=t),d=s.stateManager.syncRadioState(o,r,n.field,h,i,d),null!=d&&"function"!=typeof d||(c=mb(n.checked,{col:o,row:r,table:s,context:null,value:t,dataValue:e}),d=s.stateManager.syncRadioState(o,r,n.field,h,i,c)),null!==(l=null!=d?d:c)&&void 0!==l&&l}(t,e,i,o,r,n,l),d=function(t,e,i,o,r,n){var s;let a;Q(t)&&(a=t.disable);const l=mb(r.disable,{col:i,row:o,table:n,context:null,value:t,dataValue:e});return null!==(s=null!=a?a:l)&&void 0!==s&&s}(t,e,o,r,n,l),c=Q(t)?t.text:K(t)?"":null!=t?t:"",u=xt({},a,{checked:h,disabled:d,text:{text:1===c.length?c[0]:c,whiteSpace:1!==c.length||s?"normal":"no-wrap"},boundsPadding:0}),g=new Vf(u);return g.name="radio",g}function X_(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p,f,v,b,m){var C,y,w,x,S,_,A,R,B,M,T,P,k,L,H,E,z,F,I,O,D,W,N,G,j,U,V,X,Y,$,K,q;const Z=t._getCellStyle(n,s),Q=function(t,e,i,o,r){const n=e&&J(e[t])?e[t]:void 0;if("function"==typeof n)return n({col:i,row:o,table:r,value:r.getCellValue(i,o),dataValue:r.getCellOriginValue(i,o),cellHeaderPaths:r.getCellHeaderPaths(i,o)})}("padding",Z,n,s,t);J(Q)&&(d=Q),(null===(C=null==v?void 0:v.text)||void 0===C?void 0:C.textAlign)&&(c=null===(y=null==v?void 0:v.text)||void 0===y?void 0:y.textAlign),(null===(w=null==v?void 0:v.text)||void 0===w?void 0:w.textBaseline)&&(u=null===(x=null==v?void 0:v.text)||void 0===x?void 0:x.textBaseline);const tt=t.isAutoRowHeight(s),et="auto"===a,it=null!==(S=Z.autoWrapText)&&void 0!==S?S:t.internalProps.autoWrapText,ot=Z.lineClamp,rt=XC(n,s,v,t);let nt;if(m&&(nt=t.scenegraph.getCell(n,s,!0),nt&&"cell"===nt.role&&nt.setAttributes({x:o,y:r,width:l,height:h,lineWidth:null!==(A=null===(_=null==v?void 0:v.group)||void 0===_?void 0:_.lineWidth)&&void 0!==A?A:void 0,fill:null!==(B=null===(R=null==v?void 0:v.group)||void 0===R?void 0:R.fill)&&void 0!==B?B:void 0,stroke:null!==(T=null===(M=null==v?void 0:v.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:null!=rt?rt:void 0,strokeArrayColor:null!==(k=null===(P=null==v?void 0:v.group)||void 0===P?void 0:P.strokeArrayColor)&&void 0!==k?k:void 0,cursor:null!==(H=null===(L=null==v?void 0:v.group)||void 0===L?void 0:L.cursor)&&void 0!==H?H:void 0,lineDash:null!==(z=null===(E=null==v?void 0:v.group)||void 0===E?void 0:E.lineDash)&&void 0!==z?z:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius})),nt&&"cell"===nt.role||(nt=new jC({x:o,y:r,width:l,height:h,lineWidth:null!==(I=null===(F=null==v?void 0:v.group)||void 0===F?void 0:F.lineWidth)&&void 0!==I?I:void 0,fill:null!==(D=null===(O=null==v?void 0:v.group)||void 0===O?void 0:O.fill)&&void 0!==D?D:void 0,stroke:null!==(N=null===(W=null==v?void 0:v.group)||void 0===W?void 0:W.stroke)&&void 0!==N?N:void 0,strokeArrayWidth:null!=rt?rt:void 0,strokeArrayColor:null!==(j=null===(G=null==v?void 0:v.group)||void 0===G?void 0:G.strokeArrayColor)&&void 0!==j?j:void 0,cursor:null!==(V=null===(U=null==v?void 0:v.group)||void 0===U?void 0:U.cursor)&&void 0!==V?V:void 0,lineDash:null!==(Y=null===(X=null==v?void 0:v.group)||void 0===X?void 0:X.lineDash)&&void 0!==Y?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius}),nt.role="cell",nt.col=n,nt.row=s,null==i||i.addCellGroup(nt)),p&&nt.appendChild(p),f){const i=e;let o;if(g){let e=n,i=s;b&&(e=b.start.col,i=b.start.row),o=t.getCellIcons(e,i)}if(function(t,e,i,o,r,n,s,a,l,h,d,c,u,g,p){var f,v,b,m,C;let y,w=0,x=0,S=0;if(Array.isArray(e)&&0!==e.length){const{inlineFrontIcons:f,inlineEndIcons:_,contentLeftIcons:A,contentRightIcons:R,leftIconWidth:B,rightIconWidth:M,absoluteRightIconWidth:T}=ty(e,t,p,u);let P;if(w=B,x=M,S=T,0===f.length&&0===_.length){let e=0;at(u.theme._contentOffset)&&("left"===d?e=u.theme._contentOffset:"right"===d&&(e=-u.theme._contentOffset));const c=p?$C(p.start.col,p.start.row,u):$C(t.col,t.row,u),{text:f,moreThanMaxCharacters:b}=KC(i,u),m={text:1===f.length?f[0]:f,moreThanMaxCharacters:b,maxLineWidth:r?1/0:l-(o[1]+o[3])-w-x-c,textBaseline:"top",heightLimit:n&&!(null===(v=u.options.customConfig)||void 0===v?void 0:v.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,autoWrapText:s,lineClamp:a,wordBreak:"break-word",whiteSpace:1!==f.length||s?"normal":"no-wrap",dx:("left"===d?A.length?0:c:0)+e},C=new Gl(g.text?Object.assign({},g.text,m):m);C.name="text",P=C}else{const e=Object.assign({text:null==i?void 0:i.toString()},(null===(C=null===(m=null===(b=t.parent)||void 0===b?void 0:b.theme)||void 0===m?void 0:m.userTheme)||void 0===C?void 0:C.text)||{});g.text&&Object.assign(e,g.text),e.textBaseline="middle";const a=[...f.map((t=>ZC(t))),e,..._.map((t=>ZC(t)))];a[0].textAlign=d;const u=new bd({width:r?0:l-(o[1]+o[3])-w-x,height:n&&s?0:Math.ceil(h-(o[0]+o[2])),textConfig:a,verticalDirection:n&&s?"top":c,ellipsis:e.ellipsis});u.name="text",P=u,u.bindIconEvent()}if(0!==A.length||0!==R.length){const e=new YC({x:0,y:0,fill:!1,stroke:!1,pickable:!1});e.name="content",e.setCellContentOption({autoWidth:r,autoHeight:n,cellWidth:l-(o[1]+o[3])-w-x,cellHeight:h-(o[0]+o[2]),align:d,baseline:c});const i={addedHierarchyOffset:0};A.forEach((o=>{const r=qC(o,void 0,t.col,t.row,p,u,i);r.role="icon-content-left",r.name=o.name,e.addLeftOccupyingIcon(r)})),R.forEach((o=>{const r=qC(o,void 0,t.col,t.row,p,u,i);r.role="icon-content-right",r.name=o.name,e.addRightOccupyingIcon(r)})),e.addContent(P),t.appendChild(e),e.layout(),y=e.AABBBounds.width(),e.AABBBounds.height()}else t.firstChild?t.insertBefore(P,t.firstChild):t.appendChild(P),y=P.AABBBounds.width(),P.AABBBounds.height()}else if(J(i)){const{text:e,moreThanMaxCharacters:v}=KC(i,u),b=p?$C(p.start.col,p.start.row,u):$C(t.col,t.row,u);let m=0;at(u.theme._contentOffset)&&("left"===d?m=u.theme._contentOffset:"right"===d&&(m=-u.theme._contentOffset));const C={text:1===e.length?e[0]:e,moreThanMaxCharacters:v,maxLineWidth:r?1/0:l-(o[1]+o[3]+b),textBaseline:"top",autoWrapText:s,lineClamp:a,wordBreak:"break-word",heightLimit:n&&!(null===(f=u.options.customConfig)||void 0===f?void 0:f.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,dx:("left"===d?b:0)+m,whiteSpace:1!==e.length||s?"normal":"no-wrap"},w=new Gl(g.text?Object.assign({},g.text,C):C);w.name="text",w.textBaseline=c,t.appendChild(w),y=w.AABBBounds.width(),w.AABBBounds.height()}const _=r?w+y+x:l-(o[1]+o[3]),A=h-(o[0]+o[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+o[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+_-x+o[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+_-S+o[3]+o[1]):"content"!==t.name&&"text"!==t.name||("center"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+w+(_-w-x)/2):"right"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+_-x):t.setAttribute("x",o[3]+w))})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",o[0]+(A-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",o[0]+A-t.AABBBounds.height()):t.setAttribute("y",o[0])})),t.setAttributes({width:_+o[1]+o[3],height:A+o[0]+o[2]})}(nt,o,i,d,et,tt,it,"number"==typeof ot?ot:void 0,nt.attribute.width,nt.attribute.height,c,u,t,v,b),null===($=null==v?void 0:v._vtable)||void 0===$?void 0:$.marked){const t=wd({x:nt.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",nt.appendChild(t)}}return p&&nt.setAttributes({width:Math.max(nt.attribute.width,null!==(K=p.attribute.width)&&void 0!==K?K:0),height:Math.max(nt.attribute.height,null!==(q=p.attribute.height)&&void 0!==q?q:0)}),nt}function Y_(t,e,i,o,r,n,s,a,l,h){var d,c,u,g,p,f;t.dependField&&(r=null!==(c=null===(d=l.getCellOriginRecord(n,s))||void 0===d?void 0:d[t.dependField])&&void 0!==c?c:r),t.barType=null!==(u=t.barType)&&void 0!==u?u:"default",t.min=null!==(g=mb(t.min,{col:n,row:s,table:l,value:o,dataValue:r,cellHeaderPaths:void 0}))&&void 0!==g?g:0,t.max=null!==(p=mb(t.max,{col:n,row:s,table:l,value:o,dataValue:r,cellHeaderPaths:void 0}))&&void 0!==p?p:t.min+100;let v=0;v=h?l.getRowsHeight(h.start.row,h.end.row):l.getRowHeight(s);let b=i,m=v,C=0;at(l.theme._contentOffset)&&(C=l.theme._contentOffset);const y=new jC({x:-C,y:-C,width:b,height:m});y.name="progress-bar";const{showBar:w,barColor:x,barBgColor:S,barPositiveColor:_,barNegativeColor:A,barAxisColor:R,barRightToLeft:B,showBarMark:M,barMarkPositiveColor:T,barMarkNegativeColor:P,barMarkWidth:k,barMarkPosition:L}=e;let{barHeight:H,barBottom:E,barPadding:z}=e;1===z.length?z=[z[0],z[0],z[0],z[0]]:2===z.length?z=[z[0],z[1],z[0],z[1]]:3===z.length&&(z=[z[0],z[1],z[2],z[1]]),z=z.map(((t,e)=>{if("string"==typeof t&&Bb.endsWith(t,"%")){const o=Number(t.substr(0,t.length-1));return 0===e||2===e?v*o/100:i*o/100}return Number(t)}));const F=Dm(VC("borderLineWidth",e,n,s,l)),I=Math.max(z[0],Math.ceil(F[0]/2)),O=Math.max(z[1],Math.floor(F[1]/2)),D=Math.max(z[2],Math.floor(F[2]/2)),W=Math.max(z[3],Math.ceil(F[3]/2));b-=O+W,m-=D+I,s===l.rowCount-1&&[0,"0"].includes(E)&&(m-=1);const N=I,G=W,j=b;if("string"==typeof H&&Bb.endsWith(H,"%")?(H=Number(H.substr(0,H.length-1)),H=m*H/100):H=Number(H),"string"==typeof E&&Bb.endsWith(E,"%")?(E=Number(E.substr(0,E.length-1)),E=m*E/100):E=Number(E),mb(w,{col:n,row:s,table:l,context:null,value:o,dataValue:r})){let e=`${r}`;Bb.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const i=Number(e);if(isNaN(i))return y;if("default"===(null!==(f=t.barType)&&void 0!==f?f:"default")){const e=i<t.min?0:i>t.max?1:(i-t.min)/(t.max-t.min),a=b,h=N+m-H-E;let d=Math.min(a*e,a);const c=B?G+j-d:G;n!==l.colCount-1||1!==e||B||(d-=1);const u=mb(S,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:e});if(u){const t=ad({x:c,y:h,width:a,height:H,fill:u});y.addChild(t)}const g=ad({x:c,y:h,width:d,height:H,fill:mb(x,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:e})||"#20a8d8"});y.addChild(g)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,a=t.max>0?t.max:0,h=e/(e+a),d=1-h,c=i>0?i/a:0,u=i<0?-i/e:0,g=b,p=N+m-H-E,f=G,C=mb(S,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c});if(C){const t=ad({x:f,y:p,width:g,height:H,fill:C});y.addChild(t)}const w=B?d*g:h*g,x=Math.min(g*h*u,g),z=B?{left:f+w,top:p,width:x,height:H}:{left:f+w-x,top:p,width:x,height:H},F=mb(A,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:u})||"#20a8d8",I=ad({x:z.left,y:z.top,width:z.width,height:z.height,fill:F});y.addChild(I);let O=Math.min(g*d*c,g);n!==l.colCount-1||1!==c||B||(O-=1);const D=B?{left:f+w-O,top:p,width:O,height:H}:{left:f+w,top:p,width:O,height:H},W=mb(_,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c})||"#20a8d8",j=ad({x:D.left,y:D.top,width:D.width,height:D.height,fill:W});y.addChild(j);const U=B?z.left:D.left,V=rd({x:0,y:0,stroke:mb(R,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c}),lineWidth:1,lineDash:[2,2],points:[{x:U,y:0},{x:U,y:v}]});if(y.addChild(V),M&&(c||u)){const t=k,e=[];let i;if(c>0)if(i=mb(T,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:c})||"#20a8d8","right"===L){const t=B?D.left+k/2:D.left+D.width-k/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===L&&(e.push({x:D.left,y:D.top+D.height-k/2}),e.push({x:D.left+D.width,y:D.top+D.height-k/2}));else if(u>0)if(i=mb(P,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:u})||"#20a8d8","right"===L){const t=B?z.left+z.width-k/2:z.left+k/2;e.push({x:t,y:z.top}),e.push({x:t,y:z.top+z.height})}else"bottom"===L&&(e.push({x:z.left,y:z.top+z.height-k/2}),e.push({x:z.left+z.width,y:z.top+z.height-k/2}));const a=rd({x:0,y:0,stroke:i,lineWidth:t,points:e});y.addChild(a)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,a=t.max>0?t.max:0,h=Math.max(e,a),d=0===h?0:Math.abs(i)/h,c=b;let u=Math.min(c*d,c);n!==l.colCount-1||1!==d||B||(u-=1);const g=N+m-H-E,p=B?G+j-u:G,f=mb(S,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d});if(f){const t=ad({x:p,y:g,width:c,height:H,fill:f});y.addChild(t)}const v={left:p,top:g,width:u,height:H};let C;C=i>=0?mb(_,{col:n,row:s,table:l,context:null,value:o,percentile:d,dataValue:r})||"#20a8d8":mb(A,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d})||"#20a8d8";const w=ad({x:v.left,y:v.top,width:v.width,height:v.height,fill:C});if(y.addChild(w),M&&i){const t=k,e=[];let a;if(a=i>=0?mb(T,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d})||"#20a8d8":mb(P,{col:n,row:s,table:l,context:null,value:o,dataValue:r,percentile:d})||"#20a8d8","right"===L){const t=B?v.left+k/2:v.left+v.width-k/2;e.push({x:t,y:v.top}),e.push({x:t,y:v.top+v.height})}else"bottom"===L&&(e.push({x:v.left,y:v.top+v.height-k/2}),e.push({x:v.left+v.width,y:v.top+v.height-k/2}));const h=rd({x:0,y:0,stroke:a,lineWidth:t,points:e});y.addChild(h)}}}return y}hm.registerFunction("createTextCellGroup",X_);class $_ extends G_{}Yf();const K_=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function q_(t,e,i){let o,r,n,s,a,l,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,n=r;return r=void 0,o=void 0,h=e,s=t.apply(n,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-l;return void 0===l||i>=e||i<0||d&&t-h>=n}function b(){const t=Date.now();if(v(t))return function(t){return a=void 0,u&&o?p(t):(r=void 0,o=void 0,s)}(t);a=f(b,function(t){const i=t-h,o=e&&-(t-l);return d?Math.min(o,n-i):o}(t))}return e=+e||0,K_(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(n=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(...t){const i=Date.now(),n=v(i);if(o=t,r=this,l=i,n){if(void 0===a)return function(t){return h=t,a=f(b,e),c?p(t):s}(l);if(d)return a=f(b,e),p(l)}return void 0===a&&(a=f(b,e)),s}}let Z_=1;class J_{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,i){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=q_(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb({...this.lastSize,windowSizeNotChange:e})};setSize(t){this.lastSize=t}onResize=()=>{this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}class Q_{resizeTime;listeners={};reseizeListeners={};on(t,e,i,...o){if("node"===Kf.mode)return-1;const r=Z_++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,i,...o);else{const e=new J_(t,i,this.resizeTime);this.reseizeListeners[r]=e}const n={target:t,type:e,listener:i,options:o};return this.listeners[r]=n,r}once(t,e,i,...o){if("node"===Kf.mode)return-1;const r=this.on(t,e,((...t)=>{this.off(r),i(...t)}),...o);return r}off(t){if("node"===Kf.mode)return;if(null==t)return;const e=this.listeners?.[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...i){if("node"!==Kf.mode)for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&r.listener.call(r.target,...i)}}hasListener(t,e){if("node"===Kf.mode)return!1;let i=!1;for(const o in this.listeners){const r=this.listeners[o];r.target===t&&r.type===e&&(i=!0)}return i}clear(){if("node"!==Kf.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];e?.disConnect()}this.listeners={}}}release(){"node"!==Kf.mode&&(this.clear(),this.listeners={})}}let tA=1;function eA(){return av?tA=1:(tA=Math.ceil(window.devicePixelRatio||1),tA>1&&tA%2!=0&&(tA+=1)),tA}eA();class iA{_gantt;_eventHandler;isDown=!1;isDraging=!1;lastDragPointerXYOnWindow;constructor(t){this._gantt=t,this._eventHandler=new Q_,this.bindEvent()}release(){this._eventHandler.release()}bindEvent(){!function(t){const o=t._gantt.scenegraph,r=t._gantt,n=r.stateManager;let s;o.tableGroup.addEventListener("pointerdown",(t=>{if(s="down",0!==t.button)return;const i=t.detailPath.find((t=>"task-bar"===t.name));i&&("task-bar-hover-shadow-left-icon"===t.target.name?(n.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"left"),n.updateInteractionState(e.grabing)):"task-bar-hover-shadow-right-icon"===t.target.name?(n.startResizeTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y,"right"),n.updateInteractionState(e.grabing)):r.parsedOptions.taskBarMoveable&&(n.startMoveTaskBar(i,t.nativeEvent.x,t.nativeEvent.y,t.offset.y),n.updateInteractionState(e.grabing)))})),o.tableGroup.addEventListener("pointermove",(t=>{if("down"===s){const e=r.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=r.eventManager.lastDragPointerXYOnWindow.y,n=t.y;(i>=1||n-o>=1)&&(s="draging")}if(n.interactionState===e.default){t.detailPath.find((t=>"task-bar"===t.name))?n.showTaskBarHover(t):n.hideTaskBarHover(t)}})),o.tableGroup.addEventListener("pointerup",(t=>{if("down"===s&&r.hasListeners(i.CLICK_TASK_BAR)){const e=hv(t.nativeEvent.y,r),o=r.getRecordByIndex(e);r.fireListeners(i.CLICK_TASK_BAR,{event:t.nativeEvent,index:e,record:o})}s="up"})),o.tableGroup.addEventListener("pointerenter",(t=>{(r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.horizontalVisible||!r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.showHorizontalScrollBar(),(r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.verticalVisible||!r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.showVerticalScrollBar()})),o.tableGroup.addEventListener("pointerleave",(t=>{(r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.horizontalVisible||!r.parsedOptions.scrollStyle.horizontalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.hideHorizontalScrollBar(),(r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.verticalVisible||!r.parsedOptions.scrollStyle.verticalVisible&&"focus"===r.parsedOptions.scrollStyle.visible)&&o.scrollbarComponent.hideVerticalScrollBar()}))}(this),function(t){const i=t._gantt;t._gantt.scenegraph;const o=i.stateManager,r=t._eventHandler;r.on(i.getElement(),"wheel",(e=>{sv(e,o,t._gantt)})),r.on(i.getContainer(),"resize",(t=>{0===t.width&&0===t.height||(J(i.options.pixelRatio)||i.setPixelRatio(eA()),t.windowSizeNotChange||i._resize())})),i.taskListTableInstance&&i.parsedOptions.verticalSplitLineMoveable&&r.on(i.verticalSplitResizeLine,"mousedown",(t=>{o.updateInteractionState(e.grabing),o.startResizeTableWidth(t)}));i.parsedOptions.verticalSplitLineHighlight&&(i.verticalSplitResizeLine&&r.on(i.verticalSplitResizeLine,"mouseover",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="1"})),i.verticalSplitResizeLine&&r.on(i.verticalSplitResizeLine,"mouseout",(t=>{i.verticalSplitResizeLine.childNodes[1].style.opacity="0"})));cc.addEventListener("mousedown",(t=>{i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y}})),cc.addEventListener("mousemove",(t=>{if(o.interactionState===e.grabing){const e=i.eventManager.lastDragPointerXYOnWindow?.x??t.x;Math.abs(e-t.x)>=1&&(o.isResizingTableWidth()?o.dealResizeTableWidth(t):o.isMoveingTaskBar()?o.dealTaskBarMove(t):o.isResizingTaskBar()&&o.dealTaskBarResize(t),i.eventManager.lastDragPointerXYOnWindow={x:t.x,y:t.y})}})),cc.addEventListener("mouseup",(t=>{"grabing"===o.interactionState&&(o.updateInteractionState(e.default),o.isResizingTableWidth()?o.endResizeTableWidth():o.isMoveingTaskBar()?o.endMoveTaskBar(t.x):o.isResizingTaskBar()&&o.endResizeTaskBar(t.x))}))}(this)}}function oA(t){const{scroll:e}=t.stateManager,{verticalBarPos:i}=e;t.taskListTableInstance.stateManager.setScrollTop(i,void 0,!1)}class rA{friction;lastTime;speedX;speedY;runingId;stopped;scrollHandle;constructor(){}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.stopped=!1,this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){if(this.stopped)return;const t=Date.now(),e=t-this.lastTime;let i=!0;const o=Math.pow(this.friction,e/16),r=o*this.speedX,n=o*this.speedY;let s=0,a=0;Math.abs(r)>.05&&(i=!1,s=(this.speedX+r)/2*e),Math.abs(n)>.05&&(i=!1,a=(this.speedY+n)/2*e),this.scrollHandle?.(s,a),i?this.runingId=null:(this.lastTime=t,this.speedX=r,this.speedY=n,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null,this.stopped=!0}isInertiaScrolling(){return!!this.runingId}}class nA{_gantt;scroll;fastScrolling;interactionState=e.default;moveTaskBar;hoverTaskBar;resizeTaskBar;resizeTableWidth;resetInteractionState=q_((()=>{this.updateInteractionState(e.default)}),100);constructor(t){this._gantt=t,this.scroll={horizontalBarPos:0,verticalBarPos:0},this.moveTaskBar={targetStartX:null,deltaX:0,startOffsetY:null,startX:null,startY:null,moving:!1,target:null,moveTaskBarXSpeed:0,moveTaskBarXInertia:new rA},this.hoverTaskBar={targetStartX:null,startX:null,target:null},this.resizeTaskBar={startOffsetY:null,targetStartX:null,startX:null,startY:null,target:null,resizing:!1,onIconName:""},this.resizeTableWidth={lastX:null,resizing:!1},this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this),function(t){t.taskListTableInstance&&t.taskListTableInstance?.on("scroll",(e=>{if("vertical"===e.scrollDirection){const{scroll:e}=t.taskListTableInstance.stateManager,{verticalBarPos:i}=e;t.stateManager.setScrollTop(i,!1)}}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_cell_value",(e=>{const{col:i,row:o,rawValue:r,changedValue:n}=e;t._refreshTaskBar(o-t.taskListTableInstance.columnHeaderLevelCount)}))}(this._gantt),function(t){t.taskListTableInstance?.on("change_header_position",(e=>{t.scenegraph.refreshTaskBars();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt),function(t){t.taskListTableInstance?.on("tree_hierarchy_state_change",(e=>{t._syncPropsFromTable(),t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.scenegraph.refreshTaskBarsAndGrid();const i=t.stateManager.scroll.horizontalBarPos,o=t.stateManager.scroll.verticalBarPos;t.scenegraph.setX(-i),t.scenegraph.setY(-o)}))}(this._gantt)}setScrollTop(t,e=!0){const o=this._gantt.getAllRowsHeight();t=Math.max(0,Math.min(t,o-this._gantt.scenegraph.height)),t=Math.ceil(t);const r=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-t);const n=t/(o-this._gantt.scenegraph.height);this._gantt.scenegraph.scrollbarComponent.updateVerticalScrollBarPos(n),r!==t&&e&&(oA(this._gantt),this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:n}))}get scrollLeft(){return this.scroll.horizontalBarPos}get scrollTop(){return this.scroll.verticalBarPos}setScrollLeft(t,e=!0){const o=this._gantt._getAllColsWidth();t=Math.max(0,Math.min(t,o-this._gantt.scenegraph.width)),t=Math.ceil(t);const r=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-t);const n=t/(o-this._gantt.scenegraph.width);this._gantt.scenegraph.scrollbarComponent.updateHorizontalScrollBarPos(n),r!==t&&e&&this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioX:n})}updateInteractionState(t){if(this.interactionState===t)return;const i=this.interactionState;this.interactionState=t,i===e.scrolling&&e.default}updateVerticalScrollBar(t){const e=this._gantt.getAllRowsHeight();this.scroll.verticalBarPos,this.scroll.verticalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.height)),J(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this._gantt.scenegraph.setY(-this.scroll.verticalBarPos,1===t),oA(this._gantt),this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"vertical",scrollRatioY:t})}updateHorizontalScrollBar(t){const e=this._gantt._getAllColsWidth();this.scroll.horizontalBarPos,this.scroll.horizontalBarPos=Math.ceil(t*(e-this._gantt.scenegraph.width)),J(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this._gantt.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this._gantt.fireListeners(i.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollDirection:"horizontal",scrollRatioY:t})}startMoveTaskBar(t,e,i,o){"task-bar-hover-shadow"===t.name&&(t=t.parent),this.moveTaskBar.moving=!0,this.moveTaskBar.target=t,this.moveTaskBar.targetStartX=t.attribute.x,this.moveTaskBar.startX=e,this.moveTaskBar.startY=i,this.moveTaskBar.startOffsetY=o}isMoveingTaskBar(){return this.moveTaskBar.moving}endMoveTaskBar(t){this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()&&this.moveTaskBar.moveTaskBarXInertia.endInertia();const e=this.moveTaskBar.deltaX,o=Math.round(e/this._gantt.parsedOptions.colWidthPerDay),r=o*this._gantt.parsedOptions.colWidthPerDay,n=this.moveTaskBar.targetStartX+r;if(this._gantt.stateManager.moveTaskBar.target.setAttribute("x",n),Math.abs(o)>=1){const t=hv(this.moveTaskBar.startOffsetY,this._gantt),e=this._gantt.getRecordByIndex(t),r=e[this._gantt.parsedOptions.startDateField],n=e[this._gantt.parsedOptions.endDateField];if(this._gantt._updateDateToTaskRecord("move",o,t),this._gantt.hasListeners(i.CHANGE_DATE_RANGE)){const e=this._gantt.getRecordByIndex(t);this._gantt.fireListeners(i.CHANGE_DATE_RANGE,{startDate:e[this._gantt.parsedOptions.startDateField],endDate:e[this._gantt.parsedOptions.endDateField],oldStartDate:r,oldEndDate:n,index:t,record:e})}}this._gantt.scenegraph.updateNextFrame(),this.moveTaskBar.moving=!1,this.moveTaskBar.target=null,this.moveTaskBar.deltaX=0,this.moveTaskBar.moveTaskBarXSpeed=0}dealTaskBarMove(t){const e=this.moveTaskBar.target,i=this._gantt.eventManager.lastDragPointerXYOnWindow.x,o=t.x-i;this.moveTaskBar.deltaX+=o,e.setAttribute("x",e.attribute.x+o),e.attribute.x<=this._gantt.stateManager.scrollLeft&&o<0?(this.moveTaskBar.moveTaskBarXSpeed=-this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,i)=>{this.moveTaskBar.deltaX+=t,e.setAttribute("x",e.attribute.x+t),this._gantt.stateManager.setScrollLeft(e.attribute.x),0===this._gantt.stateManager.scrollLeft&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):e.attribute.x+e.attribute.width>=this._gantt.stateManager.scrollLeft+this._gantt.tableNoFrameWidth&&o>0?(this.moveTaskBar.moveTaskBarXSpeed=this._gantt.parsedOptions.colWidthPerDay/100,this.moveTaskBar.moveTaskBarXInertia.startInertia(this.moveTaskBar.moveTaskBarXSpeed,0,1),this.moveTaskBar.moveTaskBarXInertia.setScrollHandle(((t,i)=>{this.moveTaskBar.deltaX+=t,e.setAttribute("x",e.attribute.x+t),this._gantt.stateManager.setScrollLeft(e.attribute.x+e.attribute.width-this._gantt.tableNoFrameWidth),this._gantt.stateManager.scrollLeft===this._gantt._getAllColsWidth()-this._gantt.tableNoFrameWidth&&this.moveTaskBar.moveTaskBarXInertia.endInertia()}))):this.moveTaskBar.moveTaskBarXInertia.isInertiaScrolling()?this.moveTaskBar.moveTaskBarXInertia.endInertia():this.moveTaskBar.moveTaskBarXSpeed=0,this._gantt.scenegraph.updateNextFrame()}startResizeTaskBar(t,e,i,o,r){this.resizeTaskBar.onIconName=r,this.resizeTaskBar.resizing=!0,this.resizeTaskBar.target=t,this.resizeTaskBar.targetStartX=t.attribute.x,this.resizeTaskBar.startX=e,this.resizeTaskBar.startY=i,this.resizeTaskBar.startOffsetY=o}isResizingTaskBar(){return this.resizeTaskBar.resizing}endResizeTaskBar(t){const e=this._gantt.stateManager.resizeTaskBar.onIconName,o=t-this.resizeTaskBar.startX;if(Math.abs(o)>=1){let t=Math.round(o/this._gantt.parsedOptions.colWidthPerDay);t="left"===e?-t:t;const r=this._gantt.stateManager.resizeTaskBar.target,n=this._gantt.stateManager.resizeTaskBar.target.barRect,s=this._gantt.stateManager.resizeTaskBar.target.progressRect,a=hv(this.resizeTaskBar.startOffsetY,this._gantt),l=this._gantt.getRecordByIndex(a),h=l[this._gantt.parsedOptions.startDateField],d=l[this._gantt.parsedOptions.endDateField],{taskDays:c,progress:u}=this._gantt.getTaskInfoByTaskListIndex(a);t<0&&c+t<=0&&(t=1-c);const g=("left"===e?-t:t)*this._gantt.parsedOptions.colWidthPerDay,p=this.resizeTaskBar.targetStartX+g,f=this._gantt.parsedOptions.colWidthPerDay*(c+t);if("left"===e?(r.setAttribute("x",p),r.setAttribute("width",f),n?.setAttribute("width",r.attribute.width),s?.setAttribute("width",u/100*r.attribute.width),this._gantt._updateDateToTaskRecord("start-move",-t,a)):"right"===e&&(r.setAttribute("width",f),n?.setAttribute("width",r.attribute.width),s?.setAttribute("width",u/100*r.attribute.width),this._gantt._updateDateToTaskRecord("end-move",t,a)),this._gantt.scenegraph.taskBar.showHoverBar(r.attribute.x,r.attribute.y,r.attribute.width,r.attribute.height),sA(this._gantt,r,a),this.resizeTaskBar.resizing=!1,this.resizeTaskBar.target=null,Math.abs(t)>=1&&this._gantt.hasListeners(i.CHANGE_DATE_RANGE)){const t=this._gantt.getRecordByIndex(a);this._gantt.fireListeners(i.CHANGE_DATE_RANGE,{startDate:t[this._gantt.parsedOptions.startDateField],endDate:t[this._gantt.parsedOptions.endDateField],oldStartDate:h,oldEndDate:d,index:a,record:t})}this._gantt.scenegraph.updateNextFrame()}}dealTaskBarResize(t){const e=this._gantt.eventManager.lastDragPointerXYOnWindow.x,i=t.x-e,o=this._gantt.stateManager.resizeTaskBar.target,r=o.barRect,n=o.progressRect,s=o.textLabel,a=this._gantt.parsedOptions.progressField,l=hv(this.resizeTaskBar.startOffsetY,this._gantt),h=this._gantt.getRecordByIndex(l)[a];let d="left"===this._gantt.stateManager.resizeTaskBar.onIconName?-i:i,c=o.attribute.width+d;d<0&&c<=this._gantt.parsedOptions.colWidthPerDay&&(d=this._gantt.parsedOptions.colWidthPerDay-o.attribute.width,c+=d),o.setAttribute("width",c),"left"===this._gantt.stateManager.resizeTaskBar.onIconName&&o.setAttribute("x",o.attribute.x-d),r?.setAttribute("width",o.attribute.width),n?.setAttribute("width",h/100*o.attribute.width),s?.setAttribute("maxLineWidth",c-20);const u=o.attribute.x,g=o.attribute.y,p=o.attribute.width,f=o.attribute.height;this._gantt.scenegraph.taskBar.showHoverBar(u,g,p,f,this.resizeTaskBar.target),sA(this._gantt,o,l),this._gantt.scenegraph.updateNextFrame()}startResizeTableWidth(t){this.resizeTableWidth.resizing=!0,this.resizeTableWidth.lastX=t.pageX}isResizingTableWidth(){return this.resizeTableWidth.resizing}endResizeTableWidth(){this.resizeTableWidth.resizing=!1}dealResizeTableWidth(t){if(!this.resizeTableWidth.resizing)return;const e=t.pageX-this.resizeTableWidth.lastX;if(Math.abs(e)>=1){let i=this._gantt.taskTableWidth+e;const o=Math.min(this._gantt.taskListTableInstance.getAllColsWidth()+this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.maxTableWidth??1e5),r=Math.max(this._gantt.parsedOptions.outerFrameStyle.borderLineWidth,this._gantt.options.taskListTable.minTableWidth??0);e>0&&i>o&&(i=o),e<0&&i<r&&(i=r),this._gantt.taskTableWidth=i,this._gantt.element.style.left=this._gantt.taskTableWidth?`${this._gantt.taskTableWidth}px`:"0px",this._gantt.verticalSplitResizeLine.style.left=this._gantt.taskTableWidth?this._gantt.taskTableWidth-7+"px":"0px",this._gantt._resize(),this.resizeTableWidth.lastX=t.pageX}}showTaskBarHover(t){const e=t.detailPath.find((t=>"task-bar"===t.name));if(this._gantt.stateManager.hoverTaskBar.target!==e){this._gantt.stateManager.hoverTaskBar.target=e;const o=this._gantt.stateManager.hoverTaskBar.target,r=o.attribute.x,n=o.attribute.y,s=o.attribute.width,a=o.attribute.height;if(this._gantt.scenegraph.taskBar.showHoverBar(r,n,s,a,e),this._gantt.scenegraph.updateNextFrame(),this._gantt.hasListeners(i.MOUSEENTER_TASK_BAR)){const e=hv(t.offset.y,this._gantt),o=this._gantt.getRecordByIndex(e);this._gantt.fireListeners(i.MOUSEENTER_TASK_BAR,{event:t.nativeEvent,index:e,record:o})}}}hideTaskBarHover(t){if(this._gantt.stateManager.hoverTaskBar.target&&(this._gantt.stateManager.hoverTaskBar.target=null,this._gantt.scenegraph.taskBar.hideHoverBar(),this._gantt.scenegraph.updateNextFrame(),this._gantt.hasListeners(i.MOUSELEAVE_TASK_BAR))){const e=hv(t.offset.y,this._gantt),o=this._gantt.getRecordByIndex(e);this._gantt.fireListeners(i.MOUSELEAVE_TASK_BAR,{event:t.nativeEvent,index:e,record:o})}}}function sA(t,e,i){const o=t.parsedOptions.taskBarCustomLayout;if(o){let r;if("function"==typeof o){const{startDate:n,endDate:s,taskDays:a,progress:l,taskRecord:h}=t.getTaskInfoByTaskListIndex(i);r=o({width:e.attribute.width,height:e.attribute.height,index:i,startDate:n,endDate:s,taskDays:a,progress:l,taskRecord:h,ganttInstance:t})}else r=o;if(r){const t=r.rootContainer;t.name="task-bar-custom-render";const i=e.children.findIndex((t=>"task-bar-custom-render"===t.name)),o=e.children[i];e.removeChild(o),e.insertInto(t,i)}}}let aA=1,lA=class{listenersData={listeners:{},listenerData:{}};on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=aA++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const r=i.indexOf(e);i.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;this.listenersData.listenerData[e]?.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>J(t))):[]}release(){delete this.listenersData}};class hA{records;minDate;maxDate;_gantt;constructor(t){this._gantt=t,this.records=t.records,this.minDate=t.parsedOptions.minDate,this.maxDate=t.parsedOptions.maxDate,this.processRecords()}processRecords(){const t=!this.minDate,e=!this.maxDate;let i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;if(t||e){for(let r=0;r<this.records.length;r++){const n=this.records[r];if(t){const t=nv(n[this._gantt.parsedOptions.startDateField]);i=Math.min(i,t.getTime())}if(e){const t=nv(n[this._gantt.parsedOptions.endDateField]);o=Math.max(o,t.getTime())}}t&&(this.minDate=nv(i)),e&&(this.maxDate=nv(o)),this._gantt.parsedOptions.minDate=this.minDate,this._gantt.parsedOptions.maxDate=this.maxDate,this._gantt.parsedOptions._minDateTime=this._gantt.parsedOptions.minDate.getTime(),this._gantt.parsedOptions._maxDateTime=this._gantt.parsedOptions.maxDate.getTime()}}}hm.registerFunction("createCheckboxCellGroup",j_),hm.registerFunction("createProgressBarCell",Y_),hm.registerFunction("createRadioCellGroup",U_);var dA=Object.freeze({__proto__:null,formatDate:Jf,getTodayNearDay:function(t,e){const i=(new Date).getTime(),o=new Date(i+864e5*t);if(e){const t=o.getFullYear().toString(),i=(o.getMonth()+1).toString().padStart(2,"0"),r=o.getDate().toString().padStart(2,"0");return e=(e=(e=e.replace("yyyy",t)).replace("mm",i)).replace("dd",r)}return o},getWeekNumber:rv,getWeekday:function(t,e="long"){const i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=new Date(t);return"short"===e?i[o.getDay()].substr(0,3):"long"===e?i[o.getDay()]:'Invalid format specified. Please use "short" or "long".'}});t.Gantt=class extends lA{options;container;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;scenegraph;stateManager;eventManager;taskListTableInstance;canvas;element;verticalSplitResizeLine;horizontalSplitLine;context;timeLineHeaderLevel;itemCount;drawHeight;headerHeight;gridHeight;parsedOptions={};taskTableWidth;taskTableColumns;records;data;constructor(t,i){super(),this.container=t,this.options=i,this.taskTableWidth="number"==typeof i?.taskListTable?.tableWidth?i?.taskListTable?.tableWidth:-1,this.taskTableColumns=i?.taskListTable?.columns??[],this.records=i?.records??[],this._sortScales(),dv(this),this.data=new hA(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.element=function(t,e="vtable-gantt"){const i=document.createElement("div");i.setAttribute("tabindex","0"),i.classList.add(e),i.style.outline="none",i.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const o=(i.offsetWidth||i.parentElement?.offsetWidth||1)-1,r=(i.offsetHeight||i.parentElement?.offsetHeight||1)-1;return i.style.width=o&&o-t.left-t.right+"px"||"0px",i.style.height=r&&r-t.top-t.bottom+"px"||"0px",i}({top:0,right:0,left:0,bottom:0},"vtable-gantt"),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.canvas=document.createElement("canvas"),this.element.appendChild(this.canvas),this.context=this.canvas.getContext("2d"),t?(t.appendChild(this.element),this._updateSize()):this._updateSize(),this._generateListTable(),this._syncPropsFromTable(),function(t){if(t.parsedOptions.horizontalSplitLine&&(t.horizontalSplitLine=document.createElement("div"),t.horizontalSplitLine.style.position="absolute",t.horizontalSplitLine.style.top=t.getAllHeaderRowsHeight()+"px",t.horizontalSplitLine.style.left=t.tableY+"px",t.horizontalSplitLine.style.height=(t.parsedOptions.horizontalSplitLine.lineWidth??2)+"px",t.horizontalSplitLine.style.width=t.tableNoFrameWidth+(t.taskListTableInstance?.tableNoFrameWidth??0)+ +(t.taskListTableInstance?t.parsedOptions.verticalSplitLine.lineWidth:0)+"px",t.horizontalSplitLine.style.backgroundColor=t.parsedOptions.horizontalSplitLine.lineColor,t.horizontalSplitLine.style.zIndex="100",t.horizontalSplitLine.style.userSelect="none",t.horizontalSplitLine.style.opacity="1",t.container.appendChild(t.horizontalSplitLine)),t.taskListTableInstance){t.verticalSplitResizeLine=document.createElement("div"),t.verticalSplitResizeLine.style.position="absolute",t.verticalSplitResizeLine.style.top=t.tableY+"px",t.verticalSplitResizeLine.style.left=t.taskTableWidth?t.taskTableWidth-7+t.parsedOptions.verticalSplitLine.lineWidth/2+"px":"0px",t.verticalSplitResizeLine.style.width="14px",t.verticalSplitResizeLine.style.height=t.drawHeight+"px",t.verticalSplitResizeLine.style.backgroundColor="rgba(0,0,0,0)",t.verticalSplitResizeLine.style.zIndex="100",t.parsedOptions.verticalSplitLineMoveable&&(t.verticalSplitResizeLine.style.cursor="col-resize"),t.verticalSplitResizeLine.style.userSelect="none",t.verticalSplitResizeLine.style.opacity="1";const e=document.createElement("div");if(e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLine.lineWidth)/2+"px",e.style.width=t.parsedOptions.verticalSplitLine.lineWidth+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLine.lineColor,e.style.zIndex="100",e.style.userSelect="none",e.style.pointerEvents="none",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e),t.parsedOptions.verticalSplitLineHighlight){const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left=(14-t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)/2+"px",e.style.width=(t.parsedOptions.verticalSplitLineHighlight.lineWidth??2)+"px",e.style.height="100%",e.style.backgroundColor=t.parsedOptions.verticalSplitLineHighlight.lineColor,e.style.zIndex="100",e.style.cursor="col-resize",e.style.userSelect="none",e.style.pointerEvents="none",e.style.opacity="0",e.style.transition="background-color 0.3s",t.verticalSplitResizeLine.appendChild(e)}t.container.appendChild(t.verticalSplitResizeLine)}}(this),this.scenegraph=new class{dateStepWidth;rowHeight;_scales;timelineHeader;grid;taskBar;_gantt;tableGroup;scrollbarComponent;markLine;frameBorder;stage;tableGroupWidth;tableGroupHeight;constructor(t){let e,i;this._gantt=t,this.tableGroupWidth=t.tableNoFrameWidth,this.tableGroupHeight=Math.min(t.tableNoFrameHeight,t.drawHeight),"node"===Kf.mode||(cc.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=Bc({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,enableLayout:!0,autoRender:!1,context:{appName:"vtable"},pluginList:["poptipForText"]}),this.stage.gantt=this._gantt,this.stage.table=this._gantt,this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph()}initSceneGraph(){const t=this;t.tableGroup=new zn({x:t._gantt.tableX,y:t._gantt.tableY,width:this.tableGroupWidth,height:this.tableGroupHeight,clip:!0,pickable:!1}),t.stage.defaultLayer.add(t.tableGroup),t.tableGroup.name="table",t.timelineHeader=new pv(t),t.grid=new $f(t),t.taskBar=new mv(t),t.markLine=new Cv(t),t.frameBorder=new yv(t),t.scrollbarComponent=new qf(t._gantt),t.stage.defaultLayer.addChild(t.scrollbarComponent.hScrollBar),t.stage.defaultLayer.addChild(t.scrollbarComponent.vScrollBar)}afterCreateSceneGraph(){this.scrollbarComponent.updateScrollBar(),function(t){const i=t._gantt,o=i.stateManager,r=i.scenegraph;r.scrollbarComponent.vScrollBar.addEventListener("pointerover",(t=>{r.scrollbarComponent.showVerticalScrollBar()})),r.scrollbarComponent.hScrollBar.addEventListener("pointerover",(t=>{r.scrollbarComponent.showHorizontalScrollBar()})),r.scrollbarComponent.vScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&r.scrollbarComponent.hideVerticalScrollBar()})),r.scrollbarComponent.hScrollBar.addEventListener("pointerout",(t=>{o.interactionState!==e.scrolling&&r.scrollbarComponent.hideHorizontalScrollBar()})),r.scrollbarComponent.vScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),r.scrollbarComponent.vScrollBar.addEventListener("scrollDown",(t=>{r._gantt.eventManager.isDown=!0})),r.scrollbarComponent.vScrollBar.addEventListener("pointerup",(()=>{r._gantt.eventManager.isDraging=!1,o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.vScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.vScrollBar.addEventListener("scrollUp",(t=>{r._gantt.eventManager.isDraging=!1})),r.scrollbarComponent.hScrollBar.addEventListener("pointermove",(t=>{t.stopPropagation()})),r.scrollbarComponent.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation()})),r.scrollbarComponent.hScrollBar.addEventListener("scrollDown",(t=>{r._gantt.eventManager.isDown=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling)})),r.scrollbarComponent.hScrollBar.addEventListener("pointerup",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.hScrollBar.addEventListener("pointerupoutside",(()=>{o.interactionState===e.scrolling&&o.updateInteractionState(e.default)})),r.scrollbarComponent.hScrollBar.addEventListener("scrollUp",(t=>{r._gantt.eventManager.isDraging=!1}));const n=Zf(o.updateVerticalScrollBar,20),s=Zf(o.updateHorizontalScrollBar,20);r.scrollbarComponent.vScrollBar.addEventListener("scrollDrag",(t=>{r._gantt.eventManager.isDown&&(r._gantt.eventManager.isDraging=!0),o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(i,t)})),r.scrollbarComponent.hScrollBar.addEventListener("scrollDrag",(t=>{r._gantt.eventManager.isDown&&(r._gantt.eventManager.isDraging=!0),o.fastScrolling=!0,o.interactionState!==e.scrolling&&o.updateInteractionState(e.scrolling);const i=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);s(i)}))}(this._gantt.eventManager)}refreshAll(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.timelineHeader.refresh(),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}refreshTaskBars(){this.taskBar.refresh(),this.updateNextFrame()}refreshTaskBarsAndGrid(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttribute("height",this.tableGroupHeight),this.grid.refresh(),this.taskBar.refresh(),this.markLine.refresh(),this.frameBorder.resize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}updateTableSize(){this.tableGroupHeight=Math.min(this._gantt.tableNoFrameHeight,this._gantt.drawHeight),this.tableGroup.setAttributes({x:this._gantt.tableX,y:this._gantt.tableY,width:this._gantt.tableNoFrameWidth,height:this.tableGroupHeight}),this.grid.resize(),this.taskBar.resize(),this.frameBorder.resize()}renderSceneGraph(){this.stage.render()}updateNextFrame(){this.stage.renderNextFrame()}get width(){return this.tableGroup.attribute?.width??0}get height(){return this.tableGroup.attribute?.height??0}get x(){return this.tableGroup.attribute?.x??0}get y(){return this.tableGroup.attribute?.y??0}setX(t,e=!1){this.timelineHeader.setX(t),this.grid.setX(t),this.taskBar.setX(t),this.markLine.setX(t),this.updateNextFrame()}setY(t,e=!1){this.grid.setY(t),this.taskBar.setY(t),this.updateNextFrame()}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}resize(){this.updateTableSize(),this.scrollbarComponent.updateScrollBar(),this.updateNextFrame()}release(){this.stage.release()}getTaskBarNodeByY(t){hv(t,this._gantt)}}(this),this.stateManager=new nA(this),this.eventManager=new iA(this),this.scenegraph.afterCreateSceneGraph(),this._scrollToMarkLine()}renderTaskBarsTable(){this.scenegraph.updateNextFrame()}_updateSize(){let t=0,e=0;if("browser"===Kf.mode){const i=this.getElement();let o=0,r=0;if(i.parentElement){const t=i.parentElement.style||window.getComputedStyle(i.parentElement);o=i.parentElement.offsetWidth-parseInt(t.paddingLeft||"0px",10)-parseInt(t.paddingRight||"0px",10),r=i.parentElement.offsetHeight-parseInt(t.paddingTop||"0px",10)-parseInt(t.paddingBottom||"0px",20)}const n=(o??1)-1-this.taskTableWidth,s=(r??1)-1;i.style.width=n&&`${n}px`||"0px",i.style.height=s&&`${s}px`||"0px";const{canvas:a}=this;t=a.parentElement?.offsetWidth??1,e=a.parentElement?.offsetHeight??1,this?.scenegraph?.stage?this.scenegraph.stage.resize(t,e):(a.style.width="",a.style.height="",a.width=t,a.height=e,a.style.width=`${t}px`,a.style.height=`${e}px`)}const i=Math.floor(t-(o=this.parsedOptions.scrollStyle,o?.hoverOn||o?.verticalVisible&&"none"===o?.verticalVisible||!o?.verticalVisible&&"none"===o?.visible?0:o?.width??7));var o;const r=Math.floor(e-function(t){return t?.hoverOn||t?.horizontalVisible&&"none"===t?.horizontalVisible||!t?.horizontalVisible&&"none"===t?.visible?0:t?.width??7}(this.parsedOptions.scrollStyle));if(this.tableNoFrameWidth=t,this.tableNoFrameHeight=Math.floor(e),this.parsedOptions.outerFrameStyle){const t=this.parsedOptions.outerFrameStyle?.borderLineWidth;this.tableX=this.taskListTableInstance?this.parsedOptions.verticalSplitLine.lineWidth??0:t,this.tableY=t,this.tableNoFrameWidth=i-t-this.parsedOptions.verticalSplitLine.lineWidth,this.tableNoFrameHeight=r-2*t}}_generateListTable(){if(this.taskTableColumns.length>=1||this.options?.rowSeriesNumber){const t=this._generateListTableOptions();if(this.taskListTableInstance=new $_(this.container,t),"auto"!==this.options?.taskListTable?.tableWidth&&-1!==this.taskTableWidth||(this.taskTableWidth=this.taskListTableInstance.getAllColsWidth()+this.parsedOptions.outerFrameStyle.borderLineWidth,this.options?.taskListTable?.maxTableWidth&&(this.taskTableWidth=Math.min(this.options?.taskListTable?.maxTableWidth,this.taskTableWidth)),this.options?.taskListTable?.minTableWidth&&(this.taskTableWidth=Math.max(this.options?.taskListTable?.minTableWidth,this.taskTableWidth)),this.element.style.left=this.taskTableWidth?`${this.taskTableWidth}px`:"0px",this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._updateSize()),this.taskListTableInstance.columnHeaderLevelCount>1)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}}_generateListTableOptions(){const t={},e=["container","records","rowSeriesNumber","overscrollBehavior","pixelRatio"];for(const i in this.options)e.indexOf(i)>=0&&(t[i]=this.options[i]);for(const e in this.options.taskListTable)t[e]=this.options.taskListTable[e],"columns"===e&&(t[e][t[e].length-1].disableColumnResize=!0);if(this.options.taskListTable?.theme)if(t.theme=this.options.taskListTable?.theme,t.theme.bodyStyle&&!function(t,e){const i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set&&!0!==i.writable)}(t.theme,"bodyStyle")){const e=t.theme.getExtendTheme();t.theme.headerStyle?.bgColor||(e.headerStyle?e.headerStyle.bgColor||(e.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):e.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor}),e.cellInnerBorder=!1,e.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{shadowBlur:0,cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),e.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),e.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},e?.columnResize)}else t.theme.headerStyle?t.theme.headerStyle.bgColor||(t.theme.headerStyle.bgColor=this.parsedOptions.timelineHeaderBackgroundColor):t.theme.headerStyle={bgColor:this.parsedOptions.timelineHeaderBackgroundColor},t.theme.cellInnerBorder=!1,t.theme.frameStyle=Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),t.theme.scrollStyle=Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),t.theme.columnResize=Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize);else t.theme={scrollStyle:Object.assign({},this.options.taskListTable?.theme?.scrollStyle,this.parsedOptions.scrollStyle,{verticalVisible:"none"}),headerStyle:Object.assign({},om.headerStyle,{bgColor:this.parsedOptions.timelineHeaderBackgroundColor},this.options.taskListTable?.theme?.headerStyle),bodyStyle:Object.assign({},om.bodyStyle,this.options.taskListTable?.theme?.bodyStyle),cellInnerBorder:!1,frameStyle:Object.assign({},this.parsedOptions.outerFrameStyle,{cornerRadius:[this.parsedOptions.outerFrameStyle?.cornerRadius??0,0,0,this.parsedOptions.outerFrameStyle?.cornerRadius??0],borderLineWidth:[this.parsedOptions.outerFrameStyle?.borderLineWidth??0,0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0,this.parsedOptions.outerFrameStyle?.borderLineWidth??0]}),columnResize:Object.assign({labelColor:"rgba(0,0,0,0)",labelBackgroundFill:"rgba(0,0,0,0)"},this.options.taskListTable?.theme?.columnResize)};return t.canvasWidth=this.taskTableWidth,t.canvasHeight=this.canvas.height,t.defaultHeaderRowHeight=this.getAllHeaderRowsHeight(),t.defaultRowHeight=this.parsedOptions.rowHeight,t.clearDOM=!1,t}getElement(){return this.element}getContainer(){return this.element.parentElement}_sortScales(){const{timelineHeader:t}=this.options;if(t){const e=t.scales,i=["year","quarter","month","week","day"],o=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),r=i.indexOf(e.unit);return-1===o?1:-1===r?-1:o-r})),r=e.slice().sort(((t,e)=>{const o=i.indexOf(t.unit),r=i.indexOf(e.unit);return-1===o?1:-1===r?-1:r-o}));this.parsedOptions.sortedTimelineScales=o,this.parsedOptions.reverseSortedTimelineScales=r}}_generateTimeLineDateMap(){const t=nv(this.parsedOptions.minDate),e=nv(this.parsedOptions.maxDate);let i=1e6;for(const i of this.parsedOptions.reverseSortedTimelineScales){const o=nv(t);i.timelineDates=cv(o,e,i)}const o=this.parsedOptions.reverseSortedTimelineScales[0],{unit:r,step:n}=o;"day"===r?i=n:"month"===r?i=30:"week"===r?i=7:"quarter"===r?i=90:"year"===r&&(i=365),this.parsedOptions.colWidthPerDay=this.parsedOptions.timelineColWidth/i}getAllRowsHeight(){return this.getAllHeaderRowsHeight()+this.itemCount*this.parsedOptions.rowHeight}getAllHeaderRowsHeight(){return this.parsedOptions.timeLineHeaderRowHeights.reduce(((t,e,i)=>t+e),0)}_getAllColsWidth(){return this.parsedOptions.colWidthPerDay*(Math.ceil(Math.abs(nv(this.parsedOptions.maxDate).getTime()-nv(this.parsedOptions.minDate).getTime())/864e5)+1)}getAllTaskBarsHeight(){return this.itemCount*this.parsedOptions.rowHeight}getRecordByIndex(t){return this.taskListTableInstance?this.taskListTableInstance.getRecordByRowCol(0,t+this.taskListTableInstance.columnHeaderLevelCount):this.records[t]}_refreshTaskBar(t){this.scenegraph.taskBar.updateTaskBarNode(t),this.scenegraph.updateNextFrame()}_updateRecordToListTable(t,e){this.taskListTableInstance.updateRecords([t],[e])}getTaskInfoByTaskListIndex(t){const e=this.getRecordByIndex(t),i=this.parsedOptions.startDateField,o=this.parsedOptions.endDateField,r=this.parsedOptions.progressField,n=nv(e[i]).getTime(),s=nv(e[o]).getTime();if(s<this.parsedOptions._minDateTime||n>this.parsedOptions._maxDateTime)return{taskDays:0,progress:0,startDate:null,endDate:null,taskRecord:e};const a=nv(Math.min(Math.max(this.parsedOptions._minDateTime,n),this.parsedOptions._maxDateTime)),l=nv(Math.max(Math.min(this.parsedOptions._maxDateTime,s),this.parsedOptions._minDateTime)),h=function(t){return"string"==typeof t&&(t=t.replace("%",""),t=parseFloat(t)),t<=1&&(t*=100),Math.round(t)}(e[r]);return{taskRecord:e,taskDays:Math.ceil(Math.abs(l.getTime()-a.getTime())/864e5)+1,startDate:a,endDate:l,progress:h}}_updateDateToTaskRecord(t,e,i){const o=this.getRecordByIndex(i),r=this.parsedOptions.startDateField,n=this.parsedOptions.endDateField,s=function(t){const e=["yyyy-mm-dd","dd-mm-yyyy","mm/dd/yyyy","yyyy/mm/dd","dd/mm/yyyy","yyyy.mm.dd","dd.mm.yyyy","mm.dd.yyyy"];t=t.replace(/\s+/g,"");for(let i=0;i<e.length;i++){const o=e[i],r=t.split(ev(o)),n=Qf(r,o);if(3===r.length&&n)return o}return null}(o[r]),a=nv(o[r]),l=nv(o[n]);if("move"===t){const t=Jf(nv(e*lv+a.getTime()),s),i=Jf(nv(e*lv+l.getTime()),s);o[r]=t,o[n]=i}else if("start-move"===t){const t=Jf(nv(e*lv+a.getTime()),s);o[r]=t}else if("end-move"===t){const t=Jf(nv(e*lv+l.getTime()),s);o[n]=t}this._updateRecordToListTable(o,i)}updateTaskRecord(t,e){this._updateRecordToListTable(t,e),this._refreshTaskBar(e)}setPixelRatio(t){this.taskListTableInstance?.setPixelRatio(t),this.parsedOptions.pixelRatio=t,this.scenegraph.setPixelRatio(t)}_resize(){this._updateSize(),this.taskListTableInstance.setCanvasSize(this.taskTableWidth,this.tableNoFrameHeight+2*this.parsedOptions.outerFrameStyle.borderLineWidth),this._syncPropsFromTable(),this.scenegraph.resize(),gv(this)}_syncPropsFromTable(){this.itemCount=this.taskListTableInstance?this.taskListTableInstance.rowCount-this.taskListTableInstance.columnHeaderLevelCount:this.records.length,this.headerHeight=this.getAllHeaderRowsHeight(),this.drawHeight=Math.min(this.headerHeight+this.parsedOptions.rowHeight*this.itemCount,this.tableNoFrameHeight),this.gridHeight=this.drawHeight-this.headerHeight}getContext(){return this.context}release(){super.release?.(),this.eventManager.release(),this.taskListTableInstance?.release();const{parentElement:t}=this.element;t&&(t.removeChild(this.element),this.verticalSplitResizeLine&&t.removeChild(this.verticalSplitResizeLine),this.horizontalSplitLine&&t.removeChild(this.horizontalSplitLine)),this.scenegraph=null}setRecords(t){this.records=t,this.taskListTableInstance.setRecords(t),this._syncPropsFromTable(),this.verticalSplitResizeLine.style.height=this.drawHeight+"px",this.scenegraph.refreshTaskBarsAndGrid();const e=this.stateManager.scroll.horizontalBarPos,i=this.stateManager.scroll.verticalBarPos;this.scenegraph.setX(-e),this.scenegraph.setY(-i)}updateScales(t){if(this.options.timelineHeader.scales=t,this._sortScales(),dv(this),this._generateTimeLineDateMap(),this.timeLineHeaderLevel=this.parsedOptions.sortedTimelineScales.length,this.scenegraph.refreshAll(),gv(this),this.taskListTableInstance)if(this.taskListTableInstance.columnHeaderLevelCount===this.parsedOptions.timeLineHeaderRowHeights.length)for(let t=0;t<this.taskListTableInstance.columnHeaderLevelCount;t++)this.taskListTableInstance.setRowHeight(t,this.parsedOptions.timeLineHeaderRowHeights[t]);else{const t=this.getAllHeaderRowsHeight()/this.taskListTableInstance.columnHeaderLevelCount;for(let e=0;e<this.taskListTableInstance.columnHeaderLevelCount;e++)this.taskListTableInstance.setRowHeight(e,t)}}_scrollToMarkLine(){if(this.parsedOptions.scrollToMarkLineDate){const t=this.parsedOptions.minDate,e=(this.parsedOptions.scrollToMarkLineDate.getTime()-t.getTime())/864e5*this.parsedOptions.colWidthPerDay-this.tableNoFrameWidth/2;this.stateManager.setScrollLeft(e)}}},t.TYPES=o,t.tools=dA,t.version="1.7.4"}));